/*
  VibeLens documentation site.

  This stylesheet follows the rules the project ships in docs/design/. Where a
  choice is deliberate and could otherwise look like an oversight, the reason is
  in a comment.

  Structure
  ---------
  1. Primitive tokens (oklch ramps)
  2. Semantic tokens (dark default, light remap)
  3. Reset and base typography
  4. Header, primary nav, search
  5. Sidebar and drawer
  6. Content, code, tables
  7. Landing page
  8. Responsive, reduced motion, print
*/

/* ------------------------------------------------- 1. primitive tokens ---- */

:root {
  /* One hue (265) runs through the neutrals so surfaces read as a family
     rather than as flat grey. oklch keeps the lightness steps perceptually
     even, which hsl() does not: see docs/design/COLOR.md. */
  --n-980: oklch(15.5% 0.018 265);
  --n-960: oklch(18% 0.021 265);
  --n-940: oklch(21% 0.024 265);
  --n-900: oklch(25% 0.026 265);
  --n-850: oklch(30% 0.028 265);
  --n-800: oklch(35% 0.028 265);
  --n-700: oklch(46% 0.026 265);
  --n-600: oklch(58% 0.024 265);
  --n-500: oklch(68% 0.02 265);
  --n-400: oklch(78% 0.015 265);
  --n-300: oklch(86% 0.011 265);
  --n-200: oklch(91.5% 0.008 265);
  --n-100: oklch(95% 0.006 265);
  --n-050: oklch(97.4% 0.005 265);

  /* Accent: a teal-cyan, derived as one hue with an even lightness ramp. */
  --a-300: oklch(88% 0.10 200);
  --a-400: oklch(82% 0.125 200);
  --a-500: oklch(74% 0.14 202);
  --a-600: oklch(63% 0.135 208);
  --a-700: oklch(52% 0.115 212);

  /* Secondary, used only for the gradient pair and one accent detail. Two
     accents is a system; five is a rainbow. */
  --v-400: oklch(80% 0.13 300);
  --v-500: oklch(70% 0.17 300);
  --v-600: oklch(58% 0.19 300);

  --ok-400: oklch(80% 0.15 158);
  --ok-600: oklch(56% 0.14 158);
  --warn-400: oklch(83% 0.14 78);
  --err-400: oklch(75% 0.16 22);
  --err-600: oklch(56% 0.19 22);

  /* Type scale, ratio 1.25 from a 1rem base, line heights paired to size. */
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.1875rem;
  --text-3xl: clamp(2.25rem, 1.55rem + 2.6vw, 3.4rem);

  --leading-tight: 1.1;
  --leading-snug: 1.32;
  --leading-normal: 1.6;
  --leading-relaxed: 1.72;

  /* 4px spacing scale. */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;
  --s-24: 6rem;

  /* Radii as steps, so elevation and scale carry meaning. */
  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --dur-instant: 90ms;
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.16, 0.84, 0.44, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.35, 1);

  --z-content: 1;
  --z-sticky: 20;
  --z-header: 40;
  --z-drawer: 50;
  --z-overlay: 60;

  --measure: 74ch;
  --header-h: 64px;
  --sidebar-w: 282px;
  --toc-w: 224px;

  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* -------------------------------------------------- 2. semantic tokens ---- */

