:root {
  --bg0: #050815; --bg1: #0b1230;
  --glass: rgba(13, 19, 44, .72); --glass2: rgba(22, 30, 64, .6);
  --line: rgba(160, 180, 255, .12); --line2: rgba(160, 180, 255, .22);
  --fg: #e9edff; --fg2: #c3cbef; --mute: #8b96c2; --dim: #5d6896;
  --accent: #8ea2ff; --accent2: #b4c1ff;
  --gold: #f5c46b; --uses: #c48cff; --by: #50dcc8;
  --ok: #6fe0a0; --warn: #ffcf70; --bad: #ff8a8a;
  --r: 14px; --panel: 460px;
  --ease: cubic-bezier(.2, .75, .2, 1);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Fraunces, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg0); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent2); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }
button { font: inherit; color: inherit; }
::selection { background: rgba(142, 162, 255, .35); }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: rgba(160,180,255,.15); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#sky:active { cursor: grabbing; }
body.hovering #sky { cursor: pointer; }

/* ---------- glass ---------- */
.topbar, #panel, .fbar, .mapctl button, #results, #tip, #page .sheet {
  background: var(--glass); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line);
}

/* ---------- top bar ---------- */
.topbar { position: fixed; top: 12px; left: 12px; right: 12px; height: 56px; z-index: 20; border-radius: 16px; display: flex; align-items: center; gap: 18px; padding: 0 12px 0 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); white-space: nowrap; }
.logo { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--gold); border: 1.5px solid rgba(245,196,107,.6); box-shadow: 0 0 18px rgba(245,196,107,.35), inset 0 0 10px rgba(245,196,107,.15); }
.brand-text { font-size: 15px; letter-spacing: .01em; color: var(--fg2); } .brand-text b { color: var(--fg); }
nav { display: flex; gap: 2px; }
nav a { color: var(--mute); font-size: 14px; padding: 7px 11px; border-radius: 9px; transition: background .2s, color .2s; }
nav a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
nav a.on { color: var(--fg); background: rgba(142,162,255,.14); }
.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search .ico { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--mute); stroke-width: 2; pointer-events: none; }
#q { width: 100%; height: 38px; padding: 0 36px 0 34px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; color: var(--fg); font-size: 14px; outline: none; transition: border-color .2s, background .2s, box-shadow .2s; }
#q::placeholder { color: var(--dim); }
#q:focus { border-color: rgba(142,162,255,.55); background: rgba(255,255,255,.08); box-shadow: 0 0 0 4px rgba(142,162,255,.12); }
#q::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 500 11px var(--mono); color: var(--mute); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 6px; pointer-events: none; }
#q:focus ~ kbd { opacity: 0; }
#results { position: absolute; top: 46px; left: 0; right: 0; max-height: min(70vh, 560px); max-height: min(70dvh, 560px); overflow: auto; border-radius: 14px; padding: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.5); animation: pop .18s var(--ease); background: rgba(13,19,44,.94); }
#results .h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 10px 10px 4px; }
#results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; color: var(--fg); font-size: 14px; }
#results a .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
#results a .t { flex: 1; min-width: 0; }
#results a small { display: block; color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results a.act, #results a:hover { background: rgba(142,162,255,.14); }
#results mark { background: none; color: var(--gold); }
#results .empty { padding: 16px 10px; color: var(--mute); font-size: 13px; }
.seg { position: relative; display: flex; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { position: relative; z-index: 1; border: none; background: none; padding: 6px 11px; font-size: 13px; color: var(--mute); cursor: pointer; border-radius: 7px; transition: color .25s; }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 7px; background: rgba(142,162,255,.22); box-shadow: inset 0 0 0 1px rgba(142,162,255,.35); transition: transform .35s var(--ease); }
.seg[data-mode=formal] .thumb { transform: translateX(100%); }
.seg[data-mode=concept] button[data-mode=concept], .seg[data-mode=formal] button[data-mode=formal] { color: var(--fg); }
.status-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg2); padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(255,207,112,.3); background: rgba(255,207,112,.08); white-space: nowrap; }
.status-chip b { color: var(--warn); font-weight: 600; }
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(255,207,112,.6); animation: beacon 2.4s infinite; }
.status-chip.ok { border-color: rgba(110,231,160,.35); background: rgba(110,231,160,.08); }
.status-chip.ok b { color: #6ee7a0; }
.status-chip.ok i { background: #6ee7a0; animation: none; }

/* ---------- panel ---------- */
#panel { position: fixed; z-index: 15; top: 80px; right: 12px; bottom: 12px; width: var(--panel); border-radius: 18px; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.45); transition: transform .5s var(--ease), opacity .4s; overscroll-behavior: contain; }
body.paged #panel { transform: translateX(30px); opacity: 0; pointer-events: none; }
#grip { display: none; }
#content { padding: 22px 24px 40px; transition: opacity .16s, transform .16s var(--ease); }
#content.out, #pagebody.out { opacity: 0; transform: translateY(6px); }
#content.in > *, #pagebody.in > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 38ms); }

.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.eyebrow .sw { width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 10px currentColor; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; }
h1.hero { font-size: 34px; }
h1.hero em { font-style: italic; color: var(--gold); font-weight: 400; }
h2 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); font-weight: 600; margin: 28px 0 10px; display: flex; align-items: center; gap: 8px; }
h2 .n { color: var(--dim); font-weight: 500; letter-spacing: 0; }
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
p { line-height: 1.65; font-size: 15px; color: var(--fg2); margin: 0 0 12px; }
.lede { font-size: 15.5px; }
.meta { font-size: 12.5px; color: var(--mute); line-height: 1.5; }
.crumbs { font-size: 12.5px; color: var(--mute); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--mute); } .crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--dim); }
code, .mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
code { background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 5px; color: var(--fg2); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--fg2); background: rgba(255,255,255,.03); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.high { color: var(--ok); border-color: rgba(111,224,160,.35); }
.badge.medium { color: var(--warn); border-color: rgba(255,207,112,.35); }
.badge.low { color: var(--bad); border-color: rgba(255,138,138,.35); }
.badge.gold { color: var(--gold); border-color: rgba(245,196,107,.45); background: rgba(245,196,107,.08); }
.badge.plain { color: var(--mute); }
/* checked against the code (core clusters): a link on static pages, a button in the panel that opens the evidence */
.badge.checked { color: var(--ok); border-color: rgba(111,224,160,.35); background: rgba(111,224,160,.06); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.badge.checked::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badgelink { display: inline-flex; align-items: center; font-size: 12px; padding: 4px 4px; color: var(--fg2); text-decoration: none; }
.badgelink:hover, .badgelink:focus-visible { color: var(--fg); text-decoration: underline; }
.badge.checked:hover, .badge.checked:focus-visible { border-color: rgba(111,224,160,.7); }
ul.evidence { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--fg2); }
ul.evidence li { margin: 6px 0; overflow-wrap: anywhere; }
ul.evidence code { font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; background: rgba(142,162,255,.1); border: 1px solid rgba(142,162,255,.22); color: var(--accent2); transition: transform .2s var(--ease), background .2s; }
a.chip:hover { background: rgba(142,162,255,.2); color: #fff; transform: translateY(-1px); }
.chip.new { background: rgba(255,255,255,.04); border-color: var(--line2); color: var(--fg2); border-style: dashed; }
.chip.word { background: none; color: var(--mute); border-color: var(--line); font-family: var(--mono); font-size: 11.5px; }

.card { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.soon { position: relative; overflow: hidden; border: 1px dashed var(--line2); border-radius: 12px; padding: 14px 16px; color: var(--mute); font-size: 14px; line-height: 1.55; }
.soon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(142,162,255,.08) 50%, transparent 70%); animation: shimmer 2.8s infinite; }
.soon b { color: var(--fg2); font-weight: 600; }
.ref { border-left: 2px solid var(--accent); padding: 8px 12px; margin: 8px 0; background: linear-gradient(90deg, rgba(142,162,255,.08), transparent); border-radius: 0 10px 10px 0; font-size: 14px; color: var(--fg); line-height: 1.5; }
.ref small { display: block; color: var(--mute); font-size: 12px; margin-top: 3px; }
.ref.note { border-color: var(--gold); background: linear-gradient(90deg, rgba(245,196,107,.08), transparent); }
/* 35b: checked references (spine clusters): locator on its own line, a small precision pill */
.ref.chk { border-color: var(--by); background: linear-gradient(90deg, rgba(80,220,200,.07), transparent); }
.ref.chk a { overflow-wrap: anywhere; color: var(--accent2); text-decoration: underline; text-decoration-color: rgba(180,193,255,.35); text-underline-offset: 2px; }
.ref .loc { display: inline; color: var(--fg2); }
.prec { display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line2); font-size: 11px; line-height: 17px; letter-spacing: .04em; color: var(--mute); white-space: nowrap; cursor: help; }
.prec.exact { color: var(--by); border-color: rgba(80,220,200,.55); }
.prec.section { color: var(--accent2); border-color: rgba(142,162,255,.5); }
.refnote { margin: 4px 0 10px; }
h3.refbg { margin: 18px 0 4px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }

