/* =============================================================================
   Sentioshield Portal — base + component styles.
   Every value here resolves to a design-system token in tokens.css. No raw hex,
   size, or radius. Component classes mirror the DS "Components" sections.
   ========================================================================== */

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(31,111,107,.18); }
a { color: var(--action); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 0; }
h1 { font-size: var(--text-h1); line-height: 1.08; }
h2 { font-size: var(--text-h2); line-height: 1.12; }
h3 { font-size: var(--text-h3); line-height: 1.2; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* SPA focus management moves focus programmatically to tabindex="-1" elements — the routed <h1> after
   every navigation (FocusOnNavigate, so screen-reader users land on the new page title) and popover /
   dialog containers. Those elements are never reachable by keyboard Tab, so the browser's default focus
   outline on them reads as a stray border on a heading. Suppress it; interactive elements' keyboard
   :focus-visible rings above are untouched, so keyboard navigation stays fully visible. */
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.overline {
  font-family: var(--font-mono); font-size: var(--text-overline);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3);
}
.serif { font-family: var(--font-display); }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }

/* Custom scrollbar to match the DS chrome */
.ss-scroll::-webkit-scrollbar { width: 11px; height: 11px; }
.ss-scroll::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 7px;
  border: 3px solid transparent; background-clip: padding-box;
}
.ss-scroll::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; }

/* ---------- Buttons ---------- */
.ss-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-h); padding: 0 var(--space-4);
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background var(--motion-micro) var(--ease-out),
              border-color var(--motion-micro) var(--ease-out),
              color var(--motion-micro) var(--ease-out);
}
.ss-btn:disabled { opacity: .5; cursor: not-allowed; }
.ss-btn i { font-size: 16px; }
.ss-btn--sm { height: 32px; font-size: 13px; padding: 0 var(--space-3); border-radius: var(--radius-sm); }
.ss-btn--lg { height: 46px; font-size: 15px; padding: 0 var(--space-6); border-radius: var(--radius-md); }
.ss-btn--primary { background: var(--action); color: var(--on-accent); }
.ss-btn--primary:hover:not(:disabled) { background: var(--action-hover); }
.ss-btn--secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.ss-btn--secondary:hover:not(:disabled) { border-color: var(--action); color: var(--action); }
.ss-btn--ghost { background: transparent; color: var(--text-2); }
.ss-btn--ghost:hover:not(:disabled) { background: var(--sev-0-tint); color: var(--action); }
/* Crimson — irreversible/destructive only. */
.ss-btn--critical { background: var(--sev-4); color: var(--on-accent); }
.ss-btn--critical:hover:not(:disabled) { background: var(--sev-4-hover); }
.ss-btn--block { width: 100%; }

/* ---------- Cards & surfaces ---------- */
.ss-card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--elev-1);
}
.ss-card--flat { box-shadow: none; }
.ss-card__pad { padding: var(--space-6); }

/* ---------- Stat tiles ---------- */
.ss-stat { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) var(--space-6); }
.ss-stat__label { font-family: var(--font-mono); font-size: var(--text-overline); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.ss-stat__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; color: var(--text); }
.ss-stat__delta { font-size: var(--text-small); color: var(--text-3); }

/* ---------- Badges & tags ---------- */
.ss-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 24px; padding: 0 var(--space-3);
  font-size: var(--text-small); font-weight: 600; border-radius: var(--radius-pill);
}
.ss-badge__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ss-badge--solid { color: var(--on-accent); }
.ss-badge--solid .ss-badge__dot { background: rgba(255,255,255,.85); }
.ss-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px;
  font-size: 12px; font-weight: 500; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); border: 1px solid var(--line);
}

