/* PLCZero. Palette from the Blue Ridge at first light: valley haze, three ridge blues,
   plus the pilot-light colors every panel already uses. Type: Barlow, the family that
   reads like an engraved nameplate. */
:root {
  --haze: #E8EDF1;
  --mist: #F5F7F9;
  --far: #B9C8D6;
  --mid: #6F8FAE;
  --ridge: #2E4B69;
  --deep: #1C3047;
  --ink: #17212B;
  --ink-2: #4B5967;
  --steel: #7C8995;
  --line: #C9D3DC;
  --run: #1F9D57;
  --run-soft: rgba(31, 157, 87, 0.16);
  --stop: #C8372D;
  --amber: #C98512;
  --wire: #9AA7B3;
  --radius: 6px;
  --f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Barlow', 'Segoe UI', sans-serif;
  --f-tag: 'Barlow Semi Condensed', 'Barlow', sans-serif;
  --f-code: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--haze); color: var(--ink); font: 17px/1.55 var(--f-body); }
a { color: var(--ridge); text-underline-offset: 3px; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--mid); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.05; margin: 0 0 0.4em; letter-spacing: 0.005em; }
h1 { font-size: clamp(42px, 6.2vw, 76px); }
h2 { font-size: clamp(30px, 3.6vw, 44px); }
h3 { font-size: 24px; }
p { margin: 0 0 1em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* nameplate logo: engraved black lamacoid tag with two screws */
.plate { display: inline-flex; align-items: center; gap: 10px; background: #14191F; color: #F2F4F6; padding: 6px 14px; border-radius: 3px;
  font: 600 22px/1 var(--f-display); letter-spacing: 0.06em; text-decoration: none; box-shadow: inset 0 0 0 1px #2B333C; }
.plate::before, .plate::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c8ced4, #6b737b); }
.plate:hover { color: #fff; }
.plate .z { color: var(--far); }

.btn-p, .btn-s { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: var(--radius);
  font: 600 18px/1 var(--f-body); text-decoration: none; cursor: pointer; border: 2px solid var(--ridge); }
.btn-p { background: var(--ridge); color: #fff; }
.btn-p:hover { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn-s { background: transparent; color: var(--ridge); }
.btn-s:hover { background: rgba(46, 75, 105, 0.08); color: var(--deep); }
button { font: inherit; }

/* ---------- site header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.top .brand { display: flex; align-items: center; gap: 14px; }
.top .tagline { font: 500 17px var(--f-display); color: var(--ink-2); letter-spacing: 0.02em; }
.top nav { display: flex; gap: 22px; align-items: center; }
.top nav a { font-weight: 600; text-decoration: none; color: var(--ink); }
.top nav a:hover { color: var(--ridge); text-decoration: underline; }

/* ---------- landing ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #F3F6F8 0%, var(--haze) 58%, #DCE4EB 100%); }
.hero .hero-top { position: relative; z-index: 3; }
.hero .hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: center; padding-top: 36px; padding-bottom: 210px; }
.hero h1 { max-width: 11ch; color: var(--deep); }
.hero .lede { font-size: 20px; max-width: 46ch; color: var(--ink); }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.ridges { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 300px; z-index: 1; display: block; }
.live-panel { min-width: 0; background: var(--mist); border: 1px solid var(--line); border-radius: 10px; padding: 18px 18px 12px; box-shadow: 0 18px 40px -24px rgba(28, 48, 71, 0.55); }
.live-panel .cap { font-size: 15px; color: var(--ink-2); margin: 8px 2px 0; }
.live-panel .ldr { overflow-x: auto; margin-top: 4px; }

.band { padding: 72px 0; }
.band.dark { background: var(--deep); color: #E9EEF3; }
.band.dark a { color: #CFE0EF; }
.band.dark h2 { color: #fff; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 2px solid var(--ridge); }
.doors > div { padding: 30px 32px 30px 0; }
.doors > div + div { padding-left: 32px; border-left: 1px solid var(--line); }
.doors p { max-width: 48ch; }
.feat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 56px; margin-top: 28px; }
.feat h3 { margin-bottom: 0.25em; }
.feat p { color: var(--ink-2); max-width: 46ch; }
.labs-list { list-style: none; padding: 0; margin: 18px 0 8px; }
.labs-list li { display: grid; grid-template-columns: 210px 1fr auto; gap: 18px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.labs-list .lname { font: 600 22px var(--f-display); }
.shop { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.shop p { font-size: 19px; max-width: 52ch; }
.foot { padding: 40px 0 56px; font-size: 14.5px; color: var(--ink-2); border-top: 1px solid var(--line); }
.foot .row1 { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.foot .legal { max-width: 88ch; }

/* ---------- ladder ---------- */
.ladder { --wy: 38px; --hot: var(--run); font-family: var(--f-tag); color: var(--ink); min-width: max-content; padding: 4px 6px 4px 0; }
.rung { display: flex; align-items: stretch; }
.rnum { flex: 0 0 34px; text-align: right; padding: calc(var(--wy) - 6px) 8px 0 0; color: var(--steel); font: 600 14px var(--f-tag); cursor: pointer; }
.rbody { flex: 1 1 auto; border-left: 3px solid var(--ink-2); border-right: 3px solid var(--ink-2); padding: 4px 0 10px; min-width: 0; }
.ladder.live .rbody { border-left-color: var(--hot); }
.rung.rsel .rbody { background: rgba(111, 143, 174, 0.12); }
.rung.rsel .rnum { color: var(--ridge); }
.rcmt { font: 500 13.5px var(--f-body); color: var(--ink-2); padding: 0 10px 2px; }
.rline { display: flex; align-items: flex-start; min-height: 58px; }
.ser { display: flex; align-items: flex-start; flex: 1 1 auto; }
.row > .ser { flex: 1 1 auto; }
.fill { flex: 1 1 14px; min-width: 14px; height: 2px; margin-top: calc(var(--wy) - 1px); background: var(--wire); }
.stub { flex: 0 0 14px; height: 2px; margin-top: calc(var(--wy) - 1px); background: var(--wire); }
.el { flex: 0 0 auto; width: 104px; height: 68px; position: relative; cursor: pointer; border-radius: 4px; }
.el.wide { width: 132px; }
.el.o { width: 112px; }
.el.o.tm { width: 124px; height: 80px; }
.el .tag { position: absolute; top: 1px; left: 0; right: 0; text-align: center; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
.el .ln { position: absolute; left: 0; right: 0; top: calc(var(--wy) - 13px); height: 26px; display: flex; align-items: center; }
.el .w { flex: 1 1 auto; height: 2px; background: var(--wire); }
.el .op { position: absolute; left: 0; right: 0; top: calc(var(--wy) + 13px); text-align: center; font-size: 11px; color: var(--steel); letter-spacing: 0.04em; }
.el.o.tm .op { display: none; }
.sym { flex: 0 0 auto; display: grid; place-items: center; background: var(--mist); }
.sym.ct { width: 22px; height: 26px; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); position: relative; }
.sym.ct.nc::after { content: ''; position: absolute; left: -3px; right: -3px; top: 12px; height: 2px; background: var(--ink); transform: rotate(-56deg); }
.sym.box { border: 2px solid var(--ink); border-radius: 4px; font: 600 12px/1 var(--f-tag); padding: 0 7px; height: 26px; }
.sym.coil { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; border-left-color: var(--ink); border-right-color: var(--ink); font: 700 12px/1 var(--f-tag); }
.sym.blk { width: 92px; height: 46px; display: flex; flex-direction: column; justify-content: center; gap: 1px; font-size: 11.5px; line-height: 1.1; padding: 0; }
.sym.blk b { font-size: 12.5px; }
.sym.blk i { font-style: normal; color: var(--ink-2); }
.el.o.tm .tag { top: -3px; }
.el.true .sym.ct, .el.true .sym.coil { border-left-color: var(--hot); border-right-color: var(--hot); background: var(--run-soft); }
.el.true .sym.ct.nc::after { background: var(--hot); }
.el.true .sym.box { border-color: var(--hot); background: var(--run-soft); }
.on { background: var(--hot) !important; }
.par { display: flex; flex-direction: column; flex: 0 0 auto; border-radius: 4px; }
.row { display: flex; align-items: flex-start; position: relative; }
.row::before, .row::after { content: ''; position: absolute; width: 2px; background: var(--wire); top: 0; bottom: 0; }
.row::before { left: 0; }
.row::after { right: 0; }
.row:first-child::before, .row:first-child::after { top: calc(var(--wy) - 1px); }
.row:last-child::before, .row:last-child::after { bottom: auto; height: calc(var(--wy) + 1px); }
.row.vin::before, .row.vout::after { background: var(--hot); }
.el.sel, .par.sel { outline: 2px dashed var(--ridge); outline-offset: 1px; background: rgba(111, 143, 174, 0.14); }
.ladder .empty { padding: 18px 10px; color: var(--ink-2); }

/* ---------- machine art ---------- */
.mach { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; touch-action: none; }
.mach .lbl { font: 500 13px var(--f-body); fill: var(--ink); text-anchor: middle; }
.mach .lbl.left { text-anchor: start; }
.mach .lbl.small { font-size: 11.5px; fill: var(--ink-2); }
.mach .lbl.big { font: 600 28px var(--f-display); fill: var(--deep); }
.mach .lbl.mono { font-variant-numeric: tabular-nums; font-weight: 600; }
.mach .bad { fill: var(--stop) !important; }
.mach .plate-t { font: 600 15px var(--f-display); fill: #F2F4F6; text-anchor: middle; letter-spacing: 0.06em; }
.mach .door { fill: #2A3846; }
.mach .door + .plate-t { fill: #E8EDF1; }
.mach .btn { cursor: pointer; }
.mach .btn:focus-visible { outline: none; }
.mach .btn:focus-visible .ring, .mach .btn:focus-visible .cap { stroke: #fff; stroke-width: 3; }
.mach .ring { fill: #11171D; }
.mach .cap { stroke: rgba(0, 0, 0, 0.25); stroke-width: 1; transition: transform 60ms; transform-box: fill-box; transform-origin: center; }
.mach .cap.go { fill: #23A35E; }
.mach .cap.stop { fill: #D23A2F; }
.mach .cap.amber { fill: #D9921B; }
.mach .cap.pressed { transform: scale(0.86); filter: brightness(0.8); }
.mach .doorg .lbl { fill: #E8EDF1; }
.mach .doorg .lbl.small { fill: #B9C8D6; }
.mach.wide .lbl { font-size: 17px; }
.mach.wide .lbl.small { font-size: 14.5px; }
.mach.wide .lbl.strong { font: 600 20px var(--f-display); }
.mach .lamp { fill: #3B4652; stroke: #11171D; stroke-width: 2; }
.mach .lamp.lit { fill: #4BE08A; filter: drop-shadow(0 0 6px rgba(75, 224, 138, 0.9)); }
.mach .lamp.amber.lit { fill: #F5B73B; filter: drop-shadow(0 0 6px rgba(245, 183, 59, 0.9)); }
.mach .dev { fill: #F5F7F9; stroke: var(--steel); stroke-width: 1.5; }
.mach .armature { fill: var(--wire); transition: y 80ms; }
.mach .armature.in { fill: var(--run); }
.mach .chip { cursor: pointer; }
.mach .chip rect { fill: #DCE3EA; stroke: var(--steel); }
.mach .chip:hover rect { fill: #CBD6E0; }
.mach .chip text { font: 600 12px var(--f-body); fill: var(--ink); text-anchor: middle; }
.mach .wire3 { stroke: #2A3846; stroke-width: 3; fill: none; }
.mach .motor { fill: var(--ridge); }
.mach .fan-c { fill: #24394F; stroke: #9DB5CC; stroke-width: 2; }
.mach .blade { stroke: #E8EDF1; stroke-width: 5; stroke-linecap: round; fill: none; }
.mach .foot { fill: #1C2833; }
.mach .belt { fill: #26313B; }
.mach .belt-marks line { stroke: #53606B; stroke-width: 2; }
.mach .roller { fill: #5A6772; stroke: #26313B; stroke-width: 2; }
.mach .box { fill: #C99E6E; stroke: #8E6A43; stroke-width: 1.5; }
.mach .box.tall { fill: #B88454; }
.mach .box.stuck { stroke: var(--stop); stroke-width: 3; }
.mach .gate-slot { fill: #0F151B; }
.mach .flap { fill: #9AA7B3; }
.mach .chute { fill: none; stroke: var(--steel); stroke-width: 2.5; }
.mach .eye rect { fill: #26313B; }
.mach .beam { stroke: #9AA7B3; stroke-width: 2; stroke-dasharray: 3 3; }
.mach .beam.broken { stroke: var(--stop); stroke-dasharray: none; }
.mach .beam.dirty { opacity: 0.25; }
.mach .tank { fill: #F5F7F9; stroke: var(--steel); stroke-width: 2; }
.mach .water { fill: #6F9BC4; opacity: 0.9; }
.mach .tick { stroke: var(--steel); stroke-width: 2; }
.mach .float { fill: var(--amber); }
.mach .pump { fill: var(--ridge); }
.mach .pipe { stroke: #AEB9C3; stroke-width: 8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mach .pipe.flow { stroke: #6F9BC4; }
.mach .pipe.out { stroke: #8FB0CE; }
.mach-opts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; padding: 6px 4px 0; }
.mach-opts select { font: inherit; }

/* ---------- lab app ---------- */
.lab-body { background: var(--haze); }
.lab-top { position: sticky; top: 0; z-index: 10; background: var(--deep); color: #E8EDF1; }
.lab-top .in { display: flex; align-items: center; gap: 14px; padding: 10px 18px; flex-wrap: wrap; }
.lab-top .plate { font-size: 19px; padding: 5px 12px; }
.lab-top select { font: 600 16px var(--f-body); padding: 7px 10px; border-radius: var(--radius); border: 1px solid #4B6886; background: #24405C; color: #fff; max-width: 330px; }
.lab-top .ctl { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.tb { font: 600 15px var(--f-body); min-height: 38px; padding: 0 14px; border-radius: var(--radius); border: 1px solid #4B6886; background: #24405C; color: #fff; cursor: pointer; }
.tb:hover { background: #2E4B69; }
.tb.on-run { background: var(--run); border-color: var(--run); }
.tb.warn { background: #6B4A10; border-color: var(--amber); }
.mode { font: 600 13.5px var(--f-tag); padding: 4px 10px; border-radius: 99px; background: #13283B; color: var(--far); }
.mode.run { color: #7CF0AC; }
.lab > div { min-width: 0; }
.lab { display: grid; grid-template-columns: minmax(330px, 430px) minmax(0, 1fr); gap: 18px; padding: 18px; max-width: 1640px; margin: 0 auto; }
.panel { background: var(--mist); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 26px; margin-bottom: 6px; }
.panel h3 { font-size: 20px; margin-bottom: 8px; }
.brief .goal { font-size: 16.5px; }
.brief ol { margin: 8px 0 0; padding-left: 20px; font-size: 15px; color: var(--ink-2); }
.brief ol li { margin-bottom: 5px; }
.io { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.io th { text-align: left; font: 600 13px var(--f-body); color: var(--ink-2); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.io td { padding: 5px 6px; border-bottom: 1px solid #E1E7EC; vertical-align: top; }
.io td.t { font-family: var(--f-tag); font-weight: 600; white-space: nowrap; }
.io td.d { color: var(--ink-2); font-size: 13.5px; }
.val { display: inline-block; min-width: 46px; text-align: center; font: 600 13px var(--f-tag); padding: 2px 7px; border-radius: 99px; background: #DCE3EA; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.val.on { background: var(--run) !important; color: #fff; }
.edbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.eb { font: 600 14.5px var(--f-body); min-height: 36px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.eb:hover { border-color: var(--mid); background: #EEF3F7; }
.eb.pri { background: var(--ridge); color: #fff; border-color: var(--ridge); }
.eb.pri:hover { background: var(--deep); }
.eb.danger { color: var(--stop); }
.eb:disabled { opacity: 0.45; cursor: default; }
.ladder-wrap { overflow-x: auto; background: var(--mist); border: 1px solid var(--line); border-radius: 6px; padding: 8px 4px; min-height: 120px; }
.insp { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px; margin: 10px 0 0; background: #EEF3F7; border: 1px solid var(--line); border-radius: 6px; }
.insp label { display: flex; flex-direction: column; font: 600 12.5px var(--f-body); color: var(--ink-2); gap: 3px; }
.insp input, .insp select { font: 500 15px var(--f-tag); padding: 6px 8px; border: 1px solid var(--steel); border-radius: 4px; background: #fff; min-width: 120px; }
.insp .hint { flex-basis: 100%; font-size: 13.5px; color: var(--ink-2); margin: 0; }
.warns { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.warns li { padding: 6px 10px; border-left: 3px solid var(--amber); background: #FBF4E6; margin-bottom: 6px; border-radius: 0 4px 4px 0; }
textarea.code { width: 100%; min-height: 220px; font: 14px/1.5 var(--f-code); padding: 10px; border: 1px solid var(--steel); border-radius: 6px; background: #fff; color: var(--ink); }
.errs { color: var(--stop); font-size: 14px; margin: 8px 0 0; padding-left: 18px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 0 0 12px; }
.tabs button { font: 600 16px var(--f-body); background: none; border: 0; padding: 8px 14px; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button[aria-selected="true"] { color: var(--deep); border-bottom-color: var(--ridge); }
.results { list-style: none; padding: 0; margin: 8px 0 0; }
.results li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px solid #E1E7EC; font-size: 15.5px; }
.results li::before { content: ''; position: absolute; left: 4px; top: 12px; width: 14px; height: 14px; border-radius: 50%; background: var(--stop); }
.results li.pass::before { background: var(--run); }
.results .fix { display: block; color: var(--ink-2); font-size: 14px; }
.banner { padding: 10px 14px; border-radius: 6px; margin: 8px 0; font-weight: 600; }
.banner.ok { background: var(--run-soft); color: #0F5F33; }
.banner.cr { background: #FBF0DA; color: #6B4A10; }
.choices { display: grid; gap: 8px; margin-top: 10px; }
.choices button { text-align: left; font: 500 15.5px var(--f-body); padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.choices button:hover { border-color: var(--mid); }
.choices button.right { border-color: var(--run); background: var(--run-soft); }
.choices button.wrong { border-color: var(--stop); background: #FBE9E7; }
.coach-log { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.msg { padding: 10px 12px; border-radius: 8px; font-size: 15.5px; }
.msg.me { background: #DCE6EF; align-self: flex-end; max-width: 85%; }
.msg.ai { background: #fff; border: 1px solid var(--line); }
.msg.ai h4 { font: 600 17px var(--f-display); margin: 8px 0 4px; }
.msg.ai ul, .msg.ai ol { margin: 4px 0 8px; padding-left: 20px; }
.msg.ai pre { background: #F0F3F6; padding: 8px 10px; border-radius: 4px; overflow-x: auto; font: 13px/1.45 var(--f-code); margin: 6px 0; }
.msg.err { background: #FBE9E7; color: #7A1E17; }
.msg .acts { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.coach-in { display: flex; gap: 8px; }
.coach-in textarea { flex: 1; font: 15px var(--f-body); padding: 8px 10px; border: 1px solid var(--steel); border-radius: 6px; min-height: 44px; resize: vertical; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.notice { font-size: 13px; color: var(--ink-2); margin-top: 10px; }

/* ---------- plant help ---------- */
.help-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; padding: 24px 0 64px; }
.form label { display: block; font-weight: 600; margin: 14px 0 4px; }
.form .opt { font-weight: 400; color: var(--ink-2); }
.form input, .form select, .form textarea { width: 100%; font: 16px var(--f-body); padding: 10px 12px; border: 1px solid var(--steel); border-radius: 6px; background: #fff; }
.form textarea { min-height: 130px; resize: vertical; }
.safety { border-left: 4px solid var(--stop); background: #FBEDEB; padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 18px 0 0; font-size: 15.5px; }
.answer { background: var(--mist); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; min-height: 200px; }
.answer h4 { font: 600 21px var(--f-display); margin: 14px 0 4px; color: var(--deep); }
.answer h4:first-child { margin-top: 0; }
.answer ul, .answer ol { padding-left: 20px; margin: 4px 0 10px; }
.answer .acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--far); border-top-color: var(--ridge); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- home: tools ---------- */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.tool { display: flex; flex-direction: column; background: var(--mist); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.tool:hover { border-color: var(--mid); background: #fff; }
.tool h3 { font: 600 24px var(--f-display); color: var(--deep); margin: 0 0 6px; }
.tool p { color: var(--ink-2); margin: 0 0 12px; flex: 1; }
.tool span { font-weight: 600; color: var(--ridge); text-decoration: underline; }

/* ---------- fault code finder ---------- */
.pagehead { font-size: clamp(36px, 5vw, 58px); margin-top: 12px; color: var(--deep); }
.fsearch { margin: 22px 0 8px; }
.fsearch input[type=search] { width: 100%; max-width: 640px; font: 600 22px var(--f-tag); padding: 14px 16px; border: 2px solid var(--mid); border-radius: 8px; background: #fff; letter-spacing: 0.02em; }
.fsearch input[type=search]:focus { outline: 3px solid rgba(46, 75, 105, 0.25); border-color: var(--ridge); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.chips button { font: 600 15px var(--f-body); padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ridge); border-color: var(--ridge); color: #fff; }
.faults { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; margin: 8px 0 40px; }
.fault { background: var(--mist); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; min-width: 0; }
.fault header { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.fcode { font: 600 26px var(--f-tag); color: #fff; background: var(--deep); border-radius: 6px; padding: 6px 12px; letter-spacing: 0.03em; white-space: nowrap; }
.fault h3 { font: 600 21px var(--f-display); margin: 0; color: var(--deep); line-height: 1.15; }
.fbrand { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.fmean { margin: 6px 0 10px; }
.fcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.fcols h4 { font: 600 15px var(--f-body); margin: 0 0 4px; color: var(--ink); }
.fcols ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); }
.fcols li + li { margin-top: 3px; }
.fcall { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; }
.facts { margin: 10px 0 0; font-weight: 600; }
.fnone { grid-column: 1 / -1; background: #FBF0DA; border-radius: 8px; padding: 14px 18px; }
.ask { border-top: 1px solid var(--line); padding: 28px 0 8px; }
.ask h2 { font-size: 30px; margin-bottom: 4px; color: var(--deep); }
.askform { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 4px 16px; max-width: 760px; margin-bottom: 16px; }
.askform .wide { grid-column: 1 / -1; }
.askform button { margin-top: 12px; }
.sources { font-size: 13.5px; color: var(--ink-2); max-width: 90ch; margin: 24px 0 0; }

/* ---------- plant help photo ---------- */
.photo { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; position: relative; }
.photo input.sr { left: 0; top: 0; }
.photobtn { min-height: 42px; cursor: pointer; }
.photo input[type=file]:focus-visible + .thumb, .photobtn:focus-within { outline: 3px solid rgba(46, 75, 105, 0.3); }
.thumb { display: flex; align-items: center; gap: 12px; }
.thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- sandbox ---------- */
.sbtitle { font: 600 19px var(--f-display); color: #E8EDF1; letter-spacing: 0.02em; }
.sandbox textarea.code { min-height: 180px; }
.small { font-size: 13.5px; }
.notes { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.notes li { padding: 6px 10px; background: #E7EEF5; border-radius: 6px; margin-top: 6px; }
.filebtn { display: inline-flex; align-items: center; cursor: pointer; }
.sbio { display: flex; flex-direction: column; gap: 8px; }
.sw { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; color: inherit; touch-action: none; user-select: none; -webkit-user-select: none; }
.sw .lamp-s { grid-row: 1 / 3; }
.swt { font: 600 15.5px var(--f-tag); overflow-wrap: anywhere; }
.swv { font: 600 13px var(--f-tag); padding: 2px 8px; border-radius: 99px; background: #DCE3EA; color: var(--ink-2); }
.swh { grid-column: 2 / 4; font-size: 12.5px; color: var(--ink-2); }
.sw.on { border-color: var(--run); }
.sw.on .swv { background: var(--run); color: #fff; }
.lamp-s { width: 14px; height: 14px; border-radius: 50%; background: #C3CCD5; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.on > .lamp-s { background: var(--run); box-shadow: 0 0 8px rgba(31, 157, 87, 0.7); }
.num label { display: block; font: 600 15px var(--f-tag); margin-bottom: 2px; overflow-wrap: anywhere; }
.numrow { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 10px; align-items: center; }
.numrow input[type=number] { font: 600 15px var(--f-tag); padding: 6px 8px; border: 1px solid var(--steel); border-radius: 6px; width: 100%; }
.numrow input[type=range] { width: 100%; accent-color: var(--ridge); }
.olist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; margin-bottom: 10px; }
.olist .out { display: flex; align-items: center; gap: 8px; font: 600 15px var(--f-tag); overflow-wrap: anywhere; min-width: 0; }
.sym.box.unk, .sym.blk.unk { border-style: dashed; color: var(--steel); }
.sym.blk i.val { background: none; padding: 0; min-width: 0; color: var(--ridge); font: 600 11px var(--f-tag); }
.el.o.mathbox { width: 200px; }
.el.o.mathbox .sym.blk { width: 184px; padding: 0 6px; overflow: hidden; }
.el.o.mathbox .sym.blk i { display: block; max-width: 172px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 980px) {
  .hero .hero-grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 170px; }
  .hero .lede { font-size: 18px; }
  .doors, .feat, .shop, .help-grid { grid-template-columns: 1fr; }
  .doors > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .labs-list li { grid-template-columns: 1fr; gap: 4px; }
  .lab { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .lab-top { position: static; }
  .top { flex-wrap: wrap; }
  .top nav { gap: 6px 16px; flex-wrap: wrap; }
  .top .tagline { display: none; }
  .fcols, .askform, .tools { grid-template-columns: 1fr; }
  .lab-top .ctl { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 3s; }
  .mach .cap { transition: none; }
}
