* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  background: #f5f5f0;
  color: #222;
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

main {
  width: 100%;
  max-width: 760px;
  min-width: 0;
}

h1 {
  color: #000;
  font-size: clamp(48px, 12vw, 96px);
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 0.9;
}

.subtitle {
  color: #999;
  font-size: 16px;
  margin-top: 8px;
  margin-bottom: 40px;
  letter-spacing: 2px;
}

.editor {
  border: 3px solid #000;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

textarea {
  display: block;
  width: 100%;
  min-height: 260px;
  background: transparent;
  color: #222;
  border: none;
  padding: 20px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  outline: none;
}

textarea::placeholder {
  color: #ccc;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  border-top: 2px solid #eee;
  gap: 10px;
}

.toolbar .left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

select {
  background: #fff;
  color: #222;
  border: 2px solid #ddd;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

select:hover {
  border-color: #000;
}

.token-count {
  color: #bbb;
  font-size: 13px;
  white-space: nowrap;
}

#submit {
  background: #000;
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

#submit:hover {
  background: #333;
}

#submit:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}

kbd {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
}

.result {
  margin-top: 28px;
  border: 3px solid #000;
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  overflow: hidden;
}

.result.hidden {
  display: none;
}

.url-row {
  margin-bottom: 14px;
}

.url-row label {
  display: block;
  color: #999;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.url-box {
  display: flex;
  gap: 8px;
}

.url-box input {
  flex: 1;
  min-width: 0;
  background: #f5f5f0;
  color: #000;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  background: #f5f5f0;
  color: #222;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  border-color: #000;
  color: #000;
  background: #f5f5f0;
}

.meta-row {
  color: #bbb;
  font-size: 12px;
  margin-top: 6px;
  word-break: break-word;
}

.qr-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid #eee;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-row canvas,
.qr-row img {
  border-radius: 8px;
}

.qr-hint {
  color: #bbb;
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  body {
    padding: 24px 10px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 20px;
  }

  textarea {
    min-height: 160px;
    padding: 14px;
    font-size: 14px;
  }

  .toolbar {
    flex-direction: column;
    padding: 10px 14px;
  }

  .toolbar .left {
    width: 100%;
    justify-content: space-between;
  }

  #submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
  }

  kbd {
    display: none;
  }

  .result {
    padding: 12px;
  }

  .url-box input {
    font-size: 11px;
    padding: 8px;
  }

  .copy-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}
