:root {
  --bg: #F2F4F6; --surface: #FFFFFF; --sunk: #E9EDF0; --ink: #16202B; --muted: #5A6774; --line: #D3DAE0;
  --accent: #A85F00; --lamp: #F2A20C; --lamp-ink: #1B1300;
  --good: #1D7A4C; --warn: #9A5B00; --crit: #B3261E;
  --f-head: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10151B; --surface: #18202A; --sunk: #212B36; --ink: #E6EBF0; --muted: #94A1AE; --line: #2D3945;
  --accent: #F5B13D; --lamp: #F2A20C; --lamp-ink: #1B1300;
  --good: #5CC38D; --warn: #F0A848; --crit: #F2857D; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #10151B; --surface: #18202A; --sunk: #212B36; --ink: #E6EBF0; --muted: #94A1AE; --line: #2D3945;
  --accent: #F5B13D; --lamp: #F2A20C; --lamp-ink: #1B1300;
  --good: #5CC38D; --warn: #F0A848; --crit: #F2857D; color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45 }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; margin: 0; text-wrap: balance }
h1 { font-size: 19px; letter-spacing: .01em }
h2 { font-size: 22px }
h3 { font-size: 16px }
p { margin: 0 }
.mono { font-family: var(--f-mono); font-size: 12.5px }
.muted { color: var(--muted) }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }

.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line) }
.bar-in { max-width: 1440px; margin: 0 auto; padding: 10px 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px }
.brand { display: flex; align-items: center; gap: 9px; padding-bottom: 10px }
.brand i { width: 10px; height: 18px; border-radius: 2px; background: var(--lamp); display: block }
.tabs { display: flex; gap: 2px; overflow-x: auto; min-width: 0 }
.tabs a { padding: 8px 12px 10px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lamp) }
.tabs a:hover { color: var(--ink) }
.tabs .count { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); margin-left: 4px }

main { max-width: 1440px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 56px; display: flex; flex-direction: column; gap: 16px }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 16px }
.head p { max-width: 68ch; color: var(--muted); margin-top: 4px }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0 }
.panel > h3 + p { margin-top: -8px }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px }
.grow { flex: 1 1 auto; min-width: 0 }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px }
@media (max-width: 800px) { .two { grid-template-columns: minmax(0, 1fr) } }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0 }
input, select, textarea, button { font: inherit; color: inherit }
input[type=text], input[type=number], input[type=search], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; width: 100%; min-width: 0; color: var(--ink) }
textarea { resize: vertical; min-height: 60px }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px }
button, .btn { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 7px 12px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap }
button:hover, .btn:hover { border-color: var(--muted) }
button.primary { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink) }
button.danger { color: var(--crit) }
button.small { padding: 3px 8px; font-size: 12.5px }
button:disabled { opacity: .5; cursor: default }
button.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500 }

.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px }
table { border-collapse: collapse; width: 100%; font-size: 13px }
th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--sunk); padding: 7px 9px; white-space: nowrap }
td { padding: 7px 9px; border-top: 1px solid var(--line); vertical-align: top }
td.wrap { min-width: 180px }
tr.click { cursor: pointer }
tr.click:hover td { background: var(--sunk) }
td input[type=text], td input[type=number], td select { padding: 4px 6px; font-size: 12.5px }
td input.mono { font-family: var(--f-mono) }
td input[data-price], td input[data-reprice], td input[data-pcrate] { width: 110px; text-align: right }
.w-s { width: 64px } .w-m { min-width: 96px } .w-l { min-width: 170px }

