:root {
  --bg:           #0f0f1a;
  --surface:      #1a1a2e;
  --surface2:     #252542;
  --border:       rgba(255, 255, 255, 0.09);
  --text:         #e2e8f0;
  --text-dim:     #8899aa;
  --radius:       12px;
  --accent-mvp:   #4ade80;
  --accent-weird: #a78bfa;
  --accent-chaos: #fb923c;
  --accent-mvp-bg:   rgba(74, 222, 128, 0.08);
  --accent-weird-bg: rgba(167, 139, 250, 0.09);
  --accent-chaos-bg: rgba(251, 146, 60, 0.09);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px 80px;
  line-height: 1.5;
  overflow-x: hidden;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid #60a5fa; outline-offset: 3px; border-radius: 4px; }

/* ============================================================
   APP SHELL
   ============================================================ */

.app {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   HEADER
   ============================================================ */

header {
  text-align: center;
  padding: 10px 0 6px;
}

h1 {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-meta { display: none; }
.proto-badge { display: none; }

.subtitle {
  font-size: 0.84rem;
  color: var(--text-dim);
  opacity: 0.75;
  letter-spacing: 0.01em;
}

/* ============================================================
   MODE SELECTOR
   ============================================================ */

.mode-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 8px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.mode-btn:hover { border-color: rgba(255,255,255,0.28); color: var(--text); }
.mode-btn.active[data-mode="mvp"]   { border-color: var(--accent-mvp);   color: var(--accent-mvp);   background: var(--accent-mvp-bg); }
.mode-btn.active[data-mode="weird"] { border-color: var(--accent-weird); color: var(--accent-weird); background: var(--accent-weird-bg); }
.mode-btn.active[data-mode="chaos"] { border-color: var(--accent-chaos); color: var(--accent-chaos); background: var(--accent-chaos-bg); border-style: solid; }

/* Chaos: cautionary treatment when inactive */
.mode-btn[data-mode="chaos"]:not(.active) {
  color: rgba(251,146,60,0.5);
  border-color: rgba(251,146,60,0.22);
  border-style: dashed;
}
.mode-btn[data-mode="chaos"]:not(.active):hover {
  color: rgba(251,146,60,0.85);
  border-color: rgba(251,146,60,0.45);
}

.mode-desc {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  min-height: 1.3em;
  margin-top: 10px;
}

/* ============================================================
   VARIETY PRESET SELECTOR
   ============================================================ */

.variety-section { display: flex; flex-direction: column; gap: 10px; }

.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.preset-btn:hover { border-color: rgba(255,255,255,0.25); color: var(--text); }
.preset-btn.active {
  border-color: #60a5fa;
  color: #93c5fd;
  background: rgba(96,165,250,0.12);
}
.preset-custom { font-style: italic; }
.preset-custom.active { border-color: #94a3b8; color: #cbd5e1; background: rgba(148,163,184,0.1); }

.variety-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  opacity: 0.6;
  min-height: 1em;
}

/* ============================================================
   PHRASE SECTION
   ============================================================ */

.phrase-box {
  background: linear-gradient(150deg, var(--surface) 0%, #1a1a35 100%);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 44px 40px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

body[data-mode="mvp"]   .phrase-box { border-color: rgba(74, 222,128,0.28); box-shadow: 0 0 48px rgba(74, 222,128,0.09), inset 0 1px 0 rgba(74,222,128,0.06); }
body[data-mode="weird"] .phrase-box { border-color: rgba(167,139,250,0.28); box-shadow: 0 0 48px rgba(167,139,250,0.09), inset 0 1px 0 rgba(167,139,250,0.06); }
body[data-mode="chaos"] .phrase-box { border-color: rgba(251,146, 60,0.28); box-shadow: 0 0 48px rgba(251,146, 60,0.09), inset 0 1px 0 rgba(251,146,60,0.06); }

.phrase-text {
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  font-weight: 700;
  line-height: 1.38;
  text-align: center;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.phrase-text.flash { animation: phraseFlash 0.22s ease-out; }

@keyframes phraseFlash {
  0%   { opacity: 0.2; transform: scale(0.97); }
  100% { opacity: 1;   transform: scale(1); }
}

.phrase-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.phrase-actions .btn-secondary {
  border-color: rgba(255,255,255,0.14);
}
.phrase-actions .btn-secondary:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
}

/* ============================================================
   BUTTONS — PRIMARY
   ============================================================ */

.btn-primary {
  padding: 14px 52px;
  border-radius: 10px;
  border: none;
  background: var(--accent-mvp);
  color: #061a10;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 12px rgba(74,222,128,0.25);
}
.btn-primary:hover  { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.97); }

body[data-mode="weird"] .btn-primary { background: var(--accent-weird); color: #120a2e; box-shadow: 0 2px 12px rgba(167,139,250,0.25); }
body[data-mode="chaos"] .btn-primary { background: var(--accent-chaos); color: #1a0800; box-shadow: 0 2px 12px rgba(251,146, 60,0.25); }

/* ============================================================
   BUTTONS — SECONDARY
   ============================================================ */

.btn-secondary {
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-secondary.small { font-size: 0.78rem; padding: 6px 14px; }

.btn-clear { color: #f87171; border-color: rgba(248,113,113,0.2); }
.btn-clear:hover { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.4); color: #fca5a5; }

/* ============================================================
   ADJUST + RATE PANELS
   ============================================================ */

#panel-adjust, #panel-rate { opacity: 0; pointer-events: none; transition: opacity 0.35s; }
#panel-adjust.revealed, #panel-rate.revealed { opacity: 1; pointer-events: auto; }

.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: block;
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-adjust {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.79rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  opacity: 0.7;
}
.btn-adjust:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
  opacity: 1;
}

.btn-rate {
  padding: 10px 22px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-rate.good  { color: #86efac;   border-color: rgba(134,239,172,0.3); }
.btn-rate.bad   { color: #f87171;   border-color: rgba(248,113,113,0.3); }
.btn-rate.fave  { color: #fbbf24;   border-color: rgba(251,191, 36,0.3); }
.btn-rate.good:hover  { background: rgba(134,239,172,0.14); border-color: #86efac; transform: scale(1.04); }
.btn-rate.bad:hover   { background: rgba(248,113,113,0.14); border-color: #f87171; transform: scale(1.04); }
.btn-rate.fave:hover  { background: rgba(251,191, 36,0.14); border-color: #fbbf24; transform: scale(1.04); }

/* Active/rated state — shows which rating the current phrase got */
.btn-rate.rated.good { background: rgba(134,239,172,0.18); border-color: #86efac; }
.btn-rate.rated.bad  { background: rgba(248,113,113,0.22); border-color: #f87171; }
.btn-rate.rated.fave { background: rgba(251,191, 36,0.22); border-color: #fbbf24; }

.rating-msg { margin-top: 10px; font-size: 0.875rem; color: var(--text-dim); min-height: 1.4em; }

.rate-log-btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ============================================================
   TESTING DASHBOARD
   ============================================================ */

/* #dashboard-section removed in Phase 7 — replaced by #stats-bar + #dev-section */

.dashboard-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 64px;
  flex: 1 1 64px;
  max-width: 100px;
}

.dash-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  text-align: center;
}

.dash-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.dashboard-norepeat {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.dash-sep { opacity: 0.35; }

.dash-tag {
  color: var(--accent-mvp);
  font-weight: 600;
}

/* ============================================================
   EVENT TRACKING PANEL
   ============================================================ */

/* #events-section removed in Phase 7 — merged into #dev-section */

#events-panel summary { list-style: none; }
#events-panel summary::-webkit-details-marker { display: none; }

.events-summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.events-summary::-webkit-details-marker { display: none; }
.events-summary:hover { color: #f1f5f9; }
.events-ls-badge {
  font-size: 0.63rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148,163,184,0.12);
  border: 1px solid rgba(148,163,184,0.2);
  color: var(--text-dim);
  font-weight: 500;
}
#events-panel[open] .packs-chevron { transform: rotate(180deg); }

.events-content {
  margin-top: 10px;
  font-size: 0.73rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.events-content b { color: var(--text); }
.events-content code { font-size: 0.69rem; background: var(--surface2); padding: 1px 4px; border-radius: 3px; }
.events-keys { margin-top: 4px; opacity: 0.7; }
.events-btns { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ============================================================
   ADVANCED PACKS
   ============================================================ */

.packs-details summary { list-style: none; }
.packs-details summary::-webkit-details-marker { display: none; }
.packs-details summary::marker { display: none; }

.packs-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  user-select: none;
}
.packs-summary:hover .section-label { color: var(--text); }

.packs-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(96,165,250,0.15);
  color: #93c5fd;
  border: 1px solid rgba(96,165,250,0.25);
  font-weight: 600;
}

.packs-chevron {
  margin-left: auto;
  font-size: 1rem;
  color: var(--text-dim);
  transition: transform 0.22s ease, color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.packs-details[open] .packs-chevron { transform: rotate(180deg); color: var(--text); }

.packs-body { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.packs-group { display: flex; flex-direction: column; gap: 8px; }

.packs-sublabel {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  opacity: 0.55;
}

.packs-grid { display: flex; gap: 8px; flex-wrap: wrap; }

.pack-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  min-width: 140px;
  flex: 1 1 140px;
  max-width: 230px;
}
.pack-btn strong { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); display: block; transition: color 0.15s; }
.pack-btn small  { font-size: 0.68rem; color: var(--text-dim); opacity: 0.55; display: block; font-weight: 400; line-height: 1.35; }
.pack-btn:hover  { border-color: rgba(255,255,255,0.22); }
.pack-btn:hover strong { color: var(--text); }
.pack-btn:hover small  { opacity: 0.75; }
.pack-btn.active { border-color: #60a5fa; background: rgba(96,165,250,0.08); }
.pack-btn.active strong { color: #93c5fd; }
.pack-btn.active small  { opacity: 0.8; }

/* ============================================================
   DEBUG PANEL
   ============================================================ */

#debug-section { border-top: 1px solid var(--border); padding-top: 12px; }

#debug-panel summary { list-style: none; }
#debug-panel summary::-webkit-details-marker { display: none; }

.debug-summary {
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.4;
  user-select: none;
  letter-spacing: 0.05em;
}
.debug-summary:hover { opacity: 0.7; }

.debug-content {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Fira Code', monospace;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.debug-content b { color: var(--text); }

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.stats-area { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }

.stats { font-size: 0.78rem; color: var(--text-dim); }

.footer-btns { display: flex; gap: 8px; flex-shrink: 0; align-self: flex-end; }

/* ============================================================
   VIRAL TAGLINE + CHALLENGE LABEL
   ============================================================ */

.viral-tagline {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  min-height: 1.3em;
  opacity: 0.65;
  margin-bottom: 10px;
  transition: opacity 0.3s;
}

.challenge-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
  text-align: center;
  min-height: 1.2em;
  letter-spacing: 0.02em;
}

/* ============================================================
   CHALLENGE STYLE SELECTOR
   ============================================================ */

#challenge-section { display: flex; flex-direction: column; gap: 10px; }

.challenge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.challenge-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.challenge-btn:hover {
  border-color: rgba(255,255,255,0.22);
  color: var(--text);
}
.challenge-btn.active {
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(251,191,36,0.09);
}

/* ============================================================
   PROMPT STYLE ROW
   ============================================================ */

.prompt-style-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
  opacity: 0.72;
  transition: opacity 0.2s;
}
.prompt-style-row:hover,
.prompt-style-row:focus-within {
  opacity: 1;
}

.prompt-style-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.style-select {
  padding: 6px 28px 6px 12px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238899aa'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.style-select:focus { border-color: rgba(96,165,250,0.5); }

.prompt-style-hint {
  font-size: 0.67rem;
  color: var(--text-dim);
  opacity: 0.5;
  flex: 1;
  min-width: 140px;
}

/* ============================================================
   SAVE ROW + SAVE BUTTON
   ============================================================ */

.save-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn-save {
  padding: 12px 28px;
  border-radius: 10px;
  border: 1.5px solid rgba(251,191,36,0.45);
  background: rgba(251,191,36,0.1);
  color: #fbbf24;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(251,191,36,0.12);
  letter-spacing: 0.01em;
}
.btn-save:hover {
  background: rgba(251,191,36,0.18);
  border-color: rgba(251,191,36,0.7);
  box-shadow: 0 4px 18px rgba(251,191,36,0.2);
  transform: scale(1.02);
}
.btn-save:active { transform: scale(0.97); }
.btn-save.rated {
  background: rgba(251,191,36,0.22);
  border-color: #fbbf24;
  box-shadow: 0 2px 14px rgba(251,191,36,0.25);
}

.btn-drawer-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(96,165,250,0.25);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.13s, border-color 0.13s, background 0.13s;
  white-space: nowrap;
}
.btn-drawer-inline:hover {
  color: #93c5fd;
  border-color: rgba(96,165,250,0.5);
  background: rgba(96,165,250,0.06);
}

.drawer-inline-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: rgba(96,165,250,0.2);
  color: #93c5fd;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

.rating-secondary-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   PUBLIC STATS BAR
   ============================================================ */

#stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.public-stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 56px;
}

.pub-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.03em;
  line-height: 1;
}

.pub-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.pub-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 8px;
  flex-shrink: 0;
}

/* ============================================================
   DEV / TESTING INFO (collapsed)
   ============================================================ */

#dev-section {
  opacity: 0.75;
  transition: opacity 0.2s;
}
#dev-section:hover, #dev-section:focus-within { opacity: 1; }

#dev-panel summary { list-style: none; }
#dev-panel summary::-webkit-details-marker { display: none; }

.dev-summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  transition: color 0.15s;
}
.dev-summary:hover { color: var(--text); }
.dev-summary:hover .packs-chevron { color: var(--text); }
#dev-panel[open] .packs-chevron { transform: rotate(180deg); color: var(--text); }

.dev-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ============================================================
   DASHBOARD HEADER ROW (legacy, kept for compat)
   ============================================================ */

.dashboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dashboard-header-row .section-label { margin-bottom: 0; }

.drawer-toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 8px;
  border: 1.5px solid rgba(96,165,250,0.35);
  background: rgba(96,165,250,0.08);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
  white-space: nowrap;
  flex-shrink: 0;
}
.drawer-toggle-btn:hover {
  border-color: rgba(96,165,250,0.6);
  background: rgba(96,165,250,0.14);
}

.drawer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #3b82f6;
  color: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

/* ============================================================
   SAVED IDEAS DRAWER
   ============================================================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-overlay.open {
  pointer-events: auto;
  opacity: 1;
}

.saved-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #12122a;
  border-left: 1px solid var(--border);
  z-index: 400;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.4,0,0.2,1), box-shadow 0.26s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.saved-drawer.open {
  transform: translateX(0);
  box-shadow: -8px 0 40px rgba(0,0,0,0.45);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title { font-size: 1rem; font-weight: 700; color: #f1f5f9; margin-bottom: 3px; }
.drawer-total-count { font-size: 0.72rem; color: var(--text-dim); }

.drawer-close-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.14s;
}
.drawer-close-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.drawer-tab {
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.13s;
  white-space: nowrap;
}
.drawer-tab:hover { color: var(--text); background: var(--surface2); }
.drawer-tab.active {
  background: var(--surface2);
  border-color: rgba(96,165,250,0.3);
  color: #93c5fd;
  font-weight: 600;
}

.drawer-search-row {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-search {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
}
.drawer-search:focus { border-color: rgba(96,165,250,0.5); }
.drawer-search::placeholder { color: var(--text-dim); opacity: 0.45; }

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.5;
  opacity: 0.7;
}

.drawer-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-export-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.drawer-storage-note {
  font-size: 0.68rem;
  color: var(--text-dim);
  opacity: 0.55;
  text-align: center;
}
.drawer-storage-note code {
  font-size: 0.67rem;
  background: var(--surface2);
  padding: 1px 4px;
  border-radius: 3px;
}

#drawer-clear-all {
  width: 100%;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.drawer-confirm-row {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-confirm-msg {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.drawer-confirm-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   SAVED IDEA CARDS
   ============================================================ */

.saved-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.14s;
  flex-shrink: 0;
}
.saved-card:hover { border-color: rgba(255,255,255,0.14); }

.saved-card-text {
  font-size: 0.87rem;
  font-weight: 500;
  color: #f1f5f9;
  line-height: 1.4;
}

.saved-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.saved-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.saved-badge.favorite { background: rgba(251,191,36,0.14); color: #fbbf24; border: 1px solid rgba(251,191,36,0.28); }
.saved-badge.good     { background: rgba(74,222,128,0.12); color: var(--accent-mvp); border: 1px solid rgba(74,222,128,0.24); }
.saved-badge.bad      { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.24); }

.saved-mode {
  font-size: 0.62rem;
  color: var(--text-dim);
  background: var(--surface);
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.saved-style { font-size: 0.66rem; color: #fbbf24; opacity: 0.85; }
.saved-time  { font-size: 0.63rem; color: var(--text-dim); margin-left: auto; }

.saved-card-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.saved-delete-btn {
  opacity: 0.38;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.saved-delete-btn:hover {
  opacity: 1;
}

/* ============================================================
   TOAST
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 0.85rem;
  color: var(--text);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  animation: toastIn 0.2s ease-out;
}
.toast.success { border-color: rgba(74,222,128,0.5);  color: var(--accent-mvp); }
.toast.error   { border-color: rgba(248,113,113,0.5); color: #f87171; }
.toast.info    { border-color: rgba(96,165,250,0.4);  color: #93c5fd; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   FALLBACK MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.72rem;
}
.modal-textarea {
  flex: 1;
  padding: 14px 20px;
  background: var(--bg);
  color: var(--text-dim);
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 0.7rem;
  border: none;
  outline: none;
  resize: none;
  overflow: auto;
  min-height: 200px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.modal-copy-btn { font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
  .phrase-box  { padding: 36px 22px 28px; min-height: 150px; }
  .phrase-text { font-size: 1.35rem; }
  .btn-primary { padding: 13px 40px; font-size: 1rem; }
  .btn-row     { gap: 6px; }
  .btn-adjust  { font-size: 0.78rem; padding: 7px 12px; }
  .btn-rate    { padding: 9px 16px;  font-size: 0.82rem; }
  .btn-save    { padding: 11px 22px; font-size: 0.95rem; }
  .pack-btn    { min-width: 120px; flex: 1 1 120px; }
  .prompt-style-hint { display: none; }
  .pub-sep     { display: none; }
  .public-stats-row { gap: 14px; }

  /* Drawer full-width on narrow screens */
  .saved-drawer { width: 100vw; }
  .drawer-toggle-btn { padding: 6px 10px; font-size: 0.76rem; }

  /* Secondary actions: 2-column grid on mobile */
  .secondary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .btn-action { font-size: 0.78rem; padding: 9px 6px; }
  .tertiary-actions { gap: 10px; font-size: 0.74rem; }
}

/* ============================================================
   PHASE 8A — PUBLIC UI SIMPLIFICATION
   ============================================================ */

/* Primary action — centered, dominant */
.primary-action {
  display: flex;
  justify-content: center;
  margin: 0;
}

/* Secondary actions — 4-button grid */
.secondary-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: -10px;
}

/* Action buttons — consistent height/radius */
.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
  white-space: nowrap;
  min-height: 44px;
}
.btn-action:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
}

/* Favorite */
.btn-action.fave-btn {
  border-color: rgba(251,191,36,0.4);
  color: #fbbf24;
  background: rgba(251,191,36,0.08);
}
.btn-action.fave-btn:hover {
  background: rgba(251,191,36,0.16);
  border-color: rgba(251,191,36,0.65);
}
.btn-action.fave-btn.rated {
  background: rgba(251,191,36,0.22);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251,191,36,0.18);
}

/* Create this image */
.btn-action.create-btn {
  border-color: rgba(167,139,250,0.38);
  color: #c4b5fd;
  background: rgba(167,139,250,0.07);
}
.btn-action.create-btn:hover {
  background: rgba(167,139,250,0.16);
  border-color: rgba(167,139,250,0.6);
}

/* Library */
.btn-action.library-btn {
  border-color: rgba(96,165,250,0.28);
  color: var(--text-dim);
}
.btn-action.library-btn:hover {
  color: #93c5fd;
  border-color: rgba(96,165,250,0.52);
  background: rgba(96,165,250,0.08);
}

/* Tertiary actions — small text row below secondary buttons */
.tertiary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -14px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.tertiary-actions:hover { opacity: 1; }

.btn-link-small {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.btn-link-small:hover { color: var(--text); }

.action-sep {
  color: var(--text-dim);
  opacity: 0.4;
  font-size: 0.78rem;
  user-select: none;
}

.coming-soon-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.65;
  font-style: italic;
  user-select: none;
}

/* Prompt style area — small, secondary */
.prompt-style-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 0.65;
  transition: opacity 0.2s;
  padding: 2px 0;
  margin-top: -6px;
}
.prompt-style-area:hover,
.prompt-style-area:focus-within { opacity: 1; }

/* ============================================================
   ADVANCED OPTIONS (collapsed)
   ============================================================ */

.adv-details summary { list-style: none; }
.adv-details summary::-webkit-details-marker { display: none; }
.adv-details summary::marker { display: none; }

.adv-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  user-select: none;
  border-radius: 6px;
  transition: color 0.15s;
}
.adv-summary:hover { color: var(--text); }
.adv-summary:hover .packs-chevron { color: var(--text); }
.adv-details[open] .packs-chevron { transform: rotate(180deg); color: var(--text); }

.adv-badge {
  display: inline-block;
  font-size: 0.63rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(96,165,250,0.15);
  color: #93c5fd;
  border: 1px solid rgba(96,165,250,0.25);
  font-weight: 600;
}

.adv-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.adv-group { display: flex; flex-direction: column; gap: 8px; }

.adv-sublabel {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  opacity: 0.65;
}

.adv-note {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.71rem;
  color: var(--accent-mvp);
  opacity: 0.9;
  margin-left: 6px;
  font-weight: 500;
}

/* ============================================================
   RESEARCH MODE (collapsed)
   ============================================================ */

.research-details summary { list-style: none; }
.research-details summary::-webkit-details-marker { display: none; }
.research-details summary::marker { display: none; }

.research-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  user-select: none;
  border-radius: 6px;
  transition: color 0.15s;
}
.research-summary:hover { color: var(--text); }
.research-summary:hover .packs-chevron { color: var(--text); }
.research-details[open] .packs-chevron { transform: rotate(180deg); color: var(--text); }

.research-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Always show panels inside research body (override the opacity-0 default) */
.research-body #panel-adjust,
.research-body #panel-rate {
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

.research-note {
  font-size: 0.74rem;
  color: var(--text-dim);
  opacity: 0.6;
  line-height: 1.5;
}

/* ============================================================
   FOOTER — MINIMAL
   ============================================================ */

.footer-minimal {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  opacity: 0.4;
  transition: opacity 0.2s;
}
.footer-minimal:hover { opacity: 0.75; }

/* ============================================================
   PHASE 8E — PART F: SPACING & SYMMETRY POLISH
   ============================================================ */

/* Advanced + Research: visually secondary when closed */
.adv-details,
.research-details {
  opacity: 0.82;
  transition: opacity 0.2s;
}
.adv-details:hover,
.adv-details:focus-within,
.adv-details[open],
.research-details:hover,
.research-details:focus-within,
.research-details[open] { opacity: 1; }

/* Mobile: tighten tertiary less aggressively on narrow screens */
@media (max-width: 480px) {
  /* Issue 1: desktop .secondary-actions rule (repeat(4,1fr)) lives below the first
     media block, so it wins there. This block is after the desktop rule → overrides. */
  .secondary-actions {
    grid-template-columns: 1fr 1fr;
    margin-top: -8px;
  }
  .tertiary-actions   { margin-top: -10px; }
  .prompt-style-area  { margin-top: -4px; }

  /* Issue 2: drawer tabs — reduce padding/font so all 4 tabs fit without scrolling */
  .drawer-tabs {
    gap: 3px;
    padding: 6px 8px;
  }
  .drawer-tab {
    padding: 5px 8px;
    font-size: 0.72rem;
  }
}

/* ============================================================
   NAMES & TITLES MODE
   ============================================================ */

/* Generator type switch — top-level toggle */
.generator-switch {
  display: flex;
  gap: 8px;
}
.gen-switch-btn {
  flex: 1;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-align: center;
}
.gen-switch-btn:hover:not(.active) {
  border-color: rgba(255,255,255,0.25);
  color: var(--text);
}
.gen-switch-btn.active {
  border-color: var(--accent-weird);
  color: var(--accent-weird);
  background: var(--accent-weird-bg);
}
/* Active prompt button uses green accent */
.gen-switch-btn.active[data-gen="prompt"] {
  border-color: var(--accent-mvp);
  color: var(--accent-mvp);
  background: var(--accent-mvp-bg);
}

/* Name category buttons */
.name-category-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.name-cat-btn {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.name-cat-btn:hover:not(.active) {
  border-color: rgba(255,255,255,0.25);
  color: var(--text);
}
.name-cat-btn.active {
  border-color: var(--accent-weird);
  color: var(--accent-weird);
  background: var(--accent-weird-bg);
}

/* Drawer kind filter */
.drawer-kind-row {
  padding: 0 16px 8px;
}
.drawer-kind-filter {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
}
.drawer-kind-filter:focus {
  border-color: var(--accent-weird);
  outline: none;
}

/* Saved card — kind/category badge for name entries */
.saved-kind {
  font-size: 0.78rem;
  color: var(--accent-weird);
  font-weight: 500;
}

/* Word-count option row inside name controls */
.name-options-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.name-option-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.name-option-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  min-width: 130px;
}
.name-option-select:focus {
  border-color: var(--accent-weird);
  outline: none;
}
.name-count-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.7;
  margin: 0;
}
@media (max-width: 480px) {
  .name-options-row { gap: 8px; }
  .name-option-select { min-width: 110px; }
}

/* ============================================================
   HOMEPAGE — dev-panel log buttons + footer generator links
   ============================================================ */

.dev-log-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.site-footer.footer-generators,
.footer-generators {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}
.footer-generators-label { color: var(--text-dim); opacity: 0.7; }
.footer-generators a { color: var(--accent-weird); text-decoration: none; }
.footer-generators a:hover { text-decoration: underline; }
.footer-sep { color: var(--text-dim); opacity: 0.5; }

/* ============================================================
   SEO LANDING PAGES (loaded by seo-page.js; no app.js)
   Reuses the global tokens; body centering from the base styles applies.
   ============================================================ */

.seo-page {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

.seo-hero { text-align: center; display: flex; flex-direction: column; gap: 12px; }
.seo-hero h1 {
  font-size: clamp(1.7rem, 5.5vw, 2.3rem);
}
.seo-intro {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto;
}

/* Tool block */
.seo-tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.seo-tool-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.seo-tool-controls label { font-size: 0.85rem; color: var(--text-dim); }
.seo-wordcount,
#seo-wordcount {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
}
#seo-wordcount:focus { border-color: var(--accent-weird); outline: none; }

.seo-body .btn-primary {
  background: var(--accent-weird);
  color: #120a2e;
  box-shadow: 0 2px 12px rgba(167,139,250,0.25);
  padding: 13px 36px;
  font-size: 1rem;
}

.seo-tool-status {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
  min-height: 1.2em;
  margin: 0;
}

.seo-results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.seo-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.seo-result-name { font-size: 1rem; font-weight: 600; color: #f1f5f9; }
.seo-result-actions { display: flex; gap: 6px; flex-shrink: 0; }
.seo-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.76rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.seo-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.seo-fav.is-fav {
  border-color: var(--accent-weird);
  color: var(--accent-weird);
  background: rgba(167,139,250,0.12);
}

/* Content sections */
.seo-section { display: flex; flex-direction: column; gap: 12px; }
.seo-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}
.seo-section h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 6px;
}
.seo-section p { font-size: 0.92rem; color: var(--text-dim); }
.seo-section ul { padding-left: 22px; display: flex; flex-direction: column; gap: 5px; }
.seo-section li { font-size: 0.9rem; color: var(--text-dim); }

/* Static example groups */
.seo-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.seo-example-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.seo-example-group h3 { margin-bottom: 8px; color: var(--accent-weird); }
.seo-example-group ul { list-style: none; padding: 0; gap: 4px; }
.seo-example-group li { color: var(--text); font-size: 0.88rem; }

/* Related generators */
.seo-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.seo-related-links a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.84rem;
}
.seo-related-links a:hover { border-color: var(--accent-weird); color: var(--accent-weird); }

/* FAQ */
.seo-faq details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--surface);
}
.seo-faq details + details { margin-top: 8px; }
.seo-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}
.seo-faq details[open] summary { color: var(--accent-weird); margin-bottom: 8px; }
.seo-faq summary::-webkit-details-marker { color: var(--text-dim); }

