/* NetWizxrd Lights — interface (plan 0023). System font, no external assets. Dark first.
   Information design after classic NMS consoles (status, alerts, top-N); finish after macOS. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --r: 20px; --r-s: 12px; --gap: 16px;
  --ease: cubic-bezier(.22, .8, .24, 1);

  --bg: #050608; --bg-glow1: rgba(10, 132, 255, .10); --bg-glow2: rgba(191, 90, 242, .07);
  --card: rgba(24, 26, 32, .66); --card-hi: rgba(255, 255, 255, .035); --sheet: rgba(26, 28, 34, .86); --solid: #191b21; --topbar: rgba(5, 6, 8, .94);
  --line: rgba(255, 255, 255, .07); --line2: rgba(255, 255, 255, .13);
  --text: #f5f5f7; --dim: #a1a1a8; --faint: #6b6b73; --fill: rgba(255, 255, 255, .06); --fill2: rgba(255, 255, 255, .10);
  --cpu: #0a84ff; --cpu2: #64d2ff; --mem: #bf5af2; --mem2: #ff6ec7; --mem3: #5e5ce6;
  --in: #30d158; --out: #ff9f0a; --inbound: #ff375f;
  --internet: #7d7aff; --lan: #64d2ff; --loopback: #98989d;
  --info: #98989d; --notice: #0a84ff; --warn: #ff9f0a; --alert: #ff453a; --ok: #30d158;
  --s-up: #30d158; --s-warning: #ff9f0a; --s-critical: #ff453a; --s-unknown: #8e8e93; --warmlight: #ffd60a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f2f6; --bg-glow1: rgba(0, 122, 255, .08); --bg-glow2: rgba(175, 82, 222, .06);
  --card: rgba(255, 255, 255, .78); --card-hi: rgba(255, 255, 255, .6); --sheet: rgba(255, 255, 255, .92); --solid: #fbfbfd; --topbar: rgba(242, 242, 246, .95);
  --line: rgba(0, 0, 0, .07); --line2: rgba(0, 0, 0, .13);
  --text: #1d1d1f; --dim: #5d5d63; --faint: #8e8e93; --fill: rgba(0, 0, 0, .045); --fill2: rgba(0, 0, 0, .08);
  --cpu: #007aff; --cpu2: #32ade6; --mem: #af52de; --mem2: #ff2d92; --mem3: #5856d6;
  --in: #248a3d; --out: #c93400; --inbound: #e0234e;
  --internet: #5856d6; --lan: #0071a4; --loopback: #8e8e93;
  --info: #8e8e93; --notice: #007aff; --warn: #c93400; --alert: #d70015; --ok: #248a3d;
  --s-up: #248a3d; --s-warning: #c93400; --s-critical: #d70015; --s-unknown: #6e6e73; --warmlight: #e8a200;
  --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 12px 40px -18px rgba(0, 0, 0, .25);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #f2f2f6; --bg-glow1: rgba(0, 122, 255, .08); --bg-glow2: rgba(175, 82, 222, .06);
    --card: rgba(255, 255, 255, .78); --card-hi: rgba(255, 255, 255, .6); --sheet: rgba(255, 255, 255, .92); --solid: #fbfbfd; --topbar: rgba(242, 242, 246, .95);
    --line: rgba(0, 0, 0, .07); --line2: rgba(0, 0, 0, .13);
    --text: #1d1d1f; --dim: #5d5d63; --faint: #8e8e93; --fill: rgba(0, 0, 0, .045); --fill2: rgba(0, 0, 0, .08);
    --cpu: #007aff; --cpu2: #32ade6; --mem: #af52de; --mem2: #ff2d92; --mem3: #5856d6;
    --in: #248a3d; --out: #c93400; --inbound: #e0234e;
    --internet: #5856d6; --lan: #0071a4; --loopback: #8e8e93;
    --info: #8e8e93; --notice: #007aff; --warn: #c93400; --alert: #d70015; --ok: #248a3d;
    --s-up: #248a3d; --s-warning: #c93400; --s-critical: #d70015; --s-unknown: #6e6e73; --warmlight: #e8a200;
  --s-up: #248a3d; --s-warning: #c93400; --s-critical: #d70015; --s-unknown: #6e6e73; --warmlight: #e8a200;
    --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 12px 40px -18px rgba(0, 0, 0, .25);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); min-height: 100vh;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1;
  background-image: radial-gradient(1200px 700px at 12% -10%, var(--bg-glow1), transparent 60%),
                    radial-gradient(1000px 700px at 100% 0%, var(--bg-glow2), transparent 60%);
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cpu); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--sheet); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 12px; }
[hidden] { display: none !important; }

/* ---- top bar ---------------------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 22px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
/* owner's NetWizxrd wordmark, exactly as on his other projects: lowercase Menlo Bold, -0.045em, 'wiz' in #0a84ff;
   'lights' beside it in the same face, regular weight, so the pair reads as one lockup */
