@font-face { font-family: Geist; src: url(/fonts/geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/fonts/geist-mono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #070708; --s0: #0B0C0D; --s1: #0E0F10; --s2: #15161A; --s3: #1C1D22;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.14); --line3: rgba(255,255,255,.22);
  --fg: #F3F2EE; --fg2: #A3A29D; --fg3: #7C7B77; --fg4: #55544F;
  --accent: #FF6A2B; --accent2: #FFA477; --accent-bg: rgba(255,106,43,.12); --hot-bg: #1A0F0A;
  --st-e: #C4501F; --st-p: #FF6A2B; --st-m: #FFA477; --st-a: #FFD8C2; --st-d: #FFFFFF;
  --land: #FFFFFF; --land-o: .17;
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1200px; --gut: clamp(20px, 4vw, 40px); --top: 57px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #FAFAF8; --s0: #F3F3F0; --s1: #FFFFFF; --s2: #ECECE8; --s3: #E2E2DD;
    --line: rgba(0,0,0,.08); --line2: rgba(0,0,0,.14); --line3: rgba(0,0,0,.24);
    --fg: #111110; --fg2: #4F4F4A; --fg3: #6B6B65; --fg4: #9A9A93;
    --accent: #D9531C; --accent2: #B8501F; --accent-bg: rgba(217,83,28,.10); --hot-bg: #FFF1EA;
    --st-e: #8F3511; --st-p: #D9531C; --st-m: #F0955F; --st-a: #C9A48C; --st-d: #111110;
    --land: #111110; --land-o: .16;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01'; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, kbd, .num { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--line2); border-radius: 5px; color: var(--fg3); background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #000; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); height: 56px; display: flex; align-items: center; gap: 28px; }
.mark { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 18px; letter-spacing: -.03em; }
.mark svg { color: var(--accent); }
.top nav { display: flex; gap: 22px; font-size: 14px; margin-right: auto; }
.top nav a { color: var(--fg2); padding: 6px 0; transition: color .15s; }
.top nav a:hover, .top nav a.on { color: var(--fg); }
.top nav a.on { box-shadow: 0 1px 0 var(--accent); }
.find { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--line2); border-radius: 9px; background: var(--s1); color: var(--fg2); cursor: pointer; }
.find:hover { border-color: var(--line3); color: var(--fg); }
body.full .top-in { max-width: none; }

/* ---------- page scaffolding ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg3); font-weight: 400; }
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--fg3); padding-top: 28px; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--fg4); }
.sec { padding: 56px 0; border-top: 1px solid var(--line); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.sec-h h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.05; letter-spacing: -.04em; font-weight: 500; }
.sec-h .aside { font-family: var(--mono); font-size: 12px; color: var(--fg3); }
.split { display: flex; flex-wrap: wrap; gap: 20px 40px; }
.split > .side { flex: 0 0 160px; padding-top: 4px; }
.split > .main { flex: 999 1 560px; min-width: 0; }
.muted { color: var(--fg2); }
.dim { color: var(--fg3); }
.link-u { text-decoration: underline; text-decoration-color: var(--line3); text-underline-offset: 3px; }
.link-u:hover { text-decoration-color: var(--fg); }

/* ---------- buttons, chips, tags ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; cursor: pointer; font-size: 14px; transition: border-color .15s, background-color .15s; }
.btn:hover { border-color: var(--line3); background: var(--s1); }
.btn.solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); color: #000; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line2); background: var(--s1); cursor: pointer; }
.icon-btn:hover { border-color: var(--line3); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--s2); border-radius: 999px; }
.seg button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--fg2); font-size: 13px; cursor: pointer; transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--fg2); font-size: 13px; cursor: pointer; }
.chip:hover { color: var(--fg); border-color: var(--line3); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .c { font-family: var(--mono); font-size: 11px; opacity: .6; }
.tag { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--s2); color: var(--fg2); white-space: nowrap; }
.tag.rec { background: var(--accent-bg); color: var(--accent2); }
.tag.pos { background: transparent; border: 1px dashed var(--line3); color: var(--fg3); }
.pill { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; font-size: 13px; background: var(--fg); color: var(--bg); }
.pill.pos { background: transparent; color: var(--fg2); border: 1px dashed var(--line3); padding: 6px 11px; }
a.pill:hover { opacity: .85; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.st-e { --st: var(--st-e); } .st-p { --st: var(--st-p); } .st-m { --st: var(--st-m); } .st-a { --st: var(--st-a); } .st-d { --st: var(--st-d); }
.dot[class*="st-"] { background: var(--st); }

/* ---------- home ---------- */
.home-intro { padding: 72px 0 56px; }
.home-intro h1 { max-width: 760px; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.15; letter-spacing: -.035em; font-weight: 500; text-wrap: balance; }
.home-intro p { margin-top: 20px; max-width: 640px; font-size: 17px; line-height: 1.6; color: var(--fg2); text-wrap: pretty; }
.counts { margin-top: 28px; display: flex; gap: 8px 28px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; color: var(--fg3); }
.counts b { color: var(--fg); font-weight: 400; }
.qbox { position: relative; margin-top: 32px; max-width: 640px; }
.qfield { height: 48px; padding: 0 12px 0 16px; display: flex; align-items: center; gap: 12px; background: var(--s1); border: 1px solid var(--line2); border-radius: 10px; color: var(--fg3); }
.qfield:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.qfield input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; color: var(--fg); font: inherit; font-size: 15px; }
.qfield input::placeholder { color: var(--fg3); }
.qresults { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--s1); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); }
figure { margin: 0; }
figcaption { margin-top: 12px; display: flex; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; color: var(--fg3); }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; color: var(--fg3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { font-weight: 400; color: var(--fg); }
.model { display: flex; align-items: stretch; min-width: 720px; }
.model .box { flex: 1; padding: 16px; border: 1px solid var(--line2); border-radius: 10px; display: flex; flex-direction: column; gap: 14px; transition: border-color .2s; }
.model a.box:hover { border-color: var(--accent); }
.model .box div { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--fg3); }
.model .arrow { flex: none; width: 44px; align-self: center; color: var(--accent); }
.scroll-x { overflow-x: auto; }