/* Disclaimer */
.seo-disclaimer {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-chaos);
  border-radius: 8px;
  padding: 12px 14px;
}

/* Page footer for landing pages */
.seo-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.seo-footer a { color: var(--text-dim); text-decoration: none; }
.seo-footer a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 480px) {
  .seo-result { flex-direction: column; align-items: stretch; }
  .seo-result-actions { justify-content: flex-end; }
}

/* ============================================================
   SEO LANDING PAGE — VISUAL POLISH
   Extends/overrides the .seo-* base above. Homepage unaffected.
   ============================================================ */

/* Tool block: purple-accent tint so it reads as the focal point */
.seo-tool {
  border-color: rgba(167,139,250,0.25);
  box-shadow: 0 0 40px rgba(167,139,250,0.07), inset 0 1px 0 rgba(167,139,250,0.05);
  padding: 28px 24px 22px;
  gap: 20px;
}

/* Generate button: wider, more commanding */
.seo-body .btn-primary {
  min-width: 210px;
  padding: 13px 44px;
}

/* Status line: slightly larger when filled */
.seo-tool-status {
  opacity: 0.9;
}

/* Library hint — small, always-on affordance */
.seo-library-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  opacity: 0.6;
  line-height: 1.45;
  margin-top: -4px;
}
.seo-library-hint a {
  color: var(--accent-weird);
  text-decoration: none;
}
.seo-library-hint a:hover { text-decoration: underline; opacity: 1; }