.brand .word { display: inline-flex; align-items: baseline; gap: .42em; font-family: Menlo, 'SF Mono', ui-monospace, monospace; font-size: 16px; line-height: 1; }
.brand .wm { font-weight: 700; letter-spacing: -0.045em; color: var(--text); }
.brand .wm .wiz { color: #0a84ff; }
.brand .prod { font-weight: 400; letter-spacing: -0.02em; color: var(--dim); }
.brand { text-decoration: none; color: inherit; }
.bulb { width: 22px; height: 22px; overflow: visible; }
.bulb .glass { fill: color-mix(in srgb, var(--warmlight) 85%, transparent); stroke: var(--warmlight); stroke-width: 1.2;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--warmlight) 70%, transparent)); animation: glow 1.6s ease-in-out 1; }
.bulb .base { fill: none; stroke: var(--dim); stroke-width: 1.6; stroke-linecap: round; }
@keyframes glow { 50% { filter: drop-shadow(0 0 11px color-mix(in srgb, var(--warmlight) 55%, transparent)); } }
.crumbs { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line); font-size: 13px; color: var(--dim); white-space: nowrap; min-width: 0; }
.crumbs a { color: var(--text); text-decoration: none; font-weight: 550; }
.crumbs a:hover { text-decoration: underline; }
.host { display: flex; flex-direction: column; line-height: 1.15; padding-left: 14px; border-left: 1px solid var(--line); min-width: 0; }
.host-name { font-weight: 600; }
.host-meta { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.knock-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line2);
  background: var(--fill); font-size: 13px; font-weight: 550; transition: background .3s, border-color .3s, color .3s; white-space: nowrap; }
