/* Nzinga Design System site. Shared by every page in docs/site.
   Tokens follow Nzinga Electric (apps/mobile/utils/color-theme.ts); type steps follow the app's compact scale
   (apps/mobile/tailwind.config.js): 5xl 34, 4xl 26, 2xl 20, xl 17, lg 15, base 14, sm 12.5, xs 11. */

:root,
:root[data-theme="light"] {
  /* Light by default: white page, very light grey panels and sidebar. Volt is a fill here, never text. */
  --bg: #FFFFFF;
  --sidebar: #F7F7FA;
  --panel: #F7F7FA;
  --panel-2: #ECECF1;
  --fg: #0B0B10;
  --muted: #55555F;
  --rule: rgba(11, 11, 16, 0.10);
  --rule-strong: rgba(11, 11, 16, 0.20);
  --volt: #C8FF2E;
  --on-volt: #0B0B10;
  --accent: #5C7A00;          /* coloured text on white: darkened Volt (4.95:1) */
  --magenta: #FF2D7A;
  --cyan: #0FA9AE;
  --violet: #7C5CFF;
  --flame: #FF6A1F;
  --code-bg: rgba(11, 11, 16, 0.06);
  --control: #85858E;         /* form control edges, 3.66:1 on white */
  --shadow: 0 1px 2px rgba(11, 11, 16, 0.05), 0 8px 24px rgba(11, 11, 16, 0.08);
  --spectrum: linear-gradient(180deg, #FF2D7A, #FF6A1F 50%, #C8FF2E);
  --spectrum-x: linear-gradient(90deg, #FF2D7A, #FF6A1F 50%, #C8FF2E);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0B10;
  --sidebar: #0E0E14;
  --panel: #16161D;
  --panel-2: #1D1D26;
  --fg: #F7F7FA;
  --muted: #A8A8B3;
  --rule: rgba(247, 247, 250, 0.12);
  --rule-strong: rgba(247, 247, 250, 0.22);
  --accent: #C8FF2E;
  --cyan: #19E0E6;
  --code-bg: rgba(247, 247, 250, 0.07);
  --control: #6E6E78;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

:root {
  --side-w: 272px;
  --head-h: 60px;
  --rail-w: 216px;
  --top-h: 56px;
  --font-head: "Outfit", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 20px); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 15px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--volt); color: var(--on-volt); }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skiplink { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--volt); color: var(--on-volt); padding: 10px 16px; border-radius: 9999px; font-weight: 600; text-decoration: none; }