/* Result rows: hover glow, comfortable padding */
.seo-result {
  padding: 13px 16px;
  border-radius: 10px;
  transition: border-color 0.14s, background 0.14s;
}
.seo-result:hover {
  border-color: rgba(167,139,250,0.32);
  background: rgba(167,139,250,0.04);
}

/* Name text: slightly more legible */
.seo-result-name { font-size: 1.05rem; }

/* All action buttons: ensure tap-target floor */
.seo-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Copy: purple tint on hover */
.seo-copy:hover {
  color: var(--accent-weird);
  border-color: rgba(167,139,250,0.5);
  background: rgba(167,139,250,0.07);
}

/* Favorite: gold when starred */
.seo-fav.is-fav {
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
}
.seo-fav.is-fav:hover { background: rgba(251,191,36,0.2); border-color: #fbbf24; }

/* Card button: distinct blue-family */
.seo-card { border-color: rgba(96,165,250,0.22); }
.seo-card:hover {
  color: #93c5fd;
  border-color: rgba(96,165,250,0.52);
  background: rgba(96,165,250,0.08);
}

/* Section headings: left accent bar for visual hierarchy */
.seo-section h2 {
  padding-left: 14px;
  border-left: 3px solid rgba(167,139,250,0.55);
  font-size: 1.3rem;
}

/* Body copy: a little more readable */
.seo-section p  { font-size: 0.9rem; line-height: 1.6; }
.seo-section li { line-height: 1.55; }

/* Examples grid: chip-style inline pills */
.seo-examples .seo-example-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
}
.seo-examples .seo-example-group li {
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  line-height: 1.35;
}
.seo-examples .seo-example-group li:hover {
  border-color: rgba(167,139,250,0.38);
  color: var(--accent-weird);
  cursor: default;
}

