@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0a0d12;
  --panel: rgba(15, 20, 28, 0.74);
  --panel-solid: #10151d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eef5;
  --muted: #94a3b6;
  --faint: #6b7889;
  --accent: #35c8ff;
  --accent-ink: #04202c;
  --warm: #ff8a3c;
  --ok: #7bd88f;
  --radius: 14px;
  --rail-w: 252px;
  --info-w: 372px;
  --top-h: 56px;
  --gap: 14px;
  --sys: var(--accent);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.m-only { display: none !important; }
.phone-text { display: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(53, 200, 255, 0.35); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: -0.01em; }

#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; }
#gl { width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; transition: opacity 0.18s; }
#labels.flying { opacity: 0; }
#labels.flying .lbl { pointer-events: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4); }

/* ---------------------------------------------------------------- top bar */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: var(--top-h); display: flex; align-items: center; gap: 20px; padding: 0 18px; background: linear-gradient(to bottom, rgba(8, 11, 16, 0.88), rgba(8, 11, 16, 0)); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 700; letter-spacing: 0.06em; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 2px; margin-left: auto; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--text); color: #0b0f15; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.ghost-btn { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ghost-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------------------------------------------------------------- systems rail */
.rail { position: absolute; left: var(--gap); top: calc(var(--top-h) + 6px); width: var(--rail-w); max-height: calc(100% - var(--top-h) - 6px - var(--gap)); overflow-y: auto; padding: 8px; z-index: 20; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.rail-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 4px; }
.sys { display: grid; grid-template-columns: 10px 1fr; column-gap: 11px; align-items: center; text-align: left; width: 100%; padding: 8px 10px; background: transparent; border: 1px solid transparent; border-radius: 10px; }
.sys:hover { background: rgba(255, 255, 255, 0.05); }
.sys.on { background: rgba(255, 255, 255, 0.08); border-color: var(--line-strong); }
.sys i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); grid-row: span 2; }
.sys b { font-weight: 600; font-size: 14px; line-height: 1.25; }
.sys small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }

/* ---------------------------------------------------------------- info panel */
.info { position: absolute; right: var(--gap); top: calc(var(--top-h) + 6px); width: var(--info-w); max-height: calc(100% - var(--top-h) - 6px - var(--gap)); overflow-y: auto; z-index: 20; padding: 18px 18px 20px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.info .eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sys); margin-bottom: 6px; }
.info .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sys); }
.info h1 { font-size: 23px; line-height: 1.2; letter-spacing: -0.01em; }
.info .tagline { font-size: 15.5px; color: var(--text); margin-top: 8px; font-weight: 500; line-height: 1.45; }
.info p.body { color: #c4cedb; margin-top: 12px; font-size: 14.5px; }
.info h3 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 20px 0 8px; font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.stat { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.stat b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); line-height: 1.3; display: block; }
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 9px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14px; color: #c4cedb; }
ol.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--sys); border: 1px solid color-mix(in srgb, var(--sys) 55%, transparent); margin-top: 1px; }
ol.steps b { color: var(--text); font-weight: 600; }
.keyparts { display: grid; gap: 4px; }
.kp { width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 7px 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline; }
.kp:hover { background: rgba(255, 255, 255, 0.05); }
.kp.on { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.kp b { font-size: 14px; font-weight: 600; }
.kp em { font-style: normal; font-size: 12px; color: var(--faint); }
.kp span { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: none; }
.kp.on span { display: block; }
.try { margin-top: 18px; padding: 10px 12px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--sys) 50%, transparent); font-size: 13.5px; color: #c4cedb; }
.try b { color: var(--sys); font-weight: 600; }
.dl-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13.5px; font-weight: 500; }
.term { border-bottom: 1px dotted var(--accent); cursor: help; color: inherit; }

