/* Polaris production frontend — dark theme. */
:root {
  --bg: #0b0e14;
  --surface: #11151c;
  --surface-2: #1a2030;
  --surface-3: #212b3f;
  --border: #232a3a;
  --text: #e6e8eb;
  --text-dim: #98a0ad;
  --accent: #6ea8fe;
  --accent-hover: #4d8df0;
  --critical: #dc2626;
  --high: #fb923c;
  --medium: #fbbf24;
  --low: #4ade80;
  --green: #4ade80;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 0 0 1px var(--border);
  --glass: linear-gradient(180deg, rgba(18, 23, 34, 0.94), rgba(11, 15, 24, 0.88));
  --glass-soft: linear-gradient(180deg, rgba(31, 38, 54, 0.72), rgba(17, 21, 28, 0.82));
  --hero-glow: 0 24px 80px rgba(5, 8, 15, 0.48);
  --tx-fast: 120ms cubic-bezier(.4,0,.2,1);
  --tx-med: 220ms cubic-bezier(.22,1,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(110,168,254,0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(6,182,212,0.12), transparent 24%),
    radial-gradient(circle at 50% 120%, rgba(168,85,247,0.12), transparent 32%),
    linear-gradient(180deg, #0a0d14 0%, #0b0e14 38%, #0a1018 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, rgba(0,0,0,0.85), transparent 82%);
  opacity: 0.34;
}

body::after {
  background:
    radial-gradient(circle at 18% 12%, rgba(110,168,254,0.16), transparent 0 18%),
    radial-gradient(circle at 82% 10%, rgba(255,153,0,0.10), transparent 0 15%),
    radial-gradient(circle at 54% 100%, rgba(168,85,247,0.14), transparent 0 20%);
  filter: blur(52px);
  opacity: 0.85;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre {
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
}

button, .btn {
  cursor: pointer;
  background: linear-gradient(180deg, #7eb0ff, var(--accent));
  color: #07101c;
  border: 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 12px 28px rgba(110,168,254,0.28);
  transition: transform var(--tx-fast), box-shadow var(--tx-fast), background var(--tx-med), border-color var(--tx-fast), color var(--tx-fast);
}
button:hover, .btn:hover {
  background: linear-gradient(180deg, #8ab7ff, var(--accent-hover));
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(110,168,254,0.32);
}
button.secondary, .btn.secondary {
  background: rgba(17, 21, 28, 0.72);
  color: var(--text);
  border: 1px solid rgba(110,168,254,0.16);
  box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover { background: rgba(110,168,254,0.10); }
button.danger { background: var(--critical); color: #0b0e14; }

input, select, textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); }
label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-dim); font-weight: 500; }

/* Visible keyboard-focus indicator. Uses :focus-visible so mouse clicks
   don't draw a ring, but Tab navigation always does. Outline (not box-shadow)
   so it doesn't shift layout, and outline-offset keeps it off the border. */
button:focus-visible,
.btn:focus-visible,
a.btn:focus-visible,
.filter-pill:focus-visible,
.pill:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Layout ───────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, rgba(15, 20, 31, 0.96), rgba(11, 15, 24, 0.94));
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(110,168,254,0.14);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(110,168,254,0.12);
  margin-bottom: 16px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: url('/skydaemon-mark.png') center/contain no-repeat;
  filter: drop-shadow(0 8px 18px rgba(110, 168, 254, 0.32));
  flex-shrink: 0;
}
.brand-name {
  font-weight: 700; letter-spacing: -0.01em;
  font-size: 16px;
  display: flex; flex-direction: column; line-height: 1.1;
}
.brand-name .product-tagline {
  font-size: 10px; font-weight: 500; color: var(--text-dim);
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-top: 2px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  position: relative;
  transition: background-color var(--tx-fast), color var(--tx-fast), transform var(--tx-fast), box-shadow var(--tx-fast);
}
.nav a:hover {
  background: rgba(110,168,254,0.10);
  color: var(--text);
  text-decoration: none;
  transform: translateX(2px);
  box-shadow: inset 0 0 0 1px rgba(110,168,254,0.12);
}
.nav a.active {
  background: linear-gradient(90deg, rgba(110,168,254,0.20), rgba(110,168,254,0.08));
  color: var(--text);
  box-shadow:
    inset 2px 0 0 var(--accent),
    inset 0 0 0 1px rgba(110,168,254,0.18),
    0 12px 32px rgba(6, 10, 18, 0.24);
}

/* Auto-icon for nav items via emoji-as-bullet, applied via attribute matching
   so we don't have to touch every page's HTML. Each nav uses its href as the
   selector; the icon is rendered via the ::before pseudo. */
.nav a::before {
  content: "";
  display: inline-flex;
  width: 16px; height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav a[href*="dashboard"]::before     { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='9'/><rect x='14' y='3' width='7' height='5'/><rect x='14' y='12' width='7' height='9'/><rect x='3' y='16' width='7' height='5'/></svg>"); }
.nav a[href*="cloud-accounts"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.5 19a4.5 4.5 0 1 0-1.7-8.7A6 6 0 0 0 6 12a4 4 0 0 0 0 8z'/></svg>"); }
.nav a[href*="agents"]::before        { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='3'/><path d='M5 21v-1a7 7 0 0 1 14 0v1'/><circle cx='12' cy='12' r='10'/></svg>"); }
.nav a[href*="graph"]::before         { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='5' cy='6' r='2.5'/><circle cx='19' cy='6' r='2.5'/><circle cx='12' cy='18' r='2.5'/><line x1='6.5' y1='7.5' x2='10.5' y2='16.5'/><line x1='17.5' y1='7.5' x2='13.5' y2='16.5'/><line x1='7.5' y1='6' x2='16.5' y2='6'/></svg>"); }
.nav a[href*="findings"]::before      { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.3 3.3a2 2 0 0 1 3.4 0l8 14a2 2 0 0 1-1.7 3H4a2 2 0 0 1-1.7-3l8-14z'/><line x1='12' y1='9' x2='12' y2='13'/><circle cx='12' cy='17' r='1' fill='%2398a0ad'/></svg>"); }
.nav a[href*="compliance"]::before    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2 L4 6 v6 c0 5 3.5 8.5 8 10 c4.5-1.5 8-5 8-10 V6 z'/><polyline points='9,12 11,14 15,10'/></svg>"); }
.nav a[href*="reports"]::before       { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='3' width='16' height='18' rx='2'/><line x1='8' y1='8' x2='16' y2='8'/><line x1='8' y1='12' x2='16' y2='12'/><line x1='8' y1='16' x2='12' y2='16'/></svg>"); }
.nav a[href*="alert-channels"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/><path d='M13.7 21a2 2 0 0 1-3.4 0'/></svg>"); }
.nav a[href*="scans"]::before         { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16' y2='16'/></svg>"); }
.nav a[href*="audit-log"]::before     { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14,2 14,8 20,8'/><line x1='8' y1='13' x2='16' y2='13'/><line x1='8' y1='17' x2='16' y2='17'/></svg>"); }
.nav a[href*="settings"]::before      { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3h.1a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8v.1a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/></svg>"); }
/* Runtime-governance + commercial pages — added so every sidebar item has an icon. */
.nav a[href*="mcp-servers"]::before   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='2' width='20' height='8' rx='2'/><rect x='2' y='14' width='20' height='8' rx='2'/><line x1='6' y1='6' x2='6.01' y2='6'/><line x1='6' y1='18' x2='6.01' y2='18'/></svg>"); }
.nav a[href*="policies"]::before      { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 6h11'/><path d='M9 12h11'/><path d='M9 18h11'/><path d='M3.5 6 L4.5 7 L6 5'/><path d='M3.5 12 L4.5 13 L6 11'/><path d='M3.5 18 L4.5 19 L6 17'/></svg>"); }
.nav a[href*="approvals"]::before     { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='8' y='2' width='8' height='4' rx='1'/><path d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/><polyline points='9,14 11,16 15,12'/></svg>"); }
.nav a[href*="annex-iv"]::before      { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 7H10a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z'/><path d='M16 3H5a2 2 0 0 0-2 2v12'/><line x1='13' y1='13' x2='19' y2='13'/><line x1='13' y1='17' x2='17' y2='17'/></svg>"); }
.nav a[href*="sdk"]::before           { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='4 17 10 11 4 5'/><line x1='12' y1='19' x2='20' y2='19'/></svg>"); }
.nav a[href*="pricing"]::before       { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='5' width='20' height='14' rx='2'/><line x1='2' y1='10' x2='22' y2='10'/><line x1='6' y1='15' x2='10' y2='15'/></svg>"); }
/* Costs page (POLARIS_COMPETITIVE_GAPS §10) — dollar-sign-in-circle icon. */
.nav a[href*="costs"]::before        { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='12' y1='1' x2='12' y2='23'/><path d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/></svg>"); }
/* Red Team (§2) — target / crosshair. Concentric circles + 4 tick marks. */
.nav a[href*="red-team"]::before     { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='4.5'/><line x1='12' y1='2' x2='12' y2='5'/><line x1='12' y1='19' x2='12' y2='22'/><line x1='2' y1='12' x2='5' y2='12'/><line x1='19' y1='12' x2='22' y2='12'/></svg>"); }
/* System status (§17) — activity / pulse line, bold zigzag. */
.nav a[href*="status"]::before       { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 12 7 12 10 5 14 19 17 12 21 12'/></svg>"); }
/* Runtime monitor — broadcast/signal icon (concentric arcs from a source dot).
   Distinct from /status (pulse) so users can scan the sidebar at a glance. */
.nav a[href*="monitoring"]::before   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='13' r='1.5' fill='%2398a0ad'/><path d='M8.5 16.5a5 5 0 0 1 0-7'/><path d='M15.5 16.5a5 5 0 0 0 0-7'/><path d='M5.5 19.5a9 9 0 0 1 0-13'/><path d='M18.5 19.5a9 9 0 0 0 0-13'/></svg>"); }
/* Executive summary — bar chart with upward trend arrow. Communicates
   "rolled-up KPI overview" at a glance. */
.nav a[href*="executive"]::before    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='3' y1='21' x2='21' y2='21'/><rect x='5' y='14' width='3' height='6'/><rect x='10.5' y='10' width='3' height='10'/><rect x='16' y='6' width='3' height='14'/><polyline points='4 8 9 5 14 7 20 3'/><polyline points='17 3 20 3 20 6'/></svg>"); }
/* Enterprise (§15) — building skyline (3 buildings with visible windows). */
.nav a[href*="enterprise"]::before   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 21h18'/><rect x='4' y='8' width='6' height='13'/><rect x='14' y='3' width='6' height='18'/><line x1='6' y1='12' x2='6' y2='12'/><line x1='8' y1='12' x2='8' y2='12'/><line x1='6' y1='17' x2='6' y2='17'/><line x1='8' y1='17' x2='8' y2='17'/><line x1='16' y1='7' x2='18' y2='7'/><line x1='16' y1='12' x2='18' y2='12'/><line x1='16' y1='17' x2='18' y2='17'/></svg>"); }
/* Wave 47 — icons for the wave 44/45/46 pages so the sidebar reads consistently. */
/* Threat catalog — book-with-shield */
.nav a[href*="threat-catalog"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/><path d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/><path d='M12 6 L9.5 7 v3 c0 2 1.1 3 2.5 3.5 c1.4-.5 2.5-1.5 2.5-3.5 V7 z'/></svg>"); }
/* Approvals — clipboard-with-check (already has matching icon path); no-op */
/* Integrations — connection / hub: 3 nodes connected to center */
.nav a[href*="integrations"]::before  { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='2.5'/><circle cx='4' cy='5' r='2'/><circle cx='20' cy='5' r='2'/><circle cx='4' cy='19' r='2'/><circle cx='20' cy='19' r='2'/><line x1='5.4' y1='6.4' x2='10.6' y2='10.6'/><line x1='18.6' y1='6.4' x2='13.4' y2='10.6'/><line x1='5.4' y1='17.6' x2='10.6' y2='13.4'/><line x1='18.6' y1='17.6' x2='13.4' y2='13.4'/></svg>"); }
/* Frameworks — stacked layers / box */
.nav a[href*="frameworks"]::before    { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='12 2 22 7 12 12 2 7 12 2'/><polyline points='2 17 12 22 22 17'/><polyline points='2 12 12 17 22 12'/></svg>"); }
/* AI-BOM — receipt / scroll */
.nav a[href*="agent-bom"]::before     { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16l3-2 3 2 3-2 3 2 3-2V8z'/><polyline points='14,2 14,8 20,8'/><line x1='8' y1='12' x2='16' y2='12'/><line x1='8' y1='16' x2='13' y2='16'/></svg>"); }
/* Compare — side-by-side bar chart */
.nav a[href*="compare"]::before       { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='12' y1='3' x2='12' y2='21'/><rect x='4' y='8' width='5' height='12'/><rect x='15' y='4' width='5' height='16'/></svg>"); }
.nav a[href*="service-catalog"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='6' rx='2'/><rect x='3' y='14' width='8' height='6' rx='2'/><rect x='13' y='14' width='8' height='6' rx='2'/></svg>"); }
.nav a[href*="attack-paths"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='5' cy='6' r='2'/><circle cx='19' cy='6' r='2'/><circle cx='12' cy='12' r='2'/><circle cx='5' cy='18' r='2'/><circle cx='19' cy='18' r='2'/><path d='M6.7 7.2 10.4 10.8'/><path d='M13.6 10.8 17.3 7.2'/><path d='M11 13.7 6.7 16.8'/><path d='M13 13.7 17.3 16.8'/></svg>"); }
.nav a[href*="controls-center"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2 4 6v6c0 5 3.5 8.5 8 10 4.5-1.5 8-5 8-10V6z'/><path d='M8 12h3'/><path d='M8 16h5'/><path d='M8 8h7'/></svg>"); }
.nav a[href*="adversary-intel"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12h7l2-8 2 16 2-8h5'/></svg>"); }
.nav a[href*="logout"]::before, .nav a[href="#"][id="logout-link"]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a0ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16,17 21,12 16,7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>"); }
.nav a:hover::before, .nav a.active::before { opacity: 1; filter: brightness(1.6); }

.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); padding: 14px 10px 4px; }

.main {
  position: relative;
  z-index: 1;
  padding: 36px 42px;
  max-width: 1320px;
}
/* Wave 47 — wide pages (matrix, catalog, integrations grid, framework grid, BOM)
   benefit from more horizontal real-estate; 1400px keeps text scanable while
   letting tables and grids breathe. body[data-page] picks the right max. */
body[data-page="compare"] .main,
body[data-page="threat-catalog"] .main,
body[data-page="integrations"] .main,
body[data-page="frameworks"] .main,
body[data-page="agent-bom"] .main,
body[data-page="graph"] .main,
body[data-page="attack-paths"] .main,
body[data-page="service-catalog"] .main,
body[data-page="controls-center"] .main,
body[data-page="adversary-intel"] .main {
  max-width: 1560px;
}
.header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
}
h1 { font-size: 24px; font-weight: 750; margin: 0 0 4px; letter-spacing: -0.03em; }
.subtitle { color: var(--text-dim); font-size: 14px; margin: 0; }

/* ─── Cards / panels ─────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid rgba(110,168,254,0.12);
  backdrop-filter: blur(18px);
  border-radius: 20px;
  padding: 24px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 20px 56px rgba(5, 8, 15, 0.38),
    0 0 0 1px rgba(12, 16, 25, 0.28);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  opacity: 0.55;
  pointer-events: none;
}
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.card,
.kpi,
.rt-kpi,
.ex-card,
.cost-card,
.rt-card,
.fw-card,
.int-card,
.probe,
.campaign-card,
.top-risk-row {
  animation: cardReveal 520ms cubic-bezier(.22,1,.36,1) both;
}

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 30px;
  border-radius: 28px;
  border: 1px solid rgba(110,168,254,0.16);
  background:
    radial-gradient(circle at top right, rgba(110,168,254,0.16), transparent 32%),
    radial-gradient(circle at bottom left, rgba(168,85,247,0.12), transparent 28%),
    linear-gradient(180deg, rgba(19, 24, 36, 0.96), rgba(11, 15, 24, 0.90));
  box-shadow: var(--hero-glow);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -30% 42%;
  height: 220px;
  background: radial-gradient(circle, rgba(110,168,254,0.18), transparent 62%);
  filter: blur(38px);
  pointer-events: none;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b9d2ff;
  font-weight: 700;
}

.hero-headline {
  margin: 12px 0 8px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 780;
  max-width: 12ch;
}

.hero-copy {
  max-width: 68ch;
  color: #c1cad8;
  font-size: 14px;
  line-height: 1.65;
}

.metric-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.metric-tile {
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--glass-soft);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(14px);
}

.metric-tile .metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
}

.metric-tile .metric-value {
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.metric-tile .metric-sub {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
}

.accent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(110,168,254,0.14);
  background: rgba(110,168,254,0.09);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(255,255,255,0.04);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.story-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(110,168,254,0.12);
  background: linear-gradient(180deg, rgba(17, 21, 31, 0.94), rgba(10, 14, 22, 0.90));
  box-shadow: 0 20px 48px rgba(5, 8, 15, 0.32);
}

.story-card .story-head {
  padding: 20px 22px 12px;
  border-bottom: 1px solid rgba(110,168,254,0.08);
}

.story-card .story-body {
  padding: 18px 22px 22px;
}

.kpi { padding: 18px 20px; }
.kpi .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* Empty states */
.empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
}
.empty h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.empty p { margin: 0 0 24px; color: var(--text-dim); }

/* Stepper for connect wizards */
.steps { counter-reset: step; padding: 0; list-style: none; margin: 0; }
.step {
  position: relative;
  padding: 0 0 28px 44px;
  border-left: 2px solid var(--border);
  margin-left: 16px;
}
.step:last-child { border-left-color: transparent; padding-bottom: 0; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -16px; top: -2px;
  width: 30px; height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: var(--text);
}
.step h3 { margin: 0 0 6px; font-size: 15px; }
.step p { margin: 0 0 10px; color: var(--text-dim); }

/* Cloud picker */
.cloud-picker {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-top: 12px;
}
.cloud-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 20px;
  text-align: left;
  transition: border-color 100ms;
  display: flex; flex-direction: column; gap: 8px;
}
.cloud-card:hover { border-color: var(--accent); text-decoration: none; }
.cloud-card .icon { font-size: 24px; }
.cloud-card .name { font-weight: 600; color: var(--text); }
.cloud-card .desc { color: var(--text-dim); font-size: 13px; }

/* Notice banners */
.notice {
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.notice.warn { background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.35); color: #fde68a; }
.notice.info { background: rgba(110,168,254,0.10); border: 1px solid rgba(110,168,254,0.35); color: #cfe1ff; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 500; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Density toggle — `body.compact` reduces padding + font on tables. Persisted to localStorage. */
body.compact th, body.compact td { padding: 5px 10px; font-size: 12px; }
body.compact .agent-name { font-size: 13px; }
body.compact .badge { padding: 1px 6px; font-size: 10px; }
body.compact .row-clickable td { line-height: 1.3; }

/* Forms */
.form-row { margin-bottom: 16px; }
.form-actions { display: flex; gap: 8px; margin-top: 24px; }

/* Login / centered single-card layout */
.center {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.center .card { width: 100%; max-width: 420px; }
.center h1 { margin-bottom: 8px; }

/* ⌘K cue — small hint at the bottom of every signed-in page footer */
.kbd-hint {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--text-dim);
}

footer.app-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  display: flex; justify-content: space-between;
}

/* ─── Wave 11 UI polish ─────────────────────────────────────
   Card hover, modal styling, skeleton shimmer, sticky table
   headers, ghost-button, badge defaults, page-header pattern.
   Adopting Linear/Vercel-style restraint: no heavy shadows,
   subtle border-color shift on hover, accent rail on actives. */

/* Card hover — subtle border accent + elevation on interactive cards. */
.card.linkable, .card.interactive,
a.card, button.card, .card[role="button"], a.fw-card {
  transition: border-color 120ms ease, transform 120ms ease, background-color 120ms ease;
  cursor: pointer;
}
.card.linkable:hover, .card.interactive:hover,
a.card:hover, button.card:hover, .card[role="button"]:hover, a.fw-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Ghost button (used by "Refresh" / "Standards datasheet" / similar
   secondary actions). Distinct from .btn.secondary which has a border. */
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
}
button.ghost:hover, .btn.ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Modal backdrop + content — used by templates / probe-detail
   modals on /policies.html and /red-team.html. Was inline; now in
   the shared sheet so every modal looks the same. */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: modalFadeIn 120ms ease;
}
.modal-backdrop.show, .modal-backdrop[style*="display: flex"] { display: flex; }
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  animation: modalSlideUp 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 600;
}
.modal-close {
  background: transparent; border: 0; color: var(--text-dim);
  font-size: 24px; line-height: 1; padding: 0 8px; cursor: pointer;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
@keyframes modalFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Skeleton loader — replaces "—" while data is loading.
   Apply class="skeleton" to any block-level element to get a
   subtle shimmer animation. Linear's shimmer pattern. */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    rgba(255,255,255,0.04) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  display: inline-block;
  min-height: 1em;
  color: transparent !important;
  user-select: none;
}
.skeleton.line { width: 100%; height: 14px; margin-bottom: 6px; }
.skeleton.line.short { width: 40%; }
.skeleton.line.med   { width: 70%; }
.skeleton.value      { width: 60px; height: 22px; }
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Sticky table headers — long tables (audit log, scans, agents)
   keep the column header visible while scrolling. */
table.sticky thead th {
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
  border-bottom: 1px solid var(--border);
}

/* Table row hover — applies to every <tr> inside <tbody> to make
   list pages feel responsive on hover. */
tbody tr { transition: background-color 100ms ease; }
tbody tr:hover { background: var(--surface-2); }

/* ─── Page header pattern — used everywhere. Consistent spacing
   and the right-side action area. */
.header h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.015em; }
.header .subtitle { max-width: 740px; }
.header > div:last-child { display: flex; gap: 8px; align-items: center; }

/* ─── Section header — for in-page section breaks. */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 28px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-head .section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.section-head .section-link {
  font-size: 12px; color: var(--accent); font-weight: 500;
}

/* ─── Universal badge — used by severity tags, status pills, etc. */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.badge.critical { background: rgba(220,38,38,0.15);  color: #fca5a5; border-color: rgba(220,38,38,0.4); }
.badge.high     { background: rgba(251,146,60,0.15);  color: #fdba74; border-color: rgba(251,146,60,0.4); }
.badge.medium   { background: rgba(251,191,36,0.15);  color: #fde68a; border-color: rgba(251,191,36,0.4); }
.badge.low      { background: rgba(74,222,128,0.15);  color: #86efac; border-color: rgba(74,222,128,0.4); }
.badge.info     { background: rgba(110,168,254,0.15); color: #93c5fd; border-color: rgba(110,168,254,0.4); }
.badge.danger   { background: var(--critical); color: #0b0e14; border-color: var(--critical); }

/* ─── Cloud-provider badges (with inline brand SVG icon) ──────────
   These keep the existing .badge.aws / .badge.azure / .badge.gcp
   color rules (defined per-page in dashboard.html / scans.html
   etc.) and add a flex layout so the SVG icon emitted by
   Polaris.cloudBadge() sits flush with the text label. */
/* Codex item 4 — cloud badges use inline-grid so the icon column is
   always EXACTLY 16px regardless of brand mark bbox; the label column
   sizes to its own content. Eliminates the "Azure rectangle bigger
   than AWS" visual drift the user flagged. */
.badge.aws,
.badge.azure,
.badge.gcp,
.badge.cloud-badge {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 6px;
  align-items: center;
  padding: 2px 8px 2px 6px;
}
.badge.aws svg,
.badge.azure svg,
.badge.gcp svg,
.badge.cloud-badge svg {
  display: block;
  width: 16px;
  height: 16px;
}
/* Fallback brand colors for the three cloud badges, applied globally
   so any page that opts in to Polaris.cloudBadge gets readable styling
   even if it doesn't define per-page .badge.aws rules. Pages that DO
   define their own .badge.aws (dashboard.html, scans.html) win via
   normal cascade — these are just a safety net. */
.badge.aws   { background: rgba(255,153,0,0.15); color: #ffb454; border-color: rgba(255,153,0,0.35); }
.badge.azure { background: rgba(6,182,212,0.15); color: #67e8f9; border-color: rgba(6,182,212,0.35); }
.badge.gcp   { background: rgba(168,85,247,0.18); color: #d8b4fe; border-color: rgba(168,85,247,0.35); }

/* ─── Helper utilities ─────────────────────────────────────── */
.muted { color: var(--text-dim); }
.text-mono { font-family: "SF Mono", Menlo, monospace; font-size: 12px; }
.text-right { text-align: right; }
.flex { display: flex; gap: 8px; align-items: center; }

/* ─── Print-friendly base — for the rare PDF export from a page. */
@media print {
  .sidebar, .nav, footer.app-footer, button, .btn, .modal-backdrop { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .main { padding: 0; max-width: none; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ─── Reduced motion accommodations — respect prefers-reduced-motion
   for users who dislike animations. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Wave 12: mobile-responsive sidebar + tooltips + toasts ──── */

/* Mobile burger button — hidden on desktop, visible < 800px.
   Codex round 4: bigger tap target (44×44), iOS safe-area aware,
   stronger contrast + soft glow so it never disappears against
   busy mobile dashboards. */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  z-index: 1100;
  background: rgba(17, 21, 28, 0.96);
  border: 1px solid rgba(110, 168, 254, 0.28);
  border-radius: 12px;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.sidebar-toggle svg { width: 22px; height: 22px; color: var(--text); }

/* On narrow screens collapse the sidebar into a slide-in drawer. */
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .main { padding: 72px 14px 24px; }
  .header h1 { font-size: 20px; }
  .modal-content { max-width: 100%; }
}
/* Backdrop for the drawer. */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 1040;
  background: rgba(0, 0, 0, 0.5);
}
.sidebar-backdrop.show { display: block; }

/* ─── Page-load fade-in. Subtle, doesn't disrupt reading. ───────── */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main { animation: pageFadeIn 200ms ease-out; }

/* ─── Wave 47 polish ──────────────────────────────────────────────
   - Universal focus rings on the new card patterns (tc-card, fw-card,
     int-card, cmp-vendor-toggle) so keyboard users get a visible ring.
   - Hero stats wrap gracefully on mobile.
   - Anchor scroll-margin-top so deep links don't hide under the
     sticky table headers / tabs.
   - Wide-table horizontal scroll hint (subtle gradient on right edge)
     so users know there's more content offscreen. */

.tc-card:focus-visible,
.int-card:focus-visible,
.fw-card:focus-visible,
.bom-card:focus-visible,
.fd-related-card:focus-visible,
.cmp-vendor-toggle:focus-visible,
.tc-dom-tab:focus-visible,
.cat-tab:focus-visible,
.fd-tab:focus-visible,
.bom-pick:focus-visible,
.fw-pick:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* The wide-page heroes use display:flex on the stats row. Constrain
   the stat width so two columns stack instead of overflowing the
   hero-card on narrow viewports. */
@media (max-width: 720px) {
  .tc-hero .stats > .stat,
  .cmp-hero .meta > .meta-cell,
  .bom-hero .stats > .stat,
  .int-hero .stats > .stat,
  .fw-hero .stats > .stat {
    flex: 1 0 calc(50% - 11px);
  }
  .tc-hero h1, .cmp-hero h1, .bom-hero h1,
  .int-hero h1, .fw-hero h1 { font-size: 19px; }
  .tc-hero .lede, .cmp-hero .lede, .bom-hero .lede,
  .int-hero .lede, .fw-hero .lede { font-size: 12.5px; }
  .tc-hero, .cmp-hero, .bom-hero, .int-hero, .fw-hero { padding: 16px 18px; }

  /* Stack BOM 2-column grid on phones */
  .bom-layout { grid-template-columns: 1fr !important; }
  /* Compare summary card always stacks */
  .cmp-summary { grid-template-columns: 1fr !important; }
}

/* Anchor scroll offset so #domain-foo links inside the catalog land
   below the sticky tab strip rather than under it. */
[id^="domain-"], [id^="cat-"], [id^="fw-"] {
  scroll-margin-top: 64px;
}

/* Subtle scroll-shadow on the wide compare table when content
   overflows horizontally. Hint to the user there's more to the right. */
.cmp-table-wrap {
  background:
    linear-gradient(to right, var(--surface), var(--surface)) left center,
    linear-gradient(to right, transparent, rgba(0,0,0,0.45)) right center,
    linear-gradient(to right, var(--surface), var(--surface)) right center;
  background-size: 24px 100%, 24px 100%, 24px 100%;
  background-repeat: no-repeat;
  background-attachment: local, scroll, local;
  background-color: var(--surface);
}

/* Smoother hover on grid cards across waves 44/45/46 */
.tc-card, .int-card, .fw-card, .bom-comp, .fd-related-card {
  will-change: transform;
}

/* Print-friendly for the comparison matrix and threat catalog —
   when a buyer hits ⌘P / Ctrl-P we hide the sidebar + emit a clean
   matrix. Most pioneer marketing pages get printed for RFP responses. */
@media print {
  .sidebar, .sidebar-toggle, .sidebar-backdrop,
  .cmp-controls, .cmp-toggle-row, .tc-controls, .tc-domains,
  .int-search, .fw-toolbar, .bom-controls,
  .nav, footer.app-footer { display: none !important; }
  .app { grid-template-columns: 1fr !important; }
  .main { padding: 16px !important; max-width: none !important; }
  body { background: white !important; color: black !important; }
  .cmp-hero, .tc-hero, .bom-hero, .int-hero, .fw-hero {
    background: white !important; border: 1px solid #ccc !important;
  }
  .tc-card, .int-card, .fw-card, .bom-card, .cmp-card,
  table.cmp-matrix, .cmp-table-wrap {
    page-break-inside: avoid;
  }
}

/* ─── Tooltips — minimal, no JS. Use `data-tooltip="..."` on any
   element + a class of `tip`. Renders below or above based on
   class `tip-top` / `tip-bottom` (default top). */
.tip { position: relative; }
.tip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 100ms ease, transform 100ms ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.tip:hover::after, .tip:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Toast container + items. Polaris.Toast.{success,error,info,warn}
   appends children to a fixed container at the bottom-right. */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9500;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  min-width: 220px; max-width: 380px;
  animation: toastSlideIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--critical); }
.toast.warn    { border-left-color: var(--medium); }
.toast.info    { border-left-color: var(--accent); }
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Alternating table rows — subtle zebra stripe for long lists. */
table.zebra tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.012); }

/* ─── Cleaner help-icon (the ? next to "Overview") ────────────── */
.welcome-help-btn,
button.help-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: 2px;
  transition: all 120ms ease;
  padding: 0;
}
.welcome-help-btn:hover, button.help-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* ─── Platform-wide micro-interactions (added 2026-05-23) ─── */
:root {
  --tx-fast: 120ms cubic-bezier(.4, 0, .2, 1);
  --tx-med:  220ms cubic-bezier(.22, 1, .36, 1);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.18);
  --shadow-glow-accent: 0 0 24px rgba(110, 168, 254, 0.20);
}

/* gentle hover lift + glow on interactive surfaces */
button, .btn, a.rt-kpi, .cost-card, .badge, .card, .tile, .kpi-card {
  transition: transform var(--tx-fast), box-shadow var(--tx-med),
              background var(--tx-med), border-color var(--tx-med);
}
.card:hover, .cost-card:hover, .tile:hover, a.rt-kpi:hover, .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift), var(--shadow-glow-accent);
  border-color: rgba(110, 168, 254, 0.40);
}
.btn:hover, button.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active, button:active { transform: translateY(0); }

/* sidebar nav: smoother hover + active treatment */
.sidebar .nav a {
  transition: background var(--tx-fast), color var(--tx-fast),
              padding var(--tx-fast), box-shadow var(--tx-fast);
}
.sidebar .nav a:hover {
  background: rgba(110, 168, 254, 0.10);
  color: var(--text);
  padding-left: 16px;
}
.sidebar .nav a.active {
  background: rgba(110, 168, 254, 0.14);
  color: var(--accent-glow);
  box-shadow: inset 3px 0 0 var(--accent-glow);
}

/* page fade-in for SPA-ish feel */
main.main, main.content { animation: sd-page-fade 320ms ease-out both; }
@keyframes sd-page-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* clearer focus ring for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 2px;
  border-radius: 4px;
}

/* table row hover (used by findings, agents, audit, scans) */
table tbody tr {
  transition: background var(--tx-fast);
}
table tbody tr:hover { background: rgba(110, 168, 254, 0.05); }


/* ─── 2026-05-23 — Premium typographic polish ──────────────────────
   Tighten H1/H2 letter-spacing, stable digit alignment on all KPI numbers,
   and broaden focus rings to every interactive surface used in the dense
   pages (filter selects, search inputs, view tabs, tabs in finding detail). */

h1 { letter-spacing: -0.02em; }
h2 { letter-spacing: -0.01em; }

/* KPI numbers, big counters, and table .num cells always use tabular figures
   so digits don't jump width when counts change (e.g. 100 → 1234). */
.kpi .value,
.rt-kpi .value,
.kpi-value,
.cost-card .value,
table .num,
td.num, th.num,
.metric-num,
.stat .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Keyboard focus rings — extend the earlier rule to cover input-style
   filter widgets that previously had only a border-color shift. Outline
   sits outside the element so we don't shift layout. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.filter-select:focus-visible,
.filter-search:focus-visible,
.view-tab:focus-visible,
.fd-tab:focus-visible,
.sa-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 5px;
}

/* Search-autosuggest items get a clean active state via keyboard nav. */
.sa-item:focus-visible { outline-offset: 0; }
