/* =========================================================================
   VALKAN tokens — adapted from the design system's colors_and_type.css
   Single source of truth for color, type, spacing, radii, shadows, motion.
   Use the CSS custom properties; never hard-code values in components.

   Only the Midnight + Gold palette ships in the app.

   Light mode lives behind data-theme="light". Dark is default.
   ========================================================================= */

/* -----------------------------------------------------------------------
   Base tokens — palette-agnostic
   These do not change across palettes or themes.
   ----------------------------------------------------------------------- */
:root {
  /* ---- Type stack ---- */
  --font-sans: "Geist", "Söhne", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono",
    "Menlo", monospace;
  --font-display: var(--font-sans); /* No separate display face by design */

  /* ---- Type scale (px values, semantically named) ---- */
  --text-2xs: 11px;   /* labels, tiny meta */
  --text-xs: 12px;    /* table cell meta, footnotes */
  --text-sm: 13px;    /* body in dense UI, table cells */
  --text-base: 14px;  /* default body */
  --text-md: 15px;    /* reading body */
  --text-lg: 17px;    /* subheads */
  --text-xl: 20px;    /* card titles, h4 */
  --text-2xl: 24px;   /* h3 */
  --text-3xl: 30px;   /* h2 */
  --text-4xl: 40px;   /* h1, big numbers */
  --text-5xl: 56px;   /* hero / dashboard headline numbers */
  --text-6xl: 80px;   /* marketing only */

  /* ---- Weights ---- */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- Line-heights ---- */
  --leading-tight: 1.1;     /* big numbers, hero */
  --leading-snug: 1.25;     /* headlines */
  --leading-normal: 1.45;   /* body */
  --leading-relaxed: 1.6;   /* long-form reading */

  /* ---- Tracking ---- */
  --tracking-display: -0.022em; /* big numbers, hero text */
  --tracking-tight: -0.012em;   /* h1-h3 */
  --tracking-normal: 0;          /* body */
  --tracking-wide: 0.04em;       /* uppercase labels (sparingly) */

  /* ---- Spacing (4px base) ---- */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 56px;
  --space-11: 80px;
  --space-12: 120px;

  /* ---- Radii ---- */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* ---- Borders ---- */
  --border-width: 1px; /* @kind other */

  /* ---- Shadows (dark-mode-tuned; rebuilt under [data-theme=light]) ----
     Directional: light source top-left (inset highlight) + cast shadow
     bottom-right, so floating elements read as physically lifted. */
  --shadow-1:
    inset 1px 1px 0 rgba(255,255,255,0.22),
    inset -1px -1px 0 rgba(0,0,0,0.40),
    0 6px 20px rgba(0,0,0,0.80),
    0 2px 6px rgba(0,0,0,0.60),
    0 0 0 1px rgba(0,0,0,0.50);
  --shadow-2:
    inset 1px 1px 0 rgba(255,255,255,0.13),
    inset -1px -2px 2px rgba(0,0,0,0.35),
    10px 14px 34px rgba(0,0,0,0.62),
    0 0 0 1px rgba(0,0,0,0.45);
  --shadow-3:
    inset 1px 2px 0 rgba(255,255,255,0.16),
    inset -2px -3px 4px rgba(0,0,0,0.40),
    22px 30px 70px rgba(0,0,0,0.70),
    0 0 0 1px rgba(0,0,0,0.50);
  /* Control depth (buttons, interactive pills) + chrome edge cast */
  --shadow-control: 0 1px 2px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.09);
  --shadow-control-strong: 0 2px 4px rgba(0,0,0,0.50), inset 0 1px 0 rgba(255,255,255,0.28);
  --shadow-pressed: inset 0 1px 3px rgba(0,0,0,0.45);
  --edge-shadow-right: 5px 0 18px rgba(0,0,0,0.32);
  --edge-shadow-down: 0 5px 18px rgba(0,0,0,0.32);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.2, 0, 0, 1); /* @kind other */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); /* @kind other */
  --dur-fast: 80ms; /* @kind other */
  --dur-base: 120ms; /* @kind other */
  --dur-slow: 200ms; /* @kind other */
  --dur-page: 320ms; /* @kind other */

  /* ---- Severity (cross-palette, do not theme) ---- */
  --sev-critical: #E5484D;
  --sev-critical-bg: rgba(229, 72, 77, 0.12);
  --sev-critical-border: rgba(229, 72, 77, 0.32);

  --sev-high: #F5A524;
  --sev-high-bg: rgba(245, 165, 36, 0.12);
  --sev-high-border: rgba(245, 165, 36, 0.32);

  --sev-medium: #E0C56A;
  --sev-medium-bg: rgba(224, 197, 106, 0.10);
  --sev-medium-border: rgba(224, 197, 106, 0.28);

  --sev-low: #5EA4F2;
  --sev-low-bg: rgba(94, 164, 242, 0.10);
  --sev-low-border: rgba(94, 164, 242, 0.28);

  --sev-info: #8A95AD;
  --sev-info-bg: rgba(138, 149, 173, 0.10);
  --sev-info-border: rgba(138, 149, 173, 0.28);

  --sev-ok: #5BB98C;
  --sev-ok-bg: rgba(91, 185, 140, 0.10);
  --sev-ok-border: rgba(91, 185, 140, 0.28);

  /* ---- Z-index ---- */
  --z-base: 0; /* @kind other */
  --z-sticky: 20; /* @kind other */
  --z-nav: 30; /* @kind other */
  --z-dropdown: 40; /* @kind other */
  --z-modal-scrim: 50; /* @kind other */
  --z-modal: 51; /* @kind other */
  --z-toast: 60; /* @kind other */
  --z-tooltip: 70; /* @kind other */
}

/* =========================================================================
   PALETTE 1 — MIDNIGHT + GOLD (default)
   Deep navy substrate, single gold accent, warm white text.
   ========================================================================= */
:root,
:root[data-palette="midnight"] {
  /* Surfaces (dark) */
  --bg-0: #070B14;          /* page */
  --bg-1: #0B1120;          /* sidebar, top chrome */
  --bg-2: #121A2E;          /* card surface */
  --bg-3: #1A2440;          /* hover-lifted row, menu */
  --bg-inset: #060912;      /* code blocks, deep wells */
  --bg-overlay: rgba(7, 11, 20, 0.72); /* modal scrim */
  --bg-deep: #040509;       /* richer near-black edge for the page-level radial depth */

  /* Foregrounds */
  --fg-1: #F4F1E8;          /* warm white — primary text */
  --fg-2: #B3BACC;          /* secondary text */
  --fg-3: #6E7894;          /* tertiary / placeholder */
  --fg-4: #4A5371;          /* disabled / faint chrome */
  --fg-inverse: #0B1120;    /* text on gold / on white */

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Accent — gold */
  --accent: #D4A95C;
  --accent-hover: #DDB66E;
  --accent-press: #C29A48;
  --accent-bg: rgba(212, 169, 92, 0.10);
  --accent-border: rgba(212, 169, 92, 0.32);
  --accent-fg: #1A1505;     /* text on gold */

  /* Data viz (calm, distinguishable @ small sizes) */
  --viz-1: #D4A95C;         /* gold (primary series) */
  --viz-2: #5EA4F2;         /* blue */
  --viz-3: #5BB98C;         /* sage */
  --viz-4: #B68FE2;         /* lavender */
  --viz-5: #E0C56A;         /* muted yellow */
  --viz-6: #6BC2D9;         /* teal */
  --viz-7: #E58A5C;         /* terracotta */
  --viz-8: #8A95AD;         /* gray */

  /* Access level on graph edges (what a principal can DO at the far end).
     Deliberately NOT aliases of --viz-*: the viz ramp belongs to charts and is
     re-tuned independently, and --viz-4 is already spent on cross-plane bridge
     edges. Also NOT the --sev-* ramp: access level is a capability, not a
     severity, and read access to a crown-jewel bucket outranks admin access to
     a scratch one. Hue here is a secondary channel — stroke width and the edge
     marker carry the same information for anyone who cannot separate these. */
  --access-read: #7C93B8;        /* muted slate-blue — deliberately recessive */
  --access-write: #D98E4F;       /* amber-orange */
  --access-read-write: #C77BC4;  /* orchid — reads as "both", not as a third hue */
  --access-admin: #E0574F;       /* alarm red, distinct from --sev-critical */

  /* Inventory-ring ramp (42M-402 review: "gray/sand/olive/bronze, no blue").
     A warm-neutral LIGHTNESS STAIRCASE, not a categorical palette — muted
     earth tones can't pass categorical CVD checks alone (validated), so ring
     identity rides on fixed concentric order + legend + hover, with lightness
     as the differentiator and red reserved for the attention share. */
  --ring-1: #C9A45C;        /* bronze  (outermost) */
  --ring-2: #A8935F;        /* sand */
  --ring-3: #838B52;        /* olive */
  --ring-4: #63795B;        /* moss */
  --ring-5: #5C6578;        /* gray   (innermost) */

  /* Page-level vignette (brand signature) */
  --vignette: radial-gradient(
    1200px 800px at 0% 100%,
    rgba(212, 169, 92, 0.05) 0%,
    rgba(212, 169, 92, 0) 60%
  ); /* @kind other */

  color-scheme: dark;
}

/* =========================================================================
   LIGHT MODE — Paper + Midnight + Gold
   Targets BOTH the root (so it beats the palette selectors' specificity
   on <html>) and any descendant element (so split-pane previews can flip
   one pane to light without touching root).
   ========================================================================= */
:root[data-theme="light"],
[data-theme="light"] {
  /* Surfaces — deepened warm cream (was near-pure-white); chrome and cards
     sit a shade darker than the page so glass edges read without a hard line */
  /* 42M-402 review rework: the warm-parchment wash read soft and heavy —
     neutral near-white canvas, white cards, sharper edges. A whisper of the
     old warmth stays in the canvas tint so light mode is still Valkan. */
  --bg-0: #F3F2EE;          /* page — neutral, faintly warm */
  --bg-1: #FAFAF7;          /* sidebar, top chrome */
  --bg-2: #FFFFFF;          /* cards — white */
  --bg-3: #ECEBE5;          /* hover row, menu */
  --bg-inset: #E7E5DE;      /* code blocks, wells */
  --bg-overlay: rgba(7, 11, 20, 0.35); /* modal scrim — dark navy at low alpha */
  --bg-deep: #ECEAE4;       /* page-level radial depth edge */

  /* Foregrounds — the midnight navy, stepped down for hierarchy
     (secondary/tertiary darkened in the 42M-402 review pass). */
  --fg-1: #0B1120;          /* primary text = dark-mode bg-1 navy */
  --fg-2: #3D4557;          /* secondary */
  --fg-3: #5B6377;          /* tertiary / placeholder */
  --fg-4: #8B93A8;          /* disabled / faint */
  --fg-inverse: #FFFFFF;    /* text on dark / on gold */

  /* Borders — neutral navy-gray, crisper than the old warm tint */
  --border-subtle:  rgba(15, 23, 42, 0.09);
  --border-default: rgba(15, 23, 42, 0.15);
  --border-strong:  rgba(15, 23, 42, 0.24);

  /* Accent — gold, deepened for legibility on white */
  --accent: #B5853C;
  --accent-hover: #C09548;
  --accent-press: #9B6F2D;
  --accent-bg: rgba(181, 133, 60, 0.10);
  --accent-border: rgba(181, 133, 60, 0.32);
  --accent-fg: #FFFFFF;     /* text on filled gold buttons */

  /* Data viz — slightly deepened to read on white */
  --viz-1: #B5853C;         /* gold */
  --viz-2: #2F6AB8;         /* blue */
  --viz-3: #3F8E62;         /* sage */
  --viz-4: #8867B6;         /* lavender */
  --viz-5: #B89A3E;         /* mustard */
  --viz-6: #3F8FA3;         /* teal */
  --viz-7: #B8623C;         /* terracotta */
  --viz-8: #6B7488;         /* gray */

  /* Access level — deepened to hold contrast on white */
  --access-read: #4C6389;
  --access-write: #A9611F;
  --access-read-write: #94438F;
  --access-admin: #B3352E;

  /* Inventory-ring ramp — deepened for white surfaces */
  --ring-1: #A8813A;
  --ring-2: #8A7844;
  --ring-3: #6B7238;
  --ring-4: #4F6847;
  --ring-5: #555E70;

  /* Page vignette — gold whisper from the bottom-left */
  --vignette: radial-gradient(
    1200px 800px at 0% 100%,
    rgba(181, 133, 60, 0.06) 0%,
    rgba(181, 133, 60, 0) 60%
  ); /* @kind other */

  /* Shadows — small and quiet (the broad directional casts of the parchment
     era made light mode feel heavy); the 1px ring does the separating. */
  --shadow-1:
    0 1px 3px rgba(11,17,32,0.10),
    0 0 0 1px rgba(11,17,32,0.07);
  --shadow-2:
    0 3px 8px rgba(11,17,32,0.12),
    0 0 0 1px rgba(11,17,32,0.07);
  --shadow-3:
    0 10px 28px rgba(11,17,32,0.16),
    0 0 0 1px rgba(11,17,32,0.08);
  /* Control depth + chrome edge cast — tuned for white */
  --shadow-control: 0 1px 2px rgba(11,17,32,0.14), inset 0 1px 0 rgba(255,255,255,0.75);
  --shadow-control-strong: 0 2px 4px rgba(11,17,32,0.18), inset 0 1px 0 rgba(255,255,255,0.35);
  --shadow-pressed: inset 0 1px 3px rgba(11,17,32,0.18);
  --edge-shadow-right: 5px 0 18px rgba(11,17,32,0.10);
  --edge-shadow-down: 0 5px 18px rgba(11,17,32,0.10);

  color-scheme: light;
}

/* Severity colors deepen slightly under light mode so they pass AA on white.
   They stay recognisable as the same hues. */
:root[data-theme="light"],
[data-theme="light"] {
  --sev-critical: #C7363B;
  --sev-critical-bg: rgba(199, 54, 59, 0.08);
  --sev-critical-border: rgba(199, 54, 59, 0.28);

  --sev-high: #C77A0F;
  --sev-high-bg: rgba(199, 122, 15, 0.08);
  --sev-high-border: rgba(199, 122, 15, 0.28);

  --sev-medium: #9C8530;
  --sev-medium-bg: rgba(156, 133, 48, 0.08);
  --sev-medium-border: rgba(156, 133, 48, 0.28);

  --sev-low: #2F6AB8;
  --sev-low-bg: rgba(47, 106, 184, 0.08);
  --sev-low-border: rgba(47, 106, 184, 0.28);

  --sev-info: #6B7488;
  --sev-info-bg: rgba(107, 116, 136, 0.08);
  --sev-info-border: rgba(107, 116, 136, 0.28);

  --sev-ok: #2F8C5C;
  --sev-ok-bg: rgba(47, 140, 92, 0.08);
  --sev-ok-border: rgba(47, 140, 92, 0.28);
}

/* =========================================================================
   SEMANTIC CSS variables — what you reach for in components
   ========================================================================= */
:root {
  /* Body */
  --color-bg: var(--bg-0);
  --color-surface: var(--bg-2);
  --color-text: var(--fg-1);
  --color-text-muted: var(--fg-2);
  --color-text-faint: var(--fg-3);
  --color-border: var(--border-subtle);
  --color-focus: var(--accent);
}

/* =========================================================================
   BASE element styles — minimal reset + sensible defaults
   ========================================================================= */
html {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg-1);
  background: var(--bg-0);
  background-image: var(--vignette);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03"; /* Geist's stylistic alts */
}

body {
  margin: 0;
}

/* Headings — type scale + tracking */
h1, .h1 {
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-semibold);
  margin: 0;
}
h2, .h2 {
  font-size: var(--text-3xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-semibold);
  margin: 0;
}
h3, .h3 {
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-semibold);
  margin: 0;
}
h4, .h4 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  font-weight: var(--weight-semibold);
  margin: 0;
}
h5, .h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin: 0;
}
h6, .h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin: 0;
}

p {
  margin: 0;
}

/* Code & mono */
code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-feature-settings: "ss01", "ss02", "zero";
}

code {
  padding: 1px 6px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--fg-1);
}

pre {
  font-size: var(--text-sm);
  padding: var(--space-5);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}

/* Big numbers — the signature metric type */
.metric {
  font-size: var(--text-5xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  font-feature-settings: "tnum", "lnum", "cv11";
  font-variant-numeric: tabular-nums;
}

/* Eyebrow / overline */
.eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Brand mark theme pair (BrandMark with no explicit variant): blue metal on
   dark surfaces, gold metal on cream — exactly one visible per theme. */
.bm-light { display: none !important; }
[data-theme="light"] .bm-light { display: block !important; }
[data-theme="light"] .bm-dark { display: none !important; }

/* Helpers */
.tabular { font-variant-numeric: tabular-nums; }
.muted   { color: var(--fg-2); }
.faint   { color: var(--fg-3); }

/* Selection */
::selection {
  background: var(--accent);
  color: var(--accent-fg);
}

/* Focus ring — global, never invisible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Scrollbar — thin, on-brand */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; border: 2px solid transparent; }

/* =========================================================================
   COMPAT ALIASES — legacy Valkan token names resolved onto Valkan tokens.
   Lets all pre-redesign CSS and inline var() styles render correctly while
   pages migrate. Pruned as consumers move to the real token names.
   ========================================================================= */
:root {
  /* Surfaces */
  --bg: var(--bg-0);
  --surface: var(--bg-2);
  --surface-2: var(--bg-1);
  --surface-3: var(--bg-inset);
  --hover: var(--bg-3);

  /* Borders */
  --border: var(--border-subtle);
  --border-soft: var(--border-subtle);

  /* Text */
  --fg: var(--fg-1);
  /* Text on saturated colored fills (provider chips, solid pills) — stays
     white in both themes; the fills themselves don't change with the theme. */
  --fg-on-color: #ffffff;

  /* Brand */
  --accent-2: var(--accent-hover);
  --accent-soft: var(--accent-bg);
  --accent-ring: var(--accent-border);

  /* Risk → severity */
  --risk-critical: var(--sev-critical);
  --risk-critical-bg: var(--sev-critical-bg);
  --risk-high: var(--sev-high);
  --risk-high-bg: var(--sev-high-bg);
  --risk-medium: var(--sev-medium);
  --risk-medium-bg: var(--sev-medium-bg);
  --risk-low: var(--sev-low);
  --risk-low-bg: var(--sev-low-bg);
  --risk-info: var(--sev-info);
  --risk-info-bg: var(--sev-info-bg);

  /* Radii + shadows */
  --r-sm: var(--radius-md);
  --r: var(--radius-lg);
  --r-lg: var(--radius-lg);
  --shadow-sm: var(--shadow-control);
  --shadow: var(--shadow-1);
  --shadow-lg: var(--shadow-2);
}

/* =========================================================================
   VALKAN chrome — app shell, sidebar, subhead, cmd-k, agent panel.
   Ported from the design system's ui_kits/console/app.css (token-only).
   Loaded via styles.css @import, BEFORE the legacy rules — a legacy rule of
   equal specificity therefore wins until it is deleted; shell classes here
   have no legacy counterpart left (pruned in the same change).
   ========================================================================= */

html, body, #root { height: 100%; }
body { margin: 0; overflow: hidden; }

@property --sidebar-w {
  syntax: '<length>';
  inherits: true;
  initial-value: 220px;
}
@property --panel-w {
  syntax: '<length>';
  inherits: true;
  initial-value: 400px;
}

.app {
  --sidebar-w: 220px;
  --panel-w: 400px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  color: var(--fg-2);
  background: var(--bg-0);
  background-image: radial-gradient(120% 140% at 15% -10%, var(--bg-1) 0%, var(--bg-0) 55%, var(--bg-deep, #040509) 100%);
  transition: grid-template-columns var(--dur-slow) var(--ease-out);
  position: relative;
}
/* Subtle film-grain for organic depth — CSS only, applies everywhere .app renders */
.app::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 500; opacity: 0.025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.app[data-sidebar="collapsed"] { --sidebar-w: 64px; }
/* A phone: one column, and the navigation is a labelled drawer over it, opened from the header. */
.app[data-nav="phone"] { grid-template-columns: minmax(0, 1fr); }
.app[data-nav="phone"] .sidebar {
  position: fixed; inset: 0 auto 0 0; width: min(288px, 86vw); z-index: var(--z-modal);
  background: var(--bg-1); transform: translateX(-100%); visibility: hidden;
  transition: transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
}
.app[data-nav-open="true"] .sidebar { transform: none; visibility: visible; transition: transform var(--dur-base) var(--ease-out); }
.nav-scrim { position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1); background: rgba(0, 0, 0, 0.5); }
.nav-menu-btn { flex: none; }

.app[data-panel="pinned"] {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--panel-w);
}

/* ===== SUB-HEADER — breadcrumb + ⌘K, living inside <main> so it scrolls
   with the page. No background, no border: it sits directly on the app's
   background gradient, matching the redesign's "part of the background"
   direction. ===== */
.subhead {
  display: flex; align-items: center; gap: 16px;
  height: 40px; flex-shrink: 0; margin-bottom: 8px;
}
.subhead .tenant-name { color: var(--fg-1); font-weight: var(--weight-medium); }

.crumbs { display: flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: var(--text-sm); white-space: nowrap; flex-shrink: 1; min-width: 0; }
/* The trail gives way before the chrome cluster: a long page title is cut with an ellipsis (its full
   text is the title attribute) rather than pushing the bar past a phone's edge. */
.crumbs > * { flex-shrink: 0; }
.crumbs > .cur { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--fg-4); }
.crumbs .cur { color: var(--fg-1); font-weight: var(--weight-medium); }
/* 42M-407 pass 3: the parent-of-entity segment, now a real control — same
   typography as a plain crumb span at rest, interactive on hover/focus. */
.crumb-back, .crumbs .crumb-link {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-decoration: none;
}
.crumbs .crumb-link.tenant-name { color: var(--fg-1); }
.crumb-back:hover, .crumbs .crumb-link:hover, .crumbs .crumb-link.tenant-name:hover { color: var(--accent); }
.crumb-back:focus-visible, .crumbs .crumb-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; color: var(--accent);
}

.spacer { flex: 1; }


