/* Wardline - interface styles.
   Graphite workspace whose chrome (top bar + sidebar) follows the theme, jade for actions and focus,
   a reserved severity scale and a validated categorical scale for charts. */

@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ------------------------------------------------------------------------------------------ tokens */
:root {
  color-scheme: dark;
  --font: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #121517;
  --panel: #181c1f;
  --panel-2: #1e2327;
  --panel-3: #252b30;
  --line: #2a3035;
  --line-2: #363d43;
  --text: #e6eaec;
  --text-2: #a9b2b8;
  --muted: #7c868d;
  --faint: #59626a;

  --chrome: #0d1012;
  --chrome-2: #161a1d;
  --chrome-line: #232a2f;
  --chrome-text: #d5dbde;
  --chrome-muted: #8a959c;
  --chrome-line-2: #33404a;
  --chrome-scroll: #2b343a;
  --chrome-current: #17241f;
  --chrome-current-text: #fff;
  --chrome-badge: #2a1823;
  --chrome-badge-text: #ff9cc8;
  --chrome-badge-neutral: #1f272c;
  --avatar: #24313a;
  --avatar-text: #cfe7dd;
  --scope-ring: #1f3a30;
  --scope-axis: #17291f;

  --accent: #34c597;
  --accent-hover: #4bd6a8;
  --accent-ink: #052a1d;
  --accent-soft: rgba(52, 197, 151, .14);
  --link: #6cc9ff;
  --focus: #4bd6a8;

  --sev-critical: #d9468a;
  --sev-high: #f08a36;
  --sev-medium: #eed35a;
  --sev-low: #45a7e0;
  --ok: #3dbb6b;
  --warn: #f0b429;
  --bad: #e5484d;

  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --s-other: #6b747a;

  --hl-cmd: #4bd6a8;
  --hl-field: #8fc7ff;
  --hl-op: #f08a36;
  --hl-str: #e8c872;
  --hl-num: #c4a7ff;
  --hl-pipe: #7c868d;
  --hl-kw: #ff8fb8;

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
  --top-h: 52px;
  --side-w: 236px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f6;
  --panel: #ffffff;
  --panel-2: #f5f7f8;
  --panel-3: #eaeef0;
  --line: #dce1e4;
  --line-2: #c9d0d4;
  --text: #14191c;
  --text-2: #4a555c;
  --muted: #687379;
  --faint: #9aa4aa;
  --chrome: #ffffff;
  --chrome-2: #f0f3f4;
  --chrome-line: #dce1e4;
  --chrome-text: #14191c;
  --chrome-muted: #687379;
  --chrome-line-2: #c3cbd0;
  --chrome-scroll: #c9d0d4;
  --chrome-current: #e3f3ed;
  --chrome-current-text: #0b4a37;
  --chrome-badge: #fbe4ee;
  --chrome-badge-text: #a8195c;
  --chrome-badge-neutral: #eaeef0;
  --avatar: #d6ebe3;
  --avatar-text: #0b5a43;
  --scope-ring: #c6e4d8;
  --scope-axis: #dcefe7;
  --accent: #0f8f6a;
  --accent-hover: #0b7a5a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 143, 106, .1);
  --link: #0b63b5;
  --focus: #0f8f6a;
  --sev-critical: #a8195c;
  --sev-high: #dc5a10;
  --sev-medium: #e8b923;
  --sev-low: #2471b5;
  --ok: #0f8a3c;
  --warn: #b7791f;
  --bad: #c62a2f;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --s-other: #9aa4aa;
  --hl-cmd: #0f8f6a;
  --hl-field: #0b63b5;
  --hl-op: #c2410c;
  --hl-str: #8a5a00;
  --hl-num: #6d28d9;
  --hl-pipe: #8a959c;
  --hl-kw: #be185d;
  --shadow: 0 18px 50px rgba(20, 30, 40, .18), 0 2px 8px rgba(20, 30, 40, .08);
}