/* How-to: numbered steps with accent circles */
.seo-howto {
  list-style: none;
  padding: 0;
  counter-reset: howto-step;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.seo-howto > li {
  counter-increment: howto-step;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.seo-howto > li::before {
  content: counter(howto-step);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-weird);
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.22);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.seo-howto > li strong { color: var(--text); }

/* FAQ: hide default marker, add custom chevron */
.seo-faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.seo-faq summary::-webkit-details-marker { display: none; }
.seo-faq summary::marker { display: none; }
.seo-faq summary::after {
  content: '▾';
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: transform 0.2s, color 0.15s;
  flex-shrink: 0;
}
.seo-faq details[open] summary::after { transform: rotate(180deg); color: var(--accent-weird); }
.seo-faq details { transition: border-color 0.15s; }
.seo-faq details:hover       { border-color: rgba(167,139,250,0.28); }
.seo-faq details[open]       { border-color: rgba(167,139,250,0.38); }
.seo-faq details[open] summary { margin-bottom: 6px; color: var(--accent-weird); }
.seo-faq details p {
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--text-dim);
}

/* Disclaimer: slightly more breathing room */
.seo-disclaimer { padding: 14px 16px; font-size: 0.82rem; line-height: 1.5; }

/* Related links: purple accent on hover */
.seo-related-links a:hover {
  border-color: rgba(167,139,250,0.55);
  background: rgba(167,139,250,0.06);
}