/* ---------- Forms & inputs ---------- */
.ss-field { display: flex; flex-direction: column; gap: 6px; }
.ss-field__label { font-family: var(--font-ui); font-size: var(--text-small); font-weight: 600; color: var(--text); }
.ss-field__hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.ss-field__error { font-size: 12.5px; color: var(--sev-4); line-height: 1.45; display: flex; gap: 6px; align-items: flex-start; }
.ss-input, .ss-select {
  height: var(--control-h); padding: 0 var(--space-3);
  font-family: var(--font-ui); font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); width: 100%;
  transition: border-color var(--motion-micro) var(--ease-out), box-shadow var(--motion-micro) var(--ease-out);
}
.ss-input::placeholder { color: var(--text-3); }
.ss-input:focus, .ss-select:focus { outline: none; border-color: var(--action); box-shadow: var(--focus-ring); }
.ss-input--invalid { border-color: var(--sev-4); }
.ss-input--invalid:focus { box-shadow: 0 0 0 3px var(--sev-4-tint); }
.ss-select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235B6B7B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-3) center; padding-right: var(--space-8); }
.ss-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 14px; color: var(--text); cursor: pointer; }
.ss-check input { width: 18px; height: 18px; accent-color: var(--action); }
.ss-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.ss-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ss-switch__track { width: 40px; height: 22px; border-radius: var(--radius-pill); background: var(--line-strong); transition: background var(--motion-base) var(--ease-out); }
.ss-switch__thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--on-accent); transition: transform var(--motion-base) var(--ease-out); box-shadow: var(--elev-1); }
.ss-switch input:checked + .ss-switch__track { background: var(--action); }
.ss-switch input:checked + .ss-switch__track + .ss-switch__thumb { transform: translateX(18px); }
.ss-switch input:focus-visible + .ss-switch__track { box-shadow: var(--focus-ring); }

/* ---------- Tables & lists ---------- */
.ss-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ss-table thead th {
  text-align: left; font-family: var(--font-mono); font-size: var(--text-overline);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-weight: 500;
}
.ss-table tbody td { padding: 0 var(--space-4); height: var(--row-h); border-bottom: 1px solid var(--line); vertical-align: middle; }
.ss-table tbody tr { transition: background var(--motion-micro) var(--ease-out); }
.ss-table tbody tr:hover { background: var(--sev-0-tint); }
.ss-table tbody tr[data-selected="true"] { background: var(--sev-0-tint); }
.ss-table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--text-2); }
/* Severity rides a 3px left edge — status, never decoration. */
.ss-row-sev { border-left: 3px solid transparent; }
.ss-person { display: flex; align-items: center; gap: var(--space-3); }
.ss-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; background: var(--sev-0-tint); color: var(--aegis-deep); flex: 0 0 auto; }
.ss-person__name { font-weight: 600; color: var(--text); }
.ss-person__id { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* ---------- Feedback: banners, toasts, dialogs ---------- */
.ss-banner { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4) var(--space-4);
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius-md); background: var(--paper-2); }
.ss-banner__icon { font-size: 20px; flex: 0 0 auto; margin-top: 1px; }
.ss-banner__title { font-weight: 600; color: var(--text); }
.ss-banner__body { font-size: var(--text-small); color: var(--text-2); line-height: 1.5; }
.ss-toast-host { position: fixed; bottom: var(--space-6); right: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); z-index: 60; }
.ss-toast { display: flex; align-items: center; gap: var(--space-3); min-width: 280px; max-width: 380px;
  padding: var(--space-3) var(--space-4); background: var(--ink); color: var(--on-accent);
  border-radius: var(--radius-md); box-shadow: var(--elev-3); animation: ss-toast-in var(--motion-enter) var(--ease-out); }
.ss-toast__title { font-weight: 600; font-size: var(--text-small); }
.ss-toast__body { font-size: 12.5px; color: var(--on-accent-muted); }
.ss-toast__action { margin-left: auto; color: var(--aegis-glow); font-weight: 600; font-size: var(--text-small); background: none; border: none; cursor: pointer; }
@keyframes ss-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ss-scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 70; padding: var(--space-4); }
.ss-dialog { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--elev-3); max-width: 440px; width: 100%; padding: var(--space-6); }
.ss-dialog__title { font-family: var(--font-display); font-size: var(--text-h3); font-weight: 700; margin-bottom: var(--space-3); }
.ss-dialog__body { font-size: 14px; color: var(--text-2); line-height: 1.55; margin-bottom: var(--space-6); }
.ss-dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-3); }

/* ---------- Empty & skeleton ---------- */
.ss-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-16) var(--space-6); }
.ss-empty__icon { font-size: 40px; color: var(--aegis); }
.ss-empty__title { font-family: var(--font-display); font-size: var(--text-h3); font-weight: 600; }
.ss-empty__body { font-size: var(--text-small); color: var(--text-3); max-width: 42ch; line-height: 1.55; }
.ss-skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--paper-2) 50%, var(--line) 75%);
  background-size: 200% 100%; animation: ss-shimmer 1.4s ease-in-out infinite; border-radius: var(--radius-sm); }
@keyframes ss-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- PII masked region (portal-owned; irreversible, no reveal) ---------- */
.ss-masked {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: var(--radius-xs);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3); user-select: none;
  background: repeating-linear-gradient(135deg, var(--line) 0 6px, transparent 6px 12px);
  border: 1px solid var(--line);
}
.ss-masked i { font-size: 13px; }

