:root {
  --bg: #f3efe6;
  --bg-2: #ebe6da;
  --surface: #fbf9f4;
  --surface-2: #f0ebe0;
  --line: #dcd5c6;
  --line-2: #cbc2b0;
  --text: #15151a;
  --muted: #5c5a55;
  --faint: #8d897f;
  --a1: #5b45e0;      /* violet: primary */
  --a1-soft: #e6e1ff;
  --a2: #e2502f;      /* coral: packets, heat */
  --a2-soft: #fde2d9;
  --a3: #0d9488;      /* teal: ok */
  --a3-soft: #d4f1ec;
  --a4: #b7791f;      /* amber */
  --glow-1: rgba(91, 69, 224, .16);
  --glow-2: rgba(226, 80, 47, .12);
  --on-a1: #ffffff;
  --shadow: 0 1px 0 rgba(0,0,0,.03), 0 18px 40px -24px rgba(40,30,10,.25);
  --grain: .05;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0f; --bg-2: #0f1017; --surface: #12131b; --surface-2: #181a24;
    --line: #23263a; --line-2: #31354d;
    --text: #eeecf6; --muted: #a09fb2; --faint: #6c6b80;
    --a1: #a594ff; --a1-soft: #221d45;
    --a2: #ff7a59; --a2-soft: #3a1c14;
    --a3: #3ee0c4; --a3-soft: #0f2e2a;
    --a4: #f2c14e;
    --glow-1: rgba(140, 115, 255, .22); --glow-2: rgba(255, 122, 89, .14);
    --on-a1: #0a0a0f;
    --shadow: 0 1px 0 rgba(255,255,255,.02), 0 24px 50px -28px rgba(0,0,0,.9);
    --grain: .07;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0f; --bg-2: #0f1017; --surface: #12131b; --surface-2: #181a24;
  --line: #23263a; --line-2: #31354d;
  --text: #eeecf6; --muted: #a09fb2; --faint: #6c6b80;
  --a1: #a594ff; --a1-soft: #221d45;
  --a2: #ff7a59; --a2-soft: #3a1c14;
  --a3: #3ee0c4; --a3-soft: #0f2e2a;
  --a4: #f2c14e;
  --glow-1: rgba(140, 115, 255, .22); --glow-2: rgba(255, 122, 89, .14);
  --on-a1: #0a0a0f;
  --shadow: 0 1px 0 rgba(255,255,255,.02), 0 24px 50px -28px rgba(0,0,0,.9);
  --grain: .07;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15.5px/1.55 "Geist", system-ui, -apple-system, sans-serif;
  background-image:
    radial-gradient(900px 600px at 85% -10%, var(--glow-1), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, var(--glow-2), transparent 60%);
  background-attachment: fixed;
}
body::after { /* film grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.mono { font-family: "Geist Mono", ui-monospace, Menlo, monospace; }
.serif { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px);
}
.me { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: conic-gradient(from 210deg, var(--a1), var(--a2), var(--a4), var(--a3), var(--a1)); color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35);
}
.me b { display: block; font-size: 14.5px; line-height: 1.2; }
.me span { font-size: 12px; color: var(--faint); }
.navlbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 12px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 14.5px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.nav a .kbd { margin-left: auto; font-size: 11px; color: var(--faint); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.open-chip {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 11px; border-radius: 11px; font-size: 12.5px; line-height: 1.4;
  background: var(--a3-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--a3) 30%, transparent);
}
.open-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--a3); flex: none; margin-top: 5px; animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--a3) 70%, transparent); } 80%,100% { box-shadow: 0 0 0 7px transparent; } }
.rail-tools { display: flex; gap: 6px; }
.tbtn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--muted);
}
.tbtn:hover { color: var(--text); border-color: var(--line-2); }

main { min-width: 0; padding: 28px clamp(16px, 4vw, 56px) 80px; }
.view { display: none; max-width: 1080px; margin: 0 auto; animation: rise .5s cubic-bezier(.2,.8,.2,1); }
.view.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 0 0 10px; }
.vh { font-size: clamp(34px, 5vw, 54px); line-height: 1.02; letter-spacing: -0.025em; margin: 0 0 12px; font-weight: 600; }
.vh .serif { font-style: italic; letter-spacing: -0.01em; font-size: 1.08em; }
.vsub { color: var(--muted); max-width: 640px; margin: 0 0 28px; font-size: 16.5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }

/* ---------- home ---------- */
.home-hero { padding: 6vh 0 28px; position: relative; }
.hello { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.hello .wave { display: inline-block; animation: wave 2.6s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100% { transform: rotate(0); } 10%,30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } }
.big {
  font-size: clamp(44px, 8.2vw, 104px); line-height: .95; letter-spacing: -0.045em; font-weight: 600; margin: 22px 0 22px;
}
.big .serif { font-style: italic; font-weight: 400; letter-spacing: -0.02em; font-size: 1.06em; }
.big .grad { background: linear-gradient(100deg, var(--a1) 10%, var(--a2) 60%, var(--a4)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 680px; margin: 0 0 30px; }
.lede b { color: var(--text); font-weight: 600; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  text-decoration: none; font-weight: 600; font-size: 14.5px; border: 1px solid var(--line); background: var(--surface);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--line-2); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); box-shadow: 0 10px 30px -12px var(--a1); }
.btn .k { font-size: 11px; padding: 1px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: .55; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 44px; }
.stat { padding: 18px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .v { font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stat .v small { font-size: .5em; color: var(--faint); font-weight: 500; letter-spacing: 0; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 6px; }
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.door {
  position: relative; overflow: hidden; padding: 20px; min-height: 190px; text-decoration: none; display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.door:hover { transform: translateY(-3px); border-color: var(--line-2); }
.door h3 { margin: auto 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.door p { margin: 0; font-size: 13.5px; color: var(--muted); }
.door .art { position: absolute; inset: 0 0 auto 0; height: 110px; opacity: .95; }
.door .go { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); font-size: 14px; transition: transform .2s; }
.door:hover .go { transform: rotate(-45deg); }

/* ---------- map ---------- */
.map-wrap { position: relative; overflow: hidden; }
.map-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.map-top .path { font-size: 12.5px; color: var(--faint); }
.map-top .spacer { flex: 1; }
.send { height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }
.send:hover { border-color: var(--a2); color: var(--a2); }
svg.map { display: block; width: 100%; height: auto; }
.map .edge { fill: none; stroke: var(--line-2); stroke-width: 1.6; }
.map .edge.dash { stroke-dasharray: 4 5; }
.map .packet { fill: var(--a2); filter: drop-shadow(0 0 6px var(--a2)); }
.map .packet.v { fill: var(--a1); filter: drop-shadow(0 0 6px var(--a1)); }
.map .node { cursor: pointer; }
.map .node rect.box { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.2; transition: stroke .2s, fill .2s; }
.map .node:hover rect.box, .map .node.sel rect.box { stroke: var(--a1); fill: var(--a1-soft); }
.map .node:focus { outline: none; }
.map .node:focus-visible rect.box { stroke: var(--a2); stroke-width: 2; }
.map .node text.t { fill: var(--text); font: 600 15px "Geist", sans-serif; }
.map .node text.s { fill: var(--muted); font: 12px "Geist Mono", monospace; }
.map .node .tag { fill: var(--a1); }
.map .node .tagt { fill: var(--on-a1); font: 600 10px "Geist Mono", monospace; letter-spacing: .04em; }
.map .plat rect { fill: var(--a1-soft); stroke: color-mix(in srgb, var(--a1) 45%, transparent); stroke-dasharray: 5 5; }
.map .lane { fill: var(--faint); font: 500 10.5px "Geist Mono", monospace; letter-spacing: .12em; }
.map-log { border-top: 1px solid var(--line); padding: 10px 16px; font-size: 12.5px; color: var(--muted); min-height: 40px; display: flex; gap: 10px; flex-wrap: wrap; }
.map-log b { color: var(--a3); font-weight: 500; }
.map-hint { position: absolute; left: 16px; bottom: 54px; font-size: 12px; color: var(--faint); }

.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 100vw); z-index: 60; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: -30px 0 60px -30px rgba(0,0,0,.5); transform: translateX(105%);
  transition: transform .38s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(5,5,10,.35); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.d-head { padding: 22px 22px 16px; border-bottom: 1px solid var(--line); position: relative; }
.d-head .layer { font-size: 11.5px; color: var(--a1); text-transform: uppercase; letter-spacing: .1em; }
.d-head h2 { margin: 6px 0 6px; font-size: 28px; letter-spacing: -0.02em; font-weight: 600; }
.d-head p { margin: 0; color: var(--muted); font-size: 14.5px; }
.d-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.d-body { padding: 18px 22px 30px; overflow: auto; }
.d-body h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 18px 0 10px; font-weight: 500; }
.d-body h4:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.wins { list-style: none; margin: 0; padding: 0; }
.wins li { position: relative; padding: 10px 0 10px 18px; border-top: 1px solid var(--line); font-size: 14.5px; }
.wins li:first-child { border-top: 0; }
.wins li::before { content: ""; position: absolute; left: 0; top: 18px; width: 7px; height: 7px; border-radius: 2px; background: var(--a2); transform: rotate(45deg); }
.wins b { font-weight: 600; }

/* ---------- trace ---------- */
.trace { padding: 0; overflow: hidden; }
.tr-head { display: grid; grid-template-columns: 250px 1fr; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
.tr-head > div { padding: 12px 16px; }
.axis { position: relative; height: 100%; }
.axis span { position: absolute; top: 12px; transform: translateX(-50%); }
.tr-row { display: grid; grid-template-columns: 250px 1fr; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.tr-row:hover, .tr-row.sel { background: var(--surface-2); }
.tr-row:last-child { border-bottom: 0; }
.tr-name { padding: 11px 16px; font-size: 13px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-name .svc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-name .ind { color: var(--faint); }
.tr-name .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tr-bar { position: relative; }
.tr-bar .gridl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .7; }
.span-b {
  position: absolute; top: 9px; height: 22px; border-radius: 6px; display: flex; align-items: center; padding: 0 8px;
  font-size: 11.5px; color: #fff; white-space: nowrap; overflow: hidden; min-width: 6px;
  transform-origin: left; animation: grow .9s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.span-b.live::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 22px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55)); animation: shimmer 1.6s infinite; }
@keyframes shimmer { 0%,100% { opacity: .2; } 50% { opacity: .9; } }
.evt { position: absolute; top: 13px; width: 13px; height: 13px; transform: translateX(-50%) rotate(45deg); border-radius: 2px; background: var(--a4); box-shadow: 0 0 0 3px var(--surface); }
.tr-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; margin-top: 16px; }
.tr-detail > div { padding: 20px 22px; }
.tr-detail > div + div { border-left: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
.tr-detail h3 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -0.015em; font-weight: 600; }
.tr-detail p { margin: 0 0 10px; color: var(--muted); }

