/* ==========================================================================
   CVE Research Intel v2 — Full-Width Cisco Magnetic / OneCD UI
   - 100% Fluid Full-Width Laptop/Desktop Workspace
   - Wider 276px Left Navigation Rail (86px Collapsed) + Larger Crisp Icons
   - Editorial Monochrome + Exception-Only Risk Highlights
   ========================================================================== */

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

/* Ultra-Deep Abyssal Midnight Blue-Black Canvas & Surfaces Strictly Scoped to Dark Mode */
html[data-theme="dark"] {
  --mds-bg-canvas: #010308;
  --mds-bg-canvas-end: #000104;
  --mds-bg-canvas-gradient: linear-gradient(145deg, #02050c 0%, #010207 48%, #000103 100%);
  --mds-bg-surface: #030710;
  --mds-bg-surface-glass: rgba(3, 7, 15, 0.92);
  --mds-bg-elevated: #060c19;
  --mds-bg-elevated-glass: rgba(6, 12, 24, 0.96);
  --mds-bg-drawer: rgba(3, 7, 15, 0.96);
  --mds-bg-input: #010308;
  --mds-bg-interact-weak: rgba(39, 116, 217, 0.16);
  --mds-header-bg: linear-gradient(180deg, rgba(2, 4, 10, 0.95) 0%, rgba(1, 3, 8, 0.90) 100%);
  --mds-border-subtle: #0e1828;
  --mds-border-default: #16243b;
  --mds-border-strong: #243a5a;
  --mds-glow-gradient:
    radial-gradient(70% 300px at 0% 0%, rgba(18, 124, 226, 0.08) 0%, rgba(8, 52, 130, 0.03) 50%, transparent 100%);
  --sticky-zone-bg: rgba(1, 3, 8, 0.88);
}

html[data-theme="light"] {
  --sticky-zone-bg: rgba(242, 245, 250, 0.88);
}

html, body {
  margin: 0;
  padding: 0;
  font-size: 13.75px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-attachment: fixed;
  overflow-x: clip;
}

.mono { font-family: var(--mds-font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--mds-text-muted); }
.hidden { display: none !important; }

.ico-14 { width: 14px; height: 14px; flex-shrink: 0; stroke-width: 1.85; }
.ico-15 { width: 15px; height: 15px; flex-shrink: 0; stroke-width: 1.85; }
.ico-16 { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.85; }
.ico-18 { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.85; }
.ico-20 { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.9; }

code {
  font-family: var(--mds-font-mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: var(--mds-radius-sm);
  background: var(--mds-bg-elevated);
  border: 1px solid var(--mds-border-subtle);
  color: var(--mds-text-primary);
}

/* Loading Indicator */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--mds-interact);
  z-index: 120;
  animation: mdsPulse 1.1s ease-in-out infinite;
}
@keyframes mdsPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ==========================================================================
   Sticky Frosted OneCD Top Header (64px)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  padding: 0 22px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--mds-header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--mds-border-subtle);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(0, 188, 235, 0.22));
}
[data-theme="light"] .brand-mark {
  filter: drop-shadow(0 2px 6px rgba(13, 39, 77, 0.14));
}

.lab-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.vendor-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2px;
}
.vendor-ico-bridge {
  width: 18px;
  height: 11px;
  vertical-align: -1px;
}
.inline-lab-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.team-logo-sm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--mds-border-default);
  background: var(--mds-bg-elevated);
}

