/* =========================================================================
   The Abingdon AI Handbook, shared stylesheet
   Design system implementation. See DESIGN_SYSTEM.md for the inventory.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root {
  /* Colours */
  --bg: #f6f1e8;
  --bg-card: #fbf7ef;
  --bg-hero: linear-gradient(180deg, #fdf6ea, #fbf0dd);
  --ink: #1f1b16;
  --ink-soft: #3d372d;
  --muted: #6b6051;
  --rule: #e3d8c3;
  --accent: #b9532a;
  --accent-deep: #9e4522;
  --accent-soft: #e8c7b4;
  --sage: #6b8a6c;
  --sage-soft: #d6e2d4;
  --slate: #232b37;
  --slate-ink: #e8eef6;
  --slate-ink-soft: #aebbcf;
  --ok: #3e7a4a;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Layout */
  --max-read: 720px;
  --max-wide: 900px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

/* -------------------------------------------------------------------------
   2. Base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}
h1 { font-size: clamp(36px, 6vw, 56px); margin: 0 0 12px; font-weight: 600; }
h2 { font-size: clamp(26px, 4vw, 34px); margin: 72px 0 16px; }
h3 { font-size: 22px; margin: 40px 0 10px; font-weight: 600; }
h4 { font-size: 19px; margin: 0 0 10px; font-weight: 600; }
h5 {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 12px 0 4px;
  font-weight: 600;
}

p { margin: 0 0 18px; color: var(--ink-soft); }
.lede { font-size: 19px; color: var(--ink); }
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}

.sig {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  margin-top: 24px;
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 56px 0;
}

.pull {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.3;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 22px;
  margin: 36px 0;
  font-style: italic;
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip {
  position: absolute;
  top: -100px;
  left: 12px;
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  z-index: 200;
  transition: top 160ms;
}
.skip:focus { top: 12px; }

/* -------------------------------------------------------------------------
   3. Page shell
   ------------------------------------------------------------------------- */
.wrap {
  max-width: var(--max-read);
  margin: 0 auto;
  padding: 64px 28px 120px;
}
.wrap.wide { max-width: var(--max-wide); }

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  transition: width 80ms linear;
  cursor: help;
}
.progress::after {
  content: attr(data-label);
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--slate);
  color: var(--slate-ink);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 160ms;
  pointer-events: none;
  white-space: nowrap;
}
.progress:hover::after { opacity: 1; }

/* -------------------------------------------------------------------------
   4. Site header and footer (injected by app.js)
   ------------------------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  background: rgba(246, 241, 232, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  z-index: 90;
}
.nav-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}
.nav-menu {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}
.nav-group { position: relative; }
.nav-button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.nav-button:hover { color: var(--accent); background: rgba(185, 83, 42, 0.06); }
.nav-button[aria-expanded="true"] { color: var(--accent); background: rgba(185, 83, 42, 0.08); }
.nav-button .chev {
  width: 10px;
  height: 10px;
  opacity: 0.6;
}
.nav-drop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 12px 30px rgba(31, 27, 22, 0.08);
  display: none;
  z-index: 95;
}
.nav-drop.wide { min-width: 240px; }
.nav-drop.open { display: block; }
.nav-drop a {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.nav-drop a:hover { background: rgba(185, 83, 42, 0.08); color: var(--accent); text-decoration: none; }
.nav-drop .drop-sep {
  height: 1px;
  background: var(--rule);
  margin: 6px 4px;
}
.nav-drop .drop-meta {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px 2px;
  font-weight: 600;
}
.nav-cta {
  appearance: none;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 140ms;
  margin-left: 4px;
  text-decoration: none;
}
.nav-cta:hover { background: var(--accent); color: white; text-decoration: none; }


.nav-mobile {
  display: none;
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-soft);
}

@media (max-width: 820px) {
  .nav-menu { display: none; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--rule);
    padding: 14px 28px 22px;
    gap: 6px;
  }
  .nav-menu.open .nav-drop {
    position: static;
    display: block;
    box-shadow: none;
    border: 0;
    padding: 0 0 8px 12px;
    background: transparent;
  }
  .nav-menu.open .nav-button { width: 100%; justify-content: space-between; }
  .nav-mobile { display: inline-block; }
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 80px;
  padding: 28px 28px 40px;
  background: var(--bg-card);
}
.site-footer .foot-wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* -------------------------------------------------------------------------
   5. Cards and faux output
   ------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 28px 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.card.hero {
  background: var(--bg-hero);
  border-color: #e7d2b8;
}
.card h4 { font-size: 19px; margin: 0 0 10px; font-weight: 600; color: var(--ink); }
.card .cap { font-size: 13px; color: var(--muted); margin: 0 0 16px; }

.faux {
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
}
.faux .lbl {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
}
.faux.weak {
  background: #fbf7ef;
  border-style: dashed;
  color: var(--muted);
  font-style: italic;
}
.faux .rep-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0 0 4px;
  font-style: normal;
}
.faux .rep-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 10px;
  font-style: normal;
}
.faux p { margin: 0 0 8px; color: inherit; font-size: 13.5px; }
.faux ol, .faux ul { margin: 4px 0 8px 20px; padding: 0; }
.faux li { margin: 2px 0; font-size: 13px; }
.faux .mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  display: block;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 6px 0;
  color: var(--ink);
  font-style: normal;
}
.faux .q-for {
  background: #fef6ec;
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  font-size: 12.5px;
  margin-top: 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: normal;
}

/* -------------------------------------------------------------------------
   6. Prompt box
   ------------------------------------------------------------------------- */
.prompt-box {
  background: var(--slate);
  color: var(--slate-ink);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  margin: 0 0 12px;
  word-wrap: break-word;
  position: relative;
}
.prompt-box .lbl {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-ink-soft);
  margin-bottom: 8px;
  font-weight: 600;
}

/* -------------------------------------------------------------------------
   7. Before/after tabs
   ------------------------------------------------------------------------- */