/* ------------------------------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.45 var(--font);
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 .6em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 4px; font-size: 11px; line-height: 16px; text-align: center; color: var(--text-2); background: var(--panel-2);
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ------------------------------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--top-h) minmax(0, 1fr); min-height: 100vh; }
.shell.collapsed { --side-w: 60px; }
.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 12px 0 0; background: var(--chrome); color: var(--chrome-text);
  border-bottom: 1px solid var(--chrome-line);
}
.brand {
  display: flex; align-items: center; gap: 10px; width: var(--side-w); height: 100%; padding: 0 16px; flex: none;
  color: var(--chrome-text); font-weight: 600; font-size: 16px; letter-spacing: .01em; transition: width .15s;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand .org { font-weight: 400; color: var(--chrome-muted); font-size: 12.5px; margin-left: 2px; }
.collapsed .brand .label, .collapsed .brand .org { display: none; }
.omni {
  position: relative; flex: 1 1 520px; max-width: 760px; display: flex; align-items: center; gap: 8px; height: 34px;
  padding: 0 10px; border: 1px solid var(--chrome-line); border-radius: var(--r); background: var(--chrome-2); color: var(--chrome-muted);
  cursor: text;
}
.omni:hover { border-color: var(--chrome-line-2); }
.omni input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--chrome-text); font: 13px var(--mono); }
.omni input::placeholder { color: var(--chrome-muted); font-family: var(--font); }
.omni svg { width: 16px; height: 16px; }
.omni kbd { background: transparent; border-color: var(--chrome-line-2); color: var(--chrome-muted); }
.top-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid transparent;
  border-radius: var(--r); background: transparent; color: var(--chrome-text); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.top-btn:hover { background: var(--chrome-2); border-color: var(--chrome-line); }
.top-btn svg { width: 17px; height: 17px; flex: none; }
.top-btn .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sev-critical); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.timebtn { border-color: var(--chrome-line); background: var(--chrome-2); }
.timebtn .lbl { color: var(--chrome-muted); }
.livepill { gap: 6px; font-size: 12.5px; color: var(--chrome-muted); }
.livepill .dot { width: 8px; height: 8px; border-radius: 50%; background: #59626a; }
.livepill.on .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(52, 197, 151, .18); }
.livepill b { color: var(--chrome-text); font-weight: 500; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--avatar); color: var(--avatar-text);
  font-size: 12px; font-weight: 600;
}

.side {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; overflow-x: hidden;
  background: var(--chrome); color: var(--chrome-text); border-right: 1px solid var(--chrome-line); padding: 8px 0 24px;
  scrollbar-width: thin; scrollbar-color: var(--chrome-scroll) transparent;
}
.nav-group { margin-top: 10px; }
.nav-group > button {
  display: flex; align-items: center; width: 100%; gap: 6px; padding: 6px 16px; border: 0; background: none;
  color: var(--chrome-muted); font-size: 12px; font-weight: 500; cursor: pointer; text-align: left;
}
.nav-group > button svg { width: 12px; height: 12px; transition: transform .15s; }
.nav-group.closed > button svg { transform: rotate(-90deg); }
.nav-group.closed .nav-items { display: none; }
.nav-items a {
  position: relative; display: flex; align-items: center; gap: 11px; height: 32px; margin: 1px 8px; padding: 0 10px;
  border-radius: var(--r); color: var(--chrome-text); font-size: 13.5px; text-decoration: none; white-space: nowrap;
}
.nav-items a svg { width: 17px; height: 17px; flex: none; color: var(--chrome-muted); }
.nav-items a:hover { background: var(--chrome-2); }
.nav-items a[aria-current="page"] { background: var(--chrome-current); color: var(--chrome-current-text); }
.nav-items a[aria-current="page"] svg { color: var(--accent); }
.nav-items a[aria-current="page"]::before {
  content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-items a .badge {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--chrome-badge); color: var(--chrome-badge-text);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.nav-items a .badge.neutral { background: var(--chrome-badge-neutral); color: var(--chrome-muted); }
.collapsed .nav-group > button { visibility: hidden; height: 6px; padding: 0; }
.collapsed .nav-group.closed .nav-items { display: block; }
.collapsed .nav-items a { justify-content: center; padding: 0; }
.collapsed .nav-items a .lbl, .collapsed .nav-items a .badge { display: none; }
.side-foot { padding: 14px 18px 0; color: var(--chrome-muted); font-size: 11.5px; }
.collapsed .side-foot { display: none; }

.main { min-width: 0; padding: 20px 24px 48px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-head .titles { flex: 1; min-width: 0; }
.page-head .crumbs { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.page-head .crumbs a { color: var(--muted); }
.page-head .crumbs svg { width: 12px; height: 12px; }
.spark { display: block; width: 100%; height: 100%; }
.kpi .spark svg { width: 100%; height: 100%; }
.page-head .sub { margin-top: 4px; color: var(--text-2); max-width: 78ch; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ------------------------------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); color: var(--text); cursor: pointer;
  font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-2)); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; gap: 5px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: var(--r);
  background: transparent; color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.sm svg { width: 14px; height: 14px; }

.input, select.input, textarea.input {
  width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel); color: var(--text); font-size: 13.5px;
}
textarea.input { height: auto; min-height: 90px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.input.mono, textarea.mono { font: 13px/1.55 var(--mono); }
.input:focus, textarea.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 28px; font-size: 13px; }
select.input { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.field > .lbl { font-weight: 500; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); }
.fields-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); transition: background .15s; flex: none; position: relative; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel-2); gap: 2px; }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); font-weight: 500; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a {
  position: relative; height: 38px; padding: 0 14px; border: 0; background: none; color: var(--text-2); cursor: pointer;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.tabs button:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.tabs [aria-selected="true"] { color: var(--text); }
.tabs [aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs .n { font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------------------------------------ panels */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.w-2 { grid-column: span 2; } .w-3 { grid-column: span 3; } .w-4 { grid-column: span 4; } .w-5 { grid-column: span 5; }
.w-6 { grid-column: span 6; } .w-7 { grid-column: span 7; } .w-8 { grid-column: span 8; } .w-9 { grid-column: span 9; }
.w-10 { grid-column: span 10; } .w-12 { grid-column: 1 / -1; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: flex; flex-direction: column; }
.panel-head {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.panel-head .tools { display: flex; gap: 2px; align-items: center; }
.panel-body { padding: 14px; min-height: 0; flex: 1; }
.panel-body.flush { padding: 0; }
.panel-body.scroll { overflow: auto; }
.panel.plain { background: transparent; border-style: dashed; }
.panel-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { font-size: 15px; }
.section-title .muted { font-size: 12.5px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); min-width: 0; overflow: hidden; }
a.kpi { color: inherit; text-decoration: none; display: block; }
a.kpi:hover { border-color: var(--line-2); background: var(--panel-2); }
.kpi .lbl { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .val { margin-top: 6px; font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
.kpi .val small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.kpi .foot { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.kpi .kspark { position: absolute; right: 12px; bottom: 12px; width: 42%; height: 34px; opacity: .9; }
.kpi:has(.kspark) .foot { max-width: 55%; } /* the text stays left of the sparkline (longer in English) */
.kpi.tone-critical .val { color: var(--sev-critical); }
.kpi.tone-high .val { color: var(--sev-high); }
.kpi.tone-ok .val { color: var(--ok); }
.delta { font-size: 12px; font-weight: 500; }
.delta.up { color: var(--sev-high); }
.delta.down { color: var(--ok); }

/* ------------------------------------------------------------------------------------------ tables */
.table-wrap { overflow: auto; max-width: 100%; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  position: sticky; top: 0; z-index: 1; height: 34px; padding: 0 10px; background: var(--panel-2); color: var(--text-2);
  border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; font-size: 12.5px; white-space: nowrap;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .arrow { display: inline-block; margin-left: 4px; color: var(--accent); }
.table td { height: 38px; padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.table tbody tr.sel td { background: var(--accent-soft); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.shrink, .table th.shrink { width: 1%; white-space: nowrap; }
.table.dense td { height: 30px; padding: 3px 10px; }
.table .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.table td .ellipsis { max-width: 520px; }
.table-foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.table-foot .pager { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.bulkbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--accent-soft); font-size: 13px; flex-wrap: wrap;
}

/* ------------------------------------------------------------------------------------------ badges */
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; color: var(--text); }
.sev::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c, var(--muted)); flex: none; }
.sev.critical { --c: var(--sev-critical); } .sev.high { --c: var(--sev-high); }
.sev.medium { --c: var(--sev-medium); } .sev.low { --c: var(--sev-low); }
.sev b { font-weight: 500; color: var(--muted); }
.urg {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.urg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.urg.critical { --c: var(--sev-critical); } .urg.high { --c: var(--sev-high); }
.urg.medium { --c: var(--sev-medium); } .urg.low { --c: var(--sev-low); }
:root[data-theme="light"] .urg.medium { color: #8a6a00; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); font-size: 12px; white-space: nowrap;
  text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
a.tag:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.tag.mono { font-family: var(--mono); font-size: 11.5px; }
.tag.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.tag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.status svg { width: 14px; height: 14px; }
.status.open { color: var(--sev-high); }
.status.ack { color: var(--sev-low); }
.status.closed { color: var(--muted); }
.status.ok, .status.pass { color: var(--ok); }
.status.fail, .status.bad { color: var(--bad); }
.status.na, .status.off { color: var(--muted); }
.status.warn { color: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--faint); }
.dot.bad { background: var(--bad); }

/* ------------------------------------------------------------------------------------------ overlays */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 10, .55); animation: fade .12s ease-out; }
.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); animation: slidein .16s ease-out;
}
.drawer.wide { width: min(1040px, 100vw); }
.drawer-head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; min-width: 0; font-size: 16px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px 28px; }
.modal {
  position: fixed; z-index: 61; left: 50%; top: 9vh; transform: translateX(-50%); width: min(560px, calc(100vw - 32px));
  max-height: 82vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); animation: pop .14s ease-out;
}
.modal.wide { width: min(880px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; font-size: 16px; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.menu {
  position: fixed; z-index: 70; min-width: 220px; max-height: 70vh; overflow: auto; padding: 5px; border: 1px solid var(--line-2);
  border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); animation: pop .1s ease-out;
}
.menu .item, .palette .item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 5px 10px; border: 0; border-radius: 4px;
  background: none; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; text-decoration: none;
}
.menu .item:hover, .menu .item.active, .palette .item:hover, .palette .item.active { background: var(--panel-2); text-decoration: none; }
.menu .item svg, .palette .item svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.menu .item .k { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu .sep { height: 1px; margin: 5px 4px; background: var(--line); }
.menu .head { padding: 8px 10px 4px; color: var(--muted); font-size: 12px; }
.toasts { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; flex-direction: column; gap: 2px; padding: 11px 14px 11px 16px; border: 1px solid var(--line-2); border-left: 3px solid var(--c, var(--accent));
  border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); font-size: 13px; animation: pop .14s ease-out;
}
.toast b { font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(24px); opacity: .4; } }
@keyframes pop { from { transform: translateY(4px) scale(.99); opacity: 0; } }
.modal { animation-name: popm; }
@keyframes popm { from { transform: translate(-50%, 6px); opacity: 0; } }

