/* هفار: the contracts between the four Hvar systems, as one orbit. Edit os/mock/hvar, then here.
   Every selector sits under #screen-hvar or carries the hv- prefix so nothing leaks into the OS. */
#screen-hvar{display:none;position:relative}
#screen-hvar.active{display:block}
#screen-hvar{--hv:212 53 51;--ok:var(--tide);--warn:var(--compass);--bad:var(--beacon)}
.hv-wrap{position:relative;max-width:520px;margin:0 auto;padding:4px 2px 24px}
.hv-mono{direction:ltr;unicode-bidi:isolate;font-family:var(--mono);font-feature-settings:"tnum"}
.hv-top{display:flex;align-items:center;justify-content:flex-end;padding:2px 4px}
.hv-top .hv-mono{font-size:13px;color:rgb(var(--fg-2))}
.hv-sub{padding:0 4px 4px;font-size:12px;color:rgb(var(--fg-3))}
.hv-sub.stale{color:rgb(var(--needs));font-weight:600}
.hv-fail{padding:48px 20px;text-align:center;color:rgb(var(--fg-2));font-size:14px;line-height:1.8}

.hv-svg{display:block;width:100%;height:auto;max-height:46dvh;overflow:visible;touch-action:manipulation}
.hv-orbit{fill:none;stroke:rgb(var(--line));stroke-width:1.2;stroke-dasharray:3 5}
.hv-spoke{stroke-width:1.6;stroke:rgb(var(--fg-4))}
.hv-spoke.FAIL,.hv-spoke.DEAD{stroke:rgb(var(--bad));stroke-dasharray:4 3}
.hv-spoke.WARN{stroke:rgb(var(--warn))}
.hv-spoke.PASS{stroke:rgb(var(--ok)/.55)}
.hv-node{cursor:pointer;outline:none}
.hv-node circle{fill:rgb(var(--card));stroke-width:2.5}
.hv-node.PASS circle{stroke:rgb(var(--ok))}
.hv-node.WARN circle{stroke:rgb(var(--warn))}
.hv-node.FAIL circle,.hv-node.DEAD circle{stroke:rgb(var(--bad));filter:drop-shadow(0 0 7px rgb(var(--bad)/.55))}
.hv-node.on circle,.hv-node:focus-visible circle{stroke-width:4}
.hv-node:focus-visible circle{stroke:rgb(var(--fg))}
.hv-g{font:600 17px var(--mono);text-anchor:middle;dominant-baseline:central;fill:rgb(var(--fg))}
.hv-node.PASS .hv-g{fill:rgb(var(--ok))}.hv-node.WARN .hv-g{fill:rgb(var(--warn))}.hv-node.FAIL .hv-g,.hv-node.DEAD .hv-g{fill:rgb(var(--bad))}
.hv-id{font:500 9px var(--mono);text-anchor:middle;fill:rgb(var(--fg-3))}
.hv-lab{font:500 11px var(--sans);text-anchor:middle;fill:rgb(var(--fg-2))}
.hv-lab.FAIL,.hv-lab.DEAD{fill:rgb(var(--bad));font-weight:600}
.hv-core{font:600 30px var(--mono);text-anchor:middle;fill:rgb(var(--fg))}
.hv-corel{font:500 11px var(--sans);text-anchor:middle;fill:rgb(var(--fg-3))}
.hv-corem{font:500 11px var(--mono);text-anchor:middle;fill:rgb(var(--hv))}

.hv-card{margin:6px 0;padding:12px 14px;border:1px solid rgb(var(--line));border-radius:var(--r-2);background:rgb(var(--card))}
.hv-t{display:flex;justify-content:space-between;gap:8px;font-size:13px;font-weight:600}
.hv-t .hv-mono{font-weight:500;font-size:11px;color:rgb(var(--fg-3))}
.hv-bar{position:relative;height:8px;margin:10px 0 8px;border-radius:99px;background:rgb(var(--sunk))}
.hv-fill{position:absolute;inset-block:0;inset-inline-start:0;width:0;border-radius:99px;background:rgb(var(--ok))}
.hv-mark{position:absolute;inset-block:-3px;width:2px;background:rgb(var(--needs));text-decoration:none}
.hv-n{display:flex;justify-content:space-between;font-size:12px;color:rgb(var(--fg-2))}
.hv-n b{color:rgb(var(--fg))}
.hv-hint{margin-top:8px;font-size:11.5px;line-height:1.7;color:rgb(var(--fg-3))}
.hv-vits{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:6px}
.hv-v{padding:10px 6px;border:1px solid rgb(var(--line));border-radius:var(--r-1);background:rgb(var(--card));text-align:center;display:flex;flex-direction:column;gap:2px}
.hv-v b{font-size:18px}.hv-v i{font-style:normal;font-size:10.5px;color:rgb(var(--fg-3));line-height:1.4}.hv-v s{text-decoration:none;font-size:10px;color:rgb(var(--fg-4))}

.hv-scrim{position:fixed;inset:0;background:rgb(0 0 0/.5);z-index:40}
.hv-sheet{position:fixed;inset-inline:0;bottom:0;z-index:41;max-height:78dvh;overflow:auto;margin:0 auto;max-width:560px;padding:12px 18px calc(22px + env(safe-area-inset-bottom));background:rgb(var(--card));border-radius:22px 22px 0 0;border-top:2px solid rgb(var(--hv));box-shadow:0 -12px 40px rgb(0 0 0/.45)}
.hv-grab{width:38px;height:4px;margin:0 auto 10px;border-radius:99px;background:rgb(var(--fg-4))}
.hv-sheet h2{display:flex;align-items:center;gap:10px;font:600 17px var(--display)}
.hv-st{font:600 11px var(--mono);padding:2px 8px;border-radius:99px;border:1px solid currentColor}
.hv-st.PASS{color:rgb(var(--ok))}.hv-st.WARN{color:rgb(var(--warn))}.hv-st.FAIL,.hv-st.DEAD{color:rgb(var(--bad))}
.hv-c{margin-top:4px;font-size:11px;color:rgb(var(--fg-3))}
.hv-sum{margin:10px 0;font-size:12.5px;line-height:1.7;color:rgb(var(--fg))}
.hv-sheet dl{display:grid;grid-template-columns:auto 1fr;gap:5px 14px;font-size:12px}
.hv-sheet dt{color:rgb(var(--fg-3));text-transform:none}
.hv-sheet dd{margin:0;font-family:var(--mono);direction:ltr;unicode-bidi:isolate;overflow-wrap:anywhere;color:rgb(var(--fg))}
.hv-note{margin-top:12px;padding:10px 12px;border-radius:var(--r-1);background:rgb(var(--warn)/.12);border:1px solid rgb(var(--warn)/.5);font-size:12px;line-height:1.7}
.hv-close{display:block;width:100%;min-height:var(--tap);margin-top:14px;border:1px solid rgb(var(--line));border-radius:var(--r-1);background:transparent;color:rgb(var(--fg));font:500 14px var(--sans);cursor:pointer}
@media(prefers-reduced-motion:reduce){.hv-node circle{filter:none}}
