/* Sun Energy Relay: the Solar Dispatch main screen (cutaway Sun / core reactor / activity monitor) on the left, the
 * work order on the right. Fits the 1366×768 stage (~1066×628); stacks below 900 px. The main screen is a dark space
 * display in both themes; the work order follows the site theme. */
.ser-stage,.ser-example{--ser-ink:#1d1a16;--ser-muted:#5c544a;--ser-panel:#ffffff;--ser-panel2:#fbf4ea;--ser-accent:#a1460f;--ser-ok:#1f7a45;--ser-bad:#b42318;
  --ser-chip:#ffffff;--ser-chip-on:#a1460f;--ser-chip-on-ink:#ffffff;--ser-console1:#e9e1d6;--ser-console2:#d5cabb;--ser-bezel:#2b2622}
[data-theme=dark] .ser-stage,[data-theme=dark] .ser-example{--ser-ink:#f3eee8;--ser-muted:#c4b8aa;--ser-panel:#1d1915;--ser-panel2:#26211b;--ser-accent:#ffb070;--ser-ok:#5fd394;--ser-bad:#ff8a80;
  --ser-chip:#26211b;--ser-chip-on:#ffb070;--ser-chip-on-ink:#22140a;--ser-console1:#24201c;--ser-console2:#18150f;--ser-bezel:#3d352d}

.ser-stage{position:absolute;inset:0;display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:12px;padding:10px;overflow:hidden;color:var(--tlg-text,#1d1a16);font-size:16px}
.ser *{box-sizing:border-box}

/* ── main screen ── */
.ser-scene{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;gap:6px;padding:8px 10px 10px;border-radius:18px;
  background:linear-gradient(180deg,var(--ser-console1),var(--ser-console2));box-shadow:inset 0 0 0 2px #0f172a14}
.ser-bar{flex:none;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 10px;min-height:34px}
.ser-mon-title{margin:0;font-weight:800;font-size:16px;line-height:1.2;color:var(--ser-ink);min-width:0}
.ser-toggle{display:flex;align-items:center;gap:4px;margin-left:auto}
.ser-toggle-l{font-weight:700;color:var(--ser-muted);margin-right:2px}
.ser-tg{min-height:36px;padding:2px 10px;border-radius:8px;border:2px solid var(--tlg-border-strong,#7c6f62);background:var(--ser-chip);color:var(--ser-ink);font:inherit;font-size:16px;font-weight:700;cursor:pointer}
.ser-tg.is-on{background:var(--ser-chip-on);border-color:var(--ser-chip-on);color:var(--ser-chip-on-ink)}
.ser-tg:disabled{cursor:default;opacity:.75}
.ser-viz-host{position:relative;flex:1 1 auto;min-height:0;container-type:size;display:flex;align-items:center;justify-content:center}
.ser-viz{border-radius:12px;overflow:hidden;border:6px solid var(--ser-bezel);box-shadow:0 8px 20px #0f172a40;background:#070b1d}
.ser-viz--sun{width:min(100cqw,calc(100cqh * 600 / 330));aspect-ratio:600/330}
.ser-viz--chart{width:min(100cqw,calc(100cqh * 600 / 420));aspect-ratio:600/420;background:#0d1424}
.ser-svg{display:block;width:100%;height:100%;touch-action:manipulation}
.ser-inset{flex:none;height:96px;border-radius:12px;background:#0d1424;border:4px solid var(--ser-bezel);overflow:hidden}
.ser-inset .ser-svg{height:100%;width:auto;max-width:100%}

/* svg text and marks (the screen is always dark) */
.ser-t{font-family:var(--tlg-font,system-ui,sans-serif);fill:#f1f3f5;font-size:18px}
.ser-t--name{font-weight:800;font-size:18px;paint-order:stroke;stroke:#070b1d;stroke-width:4px}
.ser-t--note{font-size:17px;font-style:italic;fill:#c5cbe0;paint-order:stroke;stroke:#070b1d;stroke-width:4px}
.ser-t--note2{font-size:17px;font-style:italic;fill:#aeb6cc}
.ser-t--head{font-size:18px;font-weight:800;fill:#ffe8cc}
.ser-t--badge{font-size:18px;font-weight:900;fill:#1b1306}
.ser-t--nuc{font-size:13px;font-weight:800;fill:#fff}
.ser-t--prod{font-size:18px;font-weight:700;fill:#ffe8cc}
.ser-t--ledger{font-size:18px;font-weight:800;fill:#c3fae8}
.ser-t--pill{font-size:17px;font-weight:800;fill:#f8f9fa}
.ser-t--tick{font-size:17px;fill:#c5cbe0;font-variant-numeric:tabular-nums}
.ser-t--axis{font-size:17px;font-weight:800;fill:#e9ecef}
.ser-t--val{font-size:17px;font-weight:700;fill:#ffe8cc;font-variant-numeric:tabular-nums}
.ser-t--flag{font-size:17px;font-weight:800}
.ser-t--peak{fill:#ffa94d}.ser-t--quiet{fill:#74c0fc}
.ser-t--mine{font-size:17px;font-weight:800;fill:#ffa8a8}
.ser-t--ink{font-size:18px;font-weight:700;fill:#f1f3f5}
.ser-t--keyink{fill:#8ce99a;font-weight:900}
.ser-t--muted{font-size:17px;font-style:italic;fill:#aeb6cc}
.ser-space{fill:#070b1d}
.ser-stars circle{fill:#ffffff}
.ser-gran circle{fill:#fff3bf;opacity:.18}
.ser-spot-p{fill:#7a2e0e;opacity:.85}.ser-spot-u{fill:#2b0f05}
.ser-rim{fill:none;stroke:#fff3bf;stroke-width:5}
.ser-cutedge{fill:none;stroke:#5c1d05;stroke-width:2;opacity:.8}
.ser-boundary{fill:none;stroke:#7a2e0e;stroke-width:1.5;stroke-dasharray:4 4;opacity:.7}
.ser-hl{fill:none;stroke:#74c0fc;stroke-width:4;stroke-dasharray:9 6}
.ser-spacepath{stroke:#5c6b8a;stroke-width:2;stroke-dasharray:3 7}
.ser-leader path{fill:none;stroke:#e9ecef;stroke-width:1.6;opacity:.85}.ser-leader circle{fill:#e9ecef}
.ser-hit{fill:transparent;cursor:pointer}
.ser-hit:hover{fill:#ffffff1f}
.ser-yours{fill:none;stroke:#ffffff;stroke-width:3;stroke-dasharray:7 6;opacity:.9}
.ser-badge circle{fill:#ffe066;stroke:#1b1306;stroke-width:2.5}
.ser-badge.is-key circle{fill:#8ce99a}
.ser-pill rect{fill:#0d1424ee;stroke:#c5cbe055;stroke-width:1.5}
.ser-pill--clock rect{stroke:#ffe066;stroke-width:2.5}
.ser-pill--cap rect{stroke:#ffa94d;stroke-width:2.5}
.ser-pill--slow rect{stroke:#ffa94d;stroke-width:2;stroke-dasharray:5 3}
.ser-pill--chain rect{fill:#a1460f;stroke:#ffd8a8;stroke-width:2}
.ser-pill--key rect{stroke:#8ce99a;stroke-width:2.5}.ser-pill--key text{fill:#b2f2bb}
.ser-pill--base rect{stroke:#ffa94d;stroke-width:2}
.ser-pill--pol rect{stroke:#da77f2;stroke-width:2}
/* reveal marks */
.ser-proton{fill:#ff6b6b;stroke:#fff5f5;stroke-width:1.5}
.ser-neutron{fill:#adb5bd;stroke:#f8f9fa;stroke-width:1.5}
.ser-flash{fill:#ffffff}
.ser-walk{fill:none;stroke:#ffffff;stroke-width:2;stroke-linejoin:round;opacity:.9}
.ser-cell ellipse{fill:none;stroke:#fff3bf;stroke-width:2;stroke-dasharray:5 4;opacity:.85}.ser-cell circle{fill:#fff3bf}
.ser-packet{fill:#ffffff;stroke:#ffd43b;stroke-width:3}
.ser-ray{stroke:#ffe066;stroke-width:2;opacity:.45}
.ser-wave{fill:none;stroke:#ffe066;stroke-width:3}
.ser-photon{fill:#fff3bf;stroke:#ffd43b;stroke-width:2}
.ser-arrive{fill:none;stroke:#8ce99a;stroke-width:3}
/* core reactor */
.ser-zoom{stroke:#ffd8a8;stroke-width:1.5;stroke-dasharray:4 5;opacity:.7}
.ser-reactor{fill:#140a05;stroke:#ffa94d;stroke-width:3}
.ser-arrow{fill:none;stroke:#ffe8cc;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.ser-gamma{fill:none;stroke:#ffe066;stroke-width:3}
.ser-mbar{fill:#495057;stroke:#ced4da;stroke-width:1.5}
.ser-ebar{fill:#ffd43b}
/* activity monitor */
.ser-plot{fill:#111a2e;stroke:#2f3b55;stroke-width:1.5}
.ser-grid{stroke:#2f3b55;stroke-width:1}
.ser-col{fill:#e8590c;stroke:#ffc078;stroke-width:1.5}
.ser-col.is-peak{fill:#f76707;stroke:#ffe8cc;stroke-width:3}
.ser-col.is-quiet{fill:#1c7ed6;stroke:#d0ebff;stroke-width:3}
.ser-keybox{fill:none;stroke:#8ce99a;stroke-width:3.5}
.ser-tl-axis{stroke:#c5cbe0;stroke-width:1.5;fill:none}
.ser-tl-line{fill:none;stroke:#ffa94d;stroke-width:2.5;stroke-linejoin:round}
.ser-tl-win{fill:#ffffff14;stroke:#ffe066;stroke-width:2}
.ser-tl-future{fill:#ffffff0d}
.ser-tl-base{stroke:#ffa94d;stroke-width:2.5;stroke-dasharray:5 4}
.ser-tl-mine{stroke:#ffa8a8;stroke-width:3}
.ser-arc{fill:none;stroke:#8ce99a;stroke-width:3.5;stroke-dasharray:8 5}
.ser-keydot{fill:#8ce99a}
.ser-rms{fill:none;stroke:#ffe066;stroke-width:2.5}.ser-rms--2{stroke:#74c0fc;stroke-dasharray:6 4}
.ser-rms-r{stroke:#ffe066;stroke-width:2.5}.ser-rms-r--2{stroke:#74c0fc}

/* route builder under the screen */
.ser-routebox{flex:none;display:flex;flex-direction:column;gap:6px}
.ser-route{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:0;padding:0;list-style:none}
.ser-slot{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;min-height:44px;padding:3px 6px 3px 14px;border-radius:10px;border:2px dashed var(--tlg-border-strong,#7c6f62);background:var(--ser-panel);color:var(--ser-muted);font-size:16px;line-height:1.15}
.ser-slot.is-filled{border-style:solid;color:var(--ser-ink);font-weight:800}
.ser-slot-n{position:absolute;left:-7px;top:-9px;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#ffe066;color:#1b1306;font-weight:900;border:2px solid #1b1306}
.ser-slot-t{min-width:0}
.ser-slot:not(.is-filled) .ser-slot-t{font-size:16px}
.ser-slot.is-ok{border-color:var(--ser-ok)}.ser-slot.is-bad{border-color:var(--ser-bad);border-style:dashed}
.ser-slot-m{position:absolute;right:-6px;top:-10px;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--ser-panel);font-weight:900;font-size:16px}.ser-slot.is-ok .ser-slot-m{color:var(--ser-ok)}.ser-slot.is-bad .ser-slot-m{color:var(--ser-bad)}
.ser-tray{display:flex;flex-wrap:wrap;gap:6px}
.ser-station,.ser-tool{display:flex;align-items:center;gap:5px;min-height:44px;padding:4px 10px;border-radius:10px;border:2px solid var(--tlg-border-strong,#7c6f62);background:var(--ser-chip);color:var(--ser-ink);font:inherit;font-size:16px;font-weight:700;cursor:pointer}
.ser-station-plus{font-weight:900;color:var(--ser-accent)}
.ser-tool{margin-left:auto;background:transparent}.ser-tool+.ser-tool{margin-left:0}
.ser-station:hover:not(:disabled),.ser-tool:hover:not(:disabled){border-color:var(--ser-accent)}
.ser-station:disabled,.ser-tool:disabled{cursor:default;opacity:.55}
.ser-banner{flex:none;padding:5px 10px;border-radius:10px;font-weight:800;font-size:16px;line-height:1.3;background:var(--ser-panel);border:3px solid var(--ser-ok);color:var(--ser-ink)}
.ser-table-wrap{flex:none;font-size:16px;color:var(--ser-ink)}
.ser-table-wrap summary{cursor:pointer;font-weight:700;min-height:26px}
.ser-table{border-collapse:collapse;width:100%;margin-top:3px;font-variant-numeric:tabular-nums;background:var(--ser-panel)}
.ser-table caption{text-align:left;font-weight:700}
.ser-table th,.ser-table td{padding:1px 4px;border:1px solid var(--tlg-border,#cbd5e1);text-align:right}
.ser-table th[scope=row]{text-align:left}
.ser-given--scene{flex:none;background:var(--ser-panel);color:var(--ser-ink)}
.ser-legend{flex:none;display:flex;flex-wrap:wrap;gap:4px 14px;justify-content:center;font-size:16px;color:var(--ser-ink)}
.ser-lg{display:inline-flex;align-items:center;gap:5px}
.ser-lg-dot{display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 3px;border-radius:12px;background:#140a05;color:#ffe8cc;font-weight:800;font-size:16px}
.ser-lg-p{background:#ff6b6b;color:#fff}.ser-lg-n{background:#adb5bd;color:#1b1306}.ser-lg-g{color:#ffe066}
.ser-credit{margin:3px 0 0;font-size:16px;color:var(--ser-muted)}

/* ── the work order ── */
.ser-slip{min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px;overflow:auto;padding:8px 12px;background:var(--ser-panel);border:2px solid var(--tlg-border,#d6cbbb);border-radius:16px;box-shadow:0 6px 16px #0f172a1f;color:var(--ser-ink)}
.ser-slip-kicker{margin:0;font-size:16px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--ser-accent)}
.ser-slip-title{margin:0;font-size:19px;line-height:1.2}
.ser-given{padding:5px 10px;border-radius:10px;background:var(--ser-panel2);border:1px solid var(--tlg-border,#d6cbbb);font-size:16px;line-height:1.3}
.ser-given p{margin:0}.ser-given p+p{margin-top:3px}
.ser-row{margin:0;padding:0;border:0;min-width:0}
.ser-row-l{display:flex;gap:8px;align-items:center;padding:0;font-weight:800;font-size:16px;line-height:1.2;margin-bottom:3px}
.ser-mark{font-size:18px}.ser-row.is-ok .ser-mark{color:var(--ser-ok)}.ser-row.is-bad .ser-mark{color:var(--ser-bad)}
.ser-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end}
.ser-num-box{display:flex;align-items:center;border:2px solid var(--tlg-border-strong,#7c6f62);border-radius:10px;background:var(--ser-chip);overflow:hidden}
.ser-num-box:focus-within{outline:3px solid var(--tlg-focus,#2563eb);outline-offset:2px}
.ser-input{flex:1;min-width:0;min-height:42px;border:0;padding:4px 8px;background:transparent;color:var(--ser-ink);font:inherit;font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;outline:none}
.ser-input:disabled{opacity:1;color:var(--ser-ink)}
.ser-input.is-bad-num{background:#fde8e7}
.ser-unit{flex:none;padding:0 9px;align-self:stretch;display:flex;align-items:center;background:var(--ser-panel2);border-left:1px solid var(--tlg-border,#d6cbbb);font-size:16px;font-weight:700;color:var(--ser-muted)}
.ser-num.is-ok .ser-num-box,.ser-pick.is-ok .ser-select{border-color:var(--ser-ok)}
.ser-num.is-bad .ser-num-box,.ser-pick.is-bad .ser-select{border-color:var(--ser-bad);border-style:dashed}
.ser-key{display:block;font-size:16px;font-weight:800;color:var(--ser-ok);margin-top:2px}
.ser-pick-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ser-pick-top .ser-row-l{margin:0}
.ser-select{flex:none;min-height:44px;min-width:150px;padding:4px 8px;border-radius:10px;border:2px solid var(--tlg-border-strong,#7c6f62);background:var(--ser-chip);color:var(--ser-ink);font:inherit;font-size:17px;font-weight:700}
.ser-select:disabled{opacity:1}
.ser-pick--peak .ser-select{border-left:8px solid #f76707}.ser-pick--quiet .ser-select{border-left:8px solid #1c7ed6}
.ser-chips{display:grid;gap:5px}
.ser-chips--2{grid-template-columns:1fr 1fr}
.ser-chip{display:flex;align-items:center;gap:6px;min-height:44px;padding:3px 10px;border-radius:10px;border:2px solid var(--tlg-border-strong,#7c6f62);background:var(--ser-chip);color:var(--ser-ink);font:inherit;font-size:16px;font-weight:700;line-height:1.2;text-align:left;cursor:pointer}
.ser-chip:hover:not(:disabled){border-color:var(--ser-accent)}
.ser-chip.is-on{background:var(--ser-chip-on);color:var(--ser-chip-on-ink);border-color:var(--ser-chip-on);box-shadow:inset 0 0 0 2px #ffffff55}
.ser-chip.is-on::after{content:'●';margin-left:auto;padding-left:6px}
.ser-chip:disabled{cursor:default;opacity:1}
.ser-group.is-bad .ser-chip.is-on{background:var(--ser-bad);border-color:var(--ser-bad);color:#ffffff}
.ser-group.is-ok .ser-chip.is-on{background:var(--ser-ok);border-color:var(--ser-ok);color:#ffffff}
[data-theme=dark] .ser-group.is-ok .ser-chip.is-on,[data-theme=dark] .ser-group.is-bad .ser-chip.is-on{color:#10140f}
.ser-chip.is-key{border-style:dashed;border-color:var(--ser-ok);border-width:3px}
.ser-chip.is-key::after{content:'✓ key';margin-left:auto;padding-left:6px;color:var(--ser-ok);white-space:nowrap}
.ser-about{margin-top:auto;padding:5px 10px;border:1px solid var(--tlg-border,#d6cbbb);border-radius:10px;font-size:16px}
.ser-about summary{cursor:pointer;min-height:26px;font-weight:700}
.ser-about p{margin:6px 0 0;line-height:1.35}
.ser :focus-visible{outline:3px solid var(--tlg-focus,#2563eb);outline-offset:2px}

.ser-example{max-width:640px;margin:0 auto;border-radius:14px;overflow:hidden;border:5px solid #2b2622;background:#070b1d}

@media(max-width:900px){
  .ser-stage{position:static;grid-template-columns:1fr;overflow:visible}
  .ser-viz-host{container-type:inline-size}
  .ser-viz--sun,.ser-viz--chart{width:100%}
  .ser-slip{overflow:visible}
  .ser-route{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:560px){.ser-route{grid-template-columns:1fr 1fr}.ser-pair{grid-template-columns:1fr}.ser-pick-top{flex-wrap:wrap}.ser-tool{margin-left:0}}
@media(prefers-reduced-motion:reduce){.ser-stage *{transition:none!important;animation:none!important}}
