/* Valkyn REVO Wiki. Brand tokens follow the website's REVO design system (themes/loki-web/src/styles/revo-tokens.css).
   Layout: forest brand bar on top; guide index | article | on-this-page; drawer + one column on phones. */
@font-face { font-family: "Revo Barlow Semi Condensed"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/revo/barlow-semi-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Revo Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/revo/barlow-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Revo Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/revo/barlow-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Revo Kaushan Script"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/revo/kaushan-script-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Revo Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/source/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #F8F5EC; --surface: #FFFCF2; --sunk: #EFEADB; --ink: #0F2E25; --muted: rgba(15,46,37,.74);
  --line: rgba(15,46,37,.14); --brand: #0E4A38; --brand-soft: rgba(14,74,56,.08);
  --gold: #E9B44C; --gold-ink: #8A5A12; --gold-soft: rgba(233,180,76,.18);
  --danger: #A63D2A; --danger-soft: rgba(166,61,42,.09); --ok: #1F7A57;
  --bar: #0F2E25; --bar-ink: #FFFCF2; --bar-muted: rgba(255,252,242,.72);
  --shadow: 0 18px 34px -18px rgba(15,46,37,.45);
  --font-display: "Revo Barlow Semi Condensed", "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Revo Barlow", "Barlow", "Segoe UI", system-ui, sans-serif;
  --font-script: "Revo Kaushan Script", "Brush Script MT", cursive;
  --font-mono: "Revo Mono", ui-monospace, Consolas, monospace;
  --r-sm: 8px; --r-md: 14px; --top: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A1D17; --surface: #0F2A22; --sunk: #0C231C; --ink: #F3EEDF; --muted: rgba(243,238,223,.72);
  --line: rgba(243,238,223,.12); --brand: #7CCBA8; --brand-soft: rgba(124,203,168,.1); --gold-ink: #E9B44C;
  --gold-soft: rgba(233,180,76,.14); --danger: #E58B72; --danger-soft: rgba(229,139,114,.1); --ok: #7CCBA8;
  --bar: #071510; --shadow: 0 18px 34px -18px rgba(0,0,0,.7); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0A1D17; --surface: #0F2A22; --sunk: #0C231C; --ink: #F3EEDF; --muted: rgba(243,238,223,.72);
  --line: rgba(243,238,223,.12); --brand: #7CCBA8; --brand-soft: rgba(124,203,168,.1); --gold-ink: #E9B44C;
  --gold-soft: rgba(233,180,76,.14); --danger: #E58B72; --danger-soft: rgba(229,139,114,.1); --ok: #7CCBA8;
  --bar: #071510; --shadow: 0 18px 34px -18px rgba(0,0,0,.7); color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 20px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
code, kbd { font-family: var(--font-mono); font-size: .84em; background: var(--sunk); border: 1px solid var(--line); border-radius: 5px; padding: .08em .38em; }
code { overflow-wrap: anywhere; }
pre { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; overflow-x: auto; }
pre code { border: 0; padding: 0; background: none; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #0F2E25; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid rgba(233,180,76,.35); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1440px; margin: 0 auto; height: var(--top); display: flex; align-items: center; gap: 14px; }
.icon-btn { flex: none; display: grid; place-items: center; background: none; border: 1px solid rgba(255,252,242,.25); color: var(--bar-ink); border-radius: var(--r-sm); width: 40px; height: 40px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,252,242,.1); }
.menu-btn { display: none; }
.logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--bar-ink); white-space: nowrap; }
.logo b { font: 800 22px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
.logo b span { color: var(--gold); }
.logo i { font: 400 20px/1 var(--font-script); color: var(--gold); transform: rotate(-4deg); display: inline-block; }
.search-btn { flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,252,242,.22); background: rgba(255,252,242,.07); color: var(--bar-muted); font: 500 15px var(--font-body); cursor: pointer; text-align: left; }
.search-btn:hover { background: rgba(255,252,242,.12); }
.search-btn span { flex: 1; }
.search-btn kbd { background: transparent; color: var(--bar-muted); border-color: rgba(255,252,242,.25); }
.top-links { display: flex; align-items: center; gap: 4px; }
.top-links a { color: var(--bar-ink); text-decoration: none; font: 600 14px var(--font-body); padding: 8px 10px; border-radius: var(--r-sm); white-space: nowrap; }
.top-links a:hover { background: rgba(255,252,242,.1); }
.top-links .play { background: var(--gold); color: #0F2E25; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 8px 14px; margin-left: 4px; }
.top-links .play:hover { background: #F2C766; }

/* ---------- shell ---------- */
.shell { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 272px minmax(0,1fr) 232px; gap: 40px; align-items: start; }
.shell.home { grid-template-columns: 272px minmax(0,1fr); }
.side { position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px)); max-height: calc(100vh - var(--top) - env(safe-area-inset-top, 0px)); overflow-y: auto; padding-block: 24px 40px; scrollbar-width: thin; }
.side-close { display: none; }
.side-home { display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin-bottom: 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 600; }
.side-home.active, .side-home:hover { background: var(--brand-soft); }
.side-group { margin-bottom: 4px; }
.side-group > button { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px 10px; border-radius: var(--r-sm); font: 800 13px var(--font-display); text-transform: uppercase; letter-spacing: .12em; text-align: left; }
.side-group > button:hover { background: var(--brand-soft); }
.side-group > button svg { transition: transform .2s; opacity: .6; flex: none; }
.side-group.closed > button svg { transform: rotate(-90deg); }
.side-group.closed ul { display: none; }
.side ul { list-style: none; margin: 2px 0 8px 10px; padding: 0 0 0 10px; border-left: 1px solid var(--line); }
.side li a { display: block; padding: 5px 10px; margin-left: -11px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.35; }
.side li a:hover { color: var(--ink); }
.side li a.active { color: var(--brand); border-left-color: var(--gold); font-weight: 600; background: linear-gradient(90deg, var(--gold-soft), transparent); }
.scrim { display: none; }