/* Top-right global chrome cluster (42M-407 pass 2 §2) — scan-freshness pill,
   theme toggle, AI trigger, user avatar, outermost-to-innermost as content
   gets more page-specific. */
.subhead-chrome { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Back to the previous page: beside the breadcrumb, once there is an in-app page to go back to. */
.subhead-back {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; margin-right: 10px;
  height: 26px; padding: 0 8px 0 4px; border-radius: var(--radius-md);
  border: 1px solid var(--border-default); background: transparent; color: var(--fg-2);
  font-size: var(--text-xs); cursor: pointer;
}
.subhead-back:hover, .subhead-back:focus-visible { color: var(--fg-1); border-color: var(--border-strong); }
.subhead-theme { flex-shrink: 0; }
.user-menu-trigger { padding: 0; border: 1px solid transparent; }
.user-menu-trigger .avatar { width: 26px; height: 26px; font-size: 11px; }

/* ScanFreshnessPill's real base rule lives in styles.css (a file one level
   up from this styles/ directory — my first pass here missed it entirely
   and added a second, conflicting `.scan-pill` rule that fought the
   original for the height/margin the pill actually renders with; removed —
   styles.css:533 is the one definition now, with its margin dropped since
   `.subhead-chrome`'s own `gap` handles spacing in this new horizontal
   context). Only the compact-width override belongs here. */

.iconbtn.is-active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }

.iconbtn {
  width: 28px; height: 28px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid transparent;
  color: var(--fg-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.iconbtn:hover { background: var(--bg-3); color: var(--fg-1); border-color: var(--border-subtle); }

.ap-object-metadata-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ap-object-metadata-avatar {
  width: 42px; height: 42px; border-radius: var(--radius-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,0.72); font-weight: var(--weight-semibold); font-size: 16px;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.4);
}
.ap-object-metadata-name { font-size: 15px; font-weight: var(--weight-semibold); color: var(--fg-1); letter-spacing: var(--tracking-tight); }
.ap-object-metadata-sub { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.ap-object-metadata-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.fd-decision-evidence { display: grid; gap: 12px; margin: 14px 2px 4px; }
.fd-summary-item { display: grid; gap: 4px; }
.fd-summary-item .fd-detail-text { margin: 0; }
.fd-affected-entity { display: grid; gap: 6px; }
.fd-affected-entity .fd-section-title { margin: 0; }
.fd-last-observed { font-size: 12px; }

.fd-entity-chip {
  align-items: center; align-self: start; display: inline-flex; gap: 6px; max-width: 100%;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-2);
  color: var(--fg-2); font: inherit; font-size: 12px; padding: 5px 9px;
}
button.fd-entity-chip { cursor: pointer; }
button.fd-entity-chip:hover { border-color: var(--accent-border); color: var(--fg-1); }
.fd-entity-open { align-items: center; display: inline-flex; gap: 4px; color: var(--accent-2); margin-left: 2px; white-space: nowrap; }
.fd-entity-open svg { width: 12px; height: 12px; }
.ap-section-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-4); margin: 18px 0 4px;
}
.ap-section-label:first-of-type { margin-top: 6px; }
.ap-object-metadata-headtext { min-width: 0; }
.ap-object-metadata-headtext .ap-object-metadata-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Accordion — used for any Object-tab content with more than a flat kv list
   (graph edges, escalations, related items). Never a nested tab row. */
.ap-accordion { border-top: 1px solid rgba(255,255,255,0.06); margin-top: 4px; }
[data-theme="light"] .ap-accordion { border-top-color: rgba(10,20,40,0.08); }
.ap-accordion:first-of-type { margin-top: 14px; }
.ap-accordion-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0; padding: 12px 2px; cursor: pointer;
  color: var(--fg-1); font-size: 12.5px; font-weight: var(--weight-medium); text-align: left;
  font-family: inherit;
}
.ap-accordion-chev { color: var(--fg-4); flex-shrink: 0; transition: transform 160ms var(--ease-out); }
.ap-accordion-chev.open { transform: rotate(90deg); }
.ap-accordion-count {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-4);
  background: rgba(255,255,255,0.05); border-radius: 999px; padding: 1px 7px;
}
.ap-accordion-body { padding: 0 2px 12px 21px; display: flex; flex-direction: column; gap: 8px; }

.edge-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
}
[data-theme="light"] .edge-row { background: rgba(10,20,40,0.02); border-color: rgba(10,20,40,0.06); }
.edge-row-path { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--fg-2); }
.edge-row-path span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edge-row-arrow { color: var(--fg-4); flex-shrink: 0; }

.avatar {
  width: 26px; height: 26px; border-radius: 999px;
  background: linear-gradient(155deg, var(--accent-hover), var(--accent-press));
  color: var(--accent-fg); font-size: 11px; font-weight: var(--weight-semibold);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px -3px var(--accent-border);
}

/* ===== SIDEBAR — glass panel, matches the redesign's translucent gradient ===== */
.sidebar {
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative; z-index: 1;
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
[data-theme="light"] .sidebar {
  background: linear-gradient(160deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
  border-right-color: rgba(10,20,40,0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 16px 32px -24px rgba(10,20,40,0.16);
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 16px; color: var(--fg-1); font-weight: var(--weight-semibold);
  font-size: var(--text-md); letter-spacing: var(--tracking-tight); white-space: nowrap; overflow: hidden;
}
.nav-brand img { flex-shrink: 0; }
.nav-brand span {
  overflow: hidden; text-overflow: ellipsis; max-width: 160px; opacity: 1;
  transition: max-width var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), margin-left var(--dur-slow) var(--ease-out);
}
.app[data-sidebar="collapsed"] .nav-brand span { max-width: 0; opacity: 0; }
.sb-footer .nav-item .avatar {
  width: 18px; height: 18px; font-size: 9px; flex-shrink: 0;
}
.sidebar .sec {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-4); padding: 0 10px;
  height: 32px; display: flex; align-items: center;
  position: relative;
}
.sidebar .nav-item {
  display: flex; align-items: center;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--fg-2); font-size: var(--text-sm); cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.sidebar button.nav-item { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; }
.sidebar .nav-item > svg { flex-shrink: 0; }
.sidebar .nav-item > span:not(.count):not(.avatar) {
  overflow: hidden; text-overflow: ellipsis;
  margin-left: 10px; max-width: 160px; opacity: 1;
  transition: max-width var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), margin-left var(--dur-slow) var(--ease-out);
}
.sidebar .nav-item:hover { background: var(--bg-2); color: var(--fg-1); }
.sidebar .nav-item.active {
  background-image: linear-gradient(120deg, rgba(212,169,92,0.14), rgba(212,169,92,0.02) 65%);
  color: var(--fg-1);
}
.sidebar .nav-item .count {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  color: var(--accent); background: var(--accent-bg);
  border: 1px solid var(--accent-border); border-radius: 999px;
  padding: 1px 6px;
}

/* Contextual sections — collapsed header row by default; expands to its own
   sub-items only when active, collapsing any other open section. */
.nav-section-head {
  position: relative; font-weight: var(--weight-medium);
}
.nav-section-head .disclosure {
  margin-left: auto; color: var(--fg-4); flex-shrink: 0;
  max-width: 13px; opacity: 1; overflow: hidden;
  transition: max-width var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.nav-section-head.active {
  background-image: linear-gradient(120deg, rgba(212,169,92,0.14), rgba(212,169,92,0.02) 65%);
  color: var(--fg-1);
  border: 1px solid var(--accent-border);
}
.nav-section-head.active .disclosure { color: var(--accent); }
.nav-section-items {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px; margin: 2px 2px 6px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
}
[data-theme="light"] .nav-section-items { background: rgba(10,20,40,0.02); border-color: rgba(10,20,40,0.06); }
/* 38/6, not 42/10: "Remediations" and a 99+ badge fit the 220px sidebar whole (T-171026-f5b6ae7f). */
.sidebar .nav-item.nav-subitem { padding-left: 38px; padding-right: 6px; position: relative; }
.nav-subitem > svg { width: 14px; height: 14px; }
.nav-subitem::before {
  content: ""; position: absolute; left: 26px; top: 0; bottom: 0;
  width: 1px; background: var(--border-subtle);
}
.nav-subitem.active {
  background-image: linear-gradient(120deg, rgba(212,169,92,0.14), rgba(212,169,92,0.02) 65%);
  color: var(--fg-1);
}
.nav-subitem.active::before { background: var(--accent-border); }
.sidebar .sb-footer {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 2px;
}

/* Collapse toggle pinned to footer */
.sidebar .collapse-toggle {
  display: flex; align-items: center;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--fg-3); font-size: var(--text-sm); cursor: pointer;
  background: transparent; border: 0; font-family: inherit; width: 100%;
  white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.sidebar .collapse-toggle > svg { flex-shrink: 0; }
.sidebar .collapse-toggle > span:not(.chev) {
  overflow: hidden; text-overflow: ellipsis;
  margin-left: 10px; max-width: 160px; opacity: 1;
  transition: max-width var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), margin-left var(--dur-slow) var(--ease-out);
}
.sidebar .collapse-toggle:hover { background: var(--bg-2); color: var(--fg-1); }
.sidebar .collapse-toggle .chev { transition: transform var(--dur-slow) var(--ease-out); }

/* ===== COLLAPSED SIDEBAR (icons only) — icons keep identical size/position
   to expanded; only the label text collapses away (width+opacity), so
   nothing visually jitters or shifts during the transition. */
.app[data-sidebar="collapsed"] .sidebar .nav-item > span:not(.count):not(.avatar) {
  max-width: 0; opacity: 0; margin-left: 0;
}
.app[data-sidebar="collapsed"] .sidebar .sec {
  color: transparent; font-size: 0;
}
.app[data-sidebar="collapsed"] .sidebar .sec::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%;
  height: 1px; background: var(--border-subtle); transform: translateY(-50%);
}
.app[data-sidebar="collapsed"] .sidebar .nav-item .count {
  position: absolute; top: 2px; right: 4px; margin: 0;
  min-width: 0; padding: 0 4px; font-size: 9px; line-height: 14px;
}
.app[data-sidebar="collapsed"] .sidebar .nav-subitem::before { display: none; }
.app[data-sidebar="collapsed"] .sidebar .nav-item.nav-subitem {
  padding-left: 0; padding-right: 0; justify-content: center;
}
.app[data-sidebar="collapsed"] .sidebar .nav-section-head .disclosure { max-width: 0; opacity: 0; }
.app[data-sidebar="collapsed"] .sidebar .nav-section-items { display: flex; }
.app[data-sidebar="collapsed"] .sidebar .nav-section-head.active { background-image: linear-gradient(120deg, rgba(212,169,92,0.2), rgba(212,169,92,0.05) 70%); }
.app[data-sidebar="collapsed"] .sidebar .collapse-toggle { padding-left: 10px; }
.app[data-sidebar="collapsed"] .sidebar .collapse-toggle > span:not(.chev) {
  max-width: 0; opacity: 0; margin-left: 0;
}
.app[data-sidebar="collapsed"] .sidebar .collapse-toggle .chev { transform: rotate(180deg); }

/* Sidebar collapses width only; sub-header wraps naturally on narrow screens. */
/* Keep only the current segment — separators must hide with their spans or
   the crumbs render as orphaned "/ /" glyphs. */
@media (max-width: 980px)  { .subhead .crumbs :is(span, a):not(.cur) { display: none; } }

/* Top-right cluster compression (42M-407 pass 2 §2) — collapsed onto the
   existing 980px breakpoint rather than inventing several new ones:
   - scan-freshness pill: label+age text hides, bare status dot remains
     (ScanFreshnessPill's aria-label AND title carry the full state
     regardless — see that component).
   - AI trigger is icon-only unconditionally now (user call), not part of
     this compression.
   - theme toggle: the top-right icon hides; UserMenu's own theme row
     becomes the only way to reach it. Base (shown) state declared
     immediately above `@media` — see that rule's comment for why source
     order between the two matters here. */
.user-menu-theme-row { display: none; }
@media (max-width: 980px) {
  .scan-pill .lbl, .scan-pill .age { display: none; }
  .subhead-theme { display: none; }
  .user-menu-theme-row { display: flex; }
}

/* ===== CONTENT ===== */
.content {
  overflow-y: auto;
  padding: 24px 28px 56px;
  container: content / inline-size;
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: var(--d-head-gap);
  margin-bottom: calc(var(--d-head-gap) + 4px);
}
.page-head .titles { display: flex; flex-direction: column; gap: 4px; }
.page-head .title { font-size: var(--d-page-title); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); color: var(--fg-1); }
.page-head .sub { color: var(--fg-2); font-size: var(--text-sm); }
/* The data freshness line (atoms/DataFreshness.tsx): quiet when fresh, the warning in the warn tone. */
.page-head .data-freshness { display: block; color: var(--fg-3); font-size: var(--text-xs, 12px); }
.page-head .data-freshness-warn { color: var(--sev-medium); font-weight: 600; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* In the shell the title sits in the breadcrumb row (.crumb-title), so the header is one compact row:
   eyebrow, description and freshness side by side, actions at the end (T-141026-c5e8249e). */
.page-head.compact { align-items: center; padding-bottom: 0; margin-bottom: 8px; min-height: 0; }
.page-head.compact .titles { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.page-head.compact:not(:has(.titles > *)):not(:has(.actions)) { display: none; }
.subhead .crumb-title {
  margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); color: var(--fg-1);
}

@keyframes slidein {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Cmd-K palette ===== */
.scrim {
  position: fixed; inset: 0; background: var(--bg-overlay);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal-scrim);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh;
  animation: fade var(--dur-base) var(--ease-out);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@keyframes pulse-ok {
  0% { box-shadow: 0 0 0 0 rgba(91,185,140,0.6); }
  100% { box-shadow: 0 0 0 8px rgba(91,185,140,0); }
}

/* =========================================================================
   AGENT PANEL — right side, Assistant + Help tabs, pin or float
   ========================================================================= */
.agent-panel {
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255,255,255,0.08);
  min-height: 0;
  overflow: hidden;
}
[data-theme="light"] .agent-panel {
  background: linear-gradient(160deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
  border-left-color: rgba(10,20,40,0.1);
}
.agent-panel.pinned {
  grid-column: 3; grid-row: 1;
  border-left-color: var(--accent-border);
}
.agent-panel.floating {
  position: fixed; top: 0; right: 0; bottom: 0;
  /* Clamp to the viewport: a flat 400px panel is WIDER than a 390px phone, so it used to run
     off-screen and take its own close button with it. */
  width: min(var(--panel-w), 100vw);
  box-shadow: -30px 0 60px -20px rgba(0,0,0,0.5);
  z-index: var(--z-modal);
  animation: slidein var(--dur-slow) var(--ease-out);
}
[data-theme="light"] .agent-panel.floating { box-shadow: -20px 0 50px -20px rgba(10,20,40,0.2); }

/* Scrim behind the floating (unpinned) panel — darkens + softly blurs the
   rest of the screen, matching the redesign's .rx-panel-scrim. */
.panel-scrim {
  position: fixed; top: 0; left: 0; right: var(--panel-w); bottom: 0;
  background: rgba(4,5,9,0.35); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease-out);
  z-index: calc(var(--z-modal) - 1);
}
.panel-scrim.open { opacity: 1; pointer-events: auto; }
[data-theme="light"] .panel-scrim { background: rgba(20,25,35,0.14); }

/* Header: segmented tab control + actions — matches the sophisticated
   redesign's panel chrome instead of a flat icon-bar. */
.ap-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px 8px;
  flex-shrink: 0;
}
.ap-tabs {
  display: flex; gap: 2px; flex: 1; min-width: 0;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md); padding: 3px;
}
[data-theme="light"] .ap-tabs { background: rgba(10,20,40,0.03); border-color: rgba(10,20,40,0.08); }
.ap-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: calc(var(--radius-md) - 2px);
  background: transparent; border: 0; cursor: pointer;
  color: var(--fg-3); font-family: inherit; font-size: 12.5px; font-weight: var(--weight-medium);
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
  max-width: 140px; min-width: 0; flex: 1;
}
.ap-tab .ap-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ap-tab:hover { color: var(--fg-1); }
.ap-tab.active {
  color: var(--fg-1);
  background-color: rgba(255,255,255,0.07);
  background-image: linear-gradient(160deg, rgba(255,255,255,0.05), transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 4px 10px -6px rgba(0,0,0,0.4);
}
[data-theme="light"] .ap-tab.active {
  background-color: rgba(255,255,255,0.85);
  background-image: none;
  box-shadow: 0 1px 3px rgba(10,20,40,0.12);
}
.ap-tab.active .ap-tab-ic { color: var(--accent); }
.ap-tab .ap-tab-ic { display: inline-flex; }
.ap-tab-count { min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--sev-critical); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; }
/* Ask Val is off here: a quiet dot; the tab's tooltip and its content say why. */
.ap-tab-off { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); flex-shrink: 0; }

/* ----- Inbox tab (T-241126-d3639408, alert cards T-241126-9df94aad) ----- */
.ap-inbox { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; overflow-y: auto; padding: 12px 14px; }
.ap-inbox-page { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.ap-inbox-page:hover { text-decoration: underline; }
.ap-inbox-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* The alert card (components/inbox/alertCards.tsx), on every surface that lists alerts. */
/* The closed card's head (alertCards.tsx AlertHead): a fixed dot column, the title, the For you chip on the title's
   first line, the meta under the title. --alert-indent is the dot column plus its gap: the open card's detail and
   actions start there too, under the title. */
.alert-card { --alert-indent: 15px; }
.alert-card-head {
  display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; align-items: start;
  min-width: 0; line-height: 18px;
}
.alert-card-dot { grid-column: 1; grid-row: 1; display: flex; height: 18px; align-items: center; }
.alert-card-title { grid-column: 2; grid-row: 1; font-size: 13px; font-weight: var(--weight-semibold); color: var(--fg-1); overflow-wrap: anywhere; }
.alert-card-head.read .alert-card-title { font-weight: var(--weight-medium); color: var(--fg-2); }
.alert-card-for-you { grid-column: 3; grid-row: 1; align-self: start; }
.alert-card-meta { grid-column: 2 / 4; font-size: 11.5px; font-weight: var(--weight-regular); color: var(--fg-3); }
.alert-card-summary { color: var(--fg-1); }
.dt-card-detail p { margin: 0; }
.alert-card .dt-card-detail, .alert-card .dt-card-actions { padding-left: var(--alert-indent); }
.alert-card-todo { font-weight: var(--weight-medium); color: var(--fg-1); }
.alert-card-facts { font-size: 11.5px; color: var(--fg-3); }
.alert-card-off { flex-basis: 100%; font-size: 11.5px; color: var(--fg-3); }
.alert-undo { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px solid var(--border-subtle); font-size: 12.5px; }
.alert-target-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.alert-undo-said { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-actions { display: flex; align-items: center; gap: 2px; }

/* ----- Assistant (chat) ----- */
.chat { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 18px;
}

.msg { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.msg.user {
  align-self: flex-end; align-items: flex-end;
  max-width: 86%;
}
.msg.user .bubble {
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  color: var(--fg-1); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-xs) var(--radius-lg);
  padding: 9px 12px; font-size: var(--text-sm); line-height: var(--leading-normal);
}
.msg.agent { align-self: stretch; }
.msg .who { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.agent-av {
  width: 22px; height: 22px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--border-default);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-1); flex-shrink: 0;
  box-shadow: 0 2px 6px -2px rgba(0,0,0,0.35);
}
.msg .who .nm { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--fg-1); }
.msg .who .nm .tag { color: var(--accent); font-family: var(--font-mono); font-size: 10px; font-weight: var(--weight-medium); margin-left: 6px; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.msg.agent .bubble {
  color: var(--fg-1); font-size: var(--text-sm); line-height: var(--leading-relaxed);
  padding-left: 30px;
}
.msg.agent .bubble p { margin: 0 0 8px; }
.msg.agent .bubble p:last-child { margin-bottom: 0; }
.msg.agent .bubble code { background: var(--bg-inset); border-color: var(--border-subtle); }

/* Inline incident refs inside agent answers */

.ref {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px solid color-mix(in oklab, var(--border-subtle) 55%, transparent);
  cursor: pointer; text-align: left; font-family: inherit;
  position: relative; overflow: hidden;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.ref::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(160px circle at var(--mx,50%) var(--my,50%), var(--accent-bg), transparent 70%);
  transition: opacity 200ms var(--ease-out);
}
.ref:hover::after { opacity: 1; }
.ref:hover { background: var(--bg-3); border-color: var(--border-default); }
.ref .dot { width: 8px; height: 8px; border-radius: 999px; }
.ref.crit .dot { background: var(--sev-critical); }
.ref.high .dot { background: var(--sev-high); }
.ref.med .dot { background: var(--sev-medium); }
.ref.low .dot { background: var(--sev-low); }
.ref .r-title { font-size: var(--text-xs); color: var(--fg-1); font-weight: var(--weight-medium); }
.ref .r-id { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); }

/* Thinking indicator */
.thinking { display: flex; align-items: center; gap: 6px; padding-left: 30px; color: var(--fg-3); }
.thinking .d { width: 5px; height: 5px; border-radius: 999px; background: var(--fg-3); animation: blink 1.2s ease-in-out infinite; }
.thinking .d:nth-child(2) { animation-delay: 0.2s; }
.thinking .d:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* Empty greeting + suggestions */
.chat-empty { display: flex; flex-direction: column; gap: 14px; padding: 8px 2px; }
.chat-empty .greet { display: flex; flex-direction: column; gap: 8px; }
.chat-empty .greet .gtitle { font-size: var(--text-lg); color: var(--fg-1); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.chat-empty .greet .gsub { font-size: var(--text-sm); color: var(--fg-2); line-height: var(--leading-relaxed); }
.suggest { display: flex; flex-direction: column; gap: 6px; }
.suggest .slabel { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--fg-3); margin-bottom: 2px; }
.chip-btn {
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 9px 11px; border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px solid color-mix(in oklab, var(--border-subtle) 55%, transparent);
  color: var(--fg-1); font-family: inherit; font-size: var(--text-sm); cursor: pointer;
  position: relative; overflow: hidden;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.chip-btn::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(160px circle at var(--mx,50%) var(--my,50%), var(--accent-bg), transparent 70%);
  transition: opacity 200ms var(--ease-out);
}
.chip-btn:hover::after { opacity: 1; }
.chip-btn:hover { background: var(--bg-3); border-color: var(--border-default); }
.chip-btn .ci { color: var(--accent); flex-shrink: 0; }