/* ---------- lab ---------- */
.lab { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.exp { padding: 20px; display: flex; flex-direction: column; gap: 10px; min-height: 230px; position: relative; overflow: hidden; }
.exp .stamp { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; align-self: flex-start; }
.stamp.live { background: var(--a3-soft); color: var(--a3); }
.stamp.oss { background: var(--a1-soft); color: var(--a1); }
.stamp.soon { background: var(--a2-soft); color: var(--a2); }
.exp h3 { margin: 4px 0 0; font-size: 21px; letter-spacing: -0.015em; font-weight: 600; }
.exp p { margin: 0; color: var(--muted); font-size: 14.5px; }
.exp .row { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.exp .row a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.exp .row a:hover { text-decoration: underline; }
.exp.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; min-height: 0; }
.retry { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.retry .ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.toggle button { border: 0; background: var(--surface); padding: 6px 10px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.toggle button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.lanes { display: grid; gap: 6px; }
.lane-r { display: grid; grid-template-columns: 74px 1fr 66px; align-items: center; gap: 10px; font-size: 12px; }
.lane-r .track { height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.lane-r .track i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--a1); border-radius: 4px; transition: width .5s cubic-bezier(.3,.7,.3,1); }
.lane-r .res { text-align: right; }
.res.dup { color: var(--a2); font-weight: 600; }
.res.ok { color: var(--a3); }
.ledger { margin-top: 12px; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; border-top: 1px dashed var(--line-2); padding-top: 10px; }
.ledger b { font-size: 22px; letter-spacing: -0.02em; }
.ledger b.bad { color: var(--a2); }
.ledger b.good { color: var(--a3); }

/* ---------- now ---------- */
.now-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.lc { padding: 22px; }
.ring-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c b { font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.ring .c span { font-size: 12px; color: var(--faint); }
.legend { display: grid; gap: 8px; font-size: 14px; }
.legend div { display: flex; align-items: center; gap: 10px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; padding-left: 18px; }
.heat { display: grid; grid-template-columns: repeat(26, 1fr); gap: 3px; margin-top: 20px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heat i.l1 { background: color-mix(in srgb, var(--a3) 35%, var(--surface-2)); }
.heat i.l2 { background: color-mix(in srgb, var(--a3) 65%, var(--surface-2)); }
.heat i.l3 { background: var(--a3); }
.nowlist { padding: 22px; }
.nowlist ul { list-style: none; padding: 0; margin: 0; }
.nowlist li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.nowlist li:first-child { border-top: 0; padding-top: 0; }
.nowlist li span { color: var(--faint); font-size: 12px; padding-top: 3px; }

/* ---------- tldr ---------- */
.tldr { padding: 0; overflow: hidden; }
.tldr-top { padding: 26px 26px 22px; display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tldr-top .avatar { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }
.tldr-top h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.tldr-top p { margin: 2px 0 0; color: var(--muted); }
.clock { margin-left: auto; font-size: 12.5px; color: var(--faint); text-align: right; }
.clock b { display: block; font-size: 26px; color: var(--text); letter-spacing: -0.02em; }
.tldr-grid { display: grid; grid-template-columns: 1fr 1.1fr; }
.tldr-grid > div { padding: 22px 26px; }
.tldr-grid > div + div { border-left: 1px solid var(--line); }
.tldr h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 0 0 10px; font-weight: 500; }
.tldr-foot { border-top: 1px solid var(--line); padding: 16px 26px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- contact ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.pager > div { padding: 26px; }
.pager > div + div { border-left: 1px solid var(--line); background: var(--bg-2); }
.page-btn {
  width: 100%; height: 120px; border-radius: 18px; border: 0; cursor: pointer; font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  color: #fff; background: radial-gradient(120% 140% at 20% 0%, var(--a2), #b8321a 70%);
  box-shadow: 0 2px 0 rgba(255,255,255,.25) inset, 0 20px 40px -18px var(--a2); transition: transform .1s;
}
.page-btn:active { transform: translateY(2px) scale(.99); }
.page-btn small { display: block; font-size: 12.5px; font-weight: 500; opacity: .85; margin-top: 4px; }
.links-list a { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; font-size: 15px; }
.links-list a:first-child { border-top: 0; }
.links-list a span { color: var(--faint); font-size: 13px; }
.links-list a:hover span { color: var(--a1); }

/* ---------- palette ---------- */
.pal-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(5,5,10,.45); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 14vh 16px 0; }
.pal-scrim.open { display: flex; }
.pal { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); overflow: hidden; }
.pal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 16px 18px; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; }
.pal li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 14.5px; }
.pal li.act { background: var(--surface-2); }
.pal li span { margin-left: auto; font-size: 12px; color: var(--faint); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 90; transition: all .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mobile ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  main { padding: 20px 16px 110px; }
  .tabbar {
    display: flex; position: fixed; z-index: 50; left: 12px; right: 12px; bottom: 12px; padding: 6px; gap: 2px;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border-radius: 11px; text-decoration: none; font-size: 10.5px; color: var(--muted); }
  .tabbar a b { font-size: 16px; font-weight: 400; line-height: 1; }
  .tabbar a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
  .mtop { display: flex !important; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .doors, .lab, .now-grid, .tldr-grid, .pager, .tr-detail { grid-template-columns: 1fr; }
  .exp.feature { grid-template-columns: 1fr; }
  .tldr-grid > div + div, .pager > div + div, .tr-detail > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .tr-head, .tr-row { grid-template-columns: 120px 1fr; }
  .tr-name { padding: 11px 10px; font-size: 12px; }
  .tr-name .ind { display: none; }
  .clock { margin-left: 0; text-align: left; }
  .map-hint { display: none; }
}
.mtop { display: none; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.map-list { display: none; }
@media (max-width: 640px) {
  svg.map { display: none; }
  .map-list { display: grid; gap: 0; position: relative; padding: 8px 16px 8px 34px; }
  .map-list::before { content: ""; position: absolute; left: 21px; top: 30px; bottom: 30px; width: 2px; background: linear-gradient(var(--a1), var(--a2)); border-radius: 2px; }
  .map-list button { position: relative; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: 6px 0; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; }
  .map-list button::before { content: ""; position: absolute; left: -17px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--a1); }
  .map-list button.sel { border-color: var(--a1); background: var(--a1-soft); }
  .map-list button.plat-b { background: var(--a1-soft); border-style: dashed; }
  .map-list b { font-weight: 600; font-size: 15px; }
  .map-list span { font-size: 12px; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .map .packet { display: none; }
}

/* no-JS fallback: show every view stacked */
.no-js .view { display: block; margin-bottom: 64px; }
.no-js .drawer, .no-js .scrim, .no-js .tabbar { display: none; }