/* Hero + breadcrumb */
.seo-hero    { gap: 20px; padding-top: 6px; }
.breadcrumb  { opacity: 0.75; }

/* Mobile: stack controls, full-width button */
@media (max-width: 480px) {
  .seo-tool { padding: 20px 16px 18px; }
  .seo-tool-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .seo-tool-controls label { display: none; }
  .seo-tool-controls select { width: 100%; }
  .seo-body .btn-primary { min-width: 0; width: 100%; padding: 13px 24px; }
  .seo-btn { padding: 9px 14px; min-height: 40px; }
  .seo-howto > li { gap: 10px; }
  .seo-section h2 { font-size: 1.18rem; }
}

/* ============================================================
   GENERATORS HUB PAGE
   ============================================================ */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.hub-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.hub-card:hover {
  border-color: rgba(167,139,250,0.52);
  box-shadow: 0 0 24px rgba(167,139,250,0.09);
  background: rgba(167,139,250,0.03);
}
.hub-card-icon { font-size: 2rem; line-height: 1; }
.hub-card-title { font-size: 1.1rem; font-weight: 700; color: #f1f5f9; }
.hub-card-desc  { font-size: 0.88rem; color: var(--text-dim); line-height: 1.55; flex: 1; }
.hub-card-cta   { font-size: 0.82rem; color: var(--accent-weird); font-weight: 600; margin-top: 4px; }

/* ============================================================
   TRUST PAGES (privacy / terms / about)
   ============================================================ */

.static-prose {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.static-prose h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  padding-left: 12px;
  border-left: 3px solid rgba(167,139,250,0.45);
}
.static-prose h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-top: -6px; }
.static-prose p  { font-size: 0.9rem; color: var(--text-dim); line-height: 1.65; }
.static-prose ul, .static-prose ol {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.static-prose li { font-size: 0.9rem; color: var(--text-dim); line-height: 1.55; }
.static-prose a  { color: var(--accent-weird); }
.static-prose a:hover { text-decoration: underline; }
.static-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.5;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ============================================================
   HOMEPAGE — GENERATORS + FAQ SECTIONS
   ============================================================ */

.hp-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  opacity: 0.62;
  margin-bottom: 2px;
}

/* Generator card grid on homepage */
.hp-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.hp-gen-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
  line-height: 1.3;
}
.hp-gen-link:hover {
  border-color: rgba(167,139,250,0.5);
  background: rgba(167,139,250,0.06);
  color: var(--accent-weird);
}
.hp-gen-link small {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
  opacity: 0.7;
  line-height: 1.3;
}
.hp-gen-link:hover small { opacity: 0.85; }
.hp-gen-see-all {
  font-size: 0.8rem;
  color: var(--accent-weird);
  text-decoration: none;
  opacity: 0.75;
  align-self: flex-end;
  margin-top: -4px;
}
.hp-gen-see-all:hover { opacity: 1; text-decoration: underline; }

/* Homepage FAQ — reuses .seo-faq rules already defined above.
   The wrapper below just adds section-level spacing. */
.hp-faq-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 480px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hp-gen-grid { grid-template-columns: 1fr 1fr; }
}