/* Composer */
.composer {
  flex-shrink: 0; border-top: 1px solid var(--border-subtle);
  padding: 12px; background: var(--bg-1);
}
.composer-box {
  display: flex; align-items: flex-end; gap: 8px;
  background: linear-gradient(160deg, color-mix(in oklab, var(--fg-1) 3%, var(--bg-2)), var(--bg-2)); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: 8px 8px 8px 12px;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.composer-box textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent;
  color: var(--fg-1); font: inherit; font-size: var(--text-sm); line-height: var(--leading-normal);
  max-height: 120px; min-height: 20px; padding: 1px 0;
}
.composer-box textarea::placeholder { color: var(--fg-3); }
.send-btn {
  width: 30px; height: 30px; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-fg); border: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0; transition: background var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: 0.4; cursor: default; }
.composer .hint { margin-top: 6px; font-size: 10px; color: var(--fg-4); font-family: var(--font-mono); letter-spacing: var(--tracking-wide); text-align: center; }

/* ----- Help ----- */
.help { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px 32px; }
.help .ctx {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border);
  padding: 3px 8px; border-radius: var(--radius-pill); margin-bottom: 14px;
}
.help h3 { font-size: var(--text-xl); color: var(--fg-1); letter-spacing: var(--tracking-tight); font-weight: var(--weight-semibold); margin-bottom: 6px; }
.help .lead { font-size: var(--text-sm); color: var(--fg-2); line-height: var(--leading-relaxed); margin-bottom: 18px; }
.help .h-sec { padding: 14px 0; border-top: 1px solid var(--border-subtle); }
.help .h-sec h4 { font-size: var(--text-sm); color: var(--fg-1); font-weight: var(--weight-semibold); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.help .h-sec h4 .hi { color: var(--fg-3); }
.help .h-sec p { font-size: var(--text-sm); color: var(--fg-2); line-height: var(--leading-relaxed); margin-bottom: 8px; }
.help .h-sec p:last-child { margin-bottom: 0; }
.help ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.help li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; font-size: var(--text-sm); color: var(--fg-2); line-height: var(--leading-normal); }
.help li .li-ic { color: var(--accent); margin-top: 2px; }
.help li code { background: var(--bg-inset); border-color: var(--border-subtle); color: var(--fg-1); }
.help .kbd-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: var(--text-sm); color: var(--fg-2); }
.help .kbd-row .keys { display: flex; gap: 4px; }
.help .kbd-row .keys .k { font-family: var(--font-mono); font-size: 10px; color: var(--fg-2); background: var(--bg-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); padding: 2px 6px; }
.help .ask-cta {
  margin-top: 18px; padding: 14px; border-radius: var(--radius-lg);
  background: var(--bg-2); border: 1px solid var(--border-subtle);
}
.help .ask-cta .t { font-size: var(--text-sm); color: var(--fg-1); font-weight: var(--weight-medium); margin-bottom: 4px; }
.help .ask-cta .s { font-size: var(--text-xs); color: var(--fg-3); margin-bottom: 10px; line-height: var(--leading-relaxed); }

/* ===== Valkan adaptations ===================================================
   Pages still carry their own .page padding/max-width; the subhead aligns to
   the same content column instead of .content owning the padding (that flips
   in the per-page restyle waves). */
.content { padding: 0; }
.subhead {
  /* The bottom margin is the sub-header's own (the first block above `margin: 0 auto` dropped it): the gap between
     Back and the trail and the page. The side padding is the page's (--d-page-x), not a fixed 24px. */
  max-width: 1640px; margin: 0 auto 10px; width: 100%;
  padding: 12px var(--d-page-x) 0;
}

/* Reduced motion: no shell/panel animation, no spotlight glow, no pulses. */
@media (prefers-reduced-motion: reduce) {
  .app { transition: none; }
  .agent-panel.floating { animation: none; }
  .scrim { animation: none; }
  .panel-scrim { transition: none; }
  
  .thinking .d { animation: none; opacity: 0.6; }
  .ref::after, .chip-btn::after { display: none; }
}

/* =========================================================================
   VALKAN components — glass cards, feed rows, inspector, tables, tabs,
   toolbar, toggle, severity badges, buttons, chips (design app.css port).
   ========================================================================= */

/* ===== METRIC CARDS — glass, spotlight-reactive (see .rx-spotlight-hook in
   components.jsx, which sets --mx/--my via delegated mousemove) ===== */

.metric-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -28px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 6px;
  min-height: 132px; position: relative; overflow: hidden;
  cursor: pointer; transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.metric-card::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(220px circle at var(--mx,50%) var(--my,50%), var(--accent-bg), transparent 70%);
  transition: opacity 200ms var(--ease-out);
}
.metric-card:hover::after { opacity: 1; }
.metric-card:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); transform: translateY(-1px); }
.metric-card.is-active { border-color: var(--accent-border); background: var(--accent-bg); box-shadow: var(--shadow-control); }
/* A count with nothing to open (SummaryStat countOnly): dashed, and no hover that would offer a click, in either theme. */
.metric-card.count-only { border-style: dashed; cursor: default; pointer-events: none; }
/* A sentence's own action (the Policies count line's Show / Hide): reads as a link, is a button. */
.inline-link { all: unset; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.inline-link:hover { color: var(--fg-1); }
.inline-link:focus-visible { outline: 2px solid var(--accent-border); outline-offset: 2px; border-radius: 2px; }
.metric-card .eyb { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.metric-card .val { font-size: 40px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; line-height: 1; color: var(--fg-1); }
.metric-card .val .unit { font-size: 16px; color: var(--fg-3); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.metric-card .delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); font-family: var(--font-mono); }
.metric-card .delta.up { color: var(--sev-ok); }
.metric-card .delta.warn { color: var(--sev-high); }
.metric-card .spark { margin-top: auto; height: 36px; }

/* ===== TWO COL ===== */

/* Responsive: as the content area narrows (side panels open, or small screens),
   drop the metric grid to fewer columns and stack the two-column layout. */

/* ===== INCIDENT FEED ===== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-head .h { font-size: var(--text-xl); font-weight: var(--weight-semibold); color: var(--fg-1); letter-spacing: var(--tracking-tight); }
.section-head .actions { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--fg-3); }

.feed { display: flex; flex-direction: column; gap: 8px; }

@keyframes pulse-crit {
  0% { box-shadow: 0 0 0 0 rgba(229,72,77,0.5); }
  100% { box-shadow: 0 0 0 8px rgba(229,72,77,0); }
}

/* Reflow the incident row when the content area gets tight (panels open / small screens) */

/* ===== SIDE PANELS ===== */
.side {
  display: flex; flex-direction: column; gap: 16px;
}
.panel {
  background: linear-gradient(160deg, color-mix(in oklab, var(--fg-1) 3%, var(--bg-2)), var(--bg-2));
  border: 1px solid color-mix(in oklab, var(--border-subtle) 55%, transparent);
  border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-1);
}

/* ===== INSPECTOR ===== */
.inspector {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(420px, 100vw);
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -30px 0 60px -20px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  z-index: var(--z-modal);
  animation: slidein var(--dur-slow) var(--ease-out);
}
[data-theme="light"] .inspector {
  background: linear-gradient(160deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
  border-left-color: rgba(10,20,40,0.1);
  box-shadow: -20px 0 50px -20px rgba(10,20,40,0.2);
}
/* Shift the inspector left of the agent panel when it's present */
.app[data-panel="pinned"] .inspector,
.app[data-panel="floating"] .inspector { right: var(--panel-w); }

.inspector .head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 8px;
}
.inspector .head .top {
  display: flex; align-items: center; gap: 10px;
}
.inspector .head .top .sev-badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--sev-critical-bg); border: 1px solid var(--sev-critical-border);
  color: var(--sev-critical);
}
.inspector .head .top .id { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-3); margin-left: auto; }
.inspector .head .title { font-size: var(--text-xl); color: var(--fg-1); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); }
.inspector .head .meta { font-size: var(--text-xs); color: var(--fg-3); font-family: var(--font-mono); }

.inspector .body {
  flex: 1; overflow-y: auto;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 18px;
}
.inspector .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--fg-3); margin-bottom: 6px; }
.inspector .kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: var(--text-sm); }
.inspector .kv .k { color: var(--fg-3); }
.inspector .kv .v { color: var(--fg-1); font-family: var(--font-mono); font-size: var(--text-xs); }
.inspector .timeline { display: flex; flex-direction: column; gap: 0; }

.inspector .actions { padding: 14px 20px; border-top: 1px solid var(--border-subtle); display: flex; gap: 8px; }

/* Code block in inspector */
.codeblock {
  background: var(--bg-inset); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 10px 12px;
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-1);
  line-height: var(--leading-relaxed); white-space: pre-wrap;
}

.codeblock .dim { color: var(--fg-3); }

/* ===== TABLES (Policies, Models) ===== */
.tbl-wrap {
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg); overflow-x: auto;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -28px rgba(0,0,0,0.6);
}
[data-theme="light"] .tbl-wrap {
  background: linear-gradient(160deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
  border-color: rgba(10,20,40,0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 16px 32px -24px rgba(10,20,40,0.16);
}
.tbl { width: 100%; min-width: 560px; border-collapse: collapse; }
.tbl thead th {
  text-align: left; font-weight: var(--weight-medium);
  font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-3);
  padding: calc(var(--d-cell-y) - 2px) var(--d-cell-x); background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.06);
}
[data-theme="light"] .tbl thead th { background: rgba(10,20,40,0.02); border-bottom-color: rgba(10,20,40,0.1); }
.tbl tbody td {
  padding: var(--d-cell-y) var(--d-cell-x);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: var(--text-sm); color: var(--fg-1); vertical-align: middle;
}
[data-theme="light"] .tbl tbody td { border-bottom-color: rgba(10,20,40,0.08); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { position: relative; transition: background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.tbl tbody tr::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(160px circle at var(--mx,50%) var(--my,50%), var(--accent-bg), transparent 70%);
  transition: opacity 200ms var(--ease-out);
}
.tbl tbody tr:hover { background: rgba(255,255,255,0.035); }
[data-theme="light"] .tbl tbody tr:hover { background: rgba(255,255,255,0.5); }
.tbl tbody tr:hover::after { opacity: 1; }
.tbl .mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-2); }
.tbl .right { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--fg-3); }

/* ===== TABS ===== */
/* overflow-x: auto is deliberate for every Tabs strip: at 375px a detail page's tabs otherwise push the page sideways. */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-subtle); margin-bottom: calc(var(--d-block-gap) + 4px); overflow-x: auto; }
/* The one-line intro under a DetailShell's tabs (PolicyPack, PolicyPreset, CustomPolicy, ValkanPolicy, PersonDetail). */
.detail-intro { margin: 0 0 12px; }
.tab {
  padding: var(--d-tab-y) var(--d-cell-x);
  font-size: var(--text-sm); color: var(--fg-3); cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  user-select: none;
  /* Tabs are <button>s (keyboard-reachable, announced as tabs). Reset the UA button chrome, then draw the bottom edge
     the selected tab underlines: after the reset, or the reset's zero width wins and no tab is ever underlined. */
  background: none; border: 0 solid transparent; font-family: inherit; line-height: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  /* A label stays on one line ("Risk & Reach" broke into three at 375px); the strip scrolls sideways instead. */
  white-space: nowrap; flex-shrink: 0;
}
.strip-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 12px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 20px; }
.strip-row > .tabs { border-bottom: 0; margin-bottom: 0; flex-wrap: wrap; }
.strip-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; padding-bottom: 8px; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.tab:hover { color: var(--fg-2); }
.tab.active { color: var(--fg-1); border-bottom-color: var(--accent); font-weight: var(--weight-semibold); }
.tab .count { margin-left: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); }
/* Policy builder: the page column, its inputs, the part tags and the add-part target. */
.policy-builder .builder-main { display: grid; gap: 18px; max-width: 1040px; }
.policy-builder .input { width: auto; max-width: 100%; height: 32px; padding: 0 10px; background: var(--surface-2); border-color: var(--border-strong); border-radius: 8px; }
.policy-builder textarea.input { height: auto; min-height: 56px; padding: 8px 10px; }
.pb-scope { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
.pb-part-tag { padding: 2px 9px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 999px; }
/* Adding a part: a full-width dashed target, so it reads as "add another box here". */
.policy-builder .btn.pb-add-part { justify-content: center; width: 100%; height: 40px; color: var(--fg-2); background: transparent;
  border: 1px dashed var(--border-strong); border-radius: 10px; box-shadow: none; }
.policy-builder .btn.pb-add-part:hover:not(:disabled) { color: var(--accent); background: var(--accent-bg); border-color: var(--accent); }
@media (max-width: 720px) { .pb-scope { grid-template-columns: 1fr; } }
.cond-group { display: grid; gap: 6px; padding: 8px; border-left: 2px solid var(--border-subtle); }
.cond-group-head, .cond-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cond-group-body { display: grid; gap: 6px; }
/* A related-item row's further condition sits under it, over the linked items' facts. */
.cond-related { flex-wrap: wrap; }
.cond-related-where { flex-basis: 100%; padding-left: 18px; }
.policy-builder .builder-preview { display: grid; gap: 4px; }
.policy-builder .builder-preview ul { margin: 0; padding-left: 18px; font-size: var(--text-sm); }
.policy-advanced { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; font-size: var(--text-sm); }
.policy-advanced dt { color: var(--fg-3); }
.policy-advanced dd { margin: 0; }
/* Details popup */
.policy-modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg-overlay);
}
.policy-modal {
  width: min(720px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--bg-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 20px 22px; display: grid; gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.policy-modal-head { display: flex; align-items: center; gap: 10px; }
.policy-modal-title { flex: 1; margin: 0; font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--fg-1); }
.policy-modal-close { background: none; border: 0; color: var(--fg-3); cursor: pointer; padding: 2px; }
.policy-modal-close:hover { color: var(--fg-1); }
.policy-modal-meta { display: flex; align-items: center; gap: 8px; margin-top: -4px; }
.policy-modal-id { font-size: 11px; margin-left: auto; }
.policy-modal-section { display: grid; gap: 3px; }
.policy-modal-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent);
  font-weight: var(--weight-medium);
}
.policy-modal-text { margin: 0; font-size: var(--text-sm); color: var(--fg-2); line-height: 1.55; }
.policy-details { display: grid; gap: 8px; }
.policy-detail-h {
  margin: 6px 0 0; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--fg-1);
}
.policy-detail-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.policy-detail-list li { font-size: var(--text-sm); color: var(--fg-2); line-height: 1.5; }
.policy-detail-tablewrap { overflow-x: auto; }
.policy-detail-table {
  width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed;
}
/* Fixed column widths per shape so wide tables wrap inside the popup instead of
   overflowing. Column count comes from the renderer (cols-N). */
.policy-detail-table.cols-2 th:nth-child(1), .policy-detail-table.cols-2 td:nth-child(1) { width: 76%; }
.policy-detail-table.cols-2 th:nth-child(2), .policy-detail-table.cols-2 td:nth-child(2) { width: 24%; }
.policy-detail-table.cols-4 th:nth-child(1), .policy-detail-table.cols-4 td:nth-child(1) { width: 13%; }
.policy-detail-table.cols-4 th:nth-child(2), .policy-detail-table.cols-4 td:nth-child(2) { width: 13%; }
.policy-detail-table.cols-4 th:nth-child(3), .policy-detail-table.cols-4 td:nth-child(3) { width: 37%; }
.policy-detail-table.cols-4 th:nth-child(4), .policy-detail-table.cols-4 td:nth-child(4) { width: 37%; }
.policy-detail-table th, .policy-detail-table td {
  text-align: left; padding: 5px 10px 5px 0; border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.policy-detail-table th { color: var(--fg-3); font-weight: var(--weight-medium); }
.policy-detail-table td { color: var(--fg-2); }
.policy-detail-table td:last-child, .policy-detail-table th:last-child { padding-right: 0; }
.policy-detail-table th, .policy-detail-table td { overflow-wrap: anywhere; }
.policy-details > summary {
  cursor: pointer; width: fit-content; list-style: none;
  font-size: 12px; color: var(--accent); font-weight: var(--weight-medium);
}
.policy-details > summary::-webkit-details-marker { display: none; }
.policy-details > summary::before { content: '▸ '; }
.policy-details[open] > summary::before { content: '▾ '; }
.policy-details > summary:hover { text-decoration: underline; }
.policy-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.policy-definition { display: grid; gap: 16px; margin-top: 8px; }
.def-frozen { padding: 4px 16px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-1); }
.def-frozen .def-head { justify-content: space-between; margin: 8px 0 0; }
.def-activity { display: grid; gap: 4px; margin: 8px 0; }
.def-activity > div { display: flex; gap: 8px; }
.def-activity dt { min-width: 72px; color: var(--text-muted); }
.def-activity dd { margin: 0; }
.def-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.def-fieldset button { display: none; }
/* Their menus (More ▾, a row's ⋯) hold only those buttons, so would open empty. */
.def-fieldset .cond-more { display: none; }
/* Disabled, but read as values, not greyed-out controls. */
.def-fieldset .input:disabled, .def-fieldset .input[readonly] { opacity: 1; color: var(--fg-1); cursor: default; }
.def-fieldset select.input:disabled { appearance: none; background-image: none; }
.def-fieldset details.policy-details > summary { pointer-events: none; }
/* What a rule applies to (KindSelect), and a policy's further parts in the builder. */
.kind-select { position: relative; display: inline-block; min-width: 0; }
.kind-select-button { display: inline-flex; align-items: center; gap: 8px; max-width: 420px; cursor: pointer; text-align: left; }
.kind-select-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind-select-menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; display: grid; gap: 2px; min-width: 240px;
  max-height: 320px; overflow-y: auto; padding: 6px; border: 1px solid var(--border-default);
  border-radius: var(--radius-md); background: var(--bg-1); box-shadow: var(--shadow-md, 0 4px 16px rgb(0 0 0 / 0.12));
}
.kind-select-option { display: grid; }
.kind-select-option label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; }
.kind-select-option label:hover { background: var(--bg-2); }
.kind-select-group { padding: 6px 6px 2px; font-size: var(--text-xs); border-top: 1px solid var(--border-subtle); margin-top: 4px; }
/* Read-only: the dropdown shows its kinds, it does not open. */
.def-fieldset .kind-select-button { display: inline-flex; cursor: default; }
.policy-builder .builder-part { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-default); border-radius: 10px; }
.policy-builder .builder-rule { display: grid; gap: 12px; }
.policy-builder .builder-part-head { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
/* The top-level "when … of these are true" block: a soft panel, nested groups indented inside it. */
.policy-builder .builder-main .cond-group:not(.is-nested) { gap: 8px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: 10px; }
.policy-builder .cond-group-foot { margin-top: 2px; }
.def-code-note {
  display: grid; gap: 6px; padding: 14px 16px; margin-top: 4px; border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px dashed var(--border-default); font-size: var(--text-sm); color: var(--fg-2);
}
.def-code-note p { margin: 0; line-height: 1.55; }
.def-code-title { font-weight: var(--weight-semibold); color: var(--fg-1); }
.policy-tag {
  font-size: 10px; padding: 2px 8px; color: var(--fg-3);
  background: var(--bg-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
}
.fd-policy-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 2px;
  /* Rendered as a <button>: it opens the policy popup in place rather than
     navigating to /policies, so reset the button chrome. */
  background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer;
}
.fd-policy-link:hover { text-decoration: underline; }

/* A finding's policy in the findings table as its id: a compact mono link that opens the policy. */
.policy-id-link {
  display: inline-block; max-width: 220px; vertical-align: middle;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
}
.policy-id-link:hover, .policy-id-link:focus-visible { text-decoration: underline; }

/* A side-rail value that acts as a link (the finding's policy row). */
.side-row-link {
  background: none; border: 0; padding: 0;
  font-family: inherit; font-size: inherit; font-weight: inherit; text-align: right;
  color: var(--accent); cursor: pointer;
}
.side-row-link:hover { text-decoration: underline; }

/* ===== TOOLBAR ===== */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

.input {
  height: 30px; padding: 0 10px 0 32px;
  background: var(--bg-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--fg-1);
  font: inherit; font-size: var(--text-sm);
  outline: none; transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  width: 280px; position: relative;
}
.input::placeholder { color: var(--fg-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fg-3); pointer-events: none; }

.filter-pill {
  height: 30px; padding: 0 10px; border-radius: var(--radius-md);
  background: var(--bg-1); border: 1px dashed var(--border-default);
  color: var(--fg-2); font-size: var(--text-xs); display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
}
.filter-pill:hover { background: var(--bg-3); color: var(--fg-1); }
.filter-pill.active { border-style: solid; border-color: var(--accent-border); background-color: var(--accent-bg); background-image: linear-gradient(135deg, var(--accent-bg), transparent 70%); color: var(--accent); box-shadow: var(--shadow-control); }

/* ===== Toggle ===== */
.switch {
  width: 32px; height: 18px; background: var(--bg-3); border-radius: 999px;
  border: 1px solid var(--border-default); position: relative; cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  flex-shrink: 0;
  /* Also used on <button> (Fleet's Show all), where the UA padding would distort the track.
     No-op on the <span> callers. */
  padding: 0; display: inline-block; box-sizing: border-box; appearance: none;
}
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Disabled must LOOK unavailable, not merely refuse clicks — an unexplained dead control reads
   as a bug. Fleet pairs this with a title saying why. */
.switch:disabled { cursor: not-allowed; opacity: 0.55; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 999px; background: var(--fg-2);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(14px); background: var(--accent-fg); }

/* ===== Severity badges ===== */
.sev-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: var(--radius-pill);
  font-size: 10px; font-weight: var(--weight-medium);
  border: 1px solid;
  font-feature-settings: "tnum";
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  white-space: nowrap;
  background-image: linear-gradient(135deg, currentColor -320%, transparent 140%);
}
.sev-badge .d { width: 6px; height: 6px; border-radius: 999px; box-shadow: 0 0 6px 1px currentColor; }
.sev-badge.crit { background-color: var(--sev-critical-bg); border-color: var(--sev-critical-border); color: var(--sev-critical); }
.sev-badge.crit .d { background: var(--sev-critical); }
.sev-badge.high { background-color: var(--sev-high-bg); border-color: var(--sev-high-border); color: var(--sev-high); }
.sev-badge.high .d { background: var(--sev-high); }
.sev-badge.med  { background-color: var(--sev-medium-bg); border-color: var(--sev-medium-border); color: var(--sev-medium); }
.sev-badge.med .d { background: var(--sev-medium); }
.sev-badge.low  { background-color: var(--sev-low-bg); border-color: var(--sev-low-border); color: var(--sev-low); }
.sev-badge.low .d { background: var(--sev-low); }
.sev-badge.info { background-color: var(--sev-info-bg); border-color: var(--sev-info-border); color: var(--sev-info); }
.sev-badge.info .d { background: var(--sev-info); }
.sev-badge.ok   { background-color: var(--sev-ok-bg); border-color: var(--sev-ok-border); color: var(--sev-ok); }
.sev-badge.ok .d { background: var(--sev-ok); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px;
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--fg-1) 3%); color: var(--fg-1);
  border: 1px solid var(--border-default);
  font-family: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium);
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.btn:hover { background: color-mix(in oklab, var(--bg-3) 88%, white); }
.btn { box-shadow: var(--shadow-control); }
.btn:active { box-shadow: var(--shadow-pressed); transform: translateY(0.5px); }
.btn.primary {
  background-color: var(--accent-press);
  background-image: linear-gradient(155deg, var(--accent-hover), var(--accent-press)), radial-gradient(120px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.35), transparent 70%);
  color: var(--accent-fg); border-color: transparent; font-weight: var(--weight-semibold); box-shadow: var(--shadow-control-strong);
  position: relative;
}
/* Disabled must read as disabled; a busy (in-flight) button says "working", not "no". */
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn[aria-busy="true"] { opacity: 0.8; cursor: progress; }
.btn .btn-spinner {
  width: 12px; height: 12px; border-width: 2px; flex: 0 0 auto;
  /* currentColor: the accent default vanishes on a .primary (accent) fill */
  border-color: color-mix(in oklab, currentColor 30%, transparent); border-top-color: currentColor;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:active { box-shadow: var(--shadow-pressed); transform: translateY(0.5px); }
/* Neutral high-emphasis: inverse fill in both themes. Gold (.primary) is
   reserved for at most one page-level brand/action moment. */
.btn.strong {
  background: var(--fg-1); color: var(--bg-0);
  border-color: transparent; font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-control-strong);
}
.btn.strong:hover { background: color-mix(in oklab, var(--fg-1) 88%, var(--bg-0)); }
.btn.strong:active { box-shadow: var(--shadow-pressed); transform: translateY(0.5px); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-3); color: var(--fg-1); }
.btn.ghost:active { box-shadow: none; transform: translateY(0.5px); }
.btn.sm { height: 26px; padding: 0 10px; font-size: var(--text-xs); }