.ba-tabs {
  display: inline-flex;
  background: #ece2cf;
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: 14px;
}
.ba-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 120ms;
}
.ba-tabs button.active {
  background: var(--accent);
  color: white;
}
.ba-panel { display: none; }
.ba-panel.active { display: block; }

/* -------------------------------------------------------------------------
   8. Annotated prompt
   ------------------------------------------------------------------------- */
.annot .prompt-box { margin-bottom: 18px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  margin: 0 2px;
  vertical-align: 2px;
}
.annot-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  font-size: 13px;
}
.annot-legend .item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}
.annot-legend .item b { color: var(--ink); font-weight: 600; }
.annot-legend .item span { color: var(--ink-soft); }

/* -------------------------------------------------------------------------
   9. Chat bubbles
   ------------------------------------------------------------------------- */
.chat { margin: 16px 0 0; }
.bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  margin: 8px 0;
}
.bubble.me {
  background: var(--accent-soft);
  color: var(--ink);
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.bubble.ai {
  background: white;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  border-bottom-left-radius: 4px;
}
.bubble .who {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

/* -------------------------------------------------------------------------
   10. Questions reveal
   ------------------------------------------------------------------------- */
.qr-reveal {
  display: none;
  margin-top: 14px;
  padding: 16px 18px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.qr-reveal.on { display: block; }
.qr-reveal .head {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.qr-q {
  opacity: 0;
  transform: translateY(6px);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14.5px;
  color: var(--ink);
  transition: opacity 300ms, transform 300ms;
}
.qr-q:last-child { border-bottom: 0; }
.qr-q.in { opacity: 1; transform: none; }
.qr-q b { font-weight: 600; color: var(--accent); }

/* -------------------------------------------------------------------------
   11. Rewrite tabs
   ------------------------------------------------------------------------- */
.rw-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.rw-tabs button {
  appearance: none;
  border: 1px solid var(--rule);
  background: white;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 120ms;
}
.rw-tabs button:hover { border-color: var(--accent); }
.rw-tabs button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.rw-panel { display: none; }
.rw-panel.active { display: block; }
.rw-vague {
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  font-style: italic;
}
.rw-arrow {
  text-align: center;
  color: var(--accent);
  font-size: 16px;
  margin: 4px 0;
  font-family: var(--font-display);
}
.rw-changed {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
  padding: 8px 12px;
  background: #fef6ec;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent);
}
.rw-changed b { color: var(--accent); font-weight: 600; }

/* -------------------------------------------------------------------------
   12. Connector picker
   ------------------------------------------------------------------------- */
.conn-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.conn-tabs button {
  appearance: none;
  border: 1px solid var(--rule);
  background: white;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 120ms;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.conn-tabs button:hover { border-color: var(--accent); }
.conn-tabs button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.conn-tabs button svg { width: 14px; height: 14px; }
.conn-panel { display: none; }
.conn-panel.active { display: block; }

/* -------------------------------------------------------------------------
   13. Steal these prompts
   ------------------------------------------------------------------------- */
.steal {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px 28px 20px;
  margin: 36px 0;
}
.steal h3 { margin-top: 0; }
.steal-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.steal-item:last-child { border-bottom: 0; }
.steal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.steal-head input[type=checkbox] {
  margin-top: 5px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.steal-head .t {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  line-height: 1.3;
}
.steal-head.done .t { color: var(--muted); text-decoration: line-through; }
.steal-item .desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 10px 28px;
}
.steal-item .body {
  margin-left: 28px;
  position: relative;
}
.steal-item .prompt-box {
  font-size: 12.5px;
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   14. Reveal / copy buttons
   ------------------------------------------------------------------------- */
.btn-reveal {
  appearance: none;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 120ms;
}
.btn-reveal:hover { background: var(--accent); color: white; }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--slate-ink-soft);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.2); color: white; }
.copy-btn.ok { background: var(--ok); color: white; border-color: var(--ok); }

/* -------------------------------------------------------------------------
   15. Sticky TOC
   ------------------------------------------------------------------------- */
.toc {
  position: fixed;
  top: 140px;
  left: max(24px, calc(50vw - 520px));
  width: 168px;
  font-size: 12.5px;
  line-height: 1.5;
  display: none;
  z-index: 50;
}
.toc .title {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 8px 0; }
.toc a {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: color 160ms;
}
.toc a::before {
  content: '';
  width: 6px;
  height: 1px;
  background: var(--rule);
  flex-shrink: 0;
  transition: all 160ms;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); font-weight: 600; }
.toc a.active::before { width: 14px; background: var(--accent); height: 2px; }
@media (min-width: 1120px) { .toc { display: block; } }

/* -------------------------------------------------------------------------
   16. Primer and tip grids
   ------------------------------------------------------------------------- */
.primer-grid {
  display: grid;
  gap: 14px;
  margin: 18px 0 8px;
}
.primer-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
}
.primer-item .num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  padding-top: 2px;
}
.primer-item p { margin: 0; font-size: 15px; line-height: 1.55; }
.primer-item b { color: var(--ink); font-weight: 600; }

.tip {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 44px;
  scroll-margin-top: 80px;
}
.tip .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.tip h3 { margin-top: 0; }

/* -------------------------------------------------------------------------
   17. Build-your-view (landing filter control)
   ------------------------------------------------------------------------- */
