:root {
  /* Signal — locked design tokens. Single source of truth; do not deviate. */
  --bg:        #0B0B0D;
  --panel:     #141417;
  --panel-2:   #1A1A1F;
  --line:      rgba(255,255,255,.11);
  --line-2:    rgba(255,255,255,.17);
  --text:      #EAEAEC;
  --dim:       #9A9BA2;
  --acc:       #34E3A6;
  --acc-hover: #4AF0B5;
  --acc-ink:   #05130D;
  --radius:    2px;

  /* Compatibility layer — every pre-existing component below was authored against these names. */
  --surface:      var(--panel);
  --surface2:     var(--panel-2);
  --border:       var(--line);
  --text-dim:     var(--dim);

  /* --accent/--muted: several per-page inline <style> blocks. */
  --accent: var(--acc);
  --muted:  var(--dim);
}

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

/* Self-hosted Red Hat Mono (SIL OFL) — subset latin, 3 static weights.
   Deliberate exception to the zero-external-request rule: one self-hosted
   subset display font; body stays system-ui. See brand-assets/HANDOFF.md §11. */
@font-face {
  font-family: 'Red Hat Mono';
  src: url('assets/fonts/red-hat-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Red Hat Mono';
  src: url('assets/fonts/red-hat-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Red Hat Mono';
  src: url('assets/fonts/red-hat-mono-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: 'Red Hat Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Headings/labels/brand/buttons/numeric indices ride the display mono; body prose
   (p, li, blockquote) stays system-ui via the body-level font-family below. */
h1, h2, h3, h4, h5, h6,
button, .btn-primary, .btn-secondary, .btn-adjust, .btn-rate, .btn-save, .btn-action,
.btn-clear, .btn-link-small, .btn-drawer-inline, .drawer-toggle-btn, .drawer-close-btn,
.modal-close, .mode-btn, .preset-btn, .challenge-btn, .gen-switch-btn, .name-cat-btn,
.seo-btn, .pack-btn, .adv-summary, .research-summary, .dev-summary, .packs-summary,
.snav-brand, .snav-parent, .snav-all,
label, .section-label, .hp-section-label, .prompt-style-label, .combiner-field-label,
.combiner-style-label, .seo-check-links-label, .dash-label, .pub-label,
.packs-sublabel, .adv-sublabel, .name-option-label,
.dash-value, .pub-val, .phrase-text, .hub-card-title, .drawer-title,
.seo-howto > li::before, .drawer-badge, .drawer-inline-count,
.packs-badge, .adv-badge, .events-ls-badge, .saved-badge {
  font-family: var(--font-display);
}

body {
  background-color: var(--bg);
  /* Subtle ~5% SVG-noise grain overlay, tiled over the flat bg. */
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNjAnIGhlaWdodD0nMTYwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC44NScgbnVtT2N0YXZlcz0nMicgc3RpdGNoVGlsZXM9J3N0aXRjaCcgcmVzdWx0PSdub2lzZScvPjxmZUNvbG9yTWF0cml4IGluPSdub2lzZScgdHlwZT0nbWF0cml4JyB2YWx1ZXM9JzAgMCAwIDAgMSAgMCAwIDAgMCAxICAwIDAgMCAwIDEgIDAgMCAwIDAuMDUgMCcvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbHRlcj0ndXJsKCNuKScvPjwvc3ZnPg==");
  background-repeat: repeat;
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0 16px 80px;
  line-height: 1.5;
  overflow-x: hidden;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 2px; }

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

.app {
  width: 100%;
  max-width: 700px;
  min-width: 0;
  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: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--text);
}

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

/* ============================================================
   HOME HERO (index.html only)
   ============================================================ */

.home-hero {
  position: relative;
  width: 100%;
  max-width: 850px;
  height: 200px;
  margin: 0 auto 20px;
  background: #0a091b;
  border-radius: var(--radius);
  overflow: hidden;
}
.home-hero-media {
  position: absolute;
  inset: 0;
  display: block;
}
.home-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  filter: brightness(0.72) blur(1px);
  transform: scale(1.03);
}
.home-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15,15,26,0.92) 0%, rgba(15,15,26,0.78) 32%, rgba(15,15,26,0.35) 55%, rgba(15,15,26,0.05) 75%);
}
.home-hero-content {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 36px;
  text-align: left;
}
.home-hero-content h1 { margin-bottom: 10px; }

@media (max-width: 480px) {
  /* Fixed height + overflow:hidden clipped the wrapped H1+tagline+link whenever their
     natural content height exceeded it. Auto height (with a floor) lets the hero grow to
     fit instead. */
  .home-hero { height: auto; min-height: 190px; margin: 0 auto 16px; }
  .home-hero-content { height: auto; max-width: 100%; padding: 20px 18px; }
  /* Flat strong overlay (not the desktop's left-to-right gradient) so the headline stays
     legible over the whole nebula regardless of the now-variable hero height/crop. */
  .home-hero-scrim {
    background: rgba(10,9,27,0.70);
  }
}

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

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

.mode-btn {
  padding: 8px 24px;
  border-radius: 2px;
  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: var(--line-2); color: var(--text); }
/* Standard/Weird/Chaos unify to the single mint accent (no tri-color split);
   subtle differentiation comes from border-style/weight, not hue. */
.mode-btn.active[data-mode="mvp"]   { border-color: var(--acc); color: var(--acc); background: rgba(52,227,166,0.08); }
.mode-btn.active[data-mode="weird"] { border-color: var(--acc); color: var(--acc); background: rgba(52,227,166,0.09); border-width: 2px; }
.mode-btn.active[data-mode="chaos"] { border-color: var(--acc); color: var(--acc); background: rgba(52,227,166,0.09); border-style: dashed; }

/* Chaos: cautionary treatment when inactive */
.mode-btn[data-mode="chaos"]:not(.active) {
  color: rgba(52,227,166,0.5);
  border-color: rgba(52,227,166,0.22);
  border-style: dashed;
}
.mode-btn[data-mode="chaos"]:not(.active):hover {
  color: rgba(52,227,166,0.85);
  border-color: rgba(52,227,166,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: 2px;
  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: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px 40px;
  height: 220px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: border-color 0.3s;
  position: relative;
}

body[data-mode="mvp"]   .phrase-box { border-color: var(--line-2); }
body[data-mode="weird"] .phrase-box { border-color: var(--line-2); }
body[data-mode="chaos"] .phrase-box { border-color: var(--line-2); border-style: dashed; }

.phrase-text {
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  font-weight: 700;
  line-height: 1.38;
  text-align: center;
  color: var(--text);
  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: var(--radius);
  border: none;
  background: var(--acc);
  color: var(--acc-ink);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.btn-primary:hover  { background: var(--acc-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--bg); }

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

.btn-secondary {
  padding: 10px 22px;
  border-radius: 2px;
  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: 2px;
  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: 2px;
  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: 2px;
  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: var(--text);
  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(--acc);
  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: var(--text); }
.events-ls-badge {
  font-size: 0.63rem;
  padding: 2px 7px;
  border-radius: 2px;
  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: 2px;
  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: 2px; }
.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: 2px;
  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: 2px;
  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: 2px;
  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: 2px;
  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: 2px;
  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='%239A9BA2'/%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: var(--radius);
  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;
  letter-spacing: 0.01em;
}
.btn-save:hover {
  background: rgba(251,191,36,0.18);
  border-color: rgba(251,191,36,0.7);
  transform: scale(1.02);
}
.btn-save:active { transform: scale(0.97); }
.btn-save.rated {
  background: rgba(251,191,36,0.22);
  border-color: #fbbf24;
}

.btn-drawer-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 2px;
  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: 2px;
  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: var(--text);
  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: 2px;
}