/* Segmented control: joined .btn children, neutral (non-gold) active state. */
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); margin-left: 0; }
.seg .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.seg .btn.on {
  background: var(--bg-3); color: var(--fg-1);
  font-weight: var(--weight-semibold); border-color: var(--border-strong, var(--border-default));
  position: relative; z-index: 1;
}

/* Live ping in header */
.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--fg-2);
  white-space: nowrap; flex-shrink: 0;
}

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--d-gap); margin-bottom: var(--d-block-gap); }
.stat-grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-grid[data-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* The tiles fit the room the page has, not the window: two across in a narrow content column, one in a very narrow one. */
@container content (max-width: 720px) {
  .stat-grid:not([data-cols="2"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container content (max-width: 300px) {
  .stat-grid, .stat-grid[data-cols] { grid-template-columns: minmax(0, 1fr); }
}
.section-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg); padding: var(--d-card-pad); margin-bottom: var(--d-block-gap);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -28px rgba(0,0,0,0.6);
  overflow: hidden;
}
.section-card::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(220px circle at var(--mx,50%) var(--my,50%), var(--accent-bg), transparent 70%);
  transition: opacity 200ms var(--ease-out);
}
.section-card:hover::after { opacity: 1; }
.section-card > * { position: relative; z-index: 1; }
.section-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: calc(var(--d-stack-lg) + 2px); }
/* Light mode: cards flip to a white wash over the cream background, matching
   the redesign's own light-mode override technique. */
[data-theme="light"] .metric-card,
[data-theme="light"] .section-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
  border-color: rgba(10,20,40,0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 16px 32px -24px rgba(10,20,40,0.16);
}
[data-theme="light"] .metric-card:hover { background: rgba(255,255,255,0.85); border-color: rgba(10,20,40,0.14); }
.section-card .card-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--fg-1); }

.platform-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg-3); }
.platform-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.platform-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--fg-2); }
.platform-legend span i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.platform-legend span b { font-family: var(--font-mono); color: var(--fg-3); font-weight: var(--weight-medium); }

.agent-logo {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: #0b0d10; font-weight: var(--weight-semibold); font-size: 12px; flex-shrink: 0;
  box-shadow: 0 3px 10px -3px rgba(0,0,0,0.35);
}

.stat-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--fg-3); }

/* Single agent detail */
/* Detail views are plain in-flow page content — .content (the app's single
   scroll container), already scrolls them. No independent height/scroll region here:
   that used to create nested scrollbars and clipped overflow when the
   header + tabs + a tall body exceeded the viewport. .page gives the same
   padding/max-width every list page gets. */
.detail-shell { display: flex; flex-direction: column; }
.detail-head { flex-shrink: 0; }
/* (.drawer-fill is gone — PlaybookDrawer was the only overlay that needed it,
   and VAL-413 replaced it with an in-page DetailShell like every other panel.) */
.detail-head-top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.det-logo {
  width: var(--d-logo); height: var(--d-logo); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #0b0d10; font-weight: var(--weight-semibold); font-size: 18px; flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.4);
}
/* flex-basis + min-width let a long title wrap the actions block to its own
   line instead of collapsing the title to a char-by-char sliver; overflow-wrap
   breaks a pathological long token (e.g. an ARN) rather than overflowing the
   panel — ported from the removed styles.css duplicate. */
.det-info { flex: 1 1 240px; min-width: 240px; }
.det-info .nm { margin: 0; font-size: var(--d-head-title); font-weight: var(--weight-semibold); color: var(--fg-1); letter-spacing: var(--tracking-tight); overflow-wrap: anywhere; }
.det-info .meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: calc(var(--d-stack-lg) - 2px); }
/* A card body's fact lines. */
.card-body > .meta-row:not(:first-child) { margin-top: calc(var(--d-stack-lg) - 2px); }
.det-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; max-width: 100%; }
/* An entity page's header (DetailShell `entity`, T-171126-0ccd6786): a kind icon in a quiet tile, the name, a line of
   plain facts separated by dots ending in the copy-id button, and a row of the signals worth colour. Actions are
   icon buttons of one size; a labelled action (Remediate, Revoke) sits beside them. */
.det-entity { align-items: flex-start; }
.det-kind {
  width: var(--d-logo); height: var(--d-logo); flex: none; display: grid; place-items: center;
  border-radius: var(--radius-md); background: var(--bg-3); border: 1px solid var(--border-subtle); color: var(--fg-2);
}
.det-kind svg { width: calc(var(--d-logo) * 0.45); height: calc(var(--d-logo) * 0.45); }
.det-facts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: calc(var(--d-stack) + 2px);
  font-size: var(--text-sm); color: var(--fg-2); overflow: hidden;
}
/* The dot sits in the gap before a fact; the first fact of a wrapped line has its dot outside the box, clipped, so
   no line starts with a separator. */
.det-fact { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.det-fact + .det-fact::before { content: "·"; position: absolute; left: -10px; color: var(--fg-3); }
.det-copy {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--fg-3);
}
.det-copy:hover, .det-copy:focus-visible { color: var(--fg-1); outline: none; }
.det-signals { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.det-icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--radius-md); }
.det-icon-btn svg { width: 16px; height: 16px; }
.det-watch.on { color: var(--sev-medium); }
.det-watch.on svg { fill: currentColor; }
/* A qualifier, not a state: an agent whose classification is inferred (dashed, quiet). */
.chip-dashed { border-style: dashed; opacity: .8; }

/* A detail page's tabs: room to read and hit in either density, a divider under the row, the selected tab underlined
   in the accent and set in the strongest text colour. */
.detail-head .tabs { margin: calc(var(--d-stack-lg) + 4px) 0 0; gap: 4px; }
.detail-tabs .tab { padding: max(var(--d-tab-y), 8px) 14px; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--fg-2); border-bottom-width: 3px; }
.detail-tabs .tab:hover { color: var(--fg-1); background: var(--bg-3); border-radius: 6px 6px 0 0; }
.detail-tabs .tab.active { color: var(--fg-1); font-weight: var(--weight-semibold); }
.detail-body { padding-top: calc(var(--d-block-gap) - 4px); }
/* An entity page's facts (FactRail.tsx, T-171126-902592cf): a band of compact cards under the graph, as many to a
   row as fit; counts take two tracks, their tiles side by side (a full row on a phone). */
.fact-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; align-items: stretch; margin-bottom: var(--d-block-gap); }
.fact-band > .fact-counts { grid-column: span 2; }
@media (max-width: 600px) { .fact-band > .fact-counts { grid-column: 1 / -1; } }
/* A fact card (FactGroup): a header (icon, title, status on the right), one row per field (label left, value right),
   and a footer for its actions pinned to the foot, so cards in a row share one height and their actions line up. */
.fact-group {
  display: flex; flex-direction: column; min-height: 156px; padding: 12px 14px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle); background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
}
.fact-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.fact-title {
  display: flex; align-items: center; gap: 7px; margin: 0;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2);
}
.fact-title svg { width: 14px; height: 14px; color: var(--accent); }
.fact-status {
  font-size: var(--text-xs); color: var(--fg-2); padding: 1px 8px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--border-subtle); white-space: nowrap;
}
.fact-list { display: grid; margin: 0 0 10px; }
.fact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: baseline; gap: 12px; padding: 6px 0; }
.fact + .fact { border-top: 1px dashed var(--border-subtle); }
.fact dt { font-size: var(--text-xs); color: var(--fg-3); }
.fact dd { margin: 0; font-size: var(--text-sm); font-weight: 500; color: var(--fg-1); text-align: right; overflow-wrap: anywhere; }
.fact dd .chip-row { justify-content: flex-end; }
.fact.unknown dd { font-weight: 400; font-style: italic; color: var(--fg-3); }
.fact-empty { margin: 0; font-size: var(--text-sm); color: var(--fg-3); }
.fact-note { display: block; margin-top: 2px; font-size: var(--text-xs); font-weight: 400; color: var(--fg-3); }
.fact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.fact-group .side-row:last-of-type { border-bottom: 0; }
/* Counts: two tiles a row in the rail, more when the rail spans the page; one that opens what it counts reads as a button. */
.count-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.count-tile {
  display: grid; gap: 2px; padding: calc(var(--d-row-y) + 2px) 10px; border-radius: var(--radius-md); text-align: left;
  border: 1px solid var(--border-subtle); background: var(--bg-2); color: inherit; font: inherit;
}
button.count-tile { cursor: pointer; }
button.count-tile:hover, button.count-tile:focus-visible { border-color: var(--sel); outline: none; }
.count-tile.zero { background: none; }
.count-tile.zero .count-n { color: var(--fg-3); }
.count-n { font-size: var(--d-title); font-weight: 600; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.count-l { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--fg-2); }
.count-l svg { width: 12px; height: 12px; color: var(--fg-3); }
/* A key's age against the rotation policy. */
.key-age { display: grid; gap: 6px; }
.key-age-head { display: flex; justify-content: space-between; gap: 8px; font-size: var(--text-xs); }
.key-age-track { position: relative; height: 6px; border-radius: 3px; background: var(--bg-3); }
.key-age-fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--sev-ok); }
.key-age-fill.over { background: var(--sev-high); }
.key-age-limit { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--fg-2); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
/* Both columns must be able to shrink below their content's intrinsic width
   so the metadata column is never pushed off-screen (ported from the
   removed styles.css duplicate, which had this but chrome.css's original
   didn't). */
.detail-grid > * { min-width: 0; }
@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--d-row-y) - 1px) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.side-row:last-child { border-bottom: 0; }
.side-row .k { color: var(--fg-3); }
.side-row .v { color: var(--fg-1); font-weight: var(--weight-medium); text-align: right; }
/* A fact card: its title, a fact whose value is a set of chips, the note that explains a fact, a checkbox row and
   the card's one action. */
.side-card > .card-title { margin-bottom: calc(var(--d-stack-lg) - 2px); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* A chip that opens its record (Guardrail None → its finding): the chip keeps its tone, the link shows on hover. */
.chip-link { text-decoration: none; }
.chip-link:hover > .chip, .chip-link:focus-visible > .chip { text-decoration: underline; }
.side-row .v.chip-row { justify-content: flex-end; font-weight: var(--weight-regular); }
.side-row .k { flex: none; }
.side-check { justify-content: flex-start; gap: 8px; }
.card-body.flush { padding: 0; }
.card-body.divided { border-top: 1px solid var(--border-soft); }

/* .inspector.embedded — the same head/body/actions markup, but nested inside
   the Assistant/Help/Details panel instead of floating fixed on its own. */
.inspector.embedded {
  position: static; inset: auto; width: auto; height: 100%;
  border-left: 0; box-shadow: none; animation: none;
  display: flex; flex-direction: column; min-height: 0;
}

/* ===== CHIP — small pill badge used on graph nodes, inspector headers, and
   edge/boundary tags ===== */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 10px; line-height: 1.6; white-space: nowrap;
  background-color: var(--bg-3); background-image: linear-gradient(135deg, color-mix(in oklab, var(--fg-1) 6%, transparent), transparent 70%);
  border: 1px solid color-mix(in oklab, var(--border-subtle) 65%, transparent); color: var(--fg-3);
}
.chip.medium, .chip.sev-medium { background: var(--sev-medium-bg); border-color: var(--sev-medium-border); color: var(--sev-medium); }
.chip.high, .chip.sev-high { background: var(--sev-high-bg); border-color: var(--sev-high-border); color: var(--sev-high); }
.chip.crit, .chip.sev-crit { background: var(--sev-critical-bg); border-color: var(--sev-critical-border); color: var(--sev-critical); }
.chip.low, .chip.sev-low { background: var(--sev-low-bg); border-color: var(--sev-low-border); color: var(--sev-low); }
.chip.warn { background: var(--sev-medium-bg); border-color: var(--sev-medium-border); color: var(--sev-medium); }
.chip.ok { background: var(--sev-ok-bg); border-color: var(--sev-ok-border); color: var(--sev-ok); }
.chip.muted { opacity: 0.7; }
.chip.info { background: var(--sev-info-bg); border-color: var(--sev-info-border); color: var(--sev-info); }
/* Text in a tone (atoms/Chip.tsx names the tones; a page never sets a severity colour itself). */
.tone-critical, .metric-card .val.tone-critical, .section-card .card-title.tone-critical { color: var(--sev-critical); }
.tone-high, .metric-card .val.tone-high, .section-card .card-title.tone-high { color: var(--sev-high); }
.tone-medium, .metric-card .val.tone-medium, .section-card .card-title.tone-medium { color: var(--sev-medium); }
.tone-ok, .metric-card .val.tone-ok, .section-card .card-title.tone-ok { color: var(--sev-ok); }
.dot-critical { background: var(--sev-critical); }
.edge-high { border-color: var(--sev-high); }
.tint-high { background: color-mix(in srgb, var(--sev-high) 6%, transparent); }
.tint-high-soft { background: color-mix(in srgb, var(--sev-high) 4%, transparent); }
/* Who an identity is: a person reads plain, a machine reads as information, unclassified reads muted. */
.chip.kind-machine { background: var(--sev-info-bg); border-color: var(--sev-info-border); color: var(--sev-info); }
.chip.kind-unknown { opacity: 0.7; }

/* Access level. Uses the --access-* ramp rather than the severity ramp: what a
   principal can DO is a capability, not a severity — read access to a
   crown-jewel bucket can matter more than admin access to a scratch one, and
   colouring it as a severity would assert an ordering the data does not carry.
   Colour is a secondary channel here; the chip always spells the level out. */
.chip.access-read       { background: color-mix(in oklab, var(--access-read) 14%, transparent);       border-color: color-mix(in oklab, var(--access-read) 40%, transparent);       color: var(--access-read); }
.chip.access-write      { background: color-mix(in oklab, var(--access-write) 14%, transparent);      border-color: color-mix(in oklab, var(--access-write) 40%, transparent);      color: var(--access-write); }
.chip.access-read-write { background: color-mix(in oklab, var(--access-read-write) 14%, transparent); border-color: color-mix(in oklab, var(--access-read-write) 40%, transparent); color: var(--access-read-write); }
.chip.access-admin      { background: color-mix(in oklab, var(--access-admin) 16%, transparent);      border-color: color-mix(in oklab, var(--access-admin) 45%, transparent);      color: var(--access-admin); }

/* ===== Legacy-contract compatibility ======================================
   Pre-redesign markup uses full-word severity names, a .dotc dot child, a
   .solid variant, and .tab-count — keep those contracts working on the new
   visual language until the page waves migrate them. */
.chip.critical { background: var(--sev-critical-bg); border-color: var(--sev-critical-border); color: var(--sev-critical); }
.chip .dotc { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.solid { background: var(--fg-1); color: var(--fg-inverse); border-color: transparent; }
.tab .tab-count, .tab-count { margin-left: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); }
.sev-badge.medium { background-color: var(--sev-medium-bg); border-color: var(--sev-medium-border); color: var(--sev-medium); }
.sev-badge.medium .d { background: var(--sev-medium); }
.sev-badge.critical { background-color: var(--sev-critical-bg); border-color: var(--sev-critical-border); color: var(--sev-critical); }
.sev-badge.critical .d { background: var(--sev-critical); }