/* lists */
.rows { list-style: none; padding: 0; margin: 0; }
.rows li > a, .rows li > .row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; color: var(--fg); font-size: 14px; transition: background .2s, transform .2s var(--ease); }
.rows li > a:hover { background: rgba(142,162,255,.1); transform: translateX(2px); }
.rows .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; background: currentColor; }
.rows .dot.hollow { background: none; border: 1.5px solid currentColor; box-shadow: none; }
.rows .t { flex: 1; min-width: 0; line-height: 1.35; }
.rows .t small { display: block; color: var(--mute); font-size: 12px; margin-top: 1px; }
.rows .end { font-size: 12px; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows .mono .dir { color: var(--dim); }
.more { margin-top: 6px; font-size: 13px; cursor: pointer; color: var(--accent2); background: rgba(142,162,255,.08); border: 1px solid rgba(142,162,255,.2); padding: 6px 12px; border-radius: 8px; transition: background .2s; }
.more:hover { background: rgba(142,162,255,.18); }
.tabs { display: flex; gap: 4px; margin: 0 0 6px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 9px; padding: 8px; cursor: pointer; font-size: 13px; color: var(--mute); display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s; }
.tabs button.on { color: var(--fg); border-color: var(--line2); background: rgba(255,255,255,.07); }
.tabs .sw { width: 14px; height: 3px; border-radius: 2px; }

/* route stepper */
.route { position: relative; margin: 6px 0 4px; padding-left: 18px; }
.route::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(var(--gold), rgba(245,196,107,.15)); border-radius: 2px; }
.route a, .route span.here { position: relative; display: block; padding: 5px 0; font-size: 13.5px; color: var(--fg2); line-height: 1.35; }
.route a::before, .route span.here::before { content: ""; position: absolute; left: -18px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg1); border: 2px solid var(--gold); }
.route span.here { color: #fff; font-weight: 600; }
.route span.here::before { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.route a:hover { color: #fff; }
.route .skip { font-size: 12px; color: var(--dim); padding: 2px 0; }

/* home */
/* the proof at a glance: four figures and the certification date, one calm card */
.glance { margin: 18px 0 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 12px; padding: 12px 14px 10px; }
.glance dl { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 4px 10px; margin: 0; }
.glance dl > div { display: flex; flex-direction: column-reverse; min-width: 0; }
.glance dd { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.glance dt { font-size: 12px; color: var(--mute); white-space: nowrap; }
.glance .cert { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); width: 100%; font-size: 12.5px; color: var(--fg2); }
.glance .cert i { width: 7px; height: 7px; border-radius: 50%; background: #6ee7a0; box-shadow: 0 0 8px rgba(110,231,160,.6); }
.glance .cert:hover { color: #fff; }
.cta { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; font-size: 14px; font-weight: 500; border: 1px solid var(--line2); color: var(--fg); background: rgba(255,255,255,.05); cursor: pointer; transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.09); color: #fff; }
.btn.primary { background: linear-gradient(135deg, #f5c46b, #e89b4a); color: #1a1205; border: none; box-shadow: 0 8px 26px rgba(245,196,107,.3); }
.btn.primary:hover { box-shadow: 0 10px 34px rgba(245,196,107,.45); color: #1a1205; }
.btn .arr { transition: transform .2s var(--ease); } .btn:hover .arr { transform: translateX(3px); }
.howto { display: grid; gap: 8px; margin-top: 4px; }
.howto div { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--fg2); line-height: 1.5; }
.howto .k { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--accent2); background: rgba(142,162,255,.12); }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.themes a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--fg); font-size: 13px; line-height: 1.3; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.themes a:hover { border-color: var(--c); background: rgba(255,255,255,.06); transform: translateY(-1px); }
.themes a small { color: var(--mute); font-size: 11.5px; }
.themes a .rg { margin-top: auto; padding-top: 5px; }
.themes a small + .rg { align-self: flex-start; }

/* route glyph (routeGlyph() in app.js, route_glyph() in build_site.py) */
.rg { display: inline-flex; align-items: center; vertical-align: middle; line-height: 0; }
.rg svg { display: block; overflow: visible; }
.rg.none { line-height: 1.3; font-size: 12px; color: var(--dim); font-family: var(--sans); font-weight: 400; }
.rows .end .rg { opacity: .9; }
a.rglink { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- page overlay (learn / about / concept) ---------- */
#page { position: fixed; inset: 0; z-index: 30; overflow: auto; padding: 84px 16px 60px; background: rgba(5,8,21,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility .45s; }
body.paged #page { opacity: 1; visibility: visible; }
#pagebody { max-width: 860px; margin: 0 auto; background: rgba(11,16,38,.86); border: 1px solid var(--line); border-radius: 22px; padding: 38px 44px 50px; box-shadow: 0 30px 80px rgba(0,0,0,.5); transform: translateY(24px); transition: transform .6s var(--ease), opacity .16s; }
body.paged #pagebody { transform: none; }
#pagebody h1 { font-size: 36px; }
#close { position: fixed; z-index: 31; top: 84px; right: max(16px, calc(50vw - 470px)); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); background: var(--glass); cursor: pointer; display: grid; place-items: center; transition: transform .25s var(--ease), background .2s; }
#close:hover { transform: rotate(90deg); background: rgba(255,255,255,.1); }
#close svg { width: 18px; height: 18px; stroke: var(--fg); stroke-width: 2; fill: none; }

/* learning tree */
.tree { position: relative; }
.node { position: relative; margin: 8px 0 0 0; }
.node .kids { margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--line); }
.node > .head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); cursor: pointer; transition: background .2s, border-color .2s; }
.node > .head:hover { background: rgba(255,255,255,.06); border-color: var(--line2); }
.node > .head .chev { width: 14px; height: 14px; flex: none; stroke: var(--mute); fill: none; stroke-width: 2; transition: transform .3s var(--ease); }
.node.open > .head .chev { transform: rotate(90deg); }
.node > .head .ttl { flex: 1; font-size: 14.5px; color: var(--fg); }
.kind { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; padding: 3px 7px; border-radius: 6px; flex: none; }
.kind.theorem { color: #1a1205; background: var(--gold); }
.kind.step { color: #dfe4ff; background: rgba(142,162,255,.3); }
.kind.concept { color: #c8fff4; background: rgba(80,220,200,.22); }
.kind.leaf { color: var(--fg2); background: rgba(255,255,255,.1); }
.node .st { font-size: 11.5px; color: var(--dim); }
.node .body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.node.open > .body { grid-template-rows: 1fr; }
.node .body > div { overflow: hidden; }
.node .inner { padding: 10px 14px 4px; font-size: 14px; color: var(--fg2); line-height: 1.6; }
.node .inner .meta { margin-top: 6px; }
.node.again > .head { opacity: .55; }

/* ---------- map chrome ---------- */
.mapctl { position: fixed; z-index: 14; left: 16px; top: 84px; display: flex; flex-direction: column; gap: 6px; transition: opacity .3s; }
.mapctl button { width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 18px; color: var(--fg2); display: grid; place-items: center; transition: background .2s, transform .2s var(--ease); }
.mapctl button:hover { background: rgba(255,255,255,.1); transform: scale(1.06); }
.mapctl svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.lg.named { background: #b4c1ff; box-shadow: 0 0 8px #8ea2ff; }
.lg.main { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.lg.uses, .lg.by, .lg.route { width: 16px; height: 3px; border-radius: 2px; }
.lg.uses { background: var(--uses); } .lg.by { background: var(--by); } .lg.route { background: var(--gold); }
body.paged .mapctl, body.paged .fbar, body.paged .fmob { opacity: 0; pointer-events: none; visibility: hidden; }

#tip { position: fixed; z-index: 40; left: 0; top: 0; pointer-events: none; padding: 9px 12px; border-radius: 11px; font-size: 13px; max-width: 300px; opacity: 0; transform: translate3d(var(--tx, -400px), var(--ty, 0), 0); transition: opacity .15s; contain: layout paint; box-shadow: 0 12px 30px rgba(0,0,0,.45); background: rgba(13,19,44,.92); }
#tip.on { opacity: 1; }
#tip b { display: block; font-weight: 600; color: #fff; line-height: 1.35; }
#tip span { display: block; color: var(--mute); font-size: 12px; margin-top: 3px; }
#tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(ellipse at center, #0b1230, #050815); transition: opacity .8s var(--ease), visibility .8s; color: var(--mute); font-size: 14px; letter-spacing: .02em; }
#loader.done { opacity: 0; visibility: hidden; }
.orbit { position: relative; width: 70px; height: 70px; }
.orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--gold); animation: spin 1.4s linear infinite; }
.orbit i:nth-child(2) { inset: 10px; border-top-color: var(--accent); animation-duration: 1.1s; animation-direction: reverse; }
.orbit i:nth-child(3) { inset: 22px; border-top-color: var(--by); animation-duration: .8s; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(255,207,112,.6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(255,207,112,0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.status-chip .cshort { display: none; font-size: 12px; font-weight: 600; color: #6ee7a0; }
@media (max-width: 1100px) { .brand-text, .status-chip span { display: none; } .status-chip { padding: 8px 10px; } .status-chip .cshort { display: inline; } }
.sbtn, .mpeek { display: none; }
@media (max-width: 820px) {
  /* phones: one row of top bar, clear of the notch and the X in-app browser's bars (safe-area insets) */
  .topbar { top: max(6px, env(safe-area-inset-top)); left: max(6px, env(safe-area-inset-left)); right: max(6px, env(safe-area-inset-right)); height: 56px; gap: 2px; padding: 0 4px; border-radius: 15px; }
  .brand { flex: none; width: 44px; height: 44px; justify-content: center; }
  nav { flex: 1; min-width: 0; justify-content: space-around; gap: 0; }
  nav a { display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 7px; font-size: 14px; white-space: nowrap; }
  .topbar .status-chip { flex: none; height: 44px; padding: 0 6px; gap: 5px; justify-content: center; border-color: transparent; background: none; }
  .sbtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: none; border-radius: 11px; background: rgba(255,255,255,.05); cursor: pointer; }
  .sbtn svg { width: 19px; height: 19px; fill: none; stroke: var(--fg2); stroke-width: 2; }
  .sbtn[aria-expanded=true] { background: rgba(142,162,255,.2); }
  .search { display: none; position: absolute; left: 6px; right: 54px; top: 6px; max-width: none; margin: 0; }
  .topbar.searching .search { display: block; }
  .topbar.searching > .brand, .topbar.searching > nav, .topbar.searching > .status-chip { visibility: hidden; }
  .search kbd { display: none; }
  #q { height: 44px; font-size: 16px; }                 /* 16px: iOS does not zoom the page on focus */
  #results { background: rgb(13,19,44); top: 52px; max-height: min(60vh, 520px); max-height: min(60dvh, 520px); }
  #results a { min-height: 44px; }
  /* zoom buttons: top right, 44 px */
  .mapctl { left: auto; right: max(8px, env(safe-area-inset-right)); top: calc(max(6px, env(safe-area-inset-top)) + 64px); gap: 8px; }
  .mapctl button { width: 44px; height: 44px; border-radius: 12px; background: rgba(13,19,44,.6); }
  .mapctl #zlist { display: none; }
  /* the sheet: --full (its height) and --vis (the part on screen) come from SHEET in app.js; these are the fallbacks */
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: calc(100vh - 76px); height: var(--full, calc(100dvh - 76px));
    border-radius: 20px 20px 0 0; border-bottom: none; padding-bottom: var(--hid, 0px);
    transform: translate3d(0, calc(100% - var(--vis, 50vh)), 0); transition: transform .42s var(--ease); touch-action: none;
    background: rgba(12,18,42,.95); backdrop-filter: none; -webkit-backdrop-filter: none; }   /* no blur over a moving map: cheaper frames */
  #panel[data-sheet=peek] { --vis: 180px; }
  #panel[data-sheet=full] { touch-action: pan-y; }
  #panel.dragging { transition: none; }
  body.paged #panel { transform: translate3d(0, 100%, 0); }
  #grip { display: flex; justify-content: center; align-items: flex-start; position: sticky; top: 0; z-index: 5; width: 100%; height: 44px; margin-bottom: -14px; padding: 12px 0 0; border: none;
    background: linear-gradient(rgba(12,18,42,.98) 55%, rgba(12,18,42,0)); cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
  #grip span { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); }
  #grip:focus-visible { outline: none; } #grip:focus-visible span { background: var(--accent); box-shadow: 0 0 0 3px rgba(142,162,255,.35); }
  #content { padding: 0 max(18px, env(safe-area-inset-right)) 40px max(18px, env(safe-area-inset-left)); }
  h1 { font-size: 24px; } h1.hero { font-size: 27px; }
  .themes { grid-template-columns: 1fr; }
  #page { padding: calc(max(6px, env(safe-area-inset-top)) + 64px) 0 0; }
  #pagebody { border-radius: 20px 20px 0 0; padding: 26px 20px calc(60px + env(safe-area-inset-bottom)); }
  #pagebody h1 { font-size: 28px; }
  #close { top: calc(max(6px, env(safe-area-inset-top)) + 72px); right: 14px; width: 44px; height: 44px; }
  /* home: the peek is the headline, one action and the short status */
  .mpeek { display: block; padding-top: 2px; }
  #content .dk { display: none; }
  .mpeek h1.hero { font-size: 22px; line-height: 1.2; margin: 0 0 10px; }
  .mpeek .cta { flex-wrap: nowrap; margin: 0; gap: 8px; }
  .mpeek .btn { min-height: 44px; padding: 0 14px; justify-content: center; white-space: nowrap; }
  .mpeek .btn.primary { flex: 1; }
  .mstatus { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 -6px; font-size: 13px; color: var(--fg2); }
  .mstatus i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #6ee7a0; box-shadow: 0 0 8px rgba(110,231,160,.6); }
  .mstatus span { color: var(--mute); }
  .mpeek { margin-bottom: 26px; }                      /* the peek ends in empty space, not half a line of the next text */
  .crumbs .cid, .crumbs .sep:has(+ .cid) { display: none; }   /* the id is in the eyebrow just below */
  h1.ttl { display: block; -webkit-line-clamp: unset; overflow: visible; }   /* phones: the whole title, never cut */
}
@media (max-width: 820px) {   /* learning tree: deep nesting must not push past the screen edge */
  .node .kids { margin-left: 6px; padding-left: 10px; }
  #panel { overflow-x: hidden; } #content ul ul { padding-left: 14px; } #content li { overflow-wrap: anywhere; }   /* prerendered nested lists */
  .node > .head { flex-wrap: wrap; row-gap: 4px; }
  .node > .head .ttl { min-width: 0; flex-basis: 0; overflow-wrap: anywhere; }
  .node .inner { overflow-wrap: anywhere; padding: 10px 6px 4px; }
}
@media (max-width: 369px) { .topbar .status-chip { display: none; } nav a { padding: 0 5px; } }
/* tap targets: at least 44 x 44 px on touch screens and phones */
@media (max-width: 820px), (pointer: coarse) {
  .rows li > a, .rows li > .row { min-height: 44px; }
  .chip, .tchip, .chip.morechips { min-height: 44px; display: inline-flex; align-items: center; }
  .crumbs a { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; line-height: 1.3; }
  .crumbs { margin-bottom: 4px; flex-wrap: nowrap; gap: 2px 8px; } .crumbs a:first-child { flex: none; min-width: 44px; }
  .link, .more, .btn, .vbtn, .rnode, .rroot { min-height: 44px; }
  .badge.checked { min-height: 44px; padding: 0 14px; }
  .link { display: inline-flex; align-items: center; }
  .srcbtn { display: grid; place-items: center; min-width: 44px; min-height: 44px; margin-right: -10px; }
  .sticky .back { width: 44px; height: 44px; }
  details.refs summary { min-height: 44px; align-items: center; }
  .report a, .glance .cert { display: inline-flex; align-items: center; min-height: 44px; }
  .sitefoot nav a, .sitefoot p a { display: inline-flex; align-items: center; min-height: 44px; }
  .lv-sort span { display: flex; align-items: center; justify-content: center; min-height: 44px; }
  #lv-q { height: 44px; font-size: 16px; }
  .node > .head { min-height: 44px; }
  .uproute .morestep button.row { min-height: 44px; }
  .mapctl button { width: 44px; height: 44px; }
  .rows li > a:hover { transform: none; }
}

/* the one quiet report link in a cluster panel (feedback itself lives in the site footer) */
.report { margin: 26px 0 0; font-size: 12px; }
.report a { color: var(--dim); } .report a:hover, .report a:focus-visible { color: var(--fg2); }

/* ---------- panel redesign: theme glow, sticky title, summary, stat tiles ---------- */
#panel { --c: var(--accent); }
#panel::before { content: ""; position: sticky; top: 0; display: block; height: 0; z-index: 3; box-shadow: 0 0 60px 26px color-mix(in srgb, var(--c) 22%, transparent); pointer-events: none; }
#panel::after { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: linear-gradient(90deg, transparent, var(--c), transparent); opacity: .8; pointer-events: none; }
.sticky { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 8px; margin: -22px -24px -48px; padding: 0 16px; height: 48px; overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px);
  background: rgba(11,16,38,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; font-size: 14px; font-weight: 600; color: var(--fg); transition: opacity .2s, transform .25s var(--ease), visibility .2s, border-color .2s; }
.sticky.on { opacity: 1; visibility: visible; pointer-events: auto; transform: none; border-color: var(--line); }
.sticky + .crumbs { margin-top: 22px; }
.sticky span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky .back { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; display: grid; place-items: center; }
.sticky .back:hover { background: rgba(255,255,255,.1); }
.sticky .back svg { width: 16px; height: 16px; fill: none; stroke: var(--fg2); stroke-width: 2; }
.eyebrow .core { margin-left: auto; font-size: 10px; letter-spacing: .1em; color: var(--gold); border: 1px solid rgba(245,196,107,.4); border-radius: 999px; padding: 2px 8px; }
h1.ttl { font-size: 24px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tldr { font-size: 16.5px; line-height: 1.55; color: var(--fg); margin: 2px 0 8px; }
.clamp p { margin: 0; font-size: 14.5px; }
.clamp { position: relative; max-height: 4.9em; overflow: hidden; transition: max-height .45s var(--ease); }
.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.2em; background: linear-gradient(transparent, rgba(13,19,44,.95)); transition: opacity .3s; }
.clamp.open { max-height: 80em; } .clamp.open::after { opacity: 0; }
.link { background: none; border: none; padding: 4px 0; margin: 2px 0 0; color: var(--accent2); font-size: 13px; cursor: pointer; }
.link:hover { color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; margin: 16px 0 4px; }
.tile { text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 12px; padding: 10px 11px 9px; font: inherit; color: inherit; transition: border-color .2s, background .2s, transform .2s var(--ease); }
button.tile { cursor: pointer; } button.tile:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: rgba(255,255,255,.06); transform: translateY(-1px); }
.tile b { display: flex; align-items: center; min-height: 26px; font-family: var(--serif); font-size: 21px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.tile > span { display: block; font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile em { font-style: normal; }
.tile .dotsep { font-style: normal; color: var(--dim); margin: 0 6px; font-weight: 400; }
.tiles:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hiddenchips { display: contents; } .hiddenchips:not(.open) > * { display: none; }
.chip.morechips { cursor: pointer; background: none; border-style: dashed; color: var(--mute); }
.chip.morechips:hover { color: var(--fg); }
details.refs { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: rgba(255,255,255,.02); }
details.refs summary { list-style: none; cursor: pointer; padding: 12px 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
details.refs summary::-webkit-details-marker { display: none; }
details.refs summary::before { content: "›"; font-size: 15px; transition: transform .2s; display: inline-block; }
details.refs[open] summary::before { transform: rotate(90deg); }
details.refs summary small { flex-basis: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; color: var(--dim); }
details.refs .ref:last-child { margin-bottom: 14px; }
.route a, .route span.here { padding: 6px 0 6px 4px; }
.route a::before { transition: background .2s, box-shadow .2s; }
.route a:hover::before { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
@media (max-width: 820px) { .sticky { margin: 0 -18px -48px; top: 30px; } .sticky + .crumbs { margin-top: 4px; } h1.ttl { font-size: 22px; } }

/* site footer: one element, moved by app.js between the panel and the full-page view */
.sitefoot { padding: 14px 24px 22px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mute); }
.sitefoot nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; order: 0; }
.sitefoot a, .sitefoot nav a { color: var(--mute); text-decoration: none; padding: 0; font-size: 12px; border-radius: 0; background: none; }
.sitefoot a:hover, .sitefoot nav a:hover { color: var(--fg); background: none; }
.sitefoot p { margin: 0; font-size: 12px; color: var(--mute); }
.sitefoot p a { color: var(--accent2); }
#page > .sitefoot { max-width: 860px; margin: 14px auto 0; border-top: none; padding: 0 44px; }
@media (max-width: 820px) { .sitefoot { padding: 12px 18px calc(22px + env(safe-area-inset-bottom)); } #page > .sitefoot { padding: 0 20px 30px; } }

/* ---------- list mode ---------- */
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skiplink { position: fixed; z-index: 60; left: 12px; top: -60px; padding: 10px 14px; border-radius: 10px; background: var(--bg1); border: 1px solid var(--line2); color: var(--fg); font-size: 14px; }
.skiplink:focus { top: 12px; }
.mapctl #zlist { margin-top: 6px; }
#lv-h:focus { outline: none; }
.lv-ctl { position: sticky; top: 0; z-index: 5; margin: 14px -24px 0; padding: 12px 24px 10px; background: rgba(13,19,44,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
#lv-q { width: 100%; height: 38px; padding: 0 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; color: var(--fg); font-size: 15px; outline: none; transition: border-color .2s, background .2s, box-shadow .2s; }
#lv-q::placeholder { color: var(--dim); }
#lv-q:focus { border-color: rgba(142,162,255,.55); background: rgba(255,255,255,.08); box-shadow: 0 0 0 4px rgba(142,162,255,.12); }
.lv-sort { display: flex; gap: 4px; border: none; padding: 0; margin: 8px 0 0; }
.lv-sort label { flex: 1; position: relative; }
.lv-sort input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lv-sort span { display: block; text-align: center; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 9px; padding: 7px 6px; font-size: 12.5px; color: var(--mute); transition: color .2s, background .2s, border-color .2s; pointer-events: none; }
.lv-sort label:hover span { color: var(--fg); }
.lv-sort input:checked + span { color: var(--fg); border-color: var(--line2); background: rgba(142,162,255,.16); }
.lv-sort input:focus-visible + span { box-shadow: 0 0 0 3px rgba(142,162,255,.45); }
.lv-n { margin: 10px 0 0; }
.lv-g h3 { position: sticky; top: var(--lvtop, 99px); z-index: 1; margin: 18px -24px 4px; padding: 6px 24px; background: rgb(13,19,44); font-size: 13.5px; line-height: 1.35; }
.lv-g h3 a { color: var(--fg); } .lv-g h3 a:hover { color: #fff; }
.lv-g h3 .sw { flex: none; width: 9px; height: 9px; border-radius: 3px; }
.lv-g h3 .n { color: var(--dim); font-weight: 500; font-size: 12px; }
.lv-out .rows a:focus-visible, .lv-g h3 a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: rgba(142,162,255,.12); }
.lv-out mark { background: none; color: var(--gold); }
.lv-main { color: var(--gold); }
@media (max-width: 820px) {
  .lv-ctl { top: var(--lvgrip, 21px); margin: 12px -18px 0; padding: 10px 18px 8px; }
  .lv-g h3 { margin: 16px -18px 4px; padding: 6px 18px; }
  .lv-sort span { font-size: 12px; padding: 7px 4px; }
}
@media (prefers-reduced-motion: reduce) { .rows li > a:hover { transform: none; } }

/* ---------- Lean source viewer ---------- */
.src-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.src-act a.more { display: inline-block; }
.src-status { margin: 10px 0 6px; }
pre.src { margin: 0; max-height: 60vh; max-height: 60dvh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(5,8,21,.6); font: 12.5px/1.55 var(--mono); color: var(--fg2); tab-size: 2; }
pre.src:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
pre.src code { display: inline-block; min-width: 100%; padding: 8px 12px 8px 0; background: none; border-radius: 0; font: inherit; word-break: normal; white-space: pre; counter-reset: ln; }
pre.src .ln { display: block; }
pre.src .ln::before { counter-increment: ln; content: counter(ln); position: sticky; left: 0; display: inline-block; width: 3.6em; padding-right: 10px; margin-right: 10px; text-align: right; color: var(--dim); background: rgb(9,13,32); border-right: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
/* phones: wrap long lines (long imports were clipped at the edge); wrapped parts hang under the code, not the numbers */
@media (max-width: 820px) { #pagebody pre.src code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding: 8px 8px 8px 0; }
  pre.src .ln { padding-left: calc(3.6em + 21px); text-indent: calc(-3.6em - 21px); } }
pre.src .k { color: var(--uses); }
pre.src .s { color: var(--by); }
pre.src .c { color: var(--dim); font-style: italic; }
pre.src::-webkit-scrollbar { height: 10px; } pre.src::-webkit-scrollbar-corner { background: transparent; }
.tile .rg svg { height: 20px; width: auto; }
@media (max-width: 820px) {   /* one column of theme cards: the glyph sits at the end of the quiet line */
  .themes a { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: end; }
  .themes a .tn { grid-column: 1 / -1; }
  .themes a small { grid-column: 1; }
  .themes a .rg { grid-column: 2; grid-row: 2; padding-top: 0; margin: 0; }
}

/* ---------- cluster panel: why it's in the proof, builds on / needed by ---------- */
.feeds { margin: 8px 0 0; }
.uproute { position: relative; margin: 4px 0 2px; }
.uproute::before { content: ""; position: absolute; left: 3px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(color-mix(in srgb, var(--c) 70%, transparent), rgba(245,196,107,.7)); border-radius: 2px; }
.uproute li > a, .uproute li > .row { position: relative; }
.uproute .dot { position: relative; z-index: 1; }
.uproute .here .t { color: #fff; font-weight: 600; }
.uproute .t small { margin: 0 0 1px; }
.uproute .here .t small, .uproute .main .t small { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; font-weight: 600; }
.uproute .main .t small { color: var(--gold); }
.uproute .star { position: relative; z-index: 1; width: 8px; flex: none; display: grid; place-items: center; color: var(--gold); font-size: 14px; text-shadow: 0 0 10px var(--gold); }
.uproute .morestep button.row { width: calc(100% + 20px); border: 1px dashed var(--line2); background: none; cursor: pointer; color: var(--mute); font-size: 13px; text-align: left; padding: 6px 10px 6px 28px; }
.uproute .morestep button.row:hover { color: var(--fg); border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.tchips { margin-bottom: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 5px 10px; border-radius: 999px; cursor: pointer; color: var(--fg2);
  background: color-mix(in srgb, var(--tc) 10%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent); transition: background .2s, border-color .2s; }
.tchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 6px var(--tc); }
.tchip b { font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.tchip:hover, .tchip[aria-expanded=true] { background: color-mix(in srgb, var(--tc) 22%, transparent); border-color: var(--tc); color: #fff; }
.tpanel { margin: 4px 0 8px; padding: 4px 10px 6px; border-left: 2px solid var(--line2); }
.tpanel .rows li > a { margin: 0 -10px 0 -6px; }
.onroute { color: var(--gold); font-size: 12px; white-space: nowrap; }
.keyline { margin: 8px 0 2px; }
.keyline a { color: var(--fg2); } .keyline a:hover { color: #fff; }
details.fold summary { font-size: 11px; }
details.fold summary .chev { font-size: 14px; color: var(--dim); }
details.fold summary::before { content: none; }
details.fold[open] summary .chev { display: inline-block; transform: rotate(90deg); }
details.fold > :last-child { margin-bottom: 14px; }
/* file panel: imports grouped by cluster */
.fromain { margin: -6px 0 14px; }
.gimp .ghead { margin-top: 6px; }
.gimp .gfile a { padding: 4px 10px 4px 28px; font-size: 13px; }
.gimp .gfile.xtra { display: none; } .gimp.all .gfile.xtra { display: block; }
@media (max-width: 820px) { nav .wide { display: none; } }
#content.in > .tpanel, #content.in > .nball { animation-delay: 0s; animation-duration: .3s; }
/* QA12a: Explore is in the phone nav too (it was hidden, as the logo also goes home). Five 44 px items, the search
   button and the "Certified" chip do not fit next to the logo below about 440 px, so there the logo gives way to Explore */
@media (max-width: 440px) { .topbar > .brand { display: none; } nav a { padding: 0 3px; } .topbar { gap: 4px; } }
@media (max-width: 389px) { nav a { font-size: 13px; } .topbar .status-chip { padding: 0 3px; gap: 4px; } }
.rows.steps { border-left: 2px solid var(--line2); padding-left: 16px; margin-left: 2px; }
.rows.steps li > span.t { display: block; padding: 8px 0; font-size: 14px; color: var(--fg); }

/* cluster panel file rows: the row opens the file, </> jumps straight to its source */
.rows li.frow { display: flex; align-items: center; gap: 4px; }
.rows li.frow > a:first-child { flex: 1; min-width: 0; margin-right: 0; }
.srcbtn { flex: none; font: 500 11px var(--mono); color: var(--accent2); padding: 5px 7px; margin-right: -6px; border-radius: 7px; border: 1px solid rgba(142,162,255,.22); background: rgba(142,162,255,.06); transition: background .2s, color .2s; }
.srcbtn:hover { background: rgba(142,162,255,.18); color: #fff; }
.srcbtn:focus-visible, .vbtn:focus-visible, .rnode:focus-visible, .rroot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- wide source viewer (/file/<module>): the full-page view at ~80% width, full screen on phones ---------- */
body.viewer #pagebody { max-width: none; width: min(80vw, 1500px); padding: 0 32px 34px; }
body.viewer #close { display: none; }
body.viewer #page > .sitefoot { max-width: none; width: min(80vw, 1500px); }
.vhead { position: sticky; top: 0; z-index: 3; margin: 0 -32px 14px; padding: 18px 32px 12px; background: rgba(11,16,38,.96); border-bottom: 1px solid var(--line); border-radius: 22px 22px 0 0; }
.vbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.vbar .eyebrow { margin: 0 auto 0 0; }
.vbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--fg2); font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.vbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.vbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.vbtn.icon { width: 34px; padding: 0; justify-content: center; }
#pagebody h1.vpath { font: 500 19px/1.35 var(--mono); margin: 0 0 6px; word-break: break-all; color: #fff; }
.vpath .dir { color: var(--dim); }
#pagebody h1.vmissing { font-size: 22px; margin: 4px 0 8px; overflow-wrap: anywhere; }
#pagebody h1.vmissing code { font-size: .85em; }
.vmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.vmeta a { display: inline-flex; align-items: center; gap: 7px; color: var(--fg2); } .vmeta a:hover { color: #fff; }
.vmeta .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; flex: none; }
.vmeta .sep { color: var(--dim); }
.vnotes { margin: 0 0 12px; } .vnotes h3 { margin-top: 2px; } .vnotes p { font-size: 14px; margin-bottom: 6px; }
.vsrc .src-status { margin: 0 0 6px; }
body.viewer pre.src { max-height: calc(100vh - 260px); max-height: calc(100dvh - 260px); min-height: 240px; font-size: 13px; }
pre.src a.imp { color: var(--accent2); text-decoration: underline; text-decoration-color: rgba(180,193,255,.35); text-underline-offset: 3px; }
pre.src a.imp:hover, pre.src a.imp:focus-visible { color: #fff; text-decoration-color: currentColor; outline: none; background: rgba(142,162,255,.14); border-radius: 3px; }
pre.src a.imp.ext { color: var(--by); text-decoration-color: rgba(80,220,200,.35); }
.vfoot { margin: 10px 0 0; } .vfoot code { white-space: nowrap; word-break: normal; }
.vimps { margin-top: 16px; }
@media (max-width: 820px) {
  body.viewer #page { padding: 0; z-index: 35; }
  body.viewer #pagebody { width: 100%; min-height: 100%; border-radius: 0; border: none; padding: 0 14px calc(30px + env(safe-area-inset-bottom)); }
  body.viewer #page > .sitefoot { width: auto; }
  .vhead { top: 0; margin: 0 -14px 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-radius: 0; }
  #pagebody h1.vpath { font-size: 15px; }
  .vmeta > a[data-k] { flex-basis: 100%; } .vmeta > a[data-k] + .sep { display: none; }
  body.viewer pre.src { max-height: calc(100dvh - 210px); font-size: 12px; }
  .vbtn { height: 32px; padding: 0 10px; font-size: 12.5px; }
}

/* ---------- /route/: rings around the main theorem ---------- */
.rfig { margin: 18px auto 6px; max-width: 540px; }
svg.rings { display: block; width: 100%; height: auto; overflow: visible; }
.rband { fill: rgba(142,162,255,.035); stroke: rgba(142,162,255,.08); stroke-width: 1; fill-rule: evenodd; transition: fill .2s, stroke .2s; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.rband.on { fill: rgba(142,162,255,.13); stroke: rgba(200,210,255,.55); }
.rdots { animation: ringin .9s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
.rhit { fill: transparent; fill-rule: evenodd; cursor: pointer; pointer-events: all; outline: none; }
.rhit:focus-visible { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 4 4; }
.rstar { animation: starpulse 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.rnums text { font: 600 9.5px var(--sans); fill: var(--fg2); paint-order: stroke; stroke: rgba(5,8,21,.9); stroke-width: 3px; pointer-events: none; }
.rcap { text-align: center; font-size: 13.5px; color: var(--mute); min-height: 1.6em; margin-top: 8px; }
.rcap b { color: #fff; font-weight: 600; } .rcap a { margin-left: 6px; }
@keyframes ringin { from { opacity: 0; } to { opacity: 1; } }
@keyframes starpulse { 0%, 100% { opacity: 1; } 50% { opacity: .78; } }
.rtree { margin: 6px 0 0; }
.rroot { display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; margin: 0 auto; padding: 9px 14px; border-radius: 12px; border: 1px solid rgba(245,196,107,.45); background: rgba(245,196,107,.07); color: var(--fg); font-size: 14px; font-weight: 600; }
.rroot .star { color: var(--gold); font-size: 17px; text-shadow: 0 0 10px var(--gold); }
.rroot small { display: block; font-weight: 400; font-size: 12px; color: var(--mute); }
.rroot:hover { background: rgba(245,196,107,.14); color: #fff; }
.rcols { list-style: none; margin: 0; padding: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; position: relative; }
.rcols::before { content: ""; position: absolute; top: 0; left: 50%; height: 18px; width: 1px; background: rgba(245,196,107,.5); }
.rcols > li { border-top: 1px solid rgba(245,196,107,.3); padding-top: 10px; }
.rcols ul { list-style: none; margin: 6px 0 0 8px; padding: 0 0 0 12px; border-left: 1px solid var(--line2); display: grid; gap: 2px; }
.rnode { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 9px; color: var(--fg); font-size: 13px; line-height: 1.3; transition: background .2s; }
.rnode:hover { background: rgba(142,162,255,.1); color: #fff; }
.rnode.d1 { font-weight: 600; font-size: 13.5px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.rnode.d2 { color: var(--fg2); }
.rnode .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; box-shadow: 0 0 8px currentColor; }
.rstats { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px 14px; margin: 26px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.rstats > div { display: flex; flex-direction: column-reverse; min-width: 0; }
.rstats dd { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.rstats dt { font-size: 12px; color: var(--mute); }
.rstats code { font-size: 11px; padding: 0 3px; }
@media (max-width: 600px) { .rstats { grid-template-columns: 1fr 1fr; } .rcols { grid-template-columns: 1fr; } .rcols::before { left: 18px; } }

@media (prefers-reduced-motion: reduce) { .rstar, .rband, .rdots { animation: none; } }

/* ---------- colour by field, and map filters (filters section in app.js) ---------- */
/* desktop: a slim bar along the bottom edge of the map: the field legend (each chip a filter), then small dropdowns */
.fbar { position: fixed; z-index: 14; left: 16px; bottom: 16px; max-width: calc(100vw - var(--panel) - 56px); display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 5px 7px; border-radius: 14px; font-size: 12px; color: var(--mute); box-shadow: 0 10px 34px rgba(0,0,0,.3); transition: opacity .3s, visibility .3s; }
.fbar:empty { display: none; }
.fchips { display: flex; flex-wrap: wrap; gap: 2px 3px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 8px; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--fg2); font-size: 12px; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s, color .2s, opacity .2s; }
.fchip i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 7px var(--fc); }
.fchip small { display: none; }
.fchip:hover { background: rgba(255,255,255,.07); color: #fff; }
.fchip[aria-pressed=true] { color: #fff; background: color-mix(in srgb, var(--fc) 17%, transparent); border-color: color-mix(in srgb, var(--fc) 60%, transparent); }
.fchips:has([aria-pressed=true]) .fchip[aria-pressed=false] { color: var(--mute); }
.fchips:has([aria-pressed=true]) .fchip[aria-pressed=false] i { opacity: .55; box-shadow: none; }
body:not([data-cmode=field]) .fchip i { background: none; box-shadow: none; border: 1.5px solid var(--dim); }   /* the map's colours are not fields now */
.fbar .fctl { display: contents; }                       /* the controls flow in one row */
.fddb b:empty { display: none; }
.fp-fields { display: grid; gap: 2px; min-width: 250px; }    /* the Fields dropdown: one chip per line, with its count */
.fp-fields .fchip { justify-content: flex-start; height: 30px; border-radius: 8px; font-size: 13px; }
.fp-fields .fchip span { flex: 1; text-align: left; }
.fp-fields .fchip small { display: inline; color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fdd { position: relative; }
.fddb, .fnew { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 9px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--mute); font-size: 12px; cursor: pointer; white-space: nowrap; transition: color .2s, background .2s, border-color .2s; }
.fddb b { font-weight: 500; color: var(--fg2); }
.fddb svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .2s; }
.fddb[aria-expanded=true] svg { transform: rotate(180deg); }
.fddb:hover, .fnew:hover { color: var(--fg); background: rgba(255,255,255,.07); }
.fddb.on, .fnew[aria-pressed=true] { color: #fff; border-color: rgba(142,162,255,.45); background: rgba(142,162,255,.16); }
.fddb.on b { color: #fff; }
.fnew small { display: none; }
.fpop { position: absolute; left: -4px; bottom: calc(100% + 12px); z-index: 2; width: max-content; min-width: 220px; max-width: 340px; padding: 12px 14px 10px; border-radius: 12px; background: rgba(13,19,44,.97); border: 1px solid var(--line2); box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: pop .16s var(--ease); }
.fsec { border: none; margin: 0; padding: 0; min-width: 0; }
.fsec legend { padding: 0; margin-bottom: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.fsec legend small { display: block; margin-top: 2px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--dim); font-size: 11.5px; }
.fopts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.fopt { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; color: var(--fg2); cursor: pointer; border-radius: 7px; }
.fopt:hover { color: #fff; }
.fopt input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.fopt span { flex: 1; display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; }
.fopt small { color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fdrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--fg2); }
.fdrow label { display: inline-flex; align-items: center; gap: 6px; }
.fdrow select, .fcm select { height: 30px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line2); background: rgb(20,27,58); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.fcm { display: inline-flex; align-items: center; gap: 6px; margin-left: 3px; padding-left: 9px; border-left: 1px solid var(--line); }
.fcm select { height: 26px; font-size: 12px; color: var(--fg2); background: rgba(20,27,58,.9); }
.framp { display: none; align-items: center; gap: 5px; font-size: 11px; color: var(--mute); }
.framp i { width: 64px; height: 6px; border-radius: 3px; }
.framp b { font-weight: 500; }
body[data-cmode=dist] .framp { display: inline-flex; }
.fkeys { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; margin-left: 1px; padding-left: 7px; border-left: 1px solid var(--line); font-size: 11px; }   /* (compact: the bar stays one row at 1440 px with the panel open) */
.fkeys span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fkeys .lg { width: 10px; }
.fkeys { display: none; }
body.selected .fkeys { display: inline-flex; animation: rise .4s var(--ease); }
.fcount { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 0 auto; padding-left: 8px; font-size: 12px; color: var(--fg2); line-height: 1.3; white-space: nowrap; }
.fcount b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.fclr { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--line2); background: rgba(255,255,255,.05); color: var(--fg2); font-size: 11px; line-height: 1; cursor: pointer; }
.fclr:hover { background: rgba(255,255,255,.15); color: #fff; }
.fclr[hidden] { display: none; }
.fchip:focus-visible, .fddb:focus-visible, .fnew:focus-visible, .fclr:focus-visible, .fbtn:focus-visible, .ftag:focus-visible, .lv-fbtn:focus-visible, .fs-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the count, with its clear button: top left of the map, beside the zoom buttons (on phones, beside Filter) */
.fmob { position: fixed; z-index: 14; left: 64px; top: 84px; display: flex; align-items: center; gap: 6px; transition: opacity .3s, visibility .3s; }
.fbtn, .lv-fbtn { display: none; }
.fmob .fcount { display: none; }
.fmob.on .fcount { display: inline-flex; height: 36px; margin: 0; padding: 0 6px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); font-size: 12.5px; box-shadow: 0 8px 28px rgba(0,0,0,.3); animation: rise .3s var(--ease); }
.ph-only { display: none; }

/* cluster and theme panels: field · era · level, quiet; field and era apply that filter */
.ctags { display: flex; flex-wrap: wrap; align-items: center; gap: 0 7px; margin: -4px 0 12px; font-size: 12.5px; color: var(--mute); line-height: 1.4; }
.ctags .sep { color: var(--dim); }
.ctags .tagnote { margin-left: 4px; font-size: 11px; color: var(--mute); text-decoration: underline dotted; text-underline-offset: 2px; }
.ctags .tagnote:hover, .ctags .tagnote:focus-visible { color: var(--fg2); }
.badge[title] { cursor: help; }
.ftag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: none; background: none; color: var(--fg2); font-size: 12.5px; cursor: pointer; text-decoration: underline dotted rgba(180,193,255,.4); text-underline-offset: 3px; }
.ftag i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 6px var(--fc); }
.ftag:hover { color: #fff; text-decoration-color: currentColor; }
.ftag[aria-pressed=true] { color: #fff; text-decoration: underline solid var(--gold); }

/* the list follows the map's filters */
.lv-f { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 10px 0 0; font-size: 13px; color: var(--fg2); line-height: 1.45; }
.lv-f b { color: var(--mute); font-weight: 600; }
.lv-f .link { margin: 0; }

/* phones: a Filter button on the map (and in the list) opens a sheet with every control */
.fbadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #1a1205; font-size: 11px; font-weight: 700; }
.fbadge[hidden] { display: none; }
dialog.fsheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 560px; max-height: min(86vh, 760px); max-height: min(86dvh, 760px); margin: 0 auto; padding: 0; border: 1px solid var(--line2); border-bottom: none; border-radius: 20px 20px 0 0; background: rgb(12,18,42); color: var(--fg); box-shadow: 0 -20px 60px rgba(0,0,0,.5); overflow: hidden; overscroll-behavior: contain; }
dialog.fsheet[open] { display: flex; flex-direction: column; animation: sheetup .3s var(--ease); }
dialog.fsheet::backdrop { background: rgba(3,5,14,.5); }
.fs-in { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fs-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.fs-head h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--fg); }
.fs-head h2::after { content: none; }
.fs-x { display: grid; place-items: center; width: 44px; height: 44px; border: none; border-radius: 12px; background: none; cursor: pointer; }
.fs-x svg { width: 18px; height: 18px; stroke: var(--fg2); stroke-width: 2; fill: none; }
.fs-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 22px; padding: 14px 18px 18px; }
.fs-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fs-fields .fchip { height: auto; min-height: 44px; padding: 6px 10px; border-radius: 11px; border-color: var(--line); background: rgba(255,255,255,.03); font-size: 13.5px; line-height: 1.25; white-space: normal; text-align: left; }
.fs-fields .fchip span { flex: 1; }
.fs-fields .fchip small { display: inline; color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fsheet .fopts { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 6px; }
.fsheet .fopt { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.03); font-size: 14px; }
.fsheet .fopt:has(input:checked) { color: #fff; border-color: rgba(142,162,255,.5); background: rgba(142,162,255,.14); }
.fsheet .fopt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.fsheet .fopt input { width: 18px; height: 18px; }
.fsheet .fopt span { flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; }   /* a long label pushes its count below, never outside */
.fsheet .fdrow { font-size: 15px; }
.fsheet .fdrow select { height: 44px; min-width: 96px; padding: 0 10px; font-size: 16px; }
.fnew.fs-new { justify-self: start; height: auto; min-height: 44px; margin-top: -12px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.fnew.fs-new small { display: inline; margin-left: 4px; color: var(--dim); }
.fnew.fs-new[aria-pressed=true] small { color: var(--fg2); }
.fseg { display: flex; gap: 4px; }
.fseg label { position: relative; flex: 1; }
.fseg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.fseg span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); font-size: 14px; color: var(--mute); pointer-events: none; }
.fseg input:checked + span { color: var(--fg); border-color: var(--line2); background: rgba(142,162,255,.16); }
.fseg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(142,162,255,.45); }
.fs-cm .framp { margin-top: 10px; }
.fs-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) 18px; border-top: 1px solid var(--line); background: rgb(12,18,42); }
.fs-foot .fcount { flex: 1; min-width: 0; margin: 0; padding: 0; font-size: 13px; white-space: normal; }
.fs-foot .btn { min-height: 44px; padding: 0 16px; }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 820px) {
  .fbar { display: none; }
  .ph-only { display: inline; } .dk-only { display: none; }
  .fmob { left: max(8px, env(safe-area-inset-left)); top: calc(max(6px, env(safe-area-inset-top)) + 64px); max-width: calc(100vw - 72px); }
  .fbtn { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 13px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(13,19,44,.62); color: var(--fg2); font-size: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .fbtn svg, .lv-fbtn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .fmob.on .fbtn { color: #fff; border-color: rgba(245,196,107,.45); }
  .fmob.on .fcount { height: 44px; padding: 0 0 0 12px; gap: 0; border-radius: 12px; background: rgba(13,19,44,.78); backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 13px; box-shadow: none; }
  .fmob .fcs { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* "287 of 2,647": short on the map, whole for screen readers */
  .fmob .fclr { width: 40px; height: 44px; border: none; border-radius: 0 12px 12px 0; background: none; font-size: 13px; }
  .lv-ctl { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
  #lv-q { grid-column: 1; grid-row: 1; }
  .lv-fbtn { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--fg2); font-size: 14px; cursor: pointer; }
  .lv-sort { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 820px), (pointer: coarse) { .ftag { min-height: 44px; } .ctags { margin: -8px 0 4px; } }
@media (prefers-reduced-motion: reduce) { dialog.fsheet[open], .fpop { animation: none; } }
/* content pages built from Markdown (build_site.py: /status/, /faq/, /what-is-the-riemann-hypothesis/ …) */
.asof { margin-top: -4px; }
.tablewrap { overflow-x: auto; margin: 12px 0 16px; border: 1px solid var(--line); border-radius: 12px; }
.tablewrap table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.45; }
.tablewrap th, .tablewrap td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tablewrap th { color: var(--fg); font-weight: 600; background: rgba(255,255,255,.04); }
.tablewrap tr:last-child td { border-bottom: none; }
.callout { margin: 16px 0; padding: 14px 18px; border: 1px solid var(--line2); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: linear-gradient(90deg, rgba(142,162,255,.08), rgba(255,255,255,.02)); }
.callout p { margin: 8px 0; } .callout p:first-child { margin-top: 0; } .callout p:last-child { margin-bottom: 0; }
#pagebody pre, #content pre { overflow-x: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.25); font: 12.5px/1.55 var(--mono); }
#pagebody pre code, #content pre code { white-space: pre; word-break: normal; background: none; padding: 0; }
#pagebody p code, #pagebody li code, #content p code, #content li code { word-break: normal; overflow-wrap: anywhere; }   /* break only a code span that cannot fit a line */
.tablewrap code, .callout code { word-break: normal; overflow-wrap: break-word; }
#pagebody pre.wrap, #pagebody pre.wrap code { white-space: pre-wrap; overflow-wrap: anywhere; }   /* /api/: the index JSON wraps instead of scrolling sideways */
.ltabs { display: flex; gap: 4px; padding: 4px; margin: 18px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: #151c3d; position: sticky; top: -85px; z-index: 2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 14px rgba(5,8,21,.35); }
/* QA15: the tabs stick at the very top of the window (top = minus #page's top padding), not 84px down: stuck lower,
   the page scrolled on in the band above them, so the zeros figure showed above and below the bar. Anything scrolled
   into view inside the levels (the zeros figure, a section, a heading) stops below them (their height, about 50px) */
@media (max-width: 820px) { .ltabs { top: calc(env(safe-area-inset-top, 0px) - max(6px, env(safe-area-inset-top, 0px)) - 65px); } }
.levels .level, .levels h2, .levels h3, .levels .zfig { scroll-margin-top: 70px; }
.levels { scroll-margin-top: 84px; }   /* a jump to the levels (#student) shows the tabs with a little of the page above */
@media (max-width: 820px) { .levels { scroll-margin-top: 70px; } }
.ltabs a { flex: 1; text-align: center; padding: 9px 10px; min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--fg2); font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.ltabs a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.ltabs a.on { color: var(--fg); background: rgba(142,162,255,.18); box-shadow: inset 0 0 0 1px var(--line2); }
.levels.tabbed .level > h2:first-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.level[hidden] { display: none; }
@media (max-width: 820px) { .ltabs a { min-height: 44px; } .tablewrap table { font-size: 12.5px; } }

/* ---------- Share (cluster and theme panels and pages): copies the canonical link, or the phone's share sheet ---------- */
.sharebar { margin: 0 0 14px; }
.share { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--fg2); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.share:hover { background: rgba(255,255,255,.09); color: #fff; }
.share:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.share svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share.done { color: var(--ok); border-color: rgba(111,224,160,.45); }
@media (max-width: 820px), (pointer: coarse) { .share { min-height: 44px; padding: 0 18px 0 15px; font-size: 14px; } }

/* ---------- figures in content pages: the zeros figure (inline SVG from the build) ---------- */
.zfig { margin: 22px auto 26px; max-width: 440px; }
.zfig svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(5,8,21,.45); }
.zfig figcaption { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--mute); }
.zfig .z { cursor: default; outline: none; }
.zfig .z:hover circle, .zfig .z:focus circle { stroke: #fff; stroke-width: 2; }
.zfig .z:hover text, .zfig .z:focus text { fill: var(--gold); font-weight: 600; }