:root,
[data-theme="light"] {
  color-scheme: light;

  --bg: #F9F8F4;               /* Warm Alabaster / Rice Paper */
  --bg-alt: #F2F0EB;           /* Soft Earthy Paper */
  --surface: #FFFFFF;          /* Pure Card White */
  --surface-raised: #EFECE6;   /* Soft Clay */
  --surface-sunken: #EBE7DF;
  --border: #E6E2DA;           /* Subtle Stone Border */
  --border-soft: #EFECE6;
  --border-strong: #D5CFC3;

  --text-strong: #2D3A31;      /* Deep Forest Green (Primary Text) */
  --text: #3A473E;             /* Soft Forest Charcoal */
  --text-muted: #65756B;       /* Muted Olive/Sage text */
  --text-subtle: #8C9A84;      /* Sage Green */

  --accent: #8C9A84;           /* Sage Green */
  --accent-hover: #788670;
  --accent-quiet: rgba(140, 154, 132, 0.12);
  --accent-contrast: #F9F8F4;
  --terracotta: #C27B66;       /* Terracotta Accent */
  --terracotta-hover: #AA6551;
  --violet: #9B8BAA;
  --success: #6E8B74;
  --warning: #D9A05B;
  --danger: #C27B66;

  --shadow-sm: 0 4px 6px -1px rgba(45, 58, 49, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(45, 58, 49, 0.05);
  --shadow-lg: 0 20px 40px -10px rgba(45, 58, 49, 0.07);
  --selection: rgba(140, 154, 132, 0.25);
  --header-bg: rgba(249, 248, 244, 0.88);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #141C16;               /* Deep Botanical Forest Dark */
  --bg-alt: #1A241C;
  --surface: #1E2B21;
  --surface-raised: #25352A;
  --surface-sunken: #0F1611;
  --border: rgba(230, 226, 218, 0.12);
  --border-soft: rgba(230, 226, 218, 0.06);
  --border-strong: rgba(230, 226, 218, 0.22);

  --text-strong: #F9F8F4;
  --text: #E3DEC3;
  --text-muted: #A3B2A1;
  --text-subtle: #7D8E7B;

  --accent: #A3B2A1;
  --accent-hover: #B7C7B5;
  --accent-quiet: rgba(163, 178, 161, 0.15);
  --accent-contrast: #141C16;
  --terracotta: #D98A75;
  --terracotta-hover: #E49B86;
  --violet: #B6A7C6;
  --success: #88A68E;
  --warning: #E8B475;
  --danger: #D98A75;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --selection: rgba(163, 178, 161, 0.3);
  --header-bg: rgba(20, 28, 22, 0.88);
}

/* ----------------------------------------------------------- 3. base ----- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) transparent;
}

.paper-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }

::selection { background: var(--selection); }

img, svg { max-width: 100%; height: auto; display: block; }

/* One visible focus treatment everywhere. Removing it is tell 14 in
   docs/design/ANTI-SLOP.md. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

a {
  color: var(--accent);
  text-decoration-color: color-mix(in oklch, var(--accent) 40%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease-out),
    text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

:target { scroll-margin-top: calc(var(--header-h) + var(--s-5)); }

kbd {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-2);
  z-index: var(--z-overlay);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); color: var(--accent-contrast); }

/* --------------------------------------------------------- 4. header ----- */

/* --------------------------------------------------------- 4. header ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 24px -4px color-mix(in oklch, var(--text-strong) 4%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: var(--header-h);
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 var(--s-6);
  padding-left: max(var(--s-6), env(safe-area-inset-left));
  padding-right: max(var(--s-6), env(safe-area-inset-right));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  text-decoration: none;
}
.brand:hover { color: var(--text-strong); }
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  transition: transform 0.2s ease;
}
.brand:hover img {
  transform: scale(1.08) rotate(-4deg);
}
.brand b { font-weight: inherit; }
.brand span {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--terracotta);
}
.brand .version {
  padding: 2px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 20px;
  font-size: 13.5px;
}
.primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease-out);
}
.primary-nav a:hover {
  color: var(--text-strong);
  background: var(--surface-raised);
}
.primary-nav a[aria-current="true"] {
  color: var(--text-strong);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.primary-nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--terracotta);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-subtle);
  font-family: var(--font-sans);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text-muted);
  background: var(--surface);
}
.search-trigger svg { width: 15px; height: 15px; stroke-width: 2; flex: none; }
.search-trigger span { flex: 1; }
.search-trigger kbd {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-subtle);
  flex: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.icon-button:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: var(--surface);
  transform: translateY(-1px);
}
.icon-button:active { transform: translateY(0); }
.icon-button svg { width: 18px; height: 18px; stroke-width: 1.8; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

.nav-toggle { display: none; }

/* Search dialog ------------------------------------------------------------ */

.search-dialog {
  width: min(640px, calc(100vw - var(--s-8)));
  max-height: min(70vh, 560px);
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-alt);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-dialog::backdrop {
  background: oklch(12% 0.02 265 / 0.62);
  backdrop-filter: blur(3px);
}
.search-dialog[open] { display: flex; flex-direction: column; }

.search-box {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-subtle);
}
.search-box svg { width: 18px; height: 18px; stroke-width: 1.8; flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text-strong);
  font: inherit;
  font-size: var(--text-md);
}
.search-box input::placeholder { color: var(--text-subtle); }
.search-box input:focus { outline: none; }
.search-box input::-webkit-search-cancel-button { appearance: none; }

.search-results { overflow-y: auto; padding: var(--s-2); }