.chip { display: inline-block; font-family: var(--f-mono); font-size: 11.5px; padding: 1px 6px; border-radius: 3px; background: var(--sunk); color: var(--ink); white-space: nowrap }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap }
.pill.good { color: var(--good) } .pill.warn { color: var(--warn) } .pill.crit { color: var(--crit) } .pill.plain { color: var(--muted) }
.note { border-left: 3px solid var(--lamp); background: var(--sunk); padding: 9px 12px; border-radius: 0 4px 4px 0 }
.note.crit { border-left-color: var(--crit) }
.empty { border: 1px dashed var(--line); border-radius: 6px; padding: 28px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center }
.empty b { color: var(--ink); font-family: var(--f-head); font-size: 17px; font-weight: 600 }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px }
.stat b { display: block; font-family: var(--f-head); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums }
.stat span { font-size: 12px; color: var(--muted) }
.drop { border: 1.5px dashed var(--line); border-radius: 6px; padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; color: var(--muted) }
.drop.over { border-color: var(--lamp); background: var(--sunk) }
.shot { max-height: 420px; width: 100%; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px }
.bars { display: flex; flex-direction: column; gap: 6px }
.bars div { display: grid; grid-template-columns: 110px minmax(0, 1fr) 150px; font-size: 12.5px; gap: 8px; align-items: center }
.bars i.over { background: var(--crit) }
.bars u { display: block; background: var(--sunk); border-radius: 2px; text-decoration: none }
tr.pick td { background: var(--sunk) } .rtabs { display: flex; gap: 4px; overflow-x: auto; position: sticky; top: 52px; z-index: 4; background: var(--bg); padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 4px }
.rtabs button { border: 1px solid transparent; background: none; color: var(--muted); padding: 6px 12px; border-radius: 4px } .rtabs button.on { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: inset 0 -2px 0 var(--lamp) }
.rsum { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; font-size: 13px } .rsum .link { font-size: 13px }
table.stress td { vertical-align: top } table.stress .pc { font-size: 11.5px; color: var(--muted) } table.stress tr.grp td { background: var(--sunk); font-weight: 600 }
table.mini { width: 100%; border-collapse: collapse; font-size: 12.5px } table.mini td { border: 0; padding: 1px 0 1px 10px; text-align: right; white-space: nowrap } table.mini td:first-child { text-align: left; padding-left: 0; white-space: normal } table.mini tr.sum td { border-top: 1px solid var(--line); padding-top: 4px }
th.sec, td.sec { background: var(--sunk); font-size: 12.5px }
.bars i { display: block; height: 8px; border-radius: 2px; background: var(--lamp); min-width: 2px }
.slot { display: flex; flex-direction: column; gap: 8px }
.pcard { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); display: flex; flex-direction: column; min-width: 0 }
.pcard > header { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 6px 6px 0 0; flex-wrap: wrap }
.pcard > header > div:first-child { flex: 1 1 320px; min-width: 0 }
.psec { padding: 12px 12px 0; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted) } .psec + .bgrid { padding-top: 8px }
.pcard h4 { font-family: var(--f-head); font-size: 18px; font-weight: 600 }
.pcard .ptot { text-align: right } .pcard .ptot b { display: block; font-family: var(--f-head); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums } .pcard .ptot span { font-size: 12px; color: var(--muted) }
.pmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 2px }
.pheat { display: inline-flex; align-items: center; gap: 6px } .pheat u { display: inline-block; width: 70px; height: 7px; background: var(--sunk); border-radius: 2px; text-decoration: none; overflow: hidden } .pheat i { display: block; height: 100%; background: var(--lamp) } .pheat i.over { background: var(--crit) }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; padding: 12px }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0 }
.bcard.led { border-left: 3px solid var(--lamp) } .bcard.bare { border-style: dashed }
.bcard .bh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline }
.bcard .bslot { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600 }
.bcard .bcost { font-family: var(--f-head); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap }
.bcard .bfor { font-size: 12px; color: var(--muted) }
.bcard .bwhy { font-size: 12.5px; line-height: 1.45; color: var(--ink); opacity: .85 }
.lgrid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)) } .ltab table { font-size: 12px } .ltab td, .ltab th { padding: 5px 7px } .ltab td:first-child .mono { word-break: break-all }
@media (max-width: 400px) { .lgrid { grid-template-columns: 1fr } }
.nlist { display: flex; flex-direction: column; gap: 8px; padding: 12px; font-size: 12.5px }
.nlist div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px }
@media (max-width: 560px) { .nlist div { grid-template-columns: 1fr } .pcard .ptot { text-align: left } }
.slot h3 span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-right: 6px; font-weight: 400 }
.fcard { border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 10px }
@media (max-width: 480px) { .fcard label.f { grid-column: auto !important } }
.fcard .tick { flex-direction: row; align-items: center; gap: 6px; align-self: end; padding-bottom: 7px; color: var(--ink) }
.bd { display: block; min-width: 860px; width: 100% }
.bd text { font-family: var(--f-body); font-size: 11px; fill: var(--ink) }
.bd .t { font-weight: 600 } .bd .s { fill: var(--muted); font-size: 10px } .bd .m { font-family: var(--f-mono); font-size: 10px }
.bd rect { fill: var(--surface); stroke: var(--muted) } .bd rect.cust { fill: var(--bg); fill-opacity: .72; stroke: var(--muted); stroke-dasharray: 5 4 } .bd .cust-t { fill: var(--muted); letter-spacing: .06em; font-size: 11px } .bd rect.drv { stroke: var(--lamp); stroke-width: 2 } .bd rect.lane { fill: var(--sunk); stroke: none }
.bd path, .bd line { stroke: var(--muted); fill: none } .bd .dash { stroke-dasharray: 4 3 } .bd .sig { stroke: var(--accent); stroke-dasharray: 4 3 } .bd .sigh { fill: var(--accent) } .bd rect.sigb { stroke: var(--accent) } .bd .node { fill: var(--muted) } .bd .led { fill: var(--lamp); stroke: var(--ink); stroke-width: .8 } .bd .ledk { stroke: var(--ink); stroke-width: 1.4 } .bd .ray { stroke: var(--lamp); stroke-width: 1.2 } .bd rect.gap { fill: var(--surface); stroke: none }
.bd rect.pcb { fill: none; stroke-width: 1.4; stroke-dasharray: 2 3 } .bd .pl { font-size: 10px; font-weight: 600; letter-spacing: .04em }
.bd .p0 { stroke: #2F7BBF } .bd text.p0 { fill: #2F7BBF; stroke: none } .bd .p1 { stroke: #7A5BD0 } .bd text.p1 { fill: #7A5BD0; stroke: none } .bd .p2 { stroke: #1D8A6E } .bd text.p2 { fill: #1D8A6E; stroke: none }
.bd .p3 { stroke: #C2562E } .bd text.p3 { fill: #C2562E; stroke: none } .bd .p4 { stroke: #B0388A } .bd text.p4 { fill: #B0388A; stroke: none } .bd .p5 { stroke: #6B7A12 } .bd text.p5 { fill: #6B7A12; stroke: none }
.bd rect.conn { fill: var(--ink); stroke: none } .bd .cl { font-size: 9px; font-weight: 600; fill: var(--ink) }
.pmeta .conn { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink); background: var(--sunk); border-radius: 3px; padding: 0 5px }
.wd text { fill: var(--ink); font-size: 11px } .wd .s { fill: var(--muted); font-size: 10px } .wd .t { font-weight: 600 } .wd rect.node { fill: var(--surface); stroke: var(--muted) } .wd rect.veh { fill: var(--sunk); stroke: var(--muted); stroke-dasharray: 4 3 }
.wd rect.cbox { fill: var(--surface); stroke: var(--ink) } .wd rect.chd { fill: var(--sunk); stroke: var(--ink) } .wd path, .wd line { stroke: var(--muted); fill: none } .wd .w-pwr { stroke: #C2562E; stroke-width: 2 } .wd .w-gnd { stroke: var(--ink); stroke-width: 2 } .wd .w-led { stroke: var(--lamp); stroke-width: 1.8 } .wd .w-sig { stroke: #2F7BBF; stroke-width: 1.2 } .wd .w-bus { stroke: #7A5BD0; stroke-width: 1.4; stroke-dasharray: 5 3 }
.wd .k-pwr { fill: #C2562E } .wd .k-gnd { fill: var(--ink) } .wd .k-led { fill: var(--lamp) } .wd .k-sig { fill: #2F7BBF } .wd .k-bus { fill: #7A5BD0 } .bd circle { fill: var(--lamp); stroke: none } .bd .ah { fill: var(--muted); stroke: none }
.lims { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px }
.lims li::marker { color: var(--accent) }
.shotlink { font-size: 12.5px; color: var(--accent); font-weight: 500 }
.sch { width: 100%; max-height: none; background: #fff }
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px }
.cgrid input { font-variant-numeric: tabular-nums }
details.adv summary { cursor: pointer; font-weight: 500; color: var(--accent); font-size: 13px }
details.adv[open] summary { margin-bottom: 10px }
.ck { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none }
.ck li { display: flex; gap: 8px; align-items: baseline; font-size: 13px }
table.calc td.num, table.calc th.num { min-width: 92px }
table.calc td.sec { font-weight: 600; color: var(--muted); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase }
tr.tot td { border-top: 2px solid var(--line); font-weight: 600 }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--lamp); border-radius: 50%; animation: sp 1s linear infinite; flex: none }
@keyframes sp { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none } }
.lcats { display: flex; flex-direction: column; gap: 10px }
.lgrp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px }
.lgl { width: 130px; flex: none; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
@media (max-width: 560px) { .lgl { width: 100% } }
button.lc { padding: 4px 10px; font-size: 13px; border-radius: 99px; background: var(--surface) }
button.lc span { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted) }
button.lc.on { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink) } button.lc.on span { color: var(--lamp-ink) }
.lflags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
button.lflag { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 12px; min-width: 120px; white-space: normal; text-align: left }
button.lflag b { font-family: var(--f-head); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums } button.lflag span { font-size: 12px; color: var(--muted) }
button.lflag.on { border-color: var(--lamp); box-shadow: inset 0 0 0 1px var(--lamp) }
button.lsort { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer }
table.ltbl td { white-space: nowrap } table.ltbl td.lsd { white-space: normal; min-width: 220px; font-size: 12.5px }
tr.libx > td { background: var(--bg); padding: 12px }
.libd { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 22px; white-space: normal }
.libd h4 { font-family: var(--f-head); font-size: 14px; font-weight: 600; margin: 0 0 6px } .libd h4 + * { margin-bottom: 10px } .libd > div { min-width: 0; display: flex; flex-direction: column }
.libd .lsrc { font-size: 12px; margin-top: 6px; word-break: break-word }
.lsrc2 { font-family: var(--f-body); font-size: 11px; color: var(--muted); white-space: nowrap }
td.lq { font-size: 12px; min-width: 130px; white-space: normal }
.libd .lsrc a { color: var(--accent) }
.lul { margin: 0 0 10px; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px }
#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 4px; max-width: calc(100% - 32px); z-index: 9 }
/* parts app additions */
body { margin: 0 }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-bottom: 10px; font-size: 13px }
.who .chip { font-family: var(--f-body) }
.auth { max-width: 420px; margin: 40px auto 0; width: 100% }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px }
.fgrid .wide { grid-column: 1 / -1 }
label.f .err { color: var(--crit); font-weight: 500 }
label.f.bad input, label.f.bad select, label.f.bad textarea { border-color: var(--crit) }
label.tick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink) }
.ticks { display: flex; flex-wrap: wrap; gap: 6px 16px }
.crumb { font-size: 13px } .crumb a { color: var(--accent); text-decoration: none; font-weight: 500 }
.phead { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; justify-content: space-between }
.phead h2 { font-family: var(--f-mono); font-size: 20px; font-weight: 500; word-break: break-all }
.pills { display: flex; flex-wrap: wrap; gap: 6px }
.price-now b { font-family: var(--f-head); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums }
.keybox { font-family: var(--f-mono); font-size: 13px; background: var(--sunk); padding: 10px 12px; border-radius: 4px; word-break: break-all; user-select: all }
.hist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px }
.hist li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px } .hist li span:first-child { color: var(--muted) }
@media (max-width: 560px) { .hist li { grid-template-columns: 1fr } }
pre.code { font-family: var(--f-mono); font-size: 12px; background: var(--sunk); padding: 10px 12px; border-radius: 4px; overflow-x: auto; margin: 0; white-space: pre }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px } @media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr) } }
td.act { white-space: nowrap; text-align: right }
tr.off td { color: var(--muted) }
.res-ok { border-left: 3px solid var(--good) } .res-no { border-left: 3px solid var(--crit) }
input[type=password], input[type=date], input[type=file] { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; width: 100%; min-width: 0; color: var(--ink) }
input[type=file] { padding: 5px }
a.btn { color: var(--ink) }
.who a { color: var(--ink); text-decoration: none; font-weight: 500 } .who a:hover { text-decoration: underline }
td a { color: var(--accent) }
.libd table.mini td { white-space: normal; overflow-wrap: anywhere } .libd table.mini td:last-child { padding-left: 12px }
details summary { cursor: pointer }
.libd table.mini td:first-child { overflow-wrap: normal; word-break: normal; white-space: nowrap; padding-right: 8px }
td.mono { white-space: nowrap }
/* blocks app */
.sch { width: 100%; max-height: 640px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; display: block }
.slotgrp { display: flex; flex-direction: column; gap: 8px }
.slotgrp h3 span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-right: 6px; font-weight: 400 }
table.bom td input { width: 100%; min-width: 60px }
table.bom td.q input { width: 56px }
.revs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }
.rowlist { display: flex; flex-direction: column; gap: 6px }
.rowlist .r { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 80px 32px; gap: 6px }
@media (max-width: 640px) { .rowlist .r { grid-template-columns: 1fr } }
td.kp { white-space: normal; min-width: 120px; max-width: 240px; font-size: 12px; overflow-wrap: anywhere }
td.cn { min-width: 200px }

