/* ═══════════════════════════════════════════════════════════
   Sankram AI Docs: editorial, monochrome, one indigo accent.
   Light is the default; dark applies only via the toggle.
   ═══════════════════════════════════════════════════════════ */

/* ── Theme tokens ─────────────────────────────────────────── */
:root {
  --bg: #fbfaf8;
  --bg-soft: #f3f2ee;
  --bg-elev: #ffffff;
  --ink: #111110;
  --ink-2: #44443f;
  --ink-3: #75756e;
  --line: #e8e6e0;
  --line-strong: #d6d3cb;
  --accent: #111110;
  --accent-ink: #ffffff;
  /* Accent follows the theme: black in light mode, white in dark mode. */
  --brand: var(--ink);
  --brand-2: var(--ink);
  --brand-soft: var(--grey-bg);
  --link: var(--ink);
  --green: #127a43;  --green-bg: #e7f4ec;
  --red: #b42318;    --red-bg: #fcebe9;
  --amber: #9a5800;  --amber-bg: #fdf1dc;
  --blue: #3949d6;   --blue-bg: #eceefe;
  --violet: var(--ink); --violet-bg: var(--grey-bg);
  --grey-bg: #efeee9;
  --shadow-sm: 0 1px 2px rgba(17,17,16,.05);
  --shadow: 0 1px 2px rgba(17,17,16,.04), 0 6px 16px -4px rgba(17,17,16,.08);
  --shadow-lg: 0 2px 4px rgba(17,17,16,.04), 0 24px 48px -12px rgba(17,17,16,.18);
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar: 272px;
  --toc: 232px;
  --top: 64px;
  --serif: ui-serif, "New York", "Iowan Old Style", "Charter", Georgia, Cambria, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0c0e; --bg-soft: #151518; --bg-elev: #17171a;
  --ink: #f3f2ef; --ink-2: #c9c8c2; --ink-3: #8f8e88;
  --line: #242428; --line-strong: #35353a;
  --accent: #f3f2ef; --accent-ink: #0c0c0e;
  --green: #5cd38c; --green-bg: #0f2519;
  --red: #ff8b7f;   --red-bg: #2e1310;
  --amber: #ffc066; --amber-bg: #2a1f0b;
  --blue: #93a2ff;  --blue-bg: #141a36;
  --grey-bg: #1d1d21;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -6px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}

.only-dark { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 var(--sans); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 3px; font-weight: 550; }
a:hover { text-decoration-color: currentColor; }
img { max-width: 100%; display: block; }
kbd {
  font: 11.5px var(--mono); padding: 1px 6px; min-width: 20px; text-align: center; display: inline-block;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; color: var(--ink-3); background: var(--bg-elev);
}
code { font: .88em var(--mono); background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.readbar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .1s linear; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 650; letter-spacing: -.015em; margin-right: auto; font-size: 16px; }
.brand em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.brand img { border-radius: 8px; box-shadow: var(--shadow-sm); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.sun { display: none; }
:root[data-theme="dark"] .sun { display: block; } :root[data-theme="dark"] .moon { display: none; }
.menu-btn { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 8px 0 13px; min-width: 240px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--bg-elev); color: var(--ink-3);
  cursor: pointer; font: inherit; font-size: 14px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.search-trigger span { margin-right: auto; }
.search-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

/* ── Layout ───────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc); max-width: 1480px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto;
  padding: 28px 18px 40px 22px;
}
.nav-group { margin-bottom: 26px; }
.nav-group h4 { margin: 0 0 8px 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; }
.nav-group a {
  position: relative; display: block; padding: 6px 12px; margin: 1px 0; border-radius: 9px; color: var(--ink-2);
  text-decoration: none; font-size: 14.5px; line-height: 1.45; transition: background .15s, color .15s;
}
.nav-group a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.nav-group a[aria-current="page"] { background: var(--bg-elev); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.nav-group a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }

.nav-progress { font-size: 12.5px; color: var(--ink-3); }
.toc .nav-progress { margin-top: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
#progressNav { display: none; margin: 8px 12px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.nav-progress .bar { height: 5px; border-radius: 5px; background: var(--grey-bg); margin-top: 8px; overflow: hidden; }
.nav-progress .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s ease; }

.scrim { display: none; }
#main:focus, #main:focus-visible { outline: none; }
main { position: relative; min-width: 0; padding: 48px 56px 72px; outline: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--bg-elev); }
.page { position: relative; max-width: 740px; margin: 0 auto; }
.page.enter { animation: enter .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 48px 22px 24px; display: flex; flex-direction: column; }
.toc h4 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; }
.toc a { display: block; padding: 5px 0 5px 14px; font-size: 13.5px; color: var(--ink-3); text-decoration: none; border-left: 1.5px solid var(--line); line-height: 1.45; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); font-weight: 550; border-left-color: var(--brand); }

/* ── Page typography ──────────────────────────────────────── */
.eyebrow, .hero-kicker { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 4.6vw, 50px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 14px; }
.page .summary { font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 0 0 14px; max-width: 640px; }
.meta { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.page h2 { position: relative; font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: -.012em; margin: 56px 0 14px; line-height: 1.2; }
.page h2 .anchor { position: absolute; left: -26px; top: 0; padding-right: 8px; font-family: var(--sans); font-size: 20px; color: var(--ink-3); text-decoration: none; opacity: 0; transition: opacity .15s; }
.page h2:hover .anchor, .page h2 .anchor:focus { opacity: 1; }
.page h3 { font-size: 16.5px; margin: 0 0 6px; letter-spacing: -.01em; font-weight: 650; }
.page p, .page li { color: var(--ink-2); }
.page b { color: var(--ink); font-weight: 620; }
.lead { font-size: 18.5px; line-height: 1.65; }
.page ul, .page ol { padding-left: 22px; }
.page li { margin: 7px 0; }
.page li::marker { color: var(--ink-3); }
.figure { margin: 24px 0; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--bg-elev); }

/* ── Welcome hero ─────────────────────────────────────────── */
.hero { position: relative; padding: 8px 0 8px; margin-bottom: 40px; }
.hero-title { font-family: var(--serif); font-weight: 600; font-size: clamp(42px, 6.4vw, 72px) !important; line-height: 1.02 !important; letter-spacing: -.03em !important; margin: 0 0 22px !important; }
.hero-sub { font-size: 20px !important; line-height: 1.55; color: var(--ink-2); max-width: 600px; margin: 0 0 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-elev); box-shadow: var(--shadow); overflow: hidden; }
.stats > div { padding: 18px 16px; border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-family: var(--serif); font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -.02em; margin-bottom: 6px; }
.stats span { font-size: 13px; color: var(--ink-3); line-height: 1.35; display: block; }

/* ── Cards ────────────────────────────────────────────────── */
.cards { display: grid; gap: 14px; margin: 22px 0; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.card p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.card.link { text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s; }
.card.link h3 { color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.card.link:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Flat colour icons: a tinted tile with a coloured line icon. */
.ic { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; vertical-align: middle; color: var(--ink-2); background: var(--grey-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 12%, transparent); }
.ic svg { width: 60%; height: 60%; }
.ic.lg { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px; }
.ic[data-tone="violet"] { color: var(--violet); background: var(--violet-bg); }
.ic[data-tone="blue"] { color: var(--blue); background: var(--blue-bg); }
.ic[data-tone="green"] { color: var(--green); background: var(--green-bg); }
.ic[data-tone="amber"] { color: var(--amber); background: var(--amber-bg); }
.ic[data-tone="red"] { color: var(--red); background: var(--red-bg); }
.with-ic { display: flex; align-items: center; gap: 10px; }

/* ── Callouts ─────────────────────────────────────────────── */
.callout {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 22px 24px; margin: 28px 0;
  background: #121214; color: #f3f2ef; box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .callout:not(.neutral) { background: #f3f2ef; color: #0c0c0e; }
.callout b { position: relative; color: inherit; display: block; margin-bottom: 6px; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.callout p { position: relative; margin: 0; color: inherit; opacity: .82; }
.callout.neutral { background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line); box-shadow: none; padding: 18px 22px 18px 24px; }
.callout.neutral::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--brand), var(--brand-2)); }
.callout.neutral b { font-family: var(--sans); font-size: 15px; font-weight: 650; }
.callout.neutral p { color: var(--ink-2); opacity: 1; }

/* ── Analogy strip ────────────────────────────────────────── */
.analogy { display: flex; align-items: stretch; gap: 8px; margin: 22px 0; flex-wrap: wrap; }
.analogy > div:not(.arrow) { flex: 1 1 120px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg-elev); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 3px; }
.analogy span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.analogy b { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.analogy small { color: var(--ink-3); font-size: 13px; }
.analogy .arrow { align-self: center; color: var(--line-strong); font-size: 20px; }

/* ── Checklists ───────────────────────────────────────────── */
.checklist { list-style: none; padding: 0 !important; }
.checklist li { position: relative; padding-left: 32px; margin: 10px 0; }
.checklist li::before { position: absolute; left: 0; top: 3px; width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.checklist.good li::before { content: "✓"; background: var(--green-bg); color: var(--green); }
.checklist.bad li::before { content: "!"; background: var(--red-bg); color: var(--red); }
.numbered { counter-reset: n; list-style: none; padding: 0 !important; }
.numbered li { counter-increment: n; position: relative; padding: 14px 16px 14px 56px; margin: 10px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.numbered li::before { content: counter(n); position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }

/* ── Tables ───────────────────────────────────────────────── */
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 18px 0; font-size: 14.5px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.table th, .table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.table th { background: var(--bg-soft); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--bg-soft) 60%, transparent); }

/* ── Agents ───────────────────────────────────────────────── */
.agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.agent { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--bg-elev); position: relative; box-shadow: var(--shadow-sm); }
.agent p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.6; }
.agent .tag { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--brand-soft); color: var(--link); border-radius: 99px; padding: 3px 9px; }
.agent.strong { background: linear-gradient(180deg, var(--bg-elev), var(--bg-soft)); }