.skiplink:focus { top: 12px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ============================================================ Sidebar */
.sidebar {
  position: fixed; top: var(--head-h); bottom: 0; left: 0; width: var(--side-w); z-index: 40;
  display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--rule);
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.side-label { font: 600 11px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.side-label:hover { color: var(--fg); }
.sidebar .side-close { display: none; }
.sheet-site { display: none; }
.side-search { position: relative; margin: 0 16px 10px; }
.side-search .search-ic { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.side-search input {
  width: 100%; height: 40px; padding: 0 36px 0 36px; border-radius: 8px; border: 1px solid var(--control);
  background: var(--bg); color: var(--fg); font: 400 14px/1 var(--font-body); outline: none; -webkit-appearance: none; appearance: none;
}
.side-search input::placeholder { color: var(--muted); }
.side-search input:focus { border-color: var(--volt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--volt) 22%, transparent); }
.side-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.side-search kbd { position: absolute; right: 10px; top: 50%; translate: 0 -50%; font: 500 11px/1 var(--font-mono); color: var(--muted); border: 1px solid var(--rule); border-radius: 5px; padding: 3px 6px; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px 20px; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; overscroll-behavior: contain; }
.nav-group { margin-bottom: 2px; }
.nav-head { display: flex; align-items: center; }
.nav-title {
  flex: 1; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; border-radius: 10px;
  color: var(--fg); text-decoration: none; font: 500 14px/1.3 var(--font-body);
}
.nav-title .icon { width: 17px; height: 17px; color: var(--muted); }
.nav-cowrie { width: 17px; display: flex; justify-content: center; color: var(--muted); }
.nav-title:hover { background: var(--panel); }
.nav-group.current > .nav-head .nav-title { font-weight: 600; }
.nav-group.current > .nav-head .nav-title .icon, .nav-group.current .nav-cowrie { color: var(--accent); }
.nav-toggle { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.nav-toggle:hover { background: var(--panel); color: var(--fg); }
.nav-toggle .icon { width: 16px; height: 16px; transition: rotate .18s ease; }
.nav-group.open .nav-toggle .icon, .nav-group.searching .nav-toggle .icon { rotate: 180deg; }
.nav-items { list-style: none; margin: 0 0 8px; padding: 2px 0 2px 19px; display: none; }
.nav-group.open .nav-items, .nav-group.searching .nav-items { display: block; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 10px 6px 16px;
  border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13.5px; line-height: 1.35;
}
.nav-item::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: var(--rule); }
.nav-item:hover { color: var(--fg); background: var(--panel); }
.nav-item.active { color: var(--fg); font-weight: 500; background: var(--panel); }
.nav-item.active::before { width: 3px; left: -1px; top: 6px; bottom: 6px; border-radius: 3px; background: var(--volt); }
.nav-ext { width: 13px !important; height: 13px !important; color: var(--muted); margin-left: 2px; }
mark { background: var(--volt); color: var(--on-volt); border-radius: 3px; padding: 0 1px; }
.nav-empty { color: var(--muted); font-size: 13px; padding: 10px 12px; margin: 0; }
.side-foot { display: flex; gap: 6px; padding: 12px 16px 16px; border-top: 1px solid var(--rule); }
.foot-link {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--rule); background: transparent; color: var(--fg); text-decoration: none;
  font: 500 13px/1 var(--font-body); cursor: pointer; white-space: nowrap;
}
.foot-link:hover { background: var(--panel); border-color: var(--rule-strong); }
.foot-link .icon { width: 16px; height: 16px; }

/* ============================================================ Global header (every page) */
.sitebar {
  position: sticky; top: 0; z-index: 45; height: var(--head-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.sitebar-in { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; flex: none; }
.brand .wordmark { color: var(--fg); }
.topnav { display: flex; align-items: center; gap: 2px; margin-left: 28px; }
.topnav a, .sheet-site a { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 9999px; color: var(--muted); text-decoration: none; font: 500 14px/1 var(--font-body); }
.topnav a:hover { color: var(--fg); background: var(--panel); }
.topnav a[aria-current="page"] { color: var(--fg); }
.topnav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--volt); }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top-gh { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 9999px; border: 1px solid var(--rule-strong); color: var(--fg); text-decoration: none; font: 500 13.5px/1 var(--font-body); }
.top-gh:hover { background: var(--panel); }
.top-gh .icon { width: 17px; height: 17px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9999px; border: 0; background: none;
  color: var(--fg); cursor: pointer; text-decoration: none; flex: none;
}
.icon-btn:hover { background: var(--panel); }
.menu-btn { display: none; margin-left: -8px; }
.scrim { display: none; }
body.no-docs .sidebar { display: none; }
body.no-docs .main { margin-left: 0; }

/* ============================================================ Footer (every page) */
.sitefoot { border-top: 1px solid var(--rule); background: var(--panel); padding: 40px 48px 28px; }
.sitefoot-in { display: flex; flex-wrap: wrap; gap: 32px 64px; justify-content: space-between; max-width: 1144px; margin: 0 auto; }
.foot-brand .motto { margin-top: 14px; }
.foot-cols { display: flex; flex-wrap: wrap; gap: 28px 56px; }
.foot-h { margin: 0 0 10px; font: 600 11px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-cols a { color: var(--fg); text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.foot-cols a:hover { text-decoration: underline; text-decoration-color: var(--volt); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.foot-gh .icon { width: 15px; height: 15px; }
.foot-note { max-width: 1144px; margin: 28px auto 0; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }

/* ============================================================ Main column */
.main { margin-left: var(--side-w); min-width: 0; }
.page { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 48px; max-width: 1240px; padding: 56px 48px 96px; margin: 0 auto; }
.doc { min-width: 0; max-width: 920px; }
.rail { position: sticky; top: calc(var(--head-h) + 32px); align-self: start; max-height: calc(100vh - var(--head-h) - 64px); overflow-y: auto; padding-left: 16px; border-left: 1px solid var(--rule); scrollbar-width: none; }
.rail-title { margin: 0 0 10px; font: 600 11px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.35; }
.rail li.sub a { padding-left: 12px; font-size: 12.5px; }
.rail li a:hover { color: var(--fg); }
.rail li a.active { color: var(--fg); font-weight: 500; box-shadow: -17px 0 0 -15px var(--volt); }

/* ============================================================ Prose */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 600 11px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--spectrum-x); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 44px; line-height: 50px; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 26px; line-height: 32px; margin: 0 0 12px; scroll-margin-top: calc(var(--head-h) + 20px); }
h3 { font-size: 17px; line-height: 24px; margin: 32px 0 8px; scroll-margin-top: calc(var(--head-h) + 20px); }
h4 { font-size: 15px; line-height: 21px; margin: 20px 0 6px; }
.anchor { margin-left: 6px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.lede { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 64ch; margin: 0 0 28px; text-wrap: pretty; }
.doc p, .doc li { max-width: 70ch; text-wrap: pretty; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 20px; margin: 0 0 16px; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--muted); }
.doc strong { font-weight: 600; }
.doc a:not([class]) { color: var(--fg); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--volt) 70%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.doc a:not([class]):hover { text-decoration-color: var(--volt); }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }
:not(pre) > code { background: var(--code-bg); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre { margin: 0 0 16px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); overflow-x: auto; font: 13px/1.6 var(--font-mono); }
.block { padding-top: 56px; margin-top: 56px; border-top: 1px solid var(--rule); }
.block:first-of-type { margin-top: 40px; }
.src { display: block; margin: -2px 0 18px; font: 12px/1.75 var(--font-mono); color: var(--muted); max-width: 90ch; overflow-wrap: anywhere; }
.src::before { content: "Source"; display: inline-block; margin-right: 8px; font: 600 10.5px/1.6 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.src b { color: var(--fg); font-weight: 500; margin-right: 6px; }
.src code { background: none; padding: 0; font-size: 1em; color: var(--fg); }
.cap { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 8px 0 0; }

/* ============================================================ Blocks */
.cols { display: grid; gap: 14px; margin-bottom: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.box { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.box h3, .box h4 { margin-top: 0; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box .k { display: block; font: 600 11px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
a.box { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, background .15s; }
a.box:hover { border-color: var(--rule-strong); background: var(--panel-2); }
a.box:hover .go { translate: 3px 0; color: var(--fg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.box .title { font: 600 17px/1.3 var(--font-head); margin: 0 0 4px; }
.box .desc { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; }
.go { width: 18px; height: 18px; color: var(--muted); transition: translate .15s, color .15s; }
.ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); color: var(--fg); flex: none; }
.ico .icon { width: 20px; height: 20px; }
.ico.volt { background: var(--volt); color: var(--on-volt); }
.ico.magenta { background: var(--magenta); color: #0B0B10; }
.ico.cyan { background: var(--cyan); color: #0B0B10; }
.ico.violet { background: var(--violet); color: #0B0B10; }
.ico.flame { background: var(--flame); color: #0B0B10; }

.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--rule); margin: 0 0 18px; max-width: 78ch; }
.callout > .icon { width: 20px; height: 20px; margin-top: 2px; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout.info { box-shadow: inset 3px 0 0 var(--cyan); }
.callout.info > .icon { color: var(--cyan); }
.callout.warn { box-shadow: inset 3px 0 0 var(--flame); }
.callout.warn > .icon { color: var(--flame); }
.callout.volt { box-shadow: inset 3px 0 0 var(--volt); }
.callout.volt > .icon { color: var(--accent); }
.callout.violet { box-shadow: inset 3px 0 0 var(--violet); }
.callout.violet > .icon { color: var(--violet); }

/* Status tags: what is true in the app today */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 9999px; font: 600 11px/1 var(--font-body); white-space: nowrap; vertical-align: 2px; border: 1px solid var(--rule); color: var(--fg); background: var(--panel); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.tag.built::before { background: var(--volt); }
.tag.partial::before { background: var(--cyan); }
.tag.todo::before { background: var(--flame); }
.tag.rule::before { background: var(--violet); }
.tag.pass { background: var(--volt); color: var(--on-volt); border-color: transparent; }
.tag.pass::before { background: var(--on-volt); }
.tag.fail { background: transparent; color: var(--fg); border-color: var(--flame); }
.tag.fail::before { background: var(--flame); }
.tag.large { border-color: var(--cyan); }
.tag.large::before { background: var(--cyan); }

/* Do / Don't */
.dd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.dd > div { border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--rule); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.dd .lab { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font: 600 12px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--rule); }
.dd .lab .icon { width: 16px; height: 16px; }
.dd .do .lab { box-shadow: inset 0 3px 0 var(--volt); }
.dd .do .lab .icon { color: var(--accent); }
.dd .dont .lab { box-shadow: inset 0 3px 0 var(--flame); }
.dd .dont .lab .icon { color: var(--flame); }
.dd .body { padding: 16px; flex: 1; display: grid; gap: 10px; align-content: start; }
.dd .say { font-size: 15px; line-height: 1.5; margin: 0; }
.dd .dont .say { color: var(--muted); }
.dd .why { font-size: 13px; color: var(--muted); margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--rule); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
th { font: 600 11.5px/1.4 var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; overflow-wrap: normal; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .muted, .doc p .muted { color: var(--muted); }
.yes, .no { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.yes .icon { color: var(--accent); width: 16px; height: 16px; }
.no .icon { color: var(--flame); width: 16px; height: 16px; }

/* Lists of facts */
.facts { list-style: none; padding: 0 !important; margin: 0 0 18px; display: grid; gap: 0; border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; }
.facts li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 13px 16px; margin: 0; max-width: none; border-bottom: 1px solid var(--rule); background: var(--panel); }
.facts li:last-child { border-bottom: 0; }
.facts li .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--muted); }
.facts li.ok .icon { color: var(--accent); }
.facts li.never .icon { color: var(--flame); }
.facts b { font-weight: 600; }

/* Swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 0 0 16px; }
.swatch { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; border-radius: var(--r-lg); border: 1px solid var(--rule); background: var(--panel); overflow: hidden; cursor: copy; text-align: left; padding: 0; color: inherit; font: inherit; }
.swatch .chip { position: relative; height: 96px; display: flex; align-items: flex-end; justify-content: space-between; padding: 10px 12px; font: 600 13px/1 var(--font-body); }
.swatch .chip .aa { font: 600 22px/1 var(--font-head); }
.swatch .meta { padding: 12px 14px 14px; display: grid; gap: 3px; }
.swatch .meta b { font: 600 15px/1.2 var(--font-head); }
.swatch .meta .hex { font: 12px/1.4 var(--font-mono); color: var(--muted); }
.swatch .meta .role { font-size: 13px; color: var(--muted); line-height: 1.45; }
.swatch .ratios { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.swatch.copied .hex::after { content: "  copied"; color: var(--accent); }
[data-copy] { cursor: copy; }

/* Type specimens */
.specimen { border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; margin: 0 0 18px; }
.spec-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: baseline; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.spec-row:last-child { border-bottom: 0; }
.spec-row > span:first-child { font: 12px/1.4 var(--font-mono); color: var(--muted); }
.spec-row > span:first-child b { display: block; color: var(--fg); font-weight: 500; }

/* Phone-like card for copy examples */
.phones { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 18px; }
.phone {
  width: 360px; max-width: 100%; flex: none; border-radius: 28px; overflow: hidden; min-height: 300px;
  display: flex; flex-direction: column; background: var(--color-background);
  border: 1px solid var(--rule-strong); box-shadow: var(--shadow);
}
.phone .notch { height: 26px; display: flex; justify-content: center; align-items: center; }
.phone .notch::before { content: ""; width: 64px; height: 16px; border-radius: 9999px; background: #000; }
.phone .screen { padding: 4px 20px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.phone .ptitle { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 26px; }
.phone .pbody { font-size: 14px; line-height: 20px; color: var(--color-subtext); }
.phone .grow { flex: 1; }
.phone-cap { width: 360px; max-width: 100%; }
.phone-cap .cap { margin-top: 10px; }
.phone .pheader { display: flex; align-items: center; gap: 12px; padding: 6px 20px 8px; font-weight: 700; font-size: 15px; }
.phone .pheader .icon { width: 22px; height: 22px; }

/* Live example frames (the .nz scope comes from ds/nzinga-ds.css) */
.demo { border-radius: var(--r-xl); padding: 20px; display: grid; gap: 16px; min-width: 0; margin: 0 0 16px; }
.demo.nz { background: var(--color-background); outline: 1px solid var(--rule); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 0 0 16px; }
.two > .nz { border-radius: var(--r-xl); padding: 20px; background: var(--color-background); min-width: 0; outline: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.demo .cap, .two .cap { margin: 0; color: var(--color-subtext); }
.spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 24px; margin: 0 0 16px; padding: 0 !important; list-style: none; font-size: 13px; color: var(--muted); }
.spec li { margin: 0; max-width: none; }
.spec li b { color: var(--fg); font-weight: 500; }
.media-fill { width: 100%; height: 100%; background: linear-gradient(135deg, #FF2D7A, #FF6A1F 50%, #C8FF2E); }
.stage { position: relative; min-height: 120px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #7C5CFF, #19E0E6); }
.phone-slab { position: relative; overflow: hidden; border-radius: 12px; min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; }
.comp { padding-top: 36px; margin-top: 36px; border-top: 1px dashed var(--rule); }
.comp:first-of-type { border-top: 0; margin-top: 8px; padding-top: 0; }
.comp > h3 { margin-top: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.comp > h3 .from { font: 500 11px/1 var(--font-body); color: var(--muted); border: 1px solid var(--rule); border-radius: 9999px; padding: 4px 8px; letter-spacing: .02em; }
.comp .src::before { content: "File"; }

/* Component index */
.cindex { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 0; }
.cindex .grp { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px; min-width: 0; }
.cindex .grp > a { display: flex; align-items: center; gap: 8px; font: 600 15px/1.2 var(--font-head); text-decoration: none; margin-bottom: 10px; }
.cindex .grp > a .icon { color: var(--accent); width: 16px; height: 16px; }
.cindex ul { list-style: none; padding: 0 !important; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cindex li { margin: 0; }
.cindex li a { display: inline-block; padding: 4px 10px; border-radius: 9999px; border: 1px solid var(--rule); color: var(--muted); text-decoration: none; font-size: 12.5px; line-height: 1.4; }
.cindex li a:hover { color: var(--fg); border-color: var(--volt); }
.doc .cindex a, .doc .pager a, .doc a.box, .doc a.foot-link { text-decoration: none; }

/* Overview hero */
.hero { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: center; padding: 36px; margin: 0 0 8px; border-radius: var(--r-xl); background: var(--panel); border: 1px solid var(--rule); overflow: hidden; isolation: isolate; }
.hero::after { content: ""; position: absolute; inset: auto -20% -60% 30%; height: 120%; background: radial-gradient(closest-side, color-mix(in srgb, var(--magenta) 16%, transparent), transparent); z-index: -1; }
.hero::before { content: ""; position: absolute; inset: -50% -10% auto 50%; height: 110%; background: radial-gradient(closest-side, color-mix(in srgb, var(--volt) 12%, transparent), transparent); z-index: -1; }
.hero-mark { display: grid; place-items: center; }
.hero-mark .cowrie { width: 112px; height: auto; }
.hero h1 { margin-bottom: 12px; }
.hero .lede { margin-bottom: 0; }
.hero .wm { color: var(--fg); margin-bottom: 18px; }
.hero .wm .wordmark { width: 180px; height: auto; }
.motto { font: 600 15px/1.4 var(--font-head); margin: 18px 0 0; color: var(--fg); }
/* Spectrum as a rule under the words, never as text colour (Volt and Flame fail as text on white). */
.motto span { padding-bottom: 4px; background: var(--spectrum-x) no-repeat left bottom / 100% 3px; }

.principle { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.principle .title { margin-bottom: 6px; }
.numbered { counter-reset: n; list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.numbered > li { counter-increment: n; position: relative; padding: 14px 16px 14px 52px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); margin: 0; max-width: 78ch; }
.numbered > li::before { content: counter(n); position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--volt); color: var(--on-volt); font: 700 12.5px/1 var(--font-body); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; counter-reset: s; }
.steps > div { counter-increment: s; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px; min-width: 0; }
.steps > div::before { content: counter(s, decimal-leading-zero); display: block; font: 600 11px/1 var(--font-mono); color: var(--accent); margin-bottom: 8px; }
.steps b { display: block; font: 600 14.5px/1.3 var(--font-head); margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 13px; line-height: 1.5; display: block; }

.quote { border-left: 3px solid; border-image: var(--spectrum) 1; padding: 4px 0 4px 18px; margin: 0 0 18px; font: 500 19px/1.5 var(--font-head); max-width: 60ch; }
.quote small { display: block; margin-top: 6px; font: 400 13px/1.5 var(--font-body); color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--rule); }
.pager a { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--rule); text-decoration: none; }
.pager a:hover { border-color: var(--volt); }
.pager a.next { text-align: right; }
.pager span { font-size: 12px; color: var(--muted); }
.pager b { font: 600 16px/1.3 var(--font-head); }

.lockrow { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.lock { flex: 1 1 200px; min-height: 180px; border-radius: var(--r-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; border: 1px solid var(--rule); position: relative; }
.lock .lab { position: absolute; left: 14px; top: 12px; font: 600 11px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.lock.k-black { background: #0B0B10; color: #F7F7FA; }
.lock.k-white { background: #F7F7FA; color: #0B0B10; }
.lock.k-volt { background: #C8FF2E; color: #0B0B10; border-color: transparent; }
.lock.k-magenta { background: #FF2D7A; color: #0B0B10; border-color: transparent; }
.lock .lk { display: flex; align-items: center; gap: 16px; }
.misuse { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.misuse > div { position: relative; border-radius: var(--r-md); background: #0B0B10; border: 1px solid var(--rule); display: grid; place-items: center; gap: 10px; padding: 22px 10px 14px; font-size: 12.5px; color: #F7F7FA; text-align: center; }
.misuse > div { overflow: hidden; }
.misuse > div::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--flame); }
.clearspace { position: relative; display: inline-grid; place-items: center; padding: 34px; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--magenta) 22%, transparent) 0 6px, transparent 6px 12px); border-radius: 8px; outline: 1px dashed var(--magenta); }
.clearspace > div { background: #0B0B10; padding: 0; outline: 1px solid rgba(247,247,250,.25); color: #C8FF2E; }

/* ============================================================ Responsive */
@media (max-width: 1279px) {
  .page { grid-template-columns: minmax(0, 1fr); padding: 48px 40px 88px; }
  .rail { display: none; }
}
@media (max-width: 1023px) {
  .sidebar {
    top: 0; z-index: 60; width: min(320px, 88vw); translate: -100% 0; transition: translate .22s ease;
    padding-bottom: env(safe-area-inset-bottom, 0px); visibility: hidden;
  }
  body.no-docs .sidebar { display: flex; }
  body.nav-open .sidebar { translate: 0 0; box-shadow: 0 0 60px rgba(0, 0, 0, .3); visibility: visible; }
  .sidebar .side-close { display: inline-grid; }
  .menu-btn { display: inline-grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(11, 11, 16, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .main { margin-left: 0; }
  .page { padding: 36px 24px 80px; }
  .sitefoot { padding: 32px 24px 24px; }
}
@media (max-width: 760px) {
  .topnav { display: none; }
  .sheet-site { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
  .sheet-site a { border: 1px solid var(--rule-strong); height: 34px; }
  .sheet-site a[aria-current="page"] { background: var(--volt); color: var(--on-volt); border-color: transparent; }
  body { font-size: 15px; }
  h1 { font-size: 34px; line-height: 40px; }
  h2 { font-size: 23px; line-height: 29px; }
  .lede { font-size: 16.5px; }
  .g2, .g3, .g4, .dd, .cindex { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; gap: 22px; }
  .hero-mark { justify-items: start; }
  .hero-mark .cowrie { width: 64px; }
  .block { padding-top: 40px; margin-top: 40px; }
  .spec-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .misuse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager a.next { text-align: left; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .two > .nz, .demo { padding: 16px; }
  .phone, .phone-cap { width: 100%; max-width: 360px; }
}
@media (max-width: 420px) {
  .page { padding: 28px 16px 72px; }
  .sitebar-in { padding: 0 12px; }
  .top-gh .gh-label { display: none; }
  .top-gh { width: 40px; padding: 0; justify-content: center; border: 0; }
  .box { padding: 16px; }
  th, td { padding: 9px 10px; }
  .swatches { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .swatch .chip { height: 72px; }
  .sitefoot { padding: 28px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .sitebar, .rail, .pager, .scrim, .sitefoot { display: none !important; }
  .main { margin: 0; }
}