.search-result {
  display: grid;
  gap: 2px;
  padding: var(--s-3);
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}
.search-result:hover { background: var(--surface); color: var(--text); }
.search-result[aria-selected="true"] {
  background: var(--accent-quiet);
  border-color: color-mix(in oklch, var(--accent) 34%, transparent);
  color: var(--text-strong);
}
.search-result-group {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.search-result-title { font-weight: 600; color: var(--text-strong); }
.search-result-snippet {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-snug);
  /* Two lines keeps every result the same height, so the list is scannable. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in oklch, var(--accent) 30%, transparent);
  color: inherit;
  font-weight: 600;
}

.search-empty { margin: 0; padding: var(--s-6) var(--s-4); color: var(--text-muted); font-size: var(--text-sm); }
.search-hint {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--text-subtle);
  font-size: var(--text-xs);
}

/* -------------------------------------------------------- 5. sidebar ----- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  max-width: 1660px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-6) var(--s-3) var(--s-16) var(--s-6);
  border-right: 1px solid var(--border-soft);
  font-size: var(--text-sm);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: padding-box; }

.nav-group { margin-bottom: var(--s-2); }

.nav-group > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-2);
  border-radius: var(--r-sm);
  color: var(--text-subtle);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { color: var(--text-muted); }
.nav-group > summary span { flex: 1; }
.nav-group .chev {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav-group[open] > summary .chev { transform: rotate(90deg); }

.sidebar ul { margin: var(--s-1) 0 var(--s-4); padding: 0 0 0 var(--s-2); list-style: none; }
.sidebar li { margin: 1px 0; }

.sidebar li a {
  display: block;
  padding: var(--s-2) var(--s-3);
  /* The rail is on the list, and the active item lights its own segment, which
     makes position in a long list obvious without indentation games. */
  border-left: 2px solid var(--border-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.sidebar li a:hover {
  color: var(--text-strong);
  background: var(--surface);
  border-left-color: var(--border-strong);
}
.sidebar li a[aria-current="page"] {
  color: var(--text-strong);
  background: var(--accent-quiet);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-sticky);
  background: oklch(12% 0.02 265 / 0.55);
  backdrop-filter: blur(2px);
}

/* -------------------------------------------------------- 6. content ---- */

.main { min-width: 0; padding: var(--s-10) var(--s-10) var(--s-24); }

.with-toc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  gap: var(--s-12);
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + var(--s-10));
  max-height: calc(100vh - var(--header-h) - var(--s-16));
  overflow-y: auto;
  padding-left: var(--s-4);
  border-left: 1px solid var(--border-soft);
  font-size: var(--text-sm);
  scrollbar-width: thin;
}
.toc p {
  margin: 0 0 var(--s-3);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li { margin: var(--s-1) 0; }
.toc a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  line-height: var(--leading-snug);
  transition: color var(--dur-fast) var(--ease-out);
}
.toc a:hover { color: var(--text-strong); }
.toc a.is-active { color: var(--accent); font-weight: 600; }
.toc .lvl-3 { padding-left: var(--s-3); font-size: var(--text-xs); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  font-size: var(--text-xs);
  color: var(--text-subtle);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-6);
  margin-bottom: var(--s-5);
}
.page-head h1 { margin: 0; }

.edit-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  flex: none;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 550;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.edit-link:hover { color: var(--text-strong); border-color: var(--border-strong); }
.edit-link svg { width: 13px; height: 13px; stroke-width: 1.9; }

.prose {
  width: 100%;
  max-width: 960px;
}
.prose > * + * { margin-top: var(--s-4); }

.prose h1 {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  /* Display sizes get negative tracking; body text never does. */
  letter-spacing: -0.026em;
  font-weight: 700;
  color: var(--text-strong);
  text-wrap: balance;
}

.prose h2 {
  margin-top: var(--s-12);
  margin-bottom: var(--s-3);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border-soft);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  letter-spacing: -0.014em;
  font-weight: 660;
  color: var(--text-strong);
  text-wrap: balance;
}

.prose h3 {
  margin-top: var(--s-8);
  margin-bottom: var(--s-2);
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  font-weight: 640;
  color: var(--text-strong);
}

.prose h4 {
  margin-top: var(--s-6);
  margin-bottom: var(--s-2);
  font-size: var(--text-base);
  font-weight: 640;
  color: var(--text-strong);
}

