/* Amaete Kits: the kit page. Warm workshop paper, ink, one signal-orange accent. System fonts only. */
:root {
  --bg: #f3eee4; --surface: #fffdf8; --surface2: #f8f4ec; --ink: #17181b; --muted: #6b6963; --line: #e3dccd; --line2: #d6cdbb;
  --accent: #ff5a1f; --accent-ink: #fff; --accent-soft: #ffe6da; --blue: #1e6bff; --ok: #1f9d6b; --warn: #c2410c;
  --mat: #34404c; --shadow: 0 1px 0 rgba(23,24,27,.04), 0 8px 24px -12px rgba(23,24,27,.18);
  --r: 18px; --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1012; --surface: #17191c; --surface2: #1d2024; --ink: #f2efe8; --muted: #a09d95; --line: #2a2d32; --line2: #363a40;
  --accent-soft: #3a1e12; --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 30px -14px rgba(0,0,0,.6); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* loader */
.loader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--bg); transition: opacity .4s, visibility 0s linear .4s; }
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__box { display: flex; flex-direction: column; align-items: center; width: min(320px, 76vw); }
.loader__mark { width: 64px; height: 64px; }
.loader__wheel { transform-origin: 24px 24px; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader__name { margin-top: 14px; font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.loader__name b { color: var(--accent); }
.loader__bar { width: 100%; height: 6px; border-radius: 6px; background: var(--line); margin-top: 20px; overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 4%; background: var(--accent); border-radius: inherit; transition: width .3s; }
.loader__text { margin-top: 10px; color: var(--muted); font-size: 14px; }

/* app shell */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr; padding: 12px 14px 14px; gap: 12px; }
.top { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand__name { font-weight: 800; font-size: 20px; letter-spacing: -.02em; white-space: nowrap; }
.brand__name b { color: var(--accent); font-weight: 800; }
.kitname { display: flex; flex-direction: column; padding-left: 12px; border-left: 1px solid var(--line2); line-height: 1.2; min-width: 0; }
.kitname strong { font-size: 15px; font-weight: 750; }
.kitname span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__sp { flex: 1; }
.chipgroup { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.chipgroup__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 6px 0 8px; }
.chip { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.chip[aria-pressed="true"] .dot { background: var(--accent); }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; flex: none; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:hover, .chip:hover { filter: brightness(.97); }
.langbtn { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; font-weight: 700; font-size: 13.5px; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 12px; min-height: 0; }
.left { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; min-height: 0; }
.stage { position: relative; border-radius: var(--r); overflow: hidden; background: var(--surface2); border: 1px solid var(--line); min-height: 0; box-shadow: var(--shadow); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.stage__title { position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); z-index: 3; }
.stage__title i { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-style: normal; }
.stage__title i svg { width: 18px; height: 18px; }
.stage__title strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; }
.stage__title span { font-size: 12.5px; color: var(--muted); }
.tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.tools .iconbtn { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); }
.tools .iconbtn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* part labels on the 3D view */
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); padding: 3px 9px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line2); font-size: 12px; font-weight: 650; white-space: nowrap; box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); transition: opacity .2s; }
.tag::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 7px; height: 7px; margin-left: -4px; background: inherit; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); transform: rotate(45deg); }
.tag.hot { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag.hot::after { border-color: var(--accent); }
.tag.hide { opacity: 0; }
.card { position: absolute; z-index: 5; width: 260px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13.5px; pointer-events: auto; }
.card h4 { margin: 0 0 4px; font-size: 15px; }
.card p { margin: 0; color: var(--muted); }
.card button { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 18px; color: var(--muted); }

/* step strip */
.strip { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.strip__row { display: flex; gap: 8px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; flex: 1; padding: 2px; scroll-snap-type: x proximity; }
.strip__row::-webkit-scrollbar { display: none; }
.strip__arrow { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.strip__arrow:disabled { opacity: .25; }
.step { flex: none; width: 150px; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface2); text-align: left; scroll-snap-align: start; }
.step img, .step .thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--line); flex: none; }
.step b { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 800; }
.step span { display: block; font-size: 13.5px; font-weight: 700; margin-top: 3px; line-height: 1.15; }
.step.on { border-color: var(--accent); background: var(--accent-soft); }
.step.on b { background: var(--accent); color: #fff; }
.step.done b::after { content: " ✓"; }

/* right panel */
.panel { display: grid; grid-template-rows: minmax(0, 1fr) auto; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 0; overflow: hidden; }
.panel__body { overflow-y: auto; padding: 20px 22px 24px; overscroll-behavior: contain; }
.phead { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.phead__num { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 850; font-size: 22px; flex: none; }
.phead__kicker { font-size: 11.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.phead h1 { margin: 2px 0 0; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; font-weight: 850; }
.ptext { margin: 0 0 16px; font-size: 15.5px; line-height: 1.6; }
.sec { margin: 18px 0 10px; display: flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec em { font-style: normal; padding: 2px 8px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--line); letter-spacing: 0; font-weight: 800; color: var(--ink); }
.need { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.need li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); font-size: 14px; line-height: 1.35; }
.need label { display: contents; cursor: pointer; }
.need input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.need b { min-width: 34px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 12.5px; flex: none; }
.need li.ticked { opacity: .55; }
.need li.ticked span { text-decoration: line-through; }
.tip { margin-top: 14px; display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.tip::before { content: "!"; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.wtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wtable td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.wtable td:first-child { font-weight: 700; white-space: nowrap; }
.wtable td:nth-child(2) { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; color: var(--accent); font-weight: 700; }
.wtable td:last-child { color: var(--muted); }
.pnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.btn { border: 1px solid var(--line2); background: var(--surface); padding: 11px 18px; border-radius: 12px; font-weight: 750; font-size: 14.5px; }
.btn:disabled { opacity: .4; }
.btn--go { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 6px 16px -8px var(--accent); }
.keys { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--line2); background: var(--surface2); font: 700 11px var(--mono); color: var(--ink); }

/* code */
.codebox { border-radius: 12px; background: #121418; color: #e8e6e1; font: 12.5px/1.6 var(--mono); overflow: auto; max-height: 52vh; padding: 10px 0; }
.codebox div { padding: 0 12px 0 0; white-space: pre; display: flex; }
.codebox div i { font-style: normal; color: #5b616b; width: 36px; text-align: right; padding-right: 12px; flex: none; user-select: none; }
.codebox div.hl { background: rgba(255,90,31,.22); box-shadow: inset 3px 0 0 var(--accent); }
.codebox .c { color: #7f8792; } .codebox .k { color: #ff9b6b; } .codebox .n { color: #7cc4ff; } .codebox .s { color: #a5d6a7; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); margin-bottom: 10px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-weight: 700; font-size: 13.5px; }
.tabs button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* flow chart (on the stage) */
.flow { position: absolute; right: 12px; bottom: 12px; z-index: 3; width: 330px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); padding: 10px 12px 12px; transition: width .3s, height .3s; }
.flow.big { left: 12px; top: 84px; width: auto; bottom: 12px; right: 70px; }
.flow__head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.flow__head span { flex: 1; }
.flow__head .live { color: var(--ok); }
.flow svg { width: 100%; height: auto; display: block; }
.flow.big svg { height: calc(100% - 60px); }
.flow .box rect { fill: var(--surface2); stroke: var(--line2); stroke-width: 1.5; transition: fill .15s; }
.flow .box.ask rect { fill: var(--surface); stroke-dasharray: 4 3; }
.flow .box text { fill: var(--ink); font: 650 11px var(--font); }
.flow .box.on rect { fill: var(--accent); stroke: var(--accent); }
.flow .box.on text { fill: #fff; }
.flow .box.pick rect { stroke: var(--accent); stroke-width: 2.5; }
.flow .box { cursor: pointer; }
.flow path { fill: none; stroke: var(--line2); stroke-width: 1.6; }
.flow .lnk text { fill: var(--muted); font: 700 10px var(--font); }
.flow.min { width: auto; left: auto; padding: 6px 8px 6px 12px; } .flow.min svg, .flow.min .seg, .flow.min .flow__note { display: none; } .flow.min .flow__head { margin: 0; }
.flow__note { font-size: 12.5px; color: var(--muted); margin-top: 6px; min-height: 18px; }

/* drive: readouts, minimap, controls */
.readouts { position: absolute; left: 14px; top: 76px; display: flex; gap: 8px; z-index: 3; flex-wrap: wrap; max-width: calc(100% - 90px); }
.ro { padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); min-width: 82px; }
.ro small { display: block; font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ro strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ro strong em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 2px; }
.eyes { display: flex; gap: 5px; margin-top: 6px; }
.eyes i { width: 14px; height: 14px; border-radius: 50%; background: var(--line2); }
.eyes i.on { background: var(--ink); box-shadow: 0 0 0 2px var(--accent); }
.minimap { position: absolute; left: 12px; bottom: 12px; z-index: 3; padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); }
.minimap canvas { position: static; width: 150px; height: 150px; display: block; border-radius: 10px; touch-action: none; cursor: grab; }
.minimap div { display: flex; justify-content: center; align-items: center; font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 9px 4px; border-radius: 9px; font-weight: 750; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.drivegrid { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.pad { display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 46px); gap: 5px; }
.pad button { border: 0; border-radius: 12px; background: var(--ink); color: var(--bg); display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.pad button.diag { background: var(--surface2); color: var(--ink); border: 1px solid var(--line2); }
.pad button.mid { background: var(--accent); color: #fff; border-radius: 50%; }
.pad button.held { transform: scale(.94); filter: brightness(1.2); }
.pad svg { width: 20px; height: 20px; }
.spins { display: flex; gap: 6px; margin-top: 6px; }
.spins button { flex: 1; height: 40px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface2); font-weight: 750; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; touch-action: none; user-select: none; -webkit-user-select: none; }
.spins button.held { background: var(--ink); color: var(--bg); }
.slider { display: grid; gap: 4px; }
.slider label { display: flex; justify-content: space-between; font-weight: 700; font-size: 13.5px; }
.slider label b { font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.toggles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.tog { border: 1px solid var(--line); background: var(--surface2); border-radius: 12px; padding: 10px; font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; justify-content: center; }
.tog i { width: 10px; height: 10px; border-radius: 50%; background: var(--line2); }
.tog[aria-pressed="true"] { border-color: var(--accent); }
.tog[aria-pressed="true"] i { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.serial { border-radius: 12px; background: #121418; color: #cfe8d4; font: 12px/1.55 var(--mono); height: 150px; overflow-y: auto; padding: 8px 10px; }
.serial span { color: #6b7380; margin-right: 8px; }
.hint { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.lineput { width: 100%; margin-top: 8px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(15,16,18,.45); backdrop-filter: blur(3px); padding: 16px; }
.modal[hidden] { display: none; }
.modal__box { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 22px; border: 1px solid var(--line); padding: 22px 24px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal__head h2 { margin: 0; font-size: 22px; font-weight: 850; letter-spacing: -.01em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 30px; border: 0; background: var(--line2); flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch[aria-pressed="true"] { background: var(--ok); }
.switch[aria-pressed="true"]::after { transform: translateX(20px); }
.realcar { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); font-size: 14px; }
.realcar ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.realcar code { font: 700 13px var(--mono); background: var(--surface); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.lang { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface2); text-align: left; }
.lang b { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line2); background: var(--surface); display: grid; place-items: center; font-size: 13px; flex: none; }
.lang strong { display: block; font-size: 14.5px; }
.lang span { font-size: 12px; color: var(--muted); }
.lang.on { border-color: var(--ink); }
.lang.on b { background: var(--ink); color: var(--bg); }
.lang[disabled] { opacity: .5; cursor: default; }
.soon { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }

/* laptops: slimmer panel */
@media (max-width: 1240px) { .main { grid-template-columns: minmax(0, 1fr) 370px; } .chipgroup__label { display: none; } }
@media (max-width: 1020px) { .kitname span { display: none; } }

/* phones and small tablets, portrait: stage on top, strip, then the panel */
@media (max-width: 760px) {
  .app { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .top { min-height: 40px; gap: 8px; }
  .brand svg { width: 32px; height: 32px; }
  .brand__name { font-size: 17px; }
  .kitname { display: none; }
  .chipgroup { display: none; }
  .iconbtn { width: 38px; height: 38px; }
  .main { grid-template-columns: 1fr; grid-template-rows: 44vh auto minmax(0, 1fr); gap: 8px; }
  .left { display: contents; }
  .stage { grid-row: 1; }
  .strip { grid-row: 2; padding: 6px; }
  .strip__arrow { display: none; }
  .step { width: auto; padding: 4px 10px 4px 4px; }
  .step img, .step .thumb { width: 44px; height: 34px; }
  .step span { font-size: 12.5px; white-space: nowrap; }
  .panel { grid-row: 3; }
  .panel__body { padding: 14px 16px 18px; }
  .phead { margin-bottom: 8px; justify-content: center; text-align: center; flex-direction: column; gap: 6px; }
  .phead__num { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
  .phead h1 { font-size: 22px; }
  .ptext { font-size: 15px; }
  .stage__title { left: 8px; top: 8px; padding: 6px 10px 6px 6px; }
  .stage__title i { width: 26px; height: 26px; }
  .stage__title strong { font-size: 13px; }
  .stage__title span { font-size: 11.5px; }
  .tools { right: 8px; top: 8px; gap: 6px; }
  .tools .iconbtn { width: 36px; height: 36px; }
  .readouts { top: 52px; left: 8px; gap: 4px; flex-wrap: nowrap; max-width: calc(100% - 60px); }
  .ro { padding: 4px 7px; min-width: 0; }
  .ro small { font-size: 9px; letter-spacing: .04em; }
  .ro strong { font-size: 14px; } .ro strong em { font-size: 10px; } .eyes { margin-top: 3px; gap: 3px; } .eyes i { width: 10px; height: 10px; }
  .minimap { left: 8px; bottom: 8px; padding: 5px; }
  .minimap canvas { width: 92px; height: 92px; }
  .minimap div { display: none; }
  .flow { width: 200px; right: 8px; bottom: 8px; padding: 6px 8px 8px; }
  .flow.big { left: 8px; right: 8px; top: 52px; width: auto; }
  .flow__note { display: none; }
  .keys { display: none; }
  .drivegrid { grid-template-columns: auto 1fr; gap: 12px; }
  .pad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 50px); }
  .card { left: 8px !important; right: 8px; width: auto; bottom: 8px; top: auto !important; }
}
/* phones held sideways: stage on the left, panel on the right */
@media (max-height: 520px) and (orientation: landscape) {
  .app { padding: 6px calc(8px + env(safe-area-inset-right)) 6px calc(8px + env(safe-area-inset-left)); gap: 6px; grid-template-rows: auto 1fr; }
  .top { min-height: 34px; }
  .brand svg { width: 28px; height: 28px; } .brand__name { font-size: 15px; }
  .kitname, .chipgroup { display: none; }
  .iconbtn { width: 34px; height: 34px; }
  .main { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: 1fr; gap: 8px; }
  .left { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 6px; }
  .strip { padding: 4px; } .strip__arrow { display: none; }
  .step { width: auto; padding: 3px 8px 3px 3px; } .step img, .step .thumb { width: 36px; height: 28px; } .step span { font-size: 12px; white-space: nowrap; }
  .panel__body { padding: 10px 14px 14px; }
  .phead h1 { font-size: 19px; } .phead__num { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
  .ptext { font-size: 14px; margin-bottom: 10px; }
  .pnav { padding: 6px 10px; } .btn { padding: 8px 14px; } .keys { display: none; }
  .stage__title { left: 6px; top: 6px; padding: 4px 8px 4px 4px; } .stage__title i { width: 24px; height: 24px; } .stage__title strong { font-size: 12px; } .stage__title span { display: none; }
  .tools { right: 6px; top: 6px; gap: 4px; } .tools .iconbtn { width: 32px; height: 32px; }
  .readouts { top: 40px; left: 6px; gap: 4px; } .ro { padding: 3px 7px; min-width: 0; } .ro small { font-size: 9px; } .ro strong { font-size: 13px; }
  .minimap { display: none; }
  .flow { width: 180px; right: 6px; bottom: 6px; padding: 5px 7px; } .flow__note { display: none; }
  .flow.big { left: 6px; top: 40px; right: 48px; width: auto; }
  .pad { grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(3, 42px); }
}
@media (prefers-reduced-motion: reduce) { .loader__wheel { animation: none; } .strip__row { scroll-behavior: auto; } }

/* add-ons: the camera's picture, chapter marks in the strip */
.pip { position: absolute; right: 12px; bottom: 12px; z-index: 3; width: 300px; aspect-ratio: 4 / 3; border-radius: 14px; border: 3px solid var(--surface); box-shadow: 0 6px 20px -8px rgba(0,0,0,.45); pointer-events: none; }
.pip span { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.pip span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; margin-right: 6px; vertical-align: 1px; }
.chapter { flex: none; display: flex; align-items: center; padding: 0 4px 0 10px; border-left: 2px dashed var(--line2); margin-left: 4px; }
.chapter span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); max-height: 100%; }
@media (max-width: 760px) { .pip { width: 150px; right: 8px; bottom: 8px; } .chapter span { font-size: 9px; } }
@media (max-height: 520px) and (orientation: landscape) { .pip { width: 150px; right: 6px; bottom: 6px; } }

/* parts list row that is lit up in 3D */
.need li[data-ids] { cursor: pointer; transition: border-color .15s, background .15s; }
.need li.hl { border-color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 10%, var(--surface)) !important; }

/* wires, one at a time */
.tag.port { background: #14161a; color: #fff; border-color: #14161a; font-family: var(--mono); }
.tag.port::after { border-color: #14161a; }
.wplayer { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.wplayer .iconbtn { font-size: 22px; font-weight: 700; line-height: 1; }
.wplayer .iconbtn:disabled { opacity: .35; }
.wplayer .btn { min-width: 112px; padding: 10px 14px; }
.wcount { margin-left: auto; font-size: 13px; font-weight: 750; color: var(--muted); white-space: nowrap; }
.wbar { display: flex; gap: 3px; margin-bottom: 12px; }
.wbar i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.wbar i b { display: block; height: 100%; background: var(--accent); }
.wbar i.done b { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.wcard { border: 1.5px solid var(--accent); border-radius: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.wcard__k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wcard__k b { color: var(--accent); font-family: var(--mono); text-transform: none; letter-spacing: 0; }
.wcard h3 { margin: 4px 0 8px; font-size: 18px; }
.wcard p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); font-size: 12.5px; }
.wchip i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.35); }
.wchip b { font-family: var(--mono); font-size: 12px; }
.wlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wlist li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); font-size: 13.5px; cursor: pointer; }
.wlist li.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.wlist li.hl { border-color: var(--accent); }
.wlist li.done { color: var(--muted); }
.wnum { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--line); flex: none; }
.wlist li.on .wnum { background: var(--accent); color: #fff; }
.wlist li.done .wnum { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); color: var(--accent); }
.wname { font-weight: 700; flex: 1; }
.wport { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.trouble { display: grid; gap: 6px; }
.trouble details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); padding: 0 12px; }
.trouble summary { cursor: pointer; padding: 10px 0; font-weight: 700; font-size: 14px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.trouble summary::-webkit-details-marker { display: none; }
.trouble summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.trouble details[open] summary::after { content: "−"; }
.trouble p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