.byv {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin: 28px 0;
}
.byv-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.byv h3 { margin: 0; font-size: 20px; }
.byv .byv-count {
  font-size: 12.5px;
  color: var(--muted);
}
.byv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.byv-grid label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.byv-grid select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--rule);
  background: white;
  font: inherit;
  font-size: 14px;
  padding: 10px 32px 10px 14px;
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b6051' stroke-width='1.8'><path d='M3 6l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
.byv-grid select:hover { border-color: var(--accent); }
.byv-reset {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.byv-reset:hover { color: var(--accent); }
@media (max-width: 640px) {
  .byv-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   18. Persona strip (top of filterable pages)
   ------------------------------------------------------------------------- */
.persona {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin: 16px 0 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.persona .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.persona .pills { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.persona a {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}
.persona a:hover { color: var(--accent); text-decoration: underline; }

/* -------------------------------------------------------------------------
   19. Quiz
   ------------------------------------------------------------------------- */
.quiz {
  background: var(--bg-hero);
  border: 1px solid #e7d2b8;
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin: 40px 0;
}
.quiz h3 { margin-top: 0; }
.quiz-step { margin: 18px 0; display: none; }
.quiz-step.active { display: block; }
.quiz-step h4 { margin-bottom: 14px; font-size: 17px; }
.quiz-answers {
  display: grid;
  gap: 8px;
}
.quiz-answer {
  appearance: none;
  border: 1px solid var(--rule);
  background: white;
  font: inherit;
  font-size: 14.5px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  transition: all 140ms;
}
.quiz-answer:hover {
  border-color: var(--accent);
  background: #fff8f1;
}
.quiz-answer.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.quiz-progress {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.quiz-summary {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.quiz-summary .edit {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.quiz-result {
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 18px;
  display: none;
}
.quiz-result.on { display: block; }
.quiz-result-head {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.quiz-result h4 {
  font-size: 20px;
  margin: 0 0 8px;
}
.quiz-result p { font-size: 14.5px; }
.quiz-retake {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-top: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.quiz-retake:hover { color: var(--accent); }
.quiz-result .ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.quiz-result .cta {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background 140ms;
}
.quiz-result .cta:hover { background: var(--accent-deep); text-decoration: none; }
.quiz-result .cta.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.quiz-result .cta.ghost:hover { background: var(--accent); color: white; }

/* -------------------------------------------------------------------------
   20. Pills (level / role / bu badges)
   ------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.pill.level {
  background: var(--sage-soft);
  color: #375238;
}
.pill.role {
  background: var(--accent-soft);
  color: #6f2f13;
}
.pill.bu {
  background: white;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
a.pill:hover { text-decoration: none; filter: brightness(0.96); }

/* -------------------------------------------------------------------------
   21. Library
   ------------------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 22px 0 36px;
}
.category-card {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: transform 140ms, border-color 140ms, box-shadow 180ms;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.category-card:hover,
.category-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(31, 27, 22, 0.06);
}
.category-card.active {
  border-color: var(--accent);
  background: #fef6ec;
  box-shadow: 0 4px 14px rgba(185, 83, 42, 0.1);
}
.category-card.all {
  background: var(--bg);
  border-style: dashed;
}
.category-card.all.active {
  background: #fef6ec;
  border-style: solid;
}
.category-count {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.category-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}
.category-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.lib-filter {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: end;
}
.lib-filter .field.full { grid-column: 1 / -1; }

.pill.category {
  background: var(--sage-soft);
  color: #375238;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lib-filter .field { display: flex; flex-direction: column; gap: 4px; }
.lib-filter label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.lib-filter input[type=text],
.lib-filter select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--rule);
  background: white;
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.lib-filter input[type=text]:focus,
.lib-filter select:focus { border-color: var(--accent); outline: 0; }
@media (max-width: 560px) {
  .lib-filter { grid-template-columns: 1fr; }
}

.lib-count {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 16px;
}
.lib-item {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 12px 0;
}
.lib-item h4 { margin: 0 0 6px; font-size: 17px; }
.lib-item .lib-desc { font-size: 14px; color: var(--ink-soft); margin: 0 0 10px; }
.lib-item .lib-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.lib-item .lib-body {
  display: none;
  margin-top: 12px;
  position: relative;
}
.lib-item.on .lib-body { display: block; }
.lib-item .lib-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

/* -------------------------------------------------------------------------
   22. Case studies
   ------------------------------------------------------------------------- */
.case-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin: 16px 0;
}
.case-card h4 { margin: 0 0 8px; }
.case-card .who { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.case-card .outcome {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0;
}
.case-card .full { display: none; margin-top: 16px; }
.case-card.on .full { display: block; }
.case-card .full h5 { color: var(--accent); margin: 14px 0 4px; }
.case-card .full p { font-size: 14.5px; }
.case-card .case-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 10px;
}

/* -------------------------------------------------------------------------
   23. Glossary
   ------------------------------------------------------------------------- */
.term {
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  position: relative;
}
.term-pop {
  position: absolute;
  background: var(--slate);
  color: var(--slate-ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  max-width: 280px;
  box-shadow: 0 8px 20px rgba(31, 27, 22, 0.16);
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms, transform 160ms;
}
.term-pop.on { opacity: 1; transform: translateY(0); }
.glossary-entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 100px;
}
.glossary-entry h4 { margin: 0 0 6px; }
.glossary-entry .short {
  font-size: 14.5px;
  color: var(--ink);
  margin: 0 0 6px;
}
.glossary-entry .long {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 6px 0 0;
}

/* -------------------------------------------------------------------------
   24. Empty state
   ------------------------------------------------------------------------- */
.empty {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin: 24px 0;
}
.empty h3 { margin-top: 0; }
.empty .note {
  background: white;
  border-left: 3px solid var(--sage);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 16px 0;
}
.empty .links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 13px;
}

/* -------------------------------------------------------------------------
   25. Try items
   ------------------------------------------------------------------------- */
.try-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.try-item:last-child { border-bottom: 0; }
.try-item input[type=checkbox] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin-top: 4px;
}
.try-item .t {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 0 0 4px;
}
.try-item .desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}
.try-item.done .t { color: var(--muted); text-decoration: line-through; }
.try-item .estimate {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: white;
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   26. Section intro
   ------------------------------------------------------------------------- */
.section-intro { margin-bottom: 32px; }
.section-intro .eyebrow { margin-bottom: 12px; }
.section-intro h1 { margin-bottom: 14px; }
.section-intro p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------------
   26f. Tool grid (hub page) and decision table
   ------------------------------------------------------------------------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 28px 0;
}
.tool-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms, border-color 160ms, box-shadow 200ms;
}
.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31, 27, 22, 0.06);
  text-decoration: none;
}
.tool-card .tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 14px;
}
.tool-card .tool-icon.sage { background: var(--sage-soft); color: #375238; }
.tool-card h3 {
  font-size: 20px;
  margin: 0 0 6px;
  font-weight: 600;
}
.tool-card p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 10px;
}
.tool-card .best-for {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.decision-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.decision-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--accent);
}
.decision-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  line-height: 1.5;
  vertical-align: top;
}
.decision-table td:first-child {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
.decision-table td:last-child { font-size: 13px; color: var(--muted); }
.decision-table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .decision-table { font-size: 13px; }
  .decision-table td:first-child { white-space: normal; }
  .decision-table th, .decision-table td { padding: 10px 10px; }
}