.palette { top: 12vh; width: min(640px, calc(100vw - 32px)); }
.palette .pal-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.palette .pal-input input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; }
.palette .pal-input svg { width: 18px; height: 18px; color: var(--muted); }
.palette .pal-list { max-height: 52vh; overflow: auto; padding: 6px; }
.palette .pal-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 14px; }

/* ------------------------------------------------------------------------------------------ time picker */
.timepick { width: 560px; padding: 0; }
.timepick .cols { display: grid; grid-template-columns: 200px 1fr; }
.timepick .presets { padding: 6px; border-right: 1px solid var(--line); }
.timepick .custom { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.timepick .custom h3 { font-size: 13px; }

/* ------------------------------------------------------------------------------------------ charts */
.chart { position: relative; width: 100%; height: 100%; min-height: 60px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .axis.y { text-anchor: end; }
.chart .baseline { stroke: var(--line-2); shape-rendering: crispEdges; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .cross { stroke: var(--text-2); stroke-dasharray: 3 3; pointer-events: none; }
.chart .brush { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; pointer-events: none; }
.chart .lbl { fill: var(--text-2); font-size: 11.5px; }
.chart .val { fill: var(--text); font-size: 11.5px; font-weight: 500; }
.chart .center-val { fill: var(--text); font-size: 22px; font-weight: 600; }
.chart .center-lbl { fill: var(--muted); font-size: 11.5px; }
.chart-empty { display: grid; place-items: center; height: 100%; min-height: 80px; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.chart-error { color: var(--bad); font-size: 12.5px; padding: 8px 0; font-family: var(--mono); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.legend .li { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.legend .li i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.legend .li.off { opacity: .4; }
.tip {
  position: fixed; z-index: 90; pointer-events: none; min-width: 140px; max-width: 320px; padding: 8px 10px; border: 1px solid var(--line-2);
  border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); font-size: 12.5px;
}
.tip .t { color: var(--muted); margin-bottom: 4px; font-size: 12px; }
.tip .r { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.tip .r i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); flex: none; }
.tip .r span { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip .r b { font-weight: 600; }
.single { display: flex; flex-direction: column; justify-content: center; height: 100%; position: relative; }
.single .big { font-size: 34px; font-weight: 600; letter-spacing: -.015em; line-height: 1.1; }
.single .unit { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.single.tone-critical .big { color: var(--sev-critical); } .single.tone-high .big { color: var(--sev-high); }
.single .sp { height: 30px; margin-top: 8px; }
.bars-h .row-b { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 10px; align-items: center; height: 26px; font-size: 12.5px; cursor: pointer; }
.bars-h .row-b:hover .name { color: var(--text); text-decoration: underline; }
.bars-h .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bars-h .track { display: block; min-width: 0; }
.bars-h .bar { display: block; height: 12px; border-radius: 0 3px 3px 0; background: var(--c, var(--s1)); min-width: 2px; }
.bars-h .v { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; min-width: 36px; text-align: right; }
.heat { display: grid; gap: 2px; font-size: 11px; color: var(--muted); }
.heat .cell { height: 18px; border-radius: 2px; background: var(--panel-2); }
.ring text { font-family: var(--font); }

/* ------------------------------------------------------------------------------------------ search */
.rql {
  position: relative; display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel);
}
.rql:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.rql .ed { position: relative; flex: 1; min-width: 0; }
.rql textarea, .rql pre {
  margin: 0; padding: 10px 12px; border: 0; font: 14px/22px var(--mono); white-space: pre-wrap; word-break: break-word;
  min-height: 44px; tab-size: 2; letter-spacing: 0;
}
.rql textarea {
  position: relative; z-index: 1; display: block; width: 100%; resize: none; overflow: hidden; outline: 0;
  background: transparent; color: transparent; caret-color: var(--text);
}
.rql textarea::selection { background: rgba(108, 201, 255, .3); color: transparent; }
.rql pre { position: absolute; inset: 0; pointer-events: none; color: var(--text); overflow: hidden; }
.rql .ph { color: var(--muted); }
.rql .t-cmd { color: var(--hl-cmd); font-weight: 500; }
.rql .t-field { color: var(--hl-field); }
.rql .t-op { color: var(--hl-op); }
.rql .t-str { color: var(--hl-str); }
.rql .t-num { color: var(--hl-num); }
.rql .t-pipe { color: var(--hl-pipe); font-weight: 600; }
.rql .t-kw { color: var(--hl-kw); }
.rql .t-fn { color: var(--hl-cmd); }
.rql .side-btns { display: flex; align-items: flex-start; gap: 6px; padding: 6px; border-left: 1px solid var(--line); }
.rql .side-btns .btn { height: 32px; }
.ac {
  position: absolute; z-index: 40; left: 0; top: 100%; margin-top: 4px; width: min(460px, 100%); max-height: 300px; overflow: auto; padding: 4px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow);
}
.ac .opt { display: flex; align-items: center; gap: 10px; padding: 5px 9px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.ac .opt .k { width: 54px; flex: none; font-size: 11px; color: var(--muted); }
.ac .opt code { color: var(--text); }
.ac .opt .d { margin-left: auto; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.ac .opt.active { background: var(--accent-soft); }
.search-meta { display: flex; align-items: center; gap: 14px; margin: 10px 0 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.search-meta b { color: var(--text); font-weight: 600; }
.search-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.fieldbar { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; }
.fieldbar h3 { font-size: 12.5px; color: var(--text-2); font-weight: 500; margin: 6px 4px 6px; }
.fieldbar .f {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 4px; background: none;
  cursor: pointer; font-size: 13px; text-align: left; color: var(--text);
}
.fieldbar .f:hover, .fieldbar .f.open { background: var(--panel-2); }
.fieldbar .f .ty { width: 16px; flex: none; color: var(--muted); font: 11px var(--mono); }
.fieldbar .f .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.fieldbar .f .ct { color: var(--muted); font-size: 12px; }
.fieldpop { padding: 6px 8px 10px 30px; font-size: 12.5px; }
.fieldpop .v { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 3px 0; cursor: pointer; }
.fieldpop .v:hover .vn { text-decoration: underline; color: var(--text); }
.fieldpop .vn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.fieldpop .vb { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.fieldpop .vb i { display: block; height: 100%; background: var(--accent); }
.events-list .ev { display: grid; grid-template-columns: 22px 150px minmax(0, 1fr); gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.events-list .ev:hover { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.events-list .ev .tm { color: var(--text-2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.events-list .ev .tm small { display: block; color: var(--muted); font-size: 11.5px; }
.events-list .ev .raw { font: 12.5px/1.6 var(--mono); word-break: break-word; }
.events-list .ev .kv { display: inline-block; max-width: 100%; margin-right: 12px; word-break: break-all; }
.events-list .ev .kv .k { color: var(--hl-field); }
.events-list .ev .kv .vv { color: var(--text); cursor: pointer; }
.events-list .ev .kv .vv:hover { text-decoration: underline; }
.events-list .ev .msg { display: block; margin-bottom: 3px; font-family: var(--font); font-size: 13.5px; color: var(--text); }
.events-list .ev .exp { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; }
.events-list .ev .exp:hover { background: var(--panel-2); color: var(--text); }
.events-list .ev .exp svg { width: 14px; height: 14px; transition: transform .12s; }
.events-list .ev.open .exp svg { transform: rotate(90deg); }
.events-list .ev .detail { grid-column: 2 / -1; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kvtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kvtable td { padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kvtable tr:last-child td { border-bottom: 0; }
.kvtable td:first-child { width: 190px; color: var(--hl-field); font-family: var(--mono); white-space: nowrap; }
.kvtable td:last-child { font-family: var(--mono); word-break: break-all; }
.kvtable .acts { white-space: nowrap; width: 1%; }
.hist { height: 92px; margin-bottom: 4px; }

/* ------------------------------------------------------------------------------------------ home */
.hero-search { margin-bottom: 18px; }
.ribbon { position: relative; height: 54px; }
.ribbon svg { width: 100%; height: 100%; display: block; }
.ribbon .tick { cursor: pointer; }
.ribbon .hour { fill: var(--muted); font-size: 10.5px; }
.ribbon .now-line { stroke: var(--accent); stroke-width: 1.5; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-plain > li:last-child { border-bottom: 0; }
.list-plain > li.click { cursor: pointer; }
.list-plain > li.click:hover { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.list-plain .title { font-weight: 500; color: var(--text); }
.score-row { display: flex; align-items: center; gap: 16px; }
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--c, var(--accent)); }
.cardlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: inherit; text-decoration: none; min-width: 0;
}
a.card:hover { border-color: var(--line-2); background: var(--panel-2); text-decoration: none; }
.card .ttl { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.card .ttl svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.card .desc { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.card .foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.card .foot b { color: var(--text); font-weight: 600; font-size: 18px; }

/* ------------------------------------------------------------------------------------------ incident review */
.ir-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.facets { position: sticky; top: calc(var(--top-h) + 12px); }
.facet { margin-bottom: 16px; }
.facet h3 { font-size: 12.5px; font-weight: 500; color: var(--text-2); margin: 0 0 6px 2px; }
.facet button {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: 4px;
  background: none; cursor: pointer; font-size: 13px; color: var(--text); text-align: left;
}
.facet button:hover { background: var(--panel-2); }
.facet button[aria-pressed="true"] { background: var(--accent-soft); }
.facet button .n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 14px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line-2); }
.timeline li.note::before { border-color: var(--accent); }
.timeline .who { font-weight: 500; }
.timeline .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.timeline .txt { margin-top: 2px; color: var(--text-2); white-space: pre-wrap; }
.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 16px; font-size: 13px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; word-break: break-word; }
.callout { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--accent)); border-radius: var(--r); background: var(--panel-2); font-size: 13px; }
.callout.warn { --c: var(--warn); }
.callout.bad { --c: var(--bad); }
.callout.info { --c: var(--sev-low); }
.callout b { font-weight: 600; }
.code {
  margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2);
  font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; overflow: auto; color: var(--text);
}
textarea.code-edit { width: 100%; min-height: 420px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel-2); color: var(--text); font: 13px/1.6 var(--mono); resize: vertical; tab-size: 2; }
textarea.code-edit:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ------------------------------------------------------------------------------------------ MITRE */
.matrix { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(132px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.matrix .col h3 { font-size: 12px; font-weight: 600; padding: 8px; border-radius: 4px; background: var(--panel-2); margin-bottom: 6px; min-height: 52px; }
.matrix .col h3 small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.matrix .tech {
  display: block; width: 100%; margin-bottom: 4px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--panel); font-size: 11.5px; line-height: 1.3; text-align: left; cursor: pointer; color: var(--text-2);
}
.matrix .tech:hover { border-color: var(--muted); color: var(--text); }
.matrix .tech.cov { border-left: 3px solid var(--accent); color: var(--text); }
.matrix .tech.hit { background: color-mix(in srgb, var(--c) 18%, var(--panel)); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); color: var(--text); }
.matrix .tech .id { display: block; font: 10.5px var(--mono); color: var(--muted); }
.matrix .tech .n { float: right; font-weight: 600; color: var(--text); }

/* ------------------------------------------------------------------------------------------ maps */
.viz { position: relative; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.viz > svg { display: block; width: 100%; height: auto; user-select: none; }
.netmap { min-height: 420px; }
.netmap > svg { height: min(72vh, 760px); cursor: grab; }
.netmap .edge { stroke: var(--line-2); }
.netmap .edge.ids { stroke: var(--sev-critical); }
.netmap .edge.blocked { stroke: var(--sev-high); stroke-dasharray: 5 4; }
.netmap .edge.dns { stroke: var(--s7); }
.netmap .node { cursor: pointer; outline: none; }
.netmap .node text { fill: var(--text-2); font-size: 11.5px; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.netmap .node.sel text { fill: var(--text); font-weight: 600; }
.netmap .n-laptop { fill: var(--accent); }
.netmap .n-laptop.off { fill: var(--faint); }
.netmap .ring { fill: none; stroke: var(--accent); stroke-opacity: .45; stroke-width: 2; }
.netmap .n-device { fill: var(--s7); }
.netmap .n-host { fill: var(--text-2); }
.netmap .n-country { fill: var(--s1); }
.netmap .alert-ring { fill: none; stroke: var(--sev-critical); stroke-width: 2; stroke-dasharray: 3 2; }
.viz-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 2px; }
.viz-legend { position: absolute; left: 12px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); background: color-mix(in srgb, var(--panel) 85%, transparent); padding: 6px 10px; border-radius: var(--r); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.viz-legend i.sq { border-radius: 2px; }
.viz-legend i.line { width: 16px; height: 3px; border-radius: 2px; }
.viz-side { position: absolute; top: 10px; left: 10px; width: 300px; max-height: calc(100% - 20px); overflow: auto; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); font-size: 13px; }
.worldmap svg path.country { fill: var(--panel-3); stroke: var(--line); stroke-width: .5; }
.worldmap svg path.country.l1 { fill: color-mix(in srgb, var(--s1) 30%, var(--panel-3)); }
.worldmap svg path.country.l2 { fill: color-mix(in srgb, var(--s1) 50%, var(--panel-3)); }
.worldmap svg path.country.l3 { fill: color-mix(in srgb, var(--s1) 72%, var(--panel-3)); }
.worldmap svg path.country.l4 { fill: var(--s1); }
.worldmap svg path.country.threat { stroke: var(--sev-critical); stroke-width: 1.6; }
.worldmap svg path.country.office { fill: var(--accent); }
.worldmap svg path.country:hover { stroke: var(--text); stroke-width: 1; }
.worldmap .arc { fill: none; stroke: var(--s1); stroke-width: 1.4; opacity: .75; stroke-linecap: round; }
.worldmap .arc.ids { stroke: var(--sev-critical); stroke-width: 2; }
.worldmap .arc.blocked { stroke: var(--sev-high); stroke-dasharray: 4 3; }
.worldmap .office-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.map-scale { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); background: color-mix(in srgb, var(--panel) 85%, transparent); padding: 4px 8px; border-radius: var(--r); }
.map-scale i { width: 18px; height: 8px; border-radius: 2px; }
:root { --map-1: color-mix(in srgb, var(--s1) 30%, var(--panel-3)); --map-2: color-mix(in srgb, var(--s1) 50%, var(--panel-3)); --map-3: color-mix(in srgb, var(--s1) 72%, var(--panel-3)); --map-4: var(--s1); }
.table tr.dim td { opacity: .55; }

/* ------------------------------------------------------------------------------------------ live */
.stream { font: 12.5px/1.5 var(--mono); max-height: 70vh; overflow: auto; }
.stream .line { display: grid; grid-template-columns: 76px minmax(80px, 120px) minmax(140px, 220px) minmax(0, 1fr); gap: 12px; padding: 5px 12px; border-bottom: 1px solid var(--line); }
.stream .line.alert { background: color-mix(in srgb, var(--c) 10%, transparent); }
.stream .line .t { color: var(--muted); }
.stream .line .h { color: var(--hl-field); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream .line .c { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.stream .line.new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } }

/* ------------------------------------------------------------------------------------------ misc */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px 20px; color: var(--muted); text-align: center; font-size: 13.5px; }
.empty strong { color: var(--text); font-weight: 600; font-size: 14.5px; }
.empty svg { width: 28px; height: 28px; color: var(--faint); margin-bottom: 4px; }
.skel { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading { padding: 24px; color: var(--muted); font-size: 13px; }
.error { color: var(--bad); font-size: 13px; }
.pill-toggle { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.req {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: start; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--panel); cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.req:hover { border-color: var(--line-2); background: var(--panel-2); }
.req .rid { font: 500 12.5px var(--mono); }
.req .rt { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.req .rs { grid-column: 3; grid-row: 1; }
.req .rm { grid-column: 1 / -1; display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.std-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.std { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: inherit; text-decoration: none; }
.std:hover { border-color: var(--line-2); background: var(--panel-2); text-decoration: none; }
.std .nm { font-weight: 600; }
.std .vv { font-size: 12px; color: var(--muted); }
.channel { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.channel:last-child { border-bottom: 0; }
.channel .ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); color: var(--text-2); }
.channel .ic svg { width: 18px; height: 18px; }
.steps { counter-reset: st; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: st; position: relative; padding: 0 0 14px 34px; font-size: 13.5px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; display: grid; place-items: center; }

/* ------------------------------------------------------------------------------------------ login */
.login {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); background: var(--chrome); color: var(--chrome-text);
}
.login .art { position: relative; padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login .art .brand { width: auto; padding: 0; height: auto; }
.login .art h1 { font-size: 34px; line-height: 1.15; max-width: 16ch; letter-spacing: -.02em; }
.login .art p { color: var(--chrome-muted); max-width: 46ch; font-size: 15px; }
.login .art .scope .ring { stroke: var(--scope-ring); }
.login .art .scope .axis { stroke: var(--scope-axis); }
.login .art .scope { position: absolute; right: -120px; top: 50%; width: 620px; height: 620px; transform: translateY(-50%); opacity: .9; pointer-events: none; }
.login .form-side { display: grid; place-items: center; padding: 32px; background: var(--bg); color: var(--text); }
.login form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login form h2 { font-size: 22px; }
.login .btn.primary { height: 40px; font-size: 14px; }

/* ------------------------------------------------------------------------------------------ report print */
.report-page { max-width: 980px; }
@media print {
  :root { color-scheme: light; }
  .topbar, .side, .page-head .actions, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; color: #000; }
  .panel, .kpi { break-inside: avoid; border-color: #ccc; }
}

/* ------------------------------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .w-3 { grid-column: span 6; } .w-4 { grid-column: span 6; } .w-5, .w-7, .w-8, .w-9 { grid-column: 1 / -1; }
  .search-layout { grid-template-columns: 1fr; }
  .fieldbar { position: static; max-height: none; }
  .ir-layout { grid-template-columns: 1fr; }
  .facets { position: static; display: flex; gap: 16px; flex-wrap: wrap; }
  .facet { min-width: 180px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; top: var(--top-h); left: 0; width: 260px; transform: translateX(-100%); transition: transform .16s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .brand { width: auto; }
  .brand .org { display: none; }
  .omni kbd, .timebtn .lbl, .livepill, .top-tools .theme-btn, .top-tools .lang-seg, .brand .label { display: none; }
  .topbar { gap: 6px; padding-right: 8px; }
  .brand { padding: 0 6px 0 12px; }
  .omni { flex: 1 1 auto; min-width: 0; }
  .timebtn > span:not(.lbl) { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .timebtn > svg:last-child { display: none; }
  .grid > [class*="w-"] { grid-column: 1 / -1; }
  .main { overflow-x: clip; }
  .seg { max-width: 100%; overflow-x: auto; }
  .page-head .actions { justify-content: flex-start; }
  .main { padding: 16px 16px 40px; }
  .w-6 { grid-column: 1 / -1; }
  .page-head { flex-direction: column; }
  .login { grid-template-columns: 1fr; }
  .login .art { display: none; }
  .events-list .ev { grid-template-columns: 22px minmax(0, 1fr); }
  .stream .line { grid-template-columns: 64px minmax(0, 1fr); row-gap: 0; }
  .stream .line > :not(.t) { grid-column: 2; }
  .events-list .ev .tm { grid-column: 2; }
  .events-list .ev .raw { grid-column: 2; }
  .timepick { width: calc(100vw - 32px); }
  .timepick .cols { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------------------------------ cases */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; }
.lane { min-height: 200px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); display: flex; flex-direction: column; gap: 8px; }
.lane h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 4px 6px; }
.lane h2 .n { color: var(--muted); font-weight: 400; font-size: 12px; }
.case-card {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line-2));
  border-radius: var(--r); background: var(--panel); color: inherit; text-decoration: none;
}
.case-card:hover { border-color: var(--line-2); text-decoration: none; }
.case-card .t { font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.case-card .m { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.timeline li.alertnode::before { border-color: var(--c); background: var(--c); }
.page-head .actions .field { min-width: 150px; }
@media (max-width: 1180px) { .kanban { grid-template-columns: repeat(2, minmax(220px, 1fr)); } }
button.tag { cursor: pointer; font: inherit; font-size: 12px; }
.stream .line .m { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.avatar { flex: none; }
a.li { color: var(--text-2); text-decoration: none; }
a.li:hover { color: var(--text); }

/* ------------------------------------------------------------------------------------------ language switch */
/* SQ | EN: a .seg (segmented control) in the dark top bar and on the sign-in page */
.lang-seg button { height: 24px; padding: 0 8px; font: 600 11.5px var(--font); letter-spacing: .06em; }
.lang-seg.chrome { border-color: var(--chrome-line); background: var(--chrome-2); margin: 0 2px; }
.lang-seg.chrome button { color: var(--chrome-muted); }
.lang-seg.chrome button:hover { color: var(--chrome-text); }
.lang-seg.chrome button[aria-pressed="true"] { background: var(--chrome-line); color: var(--chrome-text); box-shadow: none; }
.login .form-side { position: relative; }
.login .login-lang { position: absolute; top: 20px; right: 24px; }
/* two-step verification */
.login .login-wide { width: min(400px, 100%); }
.login .login-wide form { width: 100%; }
.input.otp { font-size: 20px; letter-spacing: .3em; text-align: center; height: 44px; }
.qr-wrap { display: flex; justify-content: center; }
.qr { border-radius: 8px; width: 196px; height: 196px; }
.mfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.mfa-setup code.secret { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; word-break: break-all; user-select: all; }
.mfa-setup details summary { cursor: pointer; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; user-select: all; }