/* Filter chips and dropdown triggers (the DataTable's Add filter and Columns) — styled
   to the design's filter-pill language until pages migrate. */
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-chip-lg {
  height: 30px; padding: 0 10px; border-radius: var(--radius-md);
  background: var(--bg-1); border: 1px dashed var(--border-default);
  color: var(--fg-2); font-size: var(--text-xs);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.filter-chip-lg:hover { background: var(--bg-3); color: var(--fg-1); }
.filter-chip-lg.set { border-style: solid; border-color: var(--accent-border); background-color: var(--accent-bg); color: var(--fg-1); box-shadow: var(--shadow-control); }
.filter-chip-lg .v { color: var(--accent); font-weight: var(--weight-medium); }

/* Detail-header jump-to picker (components/InventoryPicker.tsx) — trigger
   reuses .filter-chip-lg; this is the search popover beneath it. */
.inv-picker { position: relative; }
/* 'crumb' variant — the picker doubles as the breadcrumb's trailing segment:
   plain text + chevron, matching .crumbs .cur typography, no pill chrome. */
.inv-picker-trigger-crumb {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; font-weight: var(--weight-medium); font-size: var(--text-sm);
  color: var(--fg-1); cursor: pointer;
}
.inv-picker-trigger-crumb:hover { color: var(--accent); }
/* 42M-407 pass 3 §3: chevron reads as discoverable at rest, not only on
   hover — raised from --fg-3 (muted tertiary, effectively invisible) to
   --fg-2, still "plain text + chevron, no pill chrome" per the original
   design call, just legible before the pointer arrives. Real :focus-visible
   state too — a :hover-only affordance gives keyboard users nothing. */
.inv-picker-trigger-crumb svg { width: 13px; height: 13px; color: var(--fg-2); flex-shrink: 0; }
.inv-picker-trigger-crumb:hover svg { color: var(--accent); }
.inv-picker-trigger-crumb:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
.inv-picker-trigger-crumb:focus-visible svg { color: var(--accent); }
/* Phone widths: the trail is narrower than its content and the freshness pill sits right of it, so the picker's
   label ran under that pill. The back link yields first (ellipsis); the picker keeps its label and chevron. */
@media (max-width: 480px) {
  .crumbs > .crumb-back { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .crumbs > .inv-picker { flex-shrink: 1; min-width: 0; }
  .inv-picker-trigger-crumb { max-width: 100%; }
  .inv-picker-trigger-crumb > .cur { min-width: 6ch; }
}
/* Shared popover shell (42M-407 pass 2 §5) — position (top/left) comes from
   usePopover's inline style, portalled to <body>, so this only sets the
   visual chrome. Consumers: InventoryPicker (.inv-picker-pop), UserMenu /
   AdminMenu (.menu-pop). */
.popover-pop {
  z-index: var(--z-dropdown);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden;
}
.inv-picker-pop {
  width: 280px; max-height: 360px;
}
.inv-picker-pop .list-search { margin: 8px; }
.inv-picker-list { overflow-y: auto; padding: 0 4px 4px; }
.inv-picker-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.inv-picker-item .ipi-label { color: var(--fg-1); }
.inv-picker-item .ipi-sub { font-size: 11px; }
.inv-picker-item.hi { background: var(--bg-3); }
.inv-picker-item.active .ipi-label { color: var(--accent); font-weight: var(--weight-medium); }
.inv-picker-empty { padding: 10px; text-align: center; font-size: 12px; }

/* Shared menu shell (role="menu") — UserMenu / AdminMenu, on top of
   .popover-pop's visual chrome (42M-407 pass 2 §5). */
.menu-pop { width: 220px; padding: 6px; gap: 2px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 6px; font-size: var(--text-sm);
  color: var(--fg-1); background: none; border: none; text-align: left;
  cursor: pointer; text-decoration: none;
}
.menu-item:hover, .menu-item:focus-visible {
  background: var(--bg-3); outline: none;
}
.menu-item svg { flex-shrink: 0; color: var(--fg-3); }

.user-menu-pop { width: 240px; }
.user-menu-who {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.user-menu-who .avatar { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; }
.umw-text { display: flex; flex-direction: column; min-width: 0; }
.umw-name {
  font-weight: var(--weight-medium); color: var(--fg-1); font-size: var(--text-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.umw-email { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Base (normal-width) state moved next to its @media override below —
   same selector, equal specificity, so whichever comes LATER in source
   order wins regardless of which one the media query matches. Having this
   declaration hundreds of lines after the override made the compact-width
   "show the row" rule dead: the base `display: none` here always won. */

@media (prefers-reduced-motion: reduce) {
  .metric-card::after, .tbl tbody tr::after, .section-card::after { display: none; }
  
  .inspector { animation: none; }
}

/* ===== OVERVIEW redesign ===== spacing/layout only. Card chrome itself
   (background, border, radius, shadow, hover) is deliberately left alone
   here — .metric-card/.inc-row's own site-wide rules apply unmodified, the
   same "total agents"-style glass card + cursor-spotlight hover every other
   page using SummaryStat/.metric-card already gets (useSpotlight.ts's
   delegated pointermove hook isn't page-scoped, so it just works once
   nothing here suppresses it). Earlier rounds of this redesign overrode the
   card chrome to a flat bordered look, first with the reference mockup's
   own hardcoded colors, then with Valkan's tokens — both superseded: the ask
   is now for Overview's cards to be indistinguishable from the rest of the
   site's, not a variant. Content/data wiring is unchanged — same numbers,
   same labels, same links. Left nav, top bar and right panel are untouched
   (out of scope). */
.ov-page .page-head { margin-bottom: 32px; }
.ov-page .page-head.compact { margin-bottom: 8px; }
.ov-page .section-head { margin-bottom: 16px; }
.ov-page .section-head .h { font-size: 14px; letter-spacing: var(--tracking-tight); }
.ov-page .stat-grid { gap: 16px; }
.ov-page .feed { gap: 12px; }

/* Attention/Findings cards wrap the severity badge in .eyb (Inventory wraps
   an icon+label instead) — the reference gives the badge its own `mb-5`
   (20px) below it, clear of the big number; the shared card's 8px content
   gap read as cramped for this specific pairing. */
.ov-page .metric-card .eyb:has(.sev-badge) { display: block; margin-bottom: 20px; }

/* Inventory's icon eyebrow: small muted box behind the glyph, matching the
   reference's category chip instead of a bare floating icon. */
.ov-page .stat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--radius-md);
  background: var(--bg-1); color: var(--fg-3); flex-shrink: 0;
}
.ov-page .stat-icon svg { width: 14px; height: 14px; }

/* Inventory's primary/secondary numbers: mockup stacks them with a divider
   (`mt-auto border-t border-border pt-4`), not side-by-side — a genuine
   layout difference from the rest of the site's metric cards, so it's its
   own pair of classes rather than another .stat-grid variant.
   `margin-top: auto` on the secondary block keeps the divider aligned to
   the card's bottom edge across all 5 cards regardless of content height,
   but auto-margin alone can collapse close to 0 on a tall card — the fixed
   padding-bottom/padding-top below guarantee real breathing room around the
   line itself even then, not just when there happens to be slack to eat.
   The number→label gap (both here and in the primary stat) also had no
   space of its own, just line-height. */

/* Findings' per-severity workflow-stage breakdown: 2x2 grid (Needs
   triage/Acknowledged on row one, Ticketed/Resolved on row two), matching
   the reference's `grid-cols-2`. Grid, not flex+gap — flex items size to
   their own text width ("0" vs "221"), which pushed each stage's label to a
   different x per card and read as uneven; equal grid columns fix that by
   construction and keep the 2x2 aligned across all three severity cards. */

/* `--bg-1` reads fine against the light theme's white card (its own
   --muted-on-white contrast is already enough — no complaint there), but in
   dark mode it sits too close to the glass card's near-transparent gradient
   to read without hovering. Light keeps the original flatter tile. */

/* Integration source rows: .inc-row's own site-wide chrome, unmodified —
   same reasoning as .metric-card above. */

/* Severity badges: mockup's badge-critical/high/medium have no border and
   no dot glow — just a flat soft-color pill, so those two decorations turn
   off here. The colors themselves (--sev-critical/high/medium and their
   -bg variants) are untouched — Valkan's own severity palette, already tuned
   per theme in tokens.css. */
.ov-page .sev-badge { background-image: none; border-color: transparent; }
.ov-page .sev-badge .d { box-shadow: none; }

/* Integrations read as a filler at .two-col's default 340px rail — direct
   feedback wanted it noticeably roomier (and its heading un-shrunk, above). */

/* ===== OVERVIEW v2 — Quiet instruments (42M-402) ========================== */
/* Shared glass surface for the new overview modules (same recipe as
   .section-card, without its margin — layout owns spacing via gap). */
.glass-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -28px rgba(0,0,0,0.6);
}
[data-theme="light"] .glass-card {
  background: var(--bg-2);
  border-color: var(--border-default);
  box-shadow: var(--shadow-1, 0 6px 16px rgba(11,17,32,0.14));
}

.ov2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }

.ov2-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* Hero posture strip */
.ov2-hero {
  overflow: hidden; padding: 24px 28px; min-height: 210px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
}
.ov2-hero-trend { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }
.ov2-hero-top, .ov2-hero-bottom { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ov2-hero-count { display: flex; align-items: baseline; gap: 18px; }
.ov2-hero-num {
  font-size: clamp(48px, 7vw, 80px); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display); line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--fg-1); text-decoration: none;
}
.ov2-hero-num:hover { color: var(--fg-1); text-decoration: underline; text-decoration-color: var(--border-strong); }
.ov2-hero-deltas { display: flex; flex-direction: column; gap: 5px; font-size: var(--text-xs); }
.ov2-hero-chips { display: flex; gap: 8px; align-items: center; }
.ov2-hero-tip {
  position: absolute; top: 10px; right: 12px; z-index: 1;
  font-size: var(--text-2xs); color: var(--fg-2); background: var(--bg-1);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 3px 8px; pointer-events: none;
}
.ov2-verdict { font-size: var(--text-2xs); }
.ov2-verdict.good, .good { color: var(--sev-ok); }
.ov2-verdict.warn, .ov2 .warn { color: var(--sev-high); }

/* Instrument cards */
.ov2-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ov2-card-title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--fg-1); text-decoration: none; }
.ov2-card-title:hover { text-decoration: underline; text-decoration-color: var(--border-strong); }
.ov2-delta { font-size: var(--text-2xs); }
.ov2-instrument { display: flex; align-items: center; gap: 16px; }
.ov2-ring { width: 96px; height: 96px; flex-shrink: 0; }
.ov2-ring-num { fill: var(--fg-1); font-size: 18px; font-weight: 600; }

.ov2-rail-row .d {
  display: inline-block; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor; box-shadow: 0 0 6px 1px currentColor; vertical-align: 1px;
}
.ov2-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--border-subtle); padding-top: 10px; margin-top: auto;
  font-size: var(--text-2xs); color: var(--fg-3);
}
.ov2-card-foot a { color: var(--fg-2); text-decoration: none; }
.ov2-card-foot a:hover { color: var(--fg-1); }
.ov2-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* Punchcard */
.ov2-punchcard { display: grid; grid-template-columns: repeat(15, 12px); grid-auto-rows: 12px; gap: 3px; }
.ov2-cell { width: 12px; height: 12px; border-radius: 2px; }

/* Flip cards: CSS 3D turn, both faces in the flow (the tallest face sets the
   height via grid stacking so the card never collapses mid-flip). */
.ovflip { perspective: 1200px; }
.ovflip-inner {
  display: grid; transform-style: preserve-3d;
  transition: transform 0.45s var(--ease-out, ease);
}
.ovflip.is-flipped .ovflip-inner { transform: rotateY(180deg); }
.ovflip-face {
  grid-area: 1 / 1; backface-visibility: hidden;
  display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 100%;
}
.ovflip-back { transform: rotateY(180deg); }
.ovflip-btn {
  position: absolute; top: 14px; right: 14px;
  width: 22px; height: 22px; border-radius: var(--radius-md);
  border: 1px solid var(--border-default); background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-3); cursor: pointer;
}
.ovflip-btn:hover { color: var(--fg-1); border-color: var(--border-strong); }
@media (prefers-reduced-motion: reduce) { .ovflip-inner { transition: none; } }

/* Table backs */
.ov2-table { border-collapse: collapse; width: 100%; font-family: var(--font-mono); font-size: var(--text-2xs); }
.ov2-table th {
  text-align: left; color: var(--fg-3); font-weight: var(--weight-medium); font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  padding: 6px 8px; border-bottom: 1px solid var(--border-default);
}
.ov2-table td {
  padding: 7px 8px; border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-2); font-variant-numeric: tabular-nums;
}
.ov2-table th.r, .ov2-table td.r { text-align: right; }
.ov2-table td.k { color: var(--fg-1); font-family: inherit; font-size: var(--text-xs); }
.ov2-table td.k a { color: var(--fg-1); text-decoration: none; }
.ov2-table td.k a:hover { text-decoration: underline; }
.ov2-table td.warn { color: var(--sev-high); }
.ov2-table td.good { color: var(--sev-ok); }
.ov2-table td.sev-critical a { color: var(--sev-critical); }
.ov2-table td.sev-high a { color: var(--sev-high); }
.ov2-table td.sev-medium a { color: var(--sev-medium); }

/* Top actions */
.ov2-action-rows { display: flex; flex-direction: column; }
.ov2-action-row {
  display: flex; align-items: center; gap: var(--d-gap); padding: var(--d-row-y-lg) 0;
  border-top: 1px solid var(--border-subtle);
}
.ov2-rank { font-size: var(--text-xs); color: var(--fg-4); width: 20px; flex-shrink: 0; }
.ov2-rank.is-primary { color: var(--accent); }
.ov2-action-title { flex-grow: 1; font-size: var(--text-sm); font-weight: var(--weight-medium); min-width: 0; }
.ov2-quiet-link { font-size: var(--text-2xs); color: var(--fg-2); text-decoration: none; white-space: nowrap; }
.ov2-quiet-link:hover { color: var(--fg-1); }
.ov2-missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ov2-mission { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ov2-mission.is-primary { border-color: var(--accent-border); }
.ov2-mission-top { display: flex; justify-content: space-between; align-items: center; }
.ov2-mission-title { font-size: var(--text-md); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
.ov2-mission-payoff { font-size: var(--text-xs); color: var(--fg-2); }

/* Changelog rail */
.ov2-rail { padding: 16px; display: flex; flex-direction: column; align-self: start; }
.ov2-rail-row {
  display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-subtle);
  text-decoration: none; color: var(--fg-1); font-size: var(--text-xs); line-height: var(--leading-normal);
}
.ov2-rail-row:first-of-type { margin-top: 12px; }
.ov2-rail-row .d { margin-top: 5px; flex-shrink: 0; }
.ov2-rail-row:hover .ov2-rail-body { color: var(--fg-1); }
.ov2-rail-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov2-rail-meta { font-size: var(--text-2xs); color: var(--fg-3); }

/* Customize popover */

/* ── Overview v2 round 2 (review): bars, year punchcard, scan bars, chips ── */
:root { --ov2-cell-empty: rgba(255,255,255,0.05); }
[data-theme="light"] { --ov2-cell-empty: rgba(73,53,22,0.08); }

/* Flip: faces must never exceed the wrapper or the turn drifts sideways. */
.ovflip { min-width: 0; }
.ovflip-inner { width: 100%; grid-template-columns: minmax(0, 1fr); transform-origin: center center; }
.ovflip-face { min-width: 0; max-width: 100%; }
.ovflip-face .ov2-table { display: block; overflow-x: auto; }

/* Inventory bar rows */

/* Year punchcard: 7 rows (Mon→Sun top→bottom) × 52 columns (old→new). */
.ov2-punch-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ov2-punch-cap { font-size: var(--text-2xs); color: var(--fg-4); }

.ov2-punchcard.year {
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr); grid-auto-columns: 1fr;
  gap: 2px; width: 100%; aspect-ratio: 52 / 7; min-width: 0;
}
.ov2-punchcard.year .ov2-cell { width: auto; height: auto; border-radius: 1.5px; background: var(--ov2-cell-empty); }
.ov2-punchcard.year .ov2-cell.is-future { background: transparent; }

/* Findings chips as toggles */
.ov2-chips .sev-badge { cursor: pointer; text-decoration: none; }
.ov2-chips .sev-badge.is-off { opacity: 0.35; filter: grayscale(0.6); }
.ov2-hero-chips .sev-badge { text-decoration: none; }

/* Integration scan bars */
.ov2-scanbars { display: flex; align-items: flex-end; gap: 2px; height: 44px; }
.ov2-scanbar { flex: 1 1 0; min-width: 2px; border-radius: 1.5px; opacity: 0.8; }

/* Compact empty top-actions strip */
.ov2-actions-empty { display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.ov2-actions-empty-msg { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--fg-2); flex-grow: 1; }

/* Hero toggles sit above the backdrop */
.ov2-hero-top .seg { position: relative; z-index: 1; }
.ov2-hero-top .seg .btn.sm { height: 24px; padding: 0 10px; font-size: var(--text-2xs); }

/* ── Overview v2 round 3 (visual audit): radial inventory, source chips,
   hero de-occlusion ─────────────────────────────────────────────────────── */
.ov2-hero-top, .ov2-hero-bottom { position: relative; z-index: 1; }
.ov2-hero-bottom { flex-wrap: wrap; row-gap: 8px; }
.ov2-hero-count { flex-wrap: wrap; row-gap: 4px; }

.ov2-ring-sub { fill: var(--fg-4); font-size: 8px; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }

.ov2-source-chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; min-width: 0; }
.ov2-source-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-subtle);
  font-size: var(--text-2xs); color: var(--fg-2); text-decoration: none; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.ov2-source-chip:hover { color: var(--fg-1); border-color: var(--border-strong); }

/* Round 3 fixes: the year grid was overflowing its flex parent (newest,
   colored columns clipped off the card's right edge — "no filled boxes");
   fluid tracks need min-width:0 on every flex level. */

.ov2-punchcard.year { flex: 1 1 0; width: auto; min-width: 0; overflow: hidden; }

.ov2-instrument { min-width: 0; }
.ov2-verdict { background: var(--bg-1); border: 1px solid var(--border-subtle); border-radius: 999px; padding: 2px 8px; }

/* The base .ov2-punchcard's fixed 12px column template leaked into the year
   variant (auto-flow column only ADDS implicit tracks after the 15 fixed
   ones) — clear it so all 52 columns are fluid 1fr. */
.ov2-punchcard.year { grid-template-columns: none; }

/* Card heads must clear BOTH absolute controls (expand + flip). */
.ovflip-face .ov2-card-head { padding-right: 58px; }
.ovflip.is-max .ovflip-face .ov2-card-head { padding-right: 30px; }

/* ── Overview v2 round 4 (findings review) ───────────────────────────────── */
/* Full-card inventory radial with in-arc labels */
.ov2-radial-full { width: 100%; max-width: 260px; margin: 0 auto; display: block; }

/* Always-visible view toolbar (replaces the Customize popover) */

/* Disabled range toggles read as "not enough history", not broken */
.seg .btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Stack the instrument groups BEFORE their contents compress (review: at
   ~900px labels truncated and punchcard captions wrapped). */

/* Four stacked severity grids in the Findings card */
.ov2-punch-stack { display: flex; flex-direction: column; gap: 8px; }
.ov2-punch-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: center; }
.ov2-punch-label { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; text-align: right; }
.ov2-punch-label.sev-crit { color: var(--sev-critical); }
.ov2-punch-label.sev-high { color: var(--sev-high); }
.ov2-punch-label.sev-med { color: var(--sev-medium); }
.ov2-punch-label.sev-ok { color: var(--sev-ok); }
.ov2-punch-row .ov2-punchcard.year { gap: 1.5px; }

/* ── Overview v2 round 5: hero layout, toggle affordance ─────────────────── */
/* Chart clears the headline: offset right, number block owns the left. */
.ov2-hero-trend { left: 26%; width: 74%; }
.ov2-hero-count { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ov2-hero-deltas { flex-direction: column; align-items: flex-start; }
.ov2-hero-tip { top: 42px; left: 50%; right: auto; transform: translateX(-50%); }
.ov2-hero-top { margin-bottom: 6px; }
.ov2-hero { padding: 20px 24px 12px; }

/* Page-level view switches are binary controls, not actions. Keep their labels,
   freshness copy, and tracks on the same optical baseline. */
.ov-page .page-head .actions {
  align-items: center; flex-wrap: wrap; justify-content: flex-end;
}
.ov-head-switch {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--fg-2); font-size: var(--text-xs); line-height: 18px;
}

/* Segmented toggles, app-wide: no boxed group, no joined borders — quiet
   ghost options whose active state reuses the design system's EXISTING
   active recipe (.filter-pill.active: accent-bg fill + accent-border +
   accent text), so on/off is unmistakable without inventing a new style.
   Also covers PersonaToggle and the hero/toolbar segs. */
.seg {
  gap: 2px; padding: 2px; border-radius: 999px;
  background: transparent; border: none;
}
.seg .btn, .seg .btn:first-child, .seg .btn:last-child {
  border: 1px solid transparent; background: transparent; box-shadow: none;
  border-radius: 999px; margin-left: 0; color: var(--fg-3);
}
.seg .btn:hover { background: var(--bg-3); color: var(--fg-1); }
.seg .btn.on, .seg .btn.on:hover {
  border-color: var(--accent-border);
  background-color: var(--accent-bg);
  background-image: linear-gradient(135deg, var(--accent-bg), transparent 70%);
  color: var(--accent);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-control);
}
.seg .btn:disabled { opacity: 0.3; }
.seg .btn:disabled:hover { background: transparent; color: var(--fg-3); }

/* Standalone toolbar toggles share the same active recipe. */

/* Compact dot legend under the balance radial. */

/* ── Overview v2 round 6 ─────────────────────────────────────────────────── */
/* The hero's text rows sat z-above the SVG and ate pointer events — chart
   hover only worked in the uncovered band. Rows pass pointers through;
   links/buttons stay interactive. */
.ov2-hero-top, .ov2-hero-bottom { pointer-events: none; }
.ov2-hero-top :is(a, button), .ov2-hero-bottom :is(a, button) { pointer-events: auto; }

/* Fixed hero height — switching series must not resize the banner. */
.ov2-hero { height: 216px; min-height: 0; }

/* Cards in one row share the row's height (grid stretch); the flip inner
   grid inherits it so both faces fill, feet pinned by margin-top:auto. */

.ovflip-face { height: 100%; }

/* Radial hover tooltip (instant HTML, not the laggy native SVG title). */

/* ── Overview v2 round 7 (feedback distillation) ─────────────────────────── */
/* Maximized card: full grid width, instrument + table side by side. */
.ovflip.is-max { grid-column: 1 / -1; order: -1; }
.ovflip-max-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: 20px; align-items: stretch;
}
.ovflip-max-btn { right: 42px; }
.ovflip.is-max .ovflip-max-btn { right: 14px; }
@container content (max-width: 900px) {
  .ovflip-max-inner { grid-template-columns: minmax(0, 1fr); }
}

/* Legend total replaces the removed ring-center number. */

/* Rail below the sections: full-width card, events flow in columns. */
.ov2-rail { width: 100%; }
.ov2-rail { display: block; column-gap: 24px; }
@container content (min-width: 900px) {
  .ov2-rail { columns: 2; }
  .ov2-rail .eyebrow { column-span: all; }
}
.ov2-rail-row { break-inside: avoid; }

/* Max mode reuses .ovflip-face styling but NOT the flip stacking — each face
   is its own grid column. */
.ovflip-max-inner > .ovflip-face { grid-area: auto; }
.ovflip.is-max .ov2-radial-full { max-width: 220px; }

/* Reveal targets keep breathing room above when scrolled to. */
.ovflip.is-max, .ov2-rail { scroll-margin-top: 16px; }

/* Narrow hero: pills never wrap internally; the row wraps instead. */
.ov2-hero-top { flex-wrap: wrap; row-gap: 6px; align-items: center; }
.ov2-verdict { white-space: nowrap; }

/* Delta lines get a faint backdrop so chart lines can't strike them through. */
.ov2-hero-deltas span {
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  border-radius: var(--radius-sm); padding: 0 4px; margin-left: -4px; width: fit-content;
}

/* Narrow containers: the wrapped toggle rows need the banner to grow —
   clipping the deltas is worse than a taller hero. Desktop stays fixed. */
@container content (max-width: 900px) {
  .ov2-hero { height: auto; min-height: 220px; }
}

/* ── Overview v2 round 8 (review) ────────────────────────────────────────── */
/* Screen-reader-only summary text (grids are decorative behind it). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The compact hero chart no longer runs behind the toggles or chips:
   reserved top band and right inset. */
.ov2-hero-trend { top: 44px; bottom: 6px; right: 10px; height: auto; width: auto; }

/* In the 2-across zone the odd last card spans the row instead of leaving a
   hole; in the 3-across zone all three fit one row and this must not fire. */

/* Radial legend counts (hover is enhancement, not the only precise reading) */

/* ===== PLAYBOOKS (library cards + detail) ===== */
/* The library leads with what applies to this estate, so cards carry counts and
   severity, not just a title. Styles live here rather than inline on the page —
   the old grid was an inline style object, which is why the cards and the drawer
   had drifted to different chip tones for the same effort value. */
.pb-section { margin-bottom: 28px; }
.pb-section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.pb-section-head .card-title { font-size: var(--text-sm); }
.pb-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.pb-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); color: inherit; font: inherit;
  transition: border-color 120ms ease, transform 120ms ease;
}
.pb-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
/* The card's readable body IS the button — the title/chips/why live inside it,
   so a click anywhere on them opens the playbook with no CSS involved. The
   footer is a SIBLING, which is what lets its standard codes be real buttons. */