.prose p { margin: 0; line-height: var(--leading-relaxed); text-wrap: pretty; }
.prose strong { color: var(--text-strong); font-weight: 640; }

.prose ul, .prose ol { margin: 0; padding-left: var(--s-5); }
.prose li { margin: var(--s-2) 0; line-height: var(--leading-relaxed); }
.prose li::marker { color: var(--text-subtle); }

/* Blockquotes read as callouts: the docs use them for the one thing on a page
   that must not be skimmed past. */
.prose blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-5);
  border: 1px solid color-mix(in oklch, var(--accent) 26%, transparent);
  border-left-width: 3px;
  border-left-color: var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--accent-quiet);
  color: var(--text);
}
.prose blockquote > :first-child { margin-top: 0; }

.prose hr { margin: var(--s-10) 0; border: 0; border-top: 1px solid var(--border-soft); }

.heading-anchor {
  margin-left: var(--s-2);
  color: var(--text-subtle);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
h2:hover > .heading-anchor,
/* Code -------------------------------------------------------------------- */

.prose :not(pre) > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in oklch, var(--text-strong) 5%, transparent);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 500;
}

/* Parameter names in the first column get crisp terracotta emphasis */
.prose td:first-child code {
  color: var(--terracotta);
  background: color-mix(in oklch, var(--terracotta) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--terracotta) 22%, transparent);
  font-weight: 700;
  font-size: 0.88em;
  padding: 3px 8px;
  border-radius: 6px;
}

.code-block {
  position: relative;
  margin: var(--s-5) 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.code-block:hover {
  border-color: var(--border-strong);
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--s-3);
  background: color-mix(in oklch, var(--surface) 60%, transparent);
  border-bottom: 1px solid var(--border-soft);
  min-height: 36px;
}
.code-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.code-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red { background: #ff5f56; border: 1px solid #e0443e; }
.dot-yellow { background: #ffbd2e; border: 1px solid #dea123; }
.dot-green { background: #27c93f; border: 1px solid #1aab29; }

.code-block pre {
  margin: 0;
  padding: var(--s-4) var(--s-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.62;
  tab-size: 2;
  background: transparent !important;
}
.code-block pre code { background: transparent; border: none; padding: 0; }

/* shiki emits both themes as CSS variables; pick one per theme. */
[data-theme="dark"] .shiki,
[data-theme="dark"] .shiki span { color: var(--shiki-dark, inherit); }
[data-theme="light"] .shiki,
[data-theme="light"] .shiki span { color: var(--shiki-light, inherit); }

.code-lang {
  position: static;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: lowercase;
}
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.copy-button:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
}
.copy-button[data-state="done"] {
  color: var(--success);
  border-color: color-mix(in oklch, var(--success) 40%, transparent);
  background: color-mix(in oklch, var(--success) 12%, transparent);
  opacity: 1;
}

/* Callouts ----------------------------------------------------------------- */

.callout {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}
.callout-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.callout-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }

.callout-note {
  border-left-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, var(--surface));
  border-color: color-mix(in oklch, var(--accent) 25%, var(--border));
}
.callout-note .callout-title { color: var(--accent); }

.callout-tip {
  border-left-color: var(--success);
  background: color-mix(in oklch, var(--success) 8%, var(--surface));
  border-color: color-mix(in oklch, var(--success) 25%, var(--border));
}
.callout-tip .callout-title { color: var(--success); }

.callout-warning {
  border-left-color: var(--warning);
  background: color-mix(in oklch, var(--warning) 8%, var(--surface));
  border-color: color-mix(in oklch, var(--warning) 25%, var(--border));
}
.callout-warning .callout-title { color: var(--warning); }

.callout-important, .callout-caution {
  border-left-color: var(--danger);
  background: color-mix(in oklch, var(--danger) 8%, var(--surface));
  border-color: color-mix(in oklch, var(--danger) 25%, var(--border));
}
.callout-important .callout-title, .callout-caution .callout-title { color: var(--danger); }

/* Tables ------------------------------------------------------------------ */

.table-wrap {
  margin: var(--s-6) 0;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.prose th {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in oklch, var(--surface-sunken) 70%, var(--surface));
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
.prose td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  line-height: 1.55;
  color: var(--text);
}
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.prose tbody tr:hover { background: color-mix(in oklch, var(--surface-raised) 60%, transparent); }

.prose img { border-radius: var(--r-md); }
.prose figure { margin: var(--s-6) 0; }
.mermaid { margin: var(--s-6) 0; text-align: center; }

.page-nav {
  display: flex;
  gap: var(--s-4);
  margin-top: var(--s-16);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border-soft);
}
.page-nav a {
  flex: 1;
  display: grid;
  gap: 2px;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.page-nav a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.page-nav a.next { text-align: right; }
.page-nav small {
  color: var(--text-subtle);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-nav strong { color: var(--text-strong); font-weight: 600; }

/* ------------------------------------------------------ 7. landing ------ */

.home { padding: 0; }

.hero {
  position: relative;
  padding: var(--s-24) var(--s-8) var(--s-20);
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
/* Two soft washes rather than a single centred blob: the light falls from one
   direction, which is what stops it reading as a template gradient. */
.hero::before {
  content: "";
  position: absolute;
  inset: -50% 40% 30% -15%;
  background: radial-gradient(closest-side, color-mix(in oklch, var(--accent) 20%, transparent), transparent);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 20% -15% -60% 50%;
  background: radial-gradient(closest-side, color-mix(in oklch, var(--violet) 15%, transparent), transparent);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: var(--z-content); max-width: 1180px; margin: 0 auto; }

/* -------------------------------------------------------- 7. landing ---- */

.hero {
  position: relative;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: var(--z-content);
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 8px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-strong);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}
.hero-eyebrow b { color: var(--text-strong); font-weight: 700; }
.hero-eyebrow .eyebrow-sep { color: var(--text-subtle); }
.botanical-leaf { font-size: 1rem; }

.hero-title {
  margin: 0 0 28px;
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5.8vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-strong);
  text-wrap: balance;
}
.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--terracotta);
}