.brand-text { min-width: 0; }
.brand-title {
  font-family: var(--mds-font-heading);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-breadcrumb {
  font-size: 12px;
  color: var(--mds-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Single Global Pill Search */
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
}
.topbar-search-icon {
  position: absolute;
  left: 13px;
  color: var(--mds-text-muted);
  pointer-events: none;
}
.topbar-search-input {
  width: 100%;
  height: 36px;
  padding: 0 60px 0 38px;
  border-radius: var(--mds-radius-pill);
  border: 1px solid var(--mds-border-default);
  background: var(--mds-bg-input);
  color: var(--mds-text-primary);
  font-family: var(--mds-font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.topbar-search-input:focus {
  border-color: var(--mds-interact);
  box-shadow: 0 0 0 3px var(--mds-focus-ring);
}
.kbd-hint {
  position: absolute;
  right: 11px;
  font-family: var(--mds-font-mono);
  font-size: 10.5px;
  color: var(--mds-text-muted);
  padding: 1px 6px;
  border-radius: var(--mds-radius-sm);
  border: 1px solid var(--mds-border-subtle);
  background: var(--mds-bg-elevated);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header-meta { white-space: nowrap; font-size: 12.5px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--mds-radius-md);
  border: 1px solid var(--mds-border-default);
  background: var(--mds-bg-surface);
  color: var(--mds-text-primary);
  font-family: var(--mds-font-sans);
  font-size: 12.75px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--mds-border-strong);
  background: var(--mds-bg-elevated);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--mds-focus-ring);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--mds-interact-solid);
  border-color: var(--mds-interact-solid);
  color: var(--mds-interact-text-on);
}
.btn-primary:hover:not(:disabled) {
  background: var(--mds-interact-solid-hover);
  border-color: var(--mds-interact-solid-hover);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--mds-text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--mds-bg-hover);
  border-color: transparent;
  color: var(--mds-text-primary);
}
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.25px; }
.icon-btn { width: 36px; height: 36px; padding: 0; }

.icon-ghost-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--mds-radius-lg);
  border: 1px solid transparent;
  background: transparent;
  color: var(--mds-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-ghost-btn:hover { background: var(--mds-bg-hover); color: var(--mds-text-primary); }
.icon-ghost-sm { width: 28px; height: 28px; }

/* ==========================================================================
   Magnetic Console Shell: Wider 276px Left Rail + 100% Full-Width Workspace
   ========================================================================== */
.app-shell {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 64px);
  position: relative;
  z-index: 1;
}

.nav-rail {
  width: 276px;
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  padding: 16px 12px 24px;
  border-right: 1px solid var(--mds-border-subtle);
  background: var(--mds-bg-surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
  overflow-x: visible;
  transition: width 0.2s ease;
  z-index: 30;
}

.rail-collapsed .nav-rail {
  width: 86px;
  padding: 16px 8px;
  overflow: visible;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rail-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mds-text-muted);
  padding: 14px 12px 5px;
}
.rail-section-label:first-child { padding-top: 4px; }
.rail-collapsed .rail-section-label { display: none; }

.rail-group { position: relative; }

.rail-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9.5px 12px;
  border-radius: var(--mds-radius-lg);
  border: 1px solid transparent;
  background: transparent;
  color: var(--mds-text-secondary);
  font-family: var(--mds-font-sans);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.rail-item:hover {
  background: var(--mds-bg-hover);
  color: var(--mds-text-primary);
}
.rail-item.active {
  background: var(--mds-bg-interact-weak);
  color: var(--mds-text-primary);
  font-weight: 600;
}
.rail-item.active .rail-icon {
  color: var(--mds-interact);
}

.rail-indicator {
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3.5px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.rail-item.active .rail-indicator {
  background: var(--mds-interact);
}

.rail-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 1.85;
}
.rail-label { flex: 1; white-space: nowrap; }
.rail-chevron {
  width: 16px;
  height: 16px;
  color: var(--mds-text-muted);
  transition: transform 0.18s ease;
}
.rail-group:not(.open) .rail-chevron { transform: rotate(-90deg); }
.rail-group:not(.open) .mds-rail-subnav { display: none; }

.rail-short {
  display: none;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.15;
  margin-top: 4px;
  color: var(--mds-text-muted);
}