/* ---------- tables ---------- */
.tbl { min-width: 680px; }
.tbl .tr { display: grid; gap: 12px; align-items: center; min-height: 44px; padding: 0 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tbl a.tr { transition: background-color .15s; }
.tbl a.tr:hover { background: var(--s1); }
.tbl .th { min-height: 38px; border-bottom: 1px solid var(--line2); font-family: var(--mono); font-size: 11px; color: var(--fg3); }
.tbl .th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tbl .th button:hover, .tbl .th button.on { color: var(--fg); }
.tbl .th button:focus-visible { outline: 2px solid var(--accent); }
.tbl .r { text-align: right; justify-self: end; }
.tbl .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .nm small { margin-left: 10px; color: var(--fg3); font-size: 13px; }
.tbl .n { font-family: var(--mono); font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.tbl .z { color: var(--fg4); }
.tbl .kind { display: inline-flex; align-items: center; gap: 8px; color: var(--fg3); }
.empty { padding: 40px 12px; color: var(--fg3); }
.toolbar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin: 28px 0 20px; }
.toolbar .qfield { flex: 1 1 280px; max-width: 420px; height: 40px; }
.k-glyph { width: 9px; height: 9px; flex: none; }
.k-product { background: var(--fg); border-radius: 2px; }
.k-part { border: 1.5px solid var(--fg2); border-radius: 2px; }
.k-material { background: var(--accent); border-radius: 50%; }
.k-place { border: 1.5px solid var(--accent); border-radius: 50%; }

/* ---------- node pages ---------- */
.node-head { padding: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 40px clamp(40px, 6vw, 96px); align-items: center; }
.node-head h1 { font-size: clamp(44px, 6vw, 88px); line-height: .92; letter-spacing: -.055em; font-weight: 500; text-wrap: balance; }
.node-head.small h1 { font-size: clamp(36px, 4.6vw, 64px); line-height: .98; }
.model-line { margin-top: 18px; font-family: var(--mono); font-size: 12px; color: var(--fg3); max-width: 560px; }
.tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.stats { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border-top: 1px solid var(--line2); }
.stats > div { padding-top: 16px; }
.stats .v { font-size: 30px; letter-spacing: -.04em; line-height: 1.1; }
.stats .v.sm { font-size: 17px; letter-spacing: -.01em; line-height: 1.3; padding-top: 6px; }
.stats .k { margin-top: 4px; font-size: 13px; color: var(--fg3); }
.route { margin-top: 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; color: var(--fg2); }
.route a:hover { color: var(--fg); }
.route svg { color: var(--accent); }
.card { padding: 24px; background: var(--s0); border: 1px solid var(--line); border-radius: 22px; }
.core { margin-top: 20px; display: flex; gap: 24px; align-items: stretch; }
.core .col { width: 72px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.core .col i { display: block; border-radius: 3px; transition: height .7s cubic-bezier(.2,.7,.2,1), background-color .3s, opacity .2s; }
.core .list { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.core .list a { height: 36px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--fg2); }
.core .list a .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.core .list a .n { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.core .list a.hot { color: var(--accent2); }
.core .list a:hover { color: var(--fg); }
.core.hovering .col i { opacity: .35; }
.core.hovering .col i.on { opacity: 1; }

.flowdiag { position: relative; }
.flowdiag svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.flowdiag .lk { fill: none; stroke: var(--fg); stroke-opacity: .14; stroke-width: 1.2; transition: stroke-opacity .2s, stroke .2s; }
.flowdiag .lk.pos { stroke-dasharray: 2 4; }
.flowdiag .lk.hot { stroke: var(--accent); stroke-opacity: 1; stroke-width: 1.6; }
.flowdiag .pulse { fill: none; stroke: var(--accent2); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: .4 4.6; animation: dash 2.6s linear infinite; }
.flowdiag.hovering .lk { stroke-opacity: .05; }
.flowdiag.hovering .lk.on { stroke: var(--accent); stroke-opacity: 1; }
.fd-cols { position: relative; display: grid; grid-template-columns: minmax(200px, 268px) minmax(120px, 1fr) minmax(240px, 400px); }
.fd-col { display: flex; flex-direction: column; }
.fd-col.l { grid-column: 1; gap: 10px; }
.fd-col.r { grid-column: 3; gap: 8px; }
.fd-item { min-height: 44px; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--s1); border: 1px solid var(--line2); border-radius: 11px; font-size: 13px; transition: border-color .2s, background-color .2s; }
.fd-col.l .fd-item { min-height: 50px; font-size: 14px; }
.fd-item:hover, .fd-item.on { border-color: var(--accent); }
.fd-item.hot { background: var(--hot-bg); border-color: var(--accent); }
.fd-item .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-item .meta { display: flex; gap: 8px; align-items: center; flex: none; font-family: var(--mono); font-size: 11px; color: var(--fg3); }
.fd-item.hot .meta { color: var(--accent2); }

.rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ring { padding: 20px; background: var(--s1); border: 1px solid var(--line); border-radius: 18px; display: flex; align-items: center; gap: 18px; }
.ring svg { flex: none; transform: rotate(-90deg); }
.ring .bg { fill: none; stroke: var(--line); stroke-width: 2.4; }
.ring .fg { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; animation: ringin 1.6s .2s cubic-bezier(.2,.7,.2,1) backwards; }
.ring .v { font-size: 28px; letter-spacing: -.04em; line-height: 1.1; }
.ring .k { font-size: 14px; color: var(--fg2); }
.ring .w { font-family: var(--mono); font-size: 11px; color: var(--fg3); }

.mapfig { position: relative; background: var(--s0); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.mapfig .map { position: relative; width: 100%; aspect-ratio: 1440 / 536; }
.stagebar { display: flex; height: 6px; gap: 2px; border-radius: 3px; overflow: hidden; margin: 14px 20px; }
.stagebar i { display: block; min-width: 4px; background: var(--st); }
.mapfig .legend { margin: 0 20px 16px; }

.lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 40px 56px; }
.list h3 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.rows { border-top: 1px solid var(--line2); }
.rowl { min-height: 44px; padding: 8px 0; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
a.rowl:hover .nm { color: var(--accent2); }
.rowl .nm { flex: 1; min-width: 0; }
.rowl .nm small { display: block; font-size: 12px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowl .n { font-family: var(--mono); font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; flex: none; }
.rowl .bar { width: 80px; height: 2px; flex: none; background: var(--line); border-radius: 2px; }
.rowl .bar i { display: block; height: 2px; background: var(--accent); border-radius: 2px; }
.rowl.pos { color: var(--fg3); }
.more { margin-top: 12px; background: none; border: 0; padding: 6px 0; color: var(--fg3); font-family: var(--mono); font-size: 12px; cursor: pointer; }
.more:hover { color: var(--fg); }
.group { border-bottom: 1px solid var(--line); padding: 10px 0; }
.group > a { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.group > a:hover { color: var(--accent2); }
.group .kids { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--fg3); }
.group .kids a:hover { color: var(--fg); }
details.notes { border-top: 1px solid var(--line); }
details.notes summary { list-style: none; cursor: pointer; padding: 16px 0; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--fg3); }
details.notes summary::-webkit-details-marker { display: none; }
details.notes summary:hover { color: var(--fg); }
details.notes summary::after { content: '+'; }
details.notes[open] summary::after { content: '−'; }
details.notes ol, details.notes ul { margin: 0 0 20px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--fg2); }
details.notes li::marker { font-family: var(--mono); font-size: 11px; color: var(--fg4); }

/* ---------- map ---------- */
.map svg { display: block; width: 100%; height: 100%; overflow: visible; }
.map .land { fill: none; stroke: var(--land); stroke-opacity: var(--land-o); stroke-linecap: round; }
/* Dashed paths can't use non-scaling-stroke (dashes get measured on screen, not on pathLength), so widths divide by zoom via --s. */
.map .rt { fill: none; stroke: var(--st, var(--accent)); stroke-opacity: .5; stroke-width: calc(1.1px * var(--s, 1)); }
.map .rt.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.2,.7,.2,1) forwards; }
.map .rt.dimmed { stroke-opacity: .06; }
.map .rt.lit { stroke-opacity: 1; stroke-width: calc(1.8px * var(--s, 1)); }
.map .fl { fill: none; stroke: var(--accent2); stroke-width: calc(1.8px * var(--s, 1)); stroke-linecap: round; stroke-dasharray: .3 4.7; animation: dash 3.2s linear infinite; pointer-events: none; }
.map .pt { fill: var(--st); stroke: var(--bg); stroke-width: .8; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .3s; }
.map .pt:hover { stroke: var(--fg); stroke-width: 1.5; }
.map .pt.dimmed { opacity: .12; }
.map .pt.sel { stroke: var(--fg); stroke-width: 2; }
.map .ping { fill: none; stroke: var(--fg); stroke-width: 1.2; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: ping 2.4s ease-out infinite; pointer-events: none; }
.map .lbl { font-family: var(--mono); font-size: 11px; fill: var(--fg); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }

#tip { position: fixed; z-index: 60; pointer-events: none; padding: 8px 10px; background: var(--s2); border: 1px solid var(--line2); border-radius: 8px; font-size: 12px; max-width: 280px; opacity: 0; transform: translateY(3px); transition: opacity .12s, transform .12s; }
#tip.on { opacity: 1; transform: none; }
#tip b { font-weight: 500; display: block; }
#tip span { color: var(--fg3); font-family: var(--mono); font-size: 11px; }

/* ---------- map explorer ---------- */
.explorer { position: relative; height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); min-height: 560px; overflow: hidden; }
.explorer .map { position: absolute; inset: 0; aspect-ratio: auto; }
.explorer .map svg { cursor: grab; }
.explorer .map svg:active { cursor: grabbing; }
.panel { position: absolute; z-index: 5; padding: 16px; background: color-mix(in srgb, var(--s0) 90%, transparent); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.panel.left { left: 16px; top: 16px; width: 280px; max-width: calc(100% - 32px); }
.panel.right { right: 16px; top: 16px; width: 330px; max-width: calc(100% - 32px); max-height: calc(100% - 100px); overflow: auto; }
.select { position: relative; }
.select select { appearance: none; width: 100%; min-height: 44px; padding: 0 36px 0 12px; background: var(--s2); border: 1px solid var(--line2); border-radius: 10px; color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; }
.select::after { content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--fg2); border-bottom: 1.5px solid var(--fg2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.stages { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.stages button { min-height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; border-radius: 9px; color: var(--fg); font-size: 13px; cursor: pointer; text-align: left; }
.stages button:hover { background: var(--s2); }
.stages button .dot { width: 10px; height: 10px; background: var(--st); border: 1.5px solid var(--st); }
.stages button[aria-pressed="false"] { color: var(--fg3); }
.stages button[aria-pressed="false"] .dot { background: transparent; }
.stages button .nm { flex: 1; }
.stages button .n { font-family: var(--mono); font-size: 12px; }
.place-card h2 { margin-top: 12px; font-size: 30px; line-height: 1; letter-spacing: -.04em; font-weight: 500; }
.place-card .sub { margin-top: 8px; font-size: 14px; color: var(--fg2); }
.place-card .big { margin-top: 18px; padding: 14px; background: var(--s2); border-radius: 12px; display: flex; align-items: baseline; gap: 12px; }
.place-card .big b { font-size: 34px; font-weight: 400; letter-spacing: -.05em; line-height: 1; }
.place-card .big span { font-size: 13px; color: var(--fg2); }
.zoombar { position: absolute; z-index: 5; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 2px; padding: 3px; background: color-mix(in srgb, var(--s0) 90%, transparent); border: 1px solid var(--line); border-radius: 12px; }
.zoombar button { width: 40px; height: 40px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.zoombar button:hover { background: var(--s2); }
.closex { width: 32px; height: 32px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 8px; color: var(--fg2); cursor: pointer; }
.closex:hover { background: var(--s2); color: var(--fg); }

/* ---------- data page ---------- */
.files { border-top: 1px solid var(--line2); }
.files a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); font-size: 14px; }
.files a:hover .nm { color: var(--accent2); }
.files .nm { font-family: var(--mono); font-size: 13px; }
.files small { color: var(--fg3); font-size: 13px; }
.prose { max-width: 680px; font-size: 15px; line-height: 1.65; color: var(--fg2); display: flex; flex-direction: column; gap: 14px; }
.prose b { color: var(--fg); font-weight: 500; }
ul.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.6; color: var(--fg2); }

/* ---------- palette ---------- */
#palette { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
#palette[hidden] { display: none; }
.palette-box { width: 640px; max-width: 100%; background: var(--s1); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); overflow: hidden; }
.palette-field { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--fg3); }
.palette-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--fg); font: inherit; font-size: 16px; }
#palette ul { list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 520px); overflow: auto; }
.hit { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.hit .nm { flex: 1; min-width: 0; }
.hit .nm small { display: block; font-size: 12px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit .ty { font-family: var(--mono); font-size: 11px; color: var(--fg3); }
.hit[aria-selected="true"] { background: var(--s2); }
.hit mark { background: none; color: var(--accent2); }
.nohit { padding: 18px 12px; color: var(--fg3); font-size: 14px; }

/* ---------- motion ---------- */
.rise { animation: rise .8s cubic-bezier(.2,.7,.2,1) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dash { to { stroke-dashoffset: -20; } }
@keyframes ringin { from { stroke-dashoffset: 100; } }
@keyframes ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(3.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .map .rt.draw { stroke-dashoffset: 0; }
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .top-in { gap: 16px; }
  .top nav { gap: 14px; }
  .find kbd { display: none; }
  .core .col { width: 48px; }
  .panel.right { top: auto; bottom: 16px; max-height: 50%; }
  .panel.left { width: auto; right: 16px; }
  .stages { flex-direction: row; flex-wrap: wrap; }
  .stages button .n { display: none; }
  .zoombar { display: none; }
}