.hero-lede {
  max-width: 680px;
  margin: 0 0 40px;
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text-muted);
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.button-primary {
  background: var(--text-strong);
  color: var(--bg);
  border: 1px solid var(--text-strong);
  box-shadow: var(--shadow-md);
}
.button-primary:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.button-secondary {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text-strong);
}
.button-secondary:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
  transform: translateY(-2px);
  background: var(--accent-quiet);
}

.hero-terminal {
  width: 100%;
  max-width: 660px;
  margin-top: 52px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-terminal:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 30px var(--accent-quiet);
  transform: translateY(-3px);
}
.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-soft);
}
.terminal-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}
.terminal-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.terminal-title {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.terminal-body {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-strong);
  overflow-x: auto;
}
.terminal-body .prompt {
  color: var(--terracotta);
  font-weight: 700;
  user-select: none;
}
.terminal-body code {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 24px;
}
.section + .section {
  border-top: 1px solid var(--border);
}
.section-head {
  max-width: 680px;
  margin-bottom: 56px;
}
.section-head h2 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-strong);
  text-wrap: balance;
}
.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.72;
}

.payload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.card {
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-strong);
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.68;
}
.card .tag { width: 10px; height: 10px; border-radius: 50%; flex: none; }

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.skill-group {
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.skill-group:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.skill-group > h3 {
  margin: 0 0 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skill-group dl { margin: 0; }
.skill-group dt {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--text-strong);
  background: var(--accent-quiet);
  border: 1px solid var(--border);
}
.skill-group dd {
  margin: 8px 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.68;
}

.figure-wide {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 90px;
}
.figure-wide figcaption {
  margin-top: 20px;
  color: var(--text-subtle);
  font-size: 0.875rem;
  text-align: center;
}
.figure-wide img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}
.figure-wide img:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.site-footer {
  padding: var(--s-10) var(--s-8);
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
  color: var(--text-subtle);
  font-size: var(--text-sm);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-5); }

/* ----------------------------------------------------- 8. responsive ---- */

@media (max-width: 1240px) {
  .with-toc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .main { padding: var(--s-8) var(--s-8) var(--s-20); }
  .search-trigger { width: 170px; }
}

@media (max-width: 1024px) {
  .primary-nav { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-grid; }
  .brand .version { display: none; }

  /* The sidebar drawer for tablet/mobile */
  .sidebar {
    position: fixed;
    inset: var(--header-h) auto 0 0;
    z-index: var(--z-drawer);
    width: min(320px, 86vw);
    max-height: none;
    padding: var(--s-5) var(--s-4) var(--s-16);
    border-right: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
  }
  .sidebar[data-open="true"] { transform: translateX(0); visibility: visible; }
}