.rail-collapsed .rail-item {
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  text-align: center;
}
.rail-collapsed .rail-label,
.rail-collapsed .rail-chevron { display: none; }
.rail-collapsed .rail-short { display: block; }
.rail-collapsed .rail-item.active .rail-short { color: var(--mds-interact); font-weight: 600; }

/* Expanded Submenu Tree */
.mds-rail-subnav {
  margin: 3px 0 8px 22px;
  padding-left: 11px;
  gap: 3px;
}
.rail-subitem {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7.5px 11px;
  border: none;
  border-radius: var(--mds-radius-md);
  background: transparent;
  color: var(--mds-text-muted);
  font-family: var(--mds-font-sans);
  font-size: 13.25px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sub-ico {
  width: 15.5px;
  height: 15.5px;
  flex-shrink: 0;
  stroke-width: 1.8;
  opacity: 0.78;
}
.rail-subitem:hover {
  background: var(--mds-bg-hover);
  color: var(--mds-text-primary);
}
.rail-subitem.active {
  background: var(--mds-bg-interact-weak);
  color: var(--mds-interact);
  font-weight: 600;
}
.rail-subitem.active .sub-ico { opacity: 1; }

/* Collapsed Floating Flyout */
.rail-flyout {
  display: none;
  left: 90px;
  min-width: 236px;
}
.rail-collapsed .rail-group:hover .rail-flyout,
.rail-collapsed .rail-group.flyout-open .rail-flyout {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-flyout-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mds-text-muted);
  padding: 5px 10px 7px;
  border-bottom: 1px solid var(--mds-border-subtle);
  margin-bottom: 4px;
}
.rail-flyout-item {
  width: 100%;
  padding: 7.5px 10px;
  border: none;
  border-radius: var(--mds-radius-md);
  background: transparent;
  color: var(--mds-text-secondary);
  font-family: var(--mds-font-sans);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.rail-flyout-item:hover { background: var(--mds-bg-hover); color: var(--mds-text-primary); }
.rail-flyout-item.active { background: var(--mds-bg-interact-weak); color: var(--mds-interact); font-weight: 600; }

/* ==========================================================================
   100% Fluid Full-Width Workspace & Toolbar
   ========================================================================== */
.workspace {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: clamp(1.1rem, 2vw, 1.65rem) clamp(1.25rem, 2.4vw, 2.25rem) 3.5rem;
}

.sticky-toolbar-zone {
  position: sticky;
  top: 64px;
  z-index: 35;
  margin: -10px -12px var(--mds-block-gap);
  padding: 10px 12px;
  border-radius: 0 0 var(--mds-radius-xl) var(--mds-radius-xl);
  background: var(--sticky-zone-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--mds-border-subtle);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.active-chips {
  margin-top: 10px;
  margin-bottom: 0 !important;
}

@keyframes subviewFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
section > div.mds-stack:not(.hidden),
#tab-explorer:not(.hidden),
#tab-audit:not(.hidden) {
  animation: subviewFade 0.16s ease-out;
}

.heading-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.page-title {
  margin: 0;
  font-family: var(--mds-font-heading);
  font-size: clamp(1.25rem, 1.85vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--mds-text-primary);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--mds-border-subtle);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mds-chip {
  cursor: pointer;
  font-family: var(--mds-font-sans);
  font-size: 12.25px;
  padding: 4px 11px;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.mds-chip:hover {
  border-color: var(--mds-border-strong);
  color: var(--mds-text-primary);
}

.filter-count {
  font-family: var(--mds-font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--mds-interact);
}

/* Frosted Filters Popover */
.popover-anchor { position: relative; }
.filters-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(610px, calc(100vw - 32px));
  padding: 18px;
  z-index: 65;
}
.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--mds-border-subtle);
}
.popover-title {
  font-family: var(--mds-font-heading);
  font-size: 13.5px;
  font-weight: 600;
}
.popover-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.popover-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mds-text-muted);
}
.popover-inputs-4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.input, .select {
  height: 31px;
  padding: 0 9px;
  border-radius: var(--mds-radius-md);
  border: 1px solid var(--mds-border-default);
  background: var(--mds-bg-input);
  color: var(--mds-text-primary);
  font-family: var(--mds-font-sans);
  font-size: 12.5px;
  outline: none;
}
.input:focus, .select:focus {
  border-color: var(--mds-interact);
  box-shadow: 0 0 0 2px var(--mds-focus-ring);
}
.input-date { width: 136px; }
.input-num { width: 68px; }