/* ---------- Live indicator (portal-owned) ---------- */
.ss-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--text-overline); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ss-live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aegis); position: relative; }
.ss-live--live .ss-live__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--aegis); animation: ss-ping 2.4s var(--ease-out) infinite; }
.ss-live--stale .ss-live__dot { background: var(--text-3); }
@keyframes ss-ping { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(2.2); } }

/* ---------- Utility layout ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-6 { gap: var(--space-6); }
.grow { flex: 1; } .wrap { flex-wrap: wrap; }

/* ── Ingestion surfaces (Activity / Signals / Devices) ─────────────────────────
   Data-row lists: an accessible anchor/row grid. Severity rides the left; the
   person leads; times are mono + zone-labelled. All values are tokens. */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.filters > * { min-width: 170px; }

.data-list { display: flex; flex-direction: column; }
.data-head,
.sig-row,
.dev-row {
  display: grid;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
}
.sig-row { grid-template-columns: 116px 1.5fr 2fr auto 130px; }
.dev-row { grid-template-columns: 1.6fr auto auto 1.4fr auto; }
.data-head {
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font: var(--text-overline);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.data-head.sig-row { grid-template-columns: 116px 1.5fr 2fr auto 130px; }
.data-head.dev-row { grid-template-columns: 1.6fr auto auto 1.4fr auto; }

a.sig-row,
a.dev-row {
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: background var(--motion-micro) var(--ease-out);
}
a.sig-row:hover,
a.dev-row:hover { background: var(--paper-2); }
a.sig-row:focus-visible,
a.dev-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
a.sig-row:last-child,
a.dev-row:last-child { border-bottom: 0; }

.row-person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.row-person__name { font-weight: 600; }
.row-person__sub { font-size: 11px; color: var(--text-3); }
/* The OS-layer chip on a signal row: platform icon + friendly label, so a reviewer sees at a glance
   which operating system the activity came from (Android/Windows/iOS/ChromeOS/…). */
.row-plat { display: inline-flex; align-items: center; gap: .28em; white-space: nowrap; }
.row-summary { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.row-summary__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-chev { color: var(--text-3); justify-self: end; }

/* Stacked timestamp for dense columns: time on top, muted zone beneath (truncates on a long city). */
.ts-stack { display: inline-flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ts-stack__time { font-size: var(--text-small); }
.ts-stack__zone {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Responsive ladder for the signals list ────────────────────────────────────
   Columns are disclosed by priority — Severity > Person > Activity > Captured >
   Device — dropping the lowest first so the content (Activity) is kept longest and
   nothing ever clips. Above 1150px all five show; the Captured column is a fixed,
   deterministic width so the per-row grids stay aligned. */
@media (max-width: 1150px) {
  /* Tablet landscape / small laptop: drop Device (context, not content). */
  .sig-row, .data-head.sig-row { grid-template-columns: 116px 1.5fr 2fr 130px; }
  .sig-row .col-own, .data-head .col-own { display: none; }
}
@media (max-width: 820px) {
  /* Tablet portrait / phone: also drop Captured; keep Severity + Person + Activity. */
  .sig-row, .data-head.sig-row { grid-template-columns: 96px 1.4fr minmax(0, 2fr); }
  .sig-row .col-cap, .data-head .col-cap { display: none; }
}
@media (max-width: 900px) {
  /* Devices fleet list keeps its existing narrow layout. */
  .dev-row, .data-head.dev-row { grid-template-columns: 1.4fr auto auto; }
  .dev-row .col-person, .data-head.dev-row .col-person { display: none; }
}

/* ── Redacted-capture viewer ────────────────────────────────────────────────────
   Shows the redacted derivative only. No reveal affordance exists anywhere. */
.capture { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.capture__bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.capture__frame {
  max-height: 460px; overflow: auto; background: var(--surface-2);
  display: flex; justify-content: center; padding: var(--space-3);
}
.capture__img { display: block; height: auto; border-radius: var(--radius-sm); }
.capture__foot {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border-top: 1px solid var(--line);
  color: var(--text-3); font-size: var(--text-small);
}
.capture--state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-2); padding: var(--space-8) var(--space-6);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--paper-2);
}
.capture__title { font-weight: 600; color: var(--text); }
.capture__body { max-width: 44ch; line-height: 1.5; }

/* ── Reporting charts ───────────────────────────────────────────────────────────
   Token-only bars. Severity bars carry their ramp colour; the label always states
   the value, so meaning never rests on colour alone (WCAG 2.2 AA). */
.chart { display: flex; flex-direction: column; gap: var(--space-2); }
.bar { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: var(--space-3); padding: 2px 0; }
a.bar { text-decoration: none; color: inherit; border-radius: var(--radius-sm); }
a.bar:hover .bar__label { color: var(--text); }
a.bar:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.bar__label { font-size: var(--text-small); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__track { height: 14px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.bar__fill { height: 100%; border-radius: var(--radius-pill); background: var(--aegis); min-width: 2px; }
.bar__count { font-family: var(--font-mono); font-size: var(--text-small); text-align: right; color: var(--text-2); }
.buckets { display: flex; align-items: flex-end; gap: var(--space-2); height: 130px; padding-top: var(--space-2); }
.bucket { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-1); height: 100%; justify-content: flex-end; }
.bucket__bar { width: 70%; background: var(--aegis); border-radius: var(--radius-sm) var(--radius-sm) 0 0; min-height: 2px; }
.bucket__label { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); white-space: nowrap; }

/* ── Alert inbox rows ────────────────────────────────────────────────────────── */
.alert-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line);
}
.alert-row:last-child { border-bottom: 0; }
.alert-row__meta { min-width: 0; }
.alert-row__title { font-weight: 600; }
.alert-row__sub { font-size: var(--text-small); color: var(--text-3); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* ── Device fleet + management ───────────────────────────────────────────────── */
.fleet-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.fleet-row:last-child { border-bottom: 0; }
.fleet-row:hover { background: var(--sev-0-tint); }
.fleet-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.fleet-row__main { display: flex; align-items: center; gap: var(--space-3); flex: 1 1 220px; min-width: 0; }
.fleet-row__name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-row__sub { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-small); color: var(--text-3); flex-wrap: wrap; }
.fleet-row__status { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.fleet-row__serves { display: flex; flex-direction: column; min-width: 130px; font-size: var(--text-small); color: var(--text-2); text-align: right; }
@media (max-width: 820px) {
  .fleet-row__serves { display: none; }
}

/* Enrolment wizard — method picker + steps */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.method-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  text-align: left; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; transition: border-color var(--motion-micro) var(--ease-out), background var(--motion-micro) var(--ease-out);
}
.method-card:hover { border-color: var(--line-strong); background: var(--sev-0-tint); }
.method-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.method-card__title { font-weight: 600; font-size: 15px; }
.method-card__sub { font-size: var(--text-small); color: var(--text-3); }