.pb-card-main {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  padding: 0; margin: 0; text-align: left;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.pb-card:has(.pb-card-main:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pb-card-main:focus-visible { outline: none; }
/* Position in the ranked queue — the sort order made visible, since the order
   is the page's actual recommendation. */
.pb-rank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--radius-sm); background: var(--surface-3); color: var(--fg-2);
  font-size: 10px; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums;
}
.pb-card-worklist { color: var(--accent); text-decoration: none; font-size: var(--text-xs); }
.pb-card-worklist:hover { text-decoration: underline; }
.pb-card-stds { display: inline-flex; gap: 6px; flex-wrap: wrap; }
/* A standard code is a control now, not decoration — it opens its explanation. */
.pb-std-btn {
  padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--fg-3); font: inherit; font-size: var(--text-xs);
  border-bottom: 1px dotted var(--border-strong);
}
.pb-std-btn:hover { color: var(--fg-1); border-bottom-color: var(--accent); }
.pb-std-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Chip-shaped variant, for the detail panel's Standards card and the popup's
   sibling switcher. */
.pb-standard-btn { cursor: pointer; font: inherit; }
.pb-standard-btn:hover { border-color: var(--accent); color: var(--fg-1); }
.pb-card-head { display: flex; align-items: center; gap: 8px; }
.pb-card-title { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.pb-card-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* Clamped so a long "why" cannot make one card tower over its row. */
.pb-card-why {
  font-size: var(--text-xs); line-height: var(--leading-relaxed);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pb-card-foot {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--fg-3); margin-top: auto;
}
.pb-facet { max-width: 220px; }
/* The standards facet carries "ASI09 — Human-Agent Trust Exploitation", not a
   bare code, so it needs more room than the provider facet beside it. The open
   popup sizes to its content; this is the CLOSED control's width. */
.pb-facet.wide { max-width: 340px; }
.pb-count { margin-left: auto; font-size: var(--text-xs); }

.pb-prose { font-size: var(--text-sm); color: var(--fg-2); line-height: var(--leading-relaxed); }
.pb-standards { display: flex; gap: 6px; flex-wrap: wrap; }
.pb-step { margin-bottom: 18px; }
.pb-step:last-child { margin-bottom: 0; }
.pb-step-title { font-weight: var(--weight-semibold); font-size: var(--text-sm); margin-bottom: 4px; }
.pb-step-desc { font-size: var(--text-xs); margin-bottom: 8px; line-height: var(--leading-relaxed); }
.pb-cli { position: relative; }
.pb-cli .codeblock { margin: 0; padding-right: 44px; }
.pb-cli-copy { position: absolute; top: 6px; right: 6px; }
.pb-console { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; }
.pb-claim-label { display: block; font-size: var(--text-xs); margin: 12px 0 6px; }
/* `.input` is sized for a toolbar field; a proof textarea has to fill the modal. */
#pb-claim-justification { width: 100%; min-height: 72px; resize: vertical; }
.pb-claim-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Facts cards (instance, GCE, database details): two responsive columns instead of one
   full-width column of short rows. The title spans both. */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 32px; }
.facts-grid > .card-title { grid-column: 1 / -1; }

/* Summary card: entities read as chips, the rest as plain sentences. */

.story-entity {
  font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  white-space: nowrap;
}
[data-theme="light"] .story-entity { background: rgba(10,20,40,0.06); }
/* Overview top, one frame with the graph: a one-line status strip, a row of summary cards, then the graph. */
.eo-bar {
  display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  font-size: 12.5px;
}
.eo-bar-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-4); margin-right: 4px; }
.eo-bar-top { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 260px; }
.eo-bar-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.eo-bar-actions { display: inline-flex; gap: 8px; margin-left: auto; }
.eo-bar-counts { display: inline-flex; gap: 0; white-space: nowrap; }
button.eo-bar-title { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
button.eo-bar-title:hover, button.eo-bar-title:focus-visible { text-decoration: underline; }
/* A header key chip's copy button: icon-only, inherits the chip's colour. */
.chip-copy { display: inline-flex; padding: 0; margin-left: 4px; border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; }
.chip-copy:hover, .chip-copy:focus-visible { opacity: 1; }
.chip-copy svg { width: 11px; height: 11px; }
.eo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 10px; }
.eo-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; color: inherit; cursor: default;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px;
}
/* A summary card lights its path on the graph while pointed at (StorySummary.tsx); a click does nothing. */
.eo-card:hover, .eo-card:focus-visible { border-color: var(--accent); outline: none; }
.eo-card.is-empty { background: transparent; border-style: dashed; }
.eo-card.is-empty .story-points { color: var(--fg-3); }
.eo-card.is-empty:hover { border-color: var(--border); }
.eo-card[aria-pressed="true"] { background: var(--accent-soft, rgba(255,255,255,0.06)); border-color: var(--accent); }
.story-points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.45; }
.story-points li { position: relative; padding-left: 12px; }
.story-points li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--fg-4); }
.eo-card { min-width: 0; }
.eo-card .story-entity { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.eo-card.is-risk { border-color: var(--risk, var(--sev-critical)); background: color-mix(in srgb, var(--risk, var(--sev-critical)) 8%, var(--surface)); }
.eo-card.risk-critical { --risk: var(--sev-critical); }
.eo-card.risk-high { --risk: var(--sev-critical); }
.eo-card.risk-medium { --risk: var(--sev-medium); }
.eo-card.risk-low { --risk: var(--sev-low); }
.eo-card.is-risk .eo-card-label { color: var(--risk, var(--sev-critical)); }
.eo-card-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
.eo-notes { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin: -2px 0 10px; }

/* ── Overview drawn from a preset (ADR-40) ───────────────────────────────── */
/* Sections stack like the old main column; a row is a 12-column grid that wraps at 12 columns,
   and its cards share the row's height as the instrument groups did. */
.ovp-section { display: flex; flex-direction: column; gap: var(--d-section-gap); min-width: 0; }
.ovp-section-head {
  margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--fg-2);
  letter-spacing: 0.02em;
}
.ovp-row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--d-section-gap); align-items: stretch;
}
.ovp-card { min-width: 0; display: flex; flex-direction: column; }
.ovp-card > * { flex: 1 1 auto; }
.ovp-span-3 { grid-column: span 3; }
.ovp-span-4 { grid-column: span 4; }
.ovp-span-6 { grid-column: span 6; }
.ovp-span-8 { grid-column: span 8; }
.ovp-span-12 { grid-column: span 12; }
.ovp-card > .ovflip, .ovp-card > .ovflip .ovflip-inner { height: 100%; }
/* A maximized instrument takes the row and leads it, as in the old groups. */
.ovp-card:has(> .ovflip.is-max) { grid-column: 1 / -1; order: -1; }
/* Keep cards at the old instrument minimum (340px) before they compress: four 3-column cards fit
   down to 1420px, three 4-column cards down to 1060px; below that a card takes half the row, and
   below 760px all of it. */
@container content (max-width: 1420px) {
  .ovp-row > .ovp-span-3 { grid-column: span 4; }
}
@container content (max-width: 1060px) {
  .ovp-row > .ovp-span-3, .ovp-row > .ovp-span-4, .ovp-row > .ovp-span-8 { grid-column: span 6; }
}
@container content (max-width: 760px) {
  .ovp-row > .ovp-card { grid-column: 1 / -1; }
}
.ovp-placeholder, .ovp-locked, .ovp-loading { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.ovp-placeholder .muted { font-size: var(--text-xs); }
/* The View menu and per-card display switches (T-091026-a2e40793). */
.ovp-view-menu { padding: 12px 14px; min-width: 260px; display: flex; flex-direction: column; gap: 6px; }
.ovp-view-row { justify-content: space-between; width: 100%; }
.ovp-view-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.ov2-actions-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ovp-display-switch .btn { padding-inline: 8px; }
/* A short viewport still reaches every switch and the actions: the menu scrolls inside itself. */
.ovp-view-menu { max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
/* Admin → Overview: the workspace default preset (T-071026-4a16e63c). */
.ovs-list { border: 0; margin: 0; padding: 4px 0; display: grid; gap: 6px; }
.ovs-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-subtle); cursor: pointer; }
.ovs-row.on { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, transparent); }
.ovs-name { color: var(--fg-1); font-weight: 500; }
.ovs-scope { font-size: var(--text-xs); }
.ovs-current { font-size: var(--text-2xs); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.ovs-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; }
.ovs-actions { display: inline-flex; gap: 8px; }
/* Admin → Governance: a switch beside its name and description. */
.gvs-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.gvs-desc { margin: 2px 0 0; font-size: var(--text-sm); }
/* Spans a short row's last card widens to (PresetCards packRows). */
.ovp-span-5 { grid-column: span 5; }
.ovp-span-7 { grid-column: span 7; }
.ovp-span-9 { grid-column: span 9; }
.ovp-span-10 { grid-column: span 10; }
.ovp-span-11 { grid-column: span 11; }

/* Tap targets of at least 32px on a phone. */
@media (max-width: 640px) {
  .iconbtn { width: 36px; height: 36px; }
  .btn { min-height: 32px; }
  .sidebar .nav-item { min-height: 36px; }
}

/* The one instant tooltip (components/atoms/TipLayer.tsx): any element with a data-tip. */
.app-tip {
  position: fixed; z-index: calc(var(--z-modal) + 10); pointer-events: none; max-width: 280px;
  padding: 5px 9px; border-radius: 6px; font-size: 11.5px; line-height: 1.4; white-space: normal;
  /* A matched pair in both themes: the foreground colour as the fill. */
  background: var(--fg-1); color: var(--fg-inverse);
}

/* ToolbarSelect (components/atoms/ToolbarSelect.tsx): a labelled select in a toolbar. */
.toolbar-select { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--fg-3); }
/* Sized to the chosen value's usual length, not the longest option's: a 220px select pushed the Findings toolbar onto three rows. */
.toolbar-select .input { height: 30px; padding: 0 8px; min-width: 0; max-width: 130px; }
/* An icon in place of the label (ToolbarSelect `icon`): the label is its name and its tooltip. */
.toolbar-select.has-icon { gap: 4px; }
.toolbar-select-icon { display: inline-flex; color: var(--fg-3); }
.toolbar-select-icon svg { width: 14px; height: 14px; }

/* A summary tile with an action is a button: it keeps the tile's look and takes the keyboard. */
button.metric-card-action { font: inherit; color: inherit; text-align: left; width: 100%; }
button.metric-card-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Risk types (components/overview/riskTypes.tsx): shared by Overview, Findings, Remediations, Policies and
   Agents rows, so global; in overview.css they reached only pages that had loaded the Overview's chunk. */
.sig { display: inline-flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.sig-c { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-default); color: var(--fg-2); max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-more { font-size: 10.5px; color: var(--fg-3); }
/* Icons wrap inside their column rather than being cut at its edge. */
.sig-icons { display: inline-flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; align-items: center; max-width: 100%; }
.sig-i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border-default); color: var(--fg-2); }
.sig-i svg { width: 12px; height: 12px; }
.risk-type-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* What a finding is about (components/AffectedCell.tsx), on one line: a long name is cut, the type chip stays. */
.affected-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 15em; min-width: 0; white-space: nowrap; }
.affected-cell .affected-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.affected-cell .chip { flex: none; }

/* A time and its age on one line (components/atoms/When.tsx). */
.when { white-space: nowrap; }

/* A connect guide's summary from docs/external (components/ConnectGuide.tsx). */
.connect-guide { background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: var(--radius-lg); padding: 12px 16px; font-size: 12px; color: var(--fg-2); }
.connect-guide-head { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--accent); margin-bottom: 6px; }
.connect-guide-text { margin: 0 0 6px; line-height: 1.6; }
.connect-guide-steps { margin: 0 0 6px; padding-left: 18px; line-height: 1.7; }

/* Sources: the connect cards, three across; one column on a phone, where three clipped their text. */
.connect-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.connect-grid .section-card { min-width: 0; }
.connect-grid .section-card > div { min-width: 0; }
@media (max-width: 900px) { .connect-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .connect-grid { grid-template-columns: 1fr; } }

/* A playbook command filled from a finding (lib/playbookFill.ts): its values marked, unfilled placeholders visible. */
.codeblock .pb-filled { background: var(--accent-bg); color: var(--fg-1); border-radius: 3px; padding: 0 2px; }
.codeblock .pb-placeholder { color: var(--sev-medium, var(--accent)); font-weight: var(--weight-semibold); }
/* The policy builder's "Applies to" help in the side rail: what you can check, fact → the sources that report it. */
.kind-rail-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.kind-rail-table th { text-align: left; font-weight: 600; color: var(--fg-2); border-bottom: 1px solid var(--border); padding: 4px 6px 4px 0; }
.kind-rail-table td { vertical-align: top; border-bottom: 1px solid var(--border); padding: 4px 6px 4px 0; overflow-wrap: anywhere; }
/* The policy builder's value picker: chosen values as chips beside the box that adds more. */
.value-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.value-chips .chip-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; }
/* The policy builder's rule, read as sentences: the summary on top, then "when all of these are true:" rows. */
.policy-builder .rule-summary { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--accent-border); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--accent-bg); }
.policy-builder .rule-summary p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.policy-builder .cond-group-head, .policy-builder .cond-group-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.policy-builder .cond-group.is-nested { margin-left: 18px; padding-left: 10px; border-left: 2px solid var(--border); }
.policy-builder .cond-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.policy-builder .cond-row.is-readonly { color: var(--fg-2); }
.policy-builder .cond-bullet { width: 10px; color: var(--fg-3); }
.policy-builder .cond-more { position: relative; }
.policy-builder .cond-more > summary { cursor: pointer; list-style: none; }
.policy-builder .cond-more > summary::-webkit-details-marker { display: none; }
.policy-builder .cond-more-menu { position: absolute; z-index: 5; right: 0; display: grid; gap: 6px; min-width: 200px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
/* Ask Val beside the policy builder: the form keeps its width; the chat docks on the right, below it when narrow. */
.policy-builder .builder-body.has-chat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 16px; align-items: start; }
.policy-builder .builder-main { min-width: 0; }
.policy-builder .builder-chat { position: sticky; top: 12px; display: flex; flex-direction: column; height: min(640px, calc(100vh - 140px)); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.policy-builder .builder-chat-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.policy-builder .builder-chat-head .iconbtn { margin-left: auto; }
.policy-builder .chat-proposal { display: grid; gap: 4px; margin-top: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
@media (max-width: 900px) {
  .policy-builder .builder-body.has-chat { grid-template-columns: minmax(0, 1fr); }
  .policy-builder .builder-chat { position: static; height: 480px; }
}
/* ----- Ask Val answers (ask_val.answer/1 blocks) ----- */
.av-answer { display: flex; flex-direction: column; gap: 10px; }
.av-text p { margin: 0 0 8px; }
.av-text p:last-child { margin-bottom: 0; }
.av-text ul { margin: 0; padding-left: 18px; }
.av-fallback { color: var(--fg-2); }
.av-help {
  display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start;
  padding: 10px 12px; border-radius: var(--radius-md); text-decoration: none;
  background: var(--bg-2); border: 1px solid color-mix(in oklab, var(--border-subtle) 55%, transparent);
  color: var(--fg-1); transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.av-help:hover { background: var(--bg-3); border-color: var(--border-default); }
.av-help-ic { color: var(--accent); display: inline-flex; margin-top: 1px; }
.av-help-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.av-help-title { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.av-help-sec { color: var(--fg-2); font-weight: var(--weight-regular); }
.av-help-snip { font-size: var(--text-xs); color: var(--fg-2); line-height: var(--leading-normal); }
.av-help-href { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); overflow-wrap: anywhere; }
.av-notice { font-size: var(--text-xs); line-height: var(--leading-normal); padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-2); color: var(--fg-2); }
.av-notice-warn { border-color: color-mix(in oklab, var(--sev-high) 40%, var(--border-subtle)); color: var(--fg-1); }
.av-notice-muted { color: var(--fg-3); }
.av-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.av-choice { display: flex; flex-direction: column; gap: 8px; }
.av-choice-q { font-size: 13px; }
.av-picks { font-size: 11px; margin-top: 2px; text-align: right; }
.av-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.av-chip { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--fg-3); border: 1px dashed var(--border-default); border-radius: 999px; padding: 2px 8px; align-self: flex-start; }
.av-step { font-size: var(--text-xs); color: var(--fg-3); margin-left: 6px; }
.av-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); color: var(--fg-3); }
.av-receipt-toggle { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.av-receipt { margin-top: 6px; font-family: var(--font-sans); letter-spacing: normal; }
.av-receipt p { margin: 0 0 6px; }
.av-receipt-part h4 { margin: 6px 0 4px; font-size: 11px; font-weight: 600; }
.av-receipt summary { cursor: pointer; margin: 0 0 4px; }
.av-receipt pre { max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0 0 6px; padding: 8px; background: var(--bg-2); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 10px; color: var(--fg-2); }
.av-help-group .av-help-title { text-decoration: none; color: var(--fg-1); }
.av-help-group .av-help-title:hover { text-decoration: underline; }
.av-help-sections { margin: 4px 0 0; padding-left: 16px; font-size: var(--text-xs); line-height: 1.6; }
.av-help-sections a { color: var(--accent); text-decoration: none; }
.av-help-sections a:hover { text-decoration: underline; }

/* Ask Val estate blocks: a count, a list, a route, a finding (components/askval/EstateBlocks.tsx). */
.av-estate { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.av-estate-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--fg-1); }
.av-estate-facts { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-wide); color: var(--fg-3); }
.av-estate-facts .av-partial { color: var(--sev-high); }
.av-estate .metric-card { min-width: 0; }
.av-breakdown { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--text-xs); }
.av-row-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 8px; }
.av-breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border-subtle); }
.av-action-off { color: var(--fg-3); font-size: var(--text-xs); }
.path-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: var(--text-xs); }
.path-step { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; }
.path-step-n { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); padding-top: 2px; text-align: right; }
.path-step-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; min-width: 0; overflow-wrap: anywhere; }
.path-step-edge { color: var(--fg-3); font-family: var(--font-mono); font-size: 10px; }
.path-step a { color: var(--accent); text-decoration: none; }
.path-step a:hover { text-decoration: underline; }
.av-scope { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); }
.av-scope-tool { text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.av-scope-chip { border: 1px solid var(--border-subtle); border-radius: 999px; padding: 1px 7px; background: var(--bg-2); color: var(--fg-2); }

/* MiniTable group heading row (components/table/MiniTable.tsx): quieter than a column header. */
tr.mini-group > th, tr.mini-group > td { font-size: 12px; font-weight: 600; color: var(--fg-3); background: var(--bg-2, transparent); }
/* A collapsible group's heading (ListGroups.collapsible): the whole row toggles, as a framework's category row does. */
.dt-group-toggle { position: sticky; left: 12px; display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.dt-group-toggle:hover { color: var(--fg-1); }
.dt-group-toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
tr.mini-detail > td { padding-top: 0; }

/* Where a Save lives (components/atoms/SaveBar.tsx). A DraftCard's header holds its Save and sticks to the top of
   the view while the card is on screen; clip, not hidden, so the card is not the header's scroll container. A page
   form's FormBar is pinned to the bottom of the view. */
.draft-card, .section-card:has(.draft-head) { overflow: clip; }
.draft-sentinel { height: 0; }
/* The header reaches 12px into the card's side padding, so a stuck header's background has room around its words. */
.section-card > .draft-head { position: sticky; top: 0; z-index: var(--z-sticky); align-items: center; padding: 8px 12px;
  margin: -8px -12px calc(var(--d-stack-lg) + 2px); border-bottom: 1px solid transparent; transition: background 120ms, border-color 120ms; }
.section-card > .draft-head.is-stuck { background: var(--bg-2); border-bottom-color: var(--border);
  box-shadow: 0 8px 12px -10px rgb(0 0 0 / 0.35); }
.draft-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.draft-title .card-title { margin: 0; }
.draft-intro { font-size: 13px; margin-top: 0; }
.draft-stack { display: flex; flex-direction: column; gap: 14px; }
.draft-stack > .section-card { margin-bottom: 0; }
.save-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.save-state { font-size: 12px; color: var(--sev-medium, var(--fg-2)); font-weight: var(--weight-medium); }
.save-note { font-size: 12px; color: var(--fg-3); }
.form-bar { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between;
  gap: 8px 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-2); box-shadow: 0 -6px 14px -10px rgb(0 0 0 / 0.35); }
.form-bar-state { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.form-bar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }

/* The inbox page and the panel's Inbox tab (ADR-30 amendment 2026-11-11). */
/* The one Ask Val button (T-241126-58e6d5e7, components/askval/AskValButton.tsx). Solid fills with the text colour, so
   its mark takes the other tone; quiet is the mark alone among other actions; a count badge rides on the corner. */
.askval-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; box-sizing: border-box;
  height: 28px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--fg-1); font: inherit; font-size: 13px; font-weight: var(--weight-semibold); white-space: nowrap;
  text-decoration: none; cursor: pointer; }
.askval-btn.askval-md { height: 32px; padding: 0 14px 0 10px; gap: 8px; font-size: 14px; }
.askval-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.askval-solid { background: var(--fg-1); border-color: var(--fg-1); color: var(--bg-1); }
.askval-solid:hover { opacity: 0.92; }
.askval-outline { border-color: var(--border-strong); }
.askval-outline:hover, .askval-quiet:hover { background: var(--bg-3); }
.askval-quiet { width: 28px; padding: 0; justify-content: center; background: var(--bg-3); border-color: var(--border-subtle); }
.askval-quiet.askval-md { width: 32px; padding: 0; }
.askval-link { height: auto; padding: 0; gap: 5px; text-decoration: underline; text-underline-offset: 3px; }
.askval-btn.is-off { background: transparent; border-color: var(--border-subtle); color: var(--fg-3); cursor: not-allowed; }
.askval-btn.is-off .askval-mark { opacity: 0.5; }
.askval-mark { display: inline-flex; }
.askval-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 8px; border: 2px solid var(--bg-1); background: var(--sev-critical); color: #fff; font-size: 10px;
  font-weight: var(--weight-semibold); line-height: 12px; display: inline-flex; align-items: center; justify-content: center; }
/* On the round mark-only button the corner sits on the mark: push the badge out along the diagonal, clear of it. */
.askval-quiet .askval-badge { top: -10px; right: -10px; }
@keyframes askval-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }
.askval-bob { animation: askval-bob 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .askval-bob { animation: none; }
}
/* Tab marks (T-111126-01774573): only Needs you is red; Risks and Coverage a plain count; Account a quiet dot. */
.inbox-tab-count { margin-left: 6px; min-width: 16px; padding: 0 5px; border-radius: 8px; font-size: 10px; line-height: 16px;
  background: var(--bg-3); color: var(--fg-1); }
