/* PBSG Downloads: the customer portal (DESIGN_SPEC.md §P, §S). The owner's Claude Design canvas (2026-11-24): Portal,
   Get started, Docs; light and dark, with a light / dark / system switch (<html data-theme>). Values marked "gate:"
   are measured minimums. */
@font-face { font-family: "Golos Text"; src: url("GolosTextSemiBold-regular.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("GolosText-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Hind Madurai"; src: url("HindMadurai-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nova Mono"; src: url("NovaMono-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

/* ── tokens: light by default, dark when chosen, or when "system" and the computer is dark ── */
:root {
  color-scheme: light;
  --bg: #FBF8F5; --card: #FFFFFF; --well: #F4EFEA; --fg: #1F1A17; --mute: #6B625B;
  --line: rgba(31, 26, 23, 0.10); --line2: rgba(31, 26, 23, 0.18); --chip: rgba(31, 26, 23, 0.05);
  --acc: #A94E17; --fill: #B5511D; --fill-hi: #A4471A; --fill-lo: #93401A; --on-fill: #FFFFFF;
  --ok: #1B7340; --okbg: rgba(30, 127, 69, 0.10); --off: #B3261E;
  --dot: rgba(30, 26, 23, 0.09); --glow: rgba(226, 122, 63, 0.10); --ember: #E27A3F; --discord: #5865F2;
  --shadow: 0 1px 2px rgba(31, 26, 23, 0.05), 0 16px 40px rgba(31, 26, 23, 0.07);
  --head: rgba(251, 248, 245, 0.82);
  --frost: rgba(251, 248, 245, 0.88); --field: rgba(31, 26, 23, 0.56);
  --display: "Golos Text", system-ui, sans-serif; --body: "Hind Madurai", system-ui, sans-serif; --mono: "Nova Mono", ui-monospace, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A1717; --card: #221E1E; --well: #2A2525; --fg: #FFF8F2; --mute: #B8B2AD;
  --line: rgba(255, 248, 242, 0.10); --line2: rgba(255, 248, 242, 0.18); --chip: rgba(255, 248, 242, 0.06);
  --acc: #EE985D; --ok: #7CC495; --okbg: rgba(124, 196, 149, 0.14); --off: #EBA08F;
  --dot: rgba(255, 255, 255, 0.06); --glow: rgba(226, 122, 63, 0.16);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.40); --head: rgba(26, 23, 23, 0.82);
  --frost: rgba(26, 23, 23, 0.84); --field: rgba(255, 248, 242, 0.40);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #1A1717; --card: #221E1E; --well: #2A2525; --fg: #FFF8F2; --mute: #B8B2AD;
    --line: rgba(255, 248, 242, 0.10); --line2: rgba(255, 248, 242, 0.18); --chip: rgba(255, 248, 242, 0.06);
    --acc: #EE985D; --ok: #7CC495; --okbg: rgba(124, 196, 149, 0.14); --off: #EBA08F;
    --dot: rgba(255, 255, 255, 0.06); --glow: rgba(226, 122, 63, 0.16);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.40); --head: rgba(26, 23, 23, 0.82);
    --frost: rgba(26, 23, 23, 0.84); --field: rgba(255, 248, 242, 0.40);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--body); }
