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

:root {
  --bg: #0f0f11;
  --surface: #18181c;
  --border: #2a2a30;
  --border-hover: #444;
  --text: #e8e8ec;
  --muted: #666;
  --accent: #c8f060;
  --accent-dim: rgba(200, 240, 96, 0.12);
  --warm: #ffb347;
  --quick: #60c8f0;
  --curious: #c060f0;
  --warm-dim: rgba(255, 179, 71, 0.1);
  --quick-dim: rgba(96, 200, 240, 0.1);
  --curious-dim: rgba(192, 96, 240, 0.1);
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 80px;
}

header {
  text-align: center;
  margin-bottom: 48px;
}

.logo {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

h1 {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--text);
}

h1 span { font-weight: 600; }

.subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 14px 16px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}

textarea:focus { border-color: var(--border-hover); }
textarea::placeholder { color: var(--muted); }

.persona-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.persona-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.persona-field label { margin-bottom: 0; }

input[type="text"] {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

input[type="text"]:focus { border-color: var(--border-hover); }

.generate-btn {
  width: 100%;
  max-width: 560px;
  padding: 15px;
  background: var(--accent);
  color: #0f0f11;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-bottom: 24px;
}

.generate-btn:hover { opacity: 0.88; }
.generate-btn:active { transform: scale(0.99); }
.generate-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.drafts-section {
  width: 100%;
  max-width: 560px;
  display: none;
}

.drafts-section.visible { display: block; }

.drafts-label {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.draft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.draft-card:hover { border-color: var(--border-hover); }

.draft-card.warm:hover,
.draft-card.warm.selected { border-color: var(--warm); background: var(--warm-dim); }
.draft-card.quick:hover,
.draft-card.quick.selected { border-color: var(--quick); background: var(--quick-dim); }
.draft-card.curious:hover,
.draft-card.curious.selected { border-color: var(--curious); background: var(--curious-dim); }

.draft-type {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}

.warm .draft-type { color: var(--warm); }
.quick .draft-type { color: var(--quick); }
.curious .draft-type { color: var(--curious); }

.draft-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}

.draft-check {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s;
}

.draft-card.selected .draft-check {
  border-color: currentColor;
  background: currentColor;
  color: #0f0f11;
}

.warm.selected .draft-check { border-color: var(--warm); background: var(--warm); }
.quick.selected .draft-check { border-color: var(--quick); background: var(--quick); }
.curious.selected .draft-check { border-color: var(--curious); background: var(--curious); }

.action-row {
  display: none;
  gap: 10px;
  margin-top: 16px;
}

.action-row.visible { display: flex; }

.edit-btn {
  flex: 1;
  padding: 13px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.edit-btn:hover { border-color: var(--border-hover); }

.send-btn {
  flex: 2;
  padding: 13px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #0f0f11;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.send-btn:hover { opacity: 0.88; }

.edit-area-wrap {
  display: none;
  margin-top: 12px;
}

.edit-area-wrap.visible { display: block; }

.edit-area-wrap textarea {
  border-color: var(--border-hover);
  min-height: 80px;
}

.confirm-send-btn {
  margin-top: 10px;
  width: 100%;
  padding: 13px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #0f0f11;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.confirm-send-btn:hover { opacity: 0.88; }

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: #0f0f11;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #0f0f11;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #333 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px;
  height: 16px;
}

@keyframes shimmer { to { background-position: -200% 0; } }