/* Safety / important callout card */
.callout-safety {
  background: #fef2f0;
  border: 1px solid #e8c2bb;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
}
.callout-safety h4 {
  color: var(--accent-deep);
  margin: 0 0 8px;
  font-size: 16px;
}
.callout-safety p { font-size: 14px; color: var(--ink-soft); margin: 0 0 8px; }
.callout-safety ul { margin: 4px 0 0 18px; padding: 0; }
.callout-safety li { font-size: 14px; color: var(--ink-soft); margin: 3px 0; }

/* -------------------------------------------------------------------------
   26g. Terminal card (Claude Code reconstructions)
   ------------------------------------------------------------------------- */
.terminal {
  background: #1a1d23;
  border-radius: 12px;
  padding: 20px 22px;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #d4d4d4;
  overflow-x: auto;
  position: relative;
}
.terminal .t-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2d3139;
}
.terminal .t-dots {
  display: flex;
  gap: 6px;
}
.terminal .t-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal .t-dots .r { background: #ff5f56; }
.terminal .t-dots .y { background: #ffbd2e; }
.terminal .t-dots .g { background: #27c93f; }
.terminal .t-label {
  color: #6b7280;
  font-size: 11px;
  margin-left: auto;
}
.terminal .t-line { margin: 2px 0; white-space: pre-wrap; }
.terminal .t-you { color: #7dd3fc; }
.terminal .t-claude { color: #c4b5fd; }
.terminal .t-system { color: #6b7280; font-style: italic; }
.terminal .t-success { color: #4ade80; }
.terminal .t-error { color: #f87171; }
.terminal .t-muted { color: #6b7280; }
.terminal .t-accent { color: #f0b27a; }
.terminal .t-gap { margin: 8px 0; }
@media (max-width: 520px) {
  .terminal { padding: 16px 16px; font-size: 12px; }
}

/* -------------------------------------------------------------------------
   26e. Permalinks on headings
   ------------------------------------------------------------------------- */
.permalink {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--rule);
  text-decoration: none;
  opacity: 0;
  transition: opacity 160ms, color 160ms;
  vertical-align: middle;
  letter-spacing: 0;
}
h2:hover .permalink,
h2:focus-within .permalink,
h3:hover .permalink,
h3:focus-within .permalink {
  opacity: 1;
}
.permalink:hover,
.permalink:focus { color: var(--accent); text-decoration: none; }
.permalink.ok { color: var(--ok); opacity: 1; font-size: 11px; }

/* -------------------------------------------------------------------------
   26c. Cross-link strip (level <-> role skip-ahead hint)
   ------------------------------------------------------------------------- */
.cross-link {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 10px 14px;
  background: var(--sage-soft);
  border-radius: var(--radius-sm);
  margin: 0 0 28px;
  border-left: 3px solid var(--sage);
  line-height: 1.5;
}
.cross-link a {
  color: #375238;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cross-link a:hover { color: var(--accent); }

/* -------------------------------------------------------------------------
   26b. Breadcrumbs
   ------------------------------------------------------------------------- */
.breadcrumbs {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep {
  color: var(--rule);
  font-size: 14px;
}
.breadcrumbs .section { color: var(--ink-soft); }
.breadcrumbs .current {
  color: var(--ink);
  font-weight: 500;
}

/* -------------------------------------------------------------------------
   27. Featured strip
   ------------------------------------------------------------------------- */
.featured h3 { margin-top: 40px; }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 14px 0 32px;
}
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.featured-card .kind {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.featured-card h4 {
  font-size: 16px;
  margin: 0 0 6px;
}
.featured-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}
.featured-card .meta {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   27b. Landing page: route cards + start prompt
   ------------------------------------------------------------------------- */
.landing-hero { margin-bottom: 48px; }
.landing-hero h1 { margin-bottom: 16px; }
.landing-hero .lede { max-width: 560px; }
/* Level switcher strip (role + level pages) */
.level-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}
.level-switch-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.level-switch-pills {
  display: flex;
  gap: 6px;
}
.level-switch-pill {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  background: var(--bg-card);
  color: var(--ink-soft);
  text-decoration: none;
  transition: all .12s;
}
.level-switch-pill:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.level-switch-pill.active {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: #fff;
  pointer-events: none;
}

/* Next-paths cards (bottom of level pages) */
.next-paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px 0 40px;
}
.next-path {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.next-path:hover {
  border-color: var(--accent-soft);
  box-shadow: 0 2px 12px rgba(185, 83, 42, 0.08);
  text-decoration: none;
}
.next-path.accent {
  border-left: 3px solid var(--accent);
}
.next-path-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 6px;
}
.next-path h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
.next-path p {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

.hero-note {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 620px;
  margin: 12px 0 0;
}
.hero-note a { color: var(--accent); }

.route-grid {
  display: grid;
  gap: 18px;
  margin: 0 0 40px;
}

.route {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms, border-color 160ms, box-shadow 200ms;
  position: relative;
}
a.route:hover,
a.route:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(31, 27, 22, 0.06);
  text-decoration: none;
}
.route .route-kind {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.route .route-num {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0;
  line-height: 1;
}
.route h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.route p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 640px;
}
.route-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.route-go .arrow {
  transition: transform 160ms;
  display: inline-block;
}
a.route:hover .route-go .arrow,
.start-prompt:hover .route-go .arrow { transform: translateX(4px); }

.route-roles .route-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.route-roles .pill.role {
  padding: 6px 12px;
  font-size: 12px;
}

.secondary-tiles {
  display: grid;
  gap: 14px;
  margin: 0 0 40px;
}
.start-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--bg-hero);
  border: 1px solid #e7d2b8;
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms, border-color 160ms, box-shadow 200ms;
}
.start-prompt.sage {
  background: linear-gradient(180deg, #e8efe6, #dce8da);
  border-color: #c5d4c3;
}
.start-prompt.sage:hover,
.start-prompt.sage:focus-visible {
  border-color: var(--sage);
  box-shadow: 0 8px 22px rgba(31, 27, 22, 0.06);
}
.start-prompt.sage .route-go { color: #375238; }
.start-prompt:hover,
.start-prompt:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(31, 27, 22, 0.06);
  text-decoration: none;
}
.start-prompt-text { flex: 1; }
.start-prompt-head {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.start-prompt p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 560px;
}

@media (max-width: 520px) {
  .route { padding: 22px 22px; }
  .route h2 { font-size: 24px; }
  .start-prompt { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
}

/* -------------------------------------------------------------------------
   27c. Mocked message card (cultural moments)
   ------------------------------------------------------------------------- */
.mocked-msg {
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 20px 0;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  max-width: 560px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.mocked-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.mocked-msg-avatar.sage { background: var(--sage-soft); color: #375238; }
.mocked-msg-body { min-width: 0; }
.mocked-msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.mocked-msg-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.mocked-msg-time {
  font-size: 11px;
  color: var(--muted);
}
.mocked-msg-channel {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.mocked-msg-text {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}
.mocked-msg-text + .mocked-msg-text { margin-top: 6px; }
.mocked-msg-quote {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  white-space: pre-wrap;
  line-height: 1.55;
}
.mocked-msg-react {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mocked-msg-react span {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
}
.mocked-msg-react span b { color: var(--accent); font-weight: 700; margin-right: 3px; }

/* -------------------------------------------------------------------------
   27d. Concept diagram (SVG wrapper + utility palette)
   ------------------------------------------------------------------------- */
.diagram {
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 24px 18px;
  margin: 24px 0;
  max-width: 680px;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  overflow: visible;
}
.diagram-cap {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  line-height: 1.4;
}
.diagram.wide { max-width: 100%; }

/* SVG palette utilities, applied as classes on elements inside .diagram svg */
.diagram svg .d-line {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.diagram svg .d-line-soft {
  stroke: var(--ink-soft);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
}
.diagram svg .d-line-dashed {
  stroke: var(--muted);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
}
.diagram svg .d-sage {
  stroke: var(--sage);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.diagram svg .d-fill {
  fill: var(--bg-card);
  stroke: var(--rule);
  stroke-width: 1;
}
.diagram svg .d-fill-soft {
  fill: var(--bg);
  stroke: var(--rule);
  stroke-width: 1;
}
.diagram svg .d-fill-accent {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.diagram svg .d-dot {
  fill: var(--accent);
  stroke: none;
}
.diagram svg .d-text {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  fill: var(--ink-soft);
}
.diagram svg .d-label {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink);
}
.diagram svg .d-label-accent {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-weight: 600;
  fill: var(--accent);
}
.diagram svg .d-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  fill: var(--muted);
}

/* -------------------------------------------------------------------------
   28. Mobile overrides
   ------------------------------------------------------------------------- */
@media (max-width: 520px) {
  .wrap { padding: 40px 20px 80px; }
  h1 { font-size: 36px; }
  .tip { grid-template-columns: 1fr; }
  .tip .icon { display: none; }
  .pull { font-size: 21px; }
  .steal { padding: 22px 18px 14px; }
  .steal-item .desc,
  .steal-item .body { margin-left: 0; }
  .byv { padding: 20px; }
  .quiz { padding: 22px 20px; }
  .case-card { padding: 20px; }
  .empty { padding: 26px 22px; }
  .mocked-msg { padding: 14px 16px; grid-template-columns: 32px 1fr; gap: 10px; }
  .mocked-msg-avatar { width: 32px; height: 32px; font-size: 12px; }
  .diagram { padding: 18px 16px 14px; }
  .diagram svg { max-height: 220px; }
  .annot-legend .item { grid-template-columns: 18px 1fr; gap: 8px; }
  .rw-vague { font-size: 12px; }
}

/* -------------------------------------------------------------------------
   X-Admin. Admin dashboard
   ------------------------------------------------------------------------- */
.admin-body { background: var(--bg); }
.admin-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 28px 60px; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}
.admin-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  margin: 4px 0 0;
}
.admin-me {
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-link { color: var(--accent); font-size: 13px; }

/* Login screen */
.admin-login { max-width: 520px; margin: 80px auto; }
.admin-login-form { display: flex; gap: 8px; margin-top: 12px; }
.admin-login-form input { flex: 1; font-family: var(--font-body); font-size: 15px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.admin-login-err { color: var(--accent-deep); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

/* Stat tiles */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 0 24px;
}
.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
@media (max-width: 820px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }

/* Tab strip */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
}
.admin-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--ink-soft); }
.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.chart-card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink);
}
.chart-card canvas { flex: 1; min-height: 220px; max-height: 320px; }
.chart-card-wide { grid-column: span 2; }
@media (max-width: 820px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: auto; }
}

/* Heatmap */
.heatmap { overflow-x: auto; }
.heatmap-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}
.heatmap-table th, .heatmap-table td {
  padding: 6px 10px;
  text-align: center;
  border: 1px solid var(--rule);
}
.heatmap-table thead th { background: var(--bg); font-weight: 600; }
.heatmap-table tbody th { text-align: left; font-weight: 500; background: var(--bg); white-space: nowrap; }

/* Admin toolbar + free-text table */
.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.admin-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}
.admin-table th, .admin-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  max-width: 240px;
  word-break: break-word;
}
.admin-table thead th { background: var(--bg-card); font-weight: 600; color: var(--ink-soft); position: sticky; top: 0; }
.admin-table tbody tr:hover { background: rgba(185,83,42,0.04); }

/* Allowlist */
.admin-allow-list { list-style: none; padding: 0; margin: 8px 0 0; }
.admin-allow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 14px;
}
.admin-allow-item.muted { color: var(--muted); font-style: italic; }
.admin-allow-tag {
  background: var(--rule);
  color: var(--muted);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-allow-del {
  appearance: none;
  background: transparent;
  color: var(--accent-deep);
  border: 1px solid var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}
.admin-allow-del:hover { background: var(--accent-soft); }
.admin-add-form { display: flex; gap: 8px; }
.admin-add-form input { flex: 1; }

/* -------------------------------------------------------------------------
   X-0. Homepage: What's Inside grid + Featured strip
   ------------------------------------------------------------------------- */
.home-section-head {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 600;
  margin: 48px 0 6px;
}
.home-section-sub {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

/* What's Inside — 3×2 tile grid */
.inside-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 8px;
}
.inside-tile {
  display: flex;
  gap: 14px;
  padding: 18px 18px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.inside-tile:hover {
  border-color: var(--accent-soft);
  box-shadow: 0 2px 12px rgba(185, 83, 42, 0.08);
  text-decoration: none;
}
.inside-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--accent-deep);
}
.inside-icon svg { width: 20px; height: 20px; }
.inside-body h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.inside-body p {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 820px) {
  .inside-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .inside-grid { grid-template-columns: 1fr; }
  .inside-tile { padding: 14px; }
}

/* Featured strip — horizontal scroll of cards */
.featured-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 16px;
  margin: 0 0 40px;
}
.featured-strip::-webkit-scrollbar { height: 6px; }
.featured-strip::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.featured-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.featured-card:hover {
  border-color: var(--accent-soft);
  box-shadow: 0 2px 12px rgba(185, 83, 42, 0.08);
  text-decoration: none;
}
.featured-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 8px;
}
.featured-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
  line-height: 1.25;
}
.featured-card p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

@media (max-width: 520px) {
  .featured-card { flex: 0 0 180px; padding: 14px; }
}

/* -------------------------------------------------------------------------
   X-1. Accordion (collapsible sections)
   ------------------------------------------------------------------------- */
.accord {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 18px 0 28px;
}
.accord-item {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}
.accord-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  color: var(--ink);
  transition: background .12s;
}
.accord-trigger:hover { background: rgba(185, 83, 42, 0.04); }
.accord-trigger .accord-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
  flex-shrink: 0;
  width: 24px;
}
.accord-trigger .accord-title {
  font-weight: 600;
  font-size: 16px;
  flex: 1;
}
.accord-trigger .accord-hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  flex: 1;
}
.accord-trigger .accord-chev {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .2s ease;
}
.accord-item.open .accord-trigger { border-bottom: 1px solid var(--rule); }
.accord-item.open .accord-trigger .accord-chev { transform: rotate(180deg); }
.accord-item.open .accord-trigger .accord-num { color: var(--accent-deep); }
.accord-content {
  display: none;
  padding: 20px 20px 24px;
}
.accord-item.open .accord-content { display: block; }