details.cons > summary { cursor: pointer; font-weight: 500; color: var(--accent); font-size: 13px }
.md { display: flex; flex-direction: column; gap: 8px; max-width: 96ch; font-size: 13.5px; margin-top: 10px }
.md h3, .md h4, .md h5, .md h6 { margin: 14px 0 0; font-family: var(--f-head) } .md h3 { font-size: 18px } .md h4 { font-size: 15.5px } .md h5 { font-size: 14px } .md h6 { font-size: 13px }
.md ul, .md ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px } .md code { font-family: var(--f-mono); font-size: 12px; background: var(--sunk); padding: 0 3px; border-radius: 3px }
.md pre { background: var(--sunk); padding: 10px 12px; border-radius: 4px; overflow-x: auto; margin: 0 } .md pre code { background: none; padding: 0 } .md table { font-size: 12.5px } .md td { vertical-align: top }
/* collapsible panels (collapse.js) */
.pc-head { cursor: pointer; user-select: none }
.pc-tog { margin-left: auto; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; cursor: pointer; flex: none; position: relative }
.pc-tog::before { content: ""; position: absolute; left: 9px; top: 7px; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s }
.pc .pc-tog::before { transform: rotate(-45deg); left: 7px; top: 9px }
h2.pc-head, h3.pc-head { display: flex; align-items: center; gap: 8px }
.panel.pc > :not(:first-child) { display: none }
.pcard.pc > :not(header) { display: none }
.pc-bar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 8px }
@media print { .pc-tog, .pc-bar { display: none } .panel.pc > *, .pcard.pc > * { display: revert } }