/* ── Skills ───────────────────────────────────────────────── */
.skill-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.skill-groups section { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.skill-groups h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.skill-groups ul { list-style: none; padding: 0; margin: 10px 0 0; }
.skill-groups li { font-size: 14px; margin: 0; padding: 9px 0; line-height: 1.5; border-top: 1px solid var(--line); }

/* ── Steps ────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.steps > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 3px; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.steps span { width: 28px; height: 28px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.steps small { color: var(--ink-3); font-size: 13px; }

/* ── Pills ────────────────────────────────────────────────── */
.labels { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 10px 14px; margin: 14px 0; color: var(--ink-2); font-size: 14.5px; }
.labels .pill { justify-self: start; }
.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 11px; border-radius: 99px; }
.pill.verified { background: var(--green-bg); color: var(--green); }
.pill.reported { background: var(--amber-bg); color: var(--amber); }
.pill.human { background: var(--violet-bg); color: var(--violet); }

/* ── Never list ───────────────────────────────────────────── */
.never { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.never div { border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-weight: 560; font-size: 14.5px; background: var(--bg-elev); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 12px; color: var(--ink); }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { list-style: none; padding: 0 !important; margin: 28px 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--brand), var(--brand-2) 60%, var(--line)); border-radius: 2px; }
.timeline li { position: relative; padding-left: 40px; margin: 0 0 26px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-elev); border: 2px solid var(--brand); box-shadow: 0 0 0 4px var(--bg-elev); }
.timeline time { font-size: 11.5px; font-weight: 700; color: var(--link); text-transform: uppercase; letter-spacing: .08em; }
.timeline h3 { margin: 3px 0 4px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.timeline p { margin: 0; }

/* ── Screenshots ──────────────────────────────────────────── */
.shot { margin: 28px 0; }
.shot img { border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-lg); cursor: zoom-in; background: var(--bg-soft); }
.shot figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 12px; text-align: center; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10,10,12,.82); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: fade .2s ease both; }
.lightbox img { max-height: 92vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
@keyframes fade { from { opacity: 0; } }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq details { border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; background: var(--bg-elev); box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 620; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-soft); color: var(--ink-2); font-size: 18px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 20px 18px; }