/* Inside accordion, tighten spacing so cards don't float */
.accord-content h3 { margin-top: 0; }
.accord-content p:last-child { margin-bottom: 0; }
.accord-content .card { margin-top: 16px; }

@media (max-width: 720px) {
  .accord-trigger { padding: 14px 16px; gap: 10px; }
  .accord-trigger .accord-title { font-size: 15px; }
  .accord-trigger .accord-hint { display: none; }
  .accord-content { padding: 16px; }
}

/* -------------------------------------------------------------------------
   X-2. Questionnaire (mandatory gate + welcome pill + personalised hero)
   ------------------------------------------------------------------------- */

/* Questionnaire page */
.q-body { background: var(--bg); }
.q-wrap { max-width: 760px; }
.q-intro { margin-bottom: 28px; }
.q-honesty {
  font-size: 15px;
  color: var(--ink-soft);
  background: #fff;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 18px 0 0;
  line-height: 1.55;
}
.q-privacy {
  font-size: 13.5px;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 10px 0 0;
}
.q-rating-list .q-radio-text b { color: var(--ink); }
.q-rating-list .q-radio-text i { color: var(--muted); }

/* Progress / stepper */
.q-progress {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 22px 0 28px;
}
.q-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  text-align: center;
}
.q-step.done { background: var(--sage-soft); border-color: var(--sage); }
.q-step.active { background: var(--accent-soft); border-color: var(--accent); }
.q-step-num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.q-step.done .q-step-num { color: var(--ok); }
.q-step.active .q-step-num { color: var(--accent-deep); }
.q-step-title {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
}
.q-step.active .q-step-title { color: var(--ink-soft); font-weight: 500; }