/* Active Chips */
.active-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--mds-block-gap);
}
.active-chip-btn {
  background: none;
  border: none;
  color: var(--mds-text-muted);
  cursor: pointer;
  padding: 0 0 0 3px;
  font-size: 13px;
  line-height: 1;
}
.active-chip-btn:hover { color: var(--mds-negative); }

/* Sync Banner */
.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: var(--mds-block-gap);
  border-radius: var(--mds-radius-xl);
  border: 1px solid var(--mds-border-default);
  background: var(--mds-bg-elevated-glass);
  font-size: 12.75px;
}
.sync-banner-left { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.sync-banner-right { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.sync-bar-wrap {
  flex: 1;
  height: 5px;
  border-radius: var(--mds-radius-pill);
  background: var(--mds-border-subtle);
  overflow: hidden;
}
.sync-bar-fill {
  height: 100%;
  background: var(--mds-interact);
  transition: width 0.3s ease;
}

/* ==========================================================================
   Grids, Cards, Metric Briefs & Live Evidence Strips
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--mds-block-gap); }
.grid-1-2 { display: grid; grid-template-columns: minmax(290px, 1fr) minmax(0, 1.75fr); gap: var(--mds-block-gap); }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr); gap: var(--mds-block-gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--mds-block-gap); }

.card { padding: 17px 20px; }
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  margin: 0;
  font-family: var(--mds-font-heading);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--mds-text-primary);
}
.metric-brief {
  margin-top: 3px;
  font-size: 12px;
  color: var(--mds-text-muted);
  line-height: 1.42;
}

/* Borderless Analytical Evidence & Ratio Callout Strip */
.evidence-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px 24px;
  padding: 13px 18px;
  border-radius: var(--mds-radius-card);
  border: 1px solid var(--mds-border-subtle);
  background: var(--mds-bg-surface-glass);
}
.ev-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ev-kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mds-text-muted);
}
.ev-body {
  font-size: 13px;
  color: var(--mds-text-secondary);
  line-height: 1.5;
}
.ev-body strong {
  color: var(--mds-text-primary);
  font-weight: 600;
}

