/* PIXEL-ON Install — светла тема по подразбиране, тъмна по системната настройка. */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --card-2: #f7f9fc;
  --text: #0f1b2d;
  --muted: #5d6b80;
  --line: #dde3ec;
  --primary: #0b5cc2;
  --primary-2: #0a4ea6;
  --primary-soft: #e6f0fc;
  --accent: #f29b16;
  --ok: #1f9d55;
  --ok-soft: #e4f6ec;
  --warn: #b7791f;
  --warn-soft: #fff6e0;
  --err: #d23b3b;
  --err-soft: #fdeaea;
  --dc-p: #d62828;
  --dc-n: #1d232c;
  --ac: #e07a00;
  --com: #1f6feb;
  --pv: #2e9e44;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 6px 24px rgba(15, 27, 45, .06);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420; --card: #141d2b; --card-2: #192335; --text: #e7edf6; --muted: #93a2b8; --line: #263247;
    --primary: #4b93ff; --primary-2: #6aa6ff; --primary-soft: #16294a; --ok-soft: #12301f; --warn-soft: #33270e; --err-soft: #3a1717;
    --dc-n: #c9d3e1; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1420; --card: #141d2b; --card-2: #192335; --text: #e7edf6; --muted: #93a2b8; --line: #263247;
  --primary: #4b93ff; --primary-2: #6aa6ff; --primary-soft: #16294a; --ok-soft: #12301f; --warn-soft: #33270e; --err-soft: #3a1717;
  --dc-n: #c9d3e1; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin-top: 1.6em; }
code { background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: .05em .4em; font-size: .92em; }
.muted { color: var(--muted); }
.sm { font-size: .875rem; }
[hidden] { display: none !important; }

