:root {
  color-scheme: light;
  --cc-bg: #f8fafc;
  --cc-surface: #ffffff;
  --cc-accent-1: #818cf8;
  --cc-accent-2: #2dd4bf;
  --cc-accent-3: #fbbf24;
  --cc-accent-4: #f472b6;
  --bg: var(--cc-bg);
  --bg-2: #eef2ff;
  --bg-3: #ffffff;
  --ink: #0f172a;
  --muted: #334155;
  --faint: #475569;
  --teal: #3730a3;
  --teal-2: #312e81;
  --violet: #6366f1;
  --amber: #92400e;
  --rose: #9f1239;
  --ok: #047857;
  --line: rgba(15, 23, 42, 0.12);
  --glass: color-mix(in srgb, var(--cc-surface) 78%, transparent);
  --glass-2: color-mix(in srgb, var(--cc-surface) 88%, transparent);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --sans: Aptos, "Segoe UI Variable", "Segoe UI", "Segoe UI Web (West European)", ui-sans-serif, system-ui, sans-serif;
  --serif: Aptos, "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: "Cascadia Mono", "Segoe UI Mono", ui-monospace, monospace;
  --radius: 8px;
  --nav: 340px;
  --dock: 84px;
  --focus: #3730a3;
  --mica-1: color-mix(in srgb, var(--cc-accent-1) 32%, transparent);
  --mica-2: color-mix(in srgb, var(--cc-accent-2) 26%, transparent);
  --mica-4: color-mix(in srgb, var(--cc-accent-4) 18%, transparent);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --cc-bg: #0b1120;
  --cc-surface: #131d31;
  --cc-accent-1: #818cf8;
  --cc-accent-2: #2dd4bf;
  --cc-accent-3: #fbbf24;
  --cc-accent-4: #f472b6;
  --bg-2: #10192c;
  --bg-3: #18243a;
  --ink: #e8eefc;
  --muted: #cbd5e1;
  --faint: #94a3b8;
  --teal: #c7d2fe;
  --teal-2: #818cf8;
  --violet: #a5b4fc;
  --amber: #fcd34d;
  --rose: #fda4af;
  --ok: #6ee7b7;
  --line: rgba(226, 232, 240, 0.16);
  --glass: color-mix(in srgb, var(--cc-surface) 72%, transparent);
  --glass-2: color-mix(in srgb, #1c2942 86%, transparent);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --focus: #fbbf24;
}

:root[data-theme="hc"] {
  color-scheme: dark;
  --cc-bg: #000;
  --cc-surface: #000;
  --cc-accent-1: #fff;
  --cc-accent-2: #ff0;
  --cc-accent-3: #ff0;
  --cc-accent-4: #fff;
  --bg-2: #000;
  --bg-3: #000;
  --ink: #fff;
  --muted: #fff;
  --faint: #fff;
  --teal: #ff0;
  --teal-2: #ff0;
  --violet: #fff;
  --amber: #ff0;
  --rose: #ff0;
  --ok: #fff;
  --line: #fff;
  --glass: #000;
  --glass-2: #000;
  --shadow: none;
  --focus: #ff0;
  --mica-1: transparent;
  --mica-2: transparent;
  --mica-4: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  font-size: calc(16.5px * var(--type));
  color: var(--ink);
  background-color: var(--cc-bg);
  background-image:
    radial-gradient(1100px 520px at -10% -20%, var(--mica-1), transparent 60%),
    radial-gradient(900px 480px at 110% -10%, var(--mica-2), transparent 55%),
    radial-gradient(800px 420px at 80% 120%, var(--mica-4), transparent 50%);
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(rgba(15, 23, 42, 0.45) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] body::before { opacity: 0.22; mix-blend-mode: screen; background-image: radial-gradient(rgba(255, 255, 255, 0.45) 0.6px, transparent 0.6px); }
:root[data-theme="hc"] body::before { display: none; }

:root[data-theme="teams"] {
  color-scheme: dark;
  --cc-bg: #1b1233;
  --cc-surface: #2a2048;
  --cc-accent-1: #b9a7ff;
  --cc-accent-2: #7ee0c8;
  --cc-accent-3: #ffd56a;
  --cc-accent-4: #ff8fb8;
  --bg-2: #241a40;
  --bg-3: #35285a;
  --ink: #f6f1ff;
  --muted: #ddd4f5;
  --faint: #c4b6e6;
  --teal: #d6c8ff;
  --teal-2: #b9a7ff;
  --violet: #c4b5fd;
  --amber: #ffd56a;
  --rose: #ff8fb8;
  --ok: #7ee0c8;
  --line: rgba(230, 220, 255, 0.28);
  --glass: color-mix(in srgb, #3a2c62 74%, transparent);
  --glass-2: color-mix(in srgb, #2a2048 90%, transparent);
  --shadow: 0 16px 36px rgba(20, 8, 40, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --focus: #ffd56a;
  --mica-1: color-mix(in srgb, #7b61ff 42%, transparent);
  --mica-2: color-mix(in srgb, #5b5fc7 34%, transparent);
  --mica-4: color-mix(in srgb, #ff8fb8 24%, transparent);
}
:root[data-theme="teams"] body::before {
  opacity: 0.2;
  mix-blend-mode: screen;
  background-image: radial-gradient(rgba(255, 255, 255, 0.4) 0.6px, transparent 0.6px);
}

:root { --type: 1; }
html[data-font="sm"] { --type: 0.92; }
html[data-font="md"] { --type: 1; }
html[data-font="lg"] { --type: 1.14; }
html[data-font="xl"] { --type: 1.28; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--cc-accent-3);
  color: #000;
  padding: 8px 12px;
  z-index: 30;
}
.skip:focus { top: 12px; }
a { color: var(--teal); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.mark, .icon-btn svg, .bottom-nav svg { display: block; }

.top {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-height: 56px;
  padding: 8px 14px;
  background: color-mix(in srgb, var(--cc-surface) 94%, transparent);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(22px) saturate(1.4);
}
.top-row { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 180px; }
.brand b { font-family: var(--serif); font-weight: 650; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.mark { width: 32px; height: 32px; flex: none; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.search-btn, .icon-btn, .primary, .ghost, .choice, .chip {
  border: 1px solid var(--line);
  background: var(--glass-2);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.primary {
  background: linear-gradient(180deg, #6366f1, #4338ca);
  color: #fff;
  border-color: transparent;
  font-weight: 650;
}
:root[data-theme="dark"] .primary { color: #0b1120; background: linear-gradient(180deg, #c7d2fe, #818cf8); }
:root[data-theme="hc"] .primary { color: #000; background: #ff0; }
:root[data-theme="teams"] .primary { color: #1b1233; background: linear-gradient(180deg, #efe7ff, #b9a7ff); }
.ghost { background: transparent; }
.search-btn { flex: 1; text-align: left; color: var(--muted); max-width: 520px; min-height: 44px; }
.top-meta { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.pill {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: color-mix(in srgb, var(--cc-surface) 70%, transparent);
}
.shell { display: grid; grid-template-columns: var(--nav) 1fr; min-height: calc(100vh - 56px); }
main { container-type: inline-size; }
.nav {
  position: sticky;
  top: var(--header-h, 148px);
  align-self: start;
  height: calc(100vh - var(--header-h, 148px));
  overflow: auto;
  padding: 12px 10px 120px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--cc-surface) 55%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
}
.nav h2 {
  margin: 16px 10px 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav a.item, .nav button.item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 10px;
  margin: 0 0 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--cc-surface) 78%, transparent);
}
.nav a.item:hover { border-color: var(--cc-accent-1); }
.nav a.item[aria-current="page"], .nav button.item[aria-current="page"] {
  border-color: var(--cc-accent-2);
  background: color-mix(in srgb, var(--cc-accent-2) 20%, var(--cc-surface));
  box-shadow: inset 4px 0 0 var(--cc-accent-2);
}
.nav a.item .mi, .nav a.item .idx {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--cc-accent-1) 16%, var(--cc-bg));
}
.nav a.item .mi { padding: 10px; }
.nav .idx { font-family: var(--mono); font-size: 12px; color: var(--teal); }
.nav a.item .mi-label { font-weight: 750; line-height: 1.2; }
.nav a.item .mi-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
main { padding: 22px 28px 132px; min-width: 0; }
.kicker { letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; color: var(--teal); margin: 0 0 8px; font-weight: 650; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: calc(clamp(32px, 4vw, 48px) * var(--type)); margin: 0 0 12px; }
#view-title { font-size: calc(clamp(20px, 2.4vw, 32px) * var(--type)); margin: 0 0 8px; }
h2 { font-size: calc(clamp(22px, 2.4vw, 32px) * var(--type)); margin: 18px 0 8px; }
h3 { font-size: calc(18px * var(--type)); margin: 0 0 6px; }
.lede { font-size: calc(18px * var(--type)); max-width: 68ch; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid { display: grid; gap: 12px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); margin: 18px 0; }
.stat, .card, .panel, .bench, .lesson-card, .qcard, .track-tile {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.35);
}
.stat { padding: 14px 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 28px; font-weight: 650; min-width: 4.5ch; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stage, .hero3d, .topology-stage {
  position: relative;
  height: 420px;
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cc-accent-1) 16%, var(--cc-surface)), color-mix(in srgb, var(--cc-bg) 80%, #000));
  perspective: 1200px;
}
.topology-stage canvas { width: 100%; height: 100%; display: block; }
.gl-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.gl-fallback[hidden], canvas[hidden] { display: none; }
.floor {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 28px;
  height: 120px;
  transform: rotateX(68deg);
  background:
    linear-gradient(color-mix(in srgb, var(--cc-accent-1) 35%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--cc-accent-2) 35%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid color-mix(in srgb, var(--cc-accent-1) 40%, transparent);
  transform-origin: center bottom;
}
.track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 0 0 18px; }
.track-tile {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 140px;
  padding: 14px;
  text-decoration: none;
  color: var(--ink);
}
.track-tile .idx { color: var(--teal); font-family: var(--mono); font-size: 13px; }
.track-tile strong { font-family: var(--serif); font-size: 20px; letter-spacing: -0.03em; }
.track-tile em { font-style: normal; color: var(--muted); font-size: 12px; }
.track-tile span:last-child {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.track-tile:hover { transform: translateY(-2px); }
.core { position: absolute; left: 50%; top: 58%; width: min(520px, 86%); transform: translate(-50%, -50%); z-index: 2; }
.hero-actions { margin-top: 8px; }
.split { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 14px; align-items: start; }
.panel, .card, .bench, .lesson-card, .qcard { padding: 16px; }
.card h3, .panel h3 { margin-top: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--faint); }
.flow-svg, .chart-svg, .map-svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag { border-radius: 6px; padding: 4px 8px; border: 1px solid var(--line); font-size: 12px; display: inline-block; }
.tag.bad { color: var(--rose); }
.tag.ok { color: var(--ok); }
.tag.warn { color: var(--amber); }
.callout { border-left: 3px solid var(--cc-accent-1); padding: 8px 12px; margin: 12px 0; background: color-mix(in srgb, var(--cc-accent-1) 10%, transparent); border-radius: 0 8px 8px 0; }
.callout.warn { border-color: var(--cc-accent-3); }
.callout.bad { border-color: var(--cc-accent-4); }
.prose p { max-width: 72ch; }
.deps { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.lesson-list { display: grid; gap: 8px; }
.lesson-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.num { font-family: var(--mono); font-size: 18px; color: var(--teal); }
.lab-grid, .card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  background: var(--cc-surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 0;
}
textarea { width: 100%; min-height: 88px; }
.ladder, .table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 8px 6px; vertical-align: top; }
.choice { display: block; width: 100%; text-align: left; margin: 8px 0; border-radius: 8px; }
.choice[aria-pressed="true"] { border-color: var(--teal); }
.choice.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.choice.wrong { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 12%, transparent); }
.flip { min-height: 220px; display: grid; place-items: center; text-align: center; padding: 24px; cursor: pointer; background: var(--glass-2); border-radius: 12px; border: 1px solid var(--line); }
.flip strong { font-family: var(--serif); font-size: 28px; }
.dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass-2);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow);
}
.dock p { margin: 0; color: var(--muted); font-size: 14px; max-height: 3.2em; overflow: auto; }
.palette { position: fixed; inset: 0; z-index: 12; background: rgba(15, 23, 42, 0.45); display: grid; place-items: start center; padding-top: 12vh; }
.palette[hidden] { display: none; }
.palette .box {
  width: min(680px, calc(100% - 24px));
  background: var(--cc-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px; background: transparent; }
.hits { max-height: 50vh; overflow: auto; }
.hits button { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
.hits button[aria-selected="true"], .hits button:hover { background: color-mix(in srgb, var(--cc-accent-1) 14%, transparent); }
.progress { height: 8px; background: color-mix(in srgb, var(--ink) 8%, transparent); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--cc-accent-1), var(--cc-accent-2)); }
.check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: inline-block; }
.check.on { background: var(--cc-accent-2); border-color: var(--cc-accent-2); }
.menu-btn { display: none; }
.menu-label { display: none; font-weight: 750; line-height: 1; }
.sheet-bar, .sheet-prefs { display: none; }
body[data-home="1"] .sheet-bar { display: flex; }
html { scroll-behavior: smooth; }
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.45s ease; }
.map-wrap { overflow: auto; }
.node-btn { cursor: pointer; }
.meter { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--cc-accent-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.packet { offset-path: path("M 40 80 C 180 80, 220 40, 360 40"); animation: ride 3.6s linear infinite; }
.flow-line { stroke-dasharray: 8 10; animation: dash 2.8s linear infinite; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.hero-frame {
  margin: 14px 0;
  padding: 1px;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--cc-accent-1), var(--cc-accent-2), var(--cc-accent-3), var(--cc-accent-4));
  background-size: 280% 280%;
  animation: sheen 14s linear infinite;
}
.glass-plane {
  position: absolute;
  width: 140px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  animation: floaty 7s ease-in-out infinite;
}
.glass-plane b { display: block; font-size: 16px; }
.glass-plane span { color: var(--muted); font-size: 12px; }
.p1 { left: 4%; top: 14%; }
.p2 { left: 24%; top: 6%; animation-delay: -1.2s; }
.p3 { right: 24%; top: 8%; animation-delay: -2.1s; }
.p4 { right: 4%; top: 16%; animation-delay: -3s; }
.hero-packet {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cc-accent-2);
  offset-path: path("M 70 180 C 220 90, 520 70, 860 190");
  animation: ride 4.8s linear infinite;
}
.figure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.figure { margin: 0; }
.figure-canvas { overflow: auto; }
.figure svg, .panel > svg { width: 100%; height: auto; }
.more-figures { margin: 8px 0 16px; }
.audio-card audio { width: min(100%, 520px); margin-top: 8px; }
.fault h2 { font-size: 20px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.5s ease-in forwards; }
.loading { color: var(--muted); }

.bottom-nav { display: none; }
.sip-ladder, .lis-board { margin: 12px 0; }
.sip-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sip-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.sip-party, .lis-board article {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--cc-accent-1) 8%, var(--cc-surface));
  font-size: 13px;
  font-weight: 650;
}
.sip-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sip-steps li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 4px 10px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--cc-surface) 70%, transparent);
}
.sip-steps li strong { grid-column: 2; }
.sip-steps li em { grid-column: 2; font-style: normal; color: var(--faint); font-size: 12px; }
.sip-steps li span { grid-column: 2; color: var(--muted); }
.sip-rail {
  grid-row: 1 / span 3;
  height: 8px;
  margin-top: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cc-accent-1), var(--cc-accent-2));
  opacity: 0.35;
}
.sip-steps li.is-on { border-color: var(--cc-accent-1); background: color-mix(in srgb, var(--cc-accent-1) 16%, var(--cc-surface)); }
.sip-steps li.is-on .sip-rail { opacity: 1; }
.sip-steps li.is-done .sip-rail { opacity: 0.7; }
.sip-steps li.is-fail { border-color: var(--cc-accent-4); }
.sip-inspect {
  white-space: pre-wrap;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
}
.match-line { font-family: var(--mono); font-size: 18px; letter-spacing: 0.02em; }
.match-line .g0 { color: var(--muted); }
.match-line .g1 { background: color-mix(in srgb, var(--cc-accent-1) 35%, transparent); border-radius: 4px; }
.match-line .g2 { background: color-mix(in srgb, var(--cc-accent-2) 40%, transparent); border-radius: 4px; }
.match-line .g3 { background: color-mix(in srgb, var(--cc-accent-3) 45%, transparent); border-radius: 4px; }
.match-line .g4 { background: color-mix(in srgb, var(--cc-accent-4) 40%, transparent); border-radius: 4px; }
.lis-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.lis-board article { display: grid; gap: 4px; min-height: 96px; }
.lis-board article span { font-weight: 450; color: var(--muted); }
.lis-board article.is-on { outline: 2px solid var(--cc-accent-1); }
.lis-board article.is-fail { outline-color: var(--cc-accent-4); }
.ps-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0f172a; color: #e2e8f0; }
.ps-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #1e293b; font-size: 12px; }
.ps-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--cc-accent-2); box-shadow: 0 0 10px var(--cc-accent-2); }
#ps-log { margin: 0; min-height: 220px; max-height: 360px; overflow: auto; padding: 12px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
#ps-form { display: flex; gap: 8px; align-items: center; padding: 8px 12px 12px; }
.ps-prompt { font-family: var(--mono); color: #99f6e4; }
#ps-in { flex: 1; background: transparent; color: #f8fafc; border: 0; border-radius: 0; padding: 6px 0; }
.ps-chips { margin-top: 8px; }
.syslog { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px; overflow: auto; font-family: var(--mono); font-size: 12px; }
.scenario-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.incident { margin: 8px 0 18px; }

@keyframes lift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes dash { to { stroke-dashoffset: -240; } }
@keyframes ride { to { offset-distance: 100%; } }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes fall { to { transform: translateY(100vh) rotate(200deg); opacity: 0.15; } }

@container (max-width: 860px) {
  .split, .two, .three { grid-template-columns: 1fr; }
  .lis-board { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: none; position: fixed; z-index: 11; top: var(--header-h, 160px); left: 0; bottom: auto; width: min(320px, 88vw); height: auto; max-height: calc(100vh - var(--header-h, 160px)); background: var(--cc-bg); }
  .nav.open { display: block; }
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; }
  .split, .two, .three { grid-template-columns: 1fr; }
  .stage, .hero3d, .topology-stage { height: 320px; }
  .track-tile:hover { transform: none; }
  .core { position: relative; left: auto; top: auto; transform: none; width: auto; padding: 12px; }
  .floor { display: none; }
  .glass-plane { position: relative; left: auto; right: auto; top: auto; width: auto; margin: 8px; }
  .hero3d { height: auto; perspective: none; }
  .hero-packet { display: none; }
  main { padding: 16px 14px 150px; }
  .dock { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .lis-board { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .top { padding: 6px 8px; }
  .search-btn { flex: 0 0 auto; max-width: none; width: auto; font-size: 0; padding: 8px 10px; }
  .search-btn::after { content: "Search"; font-size: 14px; }
  .nav { top: var(--header-h, 210px); max-height: calc(100vh - var(--header-h, 210px)); }
  .skybar { flex-wrap: nowrap; overflow-x: auto; }
  .primary-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .primary-nav a, .spot-nav .spot { text-align: center; font-size: 12px; padding: 7px 2px; }
  .spot-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mascot-row .monkey { width: 36px; height: 42px; }
  .hero-flow { max-height: 96px; }
  .grid.stats.live-counters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .live-counters .stat { padding: 6px 4px; }
  .live-counters .stat b { font-size: 16px; }
  .live-counters .stat span { font-size: 10px; line-height: 1.2; }
  .billboard .signal-grid { grid-template-columns: 1fr 1fr; }
  .billboard .signal-card .chart-svg { max-height: 64px; }
  #view-title { font-size: calc(22px * var(--type)); }
  .top-meta .pill { display: none; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    background: color-mix(in srgb, var(--cc-surface) 88%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(1.4);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 650;
    border-radius: 8px;
  }
  .bottom-nav a[aria-current="page"], .bottom-nav button[aria-current="page"] {
    color: var(--ink);
    background: color-mix(in srgb, var(--cc-accent-1) 18%, transparent);
  }
  .dock { bottom: 62px; left: 8px; right: 8px; padding: 6px 8px; }
  main { padding-bottom: 168px; }
  h1 { font-size: calc(30px * var(--type)); }
  .sip-cols { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) { scroll-behavior: auto; }
  html:not([data-motion="full"]) *,
  html:not([data-motion="full"]) *::before,
  html:not([data-motion="full"]) *::after {
    animation: none !important;
    transition: none !important;
  }
  html:not([data-motion="full"]) .track-tile:hover { transform: none; }
  html:not([data-motion="full"]) .packet,
  html:not([data-motion="full"]) .hero-packet,
  html:not([data-motion="full"]) .confetti { display: none; }
}
html[data-motion="reduce"] { scroll-behavior: auto; }
html[data-motion="reduce"] *,
html[data-motion="reduce"] *::before,
html[data-motion="reduce"] *::after {
  animation: none !important;
  transition: none !important;
}
html[data-motion="reduce"] .track-tile:hover { transform: none; }
html[data-motion="reduce"] .packet,
html[data-motion="reduce"] .hero-packet,
html[data-motion="reduce"] .confetti { display: none; }

.settings-grid { display: grid; gap: 12px; max-width: 760px; }
.setting {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
}
.setting legend { font-weight: 650; padding: 0 4px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row .choice { display: inline-flex; width: auto; margin: 0; text-align: center; }
.choice-row .choice[aria-pressed="true"] {
  outline: 3px solid var(--focus);
  border-color: var(--focus);
}
.setting select, .setting input[type="range"] { width: min(100%, 440px); background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.sheet {
  font-family: var(--mono);
  font-size: calc(13px * var(--type));
  white-space: pre-wrap;
  background: var(--bg-3);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  overflow: auto;
}
a.icon-btn { text-decoration: none; color: var(--ink); }

.readbar {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 0;
  z-index: 20;
  background: linear-gradient(90deg, var(--cc-accent-1), var(--cc-accent-2), var(--cc-accent-4));
  pointer-events: none;
}
.link-rail, .rail-scroll { display: contents; }
.skybar { order: 1; }
.top-row { order: 2; }
.primary-nav { order: 3; }
.skybar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2px;
  font-size: 12px;
  font-weight: 650;
}
.skybar a {
  flex: none;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--cc-surface) 70%, transparent);
}
.skybar a:hover { color: var(--ink); background: color-mix(in srgb, var(--cc-accent-1) 22%, var(--cc-surface)); }
.theme-cycle { min-height: 36px; padding: 0 10px; }
.monkey { width: 72px; height: 80px; display: block; overflow: visible; }
.monkey.mini { width: 40px; height: 44px; flex: none; }
.monkey .arm { transform-origin: 20px 50px; }
.monkey[data-pose="idle"] { animation: floaty 4.5s ease-in-out infinite; }
.monkey[data-pose="wave"] .arm { animation: wave 0.7s ease-in-out infinite; }
.monkey[data-pose="think"] .arm { transform: rotate(-68deg); }
.monkey[data-pose="listen"] .headset { stroke: var(--cc-accent-2); }
.monkey[data-pose="celebrate"] { animation: lift 0.55s ease-in-out infinite; }
@keyframes wave { 50% { transform: rotate(-54deg); } }
.site-foot {
  margin: 8px 16px 110px;
  padding: 18px 16px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  display: grid;
  gap: 8px;
}
.site-foot .sig { font-family: var(--serif); font-size: 20px; margin: 0; }
.next-labs { display: flex; flex-wrap: wrap; gap: 8px; }
.next-labs a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--bg-3);
}
.egg {
  margin: 0 16px 24px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cc-accent-3) 30%, var(--cc-surface));
}
.reading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.reading a { font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.ports { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ports th, table.ports td { border-bottom: 1px solid var(--line); text-align: left; padding: 8px 6px; vertical-align: top; }
table.ports th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.share-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  background:
    radial-gradient(400px 180px at 10% 0%, var(--mica-1), transparent 60%),
    var(--bg-3);
  border: 1px solid var(--line);
  transform: perspective(800px) rotateX(2deg);
}
.share-score { font-family: var(--serif); font-size: 42px; margin: 0; }
.cut-row { align-items: flex-start; }
body::after {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  right: -90px;
  bottom: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mica-2), transparent 68%);
  pointer-events: none;
  z-index: 0;
  animation: floaty 11s ease-in-out infinite;
}
.shell, .site-foot { position: relative; z-index: 1; }

