/* النظام — the lab. Tokens only; status is glyph + word, never colour alone; dashed = claim. */
.sys-hero{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--s-2);margin-bottom:var(--s-4)}
@media (min-width:640px){.sys-hero{grid-template-columns:repeat(4,1fr)}}
.sys-k{display:flex;flex-direction:column;gap:2px;padding:var(--s-3);border:1px solid rgb(var(--line));border-radius:var(--r-2);background:rgb(var(--surface))}
.sys-k b{font:700 21px var(--mono);color:rgb(var(--fg))}
.sys-k span{font-size:12px;color:rgb(var(--fg-3))}
.sys-note{margin:var(--s-3) 0 0;font-size:12px;line-height:1.7;color:rgb(var(--fg-3))}
.sys-lab{margin-top:var(--s-6)}
.sys-tag2{display:inline-block;padding:1px 8px;border:1px solid rgb(var(--line));border-radius:999px;font-size:11px;color:rgb(var(--fg-3));white-space:nowrap}
.sys-lab .sys-tag2,.sys-base .sys-tag2{border-style:dashed}
.sys-en{font-size:11px;color:rgb(var(--fg-3))}

/* the board: svg wires under html nodes, positioned in % of the same viewBox */
.sys-board{position:relative;max-width:520px;margin:0 auto var(--s-3)}
.sys-svg{display:block;width:100%;height:auto;direction:ltr;overflow:visible}
.sys-wp{fill:none;stroke:rgb(var(--fg-4));stroke-width:1.6;stroke-linecap:round}
.sys-ah{fill:none;stroke:rgb(var(--fg-4));stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.sys-hit{fill:none;stroke:transparent;stroke-width:50;pointer-events:stroke;cursor:pointer;outline:none}
.sys-wire:hover .sys-wp,.sys-wire.lit .sys-wp,.sys-wire.on .sys-wp{stroke:rgb(var(--accent));stroke-width:2.2}
.sys-wire.on .sys-ah,.sys-wire.lit .sys-ah{stroke:rgb(var(--accent))}
.sys-hit:focus-visible{stroke:rgb(var(--accent) / .25)}
.sys-bd{pointer-events:none}
.sys-bd rect{fill:rgb(var(--surface));stroke:rgb(var(--line));stroke-width:1}
.sys-bd text{font:600 11px var(--mono);fill:rgb(var(--fg));text-anchor:middle}
.sys-wire.on .sys-bd rect,.sys-wire.lit .sys-bd rect{stroke:rgb(var(--accent))}
.sys-stub{stroke:rgb(var(--line));stroke-width:1.4;stroke-dasharray:2 4;fill:none}
.sys-pkt{fill:rgb(var(--accent));pointer-events:none;visibility:hidden}
.sys-board.playing .sys-pkt{visibility:visible}

.sys-node{position:absolute;display:flex;flex-direction:column;justify-content:center;gap:2px;padding:0 12px;border:1px solid rgb(var(--line));border-radius:var(--r-2);background:rgb(var(--surface));color:rgb(var(--fg));text-align:start;min-height:44px;overflow:hidden}
.sys-node:hover,.sys-node:focus-visible{border-color:rgb(var(--fg-4))}
.sys-node[data-node="truth"]{background:rgb(var(--sunk))}
.sys-node.on{border-color:rgb(var(--accent));background:rgb(var(--sunk))}
.sys-nt{display:flex;align-items:center;justify-content:space-between;gap:6px}
.sys-nt b{font-size:14px}
.sys-g{font-size:12px}
.sys-nm{font-size:11px;color:rgb(var(--fg-3));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sys-nm bdi{color:rgb(var(--fg));font-weight:600}
.sys-nm em{font-style:normal;color:rgb(var(--fg-4))}
.sys-node.sm{padding:0 8px}
.sys-node.sm .sys-nt b{font-size:12.5px}
.sys-done .sys-g,.sys-done .g{color:rgb(var(--ok))}
.sys-partial .sys-g,.sys-partial .g{color:rgb(var(--needs))}
.sys-weak .sys-g,.sys-weak .g{color:rgb(var(--bad))}
.sys-fresh .sys-g,.sys-fresh .g{color:rgb(var(--info))}

.sys-play{min-height:44px;padding:0 14px;border:1px solid rgb(var(--line));border-radius:999px;background:rgb(var(--surface));font-size:13px;color:rgb(var(--fg))}
.sys-play.on{border-color:rgb(var(--accent))}
.sys-play:active{background:rgb(var(--sunk))}

/* the one inline sheet */
.sys-sheet{padding:var(--s-4);border:1px solid rgb(var(--line));border-radius:var(--r-3);background:rgb(var(--surface));min-height:88px}
.sys-hint{font-size:13px;line-height:1.8;color:rgb(var(--fg-3))}
.sys-hint b{color:rgb(var(--fg-2))}
.sys-sheet-h{display:flex;align-items:center;gap:var(--s-2);flex-wrap:wrap;margin-bottom:var(--s-2)}
.sys-sheet-h b{font-size:16px}
.sys-state{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:0 10px;border:1px dashed rgb(var(--fg-4));border-radius:999px;font-size:12px;color:rgb(var(--fg-2));white-space:nowrap}
.sys-what{margin:0 0 var(--s-3);font-size:13.5px;line-height:1.8;color:rgb(var(--fg-2))}
.sys-ms{display:flex;flex-wrap:wrap;gap:4px var(--s-4);margin-bottom:var(--s-3);font-size:12px;color:rgb(var(--fg-3))}
.sys-m bdi{color:rgb(var(--fg));font-weight:600}
.sys-na{font-style:normal;color:rgb(var(--fg-4))}
.sys-evs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:var(--s-3)}
.sys-ev{display:inline-flex;gap:6px;align-items:center;min-height:26px;padding:0 10px;border:1px solid rgb(var(--line));border-radius:999px;font-size:11.5px;color:rgb(var(--fg-2))}
.sys-ev b{color:rgb(var(--fg))}
.sys-derive,.sys-law{margin:0 0 var(--s-3);font-size:13px;line-height:1.8;color:rgb(var(--fg))}
.sys-claim{position:relative;padding:var(--s-3) var(--s-4);border:1px dashed rgb(var(--fg-4));border-radius:var(--r-2);margin-top:var(--s-4)}
.sys-tag{position:absolute;inset-block-start:-10px;inset-inline-start:12px;padding:0 8px;background:rgb(var(--surface));font-size:11px;letter-spacing:.04em;color:rgb(var(--fg-3))}
.sys-claim h4{margin:var(--s-3) 0 4px;font-size:12px;color:rgb(var(--fg-3));font-weight:600}
.sys-claim h4:first-of-type{margin-top:4px}
.sys-claim ul{margin:0;padding-inline-start:18px;list-style:disc;font-size:13px;line-height:1.8;color:rgb(var(--fg))}
.sys-claim li{margin-bottom:6px}
.sys-claim li::marker{color:rgb(var(--fg-4))}
.sys-claim p{margin:0;font-size:13px;line-height:1.8;color:rgb(var(--fg))}

/* the playground */
.sys-sim{padding:var(--s-4);border:1px dashed rgb(var(--fg-4));border-radius:var(--r-3);background:rgb(var(--surface))}
.sys-ctl{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px var(--s-3);margin-bottom:var(--s-3)}
.sys-ctl label{font-size:13px;color:rgb(var(--fg-2))}
.sys-ctl output{font:600 15px var(--mono);color:rgb(var(--fg))}
.sys-ctl input{grid-column:1 / -1;width:100%;height:44px;margin:0;accent-color:rgb(var(--accent));direction:ltr}
.sys-seg{display:flex;gap:6px;margin-bottom:var(--s-4)}
.sys-seg button{flex:1;min-height:44px;padding:0 10px;border:1px solid rgb(var(--line));border-radius:var(--r-2);background:rgb(var(--surface));font-size:12.5px;color:rgb(var(--fg-2))}
.sys-seg button[aria-pressed="true"]{border-color:rgb(var(--accent));color:rgb(var(--fg));background:rgb(var(--sunk))}
.sys-out{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--s-2)}
.sys-line{margin:var(--s-3) 0;font-size:13px;line-height:1.8;color:rgb(var(--fg))}
.sys-base{font-size:12px;line-height:1.9;color:rgb(var(--fg-3))}
.sys-base bdi{color:rgb(var(--fg-2));font-weight:600;white-space:nowrap}
.sys-zoom{margin-top:var(--s-6)}
@media (prefers-reduced-motion:reduce){.sys-pkt{display:none}}

/* the zoom below the board reuses the old cycle map: lift its buttons to the 44 px law here, not in app.css */
#screen-system .cyc-btn{min-height:44px}

.sys-legend{display:flex;flex-wrap:wrap;align-items:center;gap:4px var(--s-4);margin:0 0 var(--s-3);font-size:12px;color:rgb(var(--fg-3))}
.sys-lg{margin-inline-end:6px;font-size:12px;color:rgb(var(--fg-2))}
.sys-legend .sys-tag2{border-style:dashed}