/* Горна лента */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-t b { letter-spacing: .02em; }
.brand-t span { color: var(--muted); font-weight: 500; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #10a3e0); flex: none; }
.logo svg { width: 20px; height: 20px; fill: #fff; }
.logo.big { width: 64px; height: 64px; border-radius: 18px; }
.logo.big svg { width: 36px; height: 36px; }
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topnav > a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.topnav > a.on, .topnav > a:hover { color: var(--text); background: var(--card-2); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang a { padding: 4px 9px; text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 600; }
.lang a.on { background: var(--primary); color: #fff; }
.who { color: var(--muted); font-size: .875rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.who:hover { color: var(--primary); }
.passbar { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .875rem; padding: 6px 16px; border-bottom: 1px solid var(--line); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }

/* Карти, форми, бутони */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.narrow { max-width: 460px; margin: 20px auto; }
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; }
textarea { min-height: 90px; resize: vertical; }
.btn, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 10px;
  padding: 10px 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger, .btn-ghost.danger { color: var(--err); }
.btn.lg { padding: 14px 22px; font-size: 1.05rem; }
.btn.sm, .btn-ghost.sm { padding: 6px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--card-2); }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--err-soft); color: var(--err); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* Вход */
.login { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; min-height: 70vh; }
.login-hero h1 { font-size: 2.2rem; margin-top: 16px; }
.login-hero p { color: var(--muted); font-size: 1.1rem; max-width: 34ch; }
.hero-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.hero-points li { padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-weight: 500; width: fit-content; }
.login-card { max-width: 440px; width: 100%; justify-self: end; }
.tabs { display: flex; gap: 4px; background: var(--card-2); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.code-in { text-transform: uppercase; letter-spacing: .12em; font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; text-align: center; }

/* Начало */
.hero-start { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: end; background: linear-gradient(135deg, var(--card), var(--primary-soft)); }
.start-form .btn { width: 100%; }
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.job { display: flex; padding: 0; overflow: hidden; }
.job-main { flex: 1; padding: 16px; text-decoration: none; color: var(--text); display: grid; gap: 6px; min-width: 0; }
.job-t { font-weight: 700; }
.job-d { color: var(--muted); font-size: .875rem; }
.job-m { color: var(--muted); font-size: .8rem; display: flex; gap: 8px; align-items: center; }
.job form { padding: 8px; }
.bar { height: 6px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* Въпроси (плочки) */
.wizard-q { max-width: 980px; margin: 0 auto; }
.q-title { font-size: 1.9rem; margin: 18px 0 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; gap: 14px; align-items: flex-start; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.tile-media { flex: none; width: 56px; height: 56px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.ico { width: 30px; height: 30px; }
.tile-body { display: grid; gap: 4px; min-width: 0; }
.tile-t { font-weight: 700; font-size: 1.05rem; }
.tile-d { color: var(--muted); font-size: .875rem; }
.tile-badge { position: absolute; top: 10px; right: 10px; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); }
.tile:has(.tile-badge) .tile-body, .tile.check .tile-body { padding-right: 34px; }
.tile.fixed { cursor: default; opacity: .8; }
.tile.fixed:hover { transform: none; border-color: var(--line); }
.tile.check input { position: absolute; opacity: 0; pointer-events: none; }
.tile.check .tick { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); background: var(--card); }
.tile.check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.tile.check:has(input:checked) .tick { background: var(--primary); border-color: var(--primary); }
.tile.check:has(input:checked) .tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.tile.check:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.q-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 6px; }
.q-back { margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 3px 4px 3px 12px; font-size: .85rem; font-weight: 600; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: transparent; color: var(--primary); font: inherit; font-size: .78rem; font-weight: 600; padding: 3px 8px; border-radius: 99px; cursor: pointer; }
.chip button:hover { background: var(--primary-soft); }

/* Стъпки */
.wizard { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.side { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.side .chips { gap: 6px; }
.side .chip { font-size: .78rem; }
.side-h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.steplist { list-style: none; margin: 0; padding: 0; }
.steplist li.sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 12px 8px 4px; }
.steplist button { display: flex; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; font-size: .88rem; color: var(--text);
  padding: 6px 8px; border-radius: 8px; cursor: pointer; align-items: baseline; }
.steplist button:hover { background: var(--card-2); }
.steplist li.cur button { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.steplist .ref { flex: none; min-width: 34px; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--muted); }
.steplist li.done .st::after { content: " ✓"; color: var(--ok); font-weight: 700; }
.stage { min-width: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stage > * { min-width: 0; }
.stage-top { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #10a3e0); border-radius: 99px; transition: width .3s; }
.step { padding: 24px 26px; }
.step-h { position: relative; padding-right: 70px; margin-bottom: 8px; }
.step-h h1 { margin-top: 10px; font-size: 1.55rem; }
.step-ref { position: absolute; top: 0; right: 0; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: .95rem; color: var(--primary);
  background: var(--primary-soft); border-radius: 8px; padding: 4px 10px; }
.sec-chip { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 3px 10px; border-radius: 99px; background: var(--card-2); color: var(--muted); }
.sec-wiring { background: #fde8e8; color: #b42318; }
.sec-comms { background: #e3eeff; color: #1d4ed8; }
.sec-power { background: #fff1db; color: #b45309; }
.sec-firmware { background: #efe6ff; color: #6d28d9; }
.sec-config { background: #e0f5f2; color: #0f766e; }
.sec-test { background: var(--ok-soft); color: var(--ok); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sec-chip:not(.sec-prep) { background: var(--card-2); } }

.body { font-size: 1.02rem; }
.body h3 { font-size: 1.05rem; margin: 1.3em 0 .5em; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.body ul, .body ol { padding-left: 1.3em; }
.body li { margin: .3em 0; }
.body ol li::marker { font-weight: 700; color: var(--primary); }
.body ul.check { list-style: none; padding: 0; }
.body ul.check li { margin: 0; border-bottom: 1px solid var(--line); }
.body ul.check label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; cursor: pointer; }
.body ul.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ok); flex: none; }
.body ul.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.arr { color: var(--primary); font-weight: 700; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; margin: 12px 0; align-items: flex-start; }
.callout .ci { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; }
.callout.warn { background: var(--err-soft); }
.callout.warn .ci { background: var(--err); }
.callout.tip { background: var(--primary-soft); }
.callout.tip .ci { background: var(--primary); font-family: Georgia, serif; font-style: italic; }

/* Макет на менюто на Remote Console */
.gxmenu { max-width: 440px; margin: 14px 0; border-radius: 12px; overflow: hidden; background: #fff; color: #222; border: 1px solid #c9d3e1; box-shadow: var(--shadow); font-size: .92rem; }
.gxbar { display: flex; align-items: center; gap: 10px; background: #387dc5; color: #fff; padding: 9px 12px; font-weight: 600; }
.gxback { font-size: 1.3rem; line-height: 1; opacity: .8; }
.gxpath { font-size: .74rem; color: #5b6b80; padding: 5px 12px; background: #eef3fa; border-bottom: 1px solid #dde5f0; }
.gxmenu ul { list-style: none; margin: 0; padding: 0; }
.gxmenu li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #eef1f5; }
.gxmenu li:last-child { border-bottom: 0; }
.gxmenu li b { color: #387dc5; font-weight: 600; text-align: right; }
.gxmenu li i { font-style: normal; color: #8a96a8; font-size: 1.1rem; line-height: 1; }
.gxmenu li.hl { background: #fff4d6; box-shadow: inset 3px 0 0 #f29b16; }
.gxnote { font-size: .72rem; color: #8a96a8; padding: 5px 12px; background: #f7f9fc; border-top: 1px solid #eef1f5; }

/* Батерия */
.batcard { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 14px; }
.batcard-h { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--primary-soft); color: var(--primary); }
.batcard-h div { display: grid; }
.batcard-h b { color: var(--text); }
.batcard-h span { font-size: .85rem; color: var(--muted); }
.volts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.volts div { background: var(--card); padding: 12px 14px; display: grid; gap: 2px; }
.volts span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.volts b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.volts b.sm { font-size: .9rem; font-weight: 600; }
.batdl { margin: 0; padding: 14px 16px; display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: .92rem; }
.batdl dt { color: var(--muted); font-weight: 600; }
.batdl dd { margin: 0; }

/* Схема */
.diagram { margin: 6px 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-2); overflow-x: auto; cursor: zoom-in; }
.diagram svg { display: block; width: 100%; min-width: 600px; height: auto; }
.dg-box rect { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
.dg-inv rect { stroke: var(--primary); stroke-width: 2; }
.dg-cerbo rect { fill: var(--primary-soft); stroke: var(--primary); stroke-width: 2; }
.dg-bat rect { fill: color-mix(in srgb, var(--ok) 12%, var(--card)); stroke: var(--ok); }
.dg-acc rect { stroke: var(--accent); stroke-width: 1.6; }
.dg-pv rect { fill: color-mix(in srgb, var(--pv) 10%, var(--card)); stroke: var(--pv); }
.dg-t { fill: var(--text); font: 600 15px var(--font); text-anchor: middle; }
.dg-s { fill: var(--muted); font: 12px var(--font); text-anchor: middle; }
.dg-l { fill: var(--muted); font: 600 12px var(--font); }
.dg-lc { fill: var(--com); }
.dg-small { font-size: 10px; }
.diagram polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.dg-halo { stroke: var(--card-2); stroke-width: 10; }
.dg-dcp { stroke: var(--dc-p); stroke-width: 4; }
.dg-dcn { stroke: var(--dc-n); stroke-width: 4; }
.dg-rail { stroke-width: 7; }
.dg-ac { stroke: var(--ac); stroke-width: 3; }
.dg-com { stroke: var(--com); stroke-width: 2.5; stroke-dasharray: 7 4; }
.dg-pvl { stroke: var(--pv); stroke-width: 3; }
.dg-ac-dot { fill: var(--ac); } .dg-dcp-dot { fill: var(--dc-p); } .dg-dcn-dot { fill: var(--dc-n); }
.dg-fuse rect { fill: var(--card); stroke: var(--dc-p); stroke-width: 2.5; }
.dg-term rect { fill: var(--com); }
.dg-term text { fill: #fff; font: 700 12px var(--font); text-anchor: middle; }

/* Снимки */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.gallery figure, .inline-fig { margin: 0; }
.inline-fig { margin: 14px 0; max-width: 560px; }
.gallery img, .inline-fig img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; background: var(--card-2); cursor: zoom-in; }
.gallery { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery img { aspect-ratio: 16 / 10; object-fit: contain; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: 5px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 10, 20, .88); display: grid; place-items: center; padding: 20px; }
.lb-body { max-width: 96vw; max-height: 90vh; overflow: auto; }
.lb-body img { max-width: 96vw; max-height: 88vh; display: block; border-radius: 8px; }
.lb-body .diagram { background: var(--card); cursor: default; }
.lb-body .diagram svg { min-width: 1100px; }
.lb-close { position: fixed; top: 14px; right: 18px; font-size: 2rem; background: transparent; color: #fff; border: 0; cursor: pointer; line-height: 1; }

.done-toggle { display: inline-flex; gap: 10px; align-items: center; margin-top: 22px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; }
.done-toggle input { width: 22px; height: 22px; accent-color: var(--ok); }
.done-toggle:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.stepnav { display: flex; justify-content: space-between; gap: 12px; }
.stepnav form:last-child { margin-left: auto; }
.notes summary { cursor: pointer; font-weight: 600; }
.notes form { margin-top: 12px; display: grid; gap: 10px; }
.finish { text-align: center; padding: 40px 20px; }
.finish-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2.2rem; display: grid; place-items: center; margin: 0 auto 16px; }
.only-mobile { display: none; }

/* Админ */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { text-decoration: none; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.admin-nav a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat b { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--card-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
td .mono, .mono { font-family: ui-monospace, Consolas, monospace; }
tr.off td { opacity: .5; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.toolbar .fld { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cond { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.cond legend { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 0 4px; }
.cond label { display: inline-flex; gap: 6px; align-items: center; margin: 3px 14px 3px 0; font-size: .9rem; }
.help { background: var(--card-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; font-size: .85rem; color: var(--muted); }
.help code { font-size: .8rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.thumb { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.codebox { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .06em; }
.preview { border-left: 3px solid var(--primary); padding-left: 14px; }

@media (max-width: 900px) {
  .login, .hero-start { grid-template-columns: 1fr; }
  .login-card { justify-self: stretch; max-width: none; }
  .wizard { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(340px, 88vw); max-height: none; z-index: 50; border-radius: 0; transform: translateX(-105%); transition: transform .25s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .only-mobile { display: inline-flex; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stepnav { position: sticky; bottom: 0; z-index: 5; padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 75%, transparent); }
}
.volts div { align-content: start; }
@media (max-width: 560px) {
  h1, .q-title { font-size: 1.4rem; }
  .step { padding: 18px 16px; }
  .step-h h1 { font-size: 1.3rem; }
  .volts { grid-template-columns: repeat(2, 1fr); }
  .batdl { grid-template-columns: 1fr; gap: 2px 0; }
  .batdl dd { margin-bottom: 8px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand-t { white-space: nowrap; }
  .brand-t span, .who { display: none; }
  .topnav { gap: 2px; }
  .topnav > a { padding: 6px 7px; font-size: .85rem; }
  .logo { width: 30px; height: 30px; }
  .stepnav .btn.lg { padding: 13px 16px; }
  .tiles { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .side, .stepnav, .notes, .foot, .stage-top, .done-toggle { display: none !important; }
  .wizard { display: block; }
  .card { box-shadow: none; border: 0; }
}