.step-list { margin: 0; padding-left: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-small); color: var(--text-2); }

/* A one-time credential / enrolment code, shown prominently and selectable. */
.token-code {
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.02em; word-break: break-all;
  padding: var(--space-3) var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); user-select: all;
}

/* An inline honesty/info note (capability, ownership immutability, retention). */
.cap-note { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-small); color: var(--text-2); }
.cap-note--warn {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  background: var(--sev-3-tint); border-left: 3px solid var(--sev-3);
}

/* Capability descriptor list — ticked (capable) and unticked (honestly not available). */
.cap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.cap-item { display: flex; align-items: center; gap: var(--space-2); }
.cap-item--off { color: var(--text-3); }

/* ── Alert escalation trail ──────────────────────────────────────────────────── */
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trail__step { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; position: relative; }
/* The connector line between steps. */
.trail__step:not(:last-child)::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: -8px; width: 2px; background: var(--line);
}
.trail__icon {
  flex: none; width: 28px; height: 28px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); z-index: 1;
}
.trail__label { display: block; font-weight: 600; }
.trail__meta { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-small); color: var(--text-3); flex-wrap: wrap; }

/* ── Accessibility utilities ─────────────────────────────────────────────────── */
/* Screen-reader-only: available to assistive tech, removed from the visual layout. */
.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;
}

/* Accessible popover (SsPopover). The anchor is relative so the panel positions against the trigger;
   the backdrop is a transparent full-viewport click-catcher for outside-dismiss (below the panel, and
   below toasts/scrim/detail on the z scale). The panel's offsets/width come from the caller's style. */
.ss-popover { position: relative; display: inline-flex; }
.ss-popover__backdrop {
  position: fixed; inset: 0; z-index: 39; background: transparent;
  border: 0; padding: 0; margin: 0; cursor: default;
}
.ss-popover__panel { z-index: 40; }

/* Chart data-table alternative — every chart carries one (WCAG 2.2 AA). */
.chart-table { margin-top: var(--space-4); }
.chart-table > summary {
  cursor: pointer; font-family: var(--font-mono); font-size: var(--text-overline);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
  padding: var(--space-2) 0;
}
.chart-table > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.chart-table .ss-table { margin-top: var(--space-3); }
.chart-table .ss-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================================
   Web Access & Filtering — block page, inspector, authoring. Tokens only.
   ========================================================================== */