.inbox-tab-count.red { background: var(--sev-critical); color: #fff; }
.inbox-tab-dot { display: inline-block; margin-left: 6px; width: 6px; height: 6px; border-radius: 3px; background: var(--fg-2); }
.inbox-views { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.inbox-bar { justify-content: space-between; }
.inbox-bar .inbox-views { margin-bottom: 0; }
.inbox-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0; font-size: var(--text-xs); }
/* Every row shares the list's three columns (subgrid): the severity column is as wide as the widest severity, the
   title column the same width on every row, and the actions right-aligned in one column, so Done and Snooze line up
   whatever the action button says. In a narrow page (a phone, or beside the pinned panel) a row stacks: severity, then the
   title, then the actions. */
.inbox-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; }
.inbox-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: 10px; align-items: baseline; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.inbox-row > :first-child { justify-self: start; }
@container content (max-width: 640px) {
  .inbox-list { display: block; }
  .inbox-row { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .inbox-row .inbox-actions { flex-wrap: wrap; justify-content: flex-start; }
}
.inbox-row.read { opacity: .7; }
.inbox-row.current { background: var(--accent-bg); outline: 1px solid var(--accent-border); }
.inbox-title { flex: 1; min-width: 0; }
.inbox-impact, .inbox-action, .inbox-meta { display: block; font-size: var(--text-xs); }
.inbox-action { color: var(--fg-1); }
.inbox-meta { display: flex; gap: 8px; align-items: center; }
.inbox-tier { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.inbox-row.resolved { opacity: .6; }
.inbox-row.resolved .inbox-title a { color: var(--fg-3); }
.inbox-actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
/* Snooze is the list's own dropdown (.dt-menu/.dt-pop, components/table/table.css): the trigger stays pressed while
   its menu is open, so the two read as one. */
.snooze-choices { display: inline-flex; }
.snooze-choices > .btn[aria-expanded="true"] { background: var(--bg-3); color: var(--fg-1); }
.snooze-menu { min-width: 180px; }

/* ── Risk and Reach (RiskReach.tsx, T-181126-e76dfd9c) ─────────────────────────────────────────────────────────
   The verdict: band and one sentence, the three axes by their drivers, one fix, the reasoning behind "Why". Then the
   reach: one trunk per identity the tools run as, its data under it, most critical first. */
.rr-verdict { padding: 14px 18px; border-left: 4px solid var(--band, var(--border)); border-radius: 0 var(--r) var(--r) 0; }
.rr-verdict.band-critical, .rr-verdict.band-high { --band: var(--sev-critical); }
.rr-verdict.band-medium { --band: var(--sev-medium); }
.rr-verdict.band-low { --band: var(--sev-low); }
.rr-verdict-head { display: flex; align-items: baseline; gap: 10px; }
.rr-verdict-head p { margin: 0; flex: 1; font-size: 14px; line-height: 1.45; color: var(--fg); }
.rr-findings-link { white-space: nowrap; }
.rr-axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 24px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border-subtle); }
.rr-axis-h { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 4px; }
.rr-axis ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.5; color: var(--fg-2); }
.rr-axis p { margin: 0; font-size: 12px; }
.rr-fix { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.rr-label { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.rr-fix-text { flex: 1; font-size: 13px; line-height: 1.45; color: var(--fg); }
.rr-why { margin-top: 10px; font-size: 12.5px; }
.rr-why summary { cursor: pointer; color: var(--fg-3); }
.rr-why dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; }
.rr-why dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-4); padding-top: 2px; }
.rr-why dd { margin: 0; line-height: 1.5; color: var(--fg-2); }
.rr-why ol, .rr-why ul { margin: 0; padding-left: 18px; }
.rr-trunk { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.rr-node, .rr-tool { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12px; color: var(--fg); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.rr-node.is-root { border-color: var(--accent); color: var(--accent-2); font-weight: 600; }
.rr-node.is-identity { border-color: var(--border-strong); font-weight: 600; }
.rr-node.is-missing { border-style: dashed; color: var(--fg-3); }
.rr-tools { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 2px; border: 1px dashed var(--border); border-radius: 8px; }
.rr-tool { border-color: transparent; background: var(--surface-2); }
.rr-arrow { color: var(--fg-4); }
/* A row another view pointed at (a finding's target, a target's finding). */
tr.is-pointed > td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
tr.is-pointed > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ── A finding explained under its row (FindingExplain.tsx) ── */
.finding-explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; padding: 6px 4px 4px; }
.finding-explain h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.finding-explain p, .finding-explain ol { margin: 0 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--fg-2); }
.finding-explain ol { padding-left: 18px; }
.finding-explain-rated { color: var(--fg-3); }
/* Standards by standard: the name once, then its codes. */
.std-groups { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; }
.std-group { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.std-group-name { color: var(--fg-3); margin-right: 2px; }
.std-code { padding: 0 5px; border: 1px solid var(--border); border-radius: 4px; font-size: 11px; color: var(--fg-2); }
/* The standards a tab's current findings map to. */
.std-strip { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; padding: 0 16px 12px; }
.std-strip-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.rr-bare { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border-subtle); }
/* The blast radius: the drawing (BlastTree.tsx) beside its table, the lines ending in the rows. Narrow, the table alone
   with each route as its group's heading. Narrow is the card's own width, not the window's: the drawing takes 40% of
   it and draws nothing under BLAST_MIN_WIDTH (200px), so below 500px it gives way. Whenever the drawing cannot draw,
   the card carries .is-undrawn and the route headings show. */
.rr-blast { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); align-items: start; container: rr-blast / inline-size; }
.rr-blast-table { grid-column: 2; grid-row: 1; min-width: 0; overflow-x: auto; }
.rr-blast-draw { grid-column: 1; grid-row: 1; min-width: 0; }
.rr-blast-table .mini-group:has(.rr-trunk) { display: none; }
.rr-blast.is-undrawn .rr-blast-table .mini-group:has(.rr-trunk) { display: table-row; }
.rr-type { display: block; font-size: 11px; color: var(--fg-4); }
@container rr-blast (max-width: 499px) {
  .rr-blast-table { grid-column: 1 / -1; }
  .rr-blast-draw { display: none; }
  .rr-blast-table .mini-group:has(.rr-trunk) { display: table-row; }
}
.bt { display: block; overflow: visible; }
.rr-fold { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.rr-fold:hover { color: var(--accent-2); }
.rr-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
tr.is-fold > td { background: var(--bg-2, transparent); }
tr.is-member > td:first-child { box-shadow: inset 3px 0 0 var(--border-strong); }
.section-card-head:has(.rr-fold-all) > .card-sub { margin-left: auto; }
.bt-node rect { fill: var(--surface); stroke: var(--border-strong); }
.bt-node text { font-size: 11.5px; fill: var(--fg); }
.bt-node.is-root rect { stroke: var(--accent); }
.bt-node.is-root text { fill: var(--accent-2); font-weight: 600; }
.bt-node.is-identity rect { stroke: var(--fg-3); stroke-width: 1.5; }
.bt-node.is-identity text { font-weight: 600; }
.bt-node.is-tool rect { fill: var(--surface-2); stroke: var(--border); }
.bt-node.is-link { cursor: pointer; }
.bt-node.is-link:hover rect { stroke: var(--accent); }
.bt-link { fill: none; stroke: var(--fg-4); stroke-width: 1.25; }
.bt-fan { fill: none; stroke: var(--sev-low); opacity: .75; cursor: pointer; transition: opacity .12s ease; }
.bt-fan.crit-critical { stroke: var(--sev-critical); }
.bt-fan.crit-high { stroke: var(--sev-high); }
.bt-fan.crit-medium { stroke: var(--sev-medium); }
.bt-fan.crit-unknown { stroke: var(--fg-4); stroke-dasharray: 4 3; }
.bt-fan.is-dim { opacity: .18; }
.bt-fan.is-hot { opacity: 1; }
.bt-more { font-size: 11px; fill: var(--fg-3); }
.bt-col { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; fill: var(--fg-4); }
/* The line at the top of a tab that leads to the next (DetailShell's NextTab). */
.next-tab-label { border: 0; background: none; padding: 0; cursor: pointer; }
.next-tab-label:hover, .next-tab-label:focus-visible { color: var(--accent-2); }
.next-tab-msg { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; flex: 1 1 260px; min-width: 0; font-size: 13px; }
.next-tab-go { margin-left: auto; }
/* A second line in a Findings cell (an exception's review date). */
.inv-findings-sub { display: block; font-size: 11px; }
/* Short cells that read as one token: a ticket key, an age. */
.inv-findings-one { white-space: nowrap; }
/* A name in prose that opens its page (NamedText): the text colour, underlined, so a sentence still reads as one. */
.named-link { color: inherit; text-decoration: underline; text-decoration-color: var(--fg-4); text-underline-offset: 2px; }
.named-link:hover { color: var(--accent-2); text-decoration-color: currentColor; }
.rr-more { font-size: 12px; margin-top: 2px; }
/* A chip that is a button (it opens what explains it): no button chrome of its own. */
button.chip-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* The console's one density (T-171126-935372a0, standardised in T-171126-849135f4). lib/density.ts sets
   data-density on <html>; this file is the only place that reads it (lib/density.test.ts fails any other).

   Two layers, like a base class and its subclasses:
   1. Tokens. Every size that differs between the densities is a --d-* token, set here once for comfortable and
      once for compact. Base building blocks (cards, rows, cells, tiles, tabs, stats) read the tokens in their own
      rules, so a component built from them, or reading a token, gets both densities without a rule of its own.
   2. Roles. A component whose compact form differs in shape, not just size, adds a role class from the list
      below; the role, not the component, says what compact does.

   A component either uses tokens and roles, or does not change (a chart, a graph, an instrument). It never
   writes a [data-density] or compact-only selector. */

:root {
  --d-page-pad: 8px 24px 40px;
  --d-page-x: 24px;         /* a page's side inset, shared by the sub-header so Back and the trail line up with the content */
  --d-head-gap: 18px;       /* under a page header */
  --d-page-title: var(--text-3xl);
  --d-head-title: var(--text-xl); /* a detail page's record name */
  --d-logo: 48px;           /* a detail page's record logo */
  --d-block-gap: 16px;      /* between stacked cards and bands */
  --d-section-gap: 22px;    /* between Overview sections and card rows */
  --d-card-pad: 16px 18px;  /* a card */
  --d-tile-pad: 14px;       /* a tile inside a card: a stat, a pillar, a pattern card */
  --d-gap: 14px;            /* between tiles */
  --d-stack: 4px;           /* between the lines stacked in one row or tile */
  --d-stack-lg: 10px;       /* between the blocks stacked in one card */
  --d-row-y: 7px;           /* a list row's vertical padding */
  --d-row-y-lg: 11px;       /* a roomy list row (Top actions) */
  --d-row-y-sm: 5px;        /* a fact row inside a tile */
  --d-tab-y: 9px;           /* a tab */
  --d-cell-y: 12px;         /* a table cell */
  --d-cell-x: 14px;
  --d-col-gap: 14px;        /* between a row's columns */
  --d-text: 13px;           /* row text */
  --d-title: 16px;          /* a tile's title */
  --d-value: 28px;          /* a tile's headline number */
  --d-stat-value: 26px;
  --d-icon: 26px;           /* a row's icon, a rank badge */
  --d-bar: 22px;            /* a bar with its value inside */
  --d-clamp: 3;             /* lines of prose before "More" */
  --d-list-h: 320px;        /* a bounded list's body */
  --d-card-h: 440px;        /* paired list cards */
}
:root[data-density="compact"] {
  --d-page-pad: 4px 18px 28px;
  --d-page-x: 18px;
  --d-head-gap: 10px;
  --d-page-title: var(--text-2xl);
  --d-head-title: var(--text-lg);
  --d-logo: 34px;
  --d-block-gap: 12px;
  --d-section-gap: 14px;
  --d-card-pad: 12px 14px;
  --d-tile-pad: 9px;
  --d-gap: 8px;
  --d-stack: 2px;
  --d-stack-lg: 6px;
  --d-row-y: 3px;
  --d-row-y-lg: 5px;
  --d-row-y-sm: 1px;
  --d-tab-y: 3px;
  --d-cell-y: 5px;
  --d-cell-x: 10px;
  --d-col-gap: 10px;
  --d-text: 12.5px;
  --d-title: 14px;
  --d-value: 20px;
  --d-stat-value: 22px;
  --d-icon: 22px;
  --d-bar: 16px;
  --d-clamp: 1;
  --d-list-h: 300px;
  --d-card-h: 400px;
}

/* Roles: what compact does to a part whose shape changes. Comfortable is the component's own layout. */
/* d-row: the children sit on one line (they stack or wrap when comfortable). */
:root[data-density="compact"] .d-row { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
:root[data-density="compact"] .d-row > :not(.d-line) { flex: none; }
/* An opened disclosure inside a d-row ("+12 more") gets its room back. */
:root[data-density="compact"] .d-row:has([aria-expanded="true"]) { flex-wrap: wrap; white-space: normal; }
:root[data-density="compact"] .d-row:has([aria-expanded="true"]) > .d-line { white-space: normal; overflow: visible; }
/* d-line: one line, cut with an ellipsis. */
:root[data-density="compact"] .d-line { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* d-aside: comfortable only; compact carries it in the row's hover title or drops it. */
:root[data-density="compact"] .d-aside { display: none; }
/* d-pair: a name (its first child) and what follows it (a d-sub, labelled values), on one line when the name keeps
   10em and a d-sub 8em (labelled values keep their own width), else the rest on the next line (never "Com…"); in a
   narrow container (d-narrow, or 420px) the d-sub is dropped. */
:root[data-density="compact"] .d-pair { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 1px; min-width: 0; }
:root[data-density="compact"] .d-pair > :first-child { flex: 1 1 0; min-width: min(10em, 100%); }
:root[data-density="compact"] .d-pair > :not(:first-child) { flex: 0 1 auto; min-width: 0; }
:root[data-density="compact"] .d-pair > .d-sub { flex: 1 1 0; min-width: min(8em, 100%); }
/* A d-key labels the value after it: it keeps its own width and the value follows it. */
:root[data-density="compact"] .d-pair > .d-key { flex: none; min-width: 0; }
:root[data-density="compact"] .d-narrow .d-sub { display: none; }
@container (max-width: 420px) { :root[data-density="compact"] .d-sub { display: none; } }
/* d-inline: a label or second line that runs inline with its text. */
:root[data-density="compact"] .d-inline { display: inline; margin: 0 0.4em; }
/* d-cols: a card body of one-line facts flows into columns, so the card is about half as tall; a disclosure
   (details) keeps the full width. */
:root[data-density="compact"] .d-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(18em, 1fr)); column-gap: 16px; row-gap: 2px; align-items: baseline; }
:root[data-density="compact"] .d-cols > * { margin-top: 0; min-width: 0; }
:root[data-density="compact"] .d-cols > details { grid-column: 1 / -1; }
/* d-clamp: prose clamped to --d-clamp lines. */
.d-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--d-clamp); overflow: hidden; }
/* d-cell: a small table's cell, at most two lines, its second line inline. */
:root[data-density="compact"] .d-cell { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
:root[data-density="compact"] .d-cell .d-inline, :root[data-density="compact"] .d-cell .c-sub { display: inline; margin: 0 0 0 0.4em; }

/* d-table, and every list (DataTable, not its narrow card layout): one line a row, each cell cut with an ellipsis.
   The second line under a name (.id, .sub) is the list's d-aside. */
:root[data-density="compact"] .dt:not(.dt-narrow) .dt-table td,
:root[data-density="compact"] .dt:not(.dt-narrow) .dt-table th { padding-top: 3px; padding-bottom: 3px; white-space: nowrap; }
/* Not the selection cell: its 36px width is what the pinned first column's offset counts on (table.css). */
:root[data-density="compact"] :is(.dt:not(.dt-narrow) .dt-table, .d-table) td:not(.dt-sticky-select) { max-width: 36ch; overflow: hidden; text-overflow: ellipsis; }
:root[data-density="compact"] .d-table :is(td, th) { white-space: nowrap; }
/* A cell's own blocks (a list of targets) are cut the same way, each on its line. */
:root[data-density="compact"] :is(.dt:not(.dt-narrow) .dt-table, .d-table) td > div { overflow: hidden; text-overflow: ellipsis; }
:root[data-density="compact"] .dt:not(.dt-narrow) .dt-table td .id,
:root[data-density="compact"] .dt:not(.dt-narrow) .dt-table td .sub { display: none; }

/* ============ Valkan console — Valkan design system ============
   Tokens (dark default + light mode + legacy compat aliases) live in
   styles/tokens.css. Both entry points (main.tsx and main-endpoint.tsx)
   import only this file, so the @imports below are the single load path. */



* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
/* Scrollbar styling comes from tokens.css (token-driven, theme-aware). */

/* Shell layout (app grid, sidebar, subhead, content) lives in styles/chrome.css. */

.icon-btn { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--fg-2); }
.icon-btn:hover { background: var(--hover); }

/* ============ Generic UI ============ */
/* Segmented control. */
.seg {
  display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.seg-btn {
  font-size: 12px; padding: 4px 12px; border: 0; border-radius: 6px;
  background: transparent; color: var(--fg-3); cursor: pointer; white-space: nowrap;
}
.seg-btn:hover { color: var(--fg-2); background: var(--surface-3); }
.seg-btn.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }

/* .card/.card-header/.card-body were pre-Valkan leftovers shadowing
   chrome.css's .section-card/.section-card-head — removed; all detail-view
   call sites migrated to .section-card. .card-title/.card-sub survive
   (chrome.css styles .card-title as a .section-card child; .card-sub has
   no cascade duplicate). */
.card-title { font-weight: 600; letter-spacing: -0.01em; font-size: 13px; }
.card-sub { color: var(--fg-3); font-size: 12px; }

/* ============ Overview page ============ */
/* 8px above: the title is in the breadcrumb row just above, so the content starts high (T-141026-c5e8249e). */
.page { padding: var(--d-page-pad); max-width: 1640px; margin: 0 auto; }
.page-header { display: flex; align-items: end; gap: 16px; margin-bottom: 18px; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.page-sub { color: var(--fg-3); font-size: 13px; margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* .stat-grid comes from chrome.css (4-col Valkan grid). */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--d-tile-pad);
  display: flex; flex-direction: column; gap: calc(var(--d-stack) + 4px);
  cursor: pointer;
  transition: all .15s ease;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.stat.active { border-color: var(--accent-border); background: linear-gradient(180deg, var(--accent-bg) 0%, var(--bg-2) 60%); }
.stat-row { display: flex; align-items: center; gap: 8px; }
.stat-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--surface-3); color: var(--fg-2);
  display: grid; place-items: center;
}
.stat-icon.accent { background: var(--accent-soft); color: var(--accent); }
.stat-icon.amber { background: var(--risk-medium-bg); color: var(--risk-medium); }
.stat-icon.red { background: var(--risk-critical-bg); color: var(--risk-critical); }
.stat-icon.green { background: var(--risk-low-bg); color: var(--risk-low); }
.stat-icon.violet { background: color-mix(in srgb, var(--viz-4) 14%, transparent); color: var(--viz-4); }
.stat-icon.teal { background: color-mix(in srgb, var(--viz-6) 14%, transparent); color: var(--viz-6); }
.stat-label { color: var(--fg-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
/* margin-top:auto bottom-aligns the value+delta so a wrapped 2-line label
   (e.g. "Excessive permissions") doesn't shift the number relative to its
   single-line neighbours in the same grid row. */
.stat-value { font-size: var(--d-stat-value); font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin-top: auto; }
.stat-delta { font-size: 11px; color: var(--fg-3); margin-top: 2px; display: flex; gap: 4px; align-items: center; }
.stat-delta.up { color: var(--risk-low); }
.stat-delta.down { color: var(--risk-critical); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

/* ============ AI Agents page ============ */
.agents-shell { display: grid; grid-template-columns: 1fr; height: 100%; }

.list-search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg-3);
  background: var(--surface);
}
.list-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12px; }

/* Inventory table */
.inv-wrap { padding: 8px 20px 40px; min-width: 0; } /* a grid item: let .tbl-wrap scroll, not the page; 8px above, as .page */

/* Tables (.tbl-wrap/.tbl) come from chrome.css (glass table). */

.cell-agent { display: flex; align-items: center; gap: 10px; }
.cell-agent > :not(.platform-pill) { min-width: 0; }
/* A name cut by its column ends in an ellipsis (one-line compact lists cut it; comfortable wraps it). */
.cell-agent .nm { font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
/* A person row's "N linked" toggle: a chip that is a button (expands the accounts under the row). */
.cell-agent .linked-chip { margin-left: 6px; cursor: pointer; font: inherit; font-size: 11px; }
/* A long key is cut with an ellipsis (the whole key is the title), so it never squeezes the platform pill. */
.cell-agent .id {
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-4);
  max-width: 44ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.platforms { display: flex; gap: -4px; }
.platform-pill {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--surface);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  margin-left: -4px;
}
.platform-pill:first-child { margin-left: 0; }
.platform-pill.more { background: var(--fg-1); color: var(--fg-inverse); font-size: 9px; }