/* Design help tab (design-help.css): use this app's colours in both themes */
#view .dh { --dh-accent: var(--accent); --dh-line: var(--line); --dh-soft: var(--sunk); --dh-good: var(--good); --dh-warn: var(--warn); --dh-bad: var(--crit);
  --dh-c1: var(--accent); --dh-c2: var(--crit); --dh-c3: var(--good); --dh-wire: var(--ink) }
#view .dh .dh-nb.dh-act { background: var(--lamp); color: var(--lamp-ink) }
#view .dh .dh-card, #view .dh .dh-lib { background: var(--surface) }
#view .dh .dh-part b { font-family: var(--f-mono); font-size: 12.5px }
#view .dh h3 { font-size: 19px }

/* Design validation tests (dv-ui.js) */
.dv-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted) }
.dv-meta b { color: var(--ink); font-weight: 600; margin-right: 4px }
.panel h4 { font-family: var(--f-head); font-size: 13.5px; font-weight: 600; margin: 4px 0 6px; color: var(--accent) }
.dv-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; max-width: 90ch }
.dv-steps li::marker { color: var(--accent); font-family: var(--f-mono); font-size: 12px }
td.dv-in { min-width: 130px; width: 160px }
td.dv-in input, td.dv-in select { padding: 4px 6px; font-size: 13px; font-family: var(--f-mono) }
table.dv-res td { vertical-align: middle }
details.adv > div, details.adv > p { margin-top: 8px }
@media (max-width: 640px) {
  table.dv-res thead { display: none }
  table.dv-res tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 9px 2px; border-top: 1px solid var(--line) }
  table.dv-res td { border: 0; padding: 0 }
  table.dv-res td:nth-child(1) { grid-column: 1 / -1; font-weight: 600 }
  table.dv-res td:nth-child(2), table.dv-res td:nth-child(3) { grid-column: 1 / -1; font-size: 12.5px }
  table.dv-res td.dv-in { width: auto; min-width: 0 }
  table.dv-res td:last-child { align-self: center }
}