/* KPI Tiles (Static vs. Clickable) */
.kpi-card {
  padding: 15px 18px;
  text-align: left;
  width: 100%;
  color: var(--mds-text-primary);
  font-family: var(--mds-font-sans);
}
.kpi-card.is-active {
  border-color: var(--mds-interact);
  background: var(--mds-bg-interact-weak);
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mds-text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.kpi-val {
  font-family: var(--mds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 5px 0 4px;
  color: var(--mds-text-primary);
}
.kpi-val--exception { color: var(--mds-negative); }

/* Labeled Split Metric Rows inside Head-to-Head KPI Cards */
.split-kpi-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0 8px;
}
.split-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.split-lab {
  font-weight: 600;
  color: var(--mds-text-secondary);
}
.split-track {
  height: 7px;
  border-radius: var(--mds-radius-pill);
  background: var(--mds-bg-elevated);
  border: 1px solid var(--mds-border-subtle);
  overflow: hidden;
}
.split-fill-talos {
  height: 100%;
  border-radius: var(--mds-radius-pill);
  background: #33bbf5;
}
[data-theme="light"] .split-fill-talos { background: #1d69cc; }
.split-fill-zdi {
  height: 100%;
  border-radius: var(--mds-radius-pill);
  background: #fa5762;
}
[data-theme="light"] .split-fill-zdi { background: #cc2d37; }
.split-val {
  font-family: var(--mds-font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12.5px;
  min-width: 96px;
  text-align: right;
}
.ratio-pill {
  font-family: var(--mds-font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--mds-radius-pill);
  border: 1px solid var(--mds-border-default);
  background: var(--mds-bg-elevated);
  color: var(--mds-interact);
}

.drawer-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

/* Clickable Lab Scorecards */
.team-card {
  padding: 16px 18px;
  text-align: left;
  width: 100%;
  color: var(--mds-text-primary);
  font-family: var(--mds-font-sans);
}
.team-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.team-name {
  font-family: var(--mds-font-heading);
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.team-arrow {
  color: var(--mds-text-muted);
  transition: transform 0.15s ease, color 0.15s ease;
}
.team-card:hover .team-arrow {
  transform: translate(2px, -2px);
  color: var(--mds-interact);
}
.team-count {
  font-family: var(--mds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.team-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--mds-border-subtle);
}
.team-metric-lbl { font-size: 11px; color: var(--mds-text-muted); }
.team-metric-val { font-size: 13.5px; font-weight: 600; margin-top: 2px; }

/* Charts */
.chart-box { width: 100%; height: 335px; }
.chart-box-tall { width: 100%; height: 395px; }

/* ==========================================================================
   Head-to-Head Mirror Scorecard with Custom SVG Brand Emblems & Clickable Cells
   ========================================================================== */
.h2h-hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--mds-block-gap);
  align-items: stretch;
}
.h2h-side { padding: 18px 20px; }
.h2h-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.h2h-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lab-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--mds-border-default);
  background: var(--mds-bg-elevated);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.lab-logo--talos { border-color: rgba(0, 188, 235, 0.28); }
[data-theme="light"] .lab-logo--talos { border-color: rgba(4, 159, 217, 0.28); }
.lab-logo--zdi { border-color: rgba(215, 25, 33, 0.30); }
[data-theme="light"] .lab-logo--zdi { border-color: rgba(215, 25, 33, 0.25); }

.h2h-side-name {
  font-family: var(--mds-font-heading);
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.h2h-total-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--mds-radius-lg);
  padding: 4px 10px;
  font-family: var(--mds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--mds-text-primary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.h2h-total-btn:hover {
  border-color: var(--mds-border-strong);
  background: var(--mds-bg-hover);
}
.h2h-total-btn.is-active {
  border-color: var(--mds-interact);
  background: var(--mds-bg-interact-weak);
  color: var(--mds-interact);
}

.h2h-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--mds-border-subtle);
}
.stat-cell-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: var(--mds-radius-lg);
  border: 1px solid var(--mds-border-subtle);
  background: transparent;
  color: var(--mds-text-primary);
  font-family: var(--mds-font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.stat-cell-btn:hover {
  border-color: var(--mds-border-strong);
  background: var(--mds-bg-hover);
}
.stat-cell-btn.is-active {
  border-color: var(--mds-interact);
  background: var(--mds-bg-interact-weak);
}
.h2h-stat-lbl { font-size: 11px; color: var(--mds-text-muted); }
.h2h-stat-num { font-size: 15px; font-weight: 600; margin-top: 2px; }

.h2h-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  min-width: 126px;
  text-align: center;
}
.h2h-vs-label {
  font-family: var(--mds-font-heading);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--mds-text-muted);
}