@media (max-width: 768px) {
  .search-trigger { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 999px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  
  .main { padding: var(--s-6) var(--s-4) var(--s-16); }
  .hero { padding: var(--s-10) var(--s-4) var(--s-8); }
  .section, .figure-wide { padding-left: var(--s-4); padding-right: var(--s-4); }
  .section { padding-top: var(--s-10); padding-bottom: var(--s-10); }
  .page-nav { flex-direction: column; }
  .page-head { flex-direction: column; gap: var(--s-3); }
  .edit-link { margin-top: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 var(--s-3); gap: 6px; }
  .brand { font-size: 1.18rem; gap: 6px; }
  .brand img { width: 26px; height: 26px; }
  .search-dialog { margin-top: var(--s-4); }
}

@media (max-width: 560px) {
  .header-inner { padding: 0 var(--s-4); gap: var(--s-2); }
  .search-dialog { margin-top: var(--s-8); }
}

/* Degrade motion rather than removing meaning. See docs/design/MOTION.md. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .page-nav a:hover, .button:active, .icon-button:active { transform: none; }
  .sidebar { transition: none; }
}

/* Toast Notification & Clickable Commands ----------------------------------- */

.site-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 18px;
  border-radius: var(--r-md);
  background: #18181b;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.25);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-toast svg { color: #34d399; flex: none; }
.site-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.clickable-cmd {
  transition: all 0.15s ease;
}
.clickable-cmd:hover {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  color: #38bdf8 !important;
}
.clickable-cmd.copied-pulse {
  background: rgba(52, 211, 153, 0.3) !important;
  border-color: #34d399 !important;
  color: #34d399 !important;
}

/* Interactive Demo Simulator ----------------------------------------------- */

.interactive-demo-section {
  padding-top: 40px;
}

.demo-card-container {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-top: 32px;
}

.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}

.demo-url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex: 1;
  max-width: 500px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.demo-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terracotta);
  flex-shrink: 0;
}

.demo-run-btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  font-size: var(--text-xs);
}

.demo-url-prefix {
  color: var(--text-subtle);
}

.demo-url-input {
  background: none;
  border: none;
  color: var(--text-strong);
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  outline: none;
}

.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}

.demo-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-tab:hover {
  color: var(--text-strong);
  background: var(--surface-raised);
}

.demo-tab.active {
  color: var(--text-strong);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.demo-content-view {
  padding: 32px;
  min-height: 340px;
}

.demo-pane {
  display: none;
}

.demo-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mock-browser-window {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
}

.mock-browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}

.mock-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  margin-left: 12px;
}

.m-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.m-red { background: #f87171; }
.m-yellow { background: #fbbf24; }
.m-green { background: #34d399; }

.mock-page-body {
  padding: 32px;
  display: flex;
  justify-content: center;
}

.mock-checkout-card {
  max-width: 440px;
  width: 100%;
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mock-cart-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.mock-error-callout {
  margin: 16px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(194, 123, 102, 0.15);
  border: 1px solid var(--terracotta);
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 600;
}

.mock-btn-overflow {
  width: calc(100% + 40px);
  margin-left: -20px;
  margin-bottom: -16px;
  padding: 12px;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: default;
  position: relative;
}

.mock-terminal-window {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.console-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.c-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.console-line.error .c-tag { background: rgba(194, 123, 102, 0.2); color: var(--terracotta); }
.console-line.fail .c-tag { background: rgba(217, 160, 91, 0.2); color: var(--warning); }
.console-line.warn .c-tag { background: rgba(140, 154, 132, 0.2); color: var(--accent); }

.dom-code-view {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text-strong);
  overflow-x: auto;
}

.highlight-dom {
  background: rgba(194, 123, 102, 0.18);
  border-left: 3px solid var(--terracotta);
  display: block;
  padding: 4px 8px;
  margin: 4px 0;
  border-radius: 4px;
}

.ai-fix-card {
  padding: 28px;
  border-radius: 20px;
  background: var(--surface-raised);
  border: 1px solid var(--accent);
}

.ai-fix-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-strong);
  margin-bottom: 12px;
}

.diff-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
}

.diff-line.del { color: var(--terracotta); }
.diff-line.add { color: var(--accent); }

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(140, 154, 132, 0.2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

@media print {
  .site-header, .sidebar, .toc, .page-nav, .copy-button, .search-dialog,
  .nav-backdrop, .edit-link, .site-footer { display: none; }
  .shell, .with-toc { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; }
}