/* ---------- circuit page 1.18.0: schematic on top, tabs, design steps ---------- */
.cp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; scroll-margin-top: 70px }
.cp-sch img.sch { max-height: 420px; object-fit: contain }
.cp-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px }
.cp-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0 }
.cp-tile span, .cp-tile small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere }
.cp-tile b { font-family: var(--f-head); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums }
.cp-tile.good { border-left: 3px solid var(--good) } .cp-tile.warn { border-left: 3px solid var(--warn) } .cp-tile.crit { border-left: 3px solid var(--crit) }
.cp-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 4; background: var(--bg); padding-top: 4px }
.cp-tabs button { border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; background: transparent; padding: 10px 14px; color: var(--muted); font-size: 14px; min-height: 42px }
.cp-tabs button[aria-current="page"] { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: inset 0 3px 0 var(--lamp); margin-bottom: -1px }
.cp-tabs button:hover { color: var(--ink) }
.cp-badge { font-size: 11.5px; font-family: var(--f-mono); padding: 0 7px; border-radius: 99px; background: var(--sunk); color: var(--muted); font-weight: 500 }
.cp-badge.hot { background: #FFE2B0; color: #6B3C00 }
.cp-body { display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.cp-steps { display: flex; flex-wrap: wrap; gap: 6px }
.cp-steps a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; min-height: 32px }
.cp-steps a:hover { border-color: var(--muted) }
.cp-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 99px; background: var(--ink); color: var(--surface); font-size: 12px; font-family: var(--f-body); font-weight: 600; margin-right: 8px; flex: none }
.cp-steps .cp-n { margin-right: 0 }
.cp-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; align-self: flex-start }
.cp-seg button { border: 0; border-radius: 0; padding: 9px 14px; min-height: 40px }
.cp-seg button + button { border-left: 1px solid var(--line) }
.cp-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface) }
.pills button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink) }
.cp-chg { border-color: var(--lamp) }
.cp-impact { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; background: var(--sunk); border-left: 3px solid var(--lamp); padding: 9px 12px; border-radius: 0 4px 4px 0 }
tr.cp-ch td { background: color-mix(in srgb, var(--lamp) 12%, var(--surface)) }
td.cp-cell { background: color-mix(in srgb, var(--lamp) 18%, var(--surface)); font-weight: 600 }
.cp-was { font-size: 11.5px; color: var(--accent); font-weight: 400 }
.cp-bar { position: relative; height: 8px; background: var(--sunk); border-radius: 4px; min-width: 110px; margin: 4px 0 3px }
.cp-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--good) }
.cp-bar i.warn { background: var(--warn) } .cp-bar i.fail { background: var(--crit) }
.cp-bar s { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); text-decoration: none }
.cp-tgrid { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 14px; align-items: start }
.cp-tlist { display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.cp-test.cp-hot { border-color: var(--lamp); box-shadow: inset 4px 0 0 var(--lamp) }
.cp-fmea td { font-size: 12.5px }
.cp-tc summary { font-weight: 600 }
@media (max-width: 860px) { .cp-tgrid { grid-template-columns: minmax(0, 1fr) } .cp-tabs { top: 0 } }
/* 1.18.0: calculation steps wrap inside the card; LED values live in step 1 only */
table.cp-calc td { white-space: normal }
table.cp-calc td:nth-child(3) { min-width: 170px; max-width: 260px }
table.cp-calc td:nth-child(4), table.cp-calc td:nth-child(5) { max-width: 300px; overflow-wrap: anywhere; word-break: break-word }
table.cp-calc td:nth-child(6) { min-width: 130px; max-width: 240px }
.cp-hasled label:has(> [data-bbc="nLed"]), .cp-hasled label:has(> [data-bbc="nCh"]), .cp-hasled label:has(> [data-bbc="iMa"]),
.cp-hasled label:has(> [data-bbc="vfMin"]), .cp-hasled label:has(> [data-bbc="vfTyp"]), .cp-hasled label:has(> [data-bbc="vfMax"]) { display: none !important }
/* 1.18.0 Design change tab: inputs on the left (stays in view), checks and results on the right */
.cp-design { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start }
.cp-in { flex: 1 1 340px; max-width: 440px; position: sticky; top: 112px; max-height: calc(100vh - 124px); overflow-y: auto; gap: 14px }
.cp-out { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px }
@media (max-width: 960px) { .cp-in { position: static; max-height: none; max-width: none } }
.cp-step { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px }
.cp-step > h3 { margin: 0; display: flex; align-items: center; font-size: 15px }
.cp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px }
.cp-grid3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) }
.cp-grid .cp-span { grid-column: 1 / -1 }
.cp-grid { align-items: end }
.cp-chf input, .cp-chf select { border-color: var(--accent) !important; background: color-mix(in srgb, var(--lamp) 10%, var(--surface)) !important }
small.cp-was { font-size: 11.5px; color: var(--warn); min-height: 1em; font-weight: 500 }
.cp-sub { margin: 4px 0 0; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em }
details.cp-adv { border-top: 1px solid var(--line); padding-top: 8px }
details.cp-adv > summary { cursor: pointer; font-weight: 600; padding: 4px 0; min-height: 28px }
details.cp-adv[open] > summary { margin-bottom: 8px }
.cp-cks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px }
.cp-ck { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 6px }
.cp-ck > span:nth-child(2) { flex: 1 }
.cp-ck .pill { flex: none; min-width: 52px; justify-content: center }
.cp-ckh { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px }
.cp-chb { display: flex; flex-direction: column; gap: 6px; border-left: 3px solid var(--line); padding-left: 10px }
.cp-chh { margin: 0 }
.cp-chp { font-size: 10.5px; padding: 0 5px; margin-right: 2px }
.cp-chn { text-transform: none; letter-spacing: 0; font-weight: 400 }
.cp-adv .cp-chb { margin-top: 8px }
.sx-cht td:first-child { white-space: normal }
.cp-ck.good { background: color-mix(in srgb, var(--good) 8%, var(--surface)) }
.cp-ck.warn { background: color-mix(in srgb, var(--warn) 9%, var(--surface)) }
.cp-ck.crit { background: color-mix(in srgb, var(--crit) 8%, var(--surface)) }
.cp-lp { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: var(--bg) }
.cp-lp p { margin: 0 0 6px }
table.cp-lpt { width: 100%; font-size: 12.5px; margin-bottom: 6px }
.cp-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--lamp) 10%, var(--surface)); border-radius: 6px }
.cp-steps button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); font-size: 13px; min-height: 32px; font-weight: 500 }
.cp-steps button:hover { border-color: var(--muted) }
#cp-checks h4, #cp-step4 h4, #cp-parts h4 { margin: 6px 0 0 }
.cp-step { scroll-margin-top: 70px }
table.cp-lpt { table-layout: fixed; border-collapse: collapse }
table.cp-lpt th, table.cp-lpt td { padding: 4px 6px; white-space: normal; font-size: 12.5px }
table.cp-lpt th:first-child, table.cp-lpt td:first-child { width: 42% }
table.cp-stress td { white-space: normal }
table.cp-stress td:nth-child(2) { min-width: 180px }
table.cp-stress td:nth-child(4) .muted { font-family: var(--f-body); font-size: 11.5px }

/* 1.18.4: alternates pop-up */
.alt-modal{position:fixed;inset:0;background:rgba(15,20,30,.45);display:flex;align-items:flex-start;justify-content:center;z-index:50;padding:6vh 16px;overflow:auto}
.alt-box{max-width:900px;width:100%;box-shadow:0 12px 40px rgba(0,0,0,.25)}
ul.tight { margin: 0; padding-left: 1.1em } ul.tight li { margin: 0 0 2px }
.cp-fusa td, .cp-mtbf td { vertical-align: top }