/* part card */
.partcard { margin: -4px -4px 16px; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); position: relative; }
.partcard .x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 16px; }
.partcard .x:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.partcard h2 { font-size: 16.5px; line-height: 1.25; padding-right: 26px; }
.partcard .pn { color: var(--accent); margin-top: 3px; display: block; word-break: break-all; }
.partcard p { font-size: 13.5px; color: #c4cedb; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.chip.warn { color: var(--warm); border-color: color-mix(in srgb, var(--warm) 50%, transparent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin-top: 10px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05); border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 550; color: var(--text); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: 0.4; cursor: default; }

/* ---------------------------------------------------------------- toolbar */
.toolbar { position: absolute; left: calc(var(--rail-w) + 2 * var(--gap)); right: calc(var(--info-w) + 2 * var(--gap)); margin-inline: auto; width: fit-content; bottom: var(--gap); display: flex; align-items: center; gap: 6px; padding: 8px 10px; z-index: 20; flex-wrap: wrap; justify-content: center; }
.tool { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.tool-sep { width: 1px; height: 22px; background: var(--line); }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tool-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tool-btn[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.section-tools { display: flex; align-items: center; gap: 10px; }
.section-tools input[type="range"] { width: 84px; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: rgba(255, 255, 255, 0.14); color: var(--text); }
.seg.big button { padding: 7px 16px; font-size: 14px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 110px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); outline-offset: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; cursor: grab; }

.phasebar { position: absolute; left: calc(var(--rail-w) + 2 * var(--gap)); right: calc(var(--info-w) + 2 * var(--gap)); margin-inline: auto; width: fit-content; top: calc(var(--top-h) + 8px); z-index: 19; display: flex; align-items: center; gap: 12px; padding: 7px 14px; }
.phase-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
#phases { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
#phases li { font-size: 12.5px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--faint); transition: all 0.25s; white-space: nowrap; }
#phases li.on { color: #1a0d02; background: var(--warm); border-color: var(--warm); font-weight: 600; }

/* ---------------------------------------------------------------- labels + tooltips */
.lbl { position: absolute; left: 0; top: 0; pointer-events: none; display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 7px; border-radius: 999px; background: rgba(10, 14, 20, 0.72); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 550; color: var(--text); white-space: nowrap; cursor: pointer; backdrop-filter: blur(8px); will-change: transform; transition: opacity 0.18s, border-color 0.2s; }
.lbl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sys); box-shadow: 0 0 8px var(--sys); }
.lbl.hot, .lbl.on { border-color: var(--accent); }
.lbl.off { opacity: 0; pointer-events: none; }
.tip { position: fixed; z-index: 60; pointer-events: none; padding: 6px 10px; border-radius: 9px; background: rgba(8, 11, 16, 0.92); border: 1px solid var(--line-strong); font-size: 12.5px; max-width: 300px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.tip b { display: block; font-weight: 600; }
.tip span { color: var(--muted); }
.gloss { position: fixed; z-index: 70; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: #f3f6fa; color: #101720; font-size: 13px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.gloss b { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #46627a; margin-bottom: 2px; }

/* ---------------------------------------------------------------- tour */
.tourcard { position: absolute; left: 0; right: 0; margin-inline: auto; bottom: var(--gap); width: min(720px, calc(100% - 2 * var(--gap))); padding: 18px 22px 16px; z-index: 25; }
.tour-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tour-count { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.tourcard h2 { font-size: 21px; line-height: 1.25; letter-spacing: -0.01em; }
.tourcard p { margin-top: 8px; color: #cbd5e1; font-size: 15.5px; line-height: 1.55; }
.tourcard .tour-note { font-size: 13px; color: var(--muted); }
.tour-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.dots { list-style: none; display: flex; gap: 7px; margin: 0; padding: 0; }
.dots li { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); cursor: pointer; }
.dots li.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(53, 200, 255, 0.2); }
#app[data-view="tour"] .rail, #app[data-view="tour"] .info, #app[data-view="tour"] .toolbar { display: none; }
#app[data-view="tour"] .phasebar { left: 0; right: 0; }

/* ---------------------------------------------------------------- sheets (BOM, downloads) */
.sheet { position: absolute; inset: 0; z-index: 28; overflow-y: auto; background: rgba(8, 11, 16, 0.9); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); padding: calc(var(--top-h) + 18px) 28px 60px; }
.sheet-inner { max-width: 1280px; margin: 0 auto; }
.sheet-head h1 { font-size: 30px; letter-spacing: -0.02em; }
.sheet-head p { color: var(--muted); max-width: 70ch; margin-top: 6px; }
#app[data-view="bom"] .rail, #app[data-view="bom"] .info, #app[data-view="bom"] .toolbar, #app[data-view="bom"] .phasebar, #app[data-view="bom"] #labels,
#app[data-view="downloads"] .rail, #app[data-view="downloads"] .info, #app[data-view="downloads"] .toolbar, #app[data-view="downloads"] .phasebar, #app[data-view="downloads"] #labels { display: none; }
/* The sheet's top padding ends 18 px under the top bar, and sticky offsets count from that edge: -18 px holds the row right under the bar. */
.bom-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 10px 0 4px; padding: 10px 0; border-bottom: 1px solid transparent; position: sticky; top: -18px; z-index: 3; }
/* Held: solid across the whole width and up behind the top bar (the shadow fills, the clip trims it to that strip). */
.bom-controls.stuck { background: #080b10; border-bottom-color: var(--line-strong); box-shadow: 0 0 0 100vmax #080b10; clip-path: inset(calc(-1 * var(--top-h)) -100vmax 0 -100vmax); }
input[type="search"], select { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 12px; min-width: 0; }
input[type="search"] { flex: 1 1 260px; max-width: 420px; }
select option { background: #10151d; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: rgba(255, 255, 255, 0.02); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; background: #0d1219; position: sticky; top: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th[aria-sort="ascending"]::after { content: " ▲"; color: var(--accent); }
th[aria-sort="descending"]::after { content: " ▼"; color: var(--accent); }
td { padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: top; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
tbody tr.detail td { background: rgba(255, 255, 255, 0.025); color: #c4cedb; font-size: 13px; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
td.pn { white-space: nowrap; color: var(--accent); }
td.desc { min-width: 300px; max-width: 520px; }
td.links { white-space: nowrap; }
td.links a, td.links button { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; font-size: 12.5px; padding: 2px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
td.links a:hover, td.links button:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; border-color: var(--accent); }
.quote { color: var(--faint); font-style: italic; }
.detail-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.detail-grid dt { color: var(--faint); }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.detail-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.detail-wrap:not(:has(.thumb)) { grid-template-columns: 1fr; }
.thumb { width: 240px; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: radial-gradient(120% 100% at 50% 20%, #26303d 0%, #121821 70%); }
.lockbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--warm) 45%, transparent); background: color-mix(in srgb, var(--warm) 8%, transparent); font-size: 14px; }
.lockbar.open { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.lockbar span { flex: 1 1 260px; }
html.dl-locked [data-dl]::after { content: "\1F512"; font-size: 0.85em; margin-left: 6px; }
html.dl-locked .tabs a[data-tab="downloads"]::after { content: "\1F512"; font-size: 0.8em; margin-left: 6px; }
#unlock-form { width: min(420px, 100%); display: grid; gap: 12px; }
#unlock-form h2 { margin: 0; }
input[type="password"] { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 12px; font-size: 16px; }
.unlock-err { color: #ff8f7a; font-size: 13.5px; }
.toast { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 90; padding: 9px 16px; border-radius: 999px; background: #f3f6fa; color: #101720; font-size: 13.5px; font-weight: 550; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 22px; }
.card { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 8px; }
.card h3 { font-size: 16.5px; }
.card p { color: var(--muted); font-size: 13.5px; flex: 1; }
.card .meta { font-size: 12px; color: var(--faint); }
.card.off { opacity: 0.55; }
h2.sub { font-size: 19px; margin-top: 34px; }
.dl-systems { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-top: 12px; }
.dl-systems a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); font-size: 13.5px; }
.dl-systems a:hover { border-color: var(--accent); text-decoration: none; }
.dl-systems a span { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
#dl-note { margin-top: 26px; max-width: 80ch; }

/* ---------------------------------------------------------------- intro, loader, help */
.intro { pointer-events: none; position: absolute; inset: 0; z-index: 40; display: grid; align-items: end; justify-items: start; padding: clamp(20px, 6vw, 80px); background: radial-gradient(120% 90% at 0% 100%, rgba(6, 8, 12, 0.92) 0%, rgba(6, 8, 12, 0.55) 45%, rgba(6, 8, 12, 0) 75%); transition: opacity 0.6s; }
.intro-card { max-width: 560px; pointer-events: auto; }
.intro .eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.intro h1 { font-size: clamp(48px, 8vw, 96px); line-height: 0.98; letter-spacing: -0.03em; font-weight: 750; margin-top: 10px; }
.intro .lede { font-size: clamp(16px, 1.6vw, 19px); color: #cbd5e1; margin-top: 16px; line-height: 1.5; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.intro-hint { color: var(--muted); font-size: 13.5px; margin-top: 14px; }
#app.is-intro .rail, #app.is-intro .info, #app.is-intro .toolbar, #app.is-intro .tabs, #app.is-intro .top-actions, #app.is-intro .phasebar, #app.is-intro #labels { opacity: 0; pointer-events: none; }
#app:not(.is-intro) .intro { opacity: 0; }
#app:not(.is-intro) .intro-card { pointer-events: none; }
.rail, .info, .toolbar, .tabs, .top-actions { transition: opacity 0.5s; }
.loader { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity 0.7s; }
#app:not(.is-loading) .loader { opacity: 0; pointer-events: none; }
.loader-card { display: grid; justify-items: center; gap: 14px; color: var(--muted); }
.loader-text { font-size: 14px; letter-spacing: 0.04em; }
.bar { width: 220px; height: 3px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width 0.2s; }
.modal { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(4, 6, 9, 0.6); padding: 20px; }
.modal-card { padding: 24px; max-width: 480px; background: var(--panel-solid); }
.modal-card h2 { font-size: 20px; margin-bottom: 12px; }
.help-list { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 8px; color: #c4cedb; font-size: 14px; }
.help-list b { color: var(--text); display: inline-block; min-width: 118px; }
.error { position: absolute; inset: 0; z-index: 90; display: grid; place-items: center; padding: 30px; text-align: center; background: var(--bg); color: var(--muted); }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1180px) {
  :root { --rail-w: 214px; --info-w: 330px; }
  .brand-sub { display: none; }
}
@media (max-width: 900px) {
  /* Phone and small tablet: the model fills the screen. Systems are a strip of chips at the bottom, one caption line says
     what is selected, tools are an icon rail on the right, and the full description opens as a sheet only when asked for. */
  :root { --gap: 8px; }
  .m-only { display: inline-flex !important; }
  .desk-only, .dl { display: none !important; }
  .topbar { gap: 8px; padding: 0 10px; }
  .tabs { margin-left: 0; overflow-x: auto; flex: 1; scrollbar-width: none; }
  .tabs a { padding: 6px 12px; font-size: 13px; flex: 1; text-align: center; }
  .top-actions, .brand-name, .brand-sub { display: none; }

  .rail { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: none; flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; border-radius: 0; border-width: 1px 0 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); scrollbar-width: none; }
  .rail::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .rail-title, .sys small { display: none; }
  .sys { width: auto; flex: 0 0 auto; grid-template-columns: 8px auto; column-gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; }
  .sys i { grid-row: auto; width: 8px; height: 8px; box-shadow: none; }
  .sys b { font-size: 13.5px; white-space: nowrap; }

  .caption { display: grid !important; grid-template-columns: 1fr auto; gap: 1px 12px; align-items: center; text-align: left; position: absolute; left: 8px; right: 8px; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 21; padding: 10px 14px; color: var(--text); }
  .caption { touch-action: none; transition: transform 0.25s ease, opacity 0.25s ease; }
  .caption.dragging { transition: none; }
  .caption.gone { transform: translateY(160%); opacity: 0; pointer-events: none; }
  .caption b { font-size: 15px; font-weight: 650; line-height: 1.25; display: flex; align-items: center; gap: 8px; }
  .caption b::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--sys); }
  .caption span { grid-column: 1; font-size: 13px; line-height: 1.35; color: #b9c4d2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .caption em { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent); padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; }

  .info { display: none; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 78%; border-radius: 18px 18px 0 0; padding: 14px 16px calc(22px + env(safe-area-inset-bottom)); z-index: 34; }
  #app.sheet-open .info { display: block; }
  #app.sheet-open .caption, #app.sheet-open .toolbar, #app.sheet-open #labels, #app.sheet-open .section-tools { display: none !important; }
  .sheet-close { position: sticky; top: 0; float: right; z-index: 2; width: 34px; height: 34px; margin: -2px -4px 0 8px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--text); font-size: 18px; align-items: center; justify-content: center; }

  .toolbar { left: auto; right: 8px; top: calc(var(--top-h) + 8px); bottom: auto; margin: 0; width: auto; flex-direction: column; flex-wrap: nowrap; gap: 3px; padding: 5px; border-radius: 14px; background: rgba(13, 18, 25, 0.82); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .toolbar .t, .toolbar .tool-sep, .toolbar .slider-tool, #ctx-seg { display: none; }
  .tool-btn { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 10px; }
  .tool-btn svg { width: 20px; height: 20px; }
  .tool-btn[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
  .section-tools { position: fixed; left: 8px; right: 8px; bottom: calc(138px + env(safe-area-inset-bottom)); z-index: 22; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(13, 18, 25, 0.9); }
  .section-tools input[type="range"] { flex: 1; width: auto; }

  .phasebar { left: 0; right: 0; top: calc(var(--top-h) + 6px); padding: 5px 8px; gap: 6px; }
  .phase-title { display: none; }
  #phases { gap: 4px; }
  #phases li { font-size: 11.5px; padding: 2px 8px; }
  .lbl { font-size: 11.5px; padding: 3px 9px 3px 7px; }
  #app[data-view="tour"] .caption, #app[data-view="bom"] .caption, #app[data-view="downloads"] .caption, #app.is-intro .caption { display: none !important; }
  .sheet { padding: calc(var(--top-h) + 10px) 12px 40px; }
  .sheet-head h1 { font-size: 24px; }
  td.desc { min-width: 220px; }
  .tourcard { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); bottom: 0; width: 100%; border-radius: 18px 18px 0 0; }
  .tourcard h2 { font-size: 18px; }
  .tourcard p { font-size: 14.5px; line-height: 1.45; }
  /* home screen: the model owns the upper part of the screen, the title block sits in its own band underneath */
  .phone-text { display: inline; }
  .intro { padding: 0; background: none; justify-items: stretch; }
  .intro-card { max-width: none; padding: 34px 20px calc(20px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(6, 8, 12, 0.98) 0%, rgba(6, 8, 12, 0.94) 78%, rgba(6, 8, 12, 0) 100%); }
  .intro .eyebrow { font-size: 11px; }
  .intro h1 { font-size: clamp(38px, 12vw, 52px); margin-top: 6px; }
  .intro .lede { font-size: 15.5px; margin-top: 8px; line-height: 1.45; }
  .intro-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  .intro-actions .btn.big { padding: 12px 8px; font-size: 14.5px; justify-content: center; white-space: normal; text-align: center; }
  .intro-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