@media (max-width: 720px) {
  .q-progress { grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .q-step { padding: 6px 2px 8px; }
  .q-step-title { display: none; }
}

/* Sections */
.q-section { display: none; }
.q-section.active { display: block; }
.q-section-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 18px;
  color: var(--ink);
  font-weight: 600;
}

/* Fields */
.q-field {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 18px;
}
.q-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 6px;
}
.q-help {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Text inputs */
.q-input, .q-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.5;
}
.q-textarea { resize: vertical; min-height: 70px; }
.q-input:focus, .q-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.q-input-other { margin-top: 10px; font-size: 14px; }

/* Radios */
.q-radio-list { display: flex; flex-direction: column; gap: 6px; }
.q-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color .12s, background .12s;
}
.q-radio:hover { border-color: var(--accent-soft); }
.q-radio input { position: absolute; opacity: 0; pointer-events: none; }
.q-radio-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--muted);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}
.q-radio input:checked ~ .q-radio-dot { border-color: var(--accent); }
.q-radio input:checked ~ .q-radio-dot::after {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  position: absolute; top: 2px; left: 2px;
}
.q-radio:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.q-radio-text { font-size: 14.5px; color: var(--ink-soft); }

/* Checkboxes */
.q-checkbox-list { display: flex; flex-direction: column; gap: 6px; }
.q-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color .12s, background .12s;
}
.q-check:hover { border-color: var(--accent-soft); }
.q-check input { position: absolute; opacity: 0; pointer-events: none; }
.q-check-box {
  width: 16px; height: 16px; border-radius: 3px;
  border: 2px solid var(--muted);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}