/* ==========================================================================
   Tables & Exception-Only Severity Highlights
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--mds-radius-xl);
  border: 1px solid var(--mds-border-subtle);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.75px;
}
th {
  text-align: left;
  padding: 10px 13px;
  background: var(--mds-bg-elevated);
  color: var(--mds-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--mds-border-subtle);
  white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--mds-text-primary); }
td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--mds-border-subtle);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; transition: background 0.12s ease; }
tbody tr.clickable:hover { background: var(--mds-bg-hover); }

.sev-text {
  font-family: var(--mds-font-mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.sev-CRITICAL { color: var(--mds-negative); }
.sev-HIGH { color: var(--mds-severe); }
.sev-MEDIUM { color: var(--mds-text-secondary); }
.sev-LOW, .sev-NONE { color: var(--mds-text-muted); }

.flag-exception {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  margin-left: 5px;
  border-radius: var(--mds-radius-sm);
  border: 1px solid color-mix(in srgb, var(--mds-negative) 42%, transparent);
  background: var(--mds-negative-soft);
  color: var(--mds-negative);
  font-family: var(--mds-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.flag-quiet {
  font-size: 11px;
  color: var(--mds-text-muted);
  margin-left: 5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Audit & Policies — Borderless Editorial Prose
   ========================================================================== */
.audit-flow { padding-bottom: 24px; }
.audit-prose { max-width: 78ch; }
.section-heading {
  margin: 0 0 8px;
  font-family: var(--mds-font-heading);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.audit-meta-line { margin-bottom: 14px; }
.audit-prose p {
  margin: 0 0 12px;
  color: var(--mds-text-secondary);
  line-height: 1.65;
}
.audit-rules-list {
  margin: 0;
  padding-left: 18px;
  color: var(--mds-text-secondary);
  line-height: 1.65;
}
.audit-rules-list li + li { margin-top: 8px; }

/* ==========================================================================
   Slide-Over Frosted Glass CVE Inspector Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--mds-overlay);
  backdrop-filter: blur(4px);
  z-index: 90;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(760px, 96vw);
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--mds-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.drawer-cve-id {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--mds-interact);
}
.drawer-body {
  padding: 18px 20px 32px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--mds-border-subtle);
  border-bottom: 1px solid var(--mds-border-subtle);
}
.drawer-attr-row {
  padding: 10px 12px;
  border-radius: var(--mds-radius-lg);
  border: 1px solid var(--mds-border-subtle);
  background: var(--mds-bg-elevated);
}
.drawer-warning-box {
  padding: 10px 12px;
  border-radius: var(--mds-radius-lg);
  border: 1px solid color-mix(in srgb, var(--mds-warning) 45%, transparent);
  background: var(--mds-warning-soft);
  color: var(--mds-text-primary);
  font-size: 12.5px;
}
.json-box {
  margin: 0;
  padding: 12px;
  border-radius: var(--mds-radius-lg);
  border: 1px solid var(--mds-border-subtle);
  background: var(--mds-bg-input);
  font-family: var(--mds-font-mono);
  font-size: 11.5px;
  line-height: 1.48;
  overflow: auto;
  max-height: 380px;
  white-space: pre;
  color: var(--mds-text-secondary);
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--mds-text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
.rail-backdrop {
  position: fixed;
  inset: 0;
  background: var(--mds-overlay);
  backdrop-filter: blur(4px);
  z-index: 55;
}

@media (max-width: 1340px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 1040px) {
  .grid-2, .h2h-hero { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar-search { display: none; }
  .header-meta { display: none; }
  .nav-rail {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 280px !important;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 60;
    background: var(--mds-bg-drawer);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: var(--mds-shadow-drawer);
    overflow-y: auto !important;
  }
  .mobile-rail-open .nav-rail { transform: translateX(0); }
  .rail-collapsed .rail-label,
  .rail-collapsed .rail-chevron { display: inline; }
  .rail-collapsed .rail-short { display: none; }
  .rail-collapsed .rail-item { flex-direction: row; text-align: left; padding: 9.5px 12px; gap: 12px; }
  .rail-collapsed .mds-rail-subnav { display: flex !important; }
  .rail-group:not(.open) .mds-rail-subnav { display: none !important; }
  .filters-popover { right: auto; left: 0; }
}

@media (max-width: 640px) {
  .grid-4, .popover-inputs-4, .drawer-fact-grid { grid-template-columns: 1fr; }
  .h2h-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar-sep { display: none; }
}
