/* OmniRMM console - design tokens. Dark (navy/indigo) is the default; light is opt-in via the theme toggle. */
:root {
  color-scheme: dark;
  --bg: #090d16;
  --surface: #111726;
  --surface-2: #151c2d;
  --surface-3: #1a2336;
  --raised: #0f1524;
  --input-bg: #0b1120;
  --border: #1f293d;
  --border-strong: #2c3a55;
  --text: #e2e8f0;
  --text-strong: #ffffff;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-deep: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-border: rgba(99, 102, 241, 0.28);
  --glow: 0 0 22px -6px rgba(99, 102, 241, 0.55);
  --grid: #1e293b;
  --axis: #334155;
  --series-1: #6366f1;
  /* categorical palette for custom chart cards (cards.js) - fixed order, distinct in both themes */
  --cc-1: #6366f1; --cc-2: #14b8a6; --cc-3: #f59e0b; --cc-4: #ec4899; --cc-5: #38bdf8; --cc-6: #a78bfa; --cc-7: #f97316; --cc-8: #84cc16;
  --good: #10b981;
  --good-ink: #34d399;
  --warning: #f59e0b;
  --warning-ink: #fbbf24;
  --serious: #f97316;
  --serious-ink: #fb923c;
  --critical: #f43f5e;
  --critical-ink: #fb7185;
  --violet: #a78bfa;
  --code-bg: #0b1120;
  --sidebar: #0d121f;
  --sidebar-text: #94a3b8;
  --sidebar-strong: #ffffff;
  --nav-hover: rgba(148, 163, 184, 0.08);
  --topbar-bg: rgba(13, 18, 31, 0.7);
  --backdrop: rgba(2, 6, 23, 0.7);
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --topbar-h: 64px;
  --sidebar-w: 256px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --raised: #ffffff;
  --input-bg: #ffffff;
  --border: #e5e7ef;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-strong: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --accent: #6366f1;
  --accent-2: #4f46e5;
  --accent-deep: #4338ca;
  --accent-soft: rgba(99, 102, 241, 0.09);
  --accent-border: rgba(99, 102, 241, 0.25);
  --glow: 0 6px 18px -6px rgba(79, 70, 229, 0.45);
  --grid: #eef0f4;
  --axis: #cbd5e1;
  --cc-1: #4f46e5; --cc-2: #0d9488; --cc-3: #d97706; --cc-4: #db2777; --cc-5: #0284c7; --cc-6: #7c3aed; --cc-7: #ea580c; --cc-8: #65a30d;
  --good: #10b981;
  --good-ink: #047857;
  --warning: #f59e0b;
  --warning-ink: #b45309;
  --serious: #f97316;
  --serious-ink: #c2410c;
  --critical: #f43f5e;
  --critical-ink: #be123c;
  --violet: #7c3aed;
  --code-bg: #f6f7fb;
  --sidebar: #ffffff;
  --sidebar-text: #475569;
  --sidebar-strong: #0f172a;
  --nav-hover: rgba(15, 23, 42, 0.05);
  --topbar-bg: rgba(255, 255, 255, 0.75);
  --backdrop: rgba(15, 23, 42, 0.45);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, .25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.02em; color: var(--text-strong); }
h2 { font-size: 14.5px; margin: 0 0 14px; font-weight: 600; color: var(--text-strong); letter-spacing: -.005em; }
h3 { font-size: 11px; margin: 0 0 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
kbd { font-family: var(--mono); font-size: 10.5px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-2); padding: 1px 6px; border-radius: 5px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

/* ---------- layout: full-height sidebar | (sticky topbar + scrolling main) */
.shell { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-text); border-right: 1px solid var(--border);
  position: sticky; top: 0; width: var(--sidebar-w); height: 100vh; flex-shrink: 0;
  overflow-y: auto; display: flex; flex-direction: column; z-index: 60;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--sidebar-strong); }
.sidebar > .brand { align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.brand-text { min-width: 0; flex: 1; }
/* Pull back level with the brand mark's left edge (mark width 36px + brand gap 12px). */
.brand-foot { margin-top: 14px; margin-left: -48px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--text-3); }
.brand-foot .sidebar-toggle { align-self: stretch; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0; color: #fff; font-size: 15px; font-weight: 700;
  background: linear-gradient(45deg, var(--accent-deep), var(--accent-2)); display: grid; place-items: center; box-shadow: var(--glow);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name span { color: var(--accent-2); font-weight: 500; }
.brand-sub { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-top: 1px; }
.nav { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--sidebar-text);
  font-weight: 500; font-size: 13.5px; border: 1px solid transparent; transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .9; }
.nav a:hover { background: var(--nav-hover); text-decoration: none; color: var(--text-strong); }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-border); box-shadow: var(--shadow); }
.nav .badge { margin-left: auto; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; padding: 16px 12px 6px; }
.nav-group:first-child .nav-section { padding-top: 6px; }
/* Rearranging the menu (App.navDrag): the moved menu or page leaves a dashed placeholder; a copy follows the pointer. */
.nav-group, .nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-section { cursor: grab; border-radius: 8px; outline-offset: 2px; }
.nav-section:focus-visible { outline: 2px solid var(--accent); }
.nav-dragging { opacity: .35; outline: 1px dashed var(--accent); outline-offset: -1px; border-radius: 10px; }
.nav-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0; background: var(--sidebar); border: 1px solid var(--accent-border);
  border-radius: 10px; box-shadow: 0 12px 28px rgba(0, 0, 0, .3); opacity: .95; }
a.nav-ghost { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--text-strong); font-weight: 500; font-size: 13.5px; }
.nav-ghost .nav-items { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.nav-ghost .nav-items > a { display: flex; align-items: center; gap: 12px; padding: 7px 12px; color: var(--sidebar-text); font-size: 13px; }
.nav-ghost svg { width: 17px; height: 17px; }
.nav-reset { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 7px 12px; border-radius: 10px; background: none; border: 1px dashed var(--border);
  color: var(--text-3); font-size: 12px; cursor: pointer; }
.nav-reset:hover { color: var(--text-strong); border-color: var(--accent-border); }
.nav-reset svg { width: 15px; height: 15px; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 12px; }
.sidebar-foot button { align-self: flex-start; }
.status-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 500;
}
.status-chip .pulse { position: relative; width: 9px; height: 9px; flex-shrink: 0; }
.status-chip .pulse::before, .status-chip .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); }
.status-chip .pulse::before { animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; opacity: .7; }
.status-chip.down .pulse::before { animation: none; opacity: 0; }
.status-chip.down .pulse::after { background: var(--critical); }
.status-chip .status-meta { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-meta { min-width: 0; line-height: 1.3; }
.user-name { font-weight: 600; color: var(--text-strong); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-3); text-transform: capitalize; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--accent-2); font-weight: 700; font-size: 12px;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.main { flex: 1; min-width: 0; padding: 26px 28px 56px; animation: fadeIn .25s cubic-bezier(.16, 1, .3, 1); }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .spacer { flex: 1; }
.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.page-title h1 { margin: 0; overflow-wrap: anywhere; }
.page-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-actions .head-action:empty { display: none; }
.page-head + .crumb { margin: -12px 0 16px; }
.crumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crumb-sep { color: var(--text-3); opacity: .6; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.detail-layout > .stack > .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .detail-layout { grid-template-columns: minmax(0, 1fr); } }
.spacer { flex: 1; }
.crumb { color: var(--text-3); font-size: 13px; }
.menu-btn, .topbar .menu-btn { display: none; }

/* ---------- sticky glass top bar */
.topbar {
  position: sticky; top: 0; height: var(--topbar-h); z-index: 50; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: var(--topbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); color: var(--text-2);
}
.search-trigger {
  width: min(380px, 100%); justify-content: flex-start; gap: 10px; padding: 8px 12px; border-radius: 12px;
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; font-weight: 400;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15);
}
.search-trigger svg { width: 16px; height: 16px; transition: color .15s; }
.search-trigger:hover { background: var(--surface-2); border-color: var(--border-strong); }
.search-trigger:hover svg { color: var(--accent-2); }
.search-trigger kbd { margin-left: auto; }
.topbar-menu { position: relative; display: flex; align-items: center; }
.topbar-icons { display: flex; align-items: center; gap: 6px; }
.topbar .divider { width: 1px; height: 18px; background: var(--border-strong); margin: 0 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 11px; background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer; position: relative; padding: 0;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-3); border-color: var(--border); color: var(--text-strong); }
.icon-badge { position: absolute; top: 2px; right: 2px; box-shadow: 0 0 0 2px var(--bg); }
.theme-dark-ic { display: inline; }
.theme-light-ic { display: none; }
:root[data-theme="light"] .theme-dark-ic { display: none; }
:root[data-theme="light"] .theme-light-ic { display: inline; }
.account-btn { padding: 3px 8px 3px 3px; border-radius: 999px; gap: 6px; background: transparent; border-color: transparent; color: var(--text-2); }
.account-btn svg { width: 15px; height: 15px; }
.account-btn:hover { background: var(--surface-3); border-color: var(--border); }
.account-menu {
  position: absolute; top: calc(100% + 8px); right: 0; background: var(--raised); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 220px;
  padding: 6px; display: flex; flex-direction: column; z-index: 80; animation: pop .16s ease-out;
}
.account-menu .menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.account-menu a, .account-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; color: var(--text-2);
  text-decoration: none; background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 500;
}
.account-menu svg { width: 16px; height: 16px; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-3); color: var(--text-strong); }
.account-menu .danger:hover { color: var(--critical-ink); background: rgba(244, 63, 94, .1); }

/* ---------- 9-dot app launcher (top bar): every module as tiles, grouped like the left menu */
.launcher { position: relative; display: flex; align-items: center; }
.launcher-btn svg { width: 18px; height: 18px; stroke-width: 1.6; }
.launcher-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-2); border-color: var(--border); }
.launcher-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 80; width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - var(--topbar-h) - 24px); overflow-y: auto; padding: 14px;
  background: var(--raised); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); animation: pop .16s ease-out;
}
.launcher-group + .launcher-group { margin-top: 14px; }
.launcher-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; padding: 0 6px 6px; }
.launcher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.launcher-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 6px 9px; border-radius: 12px;
  color: var(--text-2); text-decoration: none; text-align: center; border: 1px solid transparent; transition: background .15s, color .15s;
}
.launcher-tile:hover, .launcher-tile:focus-visible { background: var(--surface-3); color: var(--text-strong); text-decoration: none; outline: none; border-color: var(--border); }
.launcher-tile.active { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-border); }
.launcher-ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--border); }
.launcher-tile.active .launcher-ic { background: transparent; border-color: var(--accent-border); }
.launcher-ic svg { width: 18px; height: 18px; }
.launcher-name { font-size: 12.5px; font-weight: 500; line-height: 1.25; }

/* ---------- notifications pull-down (top bar) and page */
.notif-menu {
  position: absolute; top: calc(100% + 8px); right: -54px; z-index: 80; width: min(380px, calc(100vw - 24px));
  background: var(--raised); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease-out;
}
.notif-menu-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-strong); }
.notif-list { max-height: min(440px, 60vh); overflow-y: auto; padding: 6px; }
.notif-item {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 10px; text-align: left;
  background: none; border: 1px solid transparent; color: var(--text); font-weight: 400;
}
.notif-item:hover, .notif-item:focus-visible { background: var(--surface-3); border-color: transparent; }
.notif-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid; }
.notif-icon svg { width: 15px; height: 15px; }
.notif-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.notif-title { font-weight: 600; font-size: 13px; color: var(--text-strong); overflow-wrap: anywhere; }
.notif-body { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; color: var(--text-3); font-size: 13px; }
.notif-empty svg { width: 22px; height: 22px; color: var(--good); }
.notif-menu-foot {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--accent-2);
}
.notif-menu-foot svg { width: 14px; height: 14px; }
.notif-menu-foot:hover { background: var(--surface-3); text-decoration: none; }
.notif-cell .notif-title { font-weight: 500; color: var(--text-2); }
.notif-cell.unread .notif-title { font-weight: 650; color: var(--text-strong); }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.unread-dot.read { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
td a svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-md);
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--text-strong); animation: fadeIn .2s ease-out;
}
.bulk-bar strong { margin-right: 6px; }
@media (max-width: 520px) { .notif-menu { right: -100px; } }