/* ── Glossary ─────────────────────────────────────────────── */
.glossary { display: grid; grid-template-columns: 210px 1fr; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.glossary dt, .glossary dd { padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.glossary dt:last-of-type, .glossary dd:last-of-type { border-bottom: 0; }
.glossary dt { font-weight: 650; background: var(--bg-soft); color: var(--ink); }
.glossary dd { color: var(--ink-2); }
.glossary dt.flash { background: var(--amber-bg); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 15px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink); cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, var(--shadow); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn.lg { padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.page .btn.primary { color: var(--accent-ink); }
.page .btn:not(.primary) { color: var(--ink); }

/* ── Widgets ──────────────────────────────────────────────── */
.journey { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin: 18px 0; background: var(--bg-elev); box-shadow: var(--shadow); }
.journey-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.journey-tabs button { all: unset; cursor: pointer; padding: 11px 14px; border-radius: 11px; display: flex; flex-direction: column; gap: 2px; transition: background .15s; }
.journey-tabs button:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.journey-tabs button small { font-size: 11.5px; color: var(--ink-3); }
.journey-tabs button b { font-size: 15px; }
.journey-tabs button[aria-selected="true"] { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.journey-tabs button[aria-selected="true"] small { color: var(--link); opacity: 1; }
.page .journey-tabs button[aria-selected="true"] b, .page .callout b { color: inherit; }
.journey-tabs button:focus-visible { outline-offset: -3px; }
.journey-body { display: grid; grid-template-columns: 220px 1fr; min-height: 240px; }
.journey-steps { list-style: none; margin: 0; padding: 12px !important; border-right: 1px solid var(--line); }
.journey-steps li { margin: 0; }
.journey-steps button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; padding: 9px 10px; border-radius: 9px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); transition: background .15s; }
.journey-steps button span { width: 24px; height: 24px; flex: none; border-radius: 8px; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.journey-steps button:hover { background: var(--bg-soft); }
.journey-steps button[aria-current="step"] { background: var(--bg-soft); color: var(--ink); font-weight: 600; }
.journey-steps button[aria-current="step"] span { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.journey-detail { padding: 26px 28px; animation: enter .3s ease both; }
.journey-detail .who { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 11px; border-radius: 99px; margin-bottom: 12px; }
.journey-detail .who.human { background: var(--violet-bg); color: var(--violet); }
.journey-detail .who.agent { background: var(--blue-bg); color: var(--blue); }
.journey-detail h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 8px; }
.journey-detail p { margin: 0 0 20px; }
.journey-nav { display: flex; gap: 8px; }

.statuses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; }
.status-btn { font: inherit; cursor: pointer; border-radius: 12px; padding: 13px 8px; border: 1.5px solid transparent; font-weight: 650; font-size: 14px; text-align: center; transition: transform .15s, box-shadow .15s; }
.status-btn:hover { transform: translateY(-1px); }
.status-btn.passed { background: var(--green-bg); color: var(--green); }
.status-btn.failed { background: var(--red-bg); color: var(--red); }
.status-btn.blocked { background: var(--amber-bg); color: var(--amber); }
.status-btn.notrun, .status-btn.na { background: var(--grey-bg); color: var(--ink-2); }
.status-btn[aria-pressed="true"] { border-color: currentColor; box-shadow: var(--shadow); }
.status-detail { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 10px 0 18px; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.status-detail p { margin: 0; }
.status-detail p + p { margin-top: 6px; }

.scorecard { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin: 18px 0; box-shadow: var(--shadow); background: var(--bg-elev); }
.score-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--bg-elev); cursor: default; outline: none; transition: background .15s; }
.score-row:last-of-type { border-bottom: 0; }
.score-row:hover, .score-row:focus-visible, .score-row.open { background: var(--bg-soft); }
.score-row .name { font-weight: 600; font-size: 15px; color: var(--ink); }
.score-row .why { display: none; font-size: 13.5px; color: var(--ink-3); margin-top: 2px; font-weight: 400; }
.score-row.open .why, .score-row:hover .why, .score-row:focus-visible .why { display: block; }
.st { flex: none; font-size: 12px; font-weight: 650; padding: 3px 11px; border-radius: 99px; white-space: nowrap; }
.st.verified { background: var(--green-bg); color: var(--green); }
.st.reviewed { background: var(--blue-bg); color: var(--blue); }
.st.partial { background: var(--amber-bg); color: var(--amber); }
.st.concerns { background: var(--red-bg); color: var(--red); }
.st.na { background: var(--grey-bg); color: var(--ink-3); }
.score-legend { font-size: 12.5px; color: var(--ink-3); padding: 12px 18px; background: var(--bg-soft); border-top: 1px solid var(--line); }

.quiz { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; background: var(--bg-elev); margin: 18px 0; box-shadow: var(--shadow); }
.quiz-top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); margin-bottom: 12px; }
.quiz-q { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 18px; color: var(--ink); line-height: 1.3; }
.quiz-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-opts .btn.right { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.quiz-opts .btn.wrong { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.quiz-opts .btn.right, .quiz-opts .btn.wrong { opacity: 1; }
.quiz-fb { margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--bg-soft); animation: enter .25s ease both; }
.quiz-fb b { display: block; }
.quiz-done { text-align: center; padding: 10px 0; }
.quiz-done .big { font-family: var(--serif); font-size: 56px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }

/* ── Pager & footer ───────────────────────────────────────── */
.pager { position: relative; max-width: 740px; margin: 64px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; text-decoration: none; display: flex; flex-direction: column; gap: 3px; background: var(--bg-elev); box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s, transform .2s; }
.pager a:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.pager small { color: var(--ink-3); font-size: 12.5px; font-weight: 550; }
.pager b { color: var(--ink); font-family: var(--serif); font-size: 18px; font-weight: 600; }
.pager .next { text-align: right; grid-column: 2; }
.foot { position: relative; max-width: 740px; margin: 48px auto 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: flex; gap: 12px; align-items: flex-start; }
.foot img { flex: none; border-radius: 6px; opacity: .85; }

/* ── Search ───────────────────────────────────────────────── */
.search-modal { position: fixed; inset: 0; z-index: 50; background: rgba(12,12,14,.4); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .15s ease both; }
.search-modal[hidden] { display: none; }
.search-box { width: 100%; max-width: 640px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: enter .2s ease both; }
.search-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 20px 22px; font: inherit; font-size: 17px; background: transparent; color: var(--ink); outline: none; }
.search-box ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.search-box li a { display: block; padding: 11px 14px; border-radius: 11px; text-decoration: none; color: var(--ink); font-weight: 600; }
.search-box li a small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; font-weight: 400; }
.search-box li a mark { background: color-mix(in srgb, var(--brand) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-box li.sel a, .search-box li a:hover { background: var(--bg-soft); }
.search-box .empty { padding: 18px; color: var(--ink-3); font-size: 15px; }
.search-hint { margin: 0; padding: 11px 18px; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .toc { display: none; }
  main { border-right: 0; }
  #progressNav { display: block; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; top: var(--top); left: 0; bottom: 0; height: auto; width: min(300px, 85vw); z-index: 40;
    background: var(--bg); transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.7,.2,1); border-right: 1px solid var(--line);
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: var(--top) 0 0 0; background: rgba(12,12,14,.35); backdrop-filter: blur(2px); z-index: 35; display: none; }
  body.nav-open .scrim { display: block; }
  main { padding: 32px 16px 48px; border: 0; }
  .search-trigger { min-width: 0; padding: 0 11px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  .page h2 .anchor { display: none; }
  .hero-sub { font-size: 18px !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .stats > div:nth-last-child(-n+2) { border-bottom: 0; }
  .cards.two, .cards.three, .agent-grid, .skill-groups, .never { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statuses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analogy .arrow { display: none; }
  .analogy > div:not(.arrow) { flex-basis: 40%; }
  .journey-tabs button { padding: 10px; }
  .journey-tabs button small { display: none; }
  .journey-body { grid-template-columns: minmax(0, 1fr); }
  .journey-steps { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 4px; }
  .journey-steps button { white-space: nowrap; }
  .glossary { grid-template-columns: minmax(0, 1fr); }
  .glossary dt { border-bottom: 0; padding-bottom: 4px; }
  .glossary dd { padding-top: 6px; }
  .table { display: block; overflow-x: auto; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