:root[data-theme="light"] {
  color-scheme: light;
  --cc-bg: #f4f7fb;
  --cc-surface: #ffffff;
  --cc-accent-1: #2563eb;
  --cc-accent-2: #0f766e;
  --cc-accent-3: #d97706;
  --cc-accent-4: #db2777;
  --bg-2: #e7eef8;
  --bg-3: #ffffff;
  --ink: #0f172a;
  --muted: #334155;
  --faint: #475569;
  --teal: #1d4ed8;
  --teal-2: #1e3a8a;
  --violet: #4f46e5;
  --amber: #92400e;
  --rose: #9f1239;
  --ok: #047857;
  --line: rgba(15, 23, 42, 0.14);
  --focus: #1d4ed8;
  --mica-1: color-mix(in srgb, #60a5fa 34%, transparent);
  --mica-2: color-mix(in srgb, #2dd4bf 28%, transparent);
  --mica-4: color-mix(in srgb, #f472b6 22%, transparent);
}

:root[data-theme="futuristic"] {
  color-scheme: dark;
  --cc-bg: #061018;
  --cc-surface: #0d1c2b;
  --cc-accent-1: #5ee7ff;
  --cc-accent-2: #7c9cff;
  --cc-accent-3: #d6ff4a;
  --cc-accent-4: #ff7ad9;
  --bg-2: #0a1622;
  --bg-3: #123044;
  --ink: #e7f7ff;
  --muted: #c5e4f5;
  --faint: #8fb4c9;
  --teal: #b6f3ff;
  --teal-2: #5ee7ff;
  --violet: #b7c6ff;
  --amber: #e8ff8a;
  --rose: #ffb3e6;
  --ok: #b6f7c9;
  --line: rgba(180, 236, 255, 0.28);
  --glass: color-mix(in srgb, #103044 78%, transparent);
  --glass-2: color-mix(in srgb, #0d2233 90%, transparent);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(94, 231, 255, 0.25);
  --focus: #d6ff4a;
  --mica-1: color-mix(in srgb, #5ee7ff 36%, transparent);
  --mica-2: color-mix(in srgb, #7c9cff 30%, transparent);
  --mica-4: color-mix(in srgb, #ff7ad9 24%, transparent);
}
:root[data-theme="futuristic"] body {
  background-image:
    linear-gradient(rgba(94, 231, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 231, 255, 0.05) 1px, transparent 1px),
    radial-gradient(900px 420px at 0% 0%, var(--mica-1), transparent 55%);
  background-size: 28px 28px, 28px 28px, auto;
}

:root[data-theme="gaming"] {
  color-scheme: dark;
  --cc-bg: #120814;
  --cc-surface: #241028;
  --cc-accent-1: #39ff14;
  --cc-accent-2: #ff2bd6;
  --cc-accent-3: #ffe600;
  --cc-accent-4: #4df0ff;
  --bg-2: #1a0c1c;
  --bg-3: #311433;
  --ink: #f7f3ea;
  --muted: #e7d5ef;
  --faint: #c9b3d4;
  --teal: #f3ffe6;
  --teal-2: #39ff14;
  --violet: #ff8ae8;
  --amber: #ffe600;
  --rose: #ff8ad8;
  --ok: #b6ff9a;
  --line: rgba(57, 255, 20, 0.35);
  --glass: color-mix(in srgb, #2a1230 80%, transparent);
  --glass-2: color-mix(in srgb, #1c0c22 92%, transparent);
  --shadow: 0 0 0 1px rgba(57, 255, 20, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
  --focus: #ffe600;
  --radius: 2px;
  --mica-1: color-mix(in srgb, #39ff14 28%, transparent);
  --mica-2: color-mix(in srgb, #ff2bd6 28%, transparent);
  --mica-4: color-mix(in srgb, #4df0ff 22%, transparent);
}
:root[data-theme="gaming"] .track-tile,
:root[data-theme="gaming"] .card,
:root[data-theme="gaming"] .panel {
  box-shadow: 4px 4px 0 var(--cc-accent-2);
}

:root[data-theme="neon"] {
  color-scheme: dark;
  --cc-bg: #07010f;
  --cc-surface: #14081f;
  --cc-accent-1: #ff2d95;
  --cc-accent-2: #22e6ff;
  --cc-accent-3: #d6ff3f;
  --cc-accent-4: #b388ff;
  --bg-2: #100616;
  --bg-3: #241033;
  --ink: #fff5fb;
  --muted: #f0d4ea;
  --faint: #c9b0d4;
  --teal: #ffd0ea;
  --teal-2: #ff2d95;
  --violet: #d7c4ff;
  --amber: #eaff8a;
  --rose: #ff9ec8;
  --ok: #c8ff8a;
  --line: rgba(255, 45, 149, 0.45);
  --glass: color-mix(in srgb, #1a0a24 78%, transparent);
  --glass-2: color-mix(in srgb, #120616 90%, transparent);
  --shadow: 0 0 24px rgba(255, 45, 149, 0.25), inset 0 0 0 1px rgba(34, 230, 255, 0.35);
  --focus: #22e6ff;
  --mica-1: color-mix(in srgb, #ff2d95 34%, transparent);
  --mica-2: color-mix(in srgb, #22e6ff 28%, transparent);
  --mica-4: color-mix(in srgb, #d6ff3f 20%, transparent);
}
:root[data-theme="neon"] .skybar a,
:root[data-theme="neon"] .next-labs a {
  box-shadow: 0 0 12px color-mix(in srgb, var(--cc-accent-2) 45%, transparent);
}

:root[data-theme="holographic"] {
  color-scheme: dark;
  --cc-bg: #0a0618;
  --cc-surface: #16102a;
  --cc-accent-1: #7af0ff;
  --cc-accent-2: #c084fc;
  --cc-accent-3: #f0abfc;
  --cc-accent-4: #67e8f9;
  --bg-2: #120c22;
  --bg-3: #24183d;
  --ink: #f5f3ff;
  --muted: #e4dcff;
  --faint: #c4b5fd;
  --teal: #e0f7ff;
  --teal-2: #7af0ff;
  --violet: #e9d5ff;
  --amber: #fbcfe8;
  --rose: #f0abfc;
  --ok: #a7f3d0;
  --line: rgba(122, 240, 255, 0.4);
  --glass: color-mix(in srgb, #1a1230 72%, transparent);
  --glass-2: color-mix(in srgb, #140e28 88%, transparent);
  --shadow: 0 0 28px rgba(192, 132, 252, 0.35), inset 0 0 0 1px rgba(122, 240, 255, 0.35);
  --focus: #7af0ff;
  --mica-1: color-mix(in srgb, #7af0ff 36%, transparent);
  --mica-2: color-mix(in srgb, #c084fc 32%, transparent);
  --mica-4: color-mix(in srgb, #f0abfc 24%, transparent);
}

:root[data-theme="cyberpunk"] {
  color-scheme: dark;
  --cc-bg: #120814;
  --cc-surface: #1c0c18;
  --cc-accent-1: #39ff14;
  --cc-accent-2: #ff2bd6;
  --cc-accent-3: #ffe600;
  --cc-accent-4: #4df0ff;
  --bg-2: #180a16;
  --bg-3: #2a1024;
  --ink: #f4ffe8;
  --muted: #e7ffc4;
  --faint: #c8f5a4;
  --teal: #eaffd2;
  --teal-2: #39ff14;
  --violet: #ff8ae6;
  --amber: #ffe600;
  --rose: #ff7ad9;
  --ok: #b6ff7a;
  --line: rgba(57, 255, 20, 0.45);
  --glass: color-mix(in srgb, #1a0c16 74%, transparent);
  --glass-2: color-mix(in srgb, #140810 90%, transparent);
  --shadow: 0 0 22px rgba(255, 43, 214, 0.35), inset 0 0 0 1px rgba(57, 255, 20, 0.4);
  --focus: #ffe600;
  --mica-1: color-mix(in srgb, #39ff14 30%, transparent);
  --mica-2: color-mix(in srgb, #ff2bd6 28%, transparent);
  --mica-4: color-mix(in srgb, #ffe600 18%, transparent);
}

:root[data-theme="sunset"] {
  color-scheme: dark;
  --cc-bg: #1a0a14;
  --cc-surface: #2a1020;
  --cc-accent-1: #ff6b3d;
  --cc-accent-2: #ff4d8d;
  --cc-accent-3: #ffd166;
  --cc-accent-4: #ff8a5b;
  --bg-2: #220e18;
  --bg-3: #3a1828;
  --ink: #fff6ee;
  --muted: #ffd7c2;
  --faint: #f0b89a;
  --teal: #ffe1c8;
  --teal-2: #ff6b3d;
  --violet: #ffb3c7;
  --amber: #ffd166;
  --rose: #ff8fab;
  --ok: #ffd166;
  --line: rgba(255, 107, 61, 0.45);
  --glass: color-mix(in srgb, #2a1020 74%, transparent);
  --glass-2: color-mix(in srgb, #1a0a14 90%, transparent);
  --shadow: 0 0 26px rgba(255, 77, 141, 0.32), inset 0 0 0 1px rgba(255, 209, 102, 0.35);
  --focus: #ffd166;
  --mica-1: color-mix(in srgb, #ff6b3d 34%, transparent);
  --mica-2: color-mix(in srgb, #ff4d8d 28%, transparent);
  --mica-4: color-mix(in srgb, #ffd166 22%, transparent);
}

:root[data-theme="hc"] body::after { display: none; }

@media (max-width: 980px) {
  .site-foot { margin-bottom: 140px; }
  .reading { position: static; }
}
.primary-nav, .spot-nav, .swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.primary-nav a, .spot, .swatch {
  text-decoration: none;
  color: var(--ink);
  font-weight: 750;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--cc-accent-1) 22%, var(--cc-surface));
}
.primary-nav a[aria-current="page"], .spot[aria-current="page"], .swatch[aria-pressed="true"] {
  outline: 3px solid var(--focus);
  background: color-mix(in srgb, var(--cc-accent-2) 35%, var(--cc-surface));
}
.billboard { display: grid; gap: 8px; margin: 0 0 10px; }
.billboard-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.mascot-row { display: flex; gap: 2px; align-items: flex-end; }
.mascot-row .monkey { width: 46px; height: 52px; }
.hero-flow { width: 100%; height: auto; max-height: 150px; display: block; }
.live-counters { margin: 0; }
.live-counters .stat { padding: 8px 10px; }
.live-counters .stat b { font-size: 22px; }
.parallax { display: flex; flex-wrap: wrap; gap: 8px; perspective: 800px; margin: 8px 0 12px; }
.px {
  display: grid;
  min-width: 76px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  transform: rotateX(12deg) rotateY(-14deg) translateZ(8px);
  transform-style: preserve-3d;
  box-shadow: var(--shadow);
}
.px b { font-family: var(--serif); font-size: 18px; }
.px small { color: var(--muted); }
.signal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.billboard .signal-card .chart-svg { max-height: 88px; width: 100%; }
.signal-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px 12px;
}
.signal-extra { display: grid; gap: 10px; margin-top: 10px; }
#signal-canvas, .d3-host, .rough-host {
  width: 100%;
  max-width: 760px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.d3-host svg, .rough-host { display: block; width: 100%; height: auto; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; margin: 0 0 8px; }
.atlas-card[hidden] { display: none; }
.atlas-card .flowchart { background: #f8fafc; color: #142033; border-radius: 12px; }
.atlas-svg, .hero-flow { overflow: visible; }
.grid.stats.live-counters { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.billboard .signal-card { padding: 6px 8px; }
.billboard .signal-card h3 { font-size: 15px; margin: 0; }
.billboard .signal-card .chart-svg { max-height: 72px; }
.billboard .parallax { margin: 0; }
@media (max-width: 1200px) {
  .hero-flow { max-height: 84px; }
  .spot-nav { flex-wrap: nowrap; overflow-x: auto; }
  .billboard .signal-card .tiny { display: none; }
  .billboard .signal-card .chart-svg { max-height: 56px; }
}
@media (max-width: 800px) {
  .grid.stats.live-counters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .spot-nav { flex-wrap: nowrap; overflow-x: auto; }
  .billboard .signal-card .tiny { display: none; }
}
@media (max-width: 640px) {
  .grid.stats.live-counters { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .grid.stats.live-counters .stat { padding: 4px; }
  .grid.stats.live-counters .stat b { font-size: 15px; }
  .grid.stats.live-counters .stat span { font-size: 10px; line-height: 1.15; }
  .hero-flow { max-height: 72px; }
  .spot-nav { display: none; }
  .billboard-top { flex-wrap: nowrap; overflow-x: auto; align-items: center; }
  .swatches { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .swatch { flex: none; }
  .billboard .signal-card .chart-svg { max-height: 56px; }
  .parallax { flex-wrap: nowrap; overflow-x: auto; margin: 0; }
  .px { min-width: 64px; padding: 4px 6px; }
}

@media (max-width: 640px) {
  .skybar { font-size: 11px; }
  .site-foot { margin: 8px 8px 170px; }
  .monkey { width: 56px; height: 64px; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.lang-pick select, .theme-flip {
  border: 1px solid var(--line);
  background: var(--glass-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 750;
}
.neon-hero {
  position: relative;
  min-height: calc(100svh - var(--header-h, 132px));
  margin: 0 -28px 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 72% 32%, color-mix(in srgb, var(--cc-accent-1) 48%, transparent), transparent 58%),
    radial-gradient(ellipse at 24% 68%, color-mix(in srgb, var(--cc-accent-2) 42%, transparent), transparent 52%),
    var(--cc-bg);
}
.neon-hero canvas, .hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.neon-hero canvas { display: block; }
.hero-fallback { display: grid; place-items: center; padding: 24px; }
.hero-fallback[hidden], .neon-hero canvas[hidden] { display: none; }
.hero-fallback .hero-flow { max-height: none; }
.hero-overlay {
  position: relative;
  z-index: 2;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px 18px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0 78%, color-mix(in srgb, var(--cc-bg) 16%, transparent) 90%, color-mix(in srgb, var(--cc-bg) 70%, transparent));
}
.hero-overlay a, .hero-overlay button, .hero-overlay audio { pointer-events: auto; }
.hero-copy {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
  max-width: 920px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}
.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 0.95;
  max-width: 12ch;
}
.hero-sub { margin: 0; max-width: 42ch; color: var(--ink); }
.hero-stats { margin: 0; }
.hero-stats .stat {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px;
  background: color-mix(in srgb, var(--cc-bg) 42%, transparent);
}
.ring { width: 36px; height: 36px; grid-row: 1 / span 2; }
.ring-bg, .ring-fg { fill: none; stroke-width: 4; }
.ring-bg { stroke: color-mix(in srgb, var(--ink) 25%, transparent); }
.ring-fg { stroke: var(--cc-accent-2); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 22px 22px; }
.hero-stats .stat b { font-size: 22px; min-width: 4.5ch; font-variant-numeric: tabular-nums; }
body[data-home="1"] .shell { grid-template-columns: 1fr; }
body[data-home="1"] .menu-btn { display: inline-grid; }
body[data-home="1"] .nav {
  display: none;
  position: fixed;
  z-index: 12;
  top: var(--header-h, 120px);
  left: 0;
  width: min(420px, 94vw);
  height: calc(100vh - var(--header-h, 120px));
  background: color-mix(in srgb, var(--cc-bg) 96%, transparent);
}
body[data-home="1"] .nav.open { display: block; }
body[data-home="1"] #view-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
body[data-home="1"] main { padding-top: 0; }
.iso-wrap { display: block; perspective: 700px; }
.iso-icon {
  width: 132px;
  height: 124px;
  display: block;
  margin: 0 auto 4px;
  transition: transform 0.35s ease, filter 0.35s ease;
  filter: drop-shadow(0 16px 18px color-mix(in srgb, var(--cc-accent-1) 65%, transparent));
}
.track-tile.holo:hover .iso-icon,
.track-tile.holo:hover .track-gl { transform: rotateX(16deg) rotateY(-22deg) translateY(-8px) scale(1.08); }
.track-head { display: flex; gap: 12px; align-items: center; }
.track-head .iso-icon { width: 108px; height: 100px; }
.holo { position: relative; }
.holo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, var(--cc-accent-1), var(--cc-accent-2), var(--cc-accent-3), var(--cc-accent-4), var(--cc-accent-1));
  background-size: 280% 280%;
  animation: sheen 7s linear infinite;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.track-tile.holo:hover { transform: translateY(-10px); box-shadow: 0 18px 40px color-mix(in srgb, var(--cc-accent-2) 35%, transparent); }
.atlas-card .figure-canvas { min-height: 280px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--cc-accent-2) 18%, var(--bg-3)), var(--bg-3)); border-radius: 12px; }
.atlas-card .figure-canvas svg { width: 100%; height: auto; min-height: 260px; }
.atlas-feature .figure-canvas { min-height: 52vh; }
.atlas-feature .figure-canvas svg { min-height: 48vh; }
.chart-panel svg { width: 100%; height: auto; min-height: 220px; }
.chart-tip {
  position: fixed;
  z-index: 40;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cc-bg) 92%, #000);
  color: var(--ink);
  border: 1px solid var(--cc-accent-2);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 0, 12, 0.72);
}
.lightbox[hidden] { display: none; }
.lb-frame {
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--cc-bg) 92%, #000);
  border: 1px solid var(--cc-accent-2);
  box-shadow: 0 0 40px color-mix(in srgb, var(--cc-accent-1) 45%, transparent);
}
.lb-bar, .lb-controls { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
#lb-stage svg { width: 100%; height: auto; min-height: 320px; }
#lb-stage.paused * { animation-play-state: paused !important; }
.region-grid, .architect { margin: 12px 0; }
.region-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.region-card .flag {
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.12em;
  margin: 0;
  color: var(--cc-accent-2);
}
.architect audio { width: min(100%, 560px); display: block; margin: 8px 0; }
.architect figure { margin: 8px 0; }
.monkey .eye { transform-box: fill-box; transform-origin: center; animation: blink 5.4s infinite; }
.monkey .tail { transform-box: fill-box; transform-origin: 20% 40%; animation: wag 1.7s ease-in-out infinite; }
.monkey .ear { transform-box: fill-box; transform-origin: center; animation: ear 2.2s ease-in-out infinite; }
.monkey .look { display: none; }
.monkey[data-look="1"] .look-1,
.monkey[data-look="2"] .look-2,
.monkey[data-look="3"] .look-3 { display: inline; }
.monkey[data-look="1"] { filter: hue-rotate(48deg) saturate(1.35); }
.monkey[data-look="2"] { filter: hue-rotate(150deg) saturate(1.3); }
.monkey[data-look="3"] { filter: hue-rotate(220deg) saturate(1.25); }
html[data-theme="neon"] .monkey .eye,
html[data-theme="holographic"] .monkey .eye,
html[data-theme="cyberpunk"] .monkey .eye,
html[data-theme="sunset"] .monkey .eye { fill: #f4fdff; }
.theme-pop {
  position: fixed;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(280px, calc(100vw - 16px));
  padding: 10px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--cc-bg) 94%, #000);
  border: 1px solid var(--cc-accent-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.theme-pop[hidden] { display: none; }
.theme-pop .swatch { width: 100%; }
.en-title { margin: -4px 0 12px; }
.spot-nav { margin: 0 0 14px; }
@keyframes wag { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(16deg); } }
@keyframes ear { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18, 0.82); } }
@keyframes blink {
  0%, 42%, 46%, 100% { transform: scaleY(1); }
  44% { transform: scaleY(0.12); }
}
html[dir="rtl"] .top-row, html[dir="rtl"] .primary-nav, html[dir="rtl"] .hero-copy { flex-direction: row-reverse; }
html[dir="rtl"] .hero-copy { text-align: right; }
html[dir="rtl"] body[data-home="1"] .nav { left: auto; right: 0; }
@media (max-width: 980px) {
  .neon-hero { margin: 0 -14px 16px; min-height: calc(100svh - var(--header-h, 160px) - 72px); }
}
@media (max-width: 640px) {
  .primary-nav, .skybar { flex-wrap: nowrap; overflow-x: auto; }
  .primary-nav a, .skybar a { flex: none; }
  .neon-hero .grid.stats.live-counters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-title { font-size: 34px; }
  .iso-icon, .track-gl { width: 104px; height: 98px; }
  .mascot-row .monkey { width: 40px; height: 46px; }
}
html[data-motion="reduce"] .holo::before,
html[data-motion="reduce"] .monkey .eye { animation: none; }
html[data-motion="reduce"] .track-tile.holo:hover,
html[data-motion="reduce"] .track-tile.holo:hover .iso-icon,
html[data-motion="reduce"] .track-tile.holo:hover .track-gl,
html[data-motion="reduce"] .monkey .tail,
html[data-motion="reduce"] .monkey .ear { transform: none; animation: none; }

.page-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
}
.page-ride { width: 100%; height: 72px; display: block; }
.stage-stops, .callouts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stage-stops li, .callouts li { display: flex; gap: 8px; align-items: baseline; }
.stage-stops b, .pin {
  flex: none;
  min-width: 1.6em;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cc-accent-2);
}
.diagram-stage { background: repeating-linear-gradient(0deg, transparent, transparent 11px, color-mix(in srgb, var(--cc-accent-2) 18%, transparent) 12px), repeating-linear-gradient(90deg, transparent, transparent 11px, color-mix(in srgb, var(--cc-accent-2) 18%, transparent) 12px), var(--bg-3); }
.flow-stage { background: linear-gradient(90deg, color-mix(in srgb, var(--cc-bg) 70%, #000), color-mix(in srgb, var(--cc-accent-1) 16%, var(--bg-3))); border-left: 6px solid var(--cc-accent-3); }
.chart-stage { background: color-mix(in srgb, var(--cc-bg) 88%, #000); border-top: 3px solid var(--cc-accent-2); }
.layout-diagrams #atlas-list { display: grid; gap: 14px; }
.blueprint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 12px;
  padding: 12px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--cc-accent-2) 55%, transparent) 0 2px, transparent 2px),
    repeating-linear-gradient(0deg, transparent, transparent 15px, color-mix(in srgb, var(--cc-accent-2) 12%, transparent) 16px),
    var(--bg-3);
  border: 1px dashed color-mix(in srgb, var(--cc-accent-2) 55%, var(--line));
  border-radius: 4px;
}
.blueprint .plate { min-width: 0; }
.blueprint .sheet-notes { align-self: end; }
.layout-flows #atlas-list { display: flex; flex-direction: column; gap: 12px; }
.film {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(200px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 8px 8px 8px 0;
  border-radius: 0 18px 18px 0;
  background: color-mix(in srgb, var(--cc-bg) 80%, #000);
  border: 0;
  border-left: 8px solid var(--cc-accent-3);
  box-shadow: none;
}
.film .figure-canvas { min-height: 180px; background: transparent; }
.layout-charts .chart-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.chart-board { grid-column: 1 / -1; }
.chart-tile, .chart-board {
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--cc-surface) 86%, transparent);
  border: 1px solid var(--line);
}
.chart-tile .chart-plot svg { max-height: 220px; }
.chart-board .chart-plot svg { min-height: 280px; }
@media (max-width: 800px) {
  .page-stage, .blueprint, .film, .layout-charts .chart-bento { grid-template-columns: 1fr; }
  .chart-board { grid-column: auto; }
}
@media (max-width: 640px) {
  .top { padding: 2px 6px; gap: 0; }
  .link-rail {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  .rail-scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 30px;
    overflow-x: auto;
    order: 2;
  }
  .top-row {
    order: 1;
    height: 44px;
    min-height: 0;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
  }
  .rail-scroll .skybar,
  .rail-scroll .primary-nav {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    height: 28px;
    overflow: visible;
    gap: 4px;
    padding: 0;
    align-items: center;
    flex: none;
  }
  .monkey.mini { width: 28px; height: 32px; }
  .brand { min-width: 0; }
  .brand b { font-size: 13px; line-height: 1; }
  .search-btn { flex: 0 0 36px; width: 36px; height: 32px; padding: 0; }
  .search-btn::after { content: "⌕"; font-size: 16px; }
  .icon-btn { width: 32px; height: 32px; }
  .theme-flip, .theme-cycle, .lang-pick select { min-height: 28px; height: 28px; padding: 0 6px; font-size: 11px; }
  .top-meta { gap: 4px; flex-wrap: nowrap; }
  .skybar a, .primary-nav a { padding: 2px 8px; font-size: 11px; }
}

.sheet-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 0;
  background: var(--cc-bg);
}
.sheet-prefs { display: none; gap: 10px; margin: 0 0 12px; }
.menu-themes { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 980px) {
  .sheet-bar { display: flex; }
  .nav a.item, .nav button.item, #nav-close { min-height: 48px; }
}
@media (max-width: 800px) {
  html, body { overflow-x: clip; }
  .menu-label { display: inline; }
  .top {
    height: calc(56px + env(safe-area-inset-top));
    max-height: calc(64px + env(safe-area-inset-top));
    min-height: 0;
    padding: env(safe-area-inset-top) 10px 0;
    gap: 0;
  }
  .link-rail { display: block; width: 100%; }
  .rail-scroll, .top-meta, .search-btn, .brand small { display: none; }
  .top-row {
    display: flex;
    align-items: center;
    height: 56px;
    max-height: 64px;
    min-height: 0;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }
  .menu-btn {
    display: inline-flex;
    flex: none;
    width: auto;
    min-width: 48px;
    min-height: 48px;
    height: 48px;
    padding: 0 12px;
  }
  .brand { min-width: 0; gap: 8px; }
  .brand b { font-size: 16px; }
  .monkey.mini { width: 32px; height: 36px; }
  body[data-home="1"] .nav,
  .nav {
    display: none;
    position: fixed;
    z-index: 40;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    top: var(--header-h, 56px);
    left: 0;
    right: 0;
    bottom: auto;
    height: calc(100dvh - var(--header-h, 56px));
    overflow: auto;
    padding: 8px 16px calc(80px + env(safe-area-inset-bottom));
    background: var(--cc-bg);
    border: 0;
  }
  body.menu-open .guide { visibility: hidden; }
  body[data-home="1"] .nav.open,
  .nav.open { display: block; }
  body[data-home="1"] .menu-btn {
    display: inline-flex;
    width: auto;
    min-width: 48px;
    min-height: 48px;
  }
  .sheet-prefs { display: grid; }
  .sheet-prefs select, .menu-themes .swatch, #nav-search {
    min-height: 48px;
    width: auto;
  }
  .menu-themes .swatch { flex: 1 1 42%; }
  body.menu-open { overflow: hidden; }
  .neon-hero { margin: 0 0 16px; }
  .dock { display: none; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--cc-surface) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(1.4);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    min-width: 44px;
    font-size: 11px;
    border-radius: 12px;
  }
  .bottom-nav svg { width: 20px; height: 20px; }
  .bottom-nav a[aria-current="page"], .bottom-nav button[aria-current="page"] {
    color: var(--ink);
    background: color-mix(in srgb, var(--cc-accent-2) 22%, transparent);
    box-shadow: inset 0 3px 0 var(--cc-accent-2);
  }
  .holo::before { animation: none; }
  main { padding: 12px 14px 20px; }
  .site-foot { margin-bottom: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
html[data-motion="reduce"] .reveal,
html[data-motion="reduce"] .reveal.is-in { opacity: 1; transform: none; }

#view { min-height: calc(100dvh - var(--header-h, 148px)); }
.menu-search { display: block; margin: 0 0 12px; }
.menu-search input, #menu-q {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--cc-bg);
}
.brand-row { gap: 8px; }
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 750;
  background: color-mix(in srgb, var(--cc-surface) 82%, transparent);
}
.brand-link:hover { border-color: var(--cc-accent-2); color: var(--ink); }
.brand-mark { width: 18px; height: 18px; flex: none; }
.foot-brands { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.copy { font-weight: 750; }
.guide {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 34;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
  max-width: min(380px, calc(100vw - 24px));
}
.guide-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  min-width: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--cc-accent-1) 28%, var(--cc-surface));
  color: var(--ink);
  font-weight: 750;
  box-shadow: var(--shadow);
}
.guide-launch svg { width: 22px; height: 22px; }
.guide-panel {
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--cc-bg) 94%, transparent);
  box-shadow: var(--shadow);
}
.guide-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.guide-bar .ghost { min-height: 44px; }
.guide-log {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  padding-right: 2px;
}
.guide-bubble {
  margin: 0;
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  line-height: 1.4;
}
.guide-bubble.bot {
  align-self: flex-start;
  background: color-mix(in srgb, var(--cc-accent-2) 12%, var(--cc-surface));
  border-bottom-left-radius: 4px;
}
.guide-bubble.you {
  align-self: flex-end;
  background: color-mix(in srgb, var(--cc-accent-1) 18%, var(--cc-surface));
  border-bottom-right-radius: 4px;
}
.guide-jump { margin: 0; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-chip {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cc-surface);
  color: var(--ink);
  text-align: left;
}
.guide-form { display: flex; gap: 8px; }
.guide-form input { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 12px; background: var(--cc-bg); }
.guide-form .primary { min-height: 44px; }
@media (max-width: 800px) {
  .guide { right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .guide-bubble.typing { animation: none; }
}
