@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlowc-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlowc-700.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/plexmono-500.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/plexmono-600.woff2") format("woff2"); }

:root {
  /* Layout: one thumb-reach column with a big button at the bottom. The drive keypad readout (amber on black) is the signature:
     every value to key in shows the way the drive's own display does. Terminals are wire-marker tags colored by wire type. */
  --bg: #E4E8E3; --surface: #F9FAF7; --surface-2: #EDF0EA; --ink: #16202B; --muted: #566272; --line: #C9CFC6;
  --chrome: #1B2330; --chrome-2: #2A3445; --chrome-ink: #EEF2F7; --chrome-muted: #9FAABB;
  --accent: #F2A12E; --accent-ink: #1C1406; --accent-text: #8E5300; --accent-soft: #FBE9C9;
  --led-bg: #0B1016; --led: #FFB547; --led-dim: #8C6C3B;
  --ok: #2B7A3D; --ok-soft: #DCEEDF; --warn: #8E5300; --warn-soft: #FAEBD0; --bad: #B9322A; --bad-soft: #F7DEDA;
  --w-dig: #1F5FBF; --w-stop: #C62828; --w-rly: #D9630B; --w-ana: #2E8B4A; --w-pwr: #6D45A8; --w-com: #8A6A55; --w-oth: #6B7480;
  --art-shadow: rgba(20, 30, 40, .14); --art-body: #D4D9DB; --art-edge: #8C969C; --art-cap: #B9C0C4; --art-face: #E8EBEC; --art-key: #9AA3A9;
  --art-knob: #3A434E; --art-screen: #10161D; --art-led: #FFB547; --art-lcd: #B5C7B2; --art-lcd-ink: #2E3B33;
  --f-display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", Roboto, "Segoe UI", system-ui, sans-serif;
  --f-mono: "Plex Mono", "IBM Plex Mono", "Roboto Mono", ui-monospace, monospace;
  --abh: 3.5rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E131A; --surface: #161D27; --surface-2: #1E2733; --ink: #E6EBF1; --muted: #9AA6B6; --line: #2C3644;
    --chrome: #090D13; --chrome-2: #222C3A; --chrome-ink: #E6EBF1; --chrome-muted: #8E9AAB;
    --accent: #F5A93A; --accent-ink: #1C1406; --accent-text: #F5B451; --accent-soft: #3A2C14;
    --led-bg: #05080C; --led: #FFB547; --led-dim: #8A6B3B;
    --ok: #5DC27A; --ok-soft: #173123; --warn: #EAA846; --warn-soft: #3A2C14; --bad: #F0675C; --bad-soft: #3D1C1A;
    --w-dig: #5B95E8; --w-stop: #EE6B6B; --w-rly: #F08A3A; --w-ana: #57B872; --w-pwr: #A57FDB; --w-com: #B8957F; --w-oth: #8E98A6;
    --art-shadow: rgba(0, 0, 0, .35); --art-body: #4B5563; --art-edge: #6E7A89; --art-cap: #3B4451; --art-face: #58636F; --art-key: #8995A3;
    --art-knob: #1E242C; --art-screen: #05080C; --art-lcd: #7E9A84; --art-lcd-ink: #1D2A22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E131A; --surface: #161D27; --surface-2: #1E2733; --ink: #E6EBF1; --muted: #9AA6B6; --line: #2C3644;
  --chrome: #090D13; --chrome-2: #222C3A; --chrome-ink: #E6EBF1; --chrome-muted: #8E9AAB;
  --accent: #F5A93A; --accent-ink: #1C1406; --accent-text: #F5B451; --accent-soft: #3A2C14;
  --led-bg: #05080C; --led: #FFB547; --led-dim: #8A6B3B;
  --ok: #5DC27A; --ok-soft: #173123; --warn: #EAA846; --warn-soft: #3A2C14; --bad: #F0675C; --bad-soft: #3D1C1A;
  --w-dig: #5B95E8; --w-stop: #EE6B6B; --w-rly: #F08A3A; --w-ana: #57B872; --w-pwr: #A57FDB; --w-com: #B8957F; --w-oth: #8E98A6;
  --art-shadow: rgba(0, 0, 0, .35); --art-body: #4B5563; --art-edge: #6E7A89; --art-cap: #3B4451; --art-face: #58636F; --art-key: #8995A3;
  --art-knob: #1E242C; --art-screen: #05080C; --art-lcd: #7E9A84; --art-lcd-ink: #1D2A22;
  color-scheme: dark;
}
:root[data-size="large"] { font-size: 112.5%; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.45 var(--f-body); -webkit-tap-highlight-color: transparent; }
body.flow { --abh: calc(3.5rem + 12px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
a { color: var(--accent-text); }
.ic { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic .f { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app bar ---------- */
#top { position: sticky; top: 0; z-index: 20; }
.appbar { background: var(--chrome); color: var(--chrome-ink); }
.appbar .in { display: flex; align-items: center; gap: 2px; height: 3.5rem; padding: 0 4px; max-width: 46rem; margin: 0 auto; }
.iconbtn { display: grid; place-items: center; width: 3rem; height: 3rem; flex: none; border: 0; background: transparent; border-radius: 50%; color: inherit; }
.iconbtn:active { background: rgba(255, 255, 255, .12); }
.iconbtn[aria-pressed="true"] { color: var(--led); background: rgba(255, 181, 71, .14); }
.abt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 0 8px; border: 0; background: transparent; text-align: left; color: inherit; height: 3rem; border-radius: 10px; }
.abt:active { background: rgba(255, 255, 255, .08); }
.abt b { max-width: 100%; font: 600 1.3125rem/1.1 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abt small { max-width: 100%; display: flex; align-items: center; gap: 4px; font-size: .8125rem; color: var(--chrome-muted); white-space: nowrap; overflow: hidden; }
.abt small .ic { width: .9rem; height: .9rem; }
.brandmark { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 10px; }
.brandmark .mark { width: 1.9rem; height: 2.65rem; flex: none; }
.brandmark .word { font: 700 1.4375rem/1 var(--f-display); letter-spacing: .2px; white-space: nowrap; }
.brandmark .by { display: block; margin-top: 2px; font: 500 .75rem/1.2 var(--f-body); color: var(--chrome-muted); }
.segs { display: flex; gap: 3px; padding: 0 12px 8px; max-width: 46rem; margin: 0 auto; }
.segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--chrome-2); }
.segs i.on { background: var(--led-dim); }
.segs i.cur { background: var(--led); box-shadow: 0 0 6px rgba(255, 181, 71, .6); }

/* ---------- page ---------- */
main { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1rem 8rem; }
.screen { display: grid; gap: 1rem; }
.screen.anim { animation: slide .18s ease-out; }
@keyframes slide { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: 2.375rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.3125rem; margin-top: .375rem; }
p { margin: 0; }
.lede { color: var(--muted); max-width: 62ch; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.stack { display: grid; gap: .625rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.note { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .9375rem; }
.note .ic { width: 1.25rem; height: 1.25rem; margin-top: 1px; color: var(--accent-text); }
.note.bad .ic { color: var(--bad); }
.note b { font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 3rem; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; color: var(--ink); text-align: center; }
.btn:active { filter: brightness(.94); }
.btn .ic { width: 1.25rem; height: 1.25rem; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary[disabled] { background: var(--surface-2); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn.tonal { background: var(--surface-2); border-color: transparent; }
.btn.text { border-color: transparent; background: transparent; color: var(--accent-text); padding: 0 10px; }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { min-height: 2.5rem; padding: 0 12px; font-size: .9375rem; border-radius: 10px; }
.btn.sm:not(.text) { white-space: nowrap; }
.btn.text { text-align: left; }
.btnrow { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- home ---------- */
.intents { display: grid; gap: .625rem; }
.intent { display: grid; grid-template-columns: 3rem 1fr auto; gap: 14px; align-items: center; width: 100%; padding: 14px; min-height: 4.75rem; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: inherit; }
.intent:active { background: var(--surface-2); }
.intent .ii { width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); }
.intent .ii .ic { width: 1.6rem; height: 1.6rem; }
.intent b { display: block; font: 600 1.4375rem/1.1 var(--f-display); }
.intent .sub { display: block; margin-top: 2px; font-size: .9375rem; color: var(--muted); line-height: 1.3; }
.intent > .ic { color: var(--muted); }
.intent.hot { background: var(--chrome); color: var(--chrome-ink); border-color: var(--chrome); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, .32); }
.intent.hot .ii { background: var(--led); color: var(--led-bg); }
.intent.hot .sub, .intent.hot > .ic { color: var(--chrome-muted); }
.resume { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--chrome); color: var(--chrome-ink); }
.resume .lcd { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--led-bg); color: var(--led); font: 600 1.0625rem/1.25 var(--f-mono); text-shadow: 0 0 8px rgba(255, 181, 71, .45); box-shadow: inset 0 0 0 1px #000; }
.resume .lcd .art { width: 2rem; height: 3rem; }
.resume .lcd .to { color: var(--led-dim); text-shadow: none; }
.resume small { color: var(--chrome-muted); font-size: .875rem; }
.resume .btnrow .btn:not(.primary) { background: transparent; color: var(--chrome-ink); border-color: var(--chrome-2); }
.maker { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding-top: .5rem; color: var(--muted); font-size: .875rem; }
.maker b { color: var(--ink); font-weight: 600; }
.corn { position: relative; width: 4.25rem; height: 4.25rem; border: 0; padding: 0; background: transparent; border-radius: 50%; }
.corn img { width: 100%; height: 100%; display: block; }
.corn.big { width: 8rem; height: 8rem; }
.pop { position: fixed; z-index: 90; width: 13px; height: 11px; border-radius: 50%; background: #FFF6DC; pointer-events: none;
  box-shadow: 5px -2px 0 -1px #FFF6DC, -4px -3px 0 -1px #FFF1C9, 1px -5px 0 -1px #FFFBEF, 0 0 0 1px rgba(201, 138, 28, .35);
  animation: pop .95s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes pop { 0% { transform: translate(0, 0) scale(.3); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); opacity: 0; } }

/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px; min-height: 4.25rem; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; color: inherit; }
.li:first-child { border-top: 0; }
.li:active { background: var(--surface-2); }
.li .tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.li .t1 { font: 600 1.375rem/1.1 var(--f-display); }
.li .t2 { font-size: .875rem; color: var(--muted); line-height: 1.3; }
.li .end { color: var(--muted); }
.li .ck { color: var(--accent-text); }
.li[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.li.plain { min-height: 3.5rem; }
.li.plain .t1 { font: 600 1.0625rem/1.25 var(--f-body); }
.art { width: 2.75rem; height: 4.125rem; flex: none; }
.thumbimg { width: 2.75rem; height: 4.125rem; flex: none; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.pill { flex: none; display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pill.leg { color: var(--warn); background: var(--warn-soft); }
.pill.best { color: var(--accent-ink); background: var(--accent); }
.fits { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.fit { display: inline-flex; align-items: center; gap: 3px; font-size: .8125rem; font-weight: 500; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.fit.ok { color: var(--ok); background: var(--ok-soft); }
.fit.no { color: var(--bad); background: var(--bad-soft); }
.fit.wn { color: var(--warn); background: var(--warn-soft); }
.grouph { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: .5rem 0 -.25rem; }
.grouph h3 { margin: 0; }
.worksif { font-size: .8125rem; line-height: 1.3; color: var(--muted); margin-top: 3px; }
.worksif.catch { color: var(--warn); }
.whynot { font-size: .8125rem; line-height: 1.3; color: var(--bad); margin-top: 3px; }
details.more { border-radius: 14px; }
details.more > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 3rem; padding: 0 14px; border-radius: 12px; background: var(--surface-2); font-weight: 600; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: .5rem; }
details.more[open] > summary .ic { transform: rotate(180deg); }

.pk { display: flex; align-items: center; gap: 12px; }
.pk > div { flex: 1; min-width: 0; }
.pk .m { display: block; font: 600 1.625rem/1.1 var(--f-display); }
.pk .b { font-size: .875rem; color: var(--muted); }
.pk .ck { color: var(--accent-text); width: 1.75rem; height: 1.75rem; }

/* ---------- search and chips ---------- */
.searchbar { position: sticky; top: var(--abh); z-index: 6; background: var(--bg); margin: -.25rem -1rem 0; padding: .25rem 1rem .5rem; display: grid; gap: .5rem; }
.searchbox { display: flex; align-items: center; gap: 8px; min-height: 3.25rem; padding: 0 6px 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.searchbox:focus-within { border-color: var(--accent); }
.searchbox .ic { color: var(--muted); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 1.0625rem; padding: 10px 0; }
.searchbox input::-webkit-search-cancel-button { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem; padding: 2px 1rem; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 2.25rem; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .9375rem; white-space: nowrap; color: inherit; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip .n { font-size: .8125rem; opacity: .7; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
details.narrow > summary { background: var(--surface); border: 1.5px solid var(--line); }
details.narrow[open] > summary { border-color: var(--accent); }

/* ---------- choices ---------- */
.opts { display: grid; gap: .5rem; }
.opt { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 14px 10px 10px; min-height: 3.75rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; color: inherit; }
.opt:active { background: var(--surface-2); }
.opt .oi { width: 2.75rem; height: 2.75rem; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.opt .oi .ic { width: 1.65rem; height: 1.65rem; }
.opt .tx { flex: 1; min-width: 0; }
.opt b { display: block; font-weight: 600; line-height: 1.25; }
.opt .sub { display: block; margin-top: 1px; font-size: .875rem; color: var(--muted); line-height: 1.3; }
.opt .ck { color: var(--accent-text); visibility: hidden; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"] .oi { background: var(--accent); color: var(--accent-ink); }
.opt[aria-pressed="true"] .ck { visibility: visible; }
.opt.dim { opacity: .62; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.seg2 .opt { min-height: 3.25rem; }
.q { display: grid; gap: .5rem; scroll-margin-top: calc(var(--abh) + 12px); }
.help { font-size: .9375rem; color: var(--muted); }
.help summary { color: var(--accent-text); font-weight: 600; cursor: pointer; padding: 4px 0; }
.help ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > .lab { font-size: .875rem; font-weight: 500; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.inp { display: flex; align-items: center; gap: 8px; min-height: 3.25rem; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.inp input, .inp textarea, .inp select { flex: 1; min-width: 0; width: 100%; border: 0; outline: none; background: transparent; font-size: 1.0625rem; padding: 12px 0; color: var(--ink); }
.inp textarea { min-height: 5.5rem; resize: vertical; }
.inp .u { font: 500 .875rem var(--f-mono); color: var(--muted); }
.inp.disabled { opacity: .55; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { min-height: 2.125rem; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font: 500 .875rem var(--f-mono); color: var(--ink); }
.unitsw { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.unitsw button { border: 0; background: var(--surface); padding: 2px 10px; font: 600 .8125rem var(--f-mono); color: var(--muted); min-height: 1.75rem; }
.unitsw button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.extra { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: end; }

/* ---------- keypad readout and codes ---------- */
.led { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; max-width: 100%; padding: 8px 12px; border-radius: 8px; background: var(--led-bg); color: var(--led); font: 600 1.0625rem/1.3 var(--f-mono); text-shadow: 0 0 8px rgba(255, 181, 71, .5); box-shadow: inset 0 0 0 1px #000, inset 0 2px 8px rgba(0, 0, 0, .6); }
.led .p, .led .eq { color: var(--led-dim); text-shadow: none; }
.code { font: 600 .875rem var(--f-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.kv { display: grid; gap: 6px; }
.kv .r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.kv .r:first-child { border-top: 0; }
.kv .r .k { color: var(--muted); font-size: .9375rem; }
.kv .r .v { font-weight: 600; text-align: right; }
.kv .r .sub { grid-column: 1 / -1; font-size: .875rem; color: var(--muted); }

/* ---------- terminal tags (wire markers) ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-grid; grid-template-columns: 6px auto; min-width: 3.75rem; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); text-align: left; vertical-align: top; }
.tag::before { content: ""; grid-row: 1 / 3; background: var(--wc, var(--w-oth)); }
.tag b { font: 600 .9375rem/1.2 var(--f-mono); padding: 5px 8px 0; }
.tag span { font-size: .6875rem; line-height: 1.25; color: var(--muted); padding: 1px 8px 5px; max-width: 9.5rem; }
button.tag { padding: 0; color: inherit; }
button.tag[aria-pressed="false"] { opacity: .5; border-style: dashed; }
button.tag[aria-pressed="false"]::before { background: var(--line); }
button.tag[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.g-stop { --wc: var(--w-stop); } .g-dig { --wc: var(--w-dig); } .g-pwr { --wc: var(--w-pwr); } .g-ana { --wc: var(--w-ana); } .g-rly { --wc: var(--w-rly); } .g-com { --wc: var(--w-com); } .g-other { --wc: var(--w-oth); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8125rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--wc); }

/* ---------- program and wire checklists ---------- */
.progress { display: grid; gap: 6px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--ok); transition: width .25s; }
.pgh { position: sticky; top: var(--abh); z-index: 4; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: .25rem -1rem -.25rem; padding: .5rem 1rem .375rem; background: var(--bg); }
.pgh h3 { margin: 0; }
.pgh small { color: var(--muted); font-size: .8125rem; }
.ps { display: grid; grid-template-columns: 2.875rem minmax(0, 1fr); gap: 4px 10px; padding: 12px 12px 12px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ps.warn { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.ps .body { display: grid; gap: 6px; min-width: 0; }
.ps .t { font-weight: 600; line-height: 1.3; }
.ps .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ps .more { display: grid; gap: 6px; }
.ps.done { background: transparent; }
.ps.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.ps.done .more { display: none; }
.tick { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; font: 600 .875rem var(--f-mono); color: var(--muted); }
.tick .ic { width: 1.4rem; height: 1.4rem; stroke-width: 2.4; }
.tick[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.kind { font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.kind.set { background: var(--accent-soft); color: var(--accent-text); }
.kind.do { background: var(--bad-soft); color: var(--bad); }
.kind.check { background: var(--surface-2); color: var(--muted); }
.ships { font-size: .875rem; color: var(--muted); }
.wmap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wmap .arrow { color: var(--accent-text); }
.st { font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.st.ok { color: var(--ok); background: var(--ok-soft); }
.st.reassign, .st.check { color: var(--warn); background: var(--warn-soft); }
.st.missing { color: var(--bad); background: var(--bad-soft); }
.st.procedure { color: var(--muted); background: var(--surface-2); }
.checks { display: grid; gap: .5rem; }
.chk { display: grid; grid-template-columns: 2.875rem minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px 10px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.chk.done .tx { color: var(--muted); }

/* ---------- photos ---------- */
.pslot { display: grid; gap: .625rem; padding: 12px; border-radius: 14px; border: 1.5px dashed var(--line); background: var(--surface); }
.pslot.has { border-style: solid; }
.pslot .ph { display: flex; align-items: center; gap: 10px; }
.pslot .ph > .ic { color: var(--muted); }
.pslot .ph b { display: block; font-weight: 600; line-height: 1.25; }
.pslot .ph span { display: block; font-size: .875rem; color: var(--muted); line-height: 1.3; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.thumb { position: relative; width: 5.5rem; height: 5.5rem; flex: none; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.missing::after { content: "Photo not on this device"; position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; font-size: .6875rem; color: var(--muted); text-align: center; }
.bigshot { display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #000; }
.bigshot img { display: block; width: 100%; max-height: 15rem; object-fit: contain; }

/* ---------- drive detail ---------- */
.dhead { display: grid; grid-template-columns: 6.5rem 1fr; gap: 16px; align-items: center; }
.dhead .art, .dhead .thumbimg { width: 6.5rem; height: 9.75rem; border-radius: 10px; }
.dhead h2 { font-size: 2.125rem; }
.dhead .b { color: var(--muted); margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.facts div { background: var(--surface); padding: 10px 12px; }
.facts small { display: block; font-size: .8125rem; color: var(--muted); }
.facts b { font-weight: 600; }
.traps { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.traps li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .9375rem; }
.traps li .ic { width: 1.25rem; height: 1.25rem; color: var(--bad); margin-top: 1px; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .8125rem; color: var(--muted); font-weight: 600; border-top: 0; }
.table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }

/* ---------- tools ---------- */
.readout { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--led-bg); box-shadow: inset 0 0 0 1px #000, inset 0 2px 10px rgba(0, 0, 0, .55); }
.readout .row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.readout .big { font: 600 1.875rem/1 var(--f-mono); color: var(--led); text-shadow: 0 0 10px rgba(255, 181, 71, .45); font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout .lbl { font: 500 .8125rem var(--f-mono); color: var(--led-dim); }
.torch { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; width: 100%; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: inherit; }
.torch .ii { width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.torch[aria-pressed="true"] { background: var(--chrome); color: var(--chrome-ink); border-color: var(--chrome); }
.torch[aria-pressed="true"] .ii { background: var(--led); color: var(--led-bg); box-shadow: 0 0 18px rgba(255, 181, 71, .6); }
.torch b { display: block; font: 600 1.375rem/1.1 var(--f-display); }
.torch span { font-size: .875rem; color: var(--muted); }
.torch[aria-pressed="true"] span { color: var(--chrome-muted); }

/* ---------- bottom bars ---------- */
.actionbar, .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06); }
.actionbar .in { max-width: 46rem; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.actionbar .sum { flex: 1; min-width: 0; font-size: .875rem; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.actionbar .sum b { color: var(--ink); font-weight: 600; }
.actionbar .btn.primary { min-height: 3.25rem; min-width: 9rem; font-size: 1.0625rem; padding: 0 20px; }
.tabbar .in { max-width: 46rem; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tab { display: grid; justify-items: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 600; padding: 4px 0; }
.tab .pb { display: grid; place-items: center; width: 3.5rem; height: 2rem; border-radius: 999px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .pb { background: var(--accent-soft); color: var(--accent-text); }
html.typing .actionbar, html.typing .tabbar { display: none; }

/* ---------- sheets, viewer, toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 18, .5); animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 46rem; margin: 0 auto; max-height: 88%; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 6px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: .75rem; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 2px; }
.sheet h3 { margin: 0; }
.sheet .opt { background: var(--bg); }
.stepl { display: grid; gap: 2px; }
.stepl button { display: grid; grid-template-columns: 2.25rem 1fr auto; gap: 10px; align-items: center; min-height: 3.25rem; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; text-align: left; color: inherit; }
.stepl button[aria-current="step"] { background: var(--accent-soft); }
.stepl button[disabled] { opacity: .45; }
.stepl .n { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font: 600 .875rem var(--f-mono); }
.stepl .n.ok { background: var(--ok); color: #fff; }
.stepl .n .ic { width: 1.1rem; height: 1.1rem; stroke-width: 2.4; }
.stepl small { font-size: .8125rem; color: var(--muted); }
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; color: #fff; }
.viewer .vbar { display: flex; align-items: center; gap: 4px; padding: 4px; }
.viewer .vbar b { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .vimg { flex: 1; overflow: auto; display: grid; place-items: center; touch-action: pan-x pan-y; }
.viewer .vimg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer.zoom .vimg { place-items: start; }
.viewer.zoom .vimg img { max-width: none; max-height: none; width: 260%; }
.viewer .vhint { text-align: center; font-size: .8125rem; color: #aab; padding: 6px 0 calc(10px + env(safe-area-inset-bottom)); }
.toast { position: fixed; left: 50%; bottom: calc(6.25rem + env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 8px); max-width: min(90vw, 30rem); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: .9375rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { display: grid; gap: .75rem; justify-items: start; padding: 18px; border-radius: 16px; border: 1.5px dashed var(--line); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 40rem) { .intents { grid-template-columns: 1fr 1fr; } }
@media (max-width: 22rem) { h1 { font-size: 2rem; } h2 { font-size: 1.75rem; } .grid2 { grid-template-columns: 1fr; } }

/* ---------- 1.3: plate reading, dead-drive checks, cross-reference, panel labels ---------- */
.intent.slim { min-height: 0; padding: 10px 14px; border-style: dashed; }
.intent.slim .ii { width: 2.5rem; height: 2.5rem; background: var(--warn-soft); color: var(--warn); }
.intent.slim b { font-size: 1.25rem; }
.mono, input.mono { font-family: var(--f-mono); letter-spacing: .02em; }
.kv .r .v.mono { font: 600 .9375rem var(--f-mono); }
pre.ocr { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--led-bg); color: var(--led); font: 500 .8125rem/1.45 var(--f-mono); white-space: pre-wrap; word-break: break-word; max-height: 14rem; overflow: auto; }
.xpicks { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.xpick { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); color: inherit; text-align: center; min-height: 9rem; }
.xpick .tx { display: grid; gap: 1px; }
.xpick small { color: var(--muted); font-size: .75rem; }
.xpick b { font: 600 1.25rem/1.1 var(--f-display); }
.xpick .tx > span { font-size: .8125rem; color: var(--muted); }
.xpick .art, .xpick .thumbimg { width: 4.5rem; height: 4.5rem; }
.xblank { display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 14px; border: 1.5px dashed var(--line); color: var(--muted); }
.xr { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.xr > b { font-weight: 600; }
.xmap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.xmap .arrow { color: var(--accent-text); width: 1.1rem; height: 1.1rem; }
.xpair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xpair > div { display: grid; gap: 3px; align-content: start; }
.xpair .led { padding: 4px 10px; font-size: .9375rem; justify-self: start; }
.labelcard { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 14px; align-items: center; }
.qrbtn { padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); line-height: 0; }
.qr { width: 100%; height: auto; display: block; }
.qrview { background: #fff; color: #111; }
.qrview .vbar { color: #111; }
.qrbig { flex: 1; display: grid; place-items: center; align-content: center; gap: 16px; padding: 16px; text-align: center; }
.qrbig .qr.big { width: min(86vw, 26rem); }
.qrbig p { max-width: 22rem; font-size: .9375rem; color: #444; margin: 0; }
.sheetlist { max-height: 55vh; overflow: auto; }
.xpick.one { grid-template-columns: auto 1fr; justify-items: start; text-align: left; min-height: 0; align-items: center; }
.xpick.one .art, .xpick.one .thumbimg, .xpick.one .xblank { width: 3.25rem; height: 3.25rem; }
.xr.fault .fh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.xr.fault .led { padding: 4px 10px; font-size: 1rem; }
.verdict { display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); }
.verdict > b { font: 700 1.5rem/1.1 var(--f-display); }
.verdict.ok { border-color: var(--ok); } .verdict.ok > b { color: var(--ok); }
.verdict.warn { border-color: var(--accent); } .verdict.warn > b { color: var(--warn); }
.verdict.bad { border-color: var(--bad); } .verdict.bad > b { color: var(--bad); }
.vline { display: grid; grid-template-columns: 1.25rem 1fr; gap: 8px; align-items: start; font-size: .9375rem; }
.vline .ic { width: 1.1rem; height: 1.1rem; margin-top: 2px; }
.vline.ok .ic { color: var(--ok); } .vline.warn .ic { color: var(--warn); } .vline.no .ic { color: var(--bad); }