/* ---- Block page: the on-device experience, owned & previewable here ---- */
.blockpage {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-8) var(--space-4); min-height: 420px;
  background: var(--paper);
}
.blockpage__card {
  width: 100%; max-width: 520px; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--elev-2);
  padding: var(--space-8) var(--space-6);
}
.blockpage__mark { color: var(--sev-3); margin-bottom: var(--space-3); }
.blockpage--care .blockpage__mark { color: var(--aegis); }
.blockpage__title { font-family: var(--font-display); font-size: var(--text-h2); color: var(--text); margin: 0 0 var(--space-2); }
.blockpage__body { color: var(--text-2); line-height: 1.55; max-width: 42ch; margin: 0 auto var(--space-4); }
.blockpage__meta { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; margin-bottom: var(--space-4); }
.blockpage__help {
  display: flex; gap: var(--space-3); text-align: left;
  background: var(--sev-0-tint); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  margin: 0 auto var(--space-4); max-width: 44ch; color: var(--aegis-deep);
}
.blockpage__help-title { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.blockpage__help-body { color: var(--text-2); font-size: var(--text-small); line-height: 1.5; }
.blockpage__foot { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.blockpage__contact { color: var(--text-3); font-size: var(--text-small); line-height: 1.5; max-width: 42ch; margin: 0; }
.blockpage__by { margin-top: var(--space-6); color: var(--text-3); font-size: var(--text-overline); text-transform: uppercase; letter-spacing: .06em; display: inline-flex; align-items: center; gap: 4px; }

/* ---- Precedence / firedRule chain (inspector) ---- */
.chain { display: flex; flex-direction: column; gap: var(--space-2); }
.chain__row {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.chain__row--won { border-color: var(--aegis); background: var(--sev-0-tint); }
.chain__rank { width: 26px; height: 26px; border-radius: var(--radius-pill); background: var(--paper-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: var(--text-small); color: var(--text-2); }
.chain__pattern { font-family: var(--font-mono); font-size: var(--text-small); color: var(--text); word-break: break-all; }
.chain__why { color: var(--text-3); font-size: var(--text-small); }
.chain__badges { display: flex; gap: var(--space-1); align-items: center; }

/* ---- Layer-0 transparency + preset floor ---- */
.floor { display: flex; flex-direction: column; gap: var(--space-2); }
.floor__item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); color: var(--text-2); font-size: var(--text-small); }
.floor__lock { color: var(--aegis); flex: 0 0 auto; }

/* ---- Authoring: refinement rows, warnings ---- */
.refine { display: flex; gap: var(--space-2); align-items: flex-end; }
.refine .ss-field { flex: 1 1 auto; }
.warn-list { display: flex; flex-direction: column; gap: var(--space-2); }

/* ---- Web Access layout utilities (tokens only) ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); align-items: baseline; }
.kv__k { color: var(--text-3); font-size: var(--text-small); }
.kv__v { color: var(--text); font-size: var(--text-small); }
.ss-link { color: var(--action); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-small); }
.ss-link:hover { text-decoration: underline; }
.ss-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.verdict-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--text-small); font-weight: 600; border: 1px solid var(--line); }

/* ---- Web Access hub cards ---- */
/* Deterministic column count so four cards never leave a lonely card on a second row:
   4-across on desktop, a balanced 2x2 on tablet, single column on narrow. */
.hub-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 980px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .hub-grid { grid-template-columns: 1fr; } }
.hubcard {
  display: flex; flex-direction: column; gap: var(--space-3);
  text-align: left; padding: var(--space-4); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elev-1);
  cursor: pointer; color: var(--text);
  transition: box-shadow var(--motion-base) var(--ease-out), border-color var(--motion-base) var(--ease-out), transform var(--motion-base) var(--ease-out);
}
.hubcard:hover { box-shadow: var(--elev-2); border-color: var(--line-strong); transform: translateY(-2px); }
.hubcard:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* Icon and title share one row so the icon never floats away from its label; body sits beneath. */
.hubcard__head { display: flex; align-items: center; gap: var(--space-3); }
.hubcard__icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-md); background: var(--sev-0-tint); color: var(--aegis);
}
.hubcard__title { font-weight: 600; font-size: var(--text-h3); font-family: var(--font-display); line-height: 1.15; }
.hubcard__body { margin: 0; color: var(--text-2); font-size: var(--text-small); line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .hubcard:hover { transform: none; } }
