/* Desk & homelab viewer styles. Dark UI; colours as tokens on :root. */
:root {
  --bg: #0f1114; --panel: #171a1f; --panel-2: #1e222a; --line: #2b3039; --text: #e6e8eb; --muted: #9aa1ac;
  --teal: #14b8a6; --purple: #8b5cf6; --gray: #8b929c;
  --pass: #34d399; --warn: #fbbf24; --fail: #f87171; --info: #60a5fa;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
#app { position: relative; height: 100%; overflow: hidden; overflow: clip; }
#stage { position: absolute; inset: 0; overflow: hidden; }
#stage canvas { display: block; }
#labels { position: absolute; inset: 0; pointer-events: none; }
#panel { position: absolute; top: 0; right: 0; bottom: 0; width: 340px; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; z-index: 20;
  transform: translateX(105%); transition: transform .22s ease; box-shadow: -12px 0 30px rgba(0,0,0,.35); }
#panel.open { transform: none; }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.iconbtn { background: rgba(23,26,31,.88); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 11px; font: 600 13px/1 inherit; cursor: pointer; backdrop-filter: blur(6px); }
#menuBtn { position: absolute; top: 12px; right: 12px; z-index: 10; }
#popup { position: absolute; left: 16px; bottom: 16px; width: 380px; max-height: calc(100% - 76px); overflow-y: auto; z-index: 15;
  background: rgba(23,26,31,.96); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
#popup[hidden] { display: none; }
#sysw { position: absolute; top: 12px; left: 12px; z-index: 16; width: 250px; background: rgba(23,26,31,.9); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; backdrop-filter: blur(8px); max-height: calc(100% - 80px); overflow-y: auto; }
#sysw .top { display: flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; }
#sysw .chev { margin-left: auto; color: var(--muted); font-size: 11px; }
#sysw .grp { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin: 9px 0 4px; }
#sysw button { display: block; width: 100%; text-align: left; margin: 0 0 4px; padding: 5px 8px; font-size: 12px; background: rgba(255,255,255,.03); }
#sysw button.on { background: #2f3b4c; border-color: #4b5d78; }
#sysw button i { color: var(--muted); font-style: normal; }
#popup .sysnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 12px; }
#popup .sysnav button { padding: 3px 12px; }
@media (max-width: 760px) {
  #sysw { width: 210px; top: 10px; left: 10px; max-height: calc(100% - 20px); }
}
#popup .ph { display: flex; gap: 10px; align-items: flex-start; }
#popup .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
#popup .pt { font-size: 15px; font-weight: 650; line-height: 1.25; }
#popup .pg { color: var(--muted); font-size: 12px; margin-top: 2px; }
#popup .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; }
#popup .role { margin: 10px 0 4px; color: var(--text); }
#popup h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
#popup ul { margin: 0; padding-left: 18px; color: #cdd2d8; }
#popup .links { display: flex; flex-wrap: wrap; gap: 6px; }
#popup .links a { color: #93c5fd; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
#popup .links a:hover { border-color: #3b4b63; }
#popup .pa { margin-top: 12px; display: flex; gap: 8px; }
section { padding: 12px 14px; border-bottom: 1px solid var(--line); }
h1 { font-size: 15px; margin: 0 0 2px; }
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.sub { color: var(--muted); font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
button, .seg label { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; font: inherit; cursor: pointer; }
button:hover, .seg label:hover { border-color: #444b57; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg input { display: none; }
.seg label { border: 0; border-radius: 0; }
.seg input:checked + label { background: #2f3b4c; color: #fff; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.toggles label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.field { margin-bottom: 8px; }
.field > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sw.line { height: 3px; vertical-align: 2px; }
.sw.dash { background: none !important; border: 1px dashed var(--muted); }
.summary { display: flex; gap: 8px; margin-bottom: 8px; }
.pill { border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.pill.fail { background: #4a1d1d; color: var(--fail); } .pill.warn { background: #45360f; color: var(--warn); }
.pill.pass { background: #133a2c; color: var(--pass); } .pill.info { background: #172a45; color: var(--info); }
.check { border-left: 3px solid var(--line); padding: 4px 0 4px 8px; margin-bottom: 6px; }
.check.fail { border-color: var(--fail); } .check.warn { border-color: var(--warn); } .check.pass { border-color: var(--pass); } .check.info { border-color: var(--info); }
.check .t { font-weight: 600; }
.check .d { color: var(--muted); font-size: 12px; word-break: break-word; }
.basis { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 0 5px; border-radius: 3px; margin-left: 4px; vertical-align: 1px; }
.basis.placeholder, .tag.placeholder { background: #3b2a12; color: #f5b85a; }
.basis.approx, .tag.approx { background: #1d2c3f; color: #8cb8ef; }
.tag.confirmed { background: #153626; color: #6ee7b7; }
.tag.tentative { background: transparent; color: #cbd5e1; border: 1px dashed #64748b; }
.wiresub { margin: 4px 0 0 22px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.wiresub[hidden] { display: none; }
.tag { font-size: 10px; padding: 0 5px; border-radius: 3px; margin-left: 4px; }
details summary { cursor: pointer; color: var(--muted); margin: 4px 0; }
table.dims { width: 100%; border-collapse: collapse; font-size: 12px; }
table.dims td { padding: 2px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.dims td:first-child { color: var(--muted); width: 38%; }
.ulabel { font: 600 10px/1 ui-monospace, Menlo, monospace; color: #8f97a3; }
.dlabel { font-size: 10px; color: #e6e8eb; background: rgba(15,17,20,.72); padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.dlabel.g-network { color: #2dd4bf; } .dlabel.g-compute { color: #a78bfa; } .dlabel.g-power, .dlabel.g-passive { color: #b4bac3; }
.dlabel.g-workspace { color: #fbbf24; } .dlabel.g-entertainment { color: #fb7185; }
.dlabel.g-reserved { color: #b4bac3; font-style: italic; border: 1px dashed #6b7280; }
.dlabel.bad { box-shadow: 0 0 0 1px var(--fail); }
.legend .tx { font-weight: 600; }
#hint { position: absolute; left: 12px; bottom: 10px; color: var(--muted); font-size: 11px; pointer-events: none; }
@media (max-width: 760px) {
  #panel { width: 100%; border-left: 0; }
  #popup { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 48%; }
  #hint { display: none; }
}