.knock-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.knock-pill.knocked { border-color: color-mix(in srgb, var(--alert) 60%, transparent); background: color-mix(in srgb, var(--alert) 14%, transparent); color: var(--text); }
.knock-pill.knocked .dot { background: var(--alert); box-shadow: 0 0 10px var(--alert); animation: pulse 1.6s ease-out 3; }   /* on change, then still */
.knock-pill.watch .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--alert) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.badge { font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.badge.mock { color: var(--warn); border: 1px dashed color-mix(in srgb, var(--warn) 60%, transparent); }
.conn-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.conn-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.conn-state[data-state="live"] .dot { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.conn-state[data-state="paused"] .dot { background: var(--warn); }
.conn-state[data-state="reconnecting"] .dot, .conn-state[data-state="down"] .dot { background: var(--alert); }
.controls { display: flex; align-items: center; gap: 10px; }
.tool { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line2);
  background: var(--fill); font-size: 13px; transition: background .2s; }
.tool:hover { background: var(--fill2); }
.tool[aria-pressed="true"] { background: color-mix(in srgb, var(--warn) 18%, transparent); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.ic-pause { width: 9px; height: 10px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.tool[aria-pressed="true"] .ic-pause { width: 0; height: 0; border: 0; border-left: 9px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--fill2); position: relative; transition: background .25s var(--ease); }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track .thumb { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--cpu); outline-offset: 2px; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; color: var(--dim); transition: background .2s, color .2s; }
.seg button[aria-checked="true"] { background: var(--fill2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.seg.small button { padding: 3px 9px; font-size: 12px; }

.coverage { margin: 14px 22px 0; padding: 10px 14px; border-radius: var(--r-s); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 9%, transparent); color: var(--text); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.coverage .ic { color: var(--warn); font-weight: 700; }
.coverage.calm { border-color: var(--line2); background: var(--fill); }
.coverage.calm .ic { color: var(--dim); }
.coverage li.dim { color: var(--dim); }
.glance .self { margin: 0; font-size: 11.5px; color: var(--faint); }
.coverage ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.coverage b { font-weight: 600; }

/* ---- layout ----------------------------------------------------------------------------- */
.page { padding: 16px 22px 24px; display: flex; flex-direction: column; gap: var(--gap); }
.page > .coverage { margin: 0; }
.view[hidden] { display: none !important; }
.grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
.grid.two { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .grid.two { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.summary { grid-template-areas: "alerts" "exposure" "tophead" "t1" "t2" "t3" "t4" "last"; }
.vitals-row { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .vitals-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#alertsCard { grid-area: alerts; } #exposure { grid-area: exposure; } #lastEvents { grid-area: last; }
#topHead { grid-area: tophead; }
#topTalkers { grid-area: t1; } #topRemote { grid-area: t2; } #topCpu { grid-area: t3; } #topMem { grid-area: t4; }
@media (min-width: 760px) { .summary { grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "alerts alerts" "exposure last" "tophead tophead" "t1 t2" "t3 t4"; } }
@media (min-width: 1100px) { .summary { grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "alerts alerts alerts alerts alerts alerts alerts alerts exposure exposure exposure exposure"
    "tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead"
    "t1 t1 t1 t2 t2 t2 t3 t3 t3 t4 t4 t4"
    "last last last last last last last last last last last last"; } }
@media (min-width: 2200px) {
  .summary { grid-template-columns: repeat(16, minmax(0, 1fr));
    grid-template-areas:
      "alerts alerts alerts alerts alerts alerts exposure exposure exposure exposure last last last last last last"
      "tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead"
      "t1 t1 t1 t1 t2 t2 t2 t2 t3 t3 t3 t3 t4 t4 t4 t4"; }
  body { font-size: 15px; }
}

/* ---- status: colour plus glyph plus word, everywhere ----------------------------------------- */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--sc); --sc: var(--s-unknown); }
.st i { width: 15px; height: 15px; border-radius: 50%; background: var(--sc); display: inline-grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; flex: none; }
.st[data-status="up"] { --sc: var(--s-up); } .st[data-status="up"] i::before { content: "✓"; }
.st[data-status="warning"] { --sc: var(--s-warning); } .st[data-status="warning"] i { border-radius: 3px; transform: rotate(45deg) scale(.86); } .st[data-status="warning"] i::before { content: "!"; transform: rotate(-45deg); }
.st[data-status="critical"] { --sc: var(--s-critical); } .st[data-status="critical"] i::before { content: "✕"; }
.st[data-status="unknown"] i::before { content: "?"; }

/* node list (only with more than one node) */
.ntable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ntable th { text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.ntable td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ntable .num { text-align: right; font-variant-numeric: tabular-nums; }
.ntable tbody tr { cursor: pointer; transition: background .15s; }
.ntable tbody tr:hover, .ntable tbody tr:focus-visible { background: var(--fill); outline: none; }
.ntable tr.sel { background: color-mix(in srgb, var(--cpu) 10%, transparent); }
.mono { font-family: var(--mono); font-size: 12px; }

/* node status header */
.node-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 22px; align-items: center; }
.status-badge { --sc: var(--s-unknown); width: 104px; height: 104px; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: color-mix(in srgb, var(--sc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent); color: var(--sc);
  box-shadow: 0 0 40px -10px color-mix(in srgb, var(--sc) 60%, transparent); transition: background .4s, border-color .4s, color .4s; }
.status-badge .sico { width: 40px; height: 40px; border-radius: 50%; background: var(--sc); display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800; }
.status-badge .sword { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.status-badge[data-status="up"] { --sc: var(--s-up); } .status-badge[data-status="up"] .sico::before { content: "✓"; }
.status-badge[data-status="warning"] { --sc: var(--s-warning); } .status-badge[data-status="warning"] .sico { border-radius: 9px; transform: rotate(45deg) scale(.8); } .status-badge[data-status="warning"] .sico::before { content: "!"; transform: rotate(-45deg); font-size: 26px; }
.status-badge[data-status="critical"] { --sc: var(--s-critical); } .status-badge[data-status="critical"] .sico::before { content: "✕"; }
.status-badge[data-status="critical"] .sico { animation: pulse 1.8s ease-out 3; }
.status-badge[data-status="unknown"] .sico::before { content: "?"; }
.node-id h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.node-meta { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.reason { margin: 8px 0 0; font-size: 16px; font-weight: 550; }
.reason[data-status="warning"] { color: var(--s-warning); } .reason[data-status="critical"] { color: var(--s-critical); } .reason[data-status="unknown"] { color: var(--dim); }
.kpis { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.kpis div { background: var(--fill); border-radius: 12px; padding: 8px 12px; }
.kpis dt { font-size: 11.5px; color: var(--dim); }
.kpis dd { margin: 2px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpis dd small { font-size: 12px; color: var(--dim); font-weight: 500; margin-left: 2px; }
.kpis .crit { color: var(--s-critical); } .kpis .warn { color: var(--s-warning); }
@media (min-width: 1100px) { .node-head { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.25fr); } .kpis { grid-column: auto; } }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; font-size: 13.5px; color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: background .2s, color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--sheet); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); font-weight: 600; }
.tabs .count:empty { display: none; }
.tabs .count { font-size: 11px; font-weight: 700; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--fill2); color: var(--dim); text-align: center; }
#tcAlerts { background: var(--s-warning); color: #fff; } #tcAlerts[data-sev="critical"] { background: var(--s-critical); }

/* alerts */
.alist { display: flex; flex-direction: column; gap: 8px; }
.arow { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 12px; border-radius: 14px; background: var(--fill);
  border: 1px solid transparent; }
.arow[data-state="active"][data-sev="critical"] { border-color: color-mix(in srgb, var(--s-critical) 45%, transparent); background: color-mix(in srgb, var(--s-critical) 9%, var(--fill)); }
.arow[data-state="active"][data-sev="warning"] { border-color: color-mix(in srgb, var(--s-warning) 35%, transparent); }
.arow[data-state="acknowledged"], .arow[data-state="cleared"] { opacity: .62; }
.arow .t { font-weight: 600; font-size: 13.5px; line-height: 1.3; } .arow .d { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.arow .m { display: flex; gap: 8px; align-items: center; margin-top: 5px; font-size: 11.5px; color: var(--faint); flex-wrap: wrap; }
.arow .m .kind, .ev .m .kind { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--fill); color: var(--dim); }
.subj { border: 0; background: none; padding: 0; color: var(--cpu); font-size: 11.5px; }
.subj:hover { text-decoration: underline; }
.ack { border: 1px solid var(--line2); background: var(--sheet); border-radius: 9px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .2s, border-color .2s; }
.ack:hover { border-color: var(--cpu); background: color-mix(in srgb, var(--cpu) 14%, var(--sheet)); }
.ack:disabled { opacity: .6; cursor: default; }
.astate { font-size: 12px; color: var(--dim); white-space: nowrap; padding-top: 6px; }
.allclear { display: flex; flex-direction: column; gap: 6px; padding: 18px 6px; }
.allclear .st { font-size: 15px; } .allclear .st i { width: 20px; height: 20px; font-size: 12px; }
.alerts-card.hot { border-color: color-mix(in srgb, var(--s-warning) 30%, var(--line)); }
.alist.compact .arow { grid-template-columns: 86px minmax(0, 1fr) auto; }
.more { border: 0; background: none; color: var(--cpu); font-size: 12.5px; padding: 2px 0; }
.more:hover { text-decoration: underline; }
.drow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* last events (summary) */
.mini-events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 18px; }
.mini-events li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.mini-events li:hover { background: var(--fill); }
.mini-events .sev { width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
.mini-events [data-sev="notice"] .sev { background: var(--notice); } .mini-events [data-sev="warn"] .sev { background: var(--warn); } .mini-events [data-sev="alert"] .sev { background: var(--alert); box-shadow: 0 0 8px var(--alert); }
.mini-events .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-events time { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.mini-events .empty, .toplist .empty { color: var(--dim); font-size: 13px; padding: 8px 4px; border: 0; cursor: default; display: block; }

/* Top 10 */
.top-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 0; }
.top-head h2 { font-size: 15px; color: var(--text); }
.toplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.trow { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-rows: auto 4px; gap: 3px 8px; padding: 6px 6px; border-radius: 9px; cursor: pointer; }
.trow:hover, .trow:focus-visible { background: var(--fill); outline: none; }
.trow:focus-visible { box-shadow: 0 0 0 2px var(--cpu) inset; }
.trow .rk { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: right; padding-top: 1px; }
.trow .tl { min-width: 0; display: flex; flex-direction: column; }
.trow .tn { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .ts { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tv { font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.trow .tb { grid-column: 2 / 4; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.trow .tb i { display: block; height: 100%; border-radius: 2px; background: var(--bar, var(--cpu)); width: 0; }
#topTalkers { --bar: var(--in); } #topRemote { --bar: var(--internet); } #topCpu { --bar: var(--cpu); } #topMem { --bar: var(--mem); }

/* exposure (summary) */
.ex-line { margin: 0 0 8px; font-size: 13.5px; } .ex-line b { font-size: 20px; } .ex-line .warn { color: var(--s-warning); font-weight: 600; }
.ex-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.exrow { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 92px 118px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 6px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.exrow:hover, .exrow:focus-visible { background: var(--fill); outline: none; }
.exrow .exp { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; } .exrow .exp small { color: var(--dim); font-weight: 500; font-size: 11px; }
.exrow .exw { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exrow .note { grid-column: 2 / 4; font-size: 11.5px; }
.door.flag { border-color: color-mix(in srgb, var(--s-warning) 50%, transparent); }
.door .why { margin-top: 4px; }

.foot { display: flex; gap: 16px; justify-content: flex-end; color: var(--faint); font-size: 11.5px; padding: 0 4px; }
.vitals-row.nodata .vital { opacity: .45; }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow);
  min-width: 0; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, var(--card-hi), transparent 40%); }
h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.hint { color: var(--dim); font-size: 12.5px; }

/* ---- vitals ----------------------------------------------------------------------------- */
.vital { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.vital-body { position: relative; display: grid; grid-template-columns: 116px 1fr; gap: 16px; align-items: center; }
.ring { width: 116px; height: 116px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--fill2); }
.ring-fg { stroke-linecap: round; }
.cpu .ring-fg { stroke: var(--cpu); }
.mem .ring-fg { stroke: var(--mem); }
.ring-val { position: absolute; left: 0; top: 0; width: 116px; height: 116px; display: flex; align-items: baseline; justify-content: center; padding-top: 40px; }
.big { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1; }
.unit { font-size: 13px; color: var(--dim); margin-left: 2px; font-weight: 500; }
.vital-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--dim); }
.kv b { color: var(--text); font-weight: 550; }
.cores { height: 54px; }
.cores svg { display: block; width: 100%; height: 100%; }
.core-bg { fill: var(--fill); }
.core-fg { fill: var(--cpu); }
.core-fg.e { fill: color-mix(in srgb, var(--cpu) 65%, var(--fill2)); }
.core-fg.hot { fill: var(--out); }
.membar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--fill); }
.membar svg { display: block; width: 100%; height: 100%; }
.membar .app { fill: var(--mem); } .membar .wired { fill: var(--mem3); } .membar .comp { fill: var(--mem2); }
.legend-mini .app::before { background: var(--mem); }
.legend-mini .wired::before { background: var(--mem3); }
.legend-mini .comp::before { background: var(--mem2); }
.legend-mini { display: flex; gap: 10px; font-size: 11px; color: var(--dim); flex-wrap: wrap; }
.legend-mini .k::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }
.pressure { font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; text-transform: none;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pressure[data-p="warn"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.pressure[data-p="critical"] { color: var(--alert); background: color-mix(in srgb, var(--alert) 16%, transparent); }
.spark { width: 100%; height: 44px; display: block; margin-top: auto; }
.vital .spark { flex: 1 1 44px; min-height: 44px; max-height: 180px; height: auto; }
.spark path.line { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.cpu .spark .line { stroke: var(--cpu); } .cpu .spark .area { fill: url(#gCpu); }
.mem .spark .line { stroke: var(--mem); } .mem .spark .area { fill: url(#gMem); }
.net .spark .line.rx { stroke: var(--in); } .net .spark .area.rx { fill: url(#gRx); }
.net .spark .line.tx { stroke: var(--out); }
.rates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rate { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.rate .arrow { font-size: 20px; font-weight: 700; margin-right: 2px; }
.rate.down .arrow { color: var(--in); } .rate.up .arrow { color: var(--out); }
.rate .sub { width: 100%; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.ifaces { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12px; color: var(--dim); }
.ifaces li { display: flex; gap: 8px; align-items: baseline; }
.ifaces .nm { font-family: var(--mono); font-size: 11.5px; color: var(--text); min-width: 46px; }
.ifaces .lb { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ifaces .r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ifaces .r .d { color: var(--in); } .ifaces .r .u { color: var(--out); }

.glance .headline { margin: 4px 0 4px; font-size: 21px; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.glance .headline.quiet { color: var(--text); }
.glance .headline.knocked { color: var(--alert); }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.facts div { min-width: 0; }
.facts dt { font-size: 11.5px; color: var(--dim); }
.facts dd { margin: 1px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.facts dd small { display: block; font-size: 11.5px; color: var(--dim); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scopebar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--fill); margin-top: auto; }
.scopebar i { height: 100%; width: 0; }
.scopebar .internet { background: var(--internet); } .scopebar .lan { background: var(--lan); } .scopebar .loopback { background: var(--loopback); }

/* ---- traffic ---------------------------------------------------------------------------- */
.traffic { display: flex; flex-direction: column; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--dim); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 18px; height: 3px; border-radius: 2px; }
.legend .sw.out { background: var(--out); } .legend .sw.in { background: var(--in); }
.legend .sw.inbound { background: repeating-linear-gradient(90deg, var(--inbound) 0 4px, transparent 4px 7px); }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.legend .dot.internet { background: var(--internet); } .legend .dot.lan { background: var(--lan); } .legend .dot.loopback { background: var(--loopback); }
.stage { position: relative; flex: 1; min-height: 440px; height: min(62vh, 640px); border-radius: var(--r-s); overflow: hidden;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--cpu) 7%, transparent), transparent 70%); }
@media (min-width: 2200px) { .stage { height: auto; min-height: 560px; } }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
.stage canvas.hand { cursor: pointer; }
.tip { position: absolute; z-index: 3; pointer-events: none; max-width: 300px; padding: 9px 12px; border-radius: 11px; font-size: 12.5px; line-height: 1.4;
  background: var(--solid); border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.tip b { font-weight: 600; } .tip .dim { color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--fill);
  font-size: 12px; transition: background .2s, border-color .2s; }
.chip:hover { background: var(--fill2); border-color: var(--line2); }
.chip .rt { color: var(--dim); font-variant-numeric: tabular-nums; }
.av { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none;
  background: linear-gradient(140deg, hsl(var(--h, 210) 70% 58%), hsl(calc(var(--h, 210) + 40) 70% 46%)); }

/* ---- who's knocking --------------------------------------------------------------------- */
.knocks { display: flex; flex-direction: column; min-height: 0; }
.knocks:focus { outline: none; }
.timeline { list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1;
  max-height: min(62vh, 640px); min-height: 200px; scrollbar-width: thin; }
@media (min-width: 2200px) { .timeline { max-height: none; } }
.ev { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--fill); border: 1px solid transparent;
  animation: slidein .5s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.ev .sev { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--info); }
.ev[data-sev="notice"] .sev { background: var(--notice); }
.ev[data-sev="warn"] .sev { background: var(--warn); }
.ev[data-sev="alert"] .sev { background: var(--alert); box-shadow: 0 0 10px var(--alert); }
.ev .t { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.ev .d { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.ev .m { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 11.5px; color: var(--faint); flex-wrap: wrap; }
.ev .m .kind { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--fill); color: var(--dim); }
.ev .m .subj { border: 0; background: none; padding: 0; color: var(--cpu); font-size: 11.5px; text-decoration: none; }
.ev .m .subj:hover { text-decoration: underline; }
.ev.knock { border-color: color-mix(in srgb, var(--alert) 45%, transparent); background: color-mix(in srgb, var(--alert) 9%, var(--fill)); }
.ev.knock .t { font-size: 15px; }
.ev.knock.fresh::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--alert); animation: ring 1.6s ease-out 3; pointer-events: none; }
@keyframes ring { from { opacity: .9; } to { opacity: 0; transform: scale(1.03); } }
.timeline .empty { color: var(--dim); font-size: 13px; padding: 20px 4px; text-align: center; }

/* ---- doors ------------------------------------------------------------------------------ */
.door-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.door { position: relative; text-align: left; border: 1px solid var(--line); background: var(--fill); border-radius: 14px; padding: 12px 12px 10px 46px; min-height: 74px;
  transition: background .2s, border-color .2s, transform .2s var(--ease); }
.door:hover { background: var(--fill2); transform: translateY(-1px); }
.door .frame { position: absolute; left: 12px; top: 12px; width: 24px; height: 34px; border-radius: 4px 4px 1px 1px; border: 2px solid var(--faint); overflow: hidden; perspective: 60px; }
.door .leaf { position: absolute; inset: 1px; border-radius: 2px 2px 0 0; background: var(--fill2); transform-origin: left center; transition: transform .8s var(--ease); }
.door .knob { position: absolute; right: 3px; top: 15px; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.door.open .frame { border-color: var(--warn); box-shadow: 0 0 14px -2px color-mix(in srgb, var(--warn) 70%, transparent); }
.door.open .frame::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 60%, transparent), transparent); }
.door.open .leaf { transform: rotateY(-58deg); background: color-mix(in srgb, var(--warn) 30%, var(--fill2)); }
.door .port { font-size: 20px; font-weight: 650; letter-spacing: -.01em; line-height: 1.1; }
.door .port { white-space: nowrap; }
.door .port small { font-size: 11px; color: var(--dim); font-weight: 500; margin-left: 4px; }
.door .who { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.door .bind { font-size: 11px; color: var(--dim); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.door .reach { font-size: 11px; font-weight: 600; margin-top: 3px; }
.door.open .reach { color: var(--warn); }
.door:not(.open) .reach { color: var(--dim); font-weight: 500; }
.door.new { animation: doorin 1s var(--ease); }
@keyframes doorin { from { opacity: 0; transform: scale(.9); } }

/* ---- programs --------------------------------------------------------------------------- */
.search { height: 30px; width: 200px; max-width: 50%; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line2); background: var(--fill); outline: none; }
.search:focus { border-color: var(--cpu); }
.table-wrap { overflow: auto; max-height: 520px; scrollbar-width: thin; }
.ptable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ptable th { position: sticky; top: 0; z-index: 1; background: var(--sheet); text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; padding: 0; border-bottom: 1px solid var(--line); }
.ptable th button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; cursor: pointer; }
.ptable th button:focus-visible { outline: 2px solid var(--cpu); outline-offset: -2px; }
.ptable th.num, .ptable td.num { text-align: right; }
.ptable th[aria-sort="ascending"] button::after { content: " ▲"; font-size: 9px; }
.ptable th[aria-sort="descending"] button::after { content: " ▼"; font-size: 9px; }
.ptable th[aria-sort="ascending"], .ptable th[aria-sort="descending"] { color: var(--text); }
.ptable td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable tbody tr { cursor: pointer; transition: background .15s; }
.ptable tbody tr:hover, .ptable tbody tr:focus-visible { background: var(--fill); outline: none; }
.ptable .pn { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ptable .pn .n { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.ptable .pn .pid { color: var(--faint); font-size: 11px; }
.sig { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; color: var(--dim); }
.sig::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.sig.apple::before { background: var(--ok); } .sig.team::before { background: var(--lan); }
.sig.adhoc::before { background: var(--warn); opacity: .7; }
.sig.unsigned { color: var(--alert); font-weight: 600; } .sig.unsigned::before { background: var(--alert); }
.bar { position: relative; display: inline-block; min-width: 54px; }
.bar::before { content: ""; position: absolute; right: 0; bottom: -3px; height: 2px; width: var(--w, 0%); border-radius: 1px; background: var(--c, var(--cpu)); opacity: .7; }
.rx { color: var(--in); } .tx { color: var(--out); } .zero { color: var(--faint); }

/* ---- drawer, toasts --------------------------------------------------------------------- */
.drawer { position: fixed; z-index: 40; top: 64px; right: 16px; bottom: 16px; width: min(680px, calc(100vw - 32px)); display: flex; flex-direction: column;
  background: var(--sheet); border: 1px solid var(--line2); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  background: var(--solid); animation: sheet .35s var(--ease); }
@keyframes sheet { from { opacity: 0; transform: translateX(24px); } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title .tt { font-size: 18px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.drawer-title .tt .av { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.drawer-title .st-sub { color: var(--dim); font-size: 12px; margin-top: 4px; word-break: break-all; font-family: var(--mono); }
.close { border: 0; background: var(--fill); width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }
.close:hover { background: var(--fill2); }
.drawer-body { overflow: auto; padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.stat { background: var(--fill); border-radius: 12px; padding: 9px 11px; }
.stat .l { font-size: 11px; color: var(--dim); } .stat .v { font-size: 16px; font-weight: 600; }
.drawer h3 { margin: 0 0 6px; font-size: 12px; color: var(--dim); font-weight: 600; letter-spacing: .02em; }
.tscroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.ctable { width: 100%; border-collapse: collapse; font-size: 12px; }
.ctable th { text-align: left; color: var(--dim); font-weight: 500; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.ctable td { padding: 5px 6px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.ctable td.num, .ctable th.num { text-align: right; }
.dirtag { font-family: var(--font); font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; }
.dirtag.out { color: var(--out); background: color-mix(in srgb, var(--out) 14%, transparent); }
.dirtag.in { color: var(--inbound); background: color-mix(in srgb, var(--inbound) 14%, transparent); }
.scopetag { font-family: var(--font); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--fill2); }
.scopetag.internet { color: var(--internet); } .scopetag.lan { color: var(--lan); } .scopetag.loopback { color: var(--loopback); }
.note { font-size: 12.5px; color: var(--dim); }

.toasts { position: fixed; z-index: 60; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
body.drawer-open .toasts { left: calc((100vw - min(680px, calc(100vw - 32px)) - 16px) / 2); }
.toasts { transition: left .35s var(--ease); }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; max-width: 520px; padding: 12px 16px; border-radius: 16px; background: var(--sheet);
  border: 1px solid color-mix(in srgb, var(--alert) 50%, transparent); box-shadow: 0 20px 60px -15px rgba(0, 0, 0, .55); background: var(--solid);
  animation: toastin .45s var(--ease); cursor: pointer; }
.toast.warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.toast .sev { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--alert); box-shadow: 0 0 10px var(--alert); flex: none; }
.toast.warn .sev { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.toast b { display: block; font-size: 14px; } .toast span { color: var(--dim); font-size: 12.5px; }
.toast.out { animation: toastout .35s var(--ease) forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
@keyframes toastout { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

body.paused .card { filter: saturate(.75); }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; padding: 10px 14px; }
  .controls .lbl { display: none; }
  .grid { padding: 12px 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- intrusion watch (addendum 3): first on the home screen; calm when quiet, unmissable when not */
.intrusion { --ic: var(--s-up); padding: 16px 20px; border-color: color-mix(in srgb, var(--ic) 32%, var(--line)); transition: border-color .4s, box-shadow .4s, background .4s; }
.intrusion[data-state="limited"] { --ic: var(--s-unknown); }
.intrusion[data-state="limited"] .in-glyph .ok { display: none; }
.intrusion[data-state="limited"] .in-glyph .bang { display: inline; }
.knock-pill.limited .dot { background: var(--s-unknown); box-shadow: none; }
.intrusion[data-state="activity"] { --ic: var(--s-warning); background: color-mix(in srgb, var(--s-warning) 7%, var(--card)); }
.intrusion[data-state="under_probe"] { --ic: var(--s-critical); background: color-mix(in srgb, var(--s-critical) 11%, var(--card));
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--s-critical) 55%, transparent), 0 0 46px -12px color-mix(in srgb, var(--s-critical) 75%, transparent); }
.in-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.in-glyph { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--ic) 16%, transparent); }
.in-glyph svg { width: 32px; height: 32px; }
.in-glyph .shield { fill: color-mix(in srgb, var(--ic) 30%, transparent); stroke: var(--ic); stroke-width: 1.6; stroke-linejoin: round; }
.in-glyph .mark { fill: none; stroke: var(--ic); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.in-glyph .bang, .intrusion:not([data-state="quiet"]) .in-glyph .ok { display: none; }
.intrusion:not([data-state="quiet"]) .in-glyph .bang { display: inline; }
.intrusion[data-state="under_probe"] .in-glyph { animation: alarm 1.6s ease-out 3; box-shadow: 0 0 0 3px color-mix(in srgb, var(--s-critical) 45%, transparent); }   /* rings on change, then holds */
@keyframes alarm { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-critical) 70%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.in-text h2 { margin-bottom: 2px; }
.in-head { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.intrusion:not([data-state="quiet"]) .in-head { color: var(--ic); font-size: 21px; }
.in-sub { margin: 3px 0 0; font-size: 13px; color: var(--dim); }
.in-go { align-self: start; white-space: nowrap; }
.in-table-wrap { margin-top: 12px; }
.itable { width: 100%; border-collapse: collapse; font-size: 13px; }
.itable th { text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.itable td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.itable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.itable .subj { font-size: 13.5px; font-weight: 650; font-family: var(--mono); }
.selfcost.over { color: var(--s-warning); font-weight: 600; }
.selfcost { font-size: 11.5px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 1250px) { .selfcost { display: none; } }
@media (max-width: 700px) { .in-main { grid-template-columns: auto minmax(0, 1fr); } .in-go { grid-column: 1 / -1; } }

/* hidden window: nothing moves (addendum 3) */
html.idle *, html.idle *::before, html.idle *::after { animation-play-state: paused !important; }
.intrusion[data-state="limited"] .in-head { color: var(--text); font-size: 19px; }

/* ---- neighbors (plan 0029): the list ----------------------------------------------------------- */
.nstrip { position: sticky; top: 55px; z-index: 19; display: flex; align-items: center; gap: 14px; padding: 5px 22px; min-height: 34px;
  background: var(--topbar); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ns-sum { all: unset; cursor: pointer; display: inline-flex; gap: 10px; align-items: baseline; white-space: nowrap; color: var(--dim); }
.ns-sum b { color: var(--text); font-weight: 600; }
.ns-sum:hover b { text-decoration: underline; }
.ns-sum:focus-visible { outline: 2px solid var(--cpu); outline-offset: 3px; border-radius: 4px; }
.nsnew { color: var(--cpu); font-weight: 600; }
.nsprobe { color: var(--s-critical); font-weight: 600; }
.nslim { color: var(--s-warning); }
.ns-marks { display: flex; gap: 5px; align-items: center; min-width: 0; overflow: hidden; }
.nmore { border: 0; background: none; color: var(--dim); font-size: 12px; padding: 0 4px; }
.nmore:hover { color: var(--text); }
.tabs .count.new { background: var(--cpu); color: #fff; }

.nb-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nb-net { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); }
.nb-net select { font: inherit; color: var(--text); background: var(--fill); border: 1px solid var(--line2); border-radius: 8px; padding: 3px 8px; }
.nb-net .note { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nb-trust { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; color: var(--text); }
.nb-name { height: 24px; width: 170px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line2); background: var(--fill); font-size: 12.5px; }
.nb-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nb-tools .search { width: 280px; }
.tool:disabled { opacity: .45; cursor: default; }
.nb-note { margin: 0 0 10px; font-size: 12.5px; color: var(--dim); }
.nb-wrap { max-height: none; }
.nbtable td { vertical-align: middle; }
.nbtable th button { all: unset; cursor: pointer; }
.nbtable th[aria-sort="ascending"] button::after { content: " ▲"; font-size: 9px; }
.nbtable th[aria-sort="descending"] button::after { content: " ▼"; font-size: 9px; }
.nbtable tr.isnew td:nth-child(2) b { color: var(--cpu); }
.nbtable tr.isign { opacity: .55; }
.nbname { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.tag { font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--fill2); color: var(--dim); border: 0; white-space: nowrap; }
.tag.probe { background: color-mix(in srgb, var(--s-critical) 18%, transparent); color: var(--s-critical); font-weight: 600; cursor: pointer; }
.nbstate { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--fill2); color: var(--dim); text-transform: capitalize; }
.nbstate.new { background: color-mix(in srgb, var(--cpu) 18%, transparent); color: var(--cpu); }
.nbstate.known { background: color-mix(in srgb, var(--s-up) 14%, transparent); color: var(--s-up); }
.mini { border: 1px solid var(--line2); background: var(--fill); border-radius: 7px; padding: 1px 8px; font-size: 11.5px; margin-left: 4px; }
.mini:hover { background: var(--fill2); }
.nb-label { display: flex; gap: 8px; } .nb-label input { flex: 1; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--fill); }
.nb-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==== design pass (plan 0034): one toolbar, a readable home, quieter chrome ======================= */
/* toolbar: brand, the six views, then state. Navigation lives here on every screen. */
.top { gap: 16px; padding: 10px 22px; min-height: 54px; }
.crumbs:empty { display: none; }
.spacer { flex: 1; }
.top .tabs { margin: 0 0 0 6px; padding: 0; background: none; border: 0; gap: 2px; flex-wrap: nowrap; min-width: 0; }
.top .tabs button { padding: 6px 12px; border-radius: 8px; font-size: 13.5px; color: var(--dim); transition: background .15s, color .15s; }
.top .tabs button:hover { background: var(--fill); color: var(--text); }
.top .tabs button[aria-selected="true"] { background: var(--fill2); color: var(--text); box-shadow: none; font-weight: 600; }
.top .tabs .count { margin-left: 4px; }
@media (max-width: 1180px) { .top { flex-wrap: wrap; } .top .tabs { order: 5; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; } }

/* status line: one calm sentence about this machine, under the vitals */
.node-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 12px 18px; }
.node-head .status-badge { width: auto; height: auto; flex-direction: row; gap: 8px; padding: 5px 13px 5px 6px; border-radius: 999px; box-shadow: none; flex: none; }
.node-head .status-badge .sico { width: 22px; height: 22px; font-size: 13px; }
.node-head .status-badge .sword { font-size: 13px; }
.node-id { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; min-width: 0; flex: 1 1 420px; }
.node-id h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.node-id .reason { margin: 0; font-size: 14px; font-weight: 500; order: 2; }
.node-id .node-meta { order: 3; font-size: 12.5px; color: var(--dim); flex-basis: 100%; }
.node-head .kpis { display: flex; gap: 22px; margin: 0 0 0 auto; grid-column: auto; flex: none; }
.node-head .kpis div { background: none; padding: 0; border-radius: 0; text-align: right; }
.node-head .kpis dt { font-size: 11.5px; }
.node-head .kpis dd { font-size: 18px; }
.node-head .kpis [data-k="cpu"], .node-head .kpis [data-k="mem"], .node-head .kpis [data-k="rx"], .node-head .kpis [data-k="tx"] { display: none; }   /* the vitals cards above already say it */

/* who is on this network: tiles you can read, on the home screen */
.nc-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nc-sum { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 13px; color: var(--dim); }
.nc-sum b { color: var(--text); font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.nc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 8px; }
.dev { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 11px; min-width: 0; padding: 9px 11px; border-radius: 13px;
  background: var(--fill); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.dev:hover { background: var(--fill2); }
.dev:focus-visible { outline: 2px solid var(--cpu); outline-offset: 2px; }
.dev.off { opacity: .55; }
.dev.new { border-color: color-mix(in srgb, var(--cpu) 38%, transparent); }
.dev.probing { border-color: color-mix(in srgb, var(--s-critical) 55%, transparent); background: color-mix(in srgb, var(--s-critical) 9%, var(--fill)); }
.dv-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.dv-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-sub { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dv-pill { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--cpu) 18%, transparent); color: var(--cpu); }
.dv-pill.probe { background: color-mix(in srgb, var(--s-critical) 18%, transparent); color: var(--s-critical); }
.av { position: relative; flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--fill2); color: var(--dim);
  font-size: 14px; font-weight: 650; }
.av svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.av.gw { color: var(--text); }
.av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--s-unknown); border: 2px solid var(--solid); }
.av.on::after { background: var(--s-up); }
.more-dev .av::after { display: none; } .more-dev .av { font-size: 12px; }

/* neighbours list: the device first, actions when you reach for them */
.neighbors .card-head { align-items: flex-end; margin-bottom: 14px; }
.neighbors h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; color: var(--text); }
.nb-net { gap: 8px 12px; }
.nb-net .note { gap: 6px 10px; }
.nb-name { height: 26px; }
.nbtable td { padding: 10px 10px; }
.nbdev { display: flex; align-items: center; gap: 11px; min-width: 0; }
.nbdev-t { min-width: 0; }
.nbhost { font-size: 12px; color: var(--dim); margin-top: 1px; }
.nbtable .mini { opacity: 0; transition: opacity .12s; }
.nbtable tr:hover .mini, .nbtable tr:focus-within .mini, .nbtable tr.isnew .mini { opacity: 1; }
@media (hover: none) { .nbtable .mini { opacity: 1; } }

/* coverage: a notice only when a sensor is off; the caveats of working sensors fold away */
.coverage, .coverage.calm { display: block; border: 0; background: none; padding: 0; margin: 0; font-size: 12.5px; color: var(--dim); }
.cov-off { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-s); margin-bottom: 8px;
  border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); background: color-mix(in srgb, var(--warn) 6%, var(--card)); color: var(--text); }
.cov-off .ic { color: var(--warn); font-weight: 700; }
.cov-notes { padding: 0 4px; }
.cov-notes summary { cursor: pointer; color: var(--faint); width: fit-content; }
.cov-notes summary:hover { color: var(--dim); }
.cov-notes ul { margin-top: 6px; }

/* footer: appearance and the one privacy switch live here, out of the way */
.foot { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 4px 4px 0; }
.foot-set { display: flex; align-items: center; gap: 14px; }
.foot-meta { display: flex; align-items: center; gap: 16px; }
.foot .selfcost { display: inline; }

/* summary: alerts and the latest events share the left column, exposure runs beside both (no hollow card) */
@media (min-width: 1100px) and (max-width: 2199px) { .summary { grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "alerts alerts alerts alerts alerts alerts alerts alerts exposure exposure exposure exposure"
    "last last last last last last last last exposure exposure exposure exposure"
    "tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead tophead"
    "t1 t1 t1 t2 t2 t2 t3 t3 t3 t4 t4 t4"; } }

/* neighbours header: the network's name is the title, and you rename it by typing into it */
.nb-net { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.nb-net select { order: 2; }
.nb-net .note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.nb-name { flex-basis: 100%; width: min(460px, 100%); height: 32px; padding: 0 8px; margin-left: -8px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  font-size: 20px; font-weight: 650; letter-spacing: -.015em; color: var(--text); outline: none; transition: background .15s, border-color .15s; }
.nb-name:hover { border-color: var(--line2); }
.nb-name:focus { border-color: var(--cpu); background: var(--fill); }
.nb-name::placeholder { color: var(--faint); font-weight: 600; }
.nb-meta { color: var(--dim); font-size: 12.5px; }
.nb-trust { font-size: 12.5px; color: var(--dim); }
.nb-trust input { accent-color: var(--cpu); }
/* the status column is a dot; the word stays for screen readers and sorting */
.nbtable th:first-child, .nbtable td:first-child { width: 44px; padding-right: 0; }
.nbtable th:first-child button { font-size: 0; }
.nbtable td:first-child .st { font-size: 0; gap: 0; }
.nbtable .av::after { display: none; }