.q-check input:checked ~ .q-check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.q-check input:checked ~ .q-check-box::after {
  content: '';
  position: absolute;
  left: 3px; top: 0px;
  width: 5px; height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.q-check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.q-check-text { font-size: 14.5px; color: var(--ink-soft); flex: 1; }

/* Ranking badge for q-ranked lists */
.q-check { justify-content: flex-start; }
.q-rank-badge {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

/* Scale (1-5 bar for self-rating) */
.q-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.q-scale label {
  position: relative;
  cursor: pointer;
  padding: 12px 0;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  transition: all .12s;
}
.q-scale label:hover { border-color: var(--accent-soft); }
.q-scale input { position: absolute; opacity: 0; pointer-events: none; }
.q-scale label:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-deep);
}

/* Matrix (7 rows × 5 columns) */
.q-matrix {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.q-matrix-header, .q-matrix-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) repeat(5, 1fr);
  align-items: center;
  gap: 4px;
  padding: 6px 6px;
}
.q-matrix-header {
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.q-matrix-header > span:first-child { text-align: left; }
.q-matrix-row { border-bottom: 1px dashed var(--rule); }
.q-matrix-row:last-child { border-bottom: none; }
.q-matrix-label {
  font-size: 14px;
  color: var(--ink-soft);
}
.q-matrix-row label {
  cursor: pointer;
  text-align: center;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: background .12s;
}
.q-matrix-row label:hover { background: var(--accent-soft); }
.q-matrix-row input { position: absolute; opacity: 0; pointer-events: none; }
.q-matrix-row label:has(input:checked) { background: var(--accent); }
.q-matrix-row label:has(input:checked)::after {
  content: '●';
  color: #fff;
  font-size: 12px;
}

@media (max-width: 640px) {
  .q-matrix-header, .q-matrix-row {
    grid-template-columns: 1.5fr repeat(5, 1fr);
  }
  .q-matrix-label { font-size: 12.5px; }
}

/* Nav buttons */
.q-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 60px;
  flex-wrap: wrap;
}
.q-nav-spacer { flex: 1; }
.q-btn {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.q-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.q-btn-next, .q-btn-submit {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-deep);
}
.q-btn-next:hover:not(:disabled),
.q-btn-submit:hover:not(:disabled) { background: var(--accent-deep); }
.q-error {
  color: var(--accent-deep);
  font-size: 13.5px;
  flex: 0 1 auto;
  min-height: 20px;
}