main { min-width: 0; padding-block: 28px 80px; }
.rail { position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px)); padding-block: 28px; font-size: 14px; max-height: calc(100vh - var(--top)); overflow-y: auto; scrollbar-width: thin; }
.rail h2, .toc-mobile summary { font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 10px; padding: 0; }
.rail ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.rail li a { display: block; padding: 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.rail li a:hover { color: var(--ink); }
.rail li a.on { color: var(--ink); border-left-color: var(--gold); }
.rail li.sub a { padding-left: 24px; font-size: 13px; }
.rail-box { margin-top: 24px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.rail-box p { margin: 0 0 8px; color: var(--muted); }
.toc-mobile { display: none; }

/* ---------- article ---------- */
.article { max-width: 800px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .16em; color: var(--gold-ink); }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.02; text-transform: uppercase; margin: 10px 0 14px; }
.article h2 { font-size: 28px; line-height: 1.1; text-transform: uppercase; margin: 56px 0 14px; }
.article h3 { font-size: 21px; line-height: 1.2; margin: 32px 0 10px; }
.article h4 { font-size: 17px; margin: 22px 0 8px; }
.h-anchor { margin-left: 8px; color: var(--gold-ink); text-decoration: none; opacity: 0; font-size: .7em; vertical-align: middle; }
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus { opacity: 1; }
.lead { font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 64ch; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.meta b { color: var(--ink); font-weight: 600; }
.article p, .article li { max-width: 70ch; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 4px 0; }
.article li::marker { color: var(--gold-ink); }
.article blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.article blockquote p { margin: 0; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); margin: 14px 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
thead th { font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--sunk); }
tbody tr:hover td { background: var(--brand-soft); }
td p { margin: 0; }
.rate { display: inline-block; min-width: 52px; text-align: center; padding: 3px 6px; border-radius: 6px; font-weight: 600; }
.rate.hi { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.rate.mid { background: color-mix(in srgb, var(--gold) 26%, transparent); }
.rate.lo { background: color-mix(in srgb, var(--gold) 44%, transparent); }
.rate.risk { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.loc { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.loc svg { color: var(--gold-ink); flex: none; }
.copy { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 6px; font: 600 12px var(--font-body); padding: 1px 8px; cursor: pointer; margin-left: 6px; vertical-align: 1px; }
.copy:hover { color: var(--brand); border-color: var(--brand); }
.cmp td:last-child { font-weight: 600; }
.cmp thead th:last-child { color: var(--gold-ink); }

/* glance card: an "At a glance" two-column table */
.table-wrap.glance { box-shadow: var(--shadow); }
.glance thead th { background: var(--bar); color: var(--gold); font-size: 14px; letter-spacing: .16em; padding: 12px 18px; }
.glance tbody td { padding: 11px 18px; }
.glance tbody td:first-child { width: 32%; min-width: 130px; font: 800 13px/1.6 var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--sunk); }
.glance tbody td:first-child strong { font-weight: 800; }
.glance.nohead thead { display: none; }
.glance tbody tr:hover td { background: inherit; }
.glance tbody tr:hover td:first-child { background: var(--sunk); }

/* hints */
.hint { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid; margin: 18px 0; }
.hint-body > :first-child { margin-top: 0; }
.shot { margin: 18px 0 24px; }
.shot a { display: inline-block; max-width: 100%; vertical-align: top; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--sunk); cursor: zoom-in; }
.shot img { display: block; width: auto; max-width: 100%; height: auto; }
.shot figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
li .shot { margin: 12px 0 16px; }
.hint-body > :last-child { margin-bottom: 0; }
.hint svg { margin-top: 3px; }
.hint.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.hint.danger svg { color: var(--danger); }
.hint.warn { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.hint.warn svg { color: var(--gold-ink); }
.hint.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.hint.info svg, .hint.ok svg { color: var(--brand); }
.hint.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

/* numbered steps (only under "Start here") */
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
ol.steps > li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 14px; align-items: start; max-width: none; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
ol.steps > li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bar); color: var(--gold); font: 800 17px var(--font-display); }
ol.steps > li > div { padding-top: 4px; min-width: 0; }
ol.steps > li > div > :last-child { margin-bottom: 0; }
ol.steps ul, ol.steps ol { margin: 6px 0 0; }

/* FAQ */
.faq { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; margin: 14px 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px; padding: 14px 18px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 800 22px/1 var(--font-display); color: var(--gold-ink); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { background: var(--brand-soft); }
.faq .ans { padding: 0 18px 16px; color: var(--muted); }
.faq .ans > :first-child { margin-top: 0; }
.faq .ans > :last-child { margin-bottom: 0; }

/* kinds (patch notes) */
.kind { display: inline-block; font: 800 11px/1.6 var(--font-display); text-transform: uppercase; letter-spacing: .1em; padding: 0 7px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.kind.new { background: var(--brand-soft); color: var(--brand); }
.kind.changed { background: var(--gold-soft); color: var(--gold-ink); }
.kind.fixed { background: var(--sunk); color: var(--ink); border: 1px solid var(--line); }
.kind.removed { background: var(--danger-soft); color: var(--danger); }

/* related + footer */
.related-h { margin-top: 56px; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.related a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); background: var(--surface); }
.related a:hover { border-color: var(--gold); }
.related a small { display: block; color: var(--muted); font-size: 12px; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.related a b { font-weight: 600; }
.page-foot { margin-top: 40px; padding: 16px 18px; border-radius: var(--r-md); background: var(--sunk); display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
.page-foot b { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.page-foot > div { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.pager a { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); background: var(--surface); min-width: 0; }
.pager a:hover { border-color: var(--gold); }
.pager a small { display: block; color: var(--muted); font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .12em; }
.pager a.next { text-align: right; grid-column: 2; }
.site-foot { border-top: 1px solid var(--line); margin-top: 20px; }
.site-foot-in { max-width: 1440px; margin: 0 auto; padding-block: 22px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 14px; color: var(--muted); }
.site-foot a { color: var(--muted); }

/* ---------- widgets ---------- */
.calc { border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); border-radius: var(--r-md); background: var(--surface); padding: 18px; margin: 18px 0 8px; }
.calc-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 12px; }
.calc-h strong { font: 800 18px var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.calc-h small { color: var(--muted); }
.calc-row { display: flex; flex-wrap: wrap; gap: 12px; }
.calc label { display: grid; gap: 4px; font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); flex: 1 1 140px; }
.calc select { font: 500 16px var(--font-body); padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.calc-out { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 18px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.calc-big { font: 800 48px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.calc-big small { display: block; font: 400 14px var(--font-body); color: var(--muted); margin-top: 6px; max-width: 30ch; }
.ladder { display: flex; gap: 4px; align-items: flex-end; height: 74px; min-width: 0; }
.ladder div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.ladder i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: var(--brand); opacity: .85; }
.ladder i.low { background: var(--danger); }
.ladder span { font: 500 11px var(--font-mono); color: var(--muted); }

/* ---------- home ---------- */
.hero { border-radius: 18px; background: var(--bar); color: var(--bar-ink); padding: 34px clamp(20px, 4vw, 44px); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border: 2px solid rgba(233,180,76,.25); transform: rotate(45deg); }
.hero::before { content: ""; position: absolute; right: 20px; top: 20px; width: 120px; height: 120px; border: 1px solid rgba(233,180,76,.18); transform: rotate(45deg); }
.hero .eyebrow { color: var(--gold); }
.hero h1 { margin: 12px 0 10px; color: var(--bar-ink); max-width: 16ch; position: relative; z-index: 1; }
.hero h1 em { font: 400 .8em var(--font-script); color: var(--gold); text-transform: none; font-style: normal; display: inline-block; transform: rotate(-4deg); padding: 0 .08em; }
.hero p { color: var(--bar-muted); font-size: 19px; max-width: 56ch; margin: 0 0 22px; position: relative; z-index: 1; }
.hero p strong { color: var(--bar-ink); }
.hero-search { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; max-width: 560px; height: 54px; padding: 0 18px; background: var(--surface); color: var(--muted); border: 0; border-radius: 999px; font: 500 17px var(--font-body); cursor: pointer; width: 100%; text-align: left; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.hero-search span { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.chips a { color: var(--bar-ink); border: 1px solid rgba(255,252,242,.25); border-radius: 999px; padding: 4px 12px; font-size: 14px; text-decoration: none; }
.chips a:hover { border-color: var(--gold); color: var(--gold); }
.live { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 18px 0 8px; }
.live-cell { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 14px 16px; min-width: 0; }
.live-cell small { display: block; font: 800 11px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.live-cell b { display: block; font: 800 24px/1.15 var(--font-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.live-cell span { font-size: 14px; color: var(--muted); }
.live-cell.now { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--surface)); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.home-body { max-width: 1040px; }
.home-body > h2 { font-size: 28px; text-transform: uppercase; margin: 52px 0 14px; }
.start { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; counter-reset: st; margin: 14px 0; }
.start a { counter-increment: st; display: grid; align-content: start; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; color: var(--ink); }
.start a:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.start a::before { content: "Step " counter(st); font: 800 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.start b { font: 800 22px/1.1 var(--font-display); text-transform: uppercase; }
.start span { color: var(--muted); font-size: 15px; }
.library { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.shelf { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 16px 18px; min-width: 0; }
.shelf h3 { margin: 0 0 8px; font-size: 19px; text-transform: uppercase; letter-spacing: .03em; }
.shelf ul { list-style: none; padding: 0; margin: 0; }
.shelf li { margin: 0; border-top: 1px solid var(--line); max-width: none; }
.shelf li a { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; padding: 9px 0; text-decoration: none; color: var(--ink); }
.shelf li a b { font-weight: 600; }
.shelf li a small { grid-column: 1; color: var(--muted); font-size: 14px; line-height: 1.4; }
.shelf li a::after { content: "→"; color: var(--gold-ink); grid-column: 2; grid-row: 1; }
.shelf li a:hover b { color: var(--brand); }

/* ---------- patch notes ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.filters button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 600 14px var(--font-body); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--bar); color: var(--gold); border-color: var(--bar); }
.release { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 24px; padding-bottom: 30px; }
.release-when { position: sticky; top: calc(var(--top) + 24px); align-self: start; }
.release-when time { display: block; font: 800 20px/1.1 var(--font-display); text-transform: uppercase; }
.badge { display: inline-block; font: 800 11px var(--font-display); text-transform: uppercase; letter-spacing: .12em; padding: 3px 8px; border-radius: 999px; margin-top: 8px; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.badge.latest { background: var(--bar); color: var(--gold); border-color: var(--bar); }
.release-body { border-left: 2px solid var(--line); padding-left: 24px; min-width: 0; }
.article .release-body > h2 { margin-top: 0; font-size: 26px; }
.change-group { border-top: 1px solid var(--line); padding-top: 4px; }
.article .change-group > h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 0 6px; }

/* ---------- search ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,15,12,.55); display: grid; justify-items: center; align-items: start; padding: calc(10vh + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.modal-box { width: min(640px, 100%); background: var(--surface); border-radius: var(--r-md); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); overflow: hidden; border: 1px solid var(--line); }
.modal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.modal-in input { flex: 1; height: 56px; border: 0; background: transparent; color: var(--ink); font: 500 18px var(--font-body); outline: none; min-width: 0; }
.results { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.results a { display: block; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.results a small { display: block; color: var(--muted); font-size: 13px; }
.results mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.results a.sel { background: var(--brand-soft); outline: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.results .grp { font: 800 11px var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 10px 12px 4px; }
.results .empty { padding: 20px 12px; color: var(--muted); }
.modal-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--sunk); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--bar); color: var(--bar-ink); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 70; box-shadow: var(--shadow); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 252px minmax(0,1fr); gap: 32px; }
  .rail { display: none; }
  .toc-mobile { display: block; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 12px 16px; margin: 0 0 22px; }
  .toc-mobile summary { margin: 0; cursor: pointer; }
  .toc-mobile ol { margin: 10px 0 0; padding-left: 18px; }
  .toc-mobile li.sub { margin-left: 14px; list-style: circle; }
  .toc-mobile a { text-decoration: none; }
}
@media (max-width: 900px) {
  .shell, .shell.home { grid-template-columns: minmax(0,1fr); }
  .menu-btn { display: grid; }
  .side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); max-height: none; background: var(--bg); padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 40px max(16px, env(safe-area-inset-left, 0px)); transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow); visibility: hidden; }
  .side.open { transform: none; visibility: visible; }
  .side-close { display: flex; justify-content: flex-end; }
  .side-close .icon-btn { color: var(--ink); border-color: var(--line); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(5,15,12,.45); }
  .top-links a:not(.play) { display: none; }
  .search-btn kbd, .search-btn span { display: none; }
  .search-btn { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; }
  .live { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .start, .library { grid-template-columns: minmax(0,1fr); }
  .release { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .release-when { position: static; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
  .release-when .badge { margin-top: 0; }
  .release-body { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .logo i { display: none; }
  .logo b { font-size: 19px; }
  .top-links .play { padding: 8px 10px; font-size: 13px; }
  .glance table, .glance thead, .glance thead tr, .glance thead th, .glance tbody, .glance tbody tr, .glance tbody td { display: block; width: 100%; }
  .glance thead th + th { display: none; }
  .glance tbody tr { border-bottom: 1px solid var(--line); }
  .glance tbody tr:last-child { border-bottom: 0; }
  .glance tbody td { border-bottom: 0; }
  .glance tbody td:first-child { width: 100%; padding-bottom: 4px; }
  .calc-out { grid-template-columns: minmax(0,1fr); }
  .pager { grid-template-columns: minmax(0,1fr); }
  .pager a.next { grid-column: 1; }
  .lead { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .side, .rail, .scrim, .pager, .toc-mobile { display: none !important; } .shell { display: block; } }

/* Language picker (top bar) */
.lang { position: relative; }
.lang { flex: none; }
.lang > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 1px solid rgba(255,252,242,.25); border-radius: var(--r-sm); cursor: pointer; font: 600 14px var(--font-body); color: var(--bar-ink); }
.lang > summary:hover { background: rgba(255,252,242,.1); }
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:focus-visible { outline: 2px solid var(--gold, #E9B44C); outline-offset: 2px; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); display: grid; }
.lang-menu a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: inherit; font-size: 15px; }
.lang-menu a:hover, .lang-menu a:focus-visible { background: var(--brand-soft); }
.lang-menu a[aria-current] { font-weight: 700; color: var(--brand); }
@media (max-width: 520px) { .lang > summary span { display: none; } .lang > summary { width: 40px; padding: 0; justify-content: center; } .topbar-in { gap: 8px; } .lang-menu { right: -48px; } }
/* Phone top bar: menu, logo, search, play, language and theme must fit from 320px up in every language. */
.logo b em { font-style: normal; }
.play .pl-short { display: none; }
@media (max-width: 900px) { .topbar-in { gap: 8px; } .logo { min-width: 0; flex: 0 1 auto; overflow: hidden; } .top-links { flex: none; } }
@media (max-width: 640px) { .logo i { display: none; } }
@media (max-width: 520px) { .play .pl-long { display: none; } .play .pl-short { display: inline; } .logo b { font-size: 18px; } }
@media (max-width: 420px) { .logo b em { display: none; } }
@media (max-width: 340px) { .top-links .play { display: none; } }