h1, h2, h3, p, ol { margin: 0; }
a { color: var(--acc); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.nojs { padding: 40px 24px; font-size: 20px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--mono); }
/* Lucide icons (download.js ICONS): one stroke path each, 24-box, currentColor */
.icon { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acc { display: inline-flex; color: var(--acc); }

/* ── the shell: still dots, the ember spotlight, the header, then the content in its own scroll box ── */
.shell { position: relative; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.dots, .spot { position: absolute; inset: 0; pointer-events: none; background-size: 22px 22px; }
.dots { background-image: radial-gradient(var(--dot) 0.7px, transparent 1.1px); }
.spot { opacity: 0; background-image: radial-gradient(#E27A3F 0.7px, transparent 1.1px);
  -webkit-mask-image: radial-gradient(180px circle at var(--sx, -999px) var(--sy, -999px), #000 0, transparent 100%);
  mask-image: radial-gradient(180px circle at var(--sx, -999px) var(--sy, -999px), #000 0, transparent 100%); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) { .spot { opacity: 0.6; } }
.scroll { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }

/* header */
.top { position: relative; z-index: 2; background: var(--head); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar { max-width: 1080px; margin: 0 auto; padding: 8px 24px; min-height: 60px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--fg); text-decoration: none; }
.brand img { display: block; width: 24px; height: 24px; }
.brand b { font: 700 16px var(--display); white-space: nowrap; }
.tabs { display: flex; gap: 4px; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; color: var(--mute); text-decoration: none; font: 600 14px var(--display); white-space: nowrap; }
.tab[aria-current] { background: var(--chip); color: var(--fg); }
.right { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.org { min-width: 0; font: 600 14px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 10px; background: var(--chip); }
.seg button { display: inline-grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--mute); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }

/* buttons */
.btn, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 20px; border-radius: 10px; font: 600 15px var(--display); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn { border: 0; background: var(--fill); color: var(--on-fill); }
.btn:hover { background: var(--fill-hi); color: var(--on-fill); }
.btn:active { background: var(--fill-lo); }
.btn.discord { background: var(--discord); }
.btn.discord:hover { background: #4752C4; }
.ghost { padding: 0 18px; border: 1px solid var(--line2); background: transparent; color: var(--fg); }
.ghost:hover, .ib:hover, .tab:hover, .rail:hover, .seg button:hover { background: var(--chip); color: var(--fg); }
.ghost.sm, .btn.sm { height: 42px; padding: 0 16px; font-size: 14px; }
.ghost.xs { height: 38px; padding: 0 14px; font-size: 14px; gap: 8px; }
.ghost .sub { color: var(--mute); font-weight: 600; }
.ib { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border-radius: 10px; border: 1px solid var(--line2); background: transparent; color: var(--fg); cursor: pointer; text-decoration: none; }
.ib.done { color: var(--ok); }
.ib:disabled, .ghost:disabled, .btn:disabled { cursor: progress; }
.ib[disabled] { opacity: 0.4; cursor: default; background: transparent; }
.link { padding: 0; border: 0; background: none; color: var(--acc); font: inherit; text-decoration: underline; cursor: pointer; }

/* cards and their parts */
main { max-width: 1080px; margin: 0 auto; padding: 40px 24px 72px; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.card { position: relative; border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.pad { padding: 22px 26px; }
.h2 { display: flex; align-items: center; gap: 10px; font: 700 18px var(--display); }
.h2 .mono { font-size: 14px; font-weight: 400; color: var(--mute); }
.kicker { font: 600 12px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--okbg); color: var(--ok); font: 600 12px var(--display); white-space: nowrap; }
.badge.off { background: var(--chip); color: var(--off); }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--well); min-width: 0; }
.tile .val { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .val.shown { white-space: normal; overflow-wrap: anywhere; }
.tile .val.none { font: 600 14px var(--display); color: var(--mute); white-space: normal; }
.tile .name { flex: 1; min-width: 0; font: 600 15px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .dc { display: inline-flex; color: var(--discord); }
.tiles { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.acts { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.say { margin-top: 10px; display: flex; align-items: flex-start; gap: 8px; font-size: 15px; color: var(--off); }
.say .icon { margin-top: 3px; }

/* your sandbox */
.sbx { padding: 30px; background: linear-gradient(160deg, var(--glow), transparent 60%), var(--card); border-color: rgba(226, 122, 63, 0.35); }
.sbx .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.host { margin-top: 8px; display: flex; align-items: center; gap: 12px; }
.host h1 { min-width: 0; font: 700 clamp(22px, 3vw, 34px)/1.2 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.host h1 .sch { color: var(--mute); font-weight: 600; }
.opens { margin-top: 4px; color: var(--mute); font-size: 15px; }

/* keys */
.krow { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.krow:first-child { border-top: 0; }
.keys { margin-top: 6px; }
.kv { flex: 1 1 260px; min-width: 0; font: 16px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.krow.shown .kv { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.krow.off .kv { text-decoration: line-through; text-decoration-color: var(--mute); color: var(--mute); }
.krow.hidden .kv { font: 600 14px var(--display); color: var(--mute); white-space: normal; }
.kwhen { font-size: 14px; color: var(--mute); white-space: nowrap; }

/* Hub and apps */
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.ostiles { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.ostile .sub { font-weight: 600; opacity: 0.85; }
.ostile.on .sub { opacity: 1; }
.apps { margin-top: 8px; }
.atile { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.atile:last-child { border-bottom: 0; }
.atile h3 { flex: 1 1 auto; display: flex; align-items: baseline; gap: 12px; min-width: 0; font: 600 15px var(--display); }
.atile h3 .mono { font-size: 14px; font-weight: 400; color: var(--mute); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* AI access (§A): the docs token for AI agents */
/* a grid so the docs link sits at the title row's right end yet comes last in the DOM (and on a phone, last on the card) */
.ai { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: start; }
.ai > * { grid-column: 1 / -1; }
.ai > .ai-top { grid-column: 1; grid-row: 1; }
.ai > .ai-docs { grid-column: 2; grid-row: 1; }
.ai-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; }
.ai-why { margin-top: 4px; font-size: 15px; color: var(--mute); }
.ai-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--mute); }
.ai-tok { margin-top: 14px; }
.ai-tok .val { font-size: 15px; }
.ai-once { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.ai-once p { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; color: var(--fg); }
.ai-once .icon { margin-top: 3px; color: var(--acc); }
.ai-setup { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.code.wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code.wrap pre code { white-space: inherit; }
.ai-confirm { margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--well); }
.ai-confirm p { font-size: 15px; }
.ai-confirm .ai-acts { margin-top: 12px; }
.ai-acts { margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-docs { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font: 600 14px var(--display); color: var(--acc); text-decoration: none; }
.ai-docs:hover { text-decoration: underline; text-underline-offset: 3px; }
.ghost.danger { color: var(--off); border-color: var(--off); }
.ghost.danger:hover { color: var(--off); }

/* states */
.sk { display: block; border-radius: 12px; background: var(--chip); }
.sk.line { height: 20px; margin: 14px 0; max-width: 520px; }
.sk.tall { height: 140px; border-radius: 18px; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--well); font-size: 15px; line-height: 1.45; color: var(--fg); }
.card > .note, .card .note { margin-top: 14px; }
.note .icon { margin-top: 2px; color: var(--off); }
.note.calm .icon { color: var(--mute); }
.down { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 26px; }
.down .note { align-self: stretch; margin: 0; }

/* ── sign-in and the new password (§P.4): the card alone, centred; the real flame on the right ── */
.giant { position: absolute; right: -8vw; top: 50%; transform: translateY(-46%); width: min(64vw, 880px); pointer-events: none; }
.split { min-height: 100%; display: grid; grid-template-columns: minmax(0, 460px); place-content: center; padding: 48px 24px; }
/* gate: over the flame the slab needs its .84–.88 tint; the field border .40–.42 */
.frost { padding: 36px; border: 1px solid var(--line2); border-radius: 20px; background: var(--frost); -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); box-shadow: var(--shadow); }
.form label { display: block; margin: 0 0 6px; font: 600 13px var(--display); color: var(--mute); }
.in { display: block; width: 100%; height: 56px; margin-bottom: 16px; padding: 0 18px; border: 1px solid var(--field); border-radius: 10px; background: var(--chip); color: var(--fg); font: 18px var(--mono); }
.in.bad { border-color: var(--off); }
.in:disabled { opacity: 0.7; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; margin-top: 6px; padding: 0 28px; border: 0; border-radius: 10px; background: var(--fill); color: var(--on-fill); font: 700 17px var(--display); cursor: pointer; }
.primary:hover:not(:disabled) { background: var(--fill-hi); }
.primary:active:not(:disabled) { background: var(--fill-lo); }
.primary:disabled { cursor: progress; }
.msg { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; font-size: 15px; line-height: 1.4; color: var(--off); }
.msg .icon { margin-top: 2px; }
.msg:empty { display: none; }
.lost { margin-top: 18px; font-size: 14px; color: var(--mute); }
.rule { margin: -8px 0 16px; font-size: 14px; color: var(--mute); }

/* ── Get started ── */
.head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.head > div:first-child { flex: 1; min-width: 260px; }
.title { font: 700 clamp(28px, 3.4vw, 38px)/1.15 var(--display); letter-spacing: -0.02em; }
.why { margin-top: 6px; color: var(--mute); font-size: 16px; }
.prog { display: flex; align-items: center; gap: 12px; }
.prog .mono { color: var(--mute); font-size: 14px; }
.bar-o { width: 180px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar-i { height: 6px; border-radius: 999px; background: var(--ember); }
.walk { margin-top: 28px; display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.rails { list-style: none; padding: 0; flex: 1 1 240px; max-width: 270px; display: flex; flex-direction: column; gap: 4px; }
.rail { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--fg); cursor: pointer; font: 600 15px var(--display); text-align: left; }
.rail[aria-current="step"] { background: var(--card); border-color: rgba(226, 122, 63, 0.45); box-shadow: var(--shadow); }
.rail .dotb { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--chip); color: var(--mute); }
.rail[aria-current="step"] .dotb { background: var(--fill); color: var(--on-fill); }
.rail.ok .dotb { background: var(--okbg); color: var(--ok); }
.rail .lbl { display: flex; flex-direction: column; line-height: 1.25; }
.rail .lbl small { font: 600 12px var(--display); color: var(--mute); }
.step { flex: 999 1 520px; min-width: 0; padding: 30px; }
.step h2 { margin-top: 4px; font: 700 26px var(--display); }
.sl { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.sl li { display: flex; align-items: flex-start; gap: 12px; counter-increment: s; font-size: 16px; }
.sl li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--acc); font: 700 13px/1 var(--display); }
.sl li span { padding-top: 1px; }
.step .tiles { margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step .tile { padding: 12px 14px; border-radius: 12px; }
.msgbox { margin-top: 16px; position: relative; border-radius: 12px; background: var(--well); padding: 16px 56px 16px 18px; }
.msgbox pre { margin: 0; font: 14px/1.75 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.msgbox .ib { position: absolute; top: 10px; right: 10px; }
.allset { margin-top: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.allset .badge { height: 36px; padding: 0 14px; font-size: 14px; gap: 8px; }
.back { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ── Docs (§D): sidebar (search + categories) · the article (72ch) · "On this page"; sticky in the scroll box ── */
.docs-on .bar { max-width: 1240px; }
.docs { max-width: 1240px; padding: 36px 24px 96px; display: grid; grid-template-columns: 232px minmax(0, 1fr) 208px; column-gap: 56px; align-items: start; }
.docs[aria-busy] { display: block; }
.dtog { display: none; }
/* the sidebar and the TOC stay in view while the article scrolls; each scrolls itself when taller than the box
   (100dvh less the 61 px header and the 36 + 24 px of air around them) */
.side, .toc { position: sticky; top: 24px; max-height: calc(100dvh - 121px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side { display: flex; flex-direction: column; gap: 16px; padding: 2px; }
.dsearch { position: relative; }
.dsearch .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mute); pointer-events: none; }
.dsq { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--field); border-radius: 10px; background: var(--card); color: var(--fg); font: 15px var(--body); }
.dsq::placeholder { color: var(--mute); opacity: 1; }
.dsq::-webkit-search-cancel-button { cursor: pointer; }
.dlist { display: flex; flex-direction: column; gap: 20px; }
.grp { display: flex; flex-direction: column; gap: 2px; }
.cat { display: flex; align-items: center; gap: 8px; margin: 0 10px 4px; font: 600 14px var(--display); color: var(--fg); }
.cat .icon { color: var(--acc); }
.nl { display: block; padding: 6px 10px 6px 32px; border-radius: 8px; color: var(--mute); text-decoration: none; font-size: 15px; line-height: 1.4; }
.nl:hover { background: var(--chip); color: var(--fg); }
.nl[aria-current] { background: rgba(226, 122, 63, 0.14); color: var(--fg); }
.res .cat { color: var(--mute); }
.nl.hit { padding-left: 10px; display: flex; flex-direction: column; gap: 1px; color: var(--fg); }
.nl.hit .ctx { font: 600 12px var(--display); color: var(--mute); }
.nl mark { background: rgba(226, 122, 63, 0.22); color: inherit; border-radius: 3px; }
.none { margin: 0 10px; font-size: 15px; color: var(--mute); }

/* the article: long-form reading */
.art { min-width: 0; max-width: 72ch; font-size: 17px; line-height: 1.7; }
.dmeta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-height: 32px; }
.crumb { font: 600 14px var(--display); color: var(--mute); }
.dmd { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ghost.dbtn { height: 32px; padding: 0 10px; gap: 6px; font-size: 13px; line-height: 1; }
.ghost.dbtn.done { color: var(--ok); }
.art > .say { margin-top: 8px; }
.art .title { margin-top: 6px; font: 700 36px/1.15 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.lead { margin-top: 14px; font-size: 19px; line-height: 1.6; color: var(--mute); }
.prose { margin-top: 8px; }
.prose > * { margin-top: 16px; }
.prose > .dh { margin-top: 48px; scroll-margin-top: 24px; position: relative; font-family: var(--display); color: var(--fg); }
.prose > h2.dh { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.prose > h3.dh { margin-top: 32px; font-size: 19px; font-weight: 600; line-height: 1.35; }
.prose > .dh + * { margin-top: 12px; }
.prose > .dh:first-child { margin-top: 40px; }
.dh:focus { outline: none; }
.dh:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; }
.anc { display: inline-flex; vertical-align: middle; margin-left: 8px; padding: 4px; border-radius: 6px; color: var(--mute); opacity: 0; }
.dh:hover .anc, .anc:focus-visible { opacity: 1; }
.anc:hover { color: var(--acc); background: var(--chip); }
.prose a, .lead a { color: var(--acc); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 700; color: var(--fg); }
.ic { padding: 1px 6px; border-radius: 6px; background: var(--chip); border: 1px solid var(--line); font: 15px var(--mono); white-space: nowrap; }
.tbl .ic { font-size: 14px; }
.ic.long { white-space: normal; overflow-wrap: anywhere; }
.ul { margin-bottom: 0; padding-left: 22px; }
.ul li + li, .prose .sl li + li { margin-top: 6px; }
.ul li::marker { color: var(--mute); }
.prose .sl { gap: 0; }
.prose .sl li { font-size: 17px; }
.prose .sl li::before { margin-top: 2px; }

/* code: a tinted well, its language and Copy on a header row; long lines scroll inside the box */
.code { border-radius: 12px; background: var(--well); border: 1px solid var(--line); overflow: hidden; }
.code-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 3px 3px 3px 16px; border-bottom: 1px solid var(--line); }
.lang { font: 12px var(--mono); color: var(--mute); }
.code-h .ib { border-color: transparent; }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font: 14px/1.7 var(--mono); tab-size: 2; color: var(--fg); }
.code pre code { font: inherit; white-space: pre; }

/* tables: their own sideways scroll on a narrow screen */
.tbl { border: 1px solid var(--line2); border-radius: 12px; overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.tbl th { padding: 10px 14px; background: var(--well); text-align: left; vertical-align: bottom; font: 600 14px var(--display); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }

/* notes: the icon's shape says which kind */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--well); font-size: 17px; line-height: 1.6; }
.callout .icon { margin-top: 3px; color: var(--mute); }
.callout.warn { background: rgba(226, 122, 63, 0.13); }
.callout.warn .icon { color: var(--acc); }

/* link cards: the whole card is the link */
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dc { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); color: var(--fg); text-decoration: none; }
.prose a.dc { color: var(--fg); text-decoration: none; }
a.dc:hover { border-color: rgba(226, 122, 63, 0.6); }
.dct { display: flex; align-items: center; gap: 10px; font: 600 17px/1.35 var(--display); }
.dct .icon { color: var(--acc); }
.dcx { font-size: 15px; line-height: 1.5; color: var(--mute); }
.fig { margin: 16px 0 0; }
.prose > .fig { margin-top: 24px; }
.fig img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }

/* Previous / Next */
.pn { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pnl { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line2); color: var(--fg); text-decoration: none; }
.pnl:hover { border-color: rgba(226, 122, 63, 0.6); }
.pnl.nx { grid-column: 2; text-align: right; align-items: flex-end; }
.pnk { display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--display); color: var(--mute); }
.pnt { font: 600 17px/1.35 var(--display); }

/* "On this page" */
.toc { padding-top: 4px; }
.toc-h { margin: 0 10px 8px; font: 600 14px var(--display); color: var(--fg); }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--mute); text-decoration: none; font-size: 14px; line-height: 1.4; }
.toc .l3 a { padding-left: 24px; }
.toc a:hover { background: var(--chip); color: var(--fg); }
.toc a.on { background: rgba(226, 122, 63, 0.14); color: var(--fg); }
.sk.ttl { height: 40px; max-width: 360px; margin: 8px 0 24px; }
@media (prefers-reduced-motion: no-preference) { .toc a, .anc, .pnl, a.dc { transition: background-color 120ms, color 120ms, border-color 120ms, opacity 120ms; } }

/* under 1100 px: no "On this page" */
@media (max-width: 1099px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); column-gap: 40px; }
  .toc { display: none; }
}

/* phone: one column, every control 44 px */
@media (max-width: 719px) {
  .bar { padding: 6px 16px 8px; gap: 4px 10px; }
  .brand { min-width: 44px; justify-content: center; }
  .brand b { display: none; }
  .tabs { order: 3; flex: 1 0 100%; }
  .tab { flex: 1; justify-content: center; height: 44px; padding: 0 8px; }
  .right { flex: 1; gap: 8px; }
  .org { flex: 1; }
  .seg button { width: 44px; height: 44px; }
  .ib { width: 44px; height: 44px; }
  .btn, .ghost, .ghost.sm, .btn.sm, .ghost.xs { height: 48px; }
  .acts > * { flex: 1 1 100%; }
  main { padding: 20px 16px 64px; }
  .stack { gap: 16px; }
  .sbx { padding: 22px 18px; }
  .pad { padding: 20px 18px; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ostiles > * { flex: 1 1 100%; }
  .split { padding: 32px 12px; }
  .frost { padding: 22px 18px; }
  .in, .primary { height: 52px; }
  .giant { width: 120vw; right: -50vw; top: auto; bottom: -40px; transform: none; opacity: 0.9; }
  .link { min-height: 44px; }
  .prog { flex: 1 1 100%; }
  .bar-o { flex: 1; }
  .rails { max-width: none; flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .rail { padding: 8px; }
  .step { padding: 22px 18px; }
  .step .acts > * { flex: 1 1 100%; }
  .docs { display: block; padding: 16px 16px 72px; }
  .dtog { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); color: var(--fg); cursor: pointer; text-align: left; }
  .dtog .dtl { font: 600 15px var(--display); }
  .dtog .dtp { flex: 1; min-width: 0; color: var(--mute); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dtog[aria-expanded="true"] > .icon:last-child { transform: rotate(180deg); }
  .side { display: none; position: static; max-height: none; overflow: visible; margin-top: 8px; padding: 12px; border: 1px solid var(--line2); border-radius: 14px; background: var(--card); }
  .side.open { display: flex; }
  .dsq { height: 44px; font-size: 16px; }
  .nl { display: flex; align-items: center; min-height: 44px; padding-top: 0; padding-bottom: 0; }
  .nl.hit { align-items: flex-start; justify-content: center; padding-top: 6px; padding-bottom: 6px; }
  .art { margin-top: 24px; font-size: 17px; }
  .art .title { font-size: 30px; }
  .lead { font-size: 18px; }
  .prose > h2.dh { font-size: 22px; }
  .anc { display: none; }
  .code-h { padding-right: 2px; }
  .tbl.wide table { min-width: 600px; }
  .tbl .ic { white-space: normal; }  /* a command chip in a cell breaks at its spaces, so the cell beside it keeps room */  /* a 2-column table fits a phone; 3 or 4 columns keep readable widths and scroll inside the box */
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pnl.nx { grid-column: 1; }
  .pnl { min-height: 56px; justify-content: center; }
  .ghost.dbtn { height: 44px; padding: 0 12px; font-size: 14px; }
  .ai-acts > .ghost, .ai-acts > .btn { flex: 1 1 100%; }
  .ai > .ai-docs { grid-column: 1 / -1; grid-row: auto; justify-self: start; min-height: 44px; margin-top: 12px; }
  .ai-once .ghost { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .ghost, .ib, .tab, .rail, .primary, .seg button, .nl { transition: background-color 120ms, color 120ms, border-color 120ms; } }
.st { display: inline-flex; align-items: center; gap: 10px; }
.split { position: relative; overflow: clip; }
.frost { position: relative; z-index: 1; }
@media (max-width: 359px) { .host h1 { font-size: 19px; } .sbx { padding: 18px 14px; } }

/* ── docs: the `diagram` block (§D.2): inline SVG, colours from the tokens; the grid, or one column when the figure is
   narrower than 600 px (a container query on the figure itself: a phone, or the article beside the sidebar) ── */
.prose > .dgm { margin-top: 24px; }
.dgm { margin: 0; container-type: inline-size; }
.dgm svg { display: block; max-width: 100%; height: auto; margin: 0 auto; overflow: visible; }
.dgm .dgm-n { display: none; }
@container (max-width: 599px) { .dgm .dgm-w { display: none; } .dgm .dgm-n { display: block; } }
.dgm .nd rect { fill: var(--card); stroke: var(--line2); stroke-width: 1; }
.dgm .nd.accent rect { fill: rgba(226, 122, 63, 0.10); stroke: rgba(226, 122, 63, 0.70); stroke-width: 1.5; }
.dgm .nd.muted rect { fill: var(--well); stroke: var(--line2); stroke-dasharray: 5 4; }
.dgm .nl { font: 600 15px var(--display); color: var(--fg); fill: currentColor; }
.dgm .ns { font: 13px var(--body); color: var(--mute); fill: currentColor; }
.dgm .ni { color: var(--acc); }
.dgm .nd.muted .ni { color: var(--mute); }
.dgm .ed { fill: none; stroke: var(--mute); stroke-width: 1.5; stroke-linejoin: round; }
.dgm .ed.dash { stroke-dasharray: 6 5; }
.dgm .ah { fill: var(--mute); }
.dgm .el rect { fill: var(--bg); stroke: var(--line2); stroke-width: 1; }
.dgm .el text { font: 13px var(--body); color: var(--fg); fill: currentColor; }
.dgm figcaption { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--mute); text-align: center; }