/* Thanks screen */
.q-thanks { max-width: 640px; margin: 32px auto; }
.q-thanks-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  margin: 18px 0;
}
.q-rec-hello { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-bottom: 10px; }
.q-rec-where { font-size: 16px; color: var(--ink-soft); margin-bottom: 18px; }
.q-rec-go {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 500;
}
.q-rec-go:hover { background: var(--accent-deep); }
.q-rec-nudges-title { margin-top: 24px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.q-rec-nudges { list-style: none; padding: 0; margin: 10px 0 0; }
.q-rec-nudges li { padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.q-rec-nudges li .why { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.q-thanks-footer { margin-top: 18px; font-size: 14px; }

/* Welcome pill in nav */
.nav-cta.welcome-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  padding: 8px 16px;
}
.welcome-pill .welcome-hello { font-size: 11.5px; font-weight: 500; opacity: 0.85; }
.welcome-pill .welcome-where { font-size: 12px; }
.welcome-pill .welcome-where b { font-weight: 600; }

/* Personalised hero block on landing */
.personal-hero {
  background: var(--sage-soft);
  border: 1px solid var(--sage);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.personal-hero .ph-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.personal-hero .ph-hello {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.personal-hero .ph-where {
  font-size: 14px;
  color: var(--ink-soft);
}
.personal-hero .ph-where b { color: var(--ink); }
.personal-hero .ph-cta {
  align-self: flex-start;
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: none;
}
.personal-hero .ph-cta:hover { background: var(--accent-deep); }
.personal-hero .hero-nudges {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-size: 13.5px;
}
.personal-hero .hero-nudges li { padding: 4px 0; }
.personal-hero .hero-nudges .why { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.personal-hero .ph-retake {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.personal-hero .ph-retake a { color: var(--muted); }

/* ---- Admin: tab bar with global BU multi-filter ---- */
.admin-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.admin-tabs-bar .admin-tabs {
  border-bottom: none;
  margin-bottom: 0;
  flex: 1 1 auto;
  /* Suppress the ghost vertical scroll arrows browsers sometimes render when
     overflow-x:auto is set and the strip is in a flex parent. */
  overflow-y: hidden;
  align-items: center;
}

/* Vertical separator between tab groups (questionnaire | capability | settings). */
.admin-tab-divider {
  display: inline-block;
  width: 1px;
  align-self: center;
  height: 18px;
  margin: 0 8px;
  background: var(--rule);
}

.bu-multi {
  position: relative;
  flex: 0 0 auto;
}
.bu-multi-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  min-width: 200px;
}
.bu-multi-trigger:hover { border-color: var(--accent); }
.bu-multi-label { flex: 1; text-align: left; }
.bu-multi-caret { color: var(--muted); }

.bu-multi-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  min-width: 240px;
  max-height: 360px;
  overflow-y: auto;
}
.bu-multi-actions {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
}
.bu-multi-action {
  font: inherit;
  font-size: 12px;
  background: var(--bg-soft, #f6f4ee);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.bu-multi-action:hover { background: #ece6d5; }
.bu-multi-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.bu-multi-list li label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.bu-multi-list li label:hover { background: var(--bg-soft, #f6f4ee); }

/* ---- Admin: Respondents filter bar ---- */
.resp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}
.resp-search {
  flex: 1 1 240px;
  min-width: 240px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  background: #fff;
}
.resp-search:focus { outline: none; border-color: var(--accent); }

.resp-multi {
  position: relative;
}
.resp-multi-trigger {
  font: inherit;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
}
.resp-multi-trigger:hover { border-color: var(--accent); }
.resp-multi-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 60;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
}
.resp-multi-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.resp-multi-list li label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.resp-multi-list li label:hover { background: var(--bg-soft, #f6f4ee); }
.resp-clear {
  font: inherit;
  font-size: 13px;
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
}
.resp-clear:hover { color: var(--ink); border-color: var(--rule); border-radius: var(--radius-sm); }

.resp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 8px;
}
.resp-chip {
  font: inherit;
  font-size: 12.5px;
  background: var(--bg-soft, #f6f4ee);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
}
.resp-chip:hover { background: #ece6d5; }
.resp-chip-x { color: var(--muted); margin-left: 4px; }

/* ---- Admin: Diagnostic scoring explainer ---- */
.scoring-explainer {
  margin: 0 0 18px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.scoring-explainer summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.scoring-explainer .se-body {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.55;
}
.scoring-explainer .se-body h4 {
  margin: 16px 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.scoring-explainer .se-band-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 10px;
  font-size: 13px;
}
.scoring-explainer .se-band-table th,
.scoring-explainer .se-band-table td {
  border: 1px solid var(--rule);
  padding: 6px 8px;
  text-align: left;
}
.scoring-explainer .se-band-table th {
  background: var(--bg-soft, #f6f4ee);
  font-weight: 600;
}
.scoring-explainer .se-note {
  background: var(--bg-soft, #f6f4ee);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
}
.scoring-explainer .se-domains {
  font-size: 13px;
  color: var(--muted);
}

/* ---- Admin: Respondents tab ---- */
.resp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.resp-table th,
.resp-table td {
  border-bottom: 1px solid var(--rule);
  padding: 10px 12px;
  text-align: left;
}
.resp-table th {
  background: var(--bg-soft, #f6f4ee);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.resp-table th:hover { background: #ece6d5; }
.resp-table tbody tr {
  cursor: pointer;
}
.resp-table tbody tr:hover {
  background: #faf6ec;
}
.resp-table tbody tr:last-child td { border-bottom: none; }

/* ---- Admin: Scorecard ---- */
.resp-scorecard .sc-back {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--accent);
  text-decoration: none;
}
.resp-scorecard .sc-back:hover { text-decoration: underline; }

.scorecard-header {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
}
.scorecard-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-family: var(--font-display);
  font-weight: 600;
}
.scorecard-header .sc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.scorecard-header .sc-rec {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-soft, #f6f4ee);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.scorecard-header .sc-nudges {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.scorecard-header .sc-nudges li { padding: 2px 0; font-size: 13px; }

.scorecard-section {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
}
.scorecard-section h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}

.sc-dl {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 6px 18px;
  margin: 0;
  font-size: 13.5px;
}
.sc-dl dt {
  font-weight: 500;
  color: var(--muted);
}
.sc-dl dd {
  margin: 0;
  color: var(--ink);
}

.sc-mcq-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.sc-mcq-tile {
  padding: 12px 14px;
  background: var(--bg-soft, #f6f4ee);
  border-radius: var(--radius-sm);
}
.sc-mcq-tile .tile-val {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.sc-mcq-tile .tile-val.tile-tiers { font-size: 13.5px; font-weight: 500; }
.sc-mcq-tile .tile-lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.sc-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.sc-domain-pill {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d6e2d4;
  color: #2f4d31;
}

.sc-question {
  border-top: 1px solid var(--rule);
  padding: 14px 0;
}
.sc-question:first-of-type { border-top: none; }
.sc-q-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.sc-q-num {
  background: var(--ink);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11.5px;
}
.sc-q-tier { text-transform: uppercase; letter-spacing: 0.04em; }
.sc-q-domain { font-style: italic; }
.sc-q-earned {
  margin-left: auto;
  font-weight: 600;
  color: var(--ink);
}
.sc-q-prompt {
  margin: 0 0 8px;
  font-size: 14.5px;
  color: var(--ink);
}
.sc-q-preamble {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--bg-soft, #f6f4ee);
  border-left: 2px solid var(--rule);
  font-size: 13px;
}
.sc-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-option {
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sc-option.picked {
  background: #faecdf;
  border-color: var(--accent);
}
.sc-option.correct {
  background: #d8e8d4;
  border-color: #6b8a6c;
}
.sc-option.picked.correct {
  background: linear-gradient(90deg, #d8e8d4 50%, #faecdf 50%);
  border-color: #3e7a4a;
}
.sc-pts {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: 4px;
}
.sc-mark {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}
.sc-mark-picked {
  background: var(--accent);
  color: #fff;
}
.sc-mark-correct {
  background: #6b8a6c;
  color: #fff;
}
.sc-q-banding {
  margin: 8px 0 0;
  font-size: 12px;
}

/* ---- Questionnaire: admin/dev quick actions ---- */
.q-admin-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #f0ece2;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.q-admin-tag {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-right: 6px;
}
.q-admin-buttons button {
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
}
.q-admin-buttons button:hover {
  background: var(--bg-soft, #f6f4ee);
  border-color: var(--accent);
}

/* ---- Section 8: AI Capability Assessment ---- */
.q-cap-intro {
  margin-bottom: 18px;
}
.q-cap-loading {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0;
}
.q-cap-host { display: block; }
.q-cap-item {
  /* same card shell as .q-field, with a slight visual nudge so the section
     reads as a single block of related questions rather than 15 isolated cards */
  margin-bottom: 14px;
}
.q-cap-prompt {
  font-size: 15.5px;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.5;
}
.q-cap-preamble {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--bg-soft, #f6f4ee);
  border-left: 3px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.q-cap-preamble p { margin: 0 0 6px; }
.q-cap-preamble p:last-child { margin-bottom: 0; }
.q-cap-hint {
  font-size: 13px;
  color: var(--muted);
  margin: -6px 0 8px;
}