.pagination {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  font-size: 12px; color: var(--fg-3);
}
.pager { display: flex; gap: 4px; }
.pager .pg { height: 26px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; white-space: nowrap; border: none; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.pager button.pg:disabled { opacity: 0.4; cursor: default; }
.pager .pg:hover:not(:disabled) { background: var(--hover); }

/* ============ Agent Detail ============ */
/* .detail-shell/.detail-head/.det-logo/.det-info/.status-select/
   .detail-tabs/.detail-body/.detail-grid were pre-Valkan leftovers here,
   shadowing chrome.css's correctly-styled versions (48px glossy .det-logo,
   pill-shaped .status-select, etc.) — removed. chrome.css's .detail-grid
   is now the sole definition (minmax(0,1fr) 300px); its `> *` min-width:0
   and narrow-viewport collapse still need porting if not already present —
   verify visually. */

/* Identity graph */
.graph-card { padding: 0; overflow: hidden; }
.graph-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.graph-toolbar .spacer { flex: 1; }
.graph-canvas {
  position: relative;
  height: 360px;
  overflow: auto;
  background:
    radial-gradient(circle at 1px 1px, var(--border-default) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface);
}
/* Fixed-size inner stage: the SVG connectors (.glines) and the node divs
   (.gnode) are positioned in this one 1000x360 space, so they always align.
   The .graph-canvas scrolls when the viewport is narrower than the stage. */
/* The wrap carries the zoom-scaled box size so .graph-canvas scrolls
   correctly; the stage is a fixed 1000x360 and is visually resized by the
   inline `transform: scale()`. */
.graph-stage-wrap { margin: 0 auto; }
.graph-stage {
  position: relative;
  width: 1000px;
  height: 360px;
}

/* Full-screen graph: the card lifts out as a fixed overlay. */
.graph-card.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.graph-card.fullscreen .graph-canvas {
  flex: 1;
  height: auto;
}
.graph-hint {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: var(--fg-4);
  font-family: var(--font-mono);
}

/* The connector SVG shares the node divs' 1000x360 pixel coordinate space.
   It must NOT stretch (no inset:0 / preserveAspectRatio=none) or the lines
   drift away from the nodes. */

/* Side card. .side-row itself now comes from chrome.css only — this file's
   copy shadowed it with a dashed-border, .side-card padding remains here as
   a modifier applied alongside .section-card (e.g. `section-card side-card`). */
.side-card { padding: var(--d-tile-pad); }

/* Risk analysis */
.risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.risk-bar { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.risk-bar .fill { height: 100%; border-radius: 999px; }
.findings-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.findings-table th, .findings-table td { padding: calc(var(--d-row-y) + 1px) 10px; border-bottom: 1px solid var(--border-soft); text-align: left; font-size: 12px; }
.findings-table th { color: var(--fg-3); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; }

/* Remediation */

.remed-status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; background: var(--surface-3); color: var(--fg-2);
}
.remed-status.open { background: var(--risk-medium-bg); color: var(--risk-medium); }
.remed-status.done { background: var(--risk-low-bg); color: var(--risk-low); }
/* Compact remediation rows: one aligned column after the severity chip. */

/* Row is a <button> for keyboard/focus semantics (feedback.md P2) — reset browser chrome. */

.remed-recur { color: var(--risk-high); font-weight: 600; }

.guide {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px;
}
.guide .gh { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; margin-bottom: 6px; color: var(--fg-2); }
.guide p { margin: 0 0 8px; color: var(--fg-2); font-size: 12px; line-height: 1.55; }
.guide ul { margin: 0; padding-left: 18px; color: var(--fg-2); font-size: 12px; }
.guide ul li { margin-bottom: 4px; }
.guide code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; }

.fd-field { display: block; margin-bottom: 12px; font-size: 12px; }
.fd-field > span { display: block; color: var(--fg-4); margin-bottom: 4px; }
.fd-field textarea,
.fd-field input,
.fd-field select {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  color: var(--fg);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  /* Blank the app out behind the dialog: a solid scrim over the overlay tint,
     plus a blur so nothing underneath reads as still-interactive content. In
     dark theme --bg-overlay alone is only ~0.35 alpha and the app showed
     straight through, making the popup look like it floated on top. */
  background: color-mix(in oklab, var(--bg-1) 78%, var(--bg-overlay));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  width: min(440px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
}
/* Simple dialogs put .modal-title straight inside .modal (no header/body/footer
   sections) — those need the modal itself to carry the padding. Sectioned
   modals (.modal > .modal-header/.modal-body) pad their own sections, so scope
   this to the direct-title layout and leave them untouched. */

/* Action row for the simple dialogs (Cancel/confirm). Used by several modals but
   was never defined — buttons rendered unspaced and left-aligned. */
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Tools & actions */
.tools-table { width: 100%; border-collapse: collapse; }
.tools-table th, .tools-table td { padding: calc(var(--d-row-y) + 2px) 12px; border-bottom: 1px solid var(--border-soft); font-size: 12px; text-align: left; }
/* A link inside a small table (not a list, whose whole row opens) reads as a link: accent, underlined on hover. */
.tools-table a, .findings-table a, .ovmini a { color: var(--accent); }
.tools-table a:hover, .findings-table a:hover, .ovmini a:hover { text-decoration: underline; }
.tools-table th { color: var(--fg-3); text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; font-weight: 600; }

/* Endpoint tables: keep long hostnames / IP:port / detail from forcing
   horizontal scroll. Full value stays in the cell's title tooltip + expand drawer. */
.ep-ellip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-ellip-sm { max-width: 150px; }

/* Lifecycle timeline */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.tl-item.critical::before { border-color: var(--risk-critical); }
.tl-item.info::before { border-color: var(--accent); }
.tl-item.ok::before { border-color: var(--risk-low); }
.tl-when { font-size: 11px; color: var(--fg-3); margin-bottom: 2px; }
.tl-what { font-size: 13px; font-weight: 500; }
.tl-who { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* Identity graph SVG line */

/* Distribution chart */

.donut { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .center .v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.donut .center .l { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.06em; }

/* Sparkline */
.spark { display: block; width: 100%; height: 32px; }

/* small util */

.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-3); }

/* Highlight on hover for clickable */
.clickable { cursor: pointer; }

/* ============ frontend-new additions (not in design prototype) ============ */
.center-screen { display: grid; place-items: center; height: 100vh; background: var(--surface-2); }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Indeterminate progress bar — for work with no deterministic length
   (e.g. a running scan). */
.progress-indeterminate {
  height: 3px;
  background: var(--accent-soft);
  overflow: hidden;
}
.progress-indeterminate::after {
  content: "";
  display: block;
  height: 100%;
  width: 38%;
  background: var(--accent);
  border-radius: 2px;
  animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}

/* One-click AWS connect: the live setup panel (AWSOneClickConnect). */
.oc-panel {
  border: 1px solid var(--accent-border);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  overflow: hidden;
}
.oc-panel.is-done { border-color: var(--risk-low); background: var(--risk-low-bg); transition: background 0.4s, border-color 0.4s; }
.oc-panel .oc-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.oc-head { display: flex; align-items: center; gap: 12px; }
.oc-spin { display: inline-flex; flex: none; }
.oc-head .spinner { width: 22px; height: 22px; border-width: 2.5px; flex: none; }
.oc-head .oc-title { font-size: 14px; font-weight: 600; color: var(--fg-1); }
.oc-head .oc-sub { font-size: 12px; color: var(--fg-2); margin-top: 2px; }
.oc-head .oc-elapsed { margin-left: auto; font-size: 12px; color: var(--fg-2); }
.oc-done-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--risk-low); color: var(--bg-0); font-size: 13px; font-weight: 700;
  animation: oc-pop 0.35s ease-out both;
}
.oc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.oc-step { display: flex; align-items: center; gap: 10px; color: var(--fg-1); }
.oc-step[data-state="todo"] { color: var(--fg-3); }
.oc-step .oc-icon { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.oc-step[data-state="todo"] .oc-icon { border: 1.5px solid var(--fg-3); border-radius: 50%; width: 12px; height: 12px; margin: 2px; opacity: 0.6; }
.oc-step[data-state="active"] .oc-icon .spinner { width: 14px; height: 14px; border-width: 2px; }
.oc-step[data-state="done"] .oc-icon { color: var(--risk-low); font-weight: 700; animation: oc-pop 0.3s ease-out both; animation-delay: calc(var(--i, 0) * 120ms); }
.oc-step[data-state="done"] { animation: fade 0.3s ease-out both; animation-delay: calc(var(--i, 0) * 120ms); }
@keyframes oc-pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* The wizard folds away (height and opacity) once a one-click setup finishes. */
.oc-fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.45s ease, opacity 0.35s ease, transform 0.45s ease; }
.oc-fold > * { min-height: 0; overflow: hidden; }
.oc-fold.is-folding { grid-template-rows: 0fr; opacity: 0; transform: translateY(-6px); }

/* A newly connected source: a thin gold outline with a soft glow sweeps in, holds, and fades
   on its own. Cells, not the row: browsers do not paint box-shadow on <tr>. */
.dt-row-new > td { animation: row-new 5s ease-in-out both; }
.dt-row-new > td:first-child { animation-name: row-new-first; }
.dt-row-new > td:last-child { animation-name: row-new-last; }
@keyframes row-new {
  0%, 100% { box-shadow: inset 0 1px 0 transparent, inset 0 -1px 0 transparent; background-color: transparent; }
  12%, 65% { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); background-color: var(--accent-soft); }
}
@keyframes row-new-first {
  0%, 100% { box-shadow: inset 1px 0 0 transparent, inset 0 1px 0 transparent, inset 0 -1px 0 transparent; background-color: transparent; }
  12%, 65% { box-shadow: inset 1px 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); background-color: var(--accent-soft); }
}
@keyframes row-new-last {
  0%, 100% { box-shadow: inset -1px 0 0 transparent, inset 0 1px 0 transparent, inset 0 -1px 0 transparent; background-color: transparent; }
  12%, 65% { box-shadow: inset -1px 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); background-color: var(--accent-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .oc-done-mark, .oc-step, .oc-step .oc-icon { animation: none !important; }
  .oc-fold { transition: none; }
  /* Still marked, without motion: a steady outline for the highlight's few seconds. */
  .dt-row-new > td { animation: none; box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
}

.state-msg { text-align: center; }
.state-msg .t { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.state-msg .s { font-size: 13px; color: var(--fg-3); margin-bottom: 14px; }

.banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin: 0 0 14px;
  font-size: 12px; color: var(--risk-medium);
  background: var(--risk-medium-bg); border-radius: var(--r-sm);
}
.banner.error { color: var(--risk-critical); background: var(--risk-critical-bg); }
.banner.info { color: var(--fg-2); background: var(--surface-2); }
.banner.ok { color: var(--sev-ok); background: var(--sev-ok-bg); }

/* TopBar slots (M1, M2) */
.count-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--surface-3);
  color: var(--fg-2);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  margin-left: 8px;
}
.count-badge .n { color: var(--fg); font-weight: 600; }
.top-action { display: flex; align-items: center; gap: 6px; }

/* Sidebar footer help icon */

/* ============ UI v1 rebuild — atoms ============ */

/* SeverityBadge — uppercase, filled, text-only (no dot). Distinct from .chip */
.sev {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  white-space: nowrap;
}
.sev.critical { background: var(--risk-critical-bg); color: var(--risk-critical); }
.sev.high     { background: var(--risk-high-bg);     color: var(--risk-high); }
.sev.medium   { background: var(--risk-medium-bg);   color: var(--risk-medium); }
.sev.low      { background: var(--risk-low-bg);      color: var(--risk-low); }
.sev.info     { background: var(--risk-info-bg);     color: var(--risk-info); }

/* RiskScorePill — numeric, colored by threshold. Distinct from .chip and .sev */
.risk-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 2px 8px;
  border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px; font-weight: 600; font-family: var(--font-mono);
  border: 1px solid transparent;
}
.risk-pill.high { background: var(--risk-critical-bg); color: var(--risk-critical); }
.risk-pill.mid  { background: var(--risk-medium-bg);   color: var(--risk-medium); }
.risk-pill.low  { background: var(--risk-low-bg);      color: var(--risk-low); }

/* EntityTypeBadge — colored solid pill */
.etype {
  display: inline-block;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px;
  background: var(--fg-1); color: var(--fg-on-color);
  white-space: nowrap;
}
.etype.agent    { background: var(--viz-4); }
.etype.nhi      { background: var(--viz-3); }
.etype.human    { background: var(--viz-7); }
.etype.role     { background: var(--viz-1); }
.etype.oauth    { background: var(--viz-2); }
.etype.finding  { background: var(--risk-critical); }
.etype.policy   { background: var(--fg-2); }
.etype.secret   { background: var(--fg-1); }
.etype.incident { background: var(--risk-high); }
.etype.playbook { background: var(--viz-3); }

/* SurfaceTag — border-only muted pill */

/* ScanFreshnessPill — green/amber/red dot + "Last scan Xm ago" */
/* 42M-407 pass 2: relocated from the sidebar footer (a vertical stack, where
   this margin-bottom spaced it from the next row) to Subhead's top-right
   flex row (`.subhead-chrome`, which already has its own `gap` between
   siblings) — the leftover margin was making align-items:center center the
   MARGIN box, not the content box, pinning the pill to the row's top edge
   instead of its vertical center. */
.scan-pill {
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--fg-2);
}
.scan-pill .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.scan-pill .dot.fresh { background: var(--risk-low); box-shadow: 0 0 0 3px var(--risk-low-bg); }
.scan-pill .dot.stale { background: var(--risk-medium); box-shadow: 0 0 0 3px var(--risk-medium-bg); }
.scan-pill .dot.cold  { background: var(--risk-critical); box-shadow: 0 0 0 3px var(--risk-critical-bg); }
.scan-pill .age { color: var(--fg); font-weight: 500; }
.scan-pill .lbl { color: var(--fg-3); }

/* EmptyState — 48px icon + title + sub + optional action */
.empty {
  text-align: center; padding: 60px 24px;
  background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
}
.empty .empty-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface-3); color: var(--fg-3);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.empty .empty-title { font-weight: 600; margin-bottom: 4px; font-size: 14px; color: var(--fg); }
.empty .empty-sub { color: var(--fg-3); font-size: 12.5px; margin-bottom: 14px; max-width: 420px; margin-left: auto; margin-right: auto; }
.empty .empty-action { margin-top: 4px; }
.empty.planned { border-style: solid; border-color: var(--border); background: var(--surface-2); }

/* Destructive action button — pair with .sm for table rows. */
.btn.danger {
  border-color: var(--risk-critical);
  color: var(--risk-critical);
}
.btn.danger:hover:not(:disabled) { background: var(--risk-critical); color: var(--fg-on-color); }
.btn.danger:disabled { opacity: 0.45; cursor: default; }

/* ============ Small stat rows and "view as" disclosures ============ */
.mini-stats { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }
.mini-stat .v { font-size: 22px; font-weight: 600; font-family: var(--font-mono); letter-spacing: -0.02em; margin-top: 4px; }
/* Text variant — the 22px mono treatment is for short numbers only. */
.mini-stat .v.txt { font-size: 13px; font-weight: 500; font-family: inherit; letter-spacing: normal; margin-top: 8px; }
.viz-fallback > summary { cursor: pointer; font-size: 12px; color: var(--fg-3); padding: 8px 16px; border-top: 1px solid var(--border-soft); user-select: none; }
.viz-fallback[open] > summary { border-bottom: 1px solid var(--border-soft); }

/* In-product external documentation. The HTML is generated from the
   allowlisted Markdown subset by scripts/build_external_docs.py. */
.external-doc-page { max-width: 1100px; }
.external-doc-body { color: var(--fg-2); line-height: 1.65; }
.external-doc-body h1 { color: var(--fg-1); font-size: 26px; letter-spacing: -0.02em; margin: 0 0 10px; }
.external-doc-body .external-doc-summary { color: var(--fg-3); font-size: 14px; margin: -4px 0 18px; }
.external-doc-body h2 { color: var(--fg-1); font-size: 18px; margin: 28px 0 8px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.external-doc-body h3 { color: var(--fg-1); font-size: 14px; margin: 20px 0 6px; }
.external-doc-body p { margin: 0 0 12px; font-size: 13px; }
.external-doc-body ul, .external-doc-body ol { margin: 0 0 14px; padding-left: 22px; font-size: 13px; }
.external-doc-body li { margin: 5px 0; }
.external-doc-body a { color: var(--accent); }
.external-doc-body blockquote { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); }
.external-doc-body code { color: var(--fg-1); background: var(--bg-inset); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 1px 4px; font-family: var(--font-mono); font-size: 11px; }
/* HelpPager: related pages, then previous / next in the Help center's reading order. */
.help-pager { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.help-related-title { color: var(--fg-1); font-size: 14px; margin: 0 0 8px; }
.help-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.help-related li { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.help-related li a { color: var(--accent); }
.help-related li span { color: var(--fg-3); font-size: 12px; }
.help-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help-prevnext-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); text-decoration: none; min-width: 0; }
.help-prevnext-link:hover { border-color: var(--accent-border); }
.help-prevnext-next { text-align: right; }
.help-prevnext-dir { color: var(--fg-3); font-size: 11px; }
.help-prevnext-title { color: var(--fg-1); font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 520px) { .help-prevnext { grid-template-columns: 1fr; } .help-prevnext-next { text-align: left; } }
/* "On this page": a sticky side list beside a long guide on wide screens, a compact wrapped list above it otherwise. */
.external-doc-layout.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; align-items: start; }
.external-doc-layout.has-toc .external-doc-toc { grid-column: 2; grid-row: 1; position: sticky; top: 16px; }
.external-doc-toc { font-size: 12px; }
.external-doc-toc-title { color: var(--fg-3); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.external-doc-toc ul { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 6px; }
.external-doc-toc a { color: var(--fg-2); text-decoration: none; overflow-wrap: anywhere; }
.external-doc-toc a:hover, .external-doc-toc a:focus-visible { color: var(--accent); }
@media (max-width: 960px) {
  .external-doc-layout.has-toc { display: block; }
  .external-doc-layout.has-toc .external-doc-toc { position: static; margin-bottom: 14px; }
  .external-doc-toc ul { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; border-left: 0; padding: 0; }
}
.help-search { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.help-search-input { flex: 1 1 280px; max-width: 520px; min-width: 0; }
.help-search-count { color: var(--fg-3); font-size: 12px; }
.help-search-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.help-search-empty p { margin: 0; color: var(--fg-2); font-size: 13px; }
/* Inline code may be one long token (a query string); let it break rather than run off a phone. */
.external-doc-body :not(pre) > code { overflow-wrap: anywhere; }
.external-doc-body pre { overflow-x: auto; padding: 12px; border-radius: var(--radius-md); background: var(--bg-inset); border: 1px solid var(--border-subtle); }
.external-doc-body pre code { padding: 0; border: 0; background: transparent; }
.external-doc-body .doc-code-block { position: relative; }
/* Opaque, so a long line scrolled under the button stays legible behind it. */
.external-doc-body .doc-copy-btn { position: absolute; top: 6px; right: 6px; background: var(--bg-inset); }
/* Room beside the first line for the Copy button, not above it: padding-top left an empty line
   at the head of every block. Commands start at the left, so the right edge is free. */
.external-doc-body .doc-code-block pre { padding-right: 84px; }
.external-doc-body table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 12px; }
.external-doc-body th, .external-doc-body td { border: 1px solid var(--border-subtle); padding: 8px 10px; text-align: left; vertical-align: top; }
.external-doc-body th { color: var(--fg-1); background: var(--surface-2); font-weight: 600; }
/* One set of steps, two routes through them ({{tab:}} in docs/external). The strip
   sticks because the routes are long enough to scroll past the choice. */
.external-doc-body .doc-tabs { margin: 18px 0 8px; }
.external-doc-body .doc-tab-strip { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; background: var(--surface); border-bottom: 1px solid var(--border-subtle); }
.external-doc-body .doc-tab-btn { color: var(--fg-3); background: transparent; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 6px 14px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
.external-doc-body .doc-tab-btn:hover { color: var(--fg-1); border-color: var(--accent-border); }
.external-doc-body .doc-tab-btn.is-active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.external-doc-body .doc-tab-panel.is-hidden { display: none; }
.external-doc-body .doc-details { margin: 14px 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 0 14px; }
.external-doc-body .doc-details[open] { padding-bottom: 6px; }
.external-doc-body .doc-details > summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.external-doc-body .doc-details > summary:hover { color: var(--accent); }
.external-doc-body .doc-tab-panel > h2:first-child { border-top: 0; padding-top: 0; }
.external-doc-groups { display: flex; flex-direction: column; gap: 28px; }
.external-doc-group + .external-doc-group { padding-top: 22px; border-top: 1px solid var(--border-subtle); }
.external-doc-group-title { color: var(--fg-1); font-size: 18px; margin: 0 0 12px; }
.external-doc-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.external-doc-card { display: block; color: inherit; text-decoration: none; transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.external-doc-card:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.external-doc-card .ctx { display: inline-block; color: var(--accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.external-doc-card h2 { color: var(--fg-1); font-size: 16px; margin: 10px 0 5px; }
.external-doc-card p { color: var(--fg-3); font-size: 12px; line-height: 1.5; margin: 0 0 12px; }
.external-doc-card-link { color: var(--accent); font-size: 12px; }
/* ============ Admin → API keys (pages/ApiKeys.tsx, components/apiKeys/) ============ */
.ak-name { display: inline-block; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ak-setup { margin-bottom: 16px; }
.ak-setup .section-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ak-steps { margin: 0; padding: 4px 0 4px 20px; display: flex; flex-direction: column; gap: 14px; }
.ak-steps > li::marker { color: var(--fg-3); font-size: 12px; }
.ak-step-title { font-size: 13px; font-weight: 600; color: var(--fg-1); margin-bottom: 6px; }
.ak-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ak-row + .ak-row { margin-top: 6px; }
.ak-note { font-size: 12px; margin: 4px 0 0; }
.ak-row .ak-note { margin: 0; }
.ak-plaintext { flex: 1; min-width: 0; font-size: 12px; word-break: break-all; user-select: all; }
.ak-setup .seg { flex-wrap: wrap; }
.ak-snippet { margin: 6px 0; padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: pre; border-radius: var(--radius-md); background: var(--bg-inset); border: 1px solid var(--border-subtle); }

/* The summary card's head and coverage meter (cardAtoms.tsx, StandardCoverage.tsx). Global, not in overview.css:
   that file loads only with the Overview chunk, and Policies draws the same card (a meter with no size or colour,
   a heading at the global h3's 24px, when opened first). */
.covbar { display: flex; gap: 3px; flex: 1; }
.covbar i { flex: 1; height: 8px; border-radius: 2px; background: var(--sev-ok); }
.covbar i.late { background: var(--sev-high); }
.covbar i.part { background: transparent; border: 1.5px dashed var(--sev-ok); }
.sum-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sum-titles { display: grid; gap: 2px; min-width: 0; }
.sum-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--fg-1); letter-spacing: 0; }