/* ---------- settings: record numbering */
.numbering-row {
  display: grid; grid-template-columns: 170px minmax(120px, 1fr) minmax(120px, 160px) minmax(200px, 1.4fr); gap: 14px; align-items: end;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.numbering-label { align-self: center; }
.numbering-sample { display: flex; flex-direction: column; gap: 6px; }
.numbering-preview { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 38px; padding: 8px 12px; border-radius: 11px; background: var(--code-bg); border: 1px dashed var(--border-strong); }
.numbering-preview .mono { color: var(--accent-2); font-weight: 600; }
input.invalid, input.invalid:focus { border-color: var(--critical); box-shadow: 0 0 0 3px rgba(244, 63, 94, .15); }
.ref { color: var(--accent-2); font-weight: 600; white-space: nowrap; }
.ticket-search { width: 320px; }
@media (max-width: 520px) { .ticket-search { width: 100%; } }
@media (max-width: 860px) { .numbering-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .numbering-label, .numbering-sample { grid-column: 1 / -1; } }

/* ---------- command palette */
.palette-back { align-items: start; padding-top: 12vh; }
.palette { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease-out; }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); }
.palette-head svg { width: 18px; height: 18px; }
.palette-head input { flex: 1; border: none; background: transparent; font-size: 14px; padding: 4px 0; box-shadow: none; }
.palette-head input:focus { outline: none; box-shadow: none; border: none; }
.palette-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.palette-item { width: 100%; border: none; background: none; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 500; }
.palette-item svg { width: 16px; height: 16px; color: var(--accent-2); }
.palette-item:hover, .palette-item.active { background: var(--surface-3); }
.palette { width: min(680px, 100%); }
.palette-list { max-height: min(520px, 62vh); }
.palette-group { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.palette-group .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.palette-item { gap: 10px; text-align: left; }
.palette-item:hover { border-color: transparent; }
.palette-item .pill { margin-left: auto; flex-shrink: 0; }
.palette-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.palette-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { font-size: 12px; color: var(--text-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-ref { display: inline-block; margin-right: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); font-weight: 600; }
.palette-item mark { background: var(--accent-soft); color: var(--text-strong); border-radius: 3px; box-shadow: 0 0 0 1px var(--accent-border); }
.palette-status { display: flex; align-items: center; gap: 10px; padding: 12px; color: var(--text-3); font-size: 12.5px; }
.palette-hint { padding: 10px 12px 12px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); margin-top: 6px; }

/* ---------- floating "Ask about a device" assistant (assistant.js) */
.ai-fab {
  position: fixed; z-index: 85; width: 56px; height: 56px; border-radius: 50%; padding: 0; justify-content: center;
  background: linear-gradient(135deg, var(--accent-deep), #818cf8); border: 1px solid rgba(255, 255, 255, .18); color: #fff;
  box-shadow: 0 10px 30px -8px rgba(79, 70, 229, .7), var(--glow); cursor: grab; touch-action: none; user-select: none;
  transition: transform .15s, box-shadow .15s;
}
.ai-fab svg { width: 24px; height: 24px; }
.ai-fab:hover { background: linear-gradient(135deg, var(--accent), #a5b4fc); border-color: rgba(255, 255, 255, .3); transform: translateY(-2px); }
.ai-fab.dragging { cursor: grabbing; transform: scale(1.06); transition: none; }
.ai-fab.open { box-shadow: 0 0 0 4px var(--accent-soft), 0 10px 30px -8px rgba(79, 70, 229, .7); }
.ai-panel {
  position: fixed; z-index: 86; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: pop .18s cubic-bezier(.16, 1, .3, 1);
}
.ai-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ai-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(45deg, var(--accent-deep), #818cf8); box-shadow: var(--glow); flex-shrink: 0; }
.ai-avatar svg { width: 18px; height: 18px; }
.ai-title { flex: 1; min-width: 0; font-weight: 600; color: var(--text-strong); line-height: 1.3; }
.ai-title .small { font-weight: 400; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.ai-msg.me { align-self: flex-end; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-msg.err { color: var(--critical-ink); border-color: rgba(244, 63, 94, .3); background: rgba(244, 63, 94, .08); }
.ai-msg .answer { font-size: 13.5px; }
.ai-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; margin-bottom: 6px; }
.ai-meta a { font-weight: 600; }
.ai-meta .confidence .meter { width: 50px; }
.ai-evidence { margin-top: 8px; font-size: 12px; color: var(--text-2); }
.ai-evidence summary { cursor: pointer; color: var(--accent-2); font-weight: 500; }
.ai-evidence ul { margin: 6px 0 0; padding-left: 18px; }
.ai-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ai-chip { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-2); }
.ai-chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.ai-foot { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.ai-foot select { width: 100%; font-size: 12.5px; padding: 6px 10px; }
.ai-input { display: flex; gap: 8px; }
.ai-input input { flex: 1; }
.ai-send { padding: 0; width: 38px; justify-content: center; flex-shrink: 0; }
.ai-send svg { width: 16px; height: 16px; }
.typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); min-width: 0; transition: border-color .15s;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card, .stack > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Two side-by-side halves inside one card, separated by a vertical rule. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.split > * + * { border-left: 1px solid var(--border); padding-left: 28px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.right { margin-left: auto; }

/* ---------- reports */
.report-range { gap: 6px; color: var(--text-3); }
.report-range svg { width: 16px; height: 16px; }
.report-range select, .report-range input { padding: 6px 10px; }
.report-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report .grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.report .kpi .value { font-size: 24px; }
.kpi-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: currentColor !important; box-shadow: 0 0 0 4px var(--accent-soft); }
.report .grid.cols-3 > .card, .report .grid.cols-2 > .card { margin-top: 0; }
@media print {
  .sidebar, .topbar, .ai-fab, .ai-panel, .tabs, .report-range, .page-head button, .report-head button, .drag-handle, .toast-host { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .card { border-color: #ccc !important; break-inside: avoid; }
  .main { padding: 0 !important; animation: none; }
  .shell { display: block; }
}

/* ---------- terminal page */
.term-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.term-layout > .card { margin-top: 0; }
.term-side { display: flex; flex-direction: column; gap: 10px; padding: 14px; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 40px); }
.term-side input { width: 100%; }
.term-devices { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.term-device { width: 100%; text-align: left; justify-content: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: none; border-color: transparent; }
.term-device:hover { background: var(--surface-3); border-color: transparent; }
.term-device.active { background: var(--accent-soft); border-color: var(--accent-border); }
.term-device.active .term-device-name { color: var(--accent-2); }
.term-device-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.term-device-name { font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-device-meta .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.term-dot.on { background: var(--good); box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.term-dot.off { background: var(--text-3); }
.term-pane { min-height: 420px; display: flex; flex-direction: column; gap: 14px; }
.term-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.term-empty { margin: auto; text-align: center; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 0; }
.term-empty .kpi-icon { width: 48px; height: 48px; border-radius: 14px; }
.term-empty .kpi-icon svg { width: 22px; height: 22px; }
.term-empty h2 { margin: 6px 0 0; }
.key-override summary { cursor: pointer; color: var(--accent-2); font-size: 12.5px; font-weight: 500; }
.key-override[open] summary { margin-bottom: 10px; }
@media (max-width: 860px) {
  .term-layout { grid-template-columns: minmax(0, 1fr); }
  .term-side { position: static; max-height: 260px; }
}

/* ---------- drag-to-reorder cards (sortableGrid) */
.sortable { position: relative; }
.drag-handle {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 28px; height: 28px; padding: 0; justify-content: center;
  border-radius: 9px; background: var(--surface-3); border-color: var(--border-strong); color: var(--text-3);
  cursor: grab; touch-action: none; opacity: 0; transition: opacity .15s, color .15s;
}
.drag-handle svg { width: 16px; height: 16px; stroke-width: 3.2; }
.drag-handle:hover { color: var(--accent-2); border-color: var(--accent-border); background: var(--surface-3); }
.sortable:hover > .drag-handle, .drag-handle:focus-visible, .sortable.dragging > .drag-handle { opacity: 1; }
@media (hover: none) { .drag-handle { opacity: .75; } }
.kpi > .drag-handle { top: auto; bottom: 12px; right: 26px; }  /* top-right is taken by the KPI icon; bottom-right by the resize corner */
.kpi.sortable .sub, .sortable > h2, .sortable > .chart-head { padding-right: 36px; }  /* keep text clear of the handle */
/* While dragging, the card's own spot is an empty placeholder and a lifted copy follows the pointer (sortableGrid). */
.sortable.dragging { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft, rgba(99, 102, 241, .06)); box-shadow: none; }
.sortable.dragging > * { visibility: hidden; }
.drag-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; opacity: .92; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28), var(--glow); transform: rotate(1deg) scale(1.02); cursor: grabbing; }
.drag-ghost > .drag-handle, .drag-ghost > .resize-handle, .drag-ghost > .resize-edge { display: none; }
body.card-dragging, body.card-dragging * { cursor: grabbing !important; user-select: none; }
.grid.sortable-grid { grid-auto-flow: row dense; }   /* later cards fill the holes wider ones leave */
/* While a card is dragged, the page's other card rows show they can take it. */
.stack.drop-row { outline: none; }
.grid.drop-row { outline: 1px dashed var(--accent-border, rgba(99, 102, 241, .35)); outline-offset: 6px; border-radius: 6px; min-height: 60px; }
.stack.sortable-stack { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
.stack.sortable-stack > * { flex: 0 0 100%; min-width: 0; }
.drag-handle { touch-action: none; }
@media (hover: hover) { .sortable > .drag-title { cursor: grab; } }

/* ---------- KPI tiles */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
a.kpi:hover, .kpi.linked:hover { border-color: var(--border-strong); transform: translateY(-1px); text-decoration: none; }
.kpi.linked { cursor: pointer; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.kpi-top + .value { margin-top: 12px; }
.kpi .sub { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid; }
.kpi-icon svg { width: 16px; height: 16px; }
.tone-accent { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-border); }
.tone-good { background: rgba(16, 185, 129, .1); color: var(--good-ink); border-color: rgba(16, 185, 129, .22); }
.tone-warning { background: rgba(245, 158, 11, .1); color: var(--warning-ink); border-color: rgba(245, 158, 11, .22); }
.tone-serious { background: rgba(249, 115, 22, .1); color: var(--serious-ink); border-color: rgba(249, 115, 22, .22); }
.tone-critical { background: rgba(244, 63, 94, .1); color: var(--critical-ink); border-color: rgba(244, 63, 94, .22); }
.tone-violet { background: rgba(167, 139, 250, .1); color: var(--violet); border-color: rgba(167, 139, 250, .22); }

/* ---------- tables */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-md); }
.table-scroll { overflow-x: auto; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.table-pager {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.table-pager .pager-size { display: inline-flex; align-items: center; gap: 6px; }
.table-pager .pager-size select { width: auto; min-width: 0; padding: 2px 6px; }
.table-pager .pager-info { margin-right: auto; }
.table-pager .pager-nav { display: inline-flex; align-items: center; gap: 8px; }
.table-pager .pager-nav button:disabled { opacity: .4; cursor: default; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
th {
  font-size: 11px; font-weight: 600; color: var(--text-3); white-space: nowrap; text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2);
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-3); }
tr.clickable { cursor: pointer; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .sort-arrow { display: inline-block; margin-left: 4px; opacity: .35; font-size: 9px; }
th.sorted { color: var(--accent-2); }
th.sorted .sort-arrow { opacity: 1; color: var(--accent-2); }

/* ---------- controls */
button, .btn {
  font: inherit; font-size: 13px; border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text);
  padding: 7px 14px; border-radius: 11px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; line-height: 1.4;
}
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
button:active:not(:disabled), .btn:active { transform: scale(.98); }
button.primary, .btn.primary {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent)); border-color: transparent; color: var(--accent-ink); box-shadow: var(--glow);
}
button.primary:hover, .btn.primary:hover { background: linear-gradient(90deg, var(--accent), #818cf8); border-color: transparent; }
button.danger { color: var(--critical-ink); background: rgba(244, 63, 94, .08); border-color: rgba(244, 63, 94, .25); }
button.danger:hover { background: rgba(244, 63, 94, .16); border-color: rgba(244, 63, 94, .4); }
button.primary.danger { background: linear-gradient(90deg, #e11d48, var(--critical)); color: #fff; border-color: transparent; box-shadow: 0 0 20px -6px rgba(244, 63, 94, .6); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--surface-3); border-color: transparent; }
button.ghost.danger:hover { background: rgba(244, 63, 94, .1); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sm, .btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 9px; }
/* The `hidden` attribute is a UA-stylesheet default, so any of our own `display:`
   rules (buttons, .form-grid, .row, …) silently out-specifies it unless we say so
   explicitly here - this one rule covers every element, not just the ones hit so far. */
[hidden] { display: none !important; }
input, select, textarea {
  font: inherit; font-size: 13px; color: var(--text); background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 11px; padding: 8px 11px; min-width: 0; max-width: 100%; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; padding: 0; }
input[type="file"] { padding: 6px; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 12px; margin-right: 10px; border: 1px solid var(--border-strong); background: var(--surface-3);
  color: var(--text); border-radius: 8px; padding: 4px 10px; cursor: pointer;
}
select { cursor: pointer; }
textarea { width: 100%; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 260px; background: var(--code-bg); tab-size: 2; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* keyboard focus on anything else clickable (cards, rows, sortable headers, map nodes) */
[tabindex]:not([tabindex="-1"]):focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
tr[tabindex]:focus-visible, th[tabindex]:focus-visible { outline-offset: -2px; }
main:focus, .modal:focus, .palette:focus { outline: none; }
/* "Skip to main content": the first Tab stop, shown only when it has focus */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; transform: translateY(-200%); padding: 8px 14px;
  background: var(--surface); color: var(--text-strong); border: 2px solid var(--accent); border-radius: 8px; }
.skip-link:focus { transform: none; }
label.field, div.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
label.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ---------- pills / status: tinted fill + border in the status hue */
.pill {
  --tone: var(--text-3); --tone-ink: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; color: var(--tone-ink);
  background: color-mix(in srgb, var(--tone) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 26%, transparent);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.st-good, .st-online, .st-completed, .st-successful, .st-installed, .st-resolved, .st-low, .st-active { --tone: var(--good); --tone-ink: var(--good-ink); }
.st-warning, .st-pending, .st-pending_approval, .st-acknowledged, .st-available, .st-medium, .st-approved, .st-open { --tone: var(--warning); --tone-ink: var(--warning-ink); }
.st-critical, .st-offline, .st-failed, .st-rejected, .st-expired, .st-revoked, .st-breached { --tone: var(--critical); --tone-ink: var(--critical-ink); }
.st-serious, .st-security, .st-high { --tone: var(--serious); --tone-ink: var(--serious-ink); }
.st-new, .st-queued, .st-sent, .st-running, .st-installing, .st-info, .st-used, .st-closed { --tone: var(--accent); --tone-ink: var(--accent-2); }
.badge { background: var(--critical); color: #fff; border-radius: 999px; font-size: 10.5px; padding: 1px 7px; font-weight: 700; line-height: 1.5; }
.nav .badge { background: rgba(244, 63, 94, .15); color: var(--critical-ink); border: 1px solid rgba(244, 63, 94, .25); }
.tag { display: inline-block; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 7px; font-size: 11px; margin: 1px 4px 1px 0; }
.meter { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent-2)); border-radius: 999px; transition: width .5s; }
.meter.warn > span { background: var(--warning); }
.meter.crit > span { background: var(--critical); }

/* ---------- tabs: segmented control */
.tabs {
  display: flex; width: fit-content; max-width: 100%; gap: 3px; padding: 4px; margin-bottom: 18px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
}
.tabs button { border: 1px solid transparent; background: none; border-radius: 9px; padding: 6px 14px; color: var(--text-2); white-space: nowrap; }
.tabs button:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.tabs button.active { background: var(--surface-3); color: var(--accent-2); border-color: var(--border-strong); box-shadow: var(--shadow); }

.ft-bar { margin-bottom: 10px; gap: 8px; }
.ft-bar .ft-search { flex: 1 1 220px; max-width: 340px; }
.ft-bar select { width: auto; max-width: 220px; }
.device-tabs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.device-tabs-row .tabs { margin-bottom: 0; }
.device-power { gap: 6px; }

/* ---------- wizard */
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); font-weight: 550; font-size: 13px; }
.step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.step.active { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-border); }
.step.active .n, .step.done .n { background: var(--accent); color: #fff; }
.os-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.os-tile { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 20px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--text); }
.os-tile svg { width: 40px; height: 40px; color: var(--text-2); }
.os-tile:hover { border-color: var(--accent-border); background: var(--surface-2); }
.os-tile.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--glow); }
.os-tile.selected svg { color: var(--accent-2); }
.os-tile .sub { font-weight: 400; color: var(--text-3); font-size: 12px; }
.codebox { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; overflow-x: auto; }
.codebox pre { white-space: pre; padding-right: 80px; }
.codebox .copy { position: absolute; top: 9px; right: 9px; }
.tok-cmd { color: #818cf8; font-weight: 600; }
.tok-flag, .tok-key { color: #c084fc; }
.tok-str { color: #34d399; }
.tok-url { color: #fb923c; }
.tok-com { color: var(--text-3); font-style: italic; }
:root[data-theme="light"] .tok-cmd { color: #4f46e5; }
:root[data-theme="light"] .tok-flag, :root[data-theme="light"] .tok-key { color: #7c3aed; }
:root[data-theme="light"] .tok-str { color: #047857; }
:root[data-theme="light"] .tok-url { color: #c2410c; }
.notice { border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--text); padding: 11px 14px; border-radius: var(--radius-md); font-size: 13px; }
.notice.warn { border-color: rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .08); }
.notice.err { border-color: rgba(244, 63, 94, .3); background: rgba(244, 63, 94, .08); color: var(--critical-ink); }
.notice.ok { border-color: rgba(16, 185, 129, .3); background: rgba(16, 185, 129, .08); }
.term-wrap { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); padding: 10px; background: #0b1120; }
.term-wrap { height: 440px; }  /* fitTerminal() sizes the terminal's rows/cols to this box */
.term-wrap.tall { height: calc(100vh - var(--topbar-h) - 220px); min-height: 360px; }
.desk-wrap { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); background: #0b1120; height: min(70vh, 720px); min-height: 360px; display: flex; }
.desk-video { flex: 1; width: 100%; height: 100%; min-width: 0; object-fit: contain; outline: none; cursor: default; }
.desk-video:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- charts */
.chart { position: relative; min-height: 150px; }
.chart svg { display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: .12; }
.chart text { fill: var(--text-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .tip { position: absolute; pointer-events: none; background: var(--raised); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); border-radius: 9px; padding: 5px 9px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -115%); }
.chart-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.chart-head .now { margin-left: auto; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--series-1); transition: opacity .12s; }
.chart .bar:hover { opacity: .75; }
.chart .bar.link { cursor: pointer; }
.chart .bar.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: .75; }

/* ---------- custom chart cards (cards.js) */
.cc-section { margin-top: 20px; }
.cc-head { align-items: baseline; margin-bottom: 10px; }
.cc-head h2 { margin: 0; }
.cc-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.cc-grid > .card { grid-column: span 6; margin-top: 0; position: relative; animation: cc-in .45s cubic-bezier(.16, 1, .3, 1) both; }
.cc-grid > .cc-sm { grid-column: span 4; }
.cc-grid > .cc-lg, .cc-grid > .cc-none { grid-column: 1 / -1; }
@media (max-width: 1100px) { .cc-grid > .cc-sm { grid-column: span 6; } }
@media (max-width: 860px) { .cc-grid > .card, .cc-grid > .cc-sm { grid-column: 1 / -1; } }
@keyframes cc-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.cc-card-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.cc-card.sortable .cc-card-head { padding-right: 36px; }
.cc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1; }
.cc-title h2 { margin: 0; font-size: 14px; }
.cc-tools { display: flex; gap: 2px; }
.cc-tools .icon-btn { width: 28px; height: 28px; }
.cc-live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.cc-busy .cc-live { animation: cc-pulse .8s ease-in-out infinite; }
@keyframes cc-pulse { 50% { transform: scale(1.6); opacity: .55; } }
.cc-chart { min-height: 0; }
.cc-chart svg { width: 100%; }
.cc-chart .series { stroke-width: 2.25; }
.cc-chart .cc-dot { stroke: var(--surface); stroke-width: 1.5; transition: r .12s; }
.cc-chart .cc-dot:hover { r: 5; }
.cc-chart .cc-slice { stroke: var(--surface); stroke-width: 2; transition: opacity .12s; }
.cc-chart .cc-slice:hover, .cc-chart .cc-bubble:hover { opacity: .8; }
.cc-chart .cc-track { stroke: var(--surface-3); }
.cc-chart .cc-needle { stroke: var(--text-strong); stroke-width: 2.5; stroke-linecap: round; }
.cc-chart .cc-hub { fill: var(--text-strong); }
.cc-chart .cc-big { fill: var(--text-strong); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.cc-chart .cc-web { stroke: var(--grid); stroke-width: 1; }
.cc-chart .cc-poly { fill-opacity: .18; stroke-width: 2; stroke-linejoin: round; }
.cc-chart .cc-bubble { fill-opacity: .35; stroke-width: 1.5; }
.cc-chart .cc-race-name { fill: #fff; font-weight: 600; font-size: 11px; }
.cc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.cc-legend:empty { display: none; }
.cc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cc-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cc-editor .cc-filter select { max-width: 200px; }
.cc-editor .cc-filter input { flex: 1; min-width: 140px; }
.cc-preview { background: var(--surface-2); }
.cc-table-wrap { max-height: 300px; overflow: auto; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cc-table th { position: sticky; top: 0; background: var(--surface); color: var(--text-2); font-weight: 600; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cc-table th.num, .cc-table td.num { text-align: right; }
.cc-table th.cc-sort { cursor: pointer; user-select: none; }
.cc-table th.cc-sort:hover { color: var(--text-strong); }
.cc-table td { padding: 6px 8px; border-bottom: 1px solid var(--grid); }
.cc-table td.num { position: relative; min-width: 80px; }
.cc-table .cc-num { position: relative; color: var(--text-strong); }
.cc-table .cc-cellbar { position: absolute; left: 4px; top: 50%; height: 60%; transform: translateY(-50%); border-radius: 4px; opacity: .18; max-width: calc(100% - 8px);
  transition: width .7s cubic-bezier(.16, 1, .3, 1), background .3s; }
.cc-table tbody tr:hover td { background: var(--surface-2); }
.cc-table .cc-row-label { color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-row-in { animation: cc-row-in .4s ease-out both; }
.cc-row-out { opacity: 0; transition: opacity .3s; }
@keyframes cc-row-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cc-row-in { animation: none; } .cc-table .cc-cellbar { transition: none; } }
.settings-pair { align-items: start; margin: 16px 0; }
.settings-pair:first-child { margin-top: 0; }
.account-row { align-items: start; margin-bottom: 16px; }
.account-row > .card { margin-top: 0; }
.settings-pair > .card { margin-top: 0; }
.cc-restore-list { gap: 6px; }
.cc-restore-row { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.cc-restore-row:hover { border-color: var(--border-strong); }
.cc-restore-admin { gap: 6px; padding-top: 8px; border-top: 1px dashed var(--border); }
.grid > .cc-card { margin-top: 0; animation: cc-in .45s cubic-bezier(.16, 1, .3, 1) both; }
.grid.cols-2 > .cc-lg { grid-column: 1 / -1; }
/* admins' edit button on a page's built-in cards (cards.js), next to the drag handle */
.cc-sys-edit {
  position: absolute; top: 12px; right: 46px; z-index: 2; width: 28px; height: 28px; padding: 0; justify-content: center;
  border-radius: 9px; background: var(--surface-3); border-color: var(--border-strong); color: var(--text-3); opacity: 0; transition: opacity .15s, color .15s;
}
.cc-sys-edit svg { width: 14px; height: 14px; }
.cc-sys-edit:hover { color: var(--accent-2); border-color: var(--accent-border); background: var(--surface-3); }
.sortable:hover > .cc-sys-edit, .cc-sys-edit:focus-visible { opacity: 1; }
@media (hover: none) { .cc-sys-edit { opacity: .75; } }
.kpi > .cc-sys-edit { top: auto; bottom: 12px; }
.sortable:has(> .cc-sys-edit) > h2, .sortable:has(> .cc-sys-edit) > .chart-head { padding-right: 72px; }
@media (prefers-reduced-motion: reduce) { .cc-grid > .card, .cc-busy .cc-live { animation: none; } }

/* ---------- ranked bar list */
.barlist { display: flex; flex-direction: column; gap: 12px; }
.barlist-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 12px; align-items: center; }
.barlist-row.clickable { cursor: pointer; }
a.barlist-row, a.cc-legend-row, a.cc-sev { color: inherit; text-decoration: none; }
a.barlist-row:hover .barlist-label, a.barlist-row:focus-visible .barlist-label { color: var(--accent-2); text-decoration: underline; }
a.cc-sev:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--t) 25%, transparent); }
/* A number, name or row on a dashboard card that opens its records (cardLink): the card's own look until hovered or focused. */
.card-link { color: inherit; text-decoration: none; border-radius: 4px; }
.card-link:hover, .card-link:focus-visible { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.barlist-label { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.barlist-track > span { display: block; height: 100%; border-radius: 999px; min-width: 2px; transition: width .5s; }
.barlist-value { font-size: 12.5px; font-weight: 600; text-align: right; color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* ---------- kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; }
.kanban .col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kanban .col h3 { display: flex; justify-content: space-between; padding: 2px 2px 4px; }
.kanban .tcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.kanban .tcard:hover { border-color: var(--accent-border); transform: translateY(-1px); }

/* ---------- misc */
.output { background: #0b1120; color: #e2e8f0; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; max-height: 420px; overflow: auto; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; }
.output .err { color: #fb7185; }
.comment { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-md); padding: 10px 12px; }
.comment.internal { background: rgba(245, 158, 11, .07); border-color: rgba(245, 158, 11, .22); }
.empty { text-align: center; color: var(--text-3); padding: 32px 12px; font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0 20px; font-size: 13px; }
.kv dt, .kv dd { padding: 7px 0; border-bottom: 1px solid var(--border); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text-strong); font-weight: 500; }
.kv dt:nth-last-of-type(1), .kv dd:nth-last-of-type(1) { border-bottom: none; }
.toast-host { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--raised); color: var(--text);
  border: 1px solid rgba(16, 185, 129, .35); padding: 11px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  max-width: 400px; font-size: 13px; font-weight: 500; animation: fadeIn .2s cubic-bezier(.16, 1, .3, 1);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.toast.err { border-color: rgba(244, 63, 94, .4); color: var(--critical-ink); }
.toast.err::before { background: var(--critical); box-shadow: 0 0 0 3px rgba(244, 63, 94, .18); }
.modal-back { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: min(640px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.16, 1, .3, 1);
}
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.modal-head h2 { margin: 0; font-size: 15.5px; flex: 1; }
.modal-body { padding: 20px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(600px 400px at 20% 10%, rgba(99, 102, 241, .16), transparent 70%),
              radial-gradient(500px 360px at 85% 90%, rgba(129, 140, 248, .10), transparent 70%), var(--bg);
}
.login .card { width: min(400px, 100%); padding: 30px 28px; box-shadow: var(--shadow-lg); gap: 16px; animation: pop .3s cubic-bezier(.16, 1, .3, 1); }
.login .brand { font-size: 19px; }
.login button.primary { justify-content: center; padding: 10px 14px; }
.qr-wrap { display: flex; justify-content: center; padding: 6px 0; }
.qr { display: block; border-radius: var(--radius-md); box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.confidence { display: inline-flex; align-items: center; gap: 6px; }
.confidence .meter { width: 80px; }
.answer { font-size: 15px; line-height: 1.6; }

@media (max-width: 1100px) {
  .grid.cols-2, .grid.cols-3, .split { grid-template-columns: minmax(0, 1fr); }
  .split > * + * { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 20px; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 95; width: 264px; transform: translateX(-100%); transition: transform .22s cubic-bezier(.16, 1, .3, 1); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { padding: 18px 16px 44px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .menu-btn, .topbar .menu-btn { display: inline-flex; }
  .search-trigger { width: auto; flex: 1; }
  .search-trigger kbd { display: none; }
}
@media (max-width: 520px) {
  .search-trigger span { display: none; }
  .search-trigger { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; justify-content: center; }
  .topbar .divider { display: none; }
  .barlist-row { grid-template-columns: 90px 1fr 34px; }
}

/* ---------- settings: AI integration provider tiles */
.ai-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ai-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; text-align: left;
  border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); font-weight: 400; color: var(--text);
}
.ai-tile:hover { border-color: var(--accent-border); background: var(--surface-2); }
.ai-tile.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--glow); }
.ai-tile-name { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text-strong); }
.ai-tile-help { font-size: 12px; color: var(--text-3); line-height: 1.45; }
a svg { width: 13px; height: 13px; vertical-align: -2px; margin-left: 3px; }

/* ---------- AI assistant: references, agent mode, proposed actions */
.ai-panel { min-height: 0; }
.ai-answer { max-width: 96%; }
.ai-refs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ai-ref {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; font-size: 12.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); min-width: 0;
}
.ai-ref:hover { border-color: var(--accent-border); text-decoration: none; }
.ai-ref svg { width: 14px; height: 14px; color: var(--accent-2); flex-shrink: 0; margin: 0; }
.ai-ref-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-ref .pill { flex-shrink: 0; }
.ai-mode-tag { display: block; font-size: 10.5px; opacity: .75; margin-top: 3px; text-transform: uppercase; letter-spacing: .06em; }
.ai-agent-toggle { display: flex; align-items: center; gap: 10px; font-size: 12.5px; cursor: pointer; padding: 6px 8px; border-radius: 10px; border: 1px dashed var(--border-strong); }
.ai-agent-toggle.on { border-style: solid; border-color: var(--accent-border); background: var(--accent-soft); }
.ai-agent-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ai-switch { width: 30px; height: 17px; border-radius: 999px; background: var(--border-strong); position: relative; flex-shrink: 0; transition: background .15s; }
.ai-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ai-agent-toggle input:checked + .ai-switch { background: var(--accent); }
.ai-agent-toggle input:checked + .ai-switch::after { transform: translateX(13px); }
.ai-agent-toggle input:focus-visible + .ai-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-action { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent-border); display: flex; flex-direction: column; gap: 6px; }
.ai-action.changes { border-color: rgba(249, 115, 22, .4); }
.ai-action-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-action svg { width: 13px; height: 13px; vertical-align: -2px; }
.ai-script { background: #0b1120; color: #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 11.5px; max-height: 180px; overflow: auto; white-space: pre-wrap; margin-top: 6px; }
.ai-action .output { max-height: 220px; font-size: 11.5px; }
.ai-explain { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.ai-explain ul { margin: 6px 0 0; padding-left: 18px; }
/* Full-screen remote session (remote.js "Full screen" button): the view fills the screen. */
.term-wrap:fullscreen, .desk-wrap:fullscreen { height: 100vh; min-height: 0; border: 0; border-radius: 0; }
/* Maximized dialog (modal opts.maximizable): fills the window; a remote session view inside
   takes all the height left over, and each viewer rescales to it. */
.modal.max { width: calc(100vw - 32px); height: calc(100vh - 32px); max-height: none; }  /* .modal-back pads 16px */
.modal.max .modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.modal.max .remote-panel { flex: 1; min-height: 0; }
.modal.max .remote-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.modal.max .remote-view > .desk-wrap, .modal.max .remote-view > .term-wrap { flex: 1; height: auto; min-height: 300px; }
/* Vulnerability scan: CVE / MITRE ATT&CK badges (FR-1.3), clickable to the public refs. */
.cve-badge { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
a.cve-badge:hover { border-color: var(--accent-border); color: var(--accent-2); text-decoration: none; }
a.cve-badge.cve { color: var(--accent-2); }
/* Vulnerability findings: cap Location/Title width so long paths or URLs don't stretch the
   row (full value on hover) - keeps every source's rows the same tidy length. */
.vuln-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vuln-cell .small { white-space: normal; }

/* ---------- Emails: classic three-pane mailbox (folders | list | reading) */
.mail-layout { display: grid; grid-template-columns: 210px 340px 1fr; gap: 0; height: calc(100vh - var(--topbar-h) - 150px);
  min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.mail-layout > * { overflow: auto; min-width: 0; }
.mail-folders { border-right: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 3px; background: var(--surface-2); }
.mail-compose { width: 100%; justify-content: center; margin-bottom: 8px; }
.mail-folder { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.mail-folder:hover { background: var(--surface-3); }
.mail-folder.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.mail-folder.add { color: var(--text-3); margin-top: 6px; justify-content: flex-start; gap: 6px; font-size: 12px; }
.mail-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.mail-list-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1; }
.mail-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border);
  padding: 10px 12px; cursor: pointer; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.active { background: var(--accent-soft); }
.mail-item.unread .mail-from, .mail-item.unread .mail-subject { font-weight: 700; color: var(--text-strong); }
.mail-item-top { display: flex; justify-content: space-between; gap: 8px; }
.mail-from { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject { font-size: 13px; color: var(--text); margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-flag { color: var(--warning-ink); }
.mail-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-read { display: flex; flex-direction: column; }
.mail-read-actions { gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1; }
.mail-read-actions select { max-width: 150px; }
.mail-head { padding: 14px 16px 6px; }
.mail-head h2 { margin: 0 0 8px; font-size: 17px; }
.mail-meta { display: flex; flex-direction: column; gap: 2px; color: var(--text-2); }
.mail-body { padding: 10px 16px 20px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.5; }
.mail-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); }
.mail-empty svg { width: 40px; height: 40px; }
@media (max-width: 1100px) { .mail-layout { grid-template-columns: 170px 1fr; } .mail-read { display: none; } }

/* ---------- Comment composer: formatting toolbar + input + footer (tickets/problems/changes) */
.composer { display: flex; flex-direction: column; gap: 0; }
.fmt-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 6px; border: 1px solid var(--border); border-bottom: 0;
  border-radius: 10px 10px 0 0; background: var(--surface-2); }
.fmt-btn { background: none; border: 0; border-radius: 6px; padding: 4px 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; line-height: 1.4; }
.fmt-btn:hover { background: var(--surface-3); color: var(--text-strong); }
.composer > textarea { border-radius: 0 0 10px 10px; border-top-left-radius: 0; border-top-right-radius: 0; margin: 0; }
.composer-foot { margin-top: 8px; align-items: center; }
/* Rendered comment bodies */
.rich { white-space: normal; }
.rich p { margin: 0 0 8px; white-space: pre-wrap; }
.rich p:last-child { margin-bottom: 0; }
.rich ul, .rich ol { margin: 4px 0 8px; padding-left: 22px; }
.rich li { margin: 2px 0; }
.rich code { font-family: var(--mono); font-size: 12.5px; background: var(--code-bg); padding: 1px 5px; border-radius: 5px; }
.rich blockquote { margin: 4px 0; padding: 2px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.rich a { color: var(--accent-2); }
/* Build PDF report: section checklist */
.doc-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-top: 8px; }
/* SLA policy editor: per-priority targets grid */
.sla-targets { border-collapse: collapse; width: 100%; }
.sla-targets th { text-align: left; font-size: 11.5px; color: var(--text-3); font-weight: 600; padding: 4px 8px; }
.sla-targets td { padding: 5px 8px; border-top: 1px solid var(--border); }

/* ---------- Request forms: builder (Settings -> Forms) and portal rendering */
.form-builder { display: grid; grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); gap: 16px; align-items: start; }
.form-preview { position: sticky; top: 12px; }
.form-field-editor { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.form-field-editor.heading { border-style: dashed; }
.form-add { padding-top: 4px; border-top: 1px dashed var(--border); }
.request-form { gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.req { color: var(--critical); }
.form-heading h3 { margin: 6px 0 2px; font-size: 14px; color: var(--text-strong); text-transform: none; letter-spacing: 0; }
.form-heading { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.form-choices { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
/* Portal: New request 65 / 35 split, form cards */
.portal-split { display: grid; grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); gap: 16px; align-items: start; }
.form-card { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; color: inherit; }
.form-card:hover { border-color: var(--border-strong); }
.form-card.active { border-color: var(--accent); background: var(--accent-soft); }
.form-card-name { font-weight: 600; color: var(--text-strong); margin-bottom: 2px; }
.form-card .kpi-icon { flex-shrink: 0; }
/* Portal: department cards above New request (a click narrows the request forms) */
.dept-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
/* Portal: My tickets dashboard */
.portal-kpi { text-align: left; cursor: pointer; color: inherit; font: inherit; }
.portal-filters { gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.portal-filters input[type="search"] { flex: 1 1 260px; }
@media (max-width: 900px) { .portal-split, .form-builder { grid-template-columns: 1fr; } .form-preview { position: static; } }
.portal-split > .card + .card { margin-top: 0; }                      /* columns, not a stack */
.portal-kpi { align-items: stretch; justify-content: flex-start; }    /* KPI tiles are buttons here */
.portal-kpi .kpi-top { width: 100%; }
.sortable > .row:first-child { padding-right: 36px; }  /* report table cards: title row */

/* Settings -> Email -> requester email template preview */
.req-mail-preview { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 6px; }
.req-mail-subject { font-weight: 600; }
.req-mail-body { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--text-2, inherit); }

/* Network discovery: selection column and push-deploy details */
.check-col { width: 34px; }
.deploy-error { max-width: 280px; white-space: normal; margin-top: 4px; }
.deploy-list { margin: 6px 0 0; padding-left: 18px; }

/* Settings -> Security Config */
.sec-job { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; padding: 14px 0; border-top: 1px solid var(--border); }
.sec-job:first-of-type { border-top: 0; }
.sec-job-main h3 { margin: 0 0 4px; }
.sec-job-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 8px; }
.sec-err { color: var(--critical, #f87171); }
.sec-job-side { display: grid; gap: 8px; align-content: start; }
@media (max-width: 720px) { .sec-job { grid-template-columns: 1fr; } }

/* My Account -> notification preferences */
.notif-prefs td.num, .notif-prefs th.num { text-align: center; width: 150px; }
.notif-prefs th .sm { margin-top: 4px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.notif-prefs tr.notif-group td { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); padding-top: 10px; }

/* Software page */
.sw-link, .sw-url { word-break: break-all; }
.sw-review dd { word-break: break-word; }
.sw-device-list { max-height: 320px; overflow: auto; gap: 6px; }
.sw-ai { background: color-mix(in srgb, var(--violet, #8b5cf6) 18%, transparent); color: var(--violet-ink, #c4b5fd); border-color: transparent; }
.movable-head { margin: -6px 0 2px; min-height: 26px; }
/* Emails: list selection */
.mail-list-head input[type=checkbox] { margin-right: 8px; }
.mail-bulk { padding: 6px 10px; gap: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mail-item { position: relative; padding-left: 34px !important; }
.mail-pick { position: absolute; left: 10px; top: 12px; }
.mail-item.picked { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mail-item { cursor: pointer; }

/* Ticket Management -> Delete module data */
.danger-zone { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.purge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.purge-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.purge-row.disabled { opacity: .6; cursor: default; }
.purge-row input { margin-top: 3px; flex: none; }
.audit-filters input[type=search] { min-width: 260px; flex: 1; }

/* ---------- portal: request sub-items in the nav, "+ New request" pull-down */
.nav a.nav-sub { padding-left: 30px; font-size: 13px; }
.raise-menu { min-width: 280px; }
.raise-menu a { align-items: flex-start; }
.raise-menu a svg { margin-top: 2px; }
.raise-menu strong { color: var(--text-strong); }

/* ---------- ticket: Post Incident Review section (omnirmm.pir) */
.pir-card > summary { cursor: pointer; list-style: none; gap: 10px; }
.pir-card > summary::-webkit-details-marker { display: none; }
.pir-card > summary::before { content: "▸"; color: var(--text-3); transition: transform .15s; }
.pir-card[open] > summary::before { transform: rotate(90deg); }
.pir-section { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pir-row { flex-wrap: nowrap; gap: 6px; }
.pir-row input[type="datetime-local"] { width: 190px; flex: none; }
.pir-row input[type="date"] { width: 150px; flex: none; }
.pir-row select { width: 130px; flex: none; }
@media (max-width: 720px) { .pir-row { flex-wrap: wrap; } }
.pir-sub { padding-left: 4px; gap: 8px; }
.pir-sub h4 { font-size: 13px; color: var(--text-2); }

/* ---------- searchable dropdown (core.js searchPicker) */
.search-pick { position: relative; }
.search-pick > input { width: 100%; }
.search-pick-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 90; max-height: 260px; overflow: auto;
  background: var(--raised); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px;
}
.search-pick-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; padding: 8px 8px 4px; }
.search-pick-item { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.search-pick-item:hover, .search-pick-item.active { background: var(--surface-3); }
.search-pick-item.chosen > span:first-child { font-weight: 600; color: var(--accent-2); }
.search-pick-empty { padding: 8px; font-size: 12.5px; color: var(--text-3); }
.search-select { display: inline-block; min-width: 170px; vertical-align: middle; }
label.field .search-select, .form-grid .search-select { display: block; width: 100%; }
.search-select > input { padding-right: 26px; cursor: pointer; }
.search-select > input:focus { cursor: text; }
.search-select-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; font-size: 11px; }

/* ---------- desktop notifications (notify.js): the one-time offer and clickable in-app toasts */
.desk-offer { position: fixed; right: 18px; bottom: 18px; z-index: 120; width: min(380px, calc(100vw - 32px)); padding: 14px;
  box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.notif-toast { display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; font: inherit; max-width: 360px; }
.notif-toast span { font-size: 12.5px; opacity: .85; }
.desk-card { background: var(--surface-2, transparent); }
.toast.notif-toast { pointer-events: auto; border-color: var(--accent-border, var(--border)); }
.toast.notif-toast::before { display: none; }

/* ---------- approvals list filters (console and portal) */
.approval-filters { gap: 8px; align-items: center; }
.approval-filters input[type="search"] { flex: 1 1 260px; min-width: 200px; }
.approval-filters .search-select { min-width: 180px; }

/* Security -> News (views-news.js) */
.news-tools { gap: 10px; align-items: center; margin: 4px 0 12px; flex-wrap: wrap; }
.news-tools input[type=search] { flex: 1 1 260px; max-width: 420px; }
.news-count { margin-left: 6px; font-size: 11px; color: var(--text-3, var(--text-2)); font-variant-numeric: tabular-nums; }
.news-footprint { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--text-2); }
.news-fp { border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; background: var(--surface-2); }
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-card { position: relative; padding: 14px 16px 14px 18px; display: flex; flex-direction: column; gap: 6px; overflow: hidden;
  animation: news-in .35s ease both; }
.news-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--border); }
.news-card.rel-high::before { background: var(--critical); }
.news-card.rel-medium::before { background: var(--serious); }
.news-card.rel-low::before { background: var(--warning); }
.news-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-2); }
.news-source { font-weight: 600; color: var(--text); }
.news-new { background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--accent-border); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 600; }
.news-cats { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.news-cat { font-size: 11px; border-radius: 999px; padding: 0 8px; border: 1px solid currentColor; line-height: 1.6; }
.news-cat.cat-ai { color: var(--violet); }
.news-cat.cat-vulnerability { color: var(--warning); }
.news-cat.cat-exploit { color: var(--critical); }
.news-cat.cat-cyber { color: var(--serious); }
.news-cat.cat-it { color: var(--accent-2); }
.news-title { margin: 0; font-size: 15.5px; line-height: 1.35; }
.news-title a { color: var(--text-strong, var(--text)); }
.news-title a:hover { color: var(--accent-2); text-decoration: underline; }
.news-summary { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.news-summary.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.news-cves { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.news-why { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--border); }
.news-why-head { font-weight: 600; color: var(--text); margin-right: 2px; }
.rel-high .news-why-head { color: var(--critical-ink, var(--critical)); }
.news-reason { display: inline-flex; gap: 5px; align-items: baseline; font-size: 12px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 8px; padding: 2px 8px; color: var(--text); max-width: 100%; }
.news-reason:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.news-reason .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.news-reason-kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); }
.news-reason.kind-cve .news-reason-kind, .news-reason.kind-domain .news-reason-kind, .news-reason.kind-supplier .news-reason-kind { color: var(--critical-ink, var(--critical)); }
.news-reason.kind-exposed .news-reason-kind, .news-reason.kind-saas .news-reason-kind { color: var(--serious); }
@keyframes news-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .news-card { animation: none; } }
.news-actions { margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--border); }
.news-card.news-done { opacity: .92; }
.news-card.news-done::before { background: var(--text-3, var(--text-2)); }
.news-status { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 8px; line-height: 1.6; border: 1px solid currentColor; }
.news-status-acknowledged { color: var(--accent-2); }
.news-status-risk_accepted { color: var(--warning); }
.news-history { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--text-2); }
.news-justify { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; line-height: 1.45; }
.news-docs { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.news-pager { margin: 14px 0 4px; }

/* Web Filtering (views-webfilter.js) */
.wf-body { display: flex; flex-direction: column; gap: 14px; }
.wf-intro { gap: 12px; align-items: center; }
.wf-mode { font-size: 12px; border-radius: 999px; padding: 1px 9px; border: 1px solid currentColor; white-space: nowrap; }
.wf-mode-endpoint { color: var(--accent-2); }
.wf-mode-intercept { color: var(--serious); }
.wf-bad { color: var(--critical); }
.wf-note { border-radius: var(--radius-md); padding: 8px 12px; font-size: 13px; border: 1px solid var(--border); background: var(--surface-2); }
.wf-note.warn { border-color: var(--warning); color: var(--text); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.wf-note.bad { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, var(--surface)); }
.wf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; }
.wf-chips { gap: 6px; flex-wrap: wrap; }
.tag.wf-block { border-color: var(--critical); color: var(--critical); }
.tag.wf-allow { border-color: var(--good); color: var(--good); }
.wf-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.wf-modecard { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; background: var(--surface-2); }
.wf-modecard:has(input:checked) { border-color: var(--accent-border); background: var(--accent-soft); }
.wf-modecard p { margin: 4px 0 0; }
.wf-groups { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; padding-right: 4px; }
.wf-group { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.wf-group > summary { cursor: pointer; padding: 8px 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wf-cat { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 12px; border-top: 1px solid var(--border); }
.wf-cat.sel-block { background: color-mix(in srgb, var(--critical) 7%, transparent); }
.wf-cat.sel-allow { background: color-mix(in srgb, var(--good) 7%, transparent); }
.wf-cat-name { min-width: 0; }
.wf-src { font-size: 11px; color: var(--text-3); margin-left: 8px; }
.wf-cat-n { white-space: nowrap; }
.wf-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.wf-seg button { border: 0; border-radius: 0; padding: 3px 10px; min-height: 0; font-size: 12px; background: none; color: var(--text-2); }
.wf-seg button + button { border-left: 1px solid var(--border); }
.wf-seg button.on.wf-seg-off { background: var(--surface-3); color: var(--text); }
.wf-seg button.on.wf-seg-block { background: var(--critical); color: #fff; }
.wf-seg button.on.wf-seg-allow { background: var(--good); color: #fff; }
.wf-editor textarea { width: 100%; font-family: var(--mono); font-size: 12px; }
.wf-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.wf-source { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; background: var(--surface-2); }
.wf-feeds summary { cursor: pointer; font-weight: 600; }
.wf-feed { gap: 8px; align-items: center; margin-top: 6px; }
.wf-feed input { flex: 1; font-family: var(--mono); font-size: 12px; }
.wf-feed-fmt { width: 70px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.wf-custom { gap: 6px; align-items: center; flex-wrap: wrap; }
.wf-custom input { flex: 1; min-width: 140px; }
.wf-test { border-left: 3px solid var(--good); padding: 4px 10px; }
.wf-test.blocked { border-left-color: var(--critical); }
.wf-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.wf-days { display: flex; gap: 6px; align-items: flex-end; height: 120px; }
.wf-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.wf-bar { flex: 1; width: 100%; max-width: 28px; position: relative; }
.wf-bar span { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 3px 3px 0 0; }
.wf-bar .q, .wf-key.q { background: var(--accent-soft); border: 1px solid var(--accent-border); }
.wf-bar .b, .wf-key.b { background: var(--critical); }
.wf-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
@media (max-width: 640px) { .wf-cat { grid-template-columns: 1fr; } }

/* X-Scan risk grade (views-xscan.js) */
.xs-grade { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; height: 1.9em; padding: 0 .35em;
  border-radius: 8px; font-weight: 700; color: #fff; background: var(--accent); }
.kpi .value .xs-grade { font-size: 1.1em; }
.xs-grade-A { background: var(--good); } .xs-grade-B { background: color-mix(in srgb, var(--good) 60%, var(--warning)); }
.xs-grade-C { background: var(--warning); } .xs-grade-D { background: var(--serious); } .xs-grade-F { background: var(--critical); }
/* X-Scan email posture dots and SaaS review state */
.xs-mail { font-size: 10.5px; font-weight: 600; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; }
.xs-mail-pass { background: color-mix(in srgb, var(--good) 18%, transparent); border-color: color-mix(in srgb, var(--good) 45%, transparent); color: var(--good-ink); }
.xs-mail-warn { background: color-mix(in srgb, var(--warning) 18%, transparent); border-color: color-mix(in srgb, var(--warning) 45%, transparent); color: var(--warning-ink); }
.xs-mail-fail { background: color-mix(in srgb, var(--critical) 18%, transparent); border-color: color-mix(in srgb, var(--critical) 45%, transparent); color: var(--critical-ink); }
.tag.xs-unreviewed { border-style: dashed; }

/* X-Scan Attack map */
:root { --xs-blue: #38bdf8; }
:root[data-theme="light"] { --xs-blue: #0284c7; }
.xa { display: flex; flex-direction: column; gap: 10px; }
.xa-toolbar { gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.xa-toolbar .field { margin: 0; min-width: 200px; }
.xa-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.xa-seg button { border: 0; border-radius: 0; background: none; padding: 6px 12px; color: var(--text-2); }
.xa-seg button.active { background: var(--accent-soft); color: var(--accent-2); }
.xa-filters { gap: 6px; flex-wrap: wrap; align-items: center; }
.xa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: none; color: var(--text-3); font-size: 12.5px; }
.xa-chip.on { color: var(--text); background: var(--surface-3); }
.xa-chip:not(.on) .xa-dot { opacity: .35; }
.xa-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.xa-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; }
.xa-stage-wrap { position: relative; min-width: 0; }
.xa-stage { position: relative; height: 640px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, var(--surface-2), var(--surface) 70%); }
.xa-svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; touch-action: none; }
.xa-svg:active { cursor: grabbing; }
.xa-ring { fill: none; stroke: var(--border); stroke-dasharray: 2 6; }
.xa-edge { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .7s ease, opacity .3s; }
.xa-edge.port { stroke-width: .7; opacity: .7; }
.xa-node { cursor: pointer; transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.xa-node circle { stroke: var(--surface); stroke-width: 1.5; transition: r .2s; }
.xa-node:hover circle, .xa-node:focus circle, .xa-node.sel circle { stroke: var(--text-strong); stroke-width: 2.5; }
.xa-node.root circle { stroke: var(--accent-2); stroke-width: 3; filter: drop-shadow(0 0 8px var(--accent-border)); }
.xa-node.host.role-access circle, .xa-node.host.role-api circle { stroke: var(--accent-2); }
.xa-node.host.role-device circle { stroke: var(--accent); stroke-dasharray: 2 2; }
.xa-node.gone { opacity: .45; }
.xa-node.discovering circle { animation: xa-pop 1.2s ease-in-out infinite; }
.xa-node.impact rect { fill: var(--surface-3); stroke: var(--border-strong); }
.xa-node.impact.attacker rect { stroke: var(--critical); fill: color-mix(in srgb, var(--critical) 12%, var(--surface-3)); }
.xa-node.dim, .xa-edge.dim, .xa-path.dim { opacity: .14; }
.xa-label { font-size: 9.5px; fill: var(--text-2); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.xa-node.root .xa-label { font-size: 12px; font-weight: 600; fill: var(--text-strong); }
.xa-glyph { font-size: 14px; fill: var(--accent-ink); pointer-events: none; }
.xa-node.impact .xa-glyph { fill: var(--text); font-size: 12px; }
.xa-impact-label { font-size: 9.5px; fill: var(--text); pointer-events: none; }
.xa-port-label { font-size: 7.5px; fill: var(--text-2); pointer-events: none; font-family: var(--mono, monospace); }
.xa-path { fill: none; stroke-width: 2; stroke-dasharray: 7 5; opacity: .85; cursor: pointer; animation: xa-flow 1s linear infinite; }
.xa-path:hover, .xa-path.sel { stroke-width: 3.5; opacity: 1; filter: drop-shadow(0 0 4px currentColor); }
.xa-path.sel { animation-duration: .5s; }
@keyframes xa-flow { to { stroke-dashoffset: -24; } }
@keyframes xa-pop { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .xa-path, .xa-node.discovering circle, .xa-pulse { animation: none; } .xa-node, .xa-edge { transition: none; } }
/* hover focus */
.xa-svg.xa-hovering .xa-node:not(.hl):not(.focus), .xa-svg.xa-hovering .xa-edge:not(.hl), .xa-svg.xa-hovering .xa-path:not(.hl) { opacity: .15; }
.xa-path { transition: opacity .25s, stroke-width .2s; }
.xa-edge.hl { stroke: var(--accent-2); stroke-width: 1.8; opacity: 1; }
.xa-path.hl { stroke-width: 3.2; opacity: 1; animation-duration: .45s; }
.xa-node > circle:not(.xa-halo) { transform-box: fill-box; transform-origin: center; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.xa-node.focus > circle:not(.xa-halo) { transform: scale(1.55); stroke: var(--text-strong); stroke-width: 2.5; }
.xa-node.root.focus > circle:not(.xa-halo) { transform: scale(1.15); }
.xa-node.focus .xa-label { font-weight: 600; fill: var(--text-strong); font-size: 11px; }
.xa-halo { fill: none; stroke: var(--accent-2); stroke-width: 2; transform-box: fill-box; transform-origin: center;
  animation: xa-halo 1.3s ease-out infinite; pointer-events: none; }
@keyframes xa-halo { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
.xa-node.ripple > circle:not(.xa-halo) { animation: xa-bump .55s ease-out both; animation-delay: var(--d, 0ms); }
@keyframes xa-bump { 40% { transform: scale(1.7); } }
.xa-peek .xa-node { transition: transform .35s cubic-bezier(.2, .9, .3, 1.25), opacity .25s; }
.xa-peek .xa-edge { stroke-dasharray: 1; transition: stroke-dashoffset .35s ease; }
.xa-tip.pop { animation: xa-tip-in .18s ease-out; }
.xa-tip.pop .xa-kv > * { animation: xa-row-in .3s ease-out both; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
@keyframes xa-tip-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes xa-row-in { from { opacity: 0; transform: translateX(-6px); } }
@media (prefers-reduced-motion: reduce) { .xa-halo, .xa-node.ripple > circle, .xa-tip.pop, .xa-tip.pop .xa-kv > * { animation: none; } }
.xa-tip { position: absolute; z-index: 5; max-width: 280px; padding: 8px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); pointer-events: none; font-size: 12.5px; }
.xa-kv { margin: 6px 0 0; grid-template-columns: auto 1fr; font-size: 12px; }
.xa-kv dd { word-break: break-word; }
.xa-legend { position: absolute; left: 10px; bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 4px 8px; border-radius: 8px; }
.xa-legend span { display: inline-flex; align-items: center; gap: 5px; }
.xa-side { border: 1px solid var(--border); border-radius: 12px; padding: 12px; max-height: 640px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.xa-side h4 { margin: 4px 0 0; }
.xa-list { display: flex; flex-direction: column; gap: 4px; }
.xa-path-row { display: flex; gap: 8px; align-items: center; text-align: left; width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px; }
.xa-path-row:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.xa-path-row .grow { flex: 1; min-width: 0; }
.xa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.xa-vectors { margin: 0; padding-left: 18px; }
.xa-ai { border-top: 1px solid var(--border); padding-top: 12px; }
.xa-chain { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-bottom: 6px; }
.xa-answer { border-left: 3px solid var(--accent); padding: 4px 0 4px 10px; }
.xa-live { color: var(--critical-ink); animation: xa-pop 1.2s ease-in-out infinite; }
.xa-grat { stroke: var(--border); stroke-width: .5; }
.xa-land { fill: var(--surface-3); stroke: var(--border-strong); stroke-width: .6; }
.xa-geo { cursor: default; }
.xa-bubble { transform-box: fill-box; transform-origin: center; cursor: pointer; transition: opacity .25s; }
.xa-enter .xa-bubble { animation: xa-grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.xa-pulse { opacity: .35; animation: xa-ripple 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.xa-pulse.hot { animation-duration: 1.4s; }
.xa-sea { fill: transparent; }
.xa-grat { pointer-events: none; }
.xa-bubble.sel > circle:nth-child(2) { stroke: var(--text-strong); stroke-width: 1.6; }
.xa-geo-ring { fill: none; stroke-width: 2.2; pointer-events: none; }
.xa-arc-line { fill: none; stroke-width: 1.3; stroke-dasharray: 3 3; opacity: .55; animation: xa-arc-flow 1.6s linear infinite; transition: opacity .25s, stroke-width .25s; }
.xa-enter .xa-arc-line { animation: xa-arc-draw 1s ease-out backwards, xa-arc-flow 1.6s linear 1s infinite; }
.xa-arc-dot { pointer-events: none; }
.xa-arc { transition: opacity .25s; }
.xa-geo-label { font-size: 8.5px; fill: var(--text); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; transition: opacity .25s; }
.xa-enter .xa-geo-label { animation: xa-label-in .5s ease-out both; }
.xa-geo-label .xa-geo-count { fill: var(--text-2); font-weight: 600; }
.xa-geo-label .muted { fill: var(--text-2); }
.xa-dim .xa-bubble:not(.on), .xa-dim .xa-geo-label:not(.on) { opacity: .2; }
.xa-dim .xa-arc:not(.on) { opacity: .08; }
.xa-dim .xa-arc.on .xa-arc-line { opacity: 1; stroke-width: 2; }
.xa-geo-label.on { font-weight: 600; }
.xa-fan-item { transform-box: fill-box; transform-origin: center; animation: xa-fan-in .35s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 30ms); pointer-events: none; }
.xa-fan-line { stroke-width: 1; opacity: .7; }
.xa-fan-label { font-size: 7.5px; fill: var(--text-strong); font-family: var(--mono, monospace); paint-order: stroke; stroke: var(--surface); stroke-width: 2.5px; }
.xa-fan-label.muted { fill: var(--text-2); }
.xa-tip-assets { margin: 4px 0; display: flex; flex-direction: column; gap: 2px; }
.xa-path-row.active { border-color: var(--accent-border); background: var(--accent-soft); }
@keyframes xa-arc-flow { to { stroke-dashoffset: -12; } }
@keyframes xa-arc-draw { from { stroke-dasharray: 0 100; opacity: 0; } to { stroke-dasharray: 100 0; opacity: .55; } }
@keyframes xa-label-in { from { opacity: 0; transform: translateY(3px); } }
@keyframes xa-fan-in { from { opacity: 0; transform: scale(.4); } }
@media (prefers-reduced-motion: reduce) { .xa-enter .xa-bubble, .xa-arc-line, .xa-enter .xa-arc-line, .xa-enter .xa-geo-label, .xa-fan-item { animation: none; } }
@keyframes xa-grow { from { transform: scale(0); opacity: 0; } }
@keyframes xa-ripple { from { transform: scale(1); opacity: .45; } to { transform: scale(2.2); opacity: 0; } }
@media (max-width: 1100px) { .xa-body { grid-template-columns: 1fr; } .xa-stage { height: 480px; } .xa-side { max-height: none; } }
/* Full screen attack / hosting map: the card fills the screen and the stage takes the rest of the height. */
.xa:fullscreen, .xa.xa-full { background: var(--bg, var(--surface)); padding: 14px; border-radius: 0; margin: 0; overflow: hidden; }
.xa.xa-full { position: fixed; inset: 0; z-index: 900; }
.xa:fullscreen .xa-body, .xa.xa-full .xa-body { flex: 1; min-height: 0; }
.xa:fullscreen .xa-stage-wrap, .xa.xa-full .xa-stage-wrap { height: 100%; }
.xa:fullscreen .xa-stage, .xa.xa-full .xa-stage { height: 100%; }
.xa:fullscreen .xa-side, .xa.xa-full .xa-side { max-height: none; height: 100%; }
@media (max-width: 1100px) {
  .xa:fullscreen .xa-body, .xa.xa-full .xa-body { grid-template-rows: minmax(0, 1fr) auto; }
  .xa:fullscreen .xa-side, .xa.xa-full .xa-side { height: auto; max-height: 30vh; }
}


/* Settings -> General (views-general.js): branding, maintenance banner, holiday and window lists */
.brand-mark.brand-logo { background: transparent; box-shadow: none; overflow: hidden; }
.brand-mark.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo-preview { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.brand-logo-preview img { max-height: 48px; max-width: 160px; object-fit: contain; }
.login-notice { white-space: pre-wrap; }
.support-contacts a { white-space: nowrap; }
.maint-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 28px 0; padding: 10px 14px;
  border: 1px solid rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1); border-radius: var(--radius-md); font-size: 13px; }
.maint-banner[hidden] { display: none; }
.maint-banner svg { width: 16px; height: 16px; color: var(--warning); flex-shrink: 0; }
.row.wrap { flex-wrap: wrap; }
.holiday-row { padding: 6px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.holiday-row:last-child { border-bottom: 0; }

/* Settings -> General layout: titled sections of two-card rows. Cards in a row stretch to the
   same height and pin their Save row to the bottom, so paired cards and buttons line up. */
.settings-section { margin: 22px 0 0; }
.settings-section:first-child { margin-top: 0; }
.card + .settings-section { margin-top: 22px; }
.settings-section-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.settings-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.settings-row + .settings-row { margin-top: 16px; }
.settings-row > :only-child { grid-column: 1 / -1; }
.settings-row > .card, .settings-col > .card { margin-top: 0; display: flex; flex-direction: column; min-width: 0; }
.settings-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-col > .card:last-child { flex: 1; }
.settings-row .card-actions { margin-top: auto; padding-top: 6px; }
/* Cards without a Save row (Backup, Restart, Reset, Dashboard restore) pin their last control to the bottom too. */
.settings-row > .card > :last-child:not(:first-child), .settings-col > .card > :last-child:not(:first-child) { margin-top: auto; }
/* Labels that wrap to two lines mustn't push their input down: inputs in a form row share a baseline. */
.settings-row .form-grid { align-items: end; }
.settings-row .card h3 { font-size: 13px; color: var(--text-2); }
.settings-row .form-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (max-width: 1100px) { .settings-row { grid-template-columns: minmax(0, 1fr); } .settings-row > :only-child { grid-column: auto; } }

/* Console announcement (Settings -> General -> Console defaults) */
.announce-banner { display: flex; align-items: center; gap: 8px; margin: 12px 28px 0; padding: 10px 14px; border-radius: var(--radius-md);
  font-size: 13px; border: 1px solid var(--accent-border); background: var(--accent-soft); white-space: pre-wrap; }
.announce-banner svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-2); }
.announce-banner.level-warning { border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1); }
.announce-banner.level-warning svg { color: var(--warning); }
.announce-banner.level-critical { border-color: rgba(244, 63, 94, .35); background: rgba(244, 63, 94, .1); }
.announce-banner.level-critical svg { color: var(--critical); }
.announce-banner.in-card { margin: 0; }
.announce-banner.in-main { margin: 0 0 16px; }
@media (max-width: 700px) { .announce-banner, .maint-banner { margin-left: 16px; margin-right: 16px; } }
.settings-row input[type="color"] { width: 44px; height: 34px; padding: 3px; cursor: pointer; }

/* Knowledge Base -> Announcements (views-announcements.js) */
.st-withdrawn { --tone: var(--text-2); --tone-ink: var(--text-2); }
.ann-compose { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.ann-compose .span-2 { grid-column: 1 / -1; }
.ann-preview-col { position: sticky; top: 0; }
.ann-detail { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 14px; align-items: start; }
.ann-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ann-seg button { border: 0; border-radius: 0; background: transparent; }
.ann-seg button.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.ann-popup { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; color: #1f2328; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.ann-popup-head { color: #fff; font-weight: 600; font-size: 16px; padding: 10px 14px; line-height: 1.3; }
.ann-popup-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.ann-popup-body .muted { color: #5b6370; }
.ann-msg { margin: 0; white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; }
.ann-sec-label { font-weight: 600; font-size: 12.5px; }
.ann-img { max-width: 100%; max-height: 220px; object-fit: contain; align-self: flex-start; border-radius: 6px; }
.ann-screen { position: relative; height: 170px; border: 6px solid #2a2f3a; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #3b4a6b, #1f2a40); }
.ann-strip { position: absolute; display: flex; align-items: center; overflow: hidden; color: #fff; font-weight: 600; font-size: 12px; }
.ann-pos-top .ann-strip { top: 0; left: 0; right: 0; height: 24px; }
.ann-pos-bottom .ann-strip { bottom: 0; left: 0; right: 0; height: 24px; }
.ann-pos-left .ann-strip { top: 0; bottom: 0; left: 0; width: 34%; align-items: flex-start; }
.ann-pos-right .ann-strip { top: 0; bottom: 0; right: 0; width: 34%; align-items: flex-start; }
.ann-ticker { white-space: nowrap; padding-left: 100%; animation: ann-roll 16s linear infinite; }
.ann-ticker.vertical { white-space: pre-wrap; padding: 100% 22px 0 8px; animation: ann-rise 18s linear infinite; font-size: 11px; }
.ann-x { position: absolute; right: 6px; top: 4px; font-size: 12px; }
@keyframes ann-roll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes ann-rise { from { transform: translateY(0); } to { transform: translateY(-100%); } }
@media (prefers-reduced-motion: reduce) { .ann-ticker, .ann-ticker.vertical { animation: none; padding: 4px 22px 4px 8px; } }
@media (max-width: 1100px) { .ann-compose, .ann-detail { grid-template-columns: 1fr; } .ann-preview-col { position: static; } }

/* Collapsible left menu: icons only, labels as tooltips (App.setSidebarCollapsed, Ctrl/⌘B). */
:root { --sidebar-w-collapsed: 72px; }
.sidebar { transition: width .2s cubic-bezier(.16, 1, .3, 1); }
.sidebar-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 10px; background: none;
  border: 1px solid transparent; color: var(--sidebar-text); font-size: 13px; font-weight: 500; cursor: pointer; }
.sidebar-toggle:hover { background: var(--nav-hover); color: var(--text-strong); }
.sidebar-toggle svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-foot .sidebar-toggle { align-self: stretch; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 861px) {
  .shell.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); overflow-x: hidden; }
  .shell.sidebar-collapsed .sidebar > .brand { flex-direction: column; align-items: center; padding: 12px 8px; gap: 10px; }
  .shell.sidebar-collapsed .sidebar > .brand .brand-text { display: flex; flex-direction: column; align-items: center; width: 100%; }
  .shell.sidebar-collapsed .brand-name, .shell.sidebar-collapsed .brand-sub { display: none; }
  .shell.sidebar-collapsed .brand-foot { margin-top: 0; margin-left: 0; width: 100%; align-items: center; }
  .shell.sidebar-collapsed .nav { padding: 12px 10px; }
  .shell.sidebar-collapsed .nav-label { display: none; }
  .shell.sidebar-collapsed .nav-section { padding: 10px 0 4px; }
  .shell.sidebar-collapsed .nav-section::after { content: ""; display: block; height: 1px; margin: 0 10px; background: var(--border); }
  .shell.sidebar-collapsed .nav-group:first-child .nav-section { padding-top: 0; }
  .shell.sidebar-collapsed .nav-group:first-child .nav-section::after { display: none; }
  .shell.sidebar-collapsed .nav-reset { justify-content: center; padding: 8px 0; gap: 0; }
  .shell.sidebar-collapsed .nav a, .shell.sidebar-collapsed .sidebar-toggle { justify-content: center; padding: 10px 0; gap: 0; position: relative; }
  .shell.sidebar-collapsed .nav a.nav-sub { padding-left: 0; }
  .shell.sidebar-collapsed .nav .badge { position: absolute; top: 3px; right: 6px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 14px; }
  .shell.sidebar-collapsed .status-chip { padding: 9px; justify-content: center; }
  .shell.sidebar-collapsed .status-chip .status-text, .shell.sidebar-collapsed .status-chip .status-meta { display: none; }
}
@media (max-width: 860px) { .sidebar-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
@media (min-width: 861px) { .shell.sidebar-collapsed .nav .badge { background: var(--critical); color: #fff; border: 2px solid var(--sidebar); } }
/* The menu scrolls on its own, so the footer (connection status, collapse button) stays in view. */
.sidebar { overflow: hidden; }
.sidebar > .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }

/* Announcements -> Delivery status (views-announcements.js) */
.ann-status .grid.kpis { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
.ann-status .grid.kpis > .card, .ann-status-row > .card { margin-top: 0; }
.ann-status-row { align-items: stretch; }
.ann-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.ann-bar > span { display: block; min-width: 3px; transition: width .4s cubic-bezier(.16, 1, .3, 1); }
.ann-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--text-2); }
.ann-legend span { display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.ann-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ann-per { gap: 10px; }
.ann-per-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; color: inherit; }
.ann-per-row:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.ann-per-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.ann-too-old { display: flex; flex-wrap: wrap; gap: 6px; }
.st-cancelled { --tone: var(--text-3); --tone-ink: var(--text-2); }
.st-withdrawn { --tone: var(--text-3); --tone-ink: var(--text-2); }

/* X-Scan depth & operations (views-xscan-plus.js) */
.xs-plus-row { align-items: stretch; }
.xs-plus-row > .card { margin-top: 0; display: flex; flex-direction: column; }
.xs-plus-row .card-actions { margin-top: auto; padding-top: 6px; }
.xs-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.xs-shots figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.xs-shots img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.xs-shots figcaption { padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-hook { gap: 6px; flex-wrap: wrap; }
.xs-fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.xs-fw { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.xs-fw:has(input:checked) { border-color: var(--accent-border); background: var(--accent-soft); }
.xs-fw input { margin-top: 3px; flex: none; width: 16px; height: 16px; }
.xs-ctl-id { display: inline-block; min-width: 64px; color: var(--accent-2); }
.xs-ctl-list { display: flex; flex-direction: column; gap: 3px; }
.xs-ctl-kv dt { white-space: normal; max-width: 220px; }
.xs-meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xs-meter > span { display: block; height: 100%; background: var(--warning); }
/* Security Compliance -> Frameworks */
.cf-tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cf-tile { text-align: left; cursor: pointer; margin: 0; font: inherit; color: inherit; }
.cf-tile.active { border-color: var(--accent-border); box-shadow: 0 0 0 1px var(--accent-border), var(--shadow); }
.cf-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin-top: 8px; }
.cf-bar > span { display: block; height: 100%; }
.cf-compliant { background: var(--good); } .cf-non_compliant { background: var(--critical); } .cf-not_assessed { background: var(--text-3); opacity: .5; }
.cf-picker > summary { cursor: pointer; list-style: revert; }
.cf-tile { display: flex; flex-direction: column; }
.cf-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-tile-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-tile-ver { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cf-tile .value { margin-top: 8px; }
.cf-tile .cf-bar { margin-top: auto; padding-top: 0; }
.cf-tile .sub { margin-bottom: 8px; }
.cf-catalogue { margin: 2px 0 6px; }
.cf-req { max-width: 640px; }
.cf-req-text { white-space: pre-wrap; max-height: 260px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.cf-area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
/* Security Compliance -> Compliance status: manual benchmarks | framework dashboard */
.cs-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cs-half { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cs-half-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cs-half-head h2 { margin: 0; }
.cs-half .grid.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cs-half .grid.cols-2, .cs-half .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
.cs-half .grid > .card, .cs-half .stack > .card { margin-top: 0; }
.cf-top-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cf-fix { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1200px) { .cs-split { grid-template-columns: minmax(0, 1fr); } }
.ann-bulk { padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--accent-border); background: var(--accent-soft); border-radius: var(--radius-md); gap: 8px; }
.ann-bulk[hidden] { display: none; }
.st-paused { --tone: var(--warning); --tone-ink: var(--warning-ink); }

/* Export dialog (core.js exportModal) */
.export-choices { display: grid; gap: 8px; }
.export-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.export-choice:hover { border-color: var(--accent); }
.export-choice.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.export-choice input { margin-top: 3px; flex: none; width: 16px; height: 16px; }
.export-choice > span { display: flex; flex-direction: column; gap: 2px; }
.nowrap { white-space: nowrap; }
.wf-two > .card { margin-top: 0; }
.tabs.tabs-wrap { flex-wrap: wrap; overflow: visible; }

/* Security -> XDR (views-xdr.js) */
.kv > div { padding: 5px 0; border-bottom: 1px solid var(--border); min-width: 0; overflow-wrap: anywhere; }
.xdr-tactics { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.xdr-tactic { border: 1px solid var(--border); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.xdr-tactic > .small.muted:first-child { text-transform: capitalize; font-weight: 600; }
.xdr-timeline { display: flex; flex-direction: column; gap: 2px; max-height: 520px; overflow: auto; }
.xdr-tl { padding: 4px 8px; border-left: 3px solid var(--border); }
.xdr-tl-alert { border-left-color: var(--critical); }
.xdr-tl-action { border-left-color: var(--accent); }
.xdr-tl-note { border-left-color: var(--good); }

.xdr-ai-result { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, transparent); display: grid; gap: 6px; }
.xdr-ai-result .mono { white-space: pre-wrap; word-break: break-word; }
.xdr-ai-result ul { margin: 0; padding-left: 18px; }

.wf-bp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.wf-bp-preview { position: sticky; top: 12px; display: grid; gap: 6px; }
.wf-bp-frame { width: 100%; height: 620px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.wf-bp-thumb { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.wf-bp-thumb img { max-height: 44px; max-width: 140px; border-radius: 6px; background: repeating-conic-gradient(#8882 0 25%, transparent 0 50%) 0 0 / 12px 12px; }
@media (max-width: 1100px) { .wf-bp { grid-template-columns: 1fr; } .wf-bp-preview { position: static; } }

/* Settings -> General -> Modules */
.module-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.module-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.module-group-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3, var(--muted)); margin-bottom: 4px; }
.module-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; cursor: pointer; border-radius: 8px; }
.module-row.required { cursor: default; }
.module-row .module-icon { display: inline-flex; color: var(--accent); }
.module-row .module-icon svg { width: 16px; height: 16px; }
.module-row .module-name { flex: 1; }
.module-row.off .module-name, .module-row.off .module-icon { opacity: .45; }
.module-row.module-sub { padding-left: 22px; }
.module-row .module-note { line-height: 1.3; margin-top: 1px; }
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.switch-ui { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong, #3a4560); transition: background .15s; position: relative; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:disabled + .switch-ui { opacity: .5; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

/* X-Scan attack map: on-map controls and dragging */
.xa-controls { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 2; }
.xa-zoom { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.xa-zoom button { width: 34px; height: 32px; border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 17px; line-height: 1; padding: 0; cursor: pointer; }
.xa-zoom button + button { border-top: 1px solid var(--border); }
.xa-zoom button:hover { background: var(--surface-3); color: var(--accent-2); }
.xa-find { width: 180px; font-size: 12px; padding: 6px 10px; background: var(--surface-2); }
.xa-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.xa-node { touch-action: none; }
.xa-node:active { cursor: grabbing; }
.xa-svg.xa-dragging { cursor: grabbing; }
.xa-svg.xa-dragging .xa-node.moving { transition: none; }
.xa-svg.xa-dragging .xa-node.moving circle { filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); }
.xa-svg.xa-dragging .xa-path { animation-play-state: paused; }

/* ---------- network discovery: logical network map (views-ops.js networkMap) */
.nm-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--raised); overflow: hidden; }
.nm-view { position: relative; height: 60vh; overflow: hidden; cursor: grab; touch-action: none; user-select: none; outline: none; }
.nm-view:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-border); }
.nm-view.panning { cursor: grabbing; }
.nm-view.panning .nm-host { cursor: grabbing; }
.nm-svg { display: block; width: 100%; height: 100%; font-family: var(--font); }
.nm-tools { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: 11px; background: color-mix(in srgb, var(--raised) 88%, transparent); backdrop-filter: blur(6px); }
.nm-tools .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.nm-tools .icon-btn:disabled { opacity: .4; cursor: default; }
.nm-zoom-pct { min-width: 44px; text-align: center; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* fullscreen: the discovered-hosts card fills the screen and the map takes all the room left */
.card:fullscreen, .card.nm-full { display: flex; flex-direction: column; overflow: auto; margin: 0; border-radius: 0; background: var(--surface); }
.card.nm-full { position: fixed; inset: 0; z-index: 1000; }
.card:fullscreen > .stack, .card.nm-full > .stack { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card:fullscreen .nm-wrap, .card.nm-full .nm-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card:fullscreen .nm-view, .card.nm-full .nm-view { flex: 1; height: auto; min-height: 0; }
.nm-link { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.nm-link.nm-trunk { stroke: var(--accent-border); stroke-width: 2; }
.nm-link.nm-wifi { stroke: var(--cc-5); stroke-dasharray: 2 4; }
.nm-frame { fill: none; stroke: var(--border); stroke-dasharray: 6 5; }
.nm-frame-t1 { fill: var(--text-strong); font: 600 14px var(--mono); }
.nm-frame-t2 { fill: var(--text-3); font-size: 11px; }
.nm-cloud rect { fill: var(--accent-soft); stroke: var(--accent-border); stroke-width: 1.5; }
.nm-cloud .t1 { fill: var(--text-strong); font-size: 13px; font-weight: 600; }
.nm-cloud .t2 { fill: var(--text-2); font-size: 11px; }
.nm-cloud .nm-ic path { stroke: var(--accent-2); }
.nm-ic path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nm-host rect { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; transition: stroke .15s, fill .15s; }
.nm-host .t1 { fill: var(--text); font-size: 12px; font-weight: 600; }
.nm-host .t2 { fill: var(--text-2); font: 11px var(--mono); }
.nm-host .t3 { fill: var(--text-3); font-size: 10px; }
.nm-host.managed rect { stroke: var(--good); }     .nm-host.managed .dot { fill: var(--good); }
.nm-host.unmanaged rect { stroke: var(--warning); } .nm-host.unmanaged .dot { fill: var(--warning); }
.nm-host.deploying rect { stroke: var(--accent); }  .nm-host.deploying .dot { fill: var(--accent); }
.nm-host.failed rect { stroke: var(--critical); }   .nm-host.failed .dot { fill: var(--critical); }
.nm-host.inferred rect { stroke: var(--text-3); stroke-dasharray: 5 4; fill: transparent; }
.nm-host.inferred .t1 { fill: var(--text-2); }
.nm-host.clickable { cursor: pointer; }
.nm-host.clickable:hover rect, .nm-host:focus-visible rect { fill: var(--surface-3); }
.nm-host:focus { outline: none; }
.nm-host.sel rect { stroke: var(--accent-2); stroke-width: 3; fill: var(--accent-soft); }
/* role icon badge in each device's bottom-right corner */
.nm-badge circle { fill: var(--surface); stroke: currentColor; stroke-width: 1.5; }
.nm-badge .nm-ic path { stroke-width: 2.2; }
.role-firewall { color: var(--cc-4); } .role-router { color: var(--cc-1); } .role-switch, .role-hub { color: var(--cc-2); }
.role-access_point, .role-wlc { color: var(--cc-5); } .role-server, .role-domain_controller, .role-hypervisor, .role-nas, .role-bmc { color: var(--cc-6); }
.role-printer { color: var(--cc-3); } .role-camera { color: var(--cc-7); } .role-voip, .role-iot { color: var(--cc-8); }
.role-workstation, .role-mobile, .role-unknown, .role-internet { color: var(--text-2); }
.nm-cluster rect { fill: var(--surface); stroke: var(--border); }
.nm-cluster .t1 { fill: var(--text-2); font-size: 12px; font-weight: 600; }
.nm-service rect { fill: var(--surface-2); stroke: var(--accent-border); stroke-width: 1.5; }
.nm-service .t1 { fill: var(--text); font-size: 12px; font-weight: 600; }
.nm-service .t2 { fill: var(--text-3); font-size: 11px; }
.nm-service .svc path { stroke: var(--accent-2); }
.nm-more rect { fill: none; stroke: var(--border-strong); stroke-dasharray: 4 3; }
.nm-more text { fill: var(--text-2); font-size: 12px; }
.nm-empty { fill: var(--text-3); font-size: 13px; }
.nm-mode button { padding: 4px 12px; }
.nm-legend { gap: 14px; flex-wrap: wrap; }
.nm-key::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.nm-key.managed::before { background: var(--good); }
.nm-key.unmanaged::before { background: var(--warning); }
.nm-key.deploying::before { background: var(--accent); }
.nm-key.failed::before { background: var(--critical); }
.nm-key.inferred::before { border: 1.5px dashed var(--text-3); border-radius: 3px; background: none; }
.nm-type { display: flex; align-items: center; gap: 8px; }
.nm-inline-ic { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nm-manual { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; line-height: 16px;
  color: var(--text-2); border: 1px dashed var(--border-strong); vertical-align: 1px; font-weight: 400; }

/* Network discovery -> Schedule */
.disc-sched { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.disc-sched-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.disc-sched-grid input, .disc-sched-grid select { width: 100%; min-width: 0; }

/* Settings locked by the service provider (Admin -> Tenants -> Edit) */
.settings-locked > *:not(.lock-note) { opacity: .5; filter: grayscale(.5); }
.settings-locked .lock-note + * { margin-top: 0; }
.lock-note { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; width: max-content; margin-bottom: 10px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--warning, #f59e0b);
  background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent); }
.lock-note svg { width: 13px; height: 13px; }
/* Admin -> Tenants -> Edit */
.tenant-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tenant-pick-group { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.tenant-pick-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3, var(--muted)); margin-bottom: 2px; }
.tenant-pick .check { display: flex; align-items: center; gap: 6px; }
.tenant-pick .check svg { width: 14px; height: 14px; color: var(--accent); flex: none; }

/* ITSM -> Documentation */
.doc-body { line-height: 1.6; }
.doc-body h2, .doc-body h3, .doc-body h4 { margin: 18px 0 6px; }
.doc-body h2:first-child, .doc-body h3:first-child { margin-top: 0; }
.doc-body p { margin: 6px 0; }
.doc-body ul { margin: 6px 0; padding-left: 22px; }
.doc-body code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.doc-code { background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow: auto; white-space: pre-wrap; font-size: 13px; }
.doc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doc-split textarea { min-height: 360px; }
.doc-preview { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; min-height: 360px; max-height: 480px; overflow: auto; }
@media (max-width: 900px) { .doc-split { grid-template-columns: 1fr; } }
.vault-secret { font-size: 16px; padding: 6px 10px; background: var(--surface-3); border-radius: 8px; user-select: all; word-break: break-all; }

/* Mobile technician home (#/m) */
.m-home { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.m-hello { font-size: 22px; font-weight: 700; }
.m-search { width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 12px; }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tile { display: grid; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; min-height: 92px; }
.m-tile:active { transform: scale(.98); }
.m-tile .m-n { font-size: 30px; font-weight: 700; line-height: 1.1; }
.m-tile .m-l { font-weight: 600; }
.m-tile .m-s { font-size: 12px; color: var(--text-2, var(--muted)); }
.m-tile.tone-critical { border-color: var(--critical); }
.m-tile.tone-warning { border-color: var(--warning); }
.m-list { display: grid; gap: 6px; }
.m-list h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2, var(--muted)); margin: 6px 0 2px; }
.m-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; }
.m-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--good); }
.m-dot.sev-critical { background: var(--critical); } .m-dot.sev-high { background: var(--serious, var(--critical)); }
.m-dot.sev-medium { background: var(--warning); } .m-dot.sev-low { background: var(--xs-blue, var(--accent)); }
.m-main { min-width: 0; } .m-title { font-weight: 600; overflow-wrap: anywhere; } .m-sub { font-size: 12px; color: var(--text-2, var(--muted)); }
.m-foot { text-align: center; font-size: 13px; padding: 8px 0 20px; }

/* 3D views (graph3d.js): the X-Scan attack map and the discovery network map */
.g3-view { position: relative; height: 60vh; min-height: 360px; overflow: hidden; outline: none; touch-action: none; user-select: none;
  border-radius: 12px; background: radial-gradient(ellipse at 50% 30%, var(--surface-2), var(--surface) 70%); }
.g3-view:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-border); }
.g3-view.dragging, .g3-view.dragging .g3-canvas { cursor: grabbing; }
.g3-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.g3-msg { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; color: var(--text-2); }
.g3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.g3-label { position: absolute; left: 0; top: 0; margin: 10px 0 0 0; white-space: nowrap; font-size: 11px; color: var(--text-2);
  text-shadow: 0 1px 2px var(--bg), 0 0 6px var(--bg); translate: -50% 0; will-change: transform; }
.g3-label.strong { font-size: 12.5px; font-weight: 600; color: var(--text); margin-top: 16px; }
.g3-label.port { font-size: 9.5px; margin-top: -18px; color: var(--text-3); }
.g3-label.disc { font-size: 12px; font-weight: 600; color: var(--accent-2); margin-top: 6px; }
.g3-controls { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface-2); box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 2; }
.g3-controls button { width: 34px; height: 32px; border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 16px; line-height: 1; padding: 0; cursor: pointer; }
.g3-controls button + button { border-top: 1px solid var(--border); }
.g3-controls button:hover, .g3-controls button.on { background: var(--surface-3); color: var(--accent-2); }
.g3-tip { position: absolute; z-index: 5; max-width: 300px; padding: 8px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: 0 8px 22px rgba(0,0,0,.3); font-size: 12px; pointer-events: none; }
.g3-tip-text { white-space: pre-line; }
.g3-view:fullscreen, .g3-view.g3-full { height: 100vh; border-radius: 0; }
.g3-view.g3-full { position: fixed; inset: 0; z-index: 1000; }
.xa-stage .g3-view { position: absolute; inset: 0; height: auto; min-height: 0; border-radius: 0; }
.card:fullscreen .g3-view, .card.nm-full .g3-view { flex: 1; height: auto; }

/* ---------- searchable dropdowns: the list every native <select> opens (core.js SelectSearch) */
.sel-pop {
  position: fixed; z-index: 1200; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: var(--raised); color: var(--text); border: 1px solid var(--border-strong); border-radius: 11px;
  box-shadow: var(--shadow-lg); animation: pop .12s ease-out; outline: none;
}
.sel-pop-head { padding: 6px; border-bottom: 1px solid var(--border); flex: none; }
.sel-pop-head .sel-pop-search { width: 100%; padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.sel-pop-search::-webkit-search-cancel-button { cursor: pointer; }
.sel-pop-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px; -webkit-overflow-scrolling: touch; }
.sel-pop-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; padding: 8px 8px 4px; }
.sel-pop-group ~ .sel-pop-item { padding-left: 16px; }
.sel-pop-item { padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.sel-pop-item.active { background: var(--surface-3); }
.sel-pop-item.chosen { font-weight: 600; color: var(--accent-2, var(--accent)); }
.sel-pop-item.chosen::after { content: "✓"; float: right; margin-left: 8px; }
.sel-pop-item.disabled { opacity: .45; cursor: not-allowed; }
.sel-pop-empty { padding: 10px; font-size: 12.5px; color: var(--text-3); }
@media (pointer: coarse) { .sel-pop-item { padding: 11px 12px; } .sel-pop-head .sel-pop-search { font-size: 16px; } }  /* 16px: iOS won't zoom in */

/* XDR relationships and attack paths (views-xdr.js: xdrGraph) - the X-Scan attack map's controls (.xa-controls, .xa-zoom, .xa-seg) */
.xdr-graph { display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px 12px; }
.xdr-graph-toolbar { grid-column: 1 / -1; grid-row: 1; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 32px; }
.xdr-graph-status { min-width: 0; }
.xdr-graph-stage { grid-column: 1; grid-row: 2; position: relative; height: 460px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-2); overflow: hidden; }
.xdr-graph-stage .g3-view { width: 100%; height: 100%; }
.xdr-graph-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; }
.xdr-graph-svg:active { cursor: grabbing; }
.xdr-graph-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.xdr-graph:fullscreen, .xdr-graph.xdr-full { background: var(--bg, var(--surface)); padding: 14px; margin: 0; border-radius: 0; }
.xdr-graph.xdr-full { position: fixed; inset: 0; z-index: 900; }
.xdr-graph:fullscreen .xdr-graph-stage, .xdr-graph.xdr-full .xdr-graph-stage { height: auto; }
.xdr-graph:fullscreen .xdr-graph-detail, .xdr-graph.xdr-full .xdr-graph-detail { max-height: none; }
.xdr-flow { animation: xa-flow 1s linear infinite; }
.xdr-node, .xdr-edge { transition: opacity .45s ease; }
.xdr-hidden { opacity: 0; pointer-events: none; }
.xdr-pop circle, .xdr-pop rect { animation: xdr-pop .6s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes xdr-pop { 0% { transform: scale(.3); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.xdr-hop line:first-child { stroke-width: 6; filter: drop-shadow(0 0 6px currentColor); }
.xdr-node.sel circle, .xdr-node.sel rect { stroke: var(--text-strong); stroke-width: 3; }
.xdr-node:active { cursor: grabbing; }
@media (prefers-reduced-motion: reduce) { .xdr-flow { animation: none; } .xdr-pop circle, .xdr-pop rect { animation: none; } }
.xdr-graph-legend { grid-column: 1; grid-row: 3; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.xdr-graph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.xdr-graph-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.xdr-graph-legend .bar { width: 16px; height: 3px; display: inline-block; border-radius: 2px; }
.xdr-graph-legend .bar.dashed { background: repeating-linear-gradient(90deg, var(--axis) 0 4px, transparent 4px 7px); }
.xdr-graph-legend .box { width: 10px; height: 10px; border: 2px solid var(--violet); border-radius: 3px; display: inline-block; }
.xdr-graph-detail { grid-column: 2; grid-row: 2 / span 2; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px;
  background: var(--surface); overflow: auto; max-height: 470px; display: flex; flex-direction: column; gap: 8px; }
.xdr-graph-detail ul { margin: 0; padding-left: 18px; }
.xdr-node { cursor: pointer; outline: none; }
.xdr-node:focus-visible circle, .xdr-node:focus-visible rect { stroke: var(--text-strong); stroke-width: 3; }
.xdr-node-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.xdr-node-role { fill: var(--text-2, var(--text)); font-size: 10px; opacity: .8; }
.xdr-node-count { fill: var(--accent-ink); font-size: 11px; font-weight: 700; pointer-events: none; }
.xdr-edge { cursor: pointer; outline: none; }
.xdr-edge:hover line:first-child, .xdr-edge:focus-visible line:first-child { stroke-width: 4; }
.xdr-edge-label { fill: var(--text-2, var(--text)); font-size: 10px; paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; }
.xdr-prio summary { cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.xdr-prio ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 900px) {
  .xdr-graph { grid-template-columns: minmax(0, 1fr); }
  .xdr-graph-detail { grid-column: 1; grid-row: 4; max-height: none; }
  .xdr-graph-stage { height: 360px; }
}
.xdr-reasons { margin: 0; padding-left: 16px; display: grid; gap: 2px; }
.xdr-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.xdr-metric { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); min-width: 0; }
.xdr-metric .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xdr-metric-value { font-size: 20px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.3; }
.xdr-metric.tone-critical .xdr-metric-value { color: var(--critical-ink); }
.xdr-metric.tone-serious .xdr-metric-value { color: var(--serious-ink); }
.xdr-metric.tone-good .xdr-metric-value { color: var(--good-ink); }
.xdr-graph-metrics select { padding: 4px 8px; font-size: 12px; }
.xdr-triggers { margin: 4px 0 0; padding-left: 16px; display: grid; gap: 4px; }
.xdr-app { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 6px; }
.xdr-app summary { cursor: pointer; }
.xdr-libs { max-height: 220px; overflow: auto; display: grid; gap: 1px; margin-top: 6px; }
.xdr-libs .rare { color: var(--serious-ink); font-weight: 600; }
.xdr-tree { display: flex; flex-direction: column; gap: 4px; }
.xdr-proc { border-left: 3px solid var(--border-strong); padding: 2px 8px; }
.xdr-proc.focus { border-left-color: var(--critical); background: var(--surface-2); }
.xdr-tree-kids { margin-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.xdr-context { opacity: .7; }
.xdr-graph-legend .bar.dotted { background: repeating-linear-gradient(90deg, var(--border-strong) 0 2px, transparent 2px 5px); }

/* ---------- command-centre charts (core.js: donutBreakdown, severityStrip, flowSteps, statusTile, triageFeed) */
.cc-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cc-donut-svg { width: 150px; height: 150px; flex: none; }
.cc-seg { transition: stroke-width .15s, opacity .15s; }
.cc-seg.hot, .cc-seg:hover { stroke-width: 28; }
.cc-donut-value { font-size: 24px; font-weight: 700; fill: var(--text-strong); font-variant-numeric: tabular-nums; }
.cc-donut-label { font-size: 10px; fill: var(--text-2, var(--text)); text-transform: uppercase; letter-spacing: .06em; }
.cc-legend { flex: 1; min-width: 160px; display: grid; gap: 6px; }
.cc-legend-title { font-weight: 700; font-size: 12.5px; color: var(--text-strong); margin-bottom: 2px; }
.cc-legend-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.cc-legend-row.clickable { cursor: pointer; }
.cc-legend-row.hot, .cc-legend-row.clickable:hover { background: var(--surface-2); }
.cc-legend-dot { width: 10px; height: 10px; border-radius: 3px; justify-self: center; }
.cc-legend-ico svg { width: 16px; height: 16px; display: block; }
.cc-legend-label { color: var(--text-2, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-legend-value { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; text-align: right; }

.cc-sev-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cc-sev { --t: var(--accent); display: flex; align-items: stretch; border: 2px solid var(--t); border-radius: 8px; overflow: hidden;
  background: var(--surface); min-height: 44px; }
.cc-sev.clickable { cursor: pointer; }
.cc-sev.clickable:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--t) 25%, transparent); }
.cc-sev.zero { opacity: .75; }
.cc-sev-ico { background: var(--t); color: #fff; display: grid; place-items: center; width: 48px; flex: none; }
.cc-sev-ico svg { width: 22px; height: 22px; }
.cc-sev-main { display: flex; align-items: center; gap: 4px; padding: 0 12px; font-size: 16px; color: var(--text); flex: 1; white-space: nowrap; }
.cc-sev-main strong { font-size: 18px; color: var(--text-strong); }
.cc-sev-subs { display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--text-2, var(--text)); }
.cc-sev-sub { display: inline-flex; align-items: center; gap: 4px; }
.cc-sev-sub + .cc-sev-sub { border-left: 1px solid var(--border); padding-left: 10px; }
.cc-sev-sub svg { width: 15px; height: 15px; }
.cc-sev.tone-critical, .cc-flow-ico.tone-critical, .cc-status-ico.tone-critical, .cc-feed-count.tone-critical { --t: var(--critical); }
.cc-sev.tone-high, .cc-sev.tone-serious, .cc-flow-ico.tone-serious, .cc-status-ico.tone-serious, .cc-feed-count.tone-serious { --t: var(--serious); }
.cc-sev.tone-medium, .cc-sev.tone-warning, .cc-flow-ico.tone-warning, .cc-status-ico.tone-warning, .cc-feed-count.tone-warning { --t: var(--warning); }
.cc-sev.tone-low, .cc-sev.tone-violet, .cc-flow-ico.tone-violet, .cc-status-ico.tone-violet { --t: var(--violet); }
.cc-sev.tone-good, .cc-flow-ico.tone-good, .cc-status-ico.tone-good, .cc-feed-count.tone-good { --t: var(--good); }
.cc-flow-ico.tone-accent, .cc-status-ico.tone-accent, .cc-feed-count.tone-accent { --t: var(--accent); }

.cc-flow { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 8px 4px; }
.cc-flow-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: inherit; text-decoration: none; min-width: 90px; flex: none; }
.cc-flow-ico { --t: var(--accent); width: 46px; height: 46px; border-radius: 50%; background: var(--t); color: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--t) 18%, transparent); }
.cc-flow-ico svg { width: 22px; height: 22px; }
.cc-flow-label { font-size: 13px; color: var(--text-2, var(--text)); }
.cc-flow-label.link { text-decoration: underline; text-underline-offset: 3px; }
.cc-flow-value { font-size: 22px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.cc-flow-arrow { flex: 1; height: 2px; background: var(--border-strong); margin-top: 23px; position: relative; min-width: 24px; }
.cc-flow-arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left-color: var(--border-strong); }

.cc-status { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px 0; min-height: 150px; }
.cc-status-ico { --t: var(--accent); color: var(--t); }
.cc-status-ico svg { width: 30px; height: 30px; }
.cc-status-head { font-size: 19px; color: var(--text-strong); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
a.cc-status-head:hover { color: var(--accent-2, var(--accent)); }
.cc-status-chev { font-size: 22px; line-height: 1; }
.cc-status-stats { display: flex; justify-content: center; }
.cc-status-stat { padding: 0 16px; }
.cc-status-stat + .cc-status-stat { border-left: 1px solid var(--border); }
.cc-status-num { font-size: 20px; font-weight: 700; color: var(--text-strong); display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.cc-status-num svg { width: 16px; height: 16px; }
.tone-text-critical { color: var(--critical-ink) !important; }
.tone-text-serious { color: var(--serious-ink) !important; }
.tone-text-warning { color: var(--warning-ink) !important; }
.tone-text-good { color: var(--good-ink) !important; }

.cc-feed { display: flex; flex-direction: column; gap: 10px; }
.cc-feed-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.cc-feed-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; color: var(--text-2, var(--text)); display: inline-flex; align-items: center; gap: 8px; }
.cc-feed-tabs button.active { color: var(--accent-2, var(--accent)); border-bottom-color: var(--accent); }
.cc-feed-count { --t: var(--critical); background: var(--t); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.cc-feed-list { display: flex; flex-direction: column; gap: 10px; }
.cc-feed-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface); display: grid; gap: 6px; }
.cc-feed-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cc-pager { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong); }
.cc-page { border: 0; border-radius: 0; background: var(--surface-2); padding: 5px 10px; font-size: 12.5px; color: var(--text); }
.cc-page + .cc-page { border-left: 1px solid var(--border); }
.cc-page.active { background: var(--accent); color: var(--accent-ink); }
.cc-page:disabled { opacity: .45; cursor: default; }
.cc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-2, var(--text)); background: var(--surface-2); }
.cc-chip svg { width: 12px; height: 12px; }
@media (max-width: 700px) { .cc-flow { flex-wrap: wrap; justify-content: center; } .cc-flow-arrow { display: none; } }
.cc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.cc-side { position: sticky; top: calc(var(--topbar-h) + 12px); }
@media (max-width: 1300px) { .cc-layout { grid-template-columns: minmax(0, 1fr); } .cc-side { position: static; } }
@media (max-width: 1000px) { .grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }

/* Resizable dashboard cards (core.js: sortableGrid.resizable) */
.resize-handle { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: nwse-resize;
  opacity: 0; transition: opacity .15s; z-index: 2; touch-action: none; border-radius: 4px; }
.resize-handle::before { content: ""; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px;
  border-right: 2px solid var(--text-3, var(--border-strong)); border-bottom: 2px solid var(--text-3, var(--border-strong)); border-bottom-right-radius: 3px; }
.resize-handle:hover::before, .resize-handle:focus-visible::before { border-color: var(--accent-2, var(--accent)); }
.sortable:hover > .resize-handle, .resize-handle:focus-visible, .sortable.resizing > .resize-handle { opacity: 1; }
@media (hover: none) { .resize-handle { opacity: .6; } }
.sortable.sized { overflow: auto; }
.sortable.resizing { outline: 2px dashed var(--accent); outline-offset: 3px; user-select: none; }
@media print { .resize-handle { display: none !important; } }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.cols-6, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }
/* edge handles: right edge = width, bottom edge = height (the corner does both) */
.resize-edge { position: absolute; z-index: 2; touch-action: none; }
.resize-e { top: 12px; bottom: 22px; right: 0; width: 8px; cursor: ew-resize; }
.resize-s { left: 12px; right: 22px; bottom: 0; height: 8px; cursor: ns-resize; }
.resize-edge::after { content: ""; position: absolute; border-radius: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.resize-e::after { top: 30%; bottom: 30%; right: 2px; width: 3px; }
.resize-s::after { left: 35%; right: 35%; bottom: 2px; height: 3px; }
.sortable:hover > .resize-edge::after { opacity: .35; }
.resize-edge:hover::after, .sortable.resizing-x > .resize-e::after, .sortable.resizing-y > .resize-s::after { opacity: 1; }
body.resizing-x, body.resizing-x * { cursor: ew-resize !important; }
body.resizing-y, body.resizing-y * { cursor: ns-resize !important; }
body.resizing-xy, body.resizing-xy * { cursor: nwse-resize !important; }
@media (hover: none) { .resize-edge::after { opacity: .3; } }
@media print { .resize-edge { display: none !important; } }

/* Group Policies: controls added or updated in the latest catalogue update */
.tag.gp-new { background: var(--accent-soft); color: var(--accent-2); }
.tag.gp-updated { background: var(--surface-2); color: var(--text-2); }