/* ============================================================
   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: 2px;
  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: 2px;
  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);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.saved-drawer.open {
  transform: translateX(0);
}

.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: var(--text); margin-bottom: 3px; }
.drawer-total-count { font-size: 0.72rem; color: var(--text-dim); }

.drawer-close-btn {
  width: 30px; height: 30px;
  border-radius: 2px;
  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: 2px;
  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: 2px;
  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: 2px;
}

#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: 2px;
  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: var(--text);
  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: 2px;
  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(52,227,166,0.12); color: var(--acc); border: 1px solid rgba(52,227,166,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: 2px;
  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: 2px;
  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(52,227,166,0.5);  color: var(--acc); }
.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: 2px;
  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: 2px;
  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; height: 160px; }
  .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: 2px;
  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;
}

/* 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: 2px;
  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: 2px;
  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: 2px;
}

.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(--acc);
  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: 2px;
  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: 2px;
}

/* 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: 2px;
  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(--acc);
  color: var(--acc);
  background: rgba(52,227,166,0.09);
}
/* Active prompt button uses green accent */
.gen-switch-btn.active[data-gen="prompt"] {
  border-color: var(--acc);
  color: var(--acc);
  background: rgba(52,227,166,0.08);
}

/* Name category buttons */
.name-category-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.name-cat-btn {
  padding: 7px 13px;
  border-radius: 2px;
  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(--acc);
  color: var(--acc);
  background: rgba(52,227,166,0.09);
}

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

/* Saved card — kind/category badge for name entries */
.saved-kind {
  font-size: 0.78rem;
  color: var(--acc);
  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: 2px;
  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(--acc);
  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(--acc); text-decoration: none; }
.footer-generators a:hover { text-decoration: underline; }
.footer-sep { color: var(--text-dim); opacity: 0.5; }

.footer-badges {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* ============================================================
   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;
  min-width: 0;
  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; min-width: 0; }
.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;
}

@media (min-width: 768px) {
  .seo-hero > h1,
  .seo-hero > .seo-intro { text-align: left; margin-inline: 25px; }
  /* max-width:none, not a bigger ch value: the base .seo-intro rule caps at 60ch, and
     dropping the desktop override alone hands the line back to that 574px cap. */
  .seo-hero > .seo-intro { max-width: none; }
}

/* 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;
  min-width: 0;
}
.seo-tool-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.seo-tool-controls label { font-size: 0.85rem; color: var(--text-dim); }
/* generator-QA self-caught: business-name-generator's longer Mood & Style option text pushed the wrap point so the bare "Suffix" <label> and its <select> ended up on different flex-wrap lines (label on row 1, select on row 2), visually orphaning the label. */
.cs-suffix-group { display:inline-flex; align-items:center; gap:8px; }

.wl-bar { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.wl-tray {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 2px;
  background: var(--surface2);
}
/* generator-QA self-caught: author CSS beats the UA [hidden]{display:none} rule at
   equal specificity, so trayEl.hidden=true (JS) rendered as a visible empty bordered
   box, not actually hidden, on every page load and after releasing all locks. */
.wl-tray[hidden] { display: none; }
.wl-tray-label { font-size: 0.85rem; color: var(--text-dim); }
.wl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border: 1.5px solid var(--acc); border-radius: 2px;
  background: var(--bg); color: var(--text); font-size: 0.9rem; font-weight: 600;
}
.wl-chip-remove {
  background: transparent; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 2px;
}
.wl-chip-remove:hover, .wl-chip-remove:focus-visible { color: var(--acc); }
.wl-add { display: flex; align-items: center; gap: 8px; }
.wl-add input[type="text"] {
  padding: 8px 12px; border-radius: 2px; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--text); font-size: 0.9rem; min-width: 160px;
}
.wl-add button {
  padding: 8px 14px; border-radius: 2px; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--text); font-size: 0.85rem; cursor: pointer;
}
.wl-add button:hover, .wl-add button:focus-visible { border-color: var(--acc); color: var(--acc); }
/* Clickable result tokens -- inline buttons so each word in a result stays part of the
   text flow (no layout shift), with a quiet dotted underline as the only affordance
   until hover/focus (no glow). */
.wl-token {
  background: transparent; border: none; padding: 0; margin: 0; font: inherit; color: inherit;
  cursor: pointer; border-bottom: 1px dotted var(--text-dim);
}
.wl-token:hover, .wl-token:focus-visible { color: var(--acc); border-bottom-color: var(--acc); }
.wl-empty-state { font-size: 0.9rem; color: var(--text-dim); padding: 10px 0; }

.seo-wordcount,
#seo-wordcount {
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 2px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
}
#seo-wordcount:focus { border-color: var(--acc); outline: none; }

.seo-body .btn-primary {
  padding: 13px 36px;
  font-size: 1rem;
}

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

.seo-results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--seo-row-gap);
  margin: 0;
  padding: 0;
  /* RESERVED RESULTS GEOMETRY. */
  --seo-row-h: 48px;
  --seo-row-gap: 6px;
  /* The batch lives in the var() FALLBACK, never as a declaration on this element. */
  min-height: max(0px, calc(var(--seo-batch, 0) * var(--seo-row-h) + (var(--seo-batch, 0) - 1) * var(--seo-row-gap)));
}


.seo-result {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.seo-result-name { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; color: var(--text); }
.seo-result-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.seo-btn {
  padding: 6px 12px;
  border-radius: 2px;
  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(--acc);
  color: var(--acc);
  background: rgba(52,227,166,0.12);
}

/* z-index lifts the overlay above the NEXT row. */
.seo-result .seo-btn { position: relative; z-index: 1; }
.seo-result .seo-btn::after {
  content: '';
  position: absolute;
  left: -3px; right: -3px;
  top: 50%; height: 44px;
  transform: translateY(-50%);
}
/* A clickable word inside a name cannot be padded to 44px wide without visibly spacing out
   the name it belongs to, so it gets the full 44px height at its own natural width. */
.seo-result .wl-token { position: relative; z-index: 1; }
.seo-result .wl-token::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%; height: 44px;
  transform: translateY(-50%);
}

/* Result action buttons: icon-only; aria-label on each button keeps SR access */
.seo-result .seo-btn {
  font-size: 0;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 2px;
}
.seo-result-actions .seo-copy::before, .seo-result-actions .seo-fav::before { color: var(--text-dim); }
.seo-result-actions .seo-fav.is-fav::before { color: #fbbf24; }
/* Card (Name Combiner only, operator-kept scope): plain downwards-arrow glyph */
.seo-result-actions .seo-card::before {
  content: '\2193';
  font-size: 16px;
  color: var(--text-dim);
}
.seo-result-actions .seo-link::before { color: var(--text-dim); }

/* Check-availability links (optional, config-driven — e.g. band/song only): a compact secondary line, not a 3rd item competing with name+actions for the same row. */
.seo-check-links {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-dim);
}
.seo-check-links[hidden] { display: none; }
.seo-check-links-label { color: var(--text-dim); }
.seo-check-links a { color: var(--text-dim); text-decoration: underline; }
.seo-check-links a:hover { color: var(--text); }

