/* BayouSim TEST · DS-09 tokens (Iris CON-1 style-system.json 16bf2d13). Neutral grey status; blue only as switch fill when ON.
   M2: every text floor is 14px (was 11-13px in places); amber only on a chip while its mechanism is acting; UI-1 CONTROLS tray. */
:root {
  --bg: #0a0a0c; --panel: #141416; --panel-2: #1c1c20; --border: #8d8d92; --text: #f5f5f5; --muted: #d0d0d4;
  --switch: #4db8ff; --switch-fill: rgba(77,184,255,0.20);
  --seam-top: 46.2963%; --seam-bot: 53.7037%;
  --chip-h: 30px; --gap: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font: 14px/1.35 "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif; }
#view { position: fixed; inset: 0; }
.chrome { position: fixed; z-index: 5; display: flex; flex-wrap: wrap; gap: var(--gap); pointer-events: none; }
.chrome > * { pointer-events: auto; }
#top { top: 8px; left: 8px; right: 8px; max-height: 22vh; overflow: hidden; }
#gauges { top: calc(8px + 2 * var(--chip-h) + 14px); right: 8px; flex-direction: column; align-items: flex-end; max-height: 40vh; overflow: hidden; width: min(300px, 44vw); }
#bottom { bottom: 8px; left: 8px; right: 8px; justify-content: center; max-height: 18vh; overflow: hidden; }
.chip { min-height: var(--chip-h); padding: 5px 10px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); border-radius: 4px; font-size: 14px; white-space: nowrap; letter-spacing: .02em; }
button.chip { cursor: pointer; color: var(--text); font: inherit; font-size: 14px; min-height: 44px; min-width: 44px; }
.chip.on { background: var(--switch-fill); border-color: var(--switch); color: var(--text); }
.gauge { min-width: 200px; max-width: 100%; text-align: right; white-space: normal; }
.gauge .tag { color: var(--muted); font-size: 14px; margin-left: 8px; }
#popup { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(18vh + 12px); padding: 10px 16px; border: 1px solid var(--border); background: var(--panel-2); border-radius: 6px; display: none; text-align: center; min-width: 260px; }
#popup div { margin: 2px 0; } #popup .name { font-weight: 600; color: var(--text); } #popup .line { color: var(--muted); }
.vlabel { position: fixed; z-index: 4; transform: translate(-50%, -130%); padding: 2px 6px; border: 1px solid var(--border); background: rgba(20,20,22,.85); color: var(--muted); font-size: 14px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.vlabel.sel { color: var(--text); background: var(--panel-2); }
#verdict { position: fixed; z-index: 9; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(10,10,12,.55); }
#verdict .box { border: 1px solid var(--border); background: var(--panel); padding: 18px 24px; border-radius: 8px; max-width: min(520px, 90vw); }
#verdict .title { font-size: 22px; font-weight: 700; letter-spacing: .08em; }
#verdict .why { margin-top: 10px; color: var(--muted); } #verdict .cite { margin-top: 6px; color: var(--text); font-size: 14px; }
#verdict .actions { margin-top: 14px; display: flex; justify-content: flex-end; } #verdict .actions .chip { min-height: 44px; min-width: 120px; font-size: 16px; color: var(--text); }
#verdict .para { margin-top: 10px; color: var(--text); } #verdict .source { margin-top: 6px; color: var(--muted); font-size: 14px; font-style: italic; }
#panel { position: fixed; z-index: 7; left: 8px; bottom: calc(18vh + 12px); max-height: 30vh; overflow: auto; width: min(360px, 60vw); border: 1px solid var(--border); background: var(--panel); border-radius: 6px; padding: 8px 10px; display: none; font-size: 14px; color: var(--muted); }
#panel .row { padding: 3px 0; } #panel .row.sel { color: var(--text); }
#srcline { position: fixed; z-index: 6; left: 8px; bottom: calc(18vh + 12px); color: var(--muted); font-size: 14px; display: none; }
/* stacked 3840x4320: keep chrome out of the seam band y 2000-2320 */
@media (min-height: 2320px) { #gauges { max-height: calc(var(--seam-top) - 160px); } #popup, #panel, #srcline { bottom: auto; top: calc(var(--seam-bot) + 16px); } }
@media (max-width: 900px), (pointer: coarse) { :root { --chip-h: 26px; } .chip { font-size: 14px; padding: 4px 7px; } #gauges { width: min(240px, 46vw); max-height: 30vh; } .gauge { min-width: 0; } }
#setup { position: fixed; z-index: 10; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); }
#setup .card { border: 1px solid var(--border); background: var(--panel); border-radius: 8px; padding: 20px 24px; width: min(460px, 92vw); }
#setup h1 { font-size: 22px; margin: 0 0 6px; font-weight: 600; } #setup .note { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
#setup .row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
#setup .row.sel .chip { border-color: var(--text); }
#schem { position: fixed; inset: 0; z-index: 3; display: none; background: var(--bg); }
/* M2 */
.chip.acting { border-color: #ffb000; color: #ffd27a; } /* amber: only while a mechanism is acting (PAYING OUT / HEAVING IN / SOLAR BOX moving) */
.chip.sel { border-color: var(--text); }
#tray { left: 8px; right: 8px; bottom: calc(8px + 52px); justify-content: center; max-height: 30vh; overflow: auto; display: none; background: rgba(10,10,12,.6); padding: 6px; border-radius: 6px; }
.chip.slider { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); }
.chip.slider input[type=range] { -webkit-appearance: none; appearance: none; width: 120px; height: 44px; background: transparent; margin: 0; }
.chip.slider input[type=range]::-webkit-slider-runnable-track { height: 6px; background: #5a5a60; border-radius: 3px; }
.chip.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #d0d0d4; border: 1px solid var(--border); }
.chip.seg { display: inline-flex; align-items: center; gap: 4px; padding: 0 0 0 10px; color: var(--text); }
.chip.seg button.chip { min-width: 52px; }
.chip[aria-disabled=true] { color: var(--muted); }
#dogring { position: fixed; z-index: 4; right: 24px; bottom: calc(18vh + 24px); width: 160px; height: 160px; border-radius: 50%; border: 6px solid #5a5a60; display: none; touch-action: none; }
#srcline .tag, #popup .tag { margin-left: 10px; color: var(--text); border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; font-size: 14px; }
#btn-try-again:focus-visible, #btn-try-again:focus { outline: 3px solid #ffffff; outline-offset: 3px; } /* D1 rule 5: focus ring >= 4.5:1 on the panel */
/* M2 · A9-r1 tank level alarm lamps (Jason 00:19 CT; colours Grok/Quill 00:23 CT): amber ONLY while lit and unacknowledged, neutral grey once
   acknowledged, steady (0 Hz, no blink), never red. One chip per tank. Left column under the top bar; wraps into columns on short screens. */
#alarms { top: calc(8px + 2 * var(--chip-h) + 14px); left: 8px; flex-direction: column; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; max-height: 40vh; max-width: 46vw; gap: 4px; z-index: 8; pointer-events: none; }
#alarms .chip.lamp { white-space: normal; line-height: 1.25; padding: 4px 10px; background: #141416; font-size: 14px; }
#alarms .lamp .l1 { font-weight: 700; letter-spacing: .04em; } #alarms .lamp .l2 { font-size: 14px; }
#alarms .lamp-active { border: 2px solid #ffb000; color: #ffd27a; }   /* amber text #ffd27a on #141416 */
#alarms .lamp-acked { border: 2px solid #8d8d92; color: #d0d0d4; }    /* grey text #d0d0d4 on #141416 */
@media (max-height: 500px) { #alarms { max-height: 52vh; } }