.seo-check-links button.seo-inline-check {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text-dim);
  text-decoration: underline;
}
.seo-check-links button.seo-inline-check:hover { color: var(--text); }
.seo-check-links button.seo-inline-check:disabled { cursor: default; text-decoration: none; opacity: 0.7; }
.seo-inline-badge.in-use { color: #f87171; }
.seo-inline-badge.likely-clear { color: #86efac; }
.seo-inline-badge.check-error { color: var(--text-dim); }

/* Next steps (affiliate links after a save or a no-record .com verdict). */
.seo-next-steps {
  flex: 1 1 100%;
  order: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-dim);
}
.seo-next-steps[hidden] { display: none; }
/* Next-step buttons: same height and border language as the row's own .seo-btn controls, so they
   read as actions of this row. Primary (the registrar) is filled; secondary is outlined. The
   "affiliate" marker sits inside the button, dimmer and smaller than the label. */
.seo-next-steps a.seo-next-step,
.seo-next-steps button.seo-next-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.seo-next-steps a.seo-next-step:hover,
.seo-next-steps button.seo-next-check:hover { border-color: var(--acc); }
.seo-next-steps button.seo-next-check { font-family: inherit; cursor: pointer; }
.seo-next-steps a.seo-next-step.is-primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.seo-next-steps a.seo-next-step.is-primary:hover { background: var(--acc-hover); border-color: var(--acc-hover); }
.seo-next-step-tag { font-size: 0.62rem; font-weight: 500; opacity: 0.72; }


/* The one disclosure sentence per page, under the generator and never inside the results */
.seo-affiliate-note { margin: 0; max-width: 72ch; font-size: 0.8rem; line-height: 1.6; color: var(--text-dim); }
.hp-line { margin: 0; max-width: 72ch; font-size: 0.86rem; line-height: 1.6; color: var(--text-dim); }
.hp-line a { color: var(--acc); }
/* Combiner mug button: the last control in the row's action group, the same height as copy and star. */
.seo-result .seo-btn.nc-merch-link,
.nc-gift-strip .seo-btn.nc-merch-link {
  width: auto;
  gap: 6px;
  padding: 0 10px;
  border-color: rgba(52,227,166,0.45);
  background: rgba(52,227,166,0.06);
  color: var(--acc);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.seo-result .seo-btn.nc-merch-link:hover,
.seo-result .seo-btn.nc-merch-link:focus-visible,
.nc-gift-strip .seo-btn.nc-merch-link:hover { border-color: var(--acc); background: rgba(52,227,166,0.11); color: var(--text); }
.nc-merch-tag { font-size: 0.62rem; font-weight: 500; color: var(--text-dim); }
/* Combiner .com check: a worded button in the row's action group; its verdict takes its place. */
.seo-result .seo-btn.nc-com-check { width: auto; padding: 0 10px; font-family: var(--font-body); font-size: 0.74rem; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.seo-result .seo-btn.nc-com-check:hover { color: var(--text); }
.seo-result .seo-btn.nc-com-check[hidden], .nc-com-verdict[hidden] { display: none; }
.nc-com-verdict { display: inline-flex; align-items: center; min-height: 30px; padding: 0 4px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; color: var(--text-dim); }
.nc-com-verdict[data-verdict="in-use"] { color: #f87171; }
.nc-com-verdict[data-verdict="no-record"] { color: #86efac; }
.nc-gift-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 2px 0; font-size: 0.74rem; color: var(--text-dim); }
.nc-gift-strip[hidden] { display: none; }
.nc-gift-strip .seo-btn.nc-merch-link { min-height: 30px; }
/* One screen: the More button exists for phones and tablets only, on the pages whose rows carry
   checks; below 900px those rows keep the name and the check button, and the rest of the row
   (copy, star, details, lookup links, next steps) opens under it, one row at a time. The
   intro moves under the tool so the button and the first results share the first screen. */
.seo-result .seo-btn.seo-more { display: none; }
@media (max-width: 899px) {
  .seo-hero > .seo-intro { order: 3; }
  .seo-tool[data-checks] .seo-results { --seo-row-h: 56px; }
  .seo-tool[data-checks] .seo-result { flex-wrap: wrap; gap: 6px 8px; padding: 5px 8px; }
  .seo-tool[data-checks] .seo-result > .seo-result-name { flex: 1 1 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; }
  .seo-tool[data-checks] .seo-result > .seo-check-links { display: contents; }
  .seo-tool[data-checks] .seo-result > .seo-check-links > .seo-check-links-label,
  .seo-tool[data-checks] .seo-result > .seo-check-links > a { display: none; order: 11; }
  .seo-tool[data-checks] .seo-result > .seo-check-links > button.seo-inline-check { order: 1; min-height: 44px; }
  .seo-tool[data-checks] .seo-result > .seo-check-links > .seo-inline-badge { order: 12; flex: 1 1 100%; }
  .seo-tool[data-checks] .seo-result > .seo-result-actions { display: none; flex: 1 1 100%; order: 10; justify-content: flex-start; gap: 4px; }
  .seo-tool[data-checks] .seo-result > .seo-next-steps { order: 13; }
  .seo-tool[data-checks] .seo-result:not(.is-open) > .seo-next-steps { display: none; }
  .seo-tool[data-checks] .seo-result.is-open > .seo-result-actions { display: flex; }
  .seo-tool[data-checks] .seo-result.is-open > .seo-check-links > .seo-check-links-label,
  .seo-tool[data-checks] .seo-result.is-open > .seo-check-links > a { display: inline; }
  .seo-tool[data-checks] .seo-result .seo-btn.seo-more { display: inline-flex; order: 5; width: auto; padding: 0 10px; font-size: 0.74rem; color: var(--text-dim); }
  .seo-tool[data-checks] .seo-result > .seo-check-links > .seo-inline-badge:empty { display: none; }
  /* A second registry check (.ai beside .com) folds behind More with the rest of the row. */
  .seo-tool[data-checks] .seo-result:not(.is-open) > .seo-check-links > [data-provider="rdap-ai"] { display: none; }
  .seo-tool[data-checks] .seo-result > .seo-check-links > button.seo-inline-check { flex: 0 1 auto; min-width: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; padding: 0 8px; }
  /* The results follow the button: the two columns of a workbench flatten into the tool, and
     the brief, the help line, the Name Lab, the More checks panel and the status line come after
     the rows. The batch-check bar stays just above the rows it refers to. */
  .seo-workbench > .seo-controls-rail, .seo-workbench > .seo-results-column { display: contents; }
  .seo-tool .seo-tool-controls { order: 0; }
  .seo-tool .seo-selected-checks { order: 1; }
  .seo-tool .seo-results { order: 2; }
  .seo-tool .seo-tool-status { order: 3; }
  .seo-tool .wl-bar, .seo-tool .wb-help, .seo-tool .name-lab, .seo-tool .seo-provider-settings { order: 4; }
  .seo-tool .seo-library-hint { order: 5; }
}
/* A row flag (restricted in most states): a small dim note beside the name. */
.seo-result-flag { font-size: 0.68rem; font-weight: 500; line-height: 1.2; color: #f0b866; border: 1px solid rgba(240,184,102,0.35); border-radius: 2px; padding: 2px 6px; white-space: nowrap; }
/* One line under the H1 pointing at a sibling page; stays above the tool on phones, where the intro moves below it. */
.seo-hero > .seo-hero-link { margin: -4px auto 12px; font-size: 0.86rem; color: var(--text-dim); text-align: center; }
.seo-hero > .seo-hero-link a { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; }
/* A row's note (the OC style note) sits under the name, small and dim, like the ship hashtag. */
.seo-result-name .seo-result-note { display: block; font-size: 0.72rem; font-weight: 500; line-height: 1.25; color: var(--text-dim); }
/* Ship names: the hashtag form sits under the name, small and dim. */
.seo-result-name .nc-hashtag { display: block; font-size: 0.72rem; font-weight: 500; line-height: 1.2; color: var(--text-dim); }
/* Copy all: one button under the batch, on every width. */
.nc-batch-tools { display: flex; justify-content: flex-end; margin-top: 6px; }
.nc-batch-tools[hidden] { display: none; }
.nc-batch-tools .seo-btn.nc-copy-all { font-size: 0.76rem; padding: 6px 14px; min-height: 32px; }
/* The More button exists for phones only. */
.seo-result .seo-btn.nc-more { display: none; }
/* Below 900px a combiner row is the name, the full mug button and More; the action group opens
   as a second row under it, one row at a time. The name gives way (ellipsis) before anything wraps. */
@media (max-width: 899px) {
  .combiner-tool .seo-result { flex-wrap: wrap; gap: 6px 8px; padding: 5px 8px; }
  .combiner-tool .seo-result-name { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .combiner-tool .seo-result > .seo-result-actions { display: none; flex: 1 1 100%; order: 10; justify-content: flex-start; gap: 4px; }
  .combiner-tool .seo-result.is-open > .seo-result-actions { display: flex; }
  .combiner-tool .seo-result .seo-btn.nc-more { display: inline-flex; width: auto; padding: 0 10px; font-size: 0.74rem; color: var(--text-dim); }
  .combiner-tool .seo-result .seo-btn.nc-merch-link {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 60%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 8px;
    line-height: 1.2;
  }
  .combiner-tool .seo-result .nc-merch-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .combiner-tool .seo-result .nc-merch-tag::before { content: '\B7  '; }
}
@media (max-width: 480px) {
  .combiner-tool .seo-tool-status { order: 1; }
  .combiner-tool .combiner-history { order: 2; }
  .combiner-tool .seo-library-hint { order: 3; }
  .nc-batch-tools .seo-btn.nc-copy-all { min-height: 44px; }
}
}

/* Shared generator workbench */
.seo-tool.seo-workbench { align-items: stretch; }
.seo-workbench > .seo-controls-rail {
  order: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.seo-workbench > .seo-results-column {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.seo-workbench > .seo-controls-rail > .seo-tool-controls {
  align-items: stretch;
  justify-content: flex-start;
}
.seo-workbench > .seo-controls-rail > .wl-bar { margin: 0; }
.seo-workbench > .seo-results-column > .seo-library-hint { margin-top: 2px; }
@media (min-width: 900px) {
  /* THE workbench geometry: 1040px page, minmax(0,1fr) + 320px, 20px gap. */
  /* Keyed on markup that exists when the HTML is PARSED, not on the class site-chrome.js adds after load. */
  .seo-page:has(.seo-tool.seo-workbench),
  .seo-page:has(.seo-tool:not(.combiner-tool):not([data-ai-prompt]) > .seo-tool-controls) { max-width: 1040px; }
  .seo-tool.seo-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    column-gap: 20px;
  }
  .seo-workbench > .seo-results-column { grid-column: 1; grid-row: 1; }
  /* The rail is STILL. */
  .seo-workbench > .seo-controls-rail {
    grid-column: 2;
    grid-row: 1;
  }
  /* ONE rail-block treatment, for every block any rail carries: the controls row, the word-lock bar, and the business page's Refine panel. */
  .seo-workbench > .seo-controls-rail > .seo-tool-controls,
  .seo-workbench > .seo-controls-rail > .wl-bar,
  .seo-workbench > .seo-controls-rail > .name-lab {
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--surface2);
  }
  .seo-workbench > .seo-controls-rail > .seo-tool-controls {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 7px;
  }
  .seo-workbench > .seo-controls-rail > .seo-tool-controls label {
    margin-top: 3px;
    text-align: left;
  }
  .seo-workbench > .seo-controls-rail > .seo-tool-controls select,
  .seo-workbench > .seo-controls-rail > .seo-tool-controls .btn-primary {
    width: 100%;
    min-width: 0;
  }
  .seo-workbench > .seo-controls-rail > .seo-tool-controls .cs-suffix-group {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }
  .seo-workbench > .seo-controls-rail > .wl-bar .wl-add {
    align-items: stretch;
    flex-direction: column;
  }
  .seo-workbench > .seo-controls-rail > .wl-bar .wl-add input,
  .seo-workbench > .seo-controls-rail > .wl-bar .wl-add button {
    width: 100%;
    min-width: 0;
  }
  .seo-workbench > .seo-controls-rail > .seo-provider-settings { margin: 0; }
}

/* Result Review + provider visibility are shared across every generator that declares checkLinks/checkInline. */
.seo-result-actions .seo-review {
  font-size: 0.72rem;
  width: auto;
  min-width: 62px;
  padding: 0 10px;
  color: var(--text-dim);
}
.seo-result-review {
  flex-basis: 100%;
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.seo-result-review[hidden] { display: none; }
.seo-review-facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 0.76rem;
}
.seo-review-facts dt { margin: 0; color: var(--text-dim); font-weight: 700; white-space: nowrap; }
.seo-review-facts dd { margin: 0; color: var(--text); }
.seo-review-group {
  flex-basis: 100%;
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.seo-review-group[hidden] { display: none; }
.seo-review-group-label {
  flex-basis: 100%;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seo-review-elsewhere { font-size: 0.76rem; }
.seo-review-elsewhere a { color: var(--text-dim); text-decoration: underline; }
.seo-review-elsewhere a:hover { color: var(--text); }

.seo-provider-settings {
  margin-bottom: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  text-align: left;
}
.seo-provider-settings > summary.seo-provider-settings-head {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}
.seo-provider-settings > summary.seo-provider-settings-head::-webkit-details-marker { display: none; }
.seo-provider-settings > summary.seo-provider-settings-head::after {
  content: '+';
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 400;
}
.seo-provider-settings[open] > summary.seo-provider-settings-head::after { content: '−'; }
.seo-provider-settings-body { margin-top: 8px; }
.seo-provider-settings-head {
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seo-provider-group { margin: 0 0 8px; }
.seo-provider-group:last-of-type { margin-bottom: 0; }
.seo-provider-group-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seo-provider-group-hint { font-weight: 400; letter-spacing: normal; text-transform: none; }
.seo-provider-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0 0;
  color: var(--text-dim);
  font-size: 0.76rem;
  cursor: pointer;
}
.seo-provider-toggle input { accent-color: var(--acc); }
.seo-provider-settings-note {
  margin: 8px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1.4;
}
.seo-availability-cockpit {
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 0;
  border: none;
  background: none;
}
.seo-result .seo-availability-cockpit { flex: 0 1 auto; order: 1; }
/* Scoped with :has() so the swap reaches ONLY a row that has a cockpit. Written unscoped
   first, this rule reordered every generator's rows -- the song page went from 64px rows to
   100px because its outbound-links line moved above the action buttons. Measured, reverted. */
.seo-result:has(> .seo-availability-cockpit) > .seo-result-actions { order: 2; }

@media (min-width: 481px) {
  .seo-tool[data-checks] .seo-result > .seo-check-links { flex: 0 1 auto; order: 1; }
  .seo-tool[data-checks] .seo-result > .seo-result-actions { order: 2; }
  /* Same exception the cockpit has below: once a verdict exists the control takes a line of
     its own, after the actions, so the name and its buttons keep the first line. */
  .seo-tool[data-checks] .seo-result:has(.seo-inline-badge:not(:empty)) > .seo-check-links {
    flex: 1 1 100%;
    order: 3;
  }
}

.seo-availability-cockpit .seo-check-links-label {
  color: var(--text-dim);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seo-availability-cockpit button.seo-inline-check {
  min-height: 28px;
  padding: 4px 9px;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid rgba(52,227,166,0.45);
  background: rgba(52,227,166,0.06);
  color: var(--acc);
  text-decoration: none;
}
.seo-availability-cockpit button.seo-inline-check:hover,
.seo-availability-cockpit button.seo-inline-check:focus-visible {
  border-color: var(--acc);
  background: rgba(52,227,166,0.11);
  color: var(--text);
  outline: none;
}
.seo-availability-cockpit button.seo-inline-check:disabled {
  border-color: var(--border);
  background: transparent;
}
/* Each check is its own control: a verdict replaces only its own button and folds back on click. */
.seo-check-ctl { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.seo-check-ctl.is-checked:not(.is-folded) > button.seo-inline-check { display: none; }
.seo-check-ctl.is-folded > .seo-inline-badge { display: none; }
.seo-check-ctl.is-checked .seo-inline-badge { cursor: pointer; }
.seo-check-ctl.is-checked .seo-inline-badge:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
/* Empty until the visitor presses the button; an empty badge must not reserve a gap. */
.seo-availability-cockpit .seo-inline-badge:empty { display: none; }
.seo-result:has(.seo-inline-badge:not(:empty)) > .seo-availability-cockpit { flex: 1 1 100%; order: 3; }
.seo-availability-cockpit .seo-inline-badge {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.45;
}
.seo-availability-cockpit .seo-inline-badge.no-record { color: var(--text); }
.seo-inline-badge.is-checking { color: var(--text-dim); }
.seo-inline-checked-at { color: var(--text-dim); white-space: nowrap; }

.seo-tool[data-checks] .seo-result:has(.seo-inline-badge.no-record)::after { content: ""; flex-basis: 100%; height: 0; order: 2; }
.seo-tool[data-checks] .seo-result:has(.seo-inline-badge.no-record) > .seo-availability-cockpit { flex: 0 1 auto; order: 3; }
.seo-tool[data-checks] .seo-result:has(.seo-inline-badge.no-record) > .seo-availability-cockpit .seo-inline-badge { flex: 0 1 auto; }
.seo-tool[data-checks] .seo-result:has(.seo-inline-badge.no-record) > .seo-next-steps { flex: 0 1 auto; order: 4; }

/* Content sections */
.seo-section { display: flex; flex-direction: column; gap: 12px; }
.seo-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  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); }

.seo-section p a,
.seo-section li a,
.seo-page .seo-intro a {
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.seo-section p a:hover,
.seo-section li a:hover,
.seo-page .seo-intro a:hover {
  color: var(--acc-hover);
}

/* Static example groups */
.seo-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.seo-examples-grid.is-five { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.seo-example-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 14px 16px;
}
.seo-example-group h3 { margin-bottom: 8px; color: var(--acc); }
.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: 2px;
  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(--acc); color: var(--acc); }

/* FAQ */
.seo-faq details {
  border: 1px solid var(--border);
  border-radius: 2px;
  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(--acc); margin-bottom: 8px; }
.seo-faq summary::-webkit-details-marker { color: var(--text-dim); }

/* Disclaimer: a plain 1px border + muted background on all four sides -- no accent left-border. */
.seo-disclaimer {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  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; }

/* ============================================================ */

/* Tool block: mint-accent hairline so it reads as the focal point */
.seo-tool {
  border-color: rgba(52,227,166,0.28);
  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(--acc);
  text-decoration: none;
}
.seo-library-hint a:hover { text-decoration: underline; opacity: 1; }

/* Result rows: hover glow, compact padding */
.seo-result {
  padding: 8px 11px;
  border-radius: 2px;
  transition: border-color 0.14s, background 0.14s;
}
.seo-result:hover {
  border-color: rgba(52,227,166,0.32);
  background: rgba(52,227,166,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: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Copy: purple tint on hover */
.seo-copy:hover {
  color: var(--acc);
  border-color: rgba(52,227,166,0.5);
  background: rgba(52,227,166,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(52,227,166,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: 2px;
  padding: 4px 10px;
  line-height: 1.35;
}
.seo-examples .seo-example-group li:hover {
  border-color: rgba(52,227,166,0.38);
  color: var(--acc);
  cursor: default;
}
.seo-examples .seo-example-group ul + p { margin-top: 12px; }

/* 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;
  position: relative;
  padding: 10px 14px 10px 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  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(--acc);
  background: rgba(52,227,166,0.12);
  border: 1px solid rgba(52,227,166,0.22);
  border-radius: 2px;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 14px;
  top: 11px;
}
.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(--acc); }
.seo-faq details { transition: border-color 0.15s; }
.seo-faq details:hover       { border-color: rgba(52,227,166,0.28); }
.seo-faq details[open]       { border-color: rgba(52,227,166,0.38); }
.seo-faq details[open] summary { margin-bottom: 6px; color: var(--acc); }
.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(52,227,166,0.55);
  background: rgba(52,227,166,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:not(.ug-check-label):not(.ng-check-label):not(.gg-check-label) {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
  }
  .seo-tool-controls select { width: 100%; }
  .seo-body .btn-primary { min-width: 0; width: 100%; padding: 13px 24px; min-height: 44px; }
  .seo-btn { padding: 9px 14px; min-height: 44px; }
  .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, background 0.15s;
}
.hub-card:hover {
  border-color: rgba(52,227,166,0.55);
  background: rgba(52,227,166,0.04);
}
.hub-card-icon { font-size: 2rem; line-height: 1; }
.hub-card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.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(--acc); font-weight: 600; margin-top: 4px; }

/* ============================================================
   GUIDES (editorial byline)
   ============================================================ */
.guide-byline {
  font-size: 0.82rem;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.guide-byline a { color: var(--acc); }
.guide-byline a:hover { text-decoration: underline; }

/* ============================================================
   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: var(--text);
  padding-left: 12px;
  border-left: 3px solid rgba(52,227,166,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(--acc); }
.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;
}

/* Comparison table (best-name-generators) */
.compare-table-wrap { overflow-x: auto; }
.compare-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.compare-table th, .compare-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
.compare-table thead th {
  background: var(--panel-2);
  color: var(--acc);
  font-weight: 700;
  font-size: 0.8rem;
}
.compare-table tbody th {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.compare-table td { color: var(--text-dim); }

/* ============================================================
   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: 2px;
  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(52,227,166,0.5);
  background: rgba(52,227,166,0.06);
  color: var(--acc);
}
.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(--acc);
  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; }
}

/* ============================================================ */

.combiner-tool { scroll-margin-top: 92px; }

.combiner-fields {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.combiner-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  min-width: 130px;
  max-width: 240px;
  text-align: left;
}
.combiner-field-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.combiner-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 2px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
.combiner-input::placeholder { color: var(--text-dim); opacity: 0.6; }
.combiner-input:focus {
  border-color: var(--acc);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52,227,166,0.18);
}
.combiner-plus {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--acc);
  padding-bottom: 9px;
  flex: 0 0 auto;
}


/* Four names or more: the fields sit in a grid, two columns on a phone, one row on a desktop. */
.combiner-fields--many {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  align-items: end;
  gap: 10px 12px;
}
.combiner-fields--many .combiner-field { max-width: none; min-width: 0; }
.combiner-fields--many .combiner-plus { display: none; }
@media (min-width: 900px) {
  .combiner-fields--many { grid-template-columns: repeat(var(--nc-fields, 4), 1fr); }
}
/* The names a blend draws from, under the blend, inside its one-line row. */
.nc-uses {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* One quiet line under the tool: free, no account, names stay in the browser; and the day the page changed. */
.seo-tool-note { margin: 10px auto 0; font-size: 0.8rem; color: var(--text-dim); text-align: center; }
/* The page's own tool, as a picture, inside the text. */
.seo-shot { max-width: 640px; margin: 22px auto 4px; }
.seo-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 2px; }
.seo-shot figcaption { margin-top: 8px; font-size: 0.8rem; color: var(--text-dim); }

/* Style selector + Combine button row */
.combiner-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.combiner-style-label { font-size: 0.85rem; color: var(--text-dim); }
.combiner-style {
  padding: 9px 14px;
  border-radius: 2px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
}
.combiner-style:focus { border-color: var(--acc); outline: none; }

/* `:not([hidden])` rather than a bare class plus a `[hidden] { display:none }` companion. */
.combiner-history:not([hidden]) {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.combiner-history-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.combiner-history-btn:disabled:hover {
  background: var(--surface);
  color: var(--text-dim);
  border-color: var(--border);
}
.combiner-history-pos {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 3.5em;
  text-align: center;
}

@media (max-width: 480px) {
  .combiner-fields { gap: 8px; }
  .combiner-fields--many { grid-template-columns: 1fr 1fr; }
  .combiner-field { min-width: 0; }
  .combiner-plus { padding-bottom: 10px; }
  /* At 390px the two labels plus the readout do not fit on one line at .seo-btn's padding.
     Letting the group wrap is better than shrinking a touch target below 44px. */
  .combiner-history { gap: 8px; }
  .combiner-history-btn { flex: 1 1 auto; min-width: 0; }
}


/* ---- Accessibility: honor reduced-motion preference ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--acc);
  color: var(--acc-ink);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ── Global site nav (ln-nav-dropdown-v2) ────────────────────────────────────
   Centered bar with hover + focus-within CSS dropdowns. <div>/<button>
   keeps child <a> links always in DOM (crawlable without JS). Inline JS
   syncs aria-expanded + Esc (progressive enhancement). Hover-bridge delay
   prevents flicker when mouse moves from parent button to dropdown.
   ─────────────────────────────────────────────────────────────────────────── */
.site-nav {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  font-size: 0.82rem;
  line-height: 1.4;
}
.snav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.snav-brand {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.snav-brand img { width: 26px; height: 26px; image-rendering: pixelated; flex-shrink: 0; }
.snav-brand:hover,
.snav-brand:focus-visible { color: var(--acc); outline: none; }
.snav-menu {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.snav-mega-group { position: relative; }
.snav-parent {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.28rem 0.55rem;
  border-radius: 2px;
  color: var(--text-dim);
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
  user-select: none;
  background: none;
  border: none;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
}
.snav-parent:hover,
.snav-parent:focus-visible {
  color: var(--text);
  background: var(--surface2);
  outline: none;
}
.snav-parent[aria-expanded="true"] { color: var(--text); background: var(--surface2); }
.snav-caret {
  font-size: 0.6rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.15s;
}
.snav-parent[aria-expanded="true"] .snav-caret { transform: rotate(180deg); }
/* Panel: hidden by default; opened purely via JS's .is-open class. */
.snav-mega-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 14px;
  width: max-content;
  max-width: min(820px, calc(100vw - 2rem));
  z-index: 102;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: start;
  gap: 4px 20px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, visibility 0.12s;
}
.snav-mega-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.snav-mega-stack { min-width: 0; }
.snav-mega-heading {
  margin: 8px 0 2px;
  padding: 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--acc);
  text-align: left;
}
.snav-mega-col:first-child .snav-mega-heading { margin-top: 0; }
.snav-mega-col ul { list-style: none; margin: 0; padding: 0; }
.snav-mega-col li a {
  display: block;
  padding: 0.32rem 0.4rem;
  border-radius: 2px;
  color: var(--text-dim);
  text-decoration: none;
  text-align: left;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.snav-mega-col li a:hover,
.snav-mega-col li a:focus-visible {
  color: var(--text);
  background: var(--surface2);
  outline: none;
}
/* ── "All Generators"/"AI Prompts"/etc. direct links ── */
.snav-all {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.28rem 0.55rem;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.snav-all:hover,
.snav-all:focus-visible {
  color: var(--text);
  background: var(--surface2);
  outline: none;
}
/* ── Mobile: panel becomes an in-flow, single-column accordion ── */
@media (max-width: 540px) {
  .snav-inner { height: auto; min-height: 40px; padding: 0.4rem 0.75rem; flex-wrap: wrap; }
  .snav-menu { width: 100%; flex-wrap: wrap; }
  .snav-all { width: 100%; }
  .snav-mega-group { position: static; width: 100%; }
  .snav-mega-panel {
    display: none;
    position: static;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: none;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    border-radius: var(--radius);
    margin: 2px 0 4px;
    gap: 0;
  }
  .snav-mega-panel.is-open { display: grid; }
}

/* ============================================================ */
@media (max-width: 820px) {
  .seo-results { --seo-row-h: 62px; --seo-row-gap: 6px; }
  .seo-result .seo-btn { width: 44px; height: 44px; min-height: 44px; }
  .seo-result .seo-btn::after { content: none; }
  /* Next-step buttons get the same 44px touch height as the row's own buttons. */
  .seo-next-steps a.seo-next-step,
  .seo-next-steps button.seo-next-check { min-height: 44px; }
}

@media (max-width: 480px) {

  /* Nav: inline nav items so brand + groups share rows instead of stacking
     (≤540 rule forces snav-menu + each snav-mega-group to width:100%) */
  .snav-menu      { width: auto; }
  .snav-mega-group { width: auto; }
  .snav-all       { width: auto; }
  .site-nav       { margin-bottom: 12px; }

  /* SEO page: tighter section gaps */
  .seo-page { gap: 10px; }

  /* Hero: tighter gaps + smaller h1 floor; strip h1 bottom-margin (adds to flex gap) */
  .seo-hero { gap: 4px; padding-top: 2px; }
  .seo-hero h1 { font-size: clamp(1.35rem, 5vw, 2.3rem); margin-bottom: 0; }
  .seo-intro   { font-size: 0.86rem; }

  /* Tool block: tighter padding + gap */
  .seo-tool { padding: 12px 14px 10px; gap: 6px; }

  /* Controls: row layout so selects (and checkbox toggles) wrap compactly;
     the Generate button always gets its own full-width row below them —
     see the .btn-primary rule's flex-basis:100% below for why. */
  .seo-tool-controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }
  /* Override width:100% that the earlier ≤480 rule puts on selects */
  .seo-tool-controls select { width: auto; flex: 0 0 auto; }
  /* flex-basis:100% guarantees the button can never share a row with a select/checkbox */
  .seo-tool-controls .btn-primary { flex: 1 1 100%; min-width: 0; padding: 11px 14px; font-size: 0.82rem; width: auto; min-height: 44px; }

  /* Results: tighter row gap on mobile (overrides desktop 6px). */
  .seo-results { --seo-row-h: 56px; --seo-row-gap: 4px; }
  .seo-tool[data-checks="links"] .seo-results,
  .seo-tool[data-checks="inline"] .seo-results { --seo-row-h: 84px; }
  .seo-tool[data-checks="cockpit"] .seo-results { --seo-row-h: 125px; }

  /* How-to: clip overflow from mixed-text flex rows on narrow viewports */
  .seo-howto { overflow-x: clip; }

  /* Result cards: compact padding + smaller name text on mobile */
  .seo-result { padding: 5px 10px; }
  .seo-result-actions { gap: 4px; }
  .seo-result-name { font-size: 0.82rem; }

  .seo-result .seo-btn { width: 44px; height: 44px; min-height: 44px; border-radius: 2px; }
}

/* Results: fit all rows within a short browser window without scrolling (laptop-height viewports with a full-width layout. */
@media (max-height: 900px) and (min-width: 481px) {
  /* Short-viewport rows are 3px+3px padding + 1px+1px border + a 28px content line = 36px; the reservation follows them here for the same reason as above. */
  .seo-results { --seo-row-h: 36px; --seo-row-gap: 10px; }
  .seo-result { padding: 3px 10px; }
  .seo-result .seo-btn { width: 28px; height: 28px; min-height: 28px; }
}

.gen-ico { width: 1.15em; height: 1.15em; margin-right: 0.35em; vertical-align: -0.18em; color: var(--acc); }
.hub-card-icon .nm-icon { width: 32px; height: 32px; display: block; color: var(--acc); }
/* Line icons: one set, drawn in currentColor; mint on the dark pages, ink inside the cream simulator. */
.nm-icon { display: inline-block; flex: none; width: 20px; height: 20px; vertical-align: middle; color: var(--acc); }
h1 > .nm-icon--page { width: 36px; height: 36px; margin-right: 0.32em; vertical-align: -5px; }
.snav-menu .nm-icon--nav { width: 16px; height: 16px; margin-right: 5px; vertical-align: -3px; }
@media (max-width: 640px) { h1 > .nm-icon--page { width: 28px; height: 28px; vertical-align: -4px; } }

/* ============================================================ */

.snav-brand,
.snav-all,
.snav-parent,
.snav-mega-heading,
.snav-mega-col a,
.snav-mega-all,
.snav-library,
.snav-toggle,
.site-footer-v2,
.site-footer-v2 a,
.sf-label {
  font-family: var(--font-display);
}

.site-nav {
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, .94);
  backdrop-filter: blur(12px);
}

.snav-inner {
  position: relative;
  width: min(1280px, calc(100% - clamp(40px, 6vw, 112px)));
  max-width: none;
  height: 58px;
  margin: 0 auto;
  padding: 0;
  gap: 24px;
}

.snav-brand {
  gap: 10px;
  margin-right: 0;
  font-size: 0.86rem;
  letter-spacing: -.03em;
}

.snav-brand img {
  width: 25px;
  height: 25px;
}

.snav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.snav-all {
  padding: 11px 10px;
  color: var(--dim);
  font-size: 0.75rem;
  border-radius: 0;
}

.snav-all:hover,
.snav-all:focus-visible,
.snav-all[aria-current="page"] {
  color: var(--text);
  background: var(--panel);
}

.snav-library {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  line-height: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.snav-library span {
  color: var(--acc);
}

.snav-library:hover,
.snav-library:focus-visible {
  border-color: var(--acc);
  background: var(--panel);
}

.snav-lang {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  white-space: nowrap;
}

.snav-lang span {
  color: var(--line-2);
}

.snav-lang a {
  padding: 11px 6px;
  color: var(--dim);
  text-decoration: none;
}

.snav-lang a:hover,
.snav-lang a:focus-visible {
  color: var(--text);
  background: var(--panel);
}

.snav-lang a[aria-current="page"] {
  color: var(--acc);
}

@media (min-width: 1001px) and (max-width: 1180px) {
  .snav-inner { gap: 12px; }
  .snav-menu { gap: 0; }
  .snav-all,
  .snav-parent { padding-right: 6px; padding-left: 6px; }
  .snav-lang a { padding-right: 4px; padding-left: 4px; }
}

.snav-toggle {
  display: none;
  margin-left: auto;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--acc);
  font-size: 0.75rem;
  cursor: pointer;
}

/* Full generator directory, restored inside the cleaner v3 site chrome. */
.snav-mega-group {
  position: static;
}

.snav-parent {
  min-height: 38px;
  padding: 11px 10px;
  border-radius: 0;
  color: var(--dim);
  font-size: 0.75rem;
}

.snav-parent:hover,
.snav-parent:focus-visible,
.snav-parent[aria-expanded="true"],
.snav-parent.is-current {
  color: var(--text);
  background: var(--panel);
}

.snav-caret {
  margin-left: 2px;
  color: var(--acc);
}

.snav-mega-panel {
  top: 100%;
  right: 0;
  left: 0;
  display: block;
  width: 100%;
  max-width: none;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: rgba(11, 11, 13, .985);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
}

.snav-mega-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  padding: 26px 28px 22px;
}

.snav-mega-stack {
  min-width: 0;
}

.snav-mega-col + .snav-mega-col {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.snav-mega-heading,
.snav-mega-col:first-child .snav-mega-heading {
  margin: 0 0 8px;
  padding: 0;
  color: var(--acc);
  font-size: .62rem;
  letter-spacing: .1em;
}

.snav-mega-col li a {
  padding: 6px 0;
  border-radius: 0;
  color: var(--dim);
  font-size: .7rem;
  line-height: 1.25;
}

.snav-mega-col li a:hover,
.snav-mega-col li a:focus-visible,
.snav-mega-col li a[aria-current="page"] {
  color: var(--text);
  background: transparent;
}

.snav-mega-col li a[aria-current="page"]::after {
  content: "  ·";
  color: var(--acc);
}

.snav-mega-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 28px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: .68rem;
  text-decoration: none;
}

.snav-mega-all:hover,
.snav-mega-all:focus-visible {
  color: var(--acc);
  background: var(--panel);
  outline: none;
}

/* Sitewide local Idea Library. The drawer is a sibling of the sticky header so
   backdrop-filter never changes the containing block for its fixed positioning. */
body.site-library-open {
  overflow: hidden;
}

.site-library-overlay,
.site-library-drawer {
  position: fixed;
}

.site-library-overlay {
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.site-library-overlay.is-open {
  opacity: 1;
}

.site-library-overlay[hidden],
.site-library-drawer[hidden],
.site-library-list[hidden],
.site-library-empty[hidden] {
  display: none;
}

.site-library-drawer {
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 301;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(500px, 100vw);
  border-left: 1px solid var(--line-2);
  background: #0b0b0d;
  box-shadow: -28px 0 80px rgba(0, 0, 0, .48);
  color: var(--text);
  transform: translate3d(100%, 0, 0);
  transition: transform 180ms cubic-bezier(.2, .75, .25, 1);
}

.site-library-drawer.is-open {
  transform: translate3d(0, 0, 0);
}

.site-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--line);
}

.site-library-kicker,
.site-library-head h2,
.site-library-head [data-library-status],
.site-library-filters label,
.site-library-item strong,
.site-library-item span,
.site-library-footer p {
  font-family: var(--font-display);
}

.site-library-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--acc);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.site-library-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.04em;
}

.site-library-head [data-library-status] {
  margin-top: 9px;
  color: var(--dim);
  font-size: .68rem;
}

.site-library-close,
.site-library-actions button,
.site-library-item-actions button {
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: border-color .14s, color .14s, background .14s;
}

.site-library-close {
  flex: 0 0 auto;
  padding: 9px 11px;
  font-size: .68rem;
}

.site-library-close:hover,
.site-library-actions button:hover:not(:disabled),
.site-library-item-actions button:hover {
  border-color: var(--acc);
  background: var(--panel);
  color: var(--text);
}

.site-library-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.site-library-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.site-library-filters label {
  color: var(--dim);
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.site-library-filters input,
.site-library-filters select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
  font: 400 .78rem/1.2 var(--font-body);
  color-scheme: dark;
}

.site-library-filters input::placeholder {
  color: var(--dim);
  opacity: .72;
}

.site-library-filters input:focus,
.site-library-filters select:focus {
  border-color: var(--acc);
  outline: none;
}

.site-library-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-library-empty {
  max-width: 34ch;
  padding: 48px 28px;
  color: var(--dim);
  font-size: .88rem;
  line-height: 1.7;
}

.site-library-list {
  list-style: none;
}

.site-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.site-library-item strong {
  min-width: 0;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}

.site-library-item > span {
  grid-column: 1;
  color: var(--dim);
  font-size: .61rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.site-library-item-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.site-library-item-actions button {
  padding: 7px 8px;
  font-size: .62rem;
}

.site-library-footer {
  padding: 18px 28px 22px;
  border-top: 1px solid var(--line);
  background: rgba(20, 20, 23, .72);
}

.site-library-footer p {
  margin-bottom: 14px;
  color: var(--dim);
  font-size: .61rem;
  line-height: 1.5;
}

.site-library-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.site-library-actions button {
  min-height: 40px;
  padding: 8px;
  font-size: .62rem;
}

.site-library-actions button:disabled {
  cursor: default;
  opacity: .34;
}

.site-footer-v2 {
  width: calc(100% + 32px);
  margin: 56px 0 -80px -16px;
  border-top: 1px solid var(--line);
  background: rgba(11, 11, 13, .72);
  color: var(--dim);
}

.sf-shell {
  width: min(1280px, calc(100% - clamp(40px, 6vw, 112px)));
  margin: 0 auto;
  padding: 46px 0 28px;
}

.sf-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.sf-brand .snav-brand {
  color: var(--text);
}

.sf-brand p {
  max-width: 300px;
  margin-top: 16px;
  color: var(--dim);
  font-size: 0.76rem;
  line-height: 1.6;
}

.sf-label {
  display: block;
  margin-bottom: 14px;
  color: var(--acc);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sf-col a {
  display: block;
  margin: 8px 0;
  color: var(--dim);
  font-size: 0.75rem;
  text-decoration: none;
}

.sf-col a:hover,
.sf-col a:focus-visible {
  color: var(--text);
  text-decoration: none;
}

.sf-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  font: 400 0.64rem/1.4 var(--font-display);
}

.sf-badge {
  display: block;
  width: auto;
  height: 34px;
}

@media (max-width: 1000px) {
  .snav-inner {
    width: calc(100% - 32px);
  }

  .snav-toggle {
    display: block;
  }

  .snav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    margin: 0;
    padding: 12px 16px 16px;
    border: 1px solid var(--line);
    border-top: 0;
    background: var(--bg);
    max-height: calc(100vh - 58px);
    overflow-y: auto;
  }

  .snav-menu.is-open {
    display: grid;
  }

  .snav-all,
  .snav-library {
    width: 100%;
  }

  .snav-mega-group {
    width: 100%;
  }

  .snav-parent {
    width: 100%;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .snav-mega-panel {
    position: static;
    display: none;
    width: 100%;
    max-height: min(62vh, 520px);
    margin: 8px 0 4px;
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
  }

  .snav-mega-panel.is-open {
    display: block;
  }

  .snav-mega-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 20px;
  }

  .snav-mega-all {
    position: sticky;
    bottom: 0;
    padding: 12px 20px;
    background: var(--bg);
  }

  .snav-all {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .snav-library {
    justify-content: space-between;
    margin-top: 6px;
  }

  .snav-lang {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }

  .snav-lang a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
  }

}

@media (max-width: 820px) {
  .sf-shell {
    width: calc(100% - 32px);
  }

  .sf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 28px;
  }

  .sf-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .site-nav {
    margin-bottom: 12px;
  }

  .snav-mega-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .snav-mega-col + .snav-mega-col {
    margin-top: 14px;
    padding-top: 14px;
  }

  .snav-mega-all {
    padding-right: 18px;
    padding-left: 18px;
  }

  .site-library-drawer {
    width: 100vw;
    border-left: 0;
  }

  .site-library-head {
    padding: 22px 20px 19px;
  }

  .site-library-filters {
    grid-template-columns: minmax(0, 1fr) 120px;
    padding: 17px 20px;
  }

  .site-library-item {
    gap: 8px 12px;
    padding: 17px 20px;
  }

  .site-library-item-actions {
    flex-direction: column;
  }

  .site-library-footer {
    padding: 16px 20px max(18px, env(safe-area-inset-bottom));
  }

  .site-library-actions {
    grid-template-columns: 1fr 1fr;
  }

  .site-library-actions [data-library-clear] {
    grid-column: 1 / -1;
  }

  .sf-grid {
    grid-template-columns: 1fr;
  }

  .sf-brand {
    grid-column: auto;
  }

  .sf-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

.seo-refine-clear {
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #333);
  background: transparent;
  color: var(--text-dim, #9aa);
  cursor: pointer;
}
.seo-refine-clear:hover,
.seo-refine-clear:focus-visible {
  border-color: var(--acc, #6ee7b7);
  color: var(--acc, #6ee7b7);
  outline: none;
}
.seo-refine-bar { margin-top: 8px; }

/* A comparison table wider than a phone says so above its first column. */
@media (max-width: 700px) {
  .compare-table-wrap::before, .agd-wrap::before { content: 'Swipe sideways to see every column'; display: block; font-size: 0.78rem; color: var(--text-dim); padding: 8px 10px 4px; }
}

/* Directory cards on a phone: icon beside the title, two lines of description, the card itself is the link. */
@media (max-width: 640px) {
  .hub-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; padding: 12px 14px; }
  .hub-card-icon { grid-row: 1 / span 2; font-size: 1.6rem; }
  .hub-card-icon .nm-icon { width: 28px; height: 28px; }
  .hub-card-title { font-size: 1rem; }
  .hub-card-desc { font-size: 0.82rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hub-card-cta { display: none; }
}

/* Example lists on a phone, where a page asks for it: chips scroll sideways in one row per style, and a long plain list reads in two columns. */
@media (max-width: 640px) {
  .seo-examples.is-rails .seo-example-group ul { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .seo-examples.is-rails .seo-example-group li { flex: 0 0 auto; white-space: nowrap; }
  .seo-examples-grid.is-cols .seo-example-group ul { display: block; columns: 2; column-gap: 14px; }
  .seo-examples-grid.is-cols .seo-example-group li { break-inside: avoid; }
}

.hr-buy { margin-top: 6px; }

/* Action icons: copy, favourite, share, filter, sort, compare, buy and info drawn from the line set through a mask,
   so each takes its control's colour; the control's words stay beside the icon. */
.seo-copy::before, .seo-fav::before, .seo-link::before, .seo-review::before, .nm-act::before, .wc-copy-all::before, .nc-copy-all::before,
.sb-copy::before, .vp-copy::before, .pc-copy::before, .udtg-copy-btn::before, [data-library-copy-all]::before,
.nm-result-actions [data-save]::before, .nm-result-actions [data-copy]::before,
.name-lab > summary::before, .sb-how > summary::before, .sb-whystack > summary::before, a.seo-next-step[href*="amazon.com"]::before {
  content: ''; display: inline-block; flex: none; width: 16px; height: 16px; margin-right: 0.4em; vertical-align: -0.2em;
  background-color: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.seo-copy, .nm-act-copy, .wc-copy-all, .nc-copy-all, .sb-copy, .vp-copy, .pc-copy, .udtg-copy-btn, [data-library-copy-all], .nm-result-actions [data-copy] { --ico: url("/assets/icons/line/copy.svg"); }
.seo-fav, .nm-result-actions [data-save] { --ico: url("/assets/icons/line/favourite.svg"); }
.seo-link, .sb-copy.sb-link { --ico: url("/assets/icons/line/share.svg"); }
.seo-review, .sb-how > summary, .sb-whystack > summary { --ico: url("/assets/icons/line/info.svg"); }
.name-lab > summary { --ico: url("/assets/icons/line/filter.svg"); }
a.seo-next-step[href*="amazon.com"] { --ico: url("/assets/icons/line/buy.svg"); }
.name-lab > summary::before { margin-right: 8px; color: var(--acc); }
.name-lab > summary > span:first-child { flex: 1 1 auto; }

