/* ============================================================
   Old Logan Readability Contract (canonical)
   Loaded LAST, after styles.css and overhaul.css.
   All editorial visual changes belong here — do not add theme
   colors in panel JS; use YourThemeConfig for charts.

   Screen map:
   - Operations: #workflowPrimary, #scanSection, #scanDetailPanel, #pendingSection
   - Research: #quickCheckSection, #backtestSection, #reportSectionCard, #secCompareSection
   - Diagnostics: #healthRibbon, #decisionDashboardCard, #statusDetailsPanel
   - Settings: #onboardingSection, #settingsSection
============================================================ */

body[data-theme="editorial"] {
  /* Old Logan Capital canonical palette — cream / forest / gold */
  --ol-bg: #f5f1e8;
  --ol-surface: #fffefb;
  --ol-surface-soft: #ebe5d6;
  --ol-border: rgba(26, 26, 26, 0.12);
  --ol-border-strong: rgba(26, 26, 26, 0.22);
  --ol-text: #1a1a1a;
  --ol-text-soft: #2a2a2a;
  --ol-muted: #5a5a5a;
  --ol-muted-soft: #6e6862;
  --ol-accent: #1a3a2e; /* forest green — primary accent */
  --ol-accent-2: #2d5a4a; /* forest light */
  --ol-accent-hover: #0f241b;
  --ol-accent-pressed: #142820;
  --ol-on-accent: #f5f1e8;
  --ol-accent-border: rgba(26, 58, 46, 0.35);
  --ol-topbar-border: rgba(26, 58, 46, 0.18);
  --ol-gold: #c9a962; /* secondary accent — borders/fills only; 2.0:1 on cream, never body text */
  --ol-accent-soft: rgba(26, 58, 46, 0.12);
  --ol-ok: #2d5a4a;
  --ol-warn: #8a5c1f;
  --ol-bad: #c94949; /* fills/borders/large text */
  --ol-bad-text: #a83636; /* AA-safe red for small text on cream/tinted chips */
  /* Neutralize legacy overhaul dark-first aliases so leftover ink-* rules
     cannot paint navy under dark body text (dark-on-dark). */
  --ink: var(--ol-bg);
  --ink-2: var(--ol-surface);
  --ink-3: var(--ol-surface-soft);
  --ink-line: var(--ol-border);
  --ink-line-strong: var(--ol-border-strong);
  --paper: var(--ol-text);
  --paper-soft: var(--ol-text-soft);
  --paper-warm: var(--ol-text);
  --paper-mute: var(--ol-muted);
  /* Spacing scale (Figma 4/8/12/16/20/24) */
  --ol-space-1: 4px;
  --ol-space-2: 8px;
  --ol-space-3: 12px;
  --ol-space-4: 16px;
  --ol-space-5: 20px;
  --ol-space-6: 24px;
  --ol-space-7: 32px;
  /* Type scale */
  --ol-text-display: 2.25rem;
  --ol-text-title: 1.125rem;
  --ol-text-body: 1rem;
  --ol-text-caption: 0.8125rem;
  --ol-text-micro: 0.8125rem; /* 13px readability floor for supporting text */
  background: var(--ol-bg) !important;
  color: var(--ol-text) !important;
  font-family: "DM Sans", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif !important;
  font-size: 16px;
  line-height: 1.55;
}

body[data-theme="editorial"] .muted,
body[data-theme="editorial"] small,
body[data-theme="editorial"] .hero-kpi-hint,
body[data-theme="editorial"] .mode-header-hint {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] p,
body[data-theme="editorial"] li,
body[data-theme="editorial"] label,
body[data-theme="editorial"] td,
body[data-theme="editorial"] th {
  color: var(--ol-text-soft);
  line-height: 1.55;
}

body[data-theme="editorial"] .small,
body[data-theme="editorial"] small {
  font-size: 0.84rem !important;
  line-height: 1.45 !important;
}

body[data-theme="editorial"] .field-label,
body[data-theme="editorial"] .workspace-eyebrow,
body[data-theme="editorial"] .stat-label,
body[data-theme="editorial"] .health-label {
  color: #3f372f !important;
  font-weight: 700 !important;
}

body[data-theme="editorial"] .disclosure-hint,
body[data-theme="editorial"] .form-hint,
body[data-theme="editorial"] [id$="Meta"],
body[data-theme="editorial"] [id$="Fresh"],
body[data-theme="editorial"] [id$="Status"] {
  color: var(--ol-muted-soft) !important;
}

body[data-theme="editorial"] a {
  color: var(--ol-accent);
}

body[data-theme="editorial"] a:hover {
  color: var(--ol-accent-hover);
}

body[data-theme="editorial"] h1,
body[data-theme="editorial"] h2,
body[data-theme="editorial"] h3,
body[data-theme="editorial"] .mode-header-title,
body[data-theme="editorial"] .section-title h2,
body[data-theme="editorial"] .section-title h3,
body[data-theme="editorial"] .kanban-lane-head strong {
  color: var(--ol-text) !important;
  font-family: "Fraunces", Georgia, serif !important;
  font-style: normal !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  -webkit-text-fill-color: var(--ol-text) !important;
}

body[data-theme="editorial"] .card,
body[data-theme="editorial"] .operate-kanban,
body[data-theme="editorial"] .operate-kanban .kanban-lane,
body[data-theme="editorial"] .mode-header,
body[data-theme="editorial"] .panel-disclosure,
body[data-theme="editorial"] #workflowPrimary {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border) !important;
  color: var(--ol-text) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .section-title {
  border-bottom: 1px solid var(--ol-border) !important;
  padding: 12px 14px !important;
  margin-bottom: 12px !important;
}

/* Top navigation and context */
body[data-theme="editorial"] .app-topbar {
  background: rgba(250, 246, 238, 0.96) !important;
  border-bottom: 1px solid var(--ol-topbar-border) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .app-topbar-brand .brand-mark {
  display: inline-grid !important;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
  font-family: "Fraunces", Georgia, serif !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  font-style: normal !important;
  flex-shrink: 0;
}

body[data-theme="editorial"] .app-topbar-brand .brand-text {
  color: var(--ol-text) !important;
  font-family: "Fraunces", Georgia, serif !important;
  font-size: 1.12rem !important;
  font-style: normal !important;
  font-weight: 700 !important;
}

body[data-theme="editorial"] .app-topbar-brand {
  gap: 10px !important;
}

body[data-theme="editorial"] .app-topbar-tabs {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border) !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn {
  color: var(--ol-muted) !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
  font-size: 0.92rem !important;
  padding: 8px 12px !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
}

/* Topbar controls called out as unreadable */
body[data-theme="editorial"] .app-topbar-actions .topbar-detail select,
body[data-theme="editorial"] #displayModeSelect {
  background: #fffdf9 !important;
  color: #1f1b17 !important;
  border: 1px solid rgba(26, 26, 26, 0.34) !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  min-height: 34px;
  padding: 6px 10px !important;
}

body[data-theme="editorial"] .app-topbar-actions .topbar-detail select:hover,
body[data-theme="editorial"] #displayModeSelect:hover,
body[data-theme="editorial"] .app-topbar-actions .topbar-detail select:focus,
body[data-theme="editorial"] #displayModeSelect:focus {
  border-color: var(--ol-accent-border) !important;
  background: #ffffff !important;
}

body[data-theme="editorial"] .app-topbar-actions .btn.secondary.small,
body[data-theme="editorial"] #refreshBtn {
  background: #fffdf9 !important;
  border: 1px solid rgba(26, 26, 26, 0.36) !important;
  color: #201c18 !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  min-height: 34px;
  padding: 6px 12px !important;
}

body[data-theme="editorial"] .app-topbar-actions .btn.secondary.small:hover,
body[data-theme="editorial"] #refreshBtn:hover {
  background: #f4ecdf !important;
  border-color: var(--ol-accent-border) !important;
}

/* Full topbar control sweep */
body[data-theme="editorial"] .app-topbar-actions .btn,
body[data-theme="editorial"] .app-topbar-actions button,
body[data-theme="editorial"] .app-topbar-actions select {
  color: #1f1b17 !important;
  border-color: rgba(26, 26, 26, 0.34) !important;
  font-weight: 700 !important;
}

body[data-theme="editorial"] .app-topbar-actions .btn.primary,
body[data-theme="editorial"] .app-topbar-actions button.btn.primary {
  background: var(--ol-accent) !important;
  border-color: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .app-topbar-actions .btn.icon-btn {
  background: #fffdf9 !important;
  border: 1px solid rgba(26, 26, 26, 0.34) !important;
  color: #1f1b17 !important;
}

body[data-theme="editorial"] .app-topbar-actions .btn.icon-btn:hover {
  background: #f4ecdf !important;
  border-color: var(--ol-accent-border) !important;
}

body[data-theme="editorial"] .mode-header {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border-strong) !important;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 31%);
}

body[data-theme="editorial"] .mode-header-title {
  font-size: clamp(1.8rem, 2.8vw, 2.3rem) !important;
  line-height: 1.14 !important;
  margin-bottom: 0.5rem !important;
}

body[data-theme="editorial"] .mode-header-lead {
  font-size: 1rem !important;
  line-height: 1.52 !important;
  max-width: 62ch;
}

body[data-theme="editorial"] .mode-header-kpis {
  border-left: 1px solid var(--ol-border) !important;
}

body[data-theme="editorial"] .mode-header-kpis .hero-kpi {
  border-bottom: 1px solid var(--ol-border) !important;
}

body[data-theme="editorial"] .mode-header-kpis .hero-kpi-value {
  font-size: 1.6rem !important;
  color: var(--ol-text) !important;
}

/* Buttons and controls */
body[data-theme="editorial"] .btn {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border-strong) !important;
  color: var(--ol-text) !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  font-size: 0.9rem !important;
}

body[data-theme="editorial"] .btn.primary,
body[data-theme="editorial"] .app-topbar #scanBtn.btn.primary {
  background: var(--ol-accent) !important;
  border-color: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
  font-weight: 700 !important;
}

body[data-theme="editorial"] input,
body[data-theme="editorial"] select,
body[data-theme="editorial"] textarea {
  background: #fffdf8 !important;
  color: #202020 !important;
  border: 1px solid var(--ol-border) !important;
  font-size: 0.95rem !important;
  line-height: 1.45 !important;
}

body[data-theme="editorial"] input:focus,
body[data-theme="editorial"] select:focus,
body[data-theme="editorial"] textarea:focus {
  border-color: var(--ol-accent) !important;
  box-shadow: 0 0 0 2px var(--ol-accent-soft) !important;
}

body[data-theme="editorial"] input::placeholder,
body[data-theme="editorial"] textarea::placeholder {
  color: #6d665f !important;
}

/* Operations first: scan -> evaluate -> approve */
body[data-theme="editorial"] .workflow-primary-heading {
  color: var(--ol-accent) !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
  font-size: 0.74rem !important;
  font-style: normal !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

body[data-theme="editorial"] .workflow-primary[data-state="loading"] .workflow-progress-step[data-state="loading"] .workflow-progress-index {
  animation: workflow-pulse 1.2s ease-in-out infinite;
}

@keyframes workflow-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

body[data-theme="editorial"] .workflow-progress {
  margin: 0 0 10px;
}

body[data-theme="editorial"] .workflow-progress-list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-theme="editorial"] .workflow-progress-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 0;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--ol-border);
  background: var(--ol-surface-soft);
  color: var(--ol-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

body[data-theme="editorial"] .workflow-progress-step:not(:last-child)::after {
  content: "\203A";
  position: absolute;
  top: 50%;
  right: -0.55rem;
  z-index: 2;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ol-border-strong);
  border-radius: 999px;
  background: var(--ol-surface);
  color: var(--ol-warn); /* gold failed contrast on surface */
  font-family: "IBM Plex Serif", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1;
}

body[data-theme="editorial"] .workflow-progress-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  min-height: 1.35rem;
  border: 1px solid var(--ol-border);
  border-radius: 999px;
  background: var(--ol-surface);
  color: var(--ol-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

body[data-theme="editorial"] .workflow-progress-step[data-state="done"] {
  border-color: rgba(45, 90, 74, 0.38);
  background: rgba(45, 90, 74, 0.07);
  color: var(--ol-ok);
}

body[data-theme="editorial"] .workflow-progress-step[data-state="done"] .workflow-progress-index {
  border-color: rgba(45, 90, 74, 0.42);
  background: rgba(45, 90, 74, 0.14);
  color: var(--ol-ok);
}

body[data-theme="editorial"] .workflow-progress-step[data-state="active"] {
  border-color: rgba(26, 58, 46, 0.42);
  background: rgba(26, 58, 46, 0.08);
  color: var(--ol-accent);
  box-shadow: inset 0 0 0 1px rgba(26, 58, 46, 0.08);
}

body[data-theme="editorial"] .workflow-progress-step[data-state="active"] .workflow-progress-index {
  border-color: var(--ol-accent-border);
  background: var(--ol-accent-soft);
  color: var(--ol-accent);
}

body[data-theme="editorial"] .workflow-progress-step[data-state="loading"] {
  border-color: rgba(176, 133, 42, 0.5);
  background: rgba(201, 169, 98, 0.13);
  color: var(--ol-warn);
}

body[data-theme="editorial"] .workflow-progress-step[data-state="loading"] .workflow-progress-index {
  border-color: rgba(176, 133, 42, 0.5);
  background: rgba(201, 169, 98, 0.22);
  color: var(--ol-warn);
}

body[data-theme="editorial"] .workflow-progress-step[data-state="blocked"] {
  border-color: rgba(201, 73, 73, 0.44);
  background: rgba(201, 73, 73, 0.1);
  color: var(--ol-bad);
}

body[data-theme="editorial"] .workflow-progress-step[data-state="blocked"] .workflow-progress-index {
  border-color: rgba(201, 73, 73, 0.44);
  background: rgba(201, 73, 73, 0.14);
  color: var(--ol-bad);
}

body[data-theme="editorial"] .kanban-lane[data-workflow-focus="true"] {
  border-color: rgba(26, 58, 46, 0.55) !important;
  box-shadow:
    0 0 0 1px rgba(26, 58, 46, 0.12) inset,
    0 10px 28px rgba(26, 58, 46, 0.1) !important;
}

body[data-theme="editorial"] .kanban-lane[data-workflow-focus="true"] .kanban-lane-head::after {
  width: 48px;
  background: var(--ol-accent);
}

body[data-theme="editorial"] .kanban-lane[data-workflow-focus="true"] .kanban-lane-step {
  background: var(--ol-accent) !important;
  color: var(--ol-surface) !important;
}

body[data-theme="editorial"] .operate-kanban {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border-strong) !important;
  gap: clamp(14px, 1.5vw, 20px) !important;
}

body[data-theme="editorial"] .operate-kanban .kanban-lane {
  min-height: clamp(240px, 34vh, 520px);
  padding: 14px 14px 16px !important;
}

body[data-theme="editorial"] .operations-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0 14px 12px;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--ol-accent-border);
  border-left: 3px solid var(--ol-accent);
  border-radius: 10px;
  background: rgba(26, 58, 46, 0.05);
  color: var(--ol-text-soft);
  font-size: 0.88rem;
  line-height: 1.35;
}

body[data-theme="editorial"] .operations-status-strip strong {
  color: var(--ol-text);
  font-weight: 800;
}

body[data-theme="editorial"] .operations-status-strip .muted {
  color: var(--ol-muted-soft) !important;
}

body[data-theme="editorial"] .operations-status-strip--workflow {
  margin: 0 0 12px;
}

body[data-theme="editorial"] .operations-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.14rem 0.48rem;
  border: 1px solid var(--ol-accent-border);
  border-radius: 999px;
  background: var(--ol-accent-soft);
  color: var(--ol-accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-theme="editorial"] .operations-status-strip[data-state="success"] {
  border-color: rgba(45, 90, 74, 0.42);
  border-left-color: var(--ol-ok);
  background: rgba(45, 90, 74, 0.08);
}

body[data-theme="editorial"] .operations-status-strip[data-state="success"] .operations-status-pill {
  border-color: rgba(45, 90, 74, 0.42);
  background: rgba(45, 90, 74, 0.14);
  color: var(--ol-ok);
}

body[data-theme="editorial"] .operations-status-strip[data-state="partial"],
body[data-theme="editorial"] .operations-status-strip[data-state="loading"] {
  border-color: rgba(176, 133, 42, 0.5);
  border-left-color: var(--ol-gold);
  background: rgba(201, 169, 98, 0.13);
}

body[data-theme="editorial"] .operations-status-strip[data-state="partial"] .operations-status-pill,
body[data-theme="editorial"] .operations-status-strip[data-state="loading"] .operations-status-pill {
  border-color: rgba(176, 133, 42, 0.5);
  background: rgba(201, 169, 98, 0.22);
  color: var(--ol-warn);
}

body[data-theme="editorial"] .operations-status-strip[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.44);
  border-left-color: var(--ol-bad);
  background: rgba(201, 73, 73, 0.1);
}

body[data-theme="editorial"] .operations-status-strip[data-state="error"] .operations-status-pill {
  border-color: rgba(201, 73, 73, 0.44);
  background: rgba(201, 73, 73, 0.14);
  color: var(--ol-bad);
}

body[data-theme="editorial"] .operations-status-strip[data-state="empty"] {
  border-color: var(--ol-border);
  border-left-color: rgba(26, 58, 46, 0.32);
  background: var(--ol-surface-soft);
}

body[data-theme="editorial"] .operations-status-strip[data-state="empty"] .operations-status-pill {
  border-color: var(--ol-border);
  background: var(--ol-surface);
  color: var(--ol-muted);
}

body[data-theme="editorial"] .operations-panel-snapshot {
  display: grid;
  gap: var(--ol-space-3, 12px);
  margin: 0 14px 14px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ol-border);
  border-radius: 10px;
  background: var(--ol-surface-soft);
}

body[data-theme="editorial"] .operations-panel-snapshot__hint {
  margin: 0;
  font-size: var(--ol-text-micro, 0.78rem);
  line-height: 1.4;
}

body[data-theme="editorial"] .operations-panel-snapshot__kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body[data-theme="editorial"] .operations-panel-snapshot__kpi {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  background: #fbf7ef;
}

body[data-theme="editorial"] .operations-panel-snapshot__kpi[data-tone="success"] {
  border-left: 3px solid var(--ol-ok);
}

body[data-theme="editorial"] .operations-panel-snapshot__kpi[data-tone="warn"] {
  border-left: 3px solid var(--ol-warn);
}

body[data-theme="editorial"] .operations-panel-snapshot__kpi[data-tone="bad"] {
  border-left: 3px solid var(--ol-bad);
}

body[data-theme="editorial"] .operations-panel-snapshot__kpi-label {
  display: block;
  color: var(--ol-muted);
  font-size: var(--ol-text-micro, 0.72rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-theme="editorial"] .operations-panel-snapshot__kpi-value {
  display: block;
  margin-top: 0.2rem;
  color: var(--ol-text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

body[data-theme="editorial"] .operations-panel-snapshot__kpi-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--ol-text-micro, 0.72rem);
}

body[data-theme="editorial"] .operations-panel-snapshot__meters {
  display: grid;
  gap: 8px;
}

body[data-theme="editorial"] .operations-panel-snapshot__meter-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ol-text-soft);
  font-size: var(--ol-text-micro, 0.78rem);
  font-weight: 700;
}

body[data-theme="editorial"] .operations-panel-snapshot__lines {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ol-text-soft);
  font-size: var(--ol-text-small, 0.84rem);
  line-height: 1.45;
}

body[data-theme="editorial"] .operations-panel-snapshot[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.35);
}

body[data-theme="editorial"] .operations-panel-snapshot[data-state="loading"] {
  border-color: color-mix(in srgb, var(--ol-warn) 35%, var(--ol-border));
}

body[data-theme="editorial"] #pendingSection[data-state="error"],
body[data-theme="editorial"] #scanSection[data-state="error"],
body[data-theme="editorial"] #scanDetailPanel[data-state="error"],
body[data-theme="editorial"] #workflowPrimary[data-state="error"],
body[data-theme="editorial"] #healthRibbon[data-state="error"],
body[data-theme="editorial"] #healthRibbon[data-async-state="error"],
body[data-theme="editorial"] #shadowScoreboardSection[data-state="error"],
body[data-theme="editorial"] #shadowScoreboardSection[data-async-state="error"],
body[data-theme="editorial"] #reviewLoopSection[data-state="error"],
body[data-theme="editorial"] #reviewLoopSection[data-async-state="error"],
body[data-theme="editorial"] #statusDetailsPanel[data-state="error"],
body[data-theme="editorial"] #statusDetailsPanel[data-async-state="error"] {
  position: relative;
  overflow: hidden;
}

body[data-theme="editorial"] #pendingSection[data-state="error"]::before,
body[data-theme="editorial"] #scanSection[data-state="error"]::before,
body[data-theme="editorial"] #scanDetailPanel[data-state="error"]::before,
body[data-theme="editorial"] #workflowPrimary[data-state="error"]::before,
body[data-theme="editorial"] #healthRibbon[data-state="error"]::before,
body[data-theme="editorial"] #healthRibbon[data-async-state="error"]::before,
body[data-theme="editorial"] #shadowScoreboardSection[data-state="error"]::before,
body[data-theme="editorial"] #shadowScoreboardSection[data-async-state="error"]::before,
body[data-theme="editorial"] #reviewLoopSection[data-state="error"]::before,
body[data-theme="editorial"] #reviewLoopSection[data-async-state="error"]::before,
body[data-theme="editorial"] #statusDetailsPanel[data-state="error"]::before,
body[data-theme="editorial"] #statusDetailsPanel[data-async-state="error"]::before {
  background: var(--ol-bad);
  border-radius: 10px 10px 0 0;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

@media (max-width: 720px) {
  body[data-theme="editorial"] .operations-panel-snapshot__kpis {
    grid-template-columns: 1fr;
  }
}

body[data-theme="editorial"] .research-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0 14px 12px;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--ol-accent-border);
  border-left: 3px solid var(--ol-accent);
  border-radius: 10px;
  background: rgba(26, 58, 46, 0.05);
  color: var(--ol-text-soft);
  font-size: 0.88rem;
  line-height: 1.35;
}

body[data-theme="editorial"] .panel-disclosure > .research-status-strip,
body[data-theme="editorial"] .research-cockpit-disclosure > .research-status-strip {
  margin-top: 12px;
}

body[data-theme="editorial"] .research-status-strip strong {
  color: var(--ol-text);
  font-weight: 800;
}

body[data-theme="editorial"] .research-status-strip .muted {
  color: var(--ol-muted-soft) !important;
}

body[data-theme="editorial"] .research-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.14rem 0.48rem;
  border: 1px solid var(--ol-accent-border);
  border-radius: 999px;
  background: var(--ol-accent-soft);
  color: var(--ol-accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-theme="editorial"] .research-status-strip[data-state="success"] {
  border-color: rgba(45, 90, 74, 0.42);
  border-left-color: var(--ol-ok);
  background: rgba(45, 90, 74, 0.08);
}

body[data-theme="editorial"] .research-status-strip[data-state="success"] .research-status-pill {
  border-color: rgba(45, 90, 74, 0.42);
  background: rgba(45, 90, 74, 0.14);
  color: var(--ol-ok);
}

body[data-theme="editorial"] .research-status-strip[data-state="partial"],
body[data-theme="editorial"] .research-status-strip[data-state="loading"] {
  border-color: rgba(176, 133, 42, 0.5);
  border-left-color: var(--ol-gold);
  background: rgba(201, 169, 98, 0.13);
}

body[data-theme="editorial"] .research-status-strip[data-state="partial"] .research-status-pill,
body[data-theme="editorial"] .research-status-strip[data-state="loading"] .research-status-pill {
  border-color: rgba(176, 133, 42, 0.5);
  background: rgba(201, 169, 98, 0.22);
  color: var(--ol-warn);
}

body[data-theme="editorial"] .research-status-strip[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.44);
  border-left-color: var(--ol-bad);
  background: rgba(201, 73, 73, 0.1);
}

body[data-theme="editorial"] .research-status-strip[data-state="error"] .research-status-pill {
  border-color: rgba(201, 73, 73, 0.44);
  background: rgba(201, 73, 73, 0.14);
  color: var(--ol-bad);
}

body[data-theme="editorial"] .research-status-strip[data-state="empty"] {
  border-color: var(--ol-border);
  border-left-color: rgba(26, 58, 46, 0.32);
  background: var(--ol-surface-soft);
}

body[data-theme="editorial"] .research-status-strip[data-state="empty"] .research-status-pill {
  border-color: var(--ol-border);
  background: var(--ol-surface);
  color: var(--ol-muted);
}

body[data-theme="editorial"] .research-panel-snapshot {
  display: grid;
  gap: var(--ol-space-3, 12px);
  margin: 0 14px 14px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ol-border);
  border-radius: 10px;
  background: var(--ol-surface-soft);
}

body[data-theme="editorial"] .research-panel-snapshot:empty {
  display: none;
}

body[data-theme="editorial"] .research-panel-snapshot__hint {
  margin: 0;
  font-size: var(--ol-text-micro, 0.78rem);
  line-height: 1.4;
}

body[data-theme="editorial"] .research-panel-snapshot__kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body[data-theme="editorial"] .research-panel-snapshot__kpi {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  background: var(--ol-surface);
}

body[data-theme="editorial"] .research-panel-snapshot__kpi[data-tone="success"] {
  border-color: rgba(45, 90, 74, 0.42);
  border-left: 3px solid var(--ol-ok);
}

body[data-theme="editorial"] .research-panel-snapshot__kpi[data-tone="warn"],
body[data-theme="editorial"] .research-panel-snapshot__kpi[data-tone="loading"] {
  border-color: rgba(176, 133, 42, 0.5);
  border-left: 3px solid var(--ol-gold);
}

body[data-theme="editorial"] .research-panel-snapshot__kpi[data-tone="bad"] {
  border-color: rgba(201, 73, 73, 0.44);
  border-left: 3px solid var(--ol-bad);
}

body[data-theme="editorial"] .research-panel-snapshot__kpi-label {
  display: block;
  color: var(--ol-muted);
  font-size: var(--ol-text-micro, 0.72rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-theme="editorial"] .research-panel-snapshot__kpi-value {
  display: block;
  margin-top: 0.2rem;
  color: var(--ol-text);
  font-family: var(--ol-font-display, "Fraunces", Georgia, serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

body[data-theme="editorial"] .research-panel-snapshot__kpi-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--ol-text-micro, 0.72rem);
}

body[data-theme="editorial"] .research-panel-snapshot__meters {
  display: grid;
  gap: 8px;
}

body[data-theme="editorial"] .research-panel-snapshot__meter-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ol-text-soft);
  font-size: var(--ol-text-micro, 0.78rem);
  font-weight: 700;
}

body[data-theme="editorial"] .research-panel-snapshot__lines {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ol-text-soft);
  font-size: var(--ol-text-small, 0.84rem);
  line-height: 1.45;
}

body[data-theme="editorial"] .research-panel-snapshot[data-state="success"] {
  border-color: rgba(45, 90, 74, 0.35);
}

body[data-theme="editorial"] .research-panel-snapshot[data-state="partial"],
body[data-theme="editorial"] .research-panel-snapshot[data-state="loading"] {
  border-color: color-mix(in srgb, var(--ol-warn) 35%, var(--ol-border));
}

body[data-theme="editorial"] .research-panel-snapshot[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.35);
}

body[data-theme="editorial"] #portfolioSection[data-state="error"],
body[data-theme="editorial"] #portfolioSection[data-async-state="error"],
body[data-theme="editorial"] #quickCheckSection[data-state="error"],
body[data-theme="editorial"] #quickCheckSection[data-async-state="error"],
body[data-theme="editorial"] #secCompareSection[data-state="error"],
body[data-theme="editorial"] #secCompareSection[data-async-state="error"],
body[data-theme="editorial"] #cockpitMergedPanel[data-state="error"],
body[data-theme="editorial"] #cockpitMergedPanel[data-async-state="error"] {
  position: relative;
  overflow: hidden;
}

body[data-theme="editorial"] #portfolioSection[data-state="error"]::before,
body[data-theme="editorial"] #portfolioSection[data-async-state="error"]::before,
body[data-theme="editorial"] #quickCheckSection[data-state="error"]::before,
body[data-theme="editorial"] #quickCheckSection[data-async-state="error"]::before,
body[data-theme="editorial"] #secCompareSection[data-state="error"]::before,
body[data-theme="editorial"] #secCompareSection[data-async-state="error"]::before,
body[data-theme="editorial"] #cockpitMergedPanel[data-state="error"]::before,
body[data-theme="editorial"] #cockpitMergedPanel[data-async-state="error"]::before {
  background: var(--ol-bad);
  border-radius: 10px 10px 0 0;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

body[data-theme="editorial"] #portfolioSection[data-state="success"]::before,
body[data-theme="editorial"] #portfolioSection[data-async-state="success"]::before,
body[data-theme="editorial"] #quickCheckSection[data-state="success"]::before,
body[data-theme="editorial"] #quickCheckSection[data-async-state="success"]::before,
body[data-theme="editorial"] #secCompareSection[data-state="success"]::before,
body[data-theme="editorial"] #secCompareSection[data-async-state="success"]::before,
body[data-theme="editorial"] #cockpitMergedPanel[data-state="success"]::before,
body[data-theme="editorial"] #cockpitMergedPanel[data-async-state="success"]::before {
  background: var(--ol-ok);
  border-radius: 10px 10px 0 0;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

body[data-theme="editorial"] #portfolioSection[data-state="success"],
body[data-theme="editorial"] #portfolioSection[data-async-state="success"],
body[data-theme="editorial"] #quickCheckSection[data-state="success"],
body[data-theme="editorial"] #quickCheckSection[data-async-state="success"],
body[data-theme="editorial"] #secCompareSection[data-state="success"],
body[data-theme="editorial"] #secCompareSection[data-async-state="success"],
body[data-theme="editorial"] #cockpitMergedPanel[data-state="success"],
body[data-theme="editorial"] #cockpitMergedPanel[data-async-state="success"],
body[data-theme="editorial"] #portfolioSection[data-state="partial"],
body[data-theme="editorial"] #quickCheckSection[data-state="partial"],
body[data-theme="editorial"] #secCompareSection[data-state="partial"],
body[data-theme="editorial"] #cockpitMergedPanel[data-state="partial"],
body[data-theme="editorial"] #portfolioSection[data-state="loading"],
body[data-theme="editorial"] #quickCheckSection[data-state="loading"],
body[data-theme="editorial"] #secCompareSection[data-state="loading"],
body[data-theme="editorial"] #cockpitMergedPanel[data-state="loading"] {
  position: relative;
  overflow: hidden;
}

body[data-theme="editorial"] #portfolioSection[data-state="partial"]::before,
body[data-theme="editorial"] #quickCheckSection[data-state="partial"]::before,
body[data-theme="editorial"] #secCompareSection[data-state="partial"]::before,
body[data-theme="editorial"] #cockpitMergedPanel[data-state="partial"]::before,
body[data-theme="editorial"] #portfolioSection[data-state="loading"]::before,
body[data-theme="editorial"] #quickCheckSection[data-state="loading"]::before,
body[data-theme="editorial"] #secCompareSection[data-state="loading"]::before,
body[data-theme="editorial"] #cockpitMergedPanel[data-state="loading"]::before {
  background: var(--ol-gold);
  border-radius: 10px 10px 0 0;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

@media (max-width: 720px) {
  body[data-theme="editorial"] .research-panel-snapshot__kpis {
    grid-template-columns: 1fr;
  }
}

body[data-theme="editorial"] .system-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0 14px 12px;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--ol-accent-border);
  border-left: 3px solid var(--ol-accent);
  border-radius: 10px;
  background: rgba(26, 58, 46, 0.05);
  color: var(--ol-text-soft);
  font-size: 0.88rem;
  line-height: 1.35;
}

body[data-theme="editorial"] #healthRibbon > .system-status-strip {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}

body[data-theme="editorial"] .panel-disclosure > .system-status-strip,
body[data-theme="editorial"] .system-quality-nested > .system-status-strip {
  margin-top: 12px;
}

body[data-theme="editorial"] .system-status-strip strong {
  color: var(--ol-text);
  font-weight: 800;
}

body[data-theme="editorial"] .system-status-strip .muted {
  color: var(--ol-muted-soft) !important;
}

body[data-theme="editorial"] .system-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.14rem 0.48rem;
  border: 1px solid var(--ol-accent-border);
  border-radius: 999px;
  background: var(--ol-accent-soft);
  color: var(--ol-accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-theme="editorial"] .system-status-strip[data-state="success"] {
  border-color: rgba(45, 90, 74, 0.42);
  border-left-color: var(--ol-ok);
  background: rgba(45, 90, 74, 0.08);
}

body[data-theme="editorial"] .system-status-strip[data-state="success"] .system-status-pill {
  border-color: rgba(45, 90, 74, 0.42);
  background: rgba(45, 90, 74, 0.14);
  color: var(--ol-ok);
}

body[data-theme="editorial"] .system-status-strip[data-state="partial"],
body[data-theme="editorial"] .system-status-strip[data-state="loading"] {
  border-color: rgba(176, 133, 42, 0.5);
  border-left-color: var(--ol-gold);
  background: rgba(201, 169, 98, 0.13);
}

body[data-theme="editorial"] .system-status-strip[data-state="partial"] .system-status-pill,
body[data-theme="editorial"] .system-status-strip[data-state="loading"] .system-status-pill {
  border-color: rgba(176, 133, 42, 0.5);
  background: rgba(201, 169, 98, 0.22);
  color: var(--ol-warn);
}

body[data-theme="editorial"] .system-status-strip[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.44);
  border-left-color: var(--ol-bad);
  background: rgba(201, 73, 73, 0.1);
}

body[data-theme="editorial"] .system-status-strip[data-state="error"] .system-status-pill {
  border-color: rgba(201, 73, 73, 0.44);
  background: rgba(201, 73, 73, 0.14);
  color: var(--ol-bad);
}

body[data-theme="editorial"] .system-status-strip[data-state="empty"] {
  border-color: var(--ol-border);
  border-left-color: rgba(26, 58, 46, 0.32);
  background: var(--ol-surface-soft);
}

body[data-theme="editorial"] .system-status-strip[data-state="empty"] .system-status-pill {
  border-color: var(--ol-border);
  background: var(--ol-surface);
  color: var(--ol-muted);
}

body[data-theme="editorial"] .kanban-lane-head {
  border-bottom: 1px solid var(--ol-border) !important;
  margin-bottom: 12px !important;
  padding-bottom: 12px !important;
}

body[data-theme="editorial"] .kanban-lane-step {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
  border-radius: 2px !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.1em !important;
}

body[data-theme="editorial"] #scanMeta,
body[data-theme="editorial"] #scanQualifiedMeta,
body[data-theme="editorial"] .scan-mode-helper,
body[data-theme="editorial"] .scan-title-meta .muted {
  color: var(--ol-muted) !important;
  font-size: 0.82rem !important;
}

body[data-theme="editorial"] table thead th {
  background: var(--ol-surface-soft) !important;
  color: #3f3428 !important;
  border-bottom: 1px solid var(--ol-border) !important;
  font-size: 0.82rem !important; /* 13px+ floor; hierarchy via uppercase + tracking */
  letter-spacing: 0.07em !important;
  text-transform: uppercase;
}

body[data-theme="editorial"] table tbody td {
  color: var(--ol-text-soft) !important;
  border-bottom: 1px solid rgba(26, 26, 26, 0.09) !important;
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
  padding: 12px 10px !important;
}

body[data-theme="editorial"] table tbody tr:hover td,
body[data-theme="editorial"] #scanSection table tbody tr.is-active td {
  background: var(--ol-accent-soft) !important;
}

/* Near-miss panel readability */
body[data-theme="editorial"] .scan-near-miss-panel,
body[data-theme="editorial"] #nearMissPanel {
  border: 1px solid rgba(26, 58, 46, 0.28) !important;
  background: #f3efe2 !important;
  color: #231f1b !important;
  padding: 10px 12px !important;
}

body[data-theme="editorial"] .scan-near-miss-panel > summary,
body[data-theme="editorial"] #nearMissPanel > summary {
  color: #241f1a !important;
  font-size: 0.94rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
}

body[data-theme="editorial"] .scan-near-miss-panel .muted,
body[data-theme="editorial"] #nearMissPanel .muted,
body[data-theme="editorial"] .scan-near-miss-copy {
  color: #4b433b !important;
}

body[data-theme="editorial"] #pendingSection .task-empty,
body[data-theme="editorial"] .report-empty {
  background: var(--ol-surface-soft) !important;
  color: var(--ol-muted) !important;
  border: 1px dashed var(--ol-border) !important;
  font-size: 0.92rem !important;
  line-height: 1.5 !important;
}

/* Status chips: explicit readable text (0.8125rem = 13px floor) */
body[data-theme="editorial"] .pill,
body[data-theme="editorial"] .chip,
body[data-theme="editorial"] .health-badge {
  background: var(--ol-surface-soft) !important;
  color: #2a2a2a !important;
  border: 1px solid rgba(26, 58, 46, 0.24) !important;
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .health-badge.bg-green-900,
body[data-theme="editorial"] .health-badge.bg-slate-900 {
  background: var(--ol-surface-soft) !important;
  color: var(--ol-muted) !important;
  border-color: var(--ol-border) !important;
}

body[data-theme="editorial"] .health-badge.bg-green-900 {
  background: var(--ol-accent-soft) !important;
  color: var(--ol-accent) !important;
  border-color: var(--ol-accent-border) !important;
}

body[data-theme="editorial"] .health-badge.bg-red-900 {
  background: rgba(158, 63, 54, 0.12) !important;
  color: var(--ol-bad) !important;
  border-color: rgba(158, 63, 54, 0.38) !important;
}

/* Action center readability: high contrast by semantic state */
body[data-theme="editorial"] .action-center,
body[data-theme="editorial"] #actionCenter {
  border: 1px solid rgba(47, 42, 37, 0.18) !important;
  border-left: 4px solid var(--ol-accent) !important;
  background: rgba(26, 58, 46, 0.04) !important;
  color: #1d1a17 !important;
}

body[data-theme="editorial"] .action-center strong,
body[data-theme="editorial"] #actionCenter strong {
  color: #1a1714 !important;
  font-style: normal !important;
  font-weight: 700 !important;
}

body[data-theme="editorial"] .action-center p,
body[data-theme="editorial"] .action-center .muted,
body[data-theme="editorial"] #actionCenter p,
body[data-theme="editorial"] #actionCenter .muted {
  color: #342f2a !important;
}

body[data-theme="editorial"] .action-center.info,
body[data-theme="editorial"] #actionCenter.info {
  background: #f1f4fb !important;
  border-left-color: #315d9a !important;
}

body[data-theme="editorial"] .action-center.success,
body[data-theme="editorial"] #actionCenter.success {
  background: #eef8f2 !important;
  border-left-color: #2f6b4f !important;
}

body[data-theme="editorial"] .action-center.warn,
body[data-theme="editorial"] #actionCenter.warn {
  background: #fcf4e8 !important;
  border-left-color: #8a5c1f !important;
}

body[data-theme="editorial"] .action-center.error,
body[data-theme="editorial"] #actionCenter.error {
  background: #fbeeee !important;
  border-left-color: #9e3f36 !important;
}

/* Research, diagnostics, settings consistency */
body[data-theme="editorial"] #toolsSection .tool-card,
body[data-theme="editorial"] #toolsSection .tool-card:hover,
body[data-theme="editorial"] #decisionDashboardCard,
body[data-theme="editorial"] #statusDetailsPanel,
body[data-theme="editorial"] #onboardingSection,
body[data-theme="editorial"] #settingsSection {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* SEC compare: declutter dense control wall */
body[data-theme="editorial"] #secCompareSection {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border-strong) !important;
}

body[data-theme="editorial"] .sec-compare-controls {
  margin: 0 14px 10px;
  padding: 12px;
  border: 1px solid var(--ol-border);
  background: var(--ol-surface-soft) !important;
  border-radius: 4px;
  display: grid;
  gap: 10px;
}

body[data-theme="editorial"] .sec-compare-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: end;
}

body[data-theme="editorial"] .sec-compare-grid .field-label {
  margin: 0;
}

body[data-theme="editorial"] .sec-compare-help {
  display: block;
  font-size: 0.84rem !important;
  line-height: 1.45;
}

body[data-theme="editorial"] .sec-compare-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

body[data-theme="editorial"] .sec-compare-toggles label {
  font-size: 0.86rem !important;
}

body[data-theme="editorial"] .sec-compare-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

body[data-theme="editorial"] .sec-compare-profile-panel {
  margin: 0 !important;
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border) !important;
}

body[data-theme="editorial"] .sec-compare-profile-panel .panel-disclosure-summary {
  font-size: 0.86rem !important;
}

body[data-theme="editorial"] .sec-compare-profile-actions {
  display: flex;
  align-items: end;
}

body[data-theme="editorial"] .sec-compare-history {
  margin-top: 8px;
}

body[data-theme="editorial"] #secComparePresetButtons {
  margin: 0 14px 8px !important;
  padding: 0 !important;
}

body[data-theme="editorial"] #secCompareMeta {
  margin: 0 14px 10px !important;
  padding: 0 !important;
}

body[data-theme="editorial"] .mgmt-dashboard {
  margin: 0 14px 10px !important;
  gap: 10px;
}

body[data-theme="editorial"] .mgmt-card {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .mgmt-card h4,
body[data-theme="editorial"] .mgmt-card-title-row h4 {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .mgmt-badge {
  background: var(--ol-surface-soft) !important;
  border: 1px solid var(--ol-border) !important;
  color: var(--ol-muted) !important;
}

@media (max-width: 1100px) {
  body[data-theme="editorial"] .sec-compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-theme="editorial"] .sec-compare-grid {
    grid-template-columns: 1fr;
  }
  body[data-theme="editorial"] .sec-compare-controls {
    margin: 0 10px 8px;
    padding: 10px;
  }
  body[data-theme="editorial"] #secComparePresetButtons,
  body[data-theme="editorial"] #secCompareMeta,
  body[data-theme="editorial"] .mgmt-dashboard {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }
}

body[data-theme="editorial"] .panel-disclosure-summary {
  background: var(--ol-surface-soft) !important;
  color: var(--ol-text) !important;
  border-bottom: 1px solid var(--ol-border) !important;
  font-size: 0.92rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body[data-theme="editorial"] .panel-disclosure > *:not(summary),
body[data-theme="editorial"] details > *:not(summary) {
  color: var(--ol-text-soft);
}

body[data-theme="editorial"] .panel-disclosure .disclosure-hint,
body[data-theme="editorial"] .scan-block-hint,
body[data-theme="editorial"] .compare-meta,
body[data-theme="editorial"] .tool-card-desc {
  color: var(--ol-muted-soft) !important;
}

/* Global summary readability sweep */
body[data-theme="editorial"] details > summary {
  color: #201c18 !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.01em !important;
}

body[data-theme="editorial"] details > summary:hover {
  color: #14110f !important;
}

body[data-theme="editorial"] details[open] > summary {
  border-bottom-color: rgba(26, 26, 26, 0.2) !important;
}

body[data-theme="editorial"] .panel-disclosure-summary {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
}

body[data-theme="editorial"] .panel-disclosure .disclosure-hint {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
}

body[data-theme="editorial"] .scan-detail-stat strong,
body[data-theme="editorial"] .hero-kpi-value,
body[data-theme="editorial"] .mono-nums {
  color: #1e1b18 !important;
}

body[data-theme="editorial"] .scan-detail-stat small,
body[data-theme="editorial"] .scan-detail-stat .muted,
body[data-theme="editorial"] .stat small,
body[data-theme="editorial"] .validation-steps-list .muted,
body[data-theme="editorial"] .report-bullets .muted {
  color: var(--ol-muted-soft) !important;
}

body[data-theme="editorial"] .table-wrap {
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 4px;
  background: #fffdf9;
}

body[data-theme="editorial"] .table-wrap table {
  background: transparent;
}

body[data-theme="editorial"] .stats .stat,
body[data-theme="editorial"] .health-tile,
body[data-theme="editorial"] .task-card {
  background: #fbf7ef !important;
  border-color: rgba(26, 26, 26, 0.14) !important;
}

body[data-theme="editorial"] .health-label,
body[data-theme="editorial"] .stat-label {
  color: #3c352f !important;
}

body[data-theme="editorial"] .task-empty::before {
  color: #4f4236 !important;
}

body[data-theme="editorial"] code,
body[data-theme="editorial"] pre,
body[data-theme="editorial"] .code-block {
  color: #28231f !important;
  background: #f6f0e4 !important;
  border-color: rgba(26, 26, 26, 0.15) !important;
}

body[data-theme="editorial"] #scanSection .chip,
body[data-theme="editorial"] #scanSection .pill,
body[data-theme="editorial"] #scanSection .scan-blockers-chip {
  background: #ece5d5 !important;
  color: #2a2a2a !important;
  border-color: rgba(26, 58, 46, 0.26) !important;
}

body[data-theme="editorial"] .warn,
body[data-theme="editorial"] .warn-text {
  color: #5a230f !important;
}

body[data-theme="editorial"] .good {
  color: #234c39 !important;
}

body[data-theme="editorial"] .workspace-intro h2 {
  font-size: 1.34rem !important;
}

body[data-theme="editorial"] .workspace-intro .muted,
body[data-theme="editorial"] .workspace-eyebrow {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .site-footer {
  border-top: 1px solid var(--ol-border) !important;
  color: var(--ol-muted) !important;
}

/* Focus and keyboard visibility */
body[data-theme="editorial"] :focus-visible {
  outline: 2px solid var(--ol-accent) !important;
  outline-offset: 2px;
}

/* overhaul.css sets `outline: none !important` on input/select/textarea
 * :focus, which silently removed keyboard focus visibility on every form
 * field. Re-assert the outline here (readability.css loads last, so equal
 * specificity + !important wins) for keyboard focus only. */
body[data-theme="editorial"] input:focus-visible,
body[data-theme="editorial"] select:focus-visible,
body[data-theme="editorial"] textarea:focus-visible {
  outline: 2px solid var(--ol-accent) !important;
  outline-offset: 2px;
}

/* styles.css removes the outline on the scan-blockers chip; keep it visible
 * for keyboard users (background tint alone is not a focus indicator). */
body[data-theme="editorial"] .scan-blockers-chip:focus-visible {
  outline: 2px solid var(--ol-accent) !important;
  outline-offset: 2px;
}

@media (max-width: 1080px) {
  body[data-theme="editorial"] .mode-header {
    grid-template-columns: 1fr;
  }
  body[data-theme="editorial"] .mode-header-kpis {
    border-left: 0 !important;
    border-top: 1px solid var(--ol-border) !important;
  }
}

/* ============================================================
   Old Logan editorial finish — softened geometry, forest/gold
   accents, mono eyebrows, frosted cream chrome.
============================================================ */
body[data-theme="editorial"] {
  --radius-card: 8px;
  --radius-pill: 6px;
}

/* Frosted cream topbar (marketing nav) */
body[data-theme="editorial"] .app-topbar {
  background: rgba(245, 241, 232, 0.98) !important;
  border-bottom: 1px solid var(--ol-topbar-border) !important;
  backdrop-filter: saturate(1.05) blur(10px);
  -webkit-backdrop-filter: saturate(1.05) blur(10px);
}

/* Softened-rectangular surfaces */
body[data-theme="editorial"] .card,
body[data-theme="editorial"] .mode-header,
body[data-theme="editorial"] #workflowPrimary,
body[data-theme="editorial"] .operate-kanban,
body[data-theme="editorial"] .operate-kanban .kanban-lane,
body[data-theme="editorial"] .panel-disclosure,
body[data-theme="editorial"] .health-tile,
body[data-theme="editorial"] .stats .stat,
body[data-theme="editorial"] .task-card,
body[data-theme="editorial"] #toolsSection .tool-card,
body[data-theme="editorial"] .mgmt-card,
body[data-theme="editorial"] #decisionDashboardCard,
body[data-theme="editorial"] #statusDetailsPanel,
body[data-theme="editorial"] #onboardingSection,
body[data-theme="editorial"] #settingsSection {
  border-radius: 8px !important;
}

body[data-theme="editorial"] .btn,
body[data-theme="editorial"] input,
body[data-theme="editorial"] select,
body[data-theme="editorial"] textarea {
  border-radius: 6px !important;
}

body[data-theme="editorial"] .pill,
body[data-theme="editorial"] .chip,
body[data-theme="editorial"] .health-badge {
  border-radius: 4px !important;
}

/* Primary CTA: forest default, darker green on hover */
body[data-theme="editorial"] .btn.primary:hover,
body[data-theme="editorial"] .app-topbar #scanBtn.btn.primary:hover {
  background: var(--ol-accent-hover) !important;
  border-color: var(--ol-accent-hover) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .btn.primary:active,
body[data-theme="editorial"] .app-topbar #scanBtn.btn.primary:active {
  background: var(--ol-accent-pressed) !important;
  border-color: var(--ol-accent-pressed) !important;
}

/* Active tab: ink fill with a gold underline cue */
body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] {
  box-shadow: inset 0 -2px 0 var(--ol-gold) !important;
}

/* Mono uppercase eyebrow / caption labels (institutional voice) */
body[data-theme="editorial"] .workspace-eyebrow,
body[data-theme="editorial"] .hero-kpi-label,
body[data-theme="editorial"] .stat-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8125rem !important; /* 13px floor for supporting labels */
  font-weight: 600 !important;
}

/* Forest step markers in the operations kanban */
body[data-theme="editorial"] .kanban-lane-step {
  background: var(--ol-accent) !important;
  color: #f5f1e8 !important;
}

/* Workflow-strip lanes (research/diagnostics/settings) on cream */
body[data-theme="editorial"] .research-lane,
body[data-theme="editorial"] .diagnostics-lane,
body[data-theme="editorial"] .settings-lane,
body[data-theme="editorial"] .operations-workspace-intro {
  background: var(--ol-surface-soft) !important;
  border: 1px solid var(--ol-border) !important;
  border-radius: 8px !important;
}

body[data-theme="editorial"] .research-lane h3,
body[data-theme="editorial"] .diagnostics-lane h3,
body[data-theme="editorial"] .settings-lane h3 {
  color: var(--ol-text) !important;
  font-family: "Fraunces", Georgia, serif !important;
}

body[data-theme="editorial"] .research-lane p,
body[data-theme="editorial"] .diagnostics-lane p,
body[data-theme="editorial"] .settings-lane p {
  color: var(--ol-text-soft) !important;
}

/* Overlays (modals + drawers) on cream — these stayed dark in the legacy pass */
body[data-theme="editorial"] dialog.modal,
body[data-theme="editorial"] .trade-drawer,
body[data-theme="editorial"] .activity-drawer-body,
body[data-theme="editorial"] .activity-drawer-toggle {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border-strong) !important;
  color: var(--ol-text) !important;
  border-radius: 8px !important;
}

body[data-theme="editorial"] dialog.modal h3,
body[data-theme="editorial"] .trade-drawer h3 {
  color: var(--ol-text) !important;
  font-style: normal !important;
  font-family: "Fraunces", Georgia, serif !important;
}

body[data-theme="editorial"] dialog.modal p,
body[data-theme="editorial"] dialog.modal li,
body[data-theme="editorial"] dialog.modal .muted,
body[data-theme="editorial"] .trade-drawer p,
body[data-theme="editorial"] .trade-drawer .muted,
body[data-theme="editorial"] .activity-drawer-body,
body[data-theme="editorial"] .activity-drawer-body .muted {
  color: var(--ol-text-soft) !important;
}

body[data-theme="editorial"] dialog.modal::backdrop {
  background: rgba(26, 26, 26, 0.42) !important;
  backdrop-filter: blur(2px);
}

body[data-theme="editorial"] .trade-drawer-tab.active {
  border-bottom: 2px solid var(--ol-gold) !important;
  color: var(--ol-accent) !important;
}

/* ============================================================
   Old Logan polish pass — editorial typographic finish
============================================================ */

/* Display headings: subtle negative tracking, a touch more presence */
body[data-theme="editorial"] .mode-header-title,
body[data-theme="editorial"] h1,
body[data-theme="editorial"] h2 {
  letter-spacing: -0.012em !important;
}
body[data-theme="editorial"] .mode-header-title {
  font-weight: 700 !important;
}

/* Eyebrows: quiet forest small-caps for brand cohesion */
body[data-theme="editorial"] .workspace-eyebrow,
body[data-theme="editorial"] .mode-header .workspace-eyebrow {
  color: var(--ol-accent) !important;
}

/* Mode-header accent stripe in gold; KPI numerals in serif */
body[data-theme="editorial"] .mode-header::before {
  background: var(--ol-gold) !important;
}
body[data-theme="editorial"] .mode-header-kpis .hero-kpi-value {
  font-family: "Fraunces", Georgia, serif !important;
  letter-spacing: -0.01em !important;
}

/* Tab numerals: quiet, monospaced — never ol/gold as text (AA fail on cream) */
body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn .tab-num {
  color: var(--ol-muted) !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
}
body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] .tab-num {
  color: var(--ol-on-accent) !important;
}
body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn:not([aria-selected="true"]):hover {
  color: var(--ol-accent) !important;
}

/* Brand wordmark: tighter editorial tracking */
body[data-theme="editorial"] .app-topbar-brand .brand-text {
  letter-spacing: -0.01em !important;
}

/* Smooth control transitions */
body[data-theme="editorial"] .btn,
body[data-theme="editorial"] .screen-switch-btn,
body[data-theme="editorial"] a {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* A bit more air between stacked sections */
body[data-theme="editorial"] main.container {
  gap: 18px !important;
}

/* Editorial text selection (ink-on-cream inverse) */
body[data-theme="editorial"] ::selection {
  background: var(--ol-accent);
  color: var(--ol-on-accent);
}

/* Thin editorial scrollbars (forest on cream) */
body[data-theme="editorial"] * {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 58, 46, 0.38) transparent;
}
body[data-theme="editorial"] ::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
body[data-theme="editorial"] ::-webkit-scrollbar-track {
  background: transparent;
}
body[data-theme="editorial"] ::-webkit-scrollbar-thumb {
  background: rgba(26, 58, 46, 0.32);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
body[data-theme="editorial"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 58, 46, 0.5);
  background-clip: padding-box;
}

/* Global chrome and dense-control cleanup */
body[data-theme="editorial"] .app-topbar {
  gap: 12px !important;
  padding: 10px clamp(12px, 2vw, 22px) !important;
}

body[data-theme="editorial"] .app-topbar-tabs {
  min-width: 0;
  max-width: 100%;
}

body[data-theme="editorial"] .app-topbar-actions {
  gap: 8px !important;
  align-items: center !important;
}

body[data-theme="editorial"] .app-topbar-actions .topbar-detail {
  min-width: 0;
}

body[data-theme="editorial"] .app-topbar-actions .topbar-detail select {
  max-width: 168px;
}

body[data-theme="editorial"] .mode-header-anchors {
  gap: 0.45rem 0.65rem !important;
}

body[data-theme="editorial"] .mode-header-anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.18rem 0.46rem;
  border: 1px solid var(--ol-border);
  border-radius: 999px;
  background: var(--ol-surface);
  color: var(--ol-accent) !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none !important;
}

body[data-theme="editorial"] .mode-header-anchors a.active,
body[data-theme="editorial"] .mode-header-anchors a:hover {
  border-color: var(--ol-accent-border);
  background: var(--ol-accent-soft);
}

body[data-theme="editorial"] .inline-form,
body[data-theme="editorial"] .sec-compare-actions,
body[data-theme="editorial"] .backtest-actions,
body[data-theme="editorial"] .settings-guardrails-row,
body[data-theme="editorial"] .chat-input-row {
  gap: 0.55rem 0.65rem !important;
}

body[data-theme="editorial"] .backtest-form-grid,
body[data-theme="editorial"] .advanced-grid,
body[data-theme="editorial"] .sec-compare-grid {
  align-items: end;
}

body[data-theme="editorial"] .advanced-details,
body[data-theme="editorial"] #reportAdvancedOptions,
body[data-theme="editorial"] #secCompareProfilePanel,
body[data-theme="editorial"] .stage-trade-panel {
  border: 1px solid var(--ol-border) !important;
  border-radius: 10px !important;
  background: var(--ol-surface-soft) !important;
}

body[data-theme="editorial"] .advanced-details > summary,
body[data-theme="editorial"] #reportAdvancedOptions > summary,
body[data-theme="editorial"] #secCompareProfilePanel > summary,
body[data-theme="editorial"] .stage-trade-panel > summary {
  background: transparent !important;
}

body[data-theme="editorial"] .trade-drawer {
  width: min(560px, calc(100vw - 24px)) !important;
}

body[data-theme="editorial"] .activity-drawer {
  max-width: min(420px, calc(100vw - 20px));
}

body[data-theme="editorial"] .activity-drawer-body {
  max-height: min(70vh, 720px);
}

body[data-theme="editorial"] .mobile-primary-dock {
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
}

body[data-theme="editorial"] .mobile-primary-dock .btn {
  flex: 1 1 0;
  justify-content: center;
  min-width: 0;
}

@media (max-width: 1180px) {
  body[data-theme="editorial"] .app-topbar {
    align-items: stretch !important;
  }

  body[data-theme="editorial"] .app-topbar-tabs {
    order: 3;
    flex-basis: 100%;
  }

  body[data-theme="editorial"] .app-topbar-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  body[data-theme="editorial"] main.container {
    width: min(100%, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-x: clip;
  }

  body[data-theme="editorial"] .mode-header,
  body[data-theme="editorial"] .mode-header-copy,
  body[data-theme="editorial"] .mode-header-actions,
  body[data-theme="editorial"] .dashboard-today-stack,
  body[data-theme="editorial"] .today-summary-landing,
  body[data-theme="editorial"] .today-summary-grid,
  body[data-theme="editorial"] .today-summary-kpi,
  body[data-theme="editorial"] .research-summary-landing,
  body[data-theme="editorial"] .research-summary-grid,
  body[data-theme="editorial"] .research-summary-kpi,
  body[data-theme="editorial"] .system-summary-landing,
  body[data-theme="editorial"] .system-summary-grid,
  body[data-theme="editorial"] .system-summary-kpi,
  body[data-theme="editorial"] .settings-summary-landing,
  body[data-theme="editorial"] .settings-summary-grid,
  body[data-theme="editorial"] .settings-summary-kpi {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  body[data-theme="editorial"] .today-summary-grid,
  body[data-theme="editorial"] .research-summary-grid,
  body[data-theme="editorial"] .system-summary-grid,
  body[data-theme="editorial"] .settings-summary-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-theme="editorial"] .app-topbar {
    position: sticky;
    top: 0;
  }

  body[data-theme="editorial"] .app-topbar-brand .brand-text {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-theme="editorial"] .app-topbar-actions .topbar-detail,
  body[data-theme="editorial"] .app-topbar-actions #refreshBtn {
    display: none !important;
  }

  body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body[data-theme="editorial"] .screen-switch-btn .tab-num {
    display: none;
  }

  body[data-theme="editorial"] .mode-header-anchors {
    display: none !important;
  }

  body[data-theme="editorial"] .inline-form input,
  body[data-theme="editorial"] .inline-form select,
  body[data-theme="editorial"] .inline-form textarea {
    min-width: 0;
    width: 100%;
  }

  body[data-theme="editorial"] .inline-form .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   Old Logan polish pass 2 — data legibility + brand cohesion
============================================================ */

/* Tabular, lining numerals for ledger-style data alignment */
body[data-theme="editorial"] .mono-nums,
body[data-theme="editorial"] .hero-kpi-value,
body[data-theme="editorial"] .scan-detail-stat strong,
body[data-theme="editorial"] table tbody td {
  font-variant-numeric: tabular-nums;
}

/* Fold the "info" status into the palette (muted slate, not bright blue) */
body[data-theme="editorial"] .action-center.info,
body[data-theme="editorial"] #actionCenter.info {
  background: #eef1f3 !important;
  border-left-color: #46586a !important;
}

/* Refined disabled controls */
body[data-theme="editorial"] .btn:disabled,
body[data-theme="editorial"] .btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}

/* In-content links: editorial underline that warms to forest on hover */
body[data-theme="editorial"] .mode-header-lead a,
body[data-theme="editorial"] p a,
body[data-theme="editorial"] li a {
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 58, 46, 0.32);
}
body[data-theme="editorial"] .mode-header-lead a:hover,
body[data-theme="editorial"] p a:hover,
body[data-theme="editorial"] li a:hover {
  border-bottom-color: var(--ol-accent);
}

/* Section titles: subtle gold bracket accent (echoes the marketing site) */
body[data-theme="editorial"] .section-title {
  border-left: 3px solid var(--ol-gold) !important;
  padding-left: 14px !important;
}

/* Mode-header anchor links warm to forest on hover */
body[data-theme="editorial"] .mode-header-anchors a:hover {
  color: var(--ol-accent) !important;
}

/* Semantic status chips (good / caution / blocked / info) in palette tones.
   Scoped with #scanSection too so they beat the generic scan-chip override. */
body[data-theme="editorial"] .pill.good,
body[data-theme="editorial"] .chip.good,
body[data-theme="editorial"] #scanSection .pill.good,
body[data-theme="editorial"] #scanSection .chip.good {
  background: rgba(45, 90, 74, 0.14) !important;
  color: #234c39 !important;
  border-color: rgba(45, 90, 74, 0.42) !important;
}
body[data-theme="editorial"] .pill.warn,
body[data-theme="editorial"] .chip.warn,
body[data-theme="editorial"] #scanSection .pill.warn,
body[data-theme="editorial"] #scanSection .chip.warn {
  background: rgba(201, 169, 98, 0.22) !important;
  color: #6f5410 !important;
  border-color: rgba(176, 133, 42, 0.5) !important;
}
body[data-theme="editorial"] .pill.bad,
body[data-theme="editorial"] .chip.bad,
body[data-theme="editorial"] #scanSection .pill.bad,
body[data-theme="editorial"] #scanSection .chip.bad {
  background: rgba(201, 73, 73, 0.14) !important;
  color: #9e3434 !important;
  border-color: rgba(201, 73, 73, 0.44) !important;
}
body[data-theme="editorial"] .pill.neutral,
body[data-theme="editorial"] .chip.neutral,
body[data-theme="editorial"] #scanSection .pill.neutral,
body[data-theme="editorial"] #scanSection .chip.neutral {
  background: rgba(70, 88, 106, 0.12) !important;
  color: #3f4d5c !important;
  border-color: rgba(70, 88, 106, 0.42) !important;
}

/* Kanban lanes: neutral frame with a deliberate forest left edge (ledger cue) */
body[data-theme="editorial"] .operate-kanban .kanban-lane {
  border-color: var(--ol-border) !important;
  border-left: 3px solid rgba(26, 58, 46, 0.5) !important;
}

/* Accent status chip (info / running states) */
body[data-theme="editorial"] .pill.accent,
body[data-theme="editorial"] .chip.accent,
body[data-theme="editorial"] .health-badge.pill-accent {
  background: var(--ol-accent-soft) !important;
  color: var(--ol-accent) !important;
  border-color: var(--ol-accent-border) !important;
}

/* Mobile dock: match primary forest green */
body[data-theme="editorial"] .mobile-primary-dock {
  background: rgba(245, 241, 232, 0.98) !important;
  border-top: 1px solid var(--ol-topbar-border) !important;
}

body[data-theme="editorial"] .mobile-primary-dock .btn.primary {
  background: var(--ol-accent) !important;
  border-color: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .mobile-primary-dock .btn.primary:hover {
  background: var(--ol-accent-hover) !important;
  border-color: var(--ol-accent-hover) !important;
}

/* Secondary actions: cream surface with forest outline (matches primary family) */
body[data-theme="editorial"] .btn.secondary {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-accent-border) !important;
  color: var(--ol-accent) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .btn.secondary:hover {
  background: var(--ol-accent-soft) !important;
  border-color: var(--ol-accent) !important;
  color: var(--ol-accent-hover) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .btn.good {
  background: var(--ol-accent-2) !important;
  border-color: var(--ol-accent-2) !important;
  color: var(--ol-on-accent) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .btn.bad {
  background: var(--ol-bad) !important;
  border-color: var(--ol-bad) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* Scan triage status filter + gate chips */
body[data-theme="editorial"] .scan-status-filter {
  border-color: var(--ol-border) !important;
  background: var(--ol-surface-soft) !important;
}
body[data-theme="editorial"] .scan-status-filter__btn {
  color: var(--ol-muted) !important;
  font-size: 0.78rem !important;
}
body[data-theme="editorial"] .scan-status-filter__btn.is-active {
  color: var(--ol-text) !important;
  background: var(--ol-surface) !important;
  box-shadow: inset 0 0 0 1px var(--ol-border-strong) !important;
}
body[data-theme="editorial"] .scan-gate-chip--pass {
  border-color: rgba(45, 90, 74, 0.42) !important;
  background: rgba(45, 90, 74, 0.12) !important;
  color: var(--ol-ok) !important;
}
body[data-theme="editorial"] .scan-gate-chip--review {
  border-color: rgba(176, 133, 42, 0.5) !important;
  background: rgba(201, 169, 98, 0.16) !important;
  color: var(--ol-warn) !important;
}
body[data-theme="editorial"] .scan-gate-chip--blocked {
  border-color: rgba(201, 73, 73, 0.44) !important;
  background: rgba(201, 73, 73, 0.12) !important;
  color: var(--ol-bad) !important;
}
body[data-theme="editorial"] .scan-gate-chip--info {
  border-color: var(--ol-border) !important;
  background: var(--ol-surface-soft) !important;
  color: var(--ol-muted) !important;
}
body[data-theme="editorial"] .scan-row-action--primary {
  border-color: var(--ol-accent) !important;
  background: var(--ol-accent-soft) !important;
  color: var(--ol-accent) !important;
}
body[data-theme="editorial"] .scan-brief-triage {
  border-bottom-color: var(--ol-border) !important;
}
body[data-theme="editorial"] #scanSection.kanban-lane {
  display: flex !important;
  flex-direction: column !important;
}
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
body[data-theme="editorial"] #scanSection .qualified-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
}
body[data-theme="editorial"] #scanSection .scan-list-pane:has(tr.scan-row--empty) .qualified-table-wrap {
  flex: 1 1 auto !important;
  min-height: clamp(220px, 30vh, 480px) !important;
}
body[data-theme="editorial"] #scanSection .scan-list-pane:not(:has(tr.scan-row--empty)) .qualified-table-wrap {
  flex: 0 1 auto !important;
  min-height: 0 !important;
}
body[data-theme="editorial"] #scanSection .near-miss-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
}
body[data-theme="editorial"] #scanSection .scan-near-miss-panel {
  width: 100% !important;
  margin-top: 12px !important;
}
body[data-theme="editorial"] #scanSection .scan-list-pane:has(tr.scan-row--empty) .scan-near-miss-panel {
  margin-top: auto !important;
}
/* Ticker absorbs leftover; Actions pin right. Never reintroduce a spacer column. */
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage th:nth-child(1),
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage td:nth-child(1),
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-col-ticker,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-triage-col-ticker {
  width: auto !important;
  min-width: 14rem !important;
  max-width: none !important;
}
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage th:nth-child(6),
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage td:nth-child(6),
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-col-rank,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-triage-col-rank {
  width: 4rem !important;
  text-align: right !important;
  font-family: inherit !important;
}
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-actions-cell,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-th-actions,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-triage-col-actions,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage th:nth-child(8),
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage td:nth-child(8) {
  width: 13.75rem !important;
  min-width: 13.75rem !important;
  max-width: 13.75rem !important;
  font-family: inherit !important;
  font-variant-numeric: normal !important;
}
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-company-name,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-ticker-meta,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-row-why {
  color: var(--ol-muted) !important;
}
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage .scan-row-why {
  color: var(--ol-ink-secondary, var(--ol-muted)) !important;
  font-size: 0.7rem !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
}
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage td.scan-col-ticker,
body[data-theme="editorial"] #scanSection .scan-candidates-table--triage td.scan-col-stop {
  white-space: normal !important;
}
body[data-theme="editorial"] .scan-results-layout {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
}
body[data-theme="editorial"] .scan-list-pane {
  gap: 10px;
  width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
body[data-theme="editorial"] .scan-detail-panel[data-state="empty"] {
  min-height: 0 !important;
}
body[data-theme="editorial"] #scanDetailPanel.kanban-lane[data-state="empty"] {
  /* Beat operate-kanban .kanban-lane min-height so empty Lane 2 doesn't leave a tall blank. */
  min-height: 0 !important;
}
body[data-theme="editorial"] .scan-detail-chart:not(:has(.scan-detail-chart-canvas)) {
  min-height: 0 !important;
}

body[data-theme="editorial"] details > summary:hover {
  color: var(--ol-accent) !important;
}

/* Dashboard readability pass: scan diagnostics, provenance, and market context */
body[data-theme="editorial"] .ops-disclosure-title {
  color: var(--ol-text) !important;
  font-family: "Fraunces", Georgia, serif !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

body[data-theme="editorial"] .panel-disclosure-summary {
  position: relative;
  padding-right: 38px !important;
}

body[data-theme="editorial"] .panel-disclosure-summary::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 50%;
  color: var(--ol-muted-soft);
  font-size: 1.15rem;
  line-height: 1;
  transform: translateY(-50%) rotate(90deg);
  transition: transform 0.16s ease, color 0.16s ease;
}

body[data-theme="editorial"] details[open] > .panel-disclosure-summary::after {
  color: var(--ol-accent);
  transform: translateY(-50%) rotate(270deg);
}

body[data-theme="editorial"] .prov-chip {
  background: var(--ol-surface-soft) !important;
  color: var(--ol-text-soft) !important;
  border-color: rgba(26, 58, 46, 0.24) !important;
  font-size: 0.82rem !important;
  font-weight: 650;
  letter-spacing: 0;
}

body[data-theme="editorial"] .prov-chip.prov-high {
  background: rgba(45, 90, 74, 0.14) !important;
  color: #234c39 !important;
  border-color: rgba(45, 90, 74, 0.42) !important;
}

body[data-theme="editorial"] .prov-chip.prov-medium {
  background: rgba(201, 169, 98, 0.22) !important;
  color: #6f5410 !important;
  border-color: rgba(176, 133, 42, 0.5) !important;
}

body[data-theme="editorial"] .prov-chip.prov-low {
  background: rgba(201, 73, 73, 0.14) !important;
  color: #9e3434 !important;
  border-color: rgba(201, 73, 73, 0.44) !important;
}

body[data-theme="editorial"] .prov-chip__source {
  color: inherit;
  font-weight: 700;
}

body[data-theme="editorial"] .kanban-lane-step {
  color: var(--ol-muted, #5a5a5a);
}

body[data-theme="editorial"] .kanban-lane-summary {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ol-muted, #5a5a5a);
}

body[data-theme="editorial"] .kanban-lane-summary[data-state="success"] {
  color: var(--ol-ok, #2d5a4a);
}

body[data-theme="editorial"] .kanban-lane-summary[data-state="partial"],
body[data-theme="editorial"] .kanban-lane-summary[data-state="loading"] {
  color: var(--ol-warn, #8a5c1f);
}

body[data-theme="editorial"] .kanban-lane-summary[data-state="error"] {
  color: var(--ol-bad, #c94949);
}

body[data-theme="editorial"] .kanban-lane-summary[data-state="empty"] {
  color: var(--ol-muted, #5a5a5a);
}

.kanban-lane-head {
  flex-wrap: wrap;
}

.kanban-lane-summary {
  flex: 1 1 100%;
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.signal-trust-row,
.pending-trust-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.15rem 0 0.55rem;
}

.signal-trust-chips,
.pending-trust-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.signal-trust-filter-hint,
.pending-filter-hint {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
}

body[data-theme="editorial"] .scan-detail-trust .signal-trust-row {
  margin-top: 0.35rem;
}

#pendingBoard[data-state="loading"] .task-empty,
#pendingBoard[data-state="empty"] .task-empty {
  padding: 1rem 0.75rem;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--ol-border, #d8cdb8) 80%, transparent);
  background: #fbf7ef;
}

#pendingBoard[data-state="error"] .async-state-error,
#pendingBoard[data-state="loading"] .task-empty {
  color: var(--ol-muted, #5a5a5a);
}

#pendingBoard[data-state="error"] {
  border-color: color-mix(in srgb, var(--ol-bad, #c94949) 35%, var(--ol-border, #d8cdb8));
}

body[data-theme="editorial"] .prov-chip__confidence,
body[data-theme="editorial"] .prov-chip__stale {
  color: inherit;
}

/* Dark-surface panels → readable editorial cream (Operations + drawer) */
body[data-theme="editorial"] .scan-brief-card,
body[data-theme="editorial"] #scanDetailPanel .scan-brief-card {
  background: var(--ol-surface, #fffefb) !important;
  border-color: var(--ol-border, #d8cdb8) !important;
  color: var(--ol-text, #1a1a1a) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .scan-brief-content,
body[data-theme="editorial"] .scan-brief-setup,
body[data-theme="editorial"] .scan-brief-header strong,
body[data-theme="editorial"] .scan-brief-detail,
body[data-theme="editorial"] .scan-brief-detail > summary,
body[data-theme="editorial"] .scan-brief-detail p,
body[data-theme="editorial"] .scan-brief-sections li {
  color: var(--ol-text-soft, #3c352f) !important;
}

body[data-theme="editorial"] .scan-brief-detail {
  background: #fbf7ef !important;
  border-color: var(--ol-border, #d8cdb8) !important;
}

body[data-theme="editorial"] .scan-brief-detail[open] {
  background: #fffefb !important;
  border-color: color-mix(in srgb, var(--ol-accent, #1a3a2e) 22%, var(--ol-border, #d8cdb8)) !important;
}

body[data-theme="editorial"] .tool-summary-card {
  background: var(--ol-surface, #fffefb) !important;
  border-color: var(--ol-border, #d8cdb8) !important;
  color: var(--ol-text, #1a1a1a) !important;
}

body[data-theme="editorial"] .tool-summary-list li,
body[data-theme="editorial"] .tool-summary-p,
body[data-theme="editorial"] .tool-summary-reasons .muted {
  color: var(--ol-text-soft, #3c352f) !important;
}

body[data-theme="editorial"] .tool-summary-list--compact li {
  font-size: 0.82rem;
  line-height: 1.45;
}

body[data-theme="editorial"] .tool-summary-list .pill.small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

#scanSection[data-state="loading"] #scanJobProgressWrap:not(.hidden),
#scanSection[data-state="loading"] .scan-integrity-banner {
  opacity: 0.85;
}

#scanSection[data-state="error"] {
  border-color: color-mix(in srgb, var(--ol-bad, #c94949) 28%, var(--ol-border, #d8cdb8));
}

#scanDetailPanel[data-state="empty"] .scan-detail-chart,
#scanDetailPanel[data-state="empty"] #scanDetailBriefCard {
  opacity: 0.92;
}

#scanDetailBriefCard[data-state="loading"] .scan-brief-content {
  color: var(--ol-warn, #8a5c1f);
}

#scanDetailBriefCard[data-state="error"] {
  border-color: color-mix(in srgb, var(--ol-bad, #c94949) 35%, var(--ol-border, #d8cdb8));
}

#scanDetailBriefCard[data-state="loading"] {
  border-color: color-mix(in srgb, var(--ol-warn, #8a5c1f) 35%, var(--ol-border, #d8cdb8));
}

body[data-theme="editorial"] .scan-diagnostics-meta {
  margin: 0 16px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ol-border);
}

body[data-theme="editorial"] .scan-diagnostics-label {
  margin-bottom: 8px;
  color: #3c352f;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-theme="editorial"] #scanSection .panel-disclosure .scan-diagnostics-meta #scanDiagnostics {
  padding: 0 !important;
}

body[data-theme="editorial"] .sector-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

body[data-theme="editorial"] .sector-card {
  background: #fbf7ef !important;
  border-color: var(--ol-border) !important;
  color: var(--ol-text-soft) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .sector-card.win {
  border-left: 3px solid var(--ol-ok) !important;
}

body[data-theme="editorial"] .sector-card.loss {
  border-left: 3px solid var(--ol-bad) !important;
}

body[data-theme="editorial"] .sector-winning,
body[data-theme="editorial"] .sector-lagging {
  color: var(--ol-text-soft) !important;
  opacity: 1 !important;
}

body[data-theme="editorial"] .sector-winning strong,
body[data-theme="editorial"] .sector-lagging strong {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .sector-lagging {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .sector-bar-track {
  background: rgba(26, 26, 26, 0.08) !important;
  border-color: rgba(26, 26, 26, 0.08) !important;
}

body[data-theme="editorial"] .sector-bar-fill--win {
  background: linear-gradient(90deg, rgba(45, 90, 74, 0.9), rgba(45, 90, 74, 0.55)) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .sector-bar-fill--loss {
  background: linear-gradient(90deg, rgba(201, 73, 73, 0.85), rgba(201, 73, 73, 0.45)) !important;
  box-shadow: none !important;
}

/* Chrome fit pass: fluid container + responsive grids on wide screens. */
@media (min-width: 1280px) {
  body[data-theme="editorial"] main.container {
    width: 100% !important;
    max-width: min(1760px, 100%) !important;
    margin: 16px auto 48px !important;
    padding-inline: clamp(16px, 2.4vw, 32px) !important;
    box-sizing: border-box !important;
    gap: 14px !important;
    padding-bottom: 120px !important;
  }

  body[data-theme="editorial"].ui-screen-operations main.container {
    max-width: min(1760px, 100%) !important;
  }

  body[data-theme="editorial"] .mode-header {
    padding: 16px 18px 18px !important;
    gap: 16px !important;
  }

  body[data-theme="editorial"] .mode-header .mode-eyebrow {
    margin-bottom: 0.25rem !important;
  }

  body[data-theme="editorial"] .mode-header-title {
    font-size: clamp(1.42rem, 1.9vw, 1.82rem) !important;
    margin-bottom: 0.25rem !important;
  }

  body[data-theme="editorial"] .mode-header-lead {
    font-size: 0.9rem !important;
    line-height: 1.42 !important;
    max-width: 72ch !important;
  }

  body[data-theme="editorial"] .mode-header-actions {
    margin-top: 0.55rem !important;
  }

  body[data-theme="editorial"] .card,
  body[data-theme="editorial"] .panel-disclosure,
  body[data-theme="editorial"] #workflowPrimary,
  body[data-theme="editorial"] .operate-kanban {
    border-radius: 14px !important;
  }

  body[data-theme="editorial"] .section-title {
    padding-top: 14px !important;
    padding-bottom: 8px !important;
  }

  body[data-theme="editorial"] .inline-form {
    padding-bottom: 12px !important;
  }

  body[data-theme="editorial"] .today-summary-landing,
  body[data-theme="editorial"] .research-summary-landing,
  body[data-theme="editorial"] .system-summary-landing,
  body[data-theme="editorial"] .settings-summary-landing,
  body[data-theme="editorial"] .action-center,
  body[data-theme="editorial"] .pending-summary-strip {
    padding: 14px 18px !important;
    margin-bottom: 0 !important;
  }

  body[data-theme="editorial"] .today-summary-grid,
  body[data-theme="editorial"] .research-summary-grid,
  body[data-theme="editorial"] .system-summary-grid,
  body[data-theme="editorial"] .settings-summary-grid {
    gap: 10px 14px !important;
    margin-bottom: 8px !important;
  }

  /* Scan table + evaluate panel need ~1040px (wide table / chart). Stack lanes
   * full-width so nothing is squeezed into a side column on laptop Chrome. */
  body[data-theme="editorial"].ui-screen-operations .operate-kanban {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: clamp(10px, 1.2vw, 16px) !important;
    padding: 10px !important;
    min-width: 0;
    overflow: hidden;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanSection,
  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel,
  body[data-theme="editorial"].ui-screen-operations .operate-kanban #pendingSection {
    grid-column: 1 / -1;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban .kanban-lane:not(:last-child)::after {
    display: none !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban .kanban-lane:not(:last-child) {
    border-right: none !important;
    border-bottom: 1px solid var(--ink-line) !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban .kanban-lane {
    min-height: clamp(280px, 36vh, 520px) !important;
    padding: 12px 12px 14px !important;
    width: auto !important;
    min-width: 0;
  }

  body[data-theme="editorial"] .kanban-lane-head {
    margin-bottom: 10px !important;
    padding-bottom: 10px !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel {
    gap: 12px !important;
    padding: 12px !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel.kanban-lane[data-state="empty"] {
    min-height: 0 !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel .scan-detail-header p {
    font-size: 0.92rem !important;
    line-height: 1.45 !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel .scan-brief-card {
    padding: 12px !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel .scan-brief-card h4 {
    margin-bottom: 8px !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel .scan-detail-chart:has(.scan-detail-chart-canvas) {
    min-height: clamp(220px, 32vh, 320px) !important;
  }
  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel .scan-detail-chart:not(:has(.scan-detail-chart-canvas)) {
    min-height: 0 !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel .scan-detail-actions {
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel .scan-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }

  body[data-theme="editorial"] .stats {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
  }

  body[data-theme="editorial"] .layout-quick-tools.research-check-panel {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr) !important;
    gap: 1rem !important;
  }

  body[data-theme="editorial"].ui-screen-research .layout-2 {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr) !important;
    align-items: start !important;
  }

  body[data-theme="editorial"].ui-screen-research .layout-2:has(> :only-child) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-theme="editorial"].ui-screen-research #performanceSection,
  body[data-theme="editorial"].ui-screen-research #cockpitMergedPanel {
    align-self: start !important;
    min-height: 0 !important;
    height: auto !important;
  }

  body[data-theme="editorial"] .ir-dossier-preview {
    max-width: min(1120px, 100%) !important;
  }

  body[data-theme="editorial"] .settings-workspace,
  body[data-theme="editorial"] .layout-onboarding-presets {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) !important;
    align-items: start !important;
  }
}

/* Phase 1 visual value pack — chart overlays, funnel drill-down, pending cards */
.scan-detail-chart-canvas {
  min-height: 240px;
}

.scan-chart-legend {
  margin-top: 0.5rem;
}

.scan-chart-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.scan-overlay-reason {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-delta-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--bg-elevated);
}

.scan-delta-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.scan-funnel-filter-host:not(.hidden) {
  margin: 0.35rem 0 0.5rem;
}

.scan-funnel-filter-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--ring-warn);
  background: color-mix(in srgb, var(--warn) 8%, var(--panel));
  font-size: 0.9rem;
}

button.funnel-node {
  appearance: none;
  font: inherit;
  color: inherit;
  width: 100%;
  text-align: left;
}

/* —— Scan funnel disclosure (Figma 125:277 / Wave 1b) —— */
.scan-funnel-disclosure > .panel-disclosure-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

#scanFunnelSummaryStrip.scan-funnel-summary-strip {
  color: var(--ol-warn);
  font-size: 0.82rem;
  font-weight: 500;
}

.scan-funnel-board-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ol-muted);
  font-weight: 600;
}

.scan-insights--funnel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.75rem 0.15rem 0.25rem;
}

.scan-insights--funnel .scan-block {
  order: unset;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
}

.scan-insights--funnel .scan-block-hint {
  margin: 0 0 0.65rem;
  display: block;
}

.scan-funnel-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.scan-funnel-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ol-accent) 12%, transparent);
  background: var(--ol-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.scan-funnel-row:hover,
.scan-funnel-row:focus-visible {
  border-color: color-mix(in srgb, var(--ol-accent) 35%, transparent);
  outline: none;
}

.scan-funnel-row--active,
.scan-funnel-row.funnel-node--active {
  border-color: var(--ol-accent) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ol-accent) 28%, transparent);
}

.scan-funnel-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.scan-funnel-row-head .label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ol-text);
  text-transform: none;
  letter-spacing: 0;
}

.scan-funnel-row-head .value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ol-text);
}

.scan-funnel-bar-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ol-muted) 18%, transparent);
  overflow: hidden;
}

.scan-funnel-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--ol-accent);
  box-shadow: none;
}

.scan-funnel-row-foot {
  font-size: 0.78rem;
  color: var(--ol-warn);
}

.scan-diagnostics-meta {
  padding: 0.15rem 0.25rem 0.35rem;
}

.scan-health-pills {
  margin-top: 0.35rem;
}

.scan-health-pill {
  font-size: 0.82rem;
}

.blocker-chips .scan-dropoff-pill {
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: var(--ol-bg);
  border: 1px solid color-mix(in srgb, var(--ol-accent) 12%, transparent);
  color: var(--ol-text);
}

.blocker-chips .scan-dropoff-pill .scan-dropoff-label {
  font-weight: 500;
}

.blocker-chips .scan-dropoff-pill strong {
  color: var(--ol-accent);
}

body[data-theme="editorial"] .scan-funnel-row {
  background: var(--ol-bg) !important;
  border-color: var(--ol-border) !important;
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .scan-funnel-row-head .label,
body[data-theme="editorial"] .scan-funnel-row-head .value {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .scan-funnel-bar-track {
  background: color-mix(in srgb, var(--ol-muted) 18%, transparent) !important;
}

body[data-theme="editorial"] .scan-funnel-bar-fill {
  background: var(--ol-accent) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .scan-funnel-row-foot {
  color: var(--ol-warn) !important;
}

body[data-theme="editorial"] .blocker-chips li,
body[data-theme="editorial"] .blocker-chips .scan-dropoff-pill {
  background: var(--ol-bg) !important;
  border-color: var(--ol-border) !important;
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .blocker-chips .scan-dropoff-pill strong {
  color: var(--ol-accent) !important;
}

.funnel-node--active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.funnel-shadow-compare {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.funnel-shadow-live {
  color: var(--good);
}

.funnel-shadow-would {
  color: var(--warn);
}

.pending-thesis-line {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.pending-trust-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.15rem 0 0.55rem;
}

.pending-trust-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pending-filter-hint {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
}

.sector-chip {
  margin-left: 0.35rem;
  vertical-align: middle;
}

.pending-cap-meter {
  margin: 0.35rem 0 0.55rem;
}

.pending-cap-meter .meter-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.meter--good span {
  background: var(--good);
}

.meter--warn span {
  background: var(--warn);
}

.meter--bad span {
  background: var(--bad);
}

/* Phase 2 — decision dashboard signal-edge evidence board */
body[data-theme="editorial"] .decision-dashboard-stack {
  gap: 10px !important;
}

body[data-theme="editorial"] .decision-dashboard-ribbon {
  grid-template-columns: repeat(2, minmax(140px, 1fr)) !important;
}

body[data-theme="editorial"] .decision-dashboard-state-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 10px 0 12px;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--ol-accent-border);
  border-left: 3px solid var(--ol-accent);
  border-radius: 10px;
  background: rgba(26, 58, 46, 0.05);
  color: var(--ol-text-soft);
  font-size: 0.88rem;
  line-height: 1.35;
}

body[data-theme="editorial"] .decision-dashboard-state-strip strong {
  color: var(--ol-text);
  font-weight: 800;
}

body[data-theme="editorial"] .decision-dashboard-state-strip .muted {
  color: var(--ol-muted-soft) !important;
}

body[data-theme="editorial"] .decision-dashboard-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.14rem 0.48rem;
  border: 1px solid var(--ol-accent-border);
  border-radius: 999px;
  background: var(--ol-accent-soft);
  color: var(--ol-accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="success"] {
  border-color: rgba(45, 90, 74, 0.42);
  border-left-color: var(--ol-ok);
  background: rgba(45, 90, 74, 0.08);
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="success"] .decision-dashboard-state-pill {
  border-color: rgba(45, 90, 74, 0.42);
  background: rgba(45, 90, 74, 0.14);
  color: var(--ol-ok);
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="partial"],
body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="loading"] {
  border-color: rgba(176, 133, 42, 0.5);
  border-left-color: var(--ol-gold);
  background: rgba(201, 169, 98, 0.13);
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="partial"] .decision-dashboard-state-pill,
body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="loading"] .decision-dashboard-state-pill {
  border-color: rgba(176, 133, 42, 0.5);
  background: rgba(201, 169, 98, 0.22);
  color: var(--ol-warn);
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.44);
  border-left-color: var(--ol-bad);
  background: rgba(201, 73, 73, 0.1);
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="error"] .decision-dashboard-state-pill {
  border-color: rgba(201, 73, 73, 0.44);
  background: rgba(201, 73, 73, 0.14);
  color: var(--ol-bad);
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="empty"] {
  border-color: var(--ol-border);
  border-left-color: rgba(26, 58, 46, 0.32);
  background: var(--ol-surface-soft);
}

body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="empty"] .decision-dashboard-state-pill {
  border-color: var(--ol-border);
  background: var(--ol-surface);
  color: var(--ol-muted);
}

.decision-summary-strip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0.5rem;
  vertical-align: middle;
}

.decision-summary-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--panel-border);
  background: var(--bg-elevated);
}

.decision-summary-pill.good {
  border-color: color-mix(in srgb, var(--good) 45%, var(--panel-border));
  color: var(--good);
}

.decision-summary-pill.bad {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--panel-border));
  color: var(--bad);
}

.decision-summary-pill.warn {
  border-color: color-mix(in srgb, var(--warn) 45%, var(--panel-border));
  color: var(--warn);
}

/* Editorial: the pills above inherit dark-theme vars (--bg-elevated is a
 * near-black), which rendered as illegible dark chips on the cream summary
 * row. Repaint them with Old Logan tokens. */
body[data-theme="editorial"] .decision-summary-pill {
  background: var(--ol-surface) !important;
  border-color: var(--ol-border-strong) !important;
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .decision-summary-pill.neutral {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .decision-summary-pill.good {
  border-color: color-mix(in srgb, var(--ol-ok) 55%, var(--ol-border-strong)) !important;
  color: var(--ol-ok) !important;
}

body[data-theme="editorial"] .decision-summary-pill.bad {
  border-color: color-mix(in srgb, var(--ol-bad) 55%, var(--ol-border-strong)) !important;
  color: var(--ol-bad) !important;
}

body[data-theme="editorial"] .decision-summary-pill.warn {
  border-color: color-mix(in srgb, var(--ol-warn) 55%, var(--ol-border-strong)) !important;
  color: var(--ol-warn) !important;
}

.decision-signal-edge-board {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--bg-elevated);
}

body[data-theme="editorial"] .decision-signal-edge-board {
  border-color: var(--ol-border) !important;
  background: var(--ol-surface-soft) !important;
}

.decision-board-title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

body[data-theme="editorial"] .decision-board-title {
  color: var(--ol-muted) !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
}

body[data-theme="editorial"] .decision-signal-edge-summary {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ol-border);
  border-left: 3px solid var(--ol-accent);
  border-radius: 8px;
  background: var(--ol-surface-soft);
  color: var(--ol-text-soft);
  font-size: 0.84rem;
  line-height: 1.35;
}

body[data-theme="editorial"] .decision-signal-edge-summary[data-state="success"] {
  border-color: rgba(45, 90, 74, 0.42);
  border-left-color: var(--ol-ok);
  background: rgba(45, 90, 74, 0.07);
  color: var(--ol-ok);
}

body[data-theme="editorial"] .decision-signal-edge-summary[data-state="partial"],
body[data-theme="editorial"] .decision-signal-edge-summary[data-state="loading"] {
  border-color: rgba(176, 133, 42, 0.5);
  border-left-color: var(--ol-gold);
  background: rgba(201, 169, 98, 0.13);
  color: var(--ol-warn);
}

body[data-theme="editorial"] .decision-signal-edge-summary[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.44);
  border-left-color: var(--ol-bad);
  background: rgba(201, 73, 73, 0.1);
  color: var(--ol-bad);
}

body[data-theme="editorial"] .decision-signal-edge-summary[data-state="empty"] {
  border-color: var(--ol-border);
  border-left-color: rgba(26, 58, 46, 0.32);
  color: var(--ol-muted);
}

body[data-theme="editorial"] #decisionDashboardCard[data-state="error"] {
  border-color: rgba(201, 73, 73, 0.44) !important;
}

body[data-theme="editorial"] #decisionDashboardCard[data-state="empty"] {
  border-color: var(--ol-border) !important;
}

body[data-theme="editorial"] #decisionSignalEdgeBoard[data-state="loading"] .decision-era-pf-chart {
  opacity: 0.72;
}

.decision-gate-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.decision-gate-tile {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  padding: 0.45rem 0.55rem;
  background: var(--panel);
}

body[data-theme="editorial"] .decision-gate-tile {
  background: var(--ol-surface) !important;
  border-color: var(--ol-border) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .decision-gate-tile--good {
  border-color: rgba(45, 90, 74, 0.42) !important;
}

body[data-theme="editorial"] .decision-gate-tile--bad {
  border-color: rgba(201, 73, 73, 0.44) !important;
}

body[data-theme="editorial"] .decision-gate-tile--warn {
  border-color: rgba(176, 133, 42, 0.5) !important;
}

body[data-theme="editorial"] .decision-gate-message {
  grid-column: 1 / -1;
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
}

.decision-gate-tile--good {
  border-color: color-mix(in srgb, var(--good) 40%, var(--panel-border));
}

.decision-gate-tile--bad {
  border-color: color-mix(in srgb, var(--bad) 40%, var(--panel-border));
}

.decision-gate-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.decision-gate-value {
  display: block;
  font-size: 1.05rem;
  margin-top: 0.1rem;
}

.decision-gate-sub {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

body[data-theme="editorial"] .decision-gate-label,
body[data-theme="editorial"] .decision-gate-sub,
body[data-theme="editorial"] .decision-pf-label,
body[data-theme="editorial"] .decision-pf-gates-note {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .decision-gate-value,
body[data-theme="editorial"] .decision-pf-value {
  color: var(--ol-text) !important;
}

.decision-era-pf-chart {
  margin-top: 0.25rem;
}

.decision-pf-chart {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.decision-pf-scenario {
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
}

.decision-pf-scenario-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.decision-pf-row {
  display: grid;
  grid-template-columns: 88px 1fr 52px;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.25rem;
}

.decision-pf-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.decision-pf-bar-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  overflow: hidden;
}

.decision-pf-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--good) 85%, #fff), var(--good));
}

body[data-theme="editorial"] .decision-pf-bar-track {
  background: rgba(26, 26, 26, 0.08) !important;
}

body[data-theme="editorial"] .decision-pf-bar-fill {
  background: var(--ol-accent) !important;
}

.decision-pf-bar-fill--worst {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 75%, #fff), var(--accent));
}

body[data-theme="editorial"] .decision-pf-bar-fill--worst {
  background: var(--ol-gold) !important;
}

.decision-pf-gate-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--warn);
  opacity: 0.9;
}

body[data-theme="editorial"] .decision-pf-gate-line {
  background: var(--ol-gold) !important;
}

body[data-theme="editorial"] .decision-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

body[data-theme="editorial"] .decision-evidence-row {
  margin: 0 !important;
  padding: 0.48rem 0.6rem;
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  background: var(--ol-surface);
  color: var(--ol-text-soft) !important;
  font-size: 0.86rem;
  line-height: 1.4;
}

body[data-theme="editorial"] .decision-evidence-row--wide {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  body[data-theme="editorial"] .decision-dashboard-ribbon,
  body[data-theme="editorial"] .decision-evidence-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-theme="editorial"] .decision-evidence-row--wide {
    grid-column: auto;
  }
}

.decision-pf-value {
  font-size: 0.82rem;
  text-align: right;
}

.decision-pf-gates-note {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
}

/* —— Phase 3: backtest equity / drawdown charts —— */
.bt-equity-chart-wrap {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.bt-equity-chart,
.bt-drawdown-chart {
  width: 100%;
  min-height: 90px;
}

/* —— Phase 4: SEC management integrity polish —— */
.saydo-timeline {
  gap: 0.65rem;
}

.saydo-node {
  transition: border-color 0.15s ease, background 0.15s ease;
}

.saydo-node:hover {
  background: color-mix(in srgb, var(--panel) 92%, var(--accent) 8%);
}

.integrity-gauge {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gauge, var(--good)) 35%, transparent);
}

.redflag-row.sev-high {
  border-left-width: 3px;
}

.dilution-table tbody tr:hover td {
  filter: brightness(1.08);
}

/* —— Phase 5: cockpit regime visuals —— */
.cockpit-sector-heatmap {
  display: grid;
  gap: 0.35rem;
  margin: 0.35rem 0 0.65rem;
}

.cockpit-sector-cell {
  display: grid;
  grid-template-columns: 42px 1fr 52px;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
}

.cockpit-sector-bar-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  overflow: hidden;
}

.cockpit-sector-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--good) 70%, #fff), var(--good));
}

.cockpit-sector-cell--flat .cockpit-sector-bar-fill {
  background: color-mix(in srgb, var(--muted) 45%, transparent);
}

.cockpit-spy-chart-wrap {
  margin: 0.35rem 0 0.5rem;
}

.cockpit-spy-chart-canvas {
  width: 100%;
  min-height: 120px;
}

/* —— Shadow workbench (Figma W2d: 153:210 / 153:319) —— */
.shadow-scoreboard-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
}

.shadow-scoreboard-trend--up {
  color: var(--warn);
}

.shadow-scoreboard-trend--down {
  color: var(--good);
}

.shadow-workbench-teaser {
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  background: color-mix(in srgb, var(--warn) 6%, transparent);
}

.shadow-workbench-teaser-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
}

.shadow-workbench-restart {
  margin-bottom: 0.75rem;
}

.shadow-tier {
  margin-top: 0.85rem;
}

.shadow-plugin-controls {
  margin-top: 0.45rem;
  gap: 0.4rem;
  align-items: center;
}

.shadow-mode-select {
  min-width: 7rem;
}

.shadow-checklist-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.shadow-plugin-checklist {
  margin-top: 0.35rem;
}

.shadow-plugin-next {
  margin: 0.25rem 0 0.45rem;
  font-size: 0.82rem;
}

body[data-theme="editorial"] #shadowScoreboardSection {
  border-color: color-mix(in srgb, var(--ol-gold) 55%, var(--ol-border));
  background: var(--ol-surface);
}

body[data-theme="editorial"] #shadowScoreboardSection > .section-title h2 {
  font-family: "Fraunces", Georgia, serif !important;
  color: var(--ol-accent);
  letter-spacing: -0.01em;
}

body[data-theme="editorial"] .shadow-scoreboard-legend {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ol-muted);
}

body[data-theme="editorial"] .shadow-scoreboard-headline {
  border: 1px solid color-mix(in srgb, var(--ol-warn) 40%, var(--ol-border));
  background: color-mix(in srgb, var(--ol-warn) 10%, var(--ol-surface-soft));
  color: var(--ol-text);
}

body[data-theme="editorial"] .shadow-workbench-teaser {
  border: 1px solid color-mix(in srgb, var(--ol-warn) 45%, var(--ol-border));
  background: var(--ol-surface);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ol-gold) 25%, transparent);
}

body[data-theme="editorial"] .shadow-workbench-teaser-inner strong {
  font-family: "Fraunces", Georgia, serif;
  color: var(--ol-accent);
  font-size: 0.98rem;
}

body[data-theme="editorial"] .shadow-tier > .scan-funnel-board-title,
body[data-theme="editorial"] .shadow-tier-title {
  margin: 0 0 0.55rem;
  font-family: "Fraunces", Georgia, serif !important;
  font-size: 0.98rem;
  color: var(--ol-accent);
}

body[data-theme="editorial"] .shadow-plugin-card {
  margin: 0 0 0.85rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--ol-gold) 50%, var(--ol-border));
  border-radius: 10px;
  background: var(--ol-surface);
}

body[data-theme="editorial"] .shadow-plugin-head h3 {
  margin: 0 0 0.25rem;
  font-family: "Fraunces", Georgia, serif !important;
  font-size: 1.05rem;
  color: var(--ol-text);
}

body[data-theme="editorial"] .shadow-plugin-purpose {
  margin: 0.15rem 0 0.35rem;
  color: var(--ol-text-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

body[data-theme="editorial"] .shadow-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.55rem 0 0.45rem;
}

body[data-theme="editorial"] .shadow-stat-cell {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  background: var(--ol-surface-soft);
  min-width: 0;
}

body[data-theme="editorial"] .shadow-stat-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ol-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-theme="editorial"] .shadow-stat-value {
  display: block;
  color: var(--ol-text);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

body[data-theme="editorial"] .shadow-stat-value.good {
  color: var(--ol-ok);
}

body[data-theme="editorial"] .shadow-stat-value.warn {
  color: var(--ol-warn);
}

body[data-theme="editorial"] .shadow-stat-value.muted {
  color: var(--ol-muted);
  font-weight: 600;
}

body[data-theme="editorial"] .shadow-stat-lines {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  color: var(--ol-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

body[data-theme="editorial"] .shadow-plugin-next {
  margin: 0.45rem 0 0.35rem;
  font-size: 0.86rem;
  color: var(--ol-text-soft);
}

body[data-theme="editorial"] .shadow-tier-blurb {
  margin: -0.15rem 0 0.65rem;
  font-size: 0.84rem;
}

@media (max-width: 900px) {
  body[data-theme="editorial"] .shadow-stat-grid {
    grid-template-columns: 1fr;
  }
}

body[data-theme="editorial"] .shadow-mode-select {
  min-width: 7.5rem;
  border: 1px solid color-mix(in srgb, var(--ol-accent) 45%, var(--ol-border));
  border-radius: 8px;
  background: var(--ol-surface-soft);
  color: var(--ol-text);
  padding: 0.35rem 0.55rem;
}

body[data-theme="editorial"] .shadow-plugin-checklist summary {
  cursor: pointer;
  color: var(--ol-muted);
  font-size: 0.82rem;
}

body[data-theme="editorial"] .shadow-checklist-list .good {
  color: var(--ol-ok);
}

body[data-theme="editorial"] .shadow-checklist-list .warn {
  color: var(--ol-warn);
}

body[data-theme="editorial"] .shadow-workbench-restart {
  border: 1px solid color-mix(in srgb, var(--ol-bad) 40%, var(--ol-border));
  background: color-mix(in srgb, var(--ol-bad) 8%, var(--ol-surface));
  color: var(--ol-text);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
}

.shadow-plugin-trend {
  font-size: 0.78rem;
  color: var(--warn);
}

/* —— Calibration panel (Figma node 5:2, variables ol/*) —— */
/* Token map: ol/bg→--ol-bg, ol/accent→--ol-accent, ol/gold→--ol-gold, ol/ok→--ol-ok, ol/bad→--ol-bad */
#calibrationSummaryStrip.calibration-summary-strip {
  /* was --ol-gold: 2.2:1 on the cream summary row — AA fail */
  color: var(--ol-warn);
  font-size: 0.82rem;
}

#calibrationSection .calibration-block + .calibration-block {
  margin-top: 0.75rem;
}

#calibrationSection .calibration-kpi-tiles {
  margin-bottom: 0.25rem;
}

#calibrationSection .calibration-board-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ol-muted);
}

#calibrationSection .calibration-raw-wrap {
  margin-top: 0.75rem;
}

#calibrationSection .calibration-raw-details {
  margin-top: 0.35rem;
}

.calibration-ledger-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.calibration-ledger-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ol-accent) 12%, transparent);
  background: var(--ol-bg);
}

.calibration-ledger-pill-count {
  color: var(--ol-accent);
}

.calibration-ledger-meta {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
}

/* —— Phase 6: calibration reliability diagram —— */
.calibration-reliability-chart {
  display: grid;
  gap: 0.55rem;
}

.calibration-reliability-row {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.calibration-reliability-row--pass {
  border-color: color-mix(in srgb, var(--good) 35%, transparent);
}

.calibration-reliability-row--fail {
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
}

.calibration-reliability-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.calibration-reliability-bar-row {
  display: grid;
  grid-template-columns: 64px 1fr 52px;
  gap: 0.4rem;
  align-items: center;
}

.calibration-reliability-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  overflow: hidden;
}

.calibration-reliability-fill {
  height: 100%;
  width: var(--calib-fill-pct, 0%);
  border-radius: inherit;
  background: var(--ol-accent);
}

.calibration-reliability-gate {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: var(--calib-gate-pct, 50%);
  width: 2px;
  background: var(--ol-gold);
  opacity: 0.9;
}

.calibration-reliability-value {
  text-align: right;
  font-size: 0.82rem;
}

.calibration-reliability-note {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
}

/* ============================================================
   Operator alerts + async states (editorial)
   Matches Figma Error Copy Standards: headline / detail / action.
============================================================ */

body[data-theme="editorial"] .async-state {
  border-radius: 10px;
  font-size: var(--ol-text-caption);
  line-height: 1.45;
  padding: var(--ol-space-3) var(--ol-space-4);
}

body[data-theme="editorial"] .async-state--loading {
  border: 1px dashed var(--ol-border-strong) !important;
  background: var(--ol-surface-soft) !important;
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .async-state--empty {
  border: 1px dashed var(--ol-border) !important;
  background: var(--ol-surface-soft) !important;
  color: var(--ol-text-soft) !important;
  font-style: normal !important;
}

body[data-theme="editorial"] .async-state--error {
  border: 1px solid rgba(201, 73, 73, 0.44) !important;
  background: rgba(201, 73, 73, 0.08) !important;
  color: var(--ol-text) !important;
  justify-content: space-between;
  gap: var(--ol-space-3);
}

body[data-theme="editorial"] .operator-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ol-space-3);
  width: 100%;
}

body[data-theme="editorial"] .operator-alert__body {
  display: grid;
  gap: var(--ol-space-1);
  min-width: 0;
}

body[data-theme="editorial"] .operator-alert__headline {
  color: var(--ol-text) !important;
  font-family: "DM Sans", system-ui, sans-serif !important;
  font-size: var(--ol-text-caption) !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

body[data-theme="editorial"] .operator-alert--bad .operator-alert__headline {
  color: #8f2f2f !important;
}

body[data-theme="editorial"] .operator-alert__detail {
  color: var(--ol-muted) !important;
  font-size: var(--ol-text-micro) !important;
  line-height: 1.45 !important;
  margin: 0;
}

body[data-theme="editorial"] .operator-alert--bad .operator-alert__detail {
  color: var(--ol-text-soft) !important;
}

body[data-theme="editorial"] [data-async-state="error"].card,
body[data-theme="editorial"] [data-async-state="error"].panel-disclosure,
body[data-theme="editorial"] #pendingBoard[data-state="error"] {
  position: relative;
  border-color: rgba(201, 73, 73, 0.44) !important;
  overflow: hidden;
}

body[data-theme="editorial"] [data-async-state="error"].card::before,
body[data-theme="editorial"] [data-async-state="error"].panel-disclosure::before,
body[data-theme="editorial"] #pendingBoard[data-state="error"]::before {
  background: var(--ol-bad);
  border-radius: 10px 10px 0 0;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

body[data-theme="editorial"] [data-async-state="stale"]::before {
  color: var(--ol-warn) !important;
  font-size: var(--ol-text-micro) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

body[data-theme="editorial"] .hero-kpi-value,
body[data-theme="editorial"] .decision-gate-value,
body[data-theme="editorial"] .decision-pf-value,
body[data-theme="editorial"] .calibration-kpi-value,
body[data-theme="editorial"] .scan-detail-stat strong,
body[data-theme="editorial"] .mono-nums,
body[data-theme="editorial"] .table-wrap td[data-col="num"],
body[data-theme="editorial"] .table-wrap th[data-col="num"] {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Chrome layout containment — prevent horizontal bleed / clipping
============================================================ */

html {
  overflow-x: clip;
}

body[data-theme="editorial"] {
  overflow-x: clip;
}

body[data-theme="editorial"] main.container {
  width: 100%;
  max-width: min(1760px, 100%);
  margin-inline: auto;
  padding-inline: clamp(12px, 2.4vw, 32px);
  box-sizing: border-box;
  min-width: 0;
}

body[data-theme="editorial"] main.container > *,
body[data-theme="editorial"] .layout-2 > *,
body[data-theme="editorial"] .layout-quick-tools > *,
body[data-theme="editorial"] .card,
body[data-theme="editorial"] .panel-disclosure,
body[data-theme="editorial"] .mode-header,
body[data-theme="editorial"] #workflowPrimary,
body[data-theme="editorial"] .operate-kanban,
body[data-theme="editorial"] .layout-2,
body[data-theme="editorial"] .layout-quick-tools,
body[data-theme="editorial"] .layout-onboarding-presets,
body[data-theme="editorial"] .settings-workspace {
  min-width: 0;
  max-width: 100%;
}

body[data-theme="editorial"] .section-title {
  flex-wrap: wrap;
  min-width: 0;
}

body[data-theme="editorial"] .section-title h2,
body[data-theme="editorial"] .section-title h3,
body[data-theme="editorial"] .scan-title-meta {
  min-width: 0;
}

body[data-theme="editorial"] .scan-studio {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border) !important;
  border-radius: 12px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ol-gold) 28%, transparent);
  padding: var(--ol-space-5) var(--ol-space-5) var(--ol-space-6);
  gap: var(--ol-space-4);
}

body[data-theme="editorial"] .scan-studio-kicker,
body[data-theme="editorial"] .scan-studio .workspace-eyebrow {
  margin: 0;
  color: var(--ol-muted) !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: var(--ol-text-micro) !important;
  font-weight: 600 !important;
}

body[data-theme="editorial"] .scan-studio-title {
  margin: 0.15rem 0 0;
  color: var(--ol-text) !important;
  font-family: "Fraunces", Georgia, serif !important;
  font-size: var(--ol-text-title);
  font-weight: 600;
  letter-spacing: -0.01em;
}

body[data-theme="editorial"] .scan-studio-lede,
body[data-theme="editorial"] .scan-studio-tf-desc,
body[data-theme="editorial"] .scan-studio-group-hint {
  color: var(--ol-muted) !important;
  font-size: var(--ol-text-caption) !important;
}

body[data-theme="editorial"] .scan-studio-tf-row {
  background: var(--ol-surface-soft);
  border: 1px solid var(--ol-border);
  border-radius: 999px;
  padding: 3px;
}

body[data-theme="editorial"] .scan-studio-tf {
  color: var(--ol-text-soft);
  font-weight: 600;
}

body[data-theme="editorial"] .scan-studio-tf.is-active {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
  box-shadow: inset 0 -2px 0 var(--ol-gold);
}

body[data-theme="editorial"] .scan-studio-note {
  color: var(--ol-warn) !important;
  background: color-mix(in srgb, var(--ol-warn) 8%, var(--ol-surface));
  border: 1px solid color-mix(in srgb, var(--ol-warn) 28%, transparent);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: var(--ol-text-caption) !important;
}

body[data-theme="editorial"] .scan-studio-group--paper {
  padding-top: var(--ol-space-2);
  border-top: 1px dashed color-mix(in srgb, var(--ol-gold) 45%, var(--ol-border));
}

body[data-theme="editorial"] .scan-studio-horizon + .scan-studio-horizon {
  border-top: 1px dashed color-mix(in srgb, var(--ol-gold) 40%, var(--ol-border));
}

body[data-theme="editorial"] .scan-studio-horizon-title {
  color: var(--ol-text) !important;
  font-family: "Fraunces", Georgia, serif !important;
}

body[data-theme="editorial"] .scan-studio-strategy {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border) !important;
  border-radius: 10px;
}

body[data-theme="editorial"] .scan-studio-strategy--yours.is-selected,
body[data-theme="editorial"] .scan-studio-strategy--primary.is-selected {
  background: color-mix(in srgb, var(--ol-accent) 8%, var(--ol-surface)) !important;
  border-color: color-mix(in srgb, var(--ol-accent) 42%, transparent) !important;
  box-shadow: inset 3px 0 0 var(--ol-gold);
}

body[data-theme="editorial"] .scan-studio-strategy--paper {
  background: color-mix(in srgb, var(--ol-bg) 70%, var(--ol-surface)) !important;
}

body[data-theme="editorial"] .scan-studio-strategy--paper.is-selected {
  background: color-mix(in srgb, var(--ol-gold) 12%, var(--ol-surface)) !important;
  border-color: color-mix(in srgb, var(--ol-gold) 55%, var(--ol-border)) !important;
}

body[data-theme="editorial"] .scan-studio-check {
  background: var(--ol-surface);
  border-color: var(--ol-border-strong);
}

body[data-theme="editorial"] .scan-studio-strategy:has(:focus-visible) {
  outline: 2px solid var(--ol-accent);
  outline-offset: 2px;
}

body[data-theme="editorial"] .scan-studio-strategy-head strong {
  color: var(--ol-text) !important;
  font-weight: 650;
}

body[data-theme="editorial"] .scan-studio-strategy-desc,
body[data-theme="editorial"] .scan-strategy-tf {
  color: var(--ol-muted) !important;
  font-size: var(--ol-text-caption) !important;
}

body[data-theme="editorial"] .scan-studio-evidence {
  color: var(--ol-muted-soft) !important;
  font-size: var(--ol-text-micro) !important;
}

body[data-theme="editorial"] .scan-studio-status,
body[data-theme="editorial"] .scan-studio-origin,
body[data-theme="editorial"] .scan-studio-primary-chip {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  background: var(--ol-bg);
  color: var(--ol-muted);
  border-color: var(--ol-border);
}

body[data-theme="editorial"] .scan-studio-status--live {
  background: var(--ol-accent);
  color: var(--ol-on-accent);
  border-color: var(--ol-accent);
}

body[data-theme="editorial"] .scan-studio-status--live_overlay {
  color: var(--ol-ok);
  border-color: var(--ol-accent-border);
  background: color-mix(in srgb, var(--ol-accent) 8%, var(--ol-surface));
}

body[data-theme="editorial"] .scan-studio-status--shadow {
  color: var(--ol-ok);
  border-color: var(--ol-accent-border);
}

body[data-theme="editorial"] .scan-studio-status--research {
  border-color: color-mix(in srgb, var(--ol-gold) 55%, var(--ol-border));
  color: var(--ol-warn);
}

body[data-theme="editorial"] .scan-studio-origin--iterated {
  color: var(--ol-ok);
  border-color: var(--ol-accent-border);
}

body[data-theme="editorial"] .scan-studio-origin--literature {
  color: var(--ol-warn);
  border-color: color-mix(in srgb, var(--ol-gold) 55%, var(--ol-border));
}

body[data-theme="editorial"] .scan-studio-primary-chip {
  color: var(--ol-accent);
  border-color: color-mix(in srgb, var(--ol-gold) 70%, transparent);
  background: color-mix(in srgb, var(--ol-gold) 16%, var(--ol-surface));
}

body[data-theme="editorial"] .scan-studio-universe {
  border-top: 1px solid var(--ol-border);
  padding-top: var(--ol-space-4);
}

body[data-theme="editorial"] .scan-studio-field select,
body[data-theme="editorial"] .scan-studio-field input {
  background: var(--ol-surface) !important;
  border: 1px solid var(--ol-border-strong) !important;
  color: var(--ol-text) !important;
  border-radius: 8px;
  min-height: 2.25rem;
}

body[data-theme="editorial"] .operate-kanban {
  overflow: hidden !important;
}

@media (min-width: 1121px) and (max-width: 1279px) {
  /* Same stacked full-width pattern as the >=1280 block. */
  body[data-theme="editorial"] .operate-kanban,
  body[data-theme="editorial"].ui-screen-operations .operate-kanban {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanSection,
  body[data-theme="editorial"].ui-screen-operations .operate-kanban #scanDetailPanel,
  body[data-theme="editorial"].ui-screen-operations .operate-kanban #pendingSection {
    grid-column: 1 / -1;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban .kanban-lane:not(:last-child)::after {
    display: none !important;
  }

  body[data-theme="editorial"].ui-screen-operations .operate-kanban .kanban-lane:not(:last-child) {
    border-right: none !important;
    border-bottom: 1px solid var(--ink-line) !important;
  }
}

@media (max-width: 1120px) {
  body[data-theme="editorial"] .operate-kanban,
  body[data-theme="editorial"].ui-screen-operations .operate-kanban {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-theme="editorial"] .operate-kanban .kanban-lane,
  body[data-theme="editorial"].ui-screen-operations .operate-kanban .kanban-lane {
    min-height: 0 !important;
  }
}

@media (min-width: 1121px) {
  body[data-theme="editorial"] .kanban-lane:not(:last-child)::after {
    right: 6px;
  }
}

@media (max-width: 1280px) {
  body[data-theme="editorial"] .app-topbar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "brand actions"
      "tabs tabs" !important;
    align-items: stretch !important;
    row-gap: 8px !important;
  }

  body[data-theme="editorial"] .app-topbar-brand {
    grid-area: brand;
    min-width: 0;
  }

  body[data-theme="editorial"] .app-topbar-actions {
    grid-area: actions;
    justify-self: end;
    flex-wrap: wrap;
  }

  body[data-theme="editorial"] .app-topbar-tabs {
    grid-area: tabs;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn {
    min-width: 0;
    justify-content: center;
    padding-inline: 8px !important;
  }
}

@media (max-width: 760px) {
  body[data-theme="editorial"] .operations-status-strip,
  body[data-theme="editorial"] .operations-panel-snapshot,
  body[data-theme="editorial"] .system-status-strip,
  body[data-theme="editorial"] .research-status-strip,
  body[data-theme="editorial"] .decision-dashboard-state-strip {
    margin-inline: 8px;
  }

  body[data-theme="editorial"] .operations-panel-snapshot__kpis {
    grid-template-columns: 1fr;
  }

  body[data-theme="editorial"] .workflow-progress-step {
    flex: 1 1 calc(50% - 4px);
  }

  body[data-theme="editorial"] .mode-header {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ============================================================
   Portfolio Risk Dashboard — editorial theme
   Figma: Old Logan DS "Portfolio Risk — Success/Partial/Empty/
   Loading/Error" (nodes 70-40 … 70-60).
   Mount: #portfolioRiskMount · alias ?screen=research&section=risk
============================================================ */

body[data-theme="editorial"] .portfolio-subtabs {
  gap: 8px;
  border: 0;
  margin: 12px 0;
}
body[data-theme="editorial"] .portfolio-subtabs .tab-btn,
body[data-theme="editorial"] .risk-stress-tabs .tab-btn {
  border: 1px solid rgba(201, 169, 98, 0.6);
  border-radius: 999px;
  background: var(--ol-bg);
  color: var(--ol-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
}
body[data-theme="editorial"] .portfolio-subtabs .tab-btn-active,
body[data-theme="editorial"] .risk-stress-tabs .tab-btn-active {
  background: var(--ol-accent);
  border-color: var(--ol-accent);
  color: var(--ol-gold);
}

/* Toolbar: lookback + freshness + refresh */
body[data-theme="editorial"] .risk-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
body[data-theme="editorial"] .risk-toolbar select {
  background: var(--ol-bg);
  border: 1px solid var(--ol-border);
  border-radius: 6px;
  color: var(--ol-text);
  font-size: 0.8125rem;
  padding: 5px 8px;
}
body[data-theme="editorial"] .risk-toolbar .risk-freshness {
  font-size: 0.8125rem;
  color: var(--ol-muted);
}

body[data-theme="editorial"] .risk-holdings-strip {
  gap: 8px;
  margin: 6px 0 12px;
}
body[data-theme="editorial"] .risk-holding-chip {
  border: 1px solid var(--ol-border);
  border-radius: 6px;
  background: var(--ol-bg);
  color: var(--ol-text);
  font-size: 0.8125rem;
}
body[data-theme="editorial"] .risk-holding-chip .mono-nums {
  color: var(--ol-muted);
}

/* Sticky anchor chips */
body[data-theme="editorial"] .risk-anchor-chips {
  position: sticky;
  top: var(--sticky-offset, 0px);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  background: var(--ol-surface);
}
body[data-theme="editorial"] .risk-anchor-chip {
  border: 1px solid rgba(201, 169, 98, 0.6);
  border-radius: 999px;
  background: var(--ol-bg);
  color: var(--ol-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  cursor: pointer;
}
body[data-theme="editorial"] .risk-anchor-chip:hover {
  color: var(--ol-accent);
  border-color: var(--ol-accent);
}

/* Section titles: gold small-caps with hairline rule */
body[data-theme="editorial"] .risk-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ol-warn);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 20px 0 10px;
}
body[data-theme="editorial"] .risk-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(201, 169, 98, 0.45);
}

/* KPI tiles — match DS Components 7-24 */
body[data-theme="editorial"] .risk-kpi {
  background: var(--ol-bg);
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  text-align: left;
}
body[data-theme="editorial"] .risk-kpi-value {
  color: var(--ol-accent);
  font-size: 1.35rem;
}
body[data-theme="editorial"] .risk-kpi-label {
  color: var(--ol-warn);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Metrics table */
body[data-theme="editorial"] .risk-metrics-table {
  font-size: 0.9rem;
}
body[data-theme="editorial"] .risk-metrics-table th {
  color: var(--ol-warn);
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(201, 169, 98, 0.45);
}
body[data-theme="editorial"] .risk-metrics-table td {
  border-bottom: 1px solid var(--ol-border);
}
body[data-theme="editorial"] .risk-metrics-table th[data-risk-sort] {
  cursor: pointer;
  user-select: none;
}
body[data-theme="editorial"] .risk-metrics-table th[data-risk-sort]:hover {
  color: var(--ol-accent);
}

/* Correlation heatmap — colors owned here via data-corr-bucket.
   Positive corr = ol/bad red tints (concentration risk).
   Negative corr = ol/ok forest tints (diversifying).
   Intensity steps must stay distinct — never flat full-red. */
body[data-theme="editorial"] .risk-corr-heatmap {
  gap: 2px;
}
body[data-theme="editorial"] .risk-corr-cell {
  min-width: 34px;
  padding: 4px 2px;
  font-size: 0.8rem;
  border-radius: 3px;
  color: var(--ol-text);
  cursor: pointer;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--ol-muted) 8%, transparent);
}
body[data-theme="editorial"] .risk-corr-label {
  font-size: 0.8rem;
  color: var(--ol-muted);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="5"] {
  background: color-mix(in srgb, var(--ol-bad) 85%, transparent);
  color: var(--ol-surface);
  border-color: color-mix(in srgb, var(--ol-bad) 55%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="4"] {
  background: color-mix(in srgb, var(--ol-bad) 62%, transparent);
  color: var(--ol-surface);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="3"] {
  background: color-mix(in srgb, var(--ol-bad) 44%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="2"] {
  background: color-mix(in srgb, var(--ol-bad) 28%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="1"] {
  background: color-mix(in srgb, var(--ol-bad) 14%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="0"] {
  background: color-mix(in srgb, var(--ol-muted) 8%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="-1"] {
  background: color-mix(in srgb, var(--ol-ok) 14%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="-2"] {
  background: color-mix(in srgb, var(--ol-ok) 28%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="-3"] {
  background: color-mix(in srgb, var(--ol-ok) 44%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="-4"] {
  background: color-mix(in srgb, var(--ol-ok) 62%, transparent);
  color: var(--ol-surface);
}
body[data-theme="editorial"] .risk-corr-cell[data-corr-bucket="-5"] {
  background: color-mix(in srgb, var(--ol-ok) 85%, transparent);
  color: var(--ol-surface);
  border-color: color-mix(in srgb, var(--ol-ok) 55%, transparent);
}
body[data-theme="editorial"] .risk-corr-cell.corr-dim { opacity: 0.25; }
body[data-theme="editorial"] .risk-corr-cell.corr-hilite {
  outline: 2px solid var(--ol-gold);
  outline-offset: -2px;
  z-index: 1;
}
body[data-theme="editorial"] .risk-corr-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--ol-muted);
  margin-top: 6px;
}
body[data-theme="editorial"] .risk-corr-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
body[data-theme="editorial"] .risk-corr-swatch--pos {
  background: color-mix(in srgb, var(--ol-bad) 70%, transparent);
}
body[data-theme="editorial"] .risk-corr-swatch--neg {
  background: color-mix(in srgb, var(--ol-ok) 70%, transparent);
}
/* Scale strip under heatmap — makes bucket intensity scannable */
body[data-theme="editorial"] .risk-corr-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 2px;
  margin-top: 8px;
  max-width: 320px;
}
body[data-theme="editorial"] .risk-corr-scale span {
  height: 8px;
  border-radius: 2px;
}
body[data-theme="editorial"] .risk-corr-scale-labels {
  display: flex;
  justify-content: space-between;
  max-width: 320px;
  font-size: 0.72rem;
  color: var(--ol-muted);
  margin-top: 2px;
}

/* Weight vs risk chart */
body[data-theme="editorial"] .risk-wr-bar-weight { background: var(--ol-accent); }
body[data-theme="editorial"] .risk-wr-bar-risk { background: var(--ol-bad); }
body[data-theme="editorial"] .risk-wr-tick {
  font-size: 0.72rem;
  color: var(--ol-muted);
}
body[data-theme="editorial"] .risk-share-fill {
  background: linear-gradient(90deg, var(--ol-warn), var(--ol-bad));
}

/* Breach / flag box */
body[data-theme="editorial"] .risk-breach-list {
  background: rgba(201, 73, 73, 0.07);
  border: 1px solid rgba(201, 73, 73, 0.55);
  border-radius: 8px;
}
body[data-theme="editorial"] .risk-breach-title { color: var(--ol-bad); }
body[data-theme="editorial"] .risk-breach-row { font-size: 0.875rem; }

/* Recommendation-style callout reuse */
body[data-theme="editorial"] .risk-recommendation-card {
  background: var(--ol-bg);
  border: 1px solid var(--ol-border);
  border-left: 3px solid var(--ol-gold);
  border-radius: 8px;
}

/* Stress testing */
body[data-theme="editorial"] .risk-stress-bar-down { background: var(--ol-warn); }
body[data-theme="editorial"] .risk-stress-bar-severe { background: var(--ol-bad); }
body[data-theme="editorial"] .risk-stress-bar-up { background: var(--ol-ok); }
body[data-theme="editorial"] .risk-stress-bar-na { background: rgba(90, 90, 90, 0.2); }
body[data-theme="editorial"] .risk-stress-tick {
  font-size: 0.74rem;
  color: var(--ol-muted);
}
body[data-theme="editorial"] .risk-tag-hypothetical {
  color: var(--ol-warn);
  border-color: var(--ol-warn);
  font-size: 0.66rem;
}

/* Footer disclosures + sparkline */
body[data-theme="editorial"] #portfolioRiskMount .panel-disclosure {
  background: var(--ol-bg);
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  padding: 4px 12px;
  margin-top: 8px;
}
body[data-theme="editorial"] .portfolio-analytics-sparkline { color: var(--ol-accent); }

/* Loading skeleton + staged progress */
body[data-theme="editorial"] .risk-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.875rem;
  margin-bottom: 10px;
}
body[data-theme="editorial"] .risk-progress-step--done { color: var(--ol-ok); }
body[data-theme="editorial"] .risk-progress-step--active { color: var(--ol-accent); font-weight: 600; }
body[data-theme="editorial"] .risk-progress-step--pending { color: var(--ol-muted); }
body[data-theme="editorial"] .risk-progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(90, 90, 90, 0.15);
  overflow: hidden;
  margin-bottom: 8px;
}
body[data-theme="editorial"] .risk-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--ol-gold);
  transition: width 1.2s ease;
}
body[data-theme="editorial"] .risk-skeleton-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
body[data-theme="editorial"] .risk-skeleton-row {
  display: flex;
  gap: 12px;
}
body[data-theme="editorial"] .risk-skeleton-block {
  border-radius: 8px;
  background: linear-gradient(
    100deg,
    rgba(90, 90, 90, 0.12) 40%,
    rgba(90, 90, 90, 0.05) 50%,
    rgba(90, 90, 90, 0.12) 60%
  );
  background-size: 200% 100%;
  animation: riskSkeletonShimmer 1.6s linear infinite;
}
@keyframes riskSkeletonShimmer {
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="editorial"] .risk-skeleton-block { animation: none; }
}

/* —— AA contrast pass: small red text uses the darker --ol-bad-text ——
 * #c94949 measures 3.4–4.1:1 on cream / tinted chips, below the 4.5:1
 * minimum for small text. Fills, borders, and large text keep --ol-bad. */
body[data-theme="editorial"] .operations-status-strip[data-state="error"] .operations-status-pill,
body[data-theme="editorial"] .research-status-strip[data-state="error"] .research-status-pill,
body[data-theme="editorial"] .system-status-strip[data-state="error"] .system-status-pill,
body[data-theme="editorial"] .decision-dashboard-state-strip[data-state="error"] .decision-dashboard-state-pill,
body[data-theme="editorial"] .decision-signal-edge-summary[data-state="error"],
body[data-theme="editorial"] .kanban-lane-summary[data-state="error"],
body[data-theme="editorial"] .workflow-progress-step[data-state="blocked"],
body[data-theme="editorial"] .workflow-progress-step[data-state="blocked"] .workflow-progress-index,
body[data-theme="editorial"] .health-badge.bg-red-900,
body[data-theme="editorial"] .risk-breach-title,
body[data-theme="editorial"] .decision-summary-pill.bad {
  color: var(--ol-bad-text) !important;
}

/* —— Generic skeleton blocks (reused beyond Portfolio Risk) —— */
body[data-theme="editorial"] .ol-skeleton {
  display: block;
  border-radius: 6px;
  min-height: 0.9rem;
  background: linear-gradient(
    100deg,
    rgba(90, 90, 90, 0.12) 40%,
    rgba(90, 90, 90, 0.05) 50%,
    rgba(90, 90, 90, 0.12) 60%
  );
  background-size: 200% 100%;
  animation: riskSkeletonShimmer 1.6s linear infinite;
}
body[data-theme="editorial"] .ol-skeleton + .ol-skeleton {
  margin-top: 0.5rem;
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="editorial"] .ol-skeleton { animation: none; }
}

/* —— Glossary tooltips (plain-language companions for jargon) —— */
body[data-theme="editorial"] .glossary-term {
  text-decoration: underline dotted rgba(26, 58, 46, 0.55);
  text-underline-offset: 2px;
  cursor: help;
  font-style: normal;
}

/* —— Onboarding step cards (moved out of inline JS colors) —— */
body[data-theme="editorial"] .onboarding-callback-hint {
  border-color: rgba(138, 92, 31, 0.45) !important;
}

body[data-theme="editorial"] .onboarding-step-card {
  border-radius: 8px;
  border: 1px solid var(--ol-border);
  background: var(--ol-surface-soft);
}

body[data-theme="editorial"] .onboarding-step-card[data-state="ok"] {
  border-color: rgba(45, 90, 74, 0.45);
  background: rgba(45, 90, 74, 0.08);
}

body[data-theme="editorial"] .onboarding-step-card[data-state="fail"] {
  border-color: rgba(201, 73, 73, 0.44);
  background: rgba(201, 73, 73, 0.08);
}

/* ============================================================
   2026-07-07 palette-unification pass.
   styles.css "Visual Overhaul v2" redefines the base tokens to a
   dark navy theme (--bg #04060f, --muted #a8b3d6, --panel navy).
   Every selector the editorial theme didn't override still consumed
   those, producing slate labels at 2:1 contrast, near-white values
   on cream, and dark-navy islands. Remap the base tokens here so
   var(--muted)/var(--panel)/... resolve to Old Logan values, then
   convert the remaining dark surfaces to cream.
============================================================ */
body[data-theme="editorial"] {
  --bg: var(--ol-bg);
  --bg-elevated: var(--ol-surface-soft);
  --panel: var(--ol-surface);
  --panel-border: var(--ol-border-strong);
  --text: var(--ol-text);
  --muted: var(--ol-muted);
  --accent: var(--ol-accent);
  --accent-2: var(--ol-accent-2);
  --good: var(--ol-ok);
  --bad: var(--ol-bad);
  --warn: var(--ol-warn);
  --border: var(--ol-border);
  /* overhaul.css cream-on-ink tokens: their dark surfaces are gone,
     so the "paper" text tokens must resolve to dark editorial text. */
  --paper: var(--ol-text);
  --paper-warm: var(--ol-text);
  --paper-mute: var(--ol-muted);
  --positive: var(--ol-ok);
  --positive-soft: rgba(45, 90, 74, 0.14);
  --negative: var(--ol-bad-text);
  --negative-soft: rgba(201, 73, 73, 0.12);
}

/* Active topbar tab + primary buttons keep the forest fill (they were
   the two intentional consumers of --paper-warm as a background). */
body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .btn.primary,
body[data-theme="editorial"] .app-topbar #scanBtn.btn.primary {
  background: var(--ol-accent) !important;
  border-color: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
}

/* —— Dark-island conversions —— */

/* Scan funnel + diagnostics blocks (were navy gradient cards) */
body[data-theme="editorial"] .scan-block,
body[data-theme="editorial"] .scan-block--blockers {
  background: var(--ol-surface-soft) !important;
  border-color: var(--ol-border) !important;
}

body[data-theme="editorial"] .funnel-node {
  background: var(--ol-surface) !important;
  border-color: var(--ol-border-strong) !important;
}

body[data-theme="editorial"] .funnel-node .label {
  color: var(--ol-muted) !important;
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .funnel-node-pct {
  color: var(--ol-muted) !important;
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .funnel-node-filtered {
  color: var(--ol-bad-text) !important;
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .funnel-bar-track {
  background: rgba(26, 26, 26, 0.1) !important;
}

body[data-theme="editorial"] .funnel-shadow-live,
body[data-theme="editorial"] .funnel-shadow-would,
body[data-theme="editorial"] .funnel-shadow-badge {
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .funnel-shadow-live { color: var(--ol-ok) !important; }
body[data-theme="editorial"] .funnel-shadow-would { color: var(--ol-warn) !important; }

/* Amber shadow badge was #fbbf24 on cream (1.66:1) */
body[data-theme="editorial"] .funnel-shadow-badge {
  background: rgba(201, 169, 98, 0.22) !important;
  color: var(--ol-warn) !important;
  border-color: rgba(176, 133, 42, 0.5) !important;
}

/* Blocker chips (near-white strong text was invisible on cream) */
body[data-theme="editorial"] .blocker-chips li {
  background: var(--ol-surface) !important;
  border-color: var(--ol-border-strong) !important;
  color: var(--ol-text-soft) !important;
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .blocker-chips li strong {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .blocker-chips li .pill {
  font-size: 0.8125rem !important;
}

/* Activity drawer log bubbles (navy with dark text) */
body[data-theme="editorial"] .log-list li {
  background: var(--ol-surface) !important;
  border-color: var(--ol-border) !important;
  color: var(--ol-text-soft) !important;
}

body[data-theme="editorial"] .log-kind {
  font-size: 0.78rem !important;
  border-color: var(--ol-border-strong) !important;
}

body[data-theme="editorial"] .log-kind.system { color: var(--ol-accent) !important; }
body[data-theme="editorial"] .log-kind.scan { color: var(--ol-accent-2) !important; }
body[data-theme="editorial"] .log-kind.trade { color: var(--ol-warn) !important; }
body[data-theme="editorial"] .log-kind.report { color: var(--ol-muted) !important; }
body[data-theme="editorial"] .log-kind.error { color: var(--ol-bad-text) !important; border-color: rgba(201, 73, 73, 0.44) !important; }

/* Onboarding stepper (navy tiles + slate text; also uneven layout) */
body[data-theme="editorial"] .onboarding-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-theme="editorial"] .onboarding-stepper li {
  flex: 1 1 180px;
  background: var(--ol-surface) !important;
  border-color: var(--ol-border-strong) !important;
}

body[data-theme="editorial"] .onboarding-stepper li .step-label {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .onboarding-stepper li .step-num {
  background: var(--ol-surface-soft) !important;
  color: var(--ol-text-soft) !important;
}

body[data-theme="editorial"] .onboarding-stepper li .step-state {
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .onboarding-stepper li.done {
  border-color: rgba(45, 90, 74, 0.45) !important;
  background: rgba(45, 90, 74, 0.08) !important;
}

body[data-theme="editorial"] .onboarding-stepper li.done .step-num {
  background: var(--ol-ok) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .onboarding-stepper li.done .step-state { color: var(--ol-ok) !important; }

body[data-theme="editorial"] .onboarding-stepper li.verifying {
  border-color: rgba(138, 92, 31, 0.5) !important;
  background: rgba(201, 169, 98, 0.13) !important;
}

body[data-theme="editorial"] .onboarding-stepper li.verifying .step-num {
  background: var(--ol-warn) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .onboarding-stepper li.verifying .step-state { color: var(--ol-warn) !important; }

body[data-theme="editorial"] .onboarding-stepper li.failed {
  border-color: rgba(201, 73, 73, 0.44) !important;
  background: rgba(201, 73, 73, 0.08) !important;
}

body[data-theme="editorial"] .onboarding-stepper li.failed .step-num {
  background: var(--ol-bad) !important;
  color: #fffefb !important;
}

body[data-theme="editorial"] .onboarding-stepper li.failed .step-state { color: var(--ol-bad-text) !important; }

body[data-theme="editorial"] .onboarding-stepper li.current {
  border-color: var(--ol-accent-border) !important;
  background: var(--ol-accent-soft) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .onboarding-stepper li.current .step-num {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .onboarding-stepper li.current .step-state { color: var(--ol-accent) !important; }

/* Onboarding "next step" row (navy card with dark muted text) */
body[data-theme="editorial"] .onboarding-next-row {
  background: var(--ol-surface) !important;
  border-color: var(--ol-accent-border) !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .onboarding-next-title,
body[data-theme="editorial"] p.onboarding-next-title {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .onboarding-next-desc {
  color: var(--ol-muted) !important;
}

/* Meters: dark track + neon gradients → editorial track and fills */
body[data-theme="editorial"] .meter {
  background: rgba(26, 26, 26, 0.12) !important;
}

body[data-theme="editorial"] .meter > span {
  background: var(--ol-accent-2) !important;
}

body[data-theme="editorial"] .meter.info > span {
  background: var(--ol-ok) !important;
}

body[data-theme="editorial"] .meter.conviction > span {
  background: var(--ol-warn) !important;
}

body[data-theme="editorial"] .meter-label {
  color: var(--ol-muted) !important;
  font-size: 0.8125rem !important;
}

/* Shadow scoreboard / review loop metric rows (labels were slate,
   values were near-white) */
body[data-theme="editorial"] .perf-metric .label {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .perf-metric .value {
  color: var(--ol-text) !important;
}

/* Status dots, activity badge, scroll-top, skip-link, clear buttons */
body[data-theme="editorial"] .status-dot.good { background: var(--ol-ok) !important; }
body[data-theme="editorial"] .status-dot.bad { background: var(--ol-bad) !important; }
body[data-theme="editorial"] .status-dot.warn { background: var(--ol-warn) !important; }

body[data-theme="editorial"] .activity-badge {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .scroll-top-btn {
  background: var(--ol-surface) !important;
  border-color: var(--ol-border-strong) !important;
  color: var(--ol-accent) !important;
}

body[data-theme="editorial"] .skip-link {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
  border-color: var(--ol-accent) !important;
}

body[data-theme="editorial"] .btn-clear-pending {
  background: var(--ol-surface) !important;
  border-color: var(--ol-border-strong) !important;
  color: var(--ol-bad-text) !important;
}

/* Trade drawer tabs (slate text on cream) */
body[data-theme="editorial"] .trade-drawer-tab {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .trade-drawer-tab.active {
  color: var(--ol-accent) !important;
}

/* Decision dashboard inner ribbon (navy band inside a cream card) */
body[data-theme="editorial"] .decision-dashboard-ribbon {
  background: var(--ol-surface-soft) !important;
  border-color: var(--ol-border) !important;
}

/* Default chip (slate) + pill.info/muted variants missing from the
   earlier good/warn/bad/neutral overrides */
body[data-theme="editorial"] .chip {
  background: var(--ol-surface-soft) !important;
  border-color: var(--ol-border-strong) !important;
  color: var(--ol-text-soft) !important;
}

body[data-theme="editorial"] .pill.info {
  background: var(--ol-accent-soft) !important;
  color: var(--ol-accent) !important;
  border-color: var(--ol-accent-border) !important;
}

body[data-theme="editorial"] .pill.muted {
  background: var(--ol-surface-soft) !important;
  color: var(--ol-muted) !important;
  border-color: var(--ol-border) !important;
}

/* Preset / profile panel leftovers (gold + paper text on cream) */
body[data-theme="editorial"] .preset-panel strong,
body[data-theme="editorial"] #profilePanel strong {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .preset-panel span,
body[data-theme="editorial"] #profilePanel span {
  color: var(--ol-text-soft);
}

/* Near-miss + scan table paper-mute leftovers */
body[data-theme="editorial"] #nearMissTableBody strong,
body[data-theme="editorial"] #scanTableBody .empty-state-cell,
body[data-theme="editorial"] .near-miss-reason {
  color: var(--ol-text-soft) !important;
}

/* ============================================================
   Type-floor sweep (audit 2026-07-07): supporting labels >= 13px.
============================================================ */
body[data-theme="editorial"] .field-label,
body[data-theme="editorial"] .today-summary-label,
body[data-theme="editorial"] .research-tab-nav {
  border-color: var(--ol-border) !important;
  background: var(--ol-surface) !important;
}

body[data-theme="editorial"] .research-tab-btn.active {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent, var(--ol-bg)) !important;
}

body[data-theme="editorial"] .research-density-control,
body[data-theme="editorial"] .research-check-mode-control {
  background: var(--ol-surface-soft) !important;
}

body[data-theme="editorial"] .research-density-btn.active,
body[data-theme="editorial"] .research-check-mode-btn.active {
  background: var(--ol-surface) !important;
  color: var(--ol-accent) !important;
}

body[data-theme="editorial"] .research-summary-label,
body[data-theme="editorial"] .system-summary-label,
body[data-theme="editorial"] .settings-summary-label,
body[data-theme="editorial"] .decision-gate-label,
body[data-theme="editorial"] .decision-pf-label,
body[data-theme="editorial"] .health-label,
body[data-theme="editorial"] .calibration-board-title,
body[data-theme="editorial"] .scan-rank-inline,
body[data-theme="editorial"] .mover-col-title,
body[data-theme="editorial"] .change-chip,
body[data-theme="editorial"] .decision-summary-pill,
body[data-theme="editorial"] .scan-block--blockers h3,
body[data-theme="editorial"] .scan-block-hint,
body[data-theme="editorial"] #scanDetailAdvancedStats .muted {
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .field-label {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .pill {
  font-size: 0.8125rem;
}

body[data-theme="editorial"] .btn.small,
body[data-theme="editorial"] a.btn.small,
body[data-theme="editorial"] .app-topbar .btn,
body[data-theme="editorial"] #scanBtn,
body[data-theme="editorial"] .screen-context-links a,
body[data-theme="editorial"] #screenContextCta,
body[data-theme="editorial"] #screenContextAltCta {
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] #scanSection .scan-candidates-table .btn.small {
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .operations-status-pill,
body[data-theme="editorial"] .research-status-pill,
body[data-theme="editorial"] .system-status-pill {
  font-size: 0.8125rem !important;
}

body[data-theme="editorial"] .code-block--tight {
  font-size: 0.8125rem !important;
}

/* ============================================================
   Spacing / overflow fixes from the audit screenshots.
============================================================ */
/* Near-miss reason pills were clipped by the nowrap-ellipsis cells */
body[data-theme="editorial"] #nearMissTableBody td:last-child,
body[data-theme="editorial"] #nearMissTableBody td .near-miss-reason {
  white-space: normal !important;
}

/* Cockpit lanes: correlation/positions chip grids overflowed the lane */
body[data-theme="editorial"] .cockpit-grid .lane {
  min-width: 0;
  overflow: hidden;
}

body[data-theme="editorial"] #cockpitPortfolioBody,
body[data-theme="editorial"] #cockpitBlotterBody {
  overflow-x: auto;
  max-width: 100%;
}

/* ============================================================
   Portfolio Book — Tax / Calendar / Journal polish
============================================================ */
body[data-theme="editorial"] .book-shell {
  gap: var(--space-3);
}
body[data-theme="editorial"] .book-kpi,
body[data-theme="editorial"] .book-estimate-card,
body[data-theme="editorial"] .book-rates-panel,
body[data-theme="editorial"] .book-day-card,
body[data-theme="editorial"] .book-journal-detail,
body[data-theme="editorial"] .book-journal-item,
body[data-theme="editorial"] .book-cal-cell {
  background: var(--ol-bg, var(--panel));
  border-color: var(--ol-border, var(--panel-border));
}
body[data-theme="editorial"] .book-kpi-label,
body[data-theme="editorial"] .book-section-title,
body[data-theme="editorial"] .book-field-label,
body[data-theme="editorial"] .book-cal-head {
  color: var(--ol-warn, var(--muted));
}
body[data-theme="editorial"] .book-kpi-value,
body[data-theme="editorial"] .book-estimate-total {
  color: var(--ol-accent, var(--accent));
}
body[data-theme="editorial"] .book-kpi-value.book-pl-pos,
body[data-theme="editorial"] .book-pl-pos {
  color: var(--good);
}
body[data-theme="editorial"] .book-kpi-value.book-pl-neg,
body[data-theme="editorial"] .book-pl-neg {
  color: var(--bad);
}
body[data-theme="editorial"] .book-cal-selected,
body[data-theme="editorial"] .book-journal-item.active {
  outline-color: var(--ol-accent, var(--accent));
}
body[data-theme="editorial"] .book-input,
body[data-theme="editorial"] .book-textarea {
  background: var(--ol-bg, var(--panel));
  border-color: var(--ol-border, var(--panel-border));
  flex: 0 0 auto !important;
}
body[data-theme="editorial"] .book-input {
  height: 2.25rem !important;
  min-height: 2.25rem !important;
  max-height: 2.25rem !important;
  line-height: 1.25 !important;
  box-sizing: border-box !important;
}
body[data-theme="editorial"] .book-textarea {
  height: auto !important;
  max-height: none !important;
  min-height: 4.5rem !important;
}
body[data-theme="editorial"] .book-rates-panel,
body[data-theme="editorial"] .book-estimate-card {
  width: fit-content;
  max-width: 100%;
}
body[data-theme="editorial"] .book-cal-cell {
  min-height: 3.25rem;
}
body[data-theme="editorial"] .book-banner--warn {
  background: color-mix(in srgb, var(--ol-warn, #c9a962) 16%, transparent);
  border-color: color-mix(in srgb, var(--ol-warn, #c9a962) 40%, var(--ol-border, transparent));
}
body[data-theme="editorial"] .book-journal-layout {
  gap: var(--space-3);
}
body[data-theme="editorial"] .book-cal-realized {
  font-size: 0.84rem;
}

/* Performance panel — remapped from dark cockpit leftovers to ol/* tokens (Wave 5) */
body[data-theme="editorial"] .perf-bucket {
  border: 1px solid var(--ol-border) !important;
  background: var(--ol-surface) !important;
  color: var(--ol-text) !important;
}
body[data-theme="editorial"] .perf-bucket h3 {
  color: var(--ol-accent) !important;
}
body[data-theme="editorial"] .perf-bucket-note,
body[data-theme="editorial"] .perf-bucket .perf-source {
  color: var(--ol-muted) !important;
}
body[data-theme="editorial"] .performance-callout {
  border: 1px solid color-mix(in srgb, var(--ol-gold) 45%, var(--ol-border)) !important;
  background: color-mix(in srgb, var(--ol-gold) 14%, var(--ol-surface)) !important;
  color: var(--ol-text) !important;
}
body[data-theme="editorial"] .performance-outcomes-wrap,
body[data-theme="editorial"] .perf-attribution-card {
  border: 1px solid var(--ol-border) !important;
  background: var(--ol-surface) !important;
}
body[data-theme="editorial"] .performance-outcomes-wrap h3,
body[data-theme="editorial"] .perf-attribution-card h3,
body[data-theme="editorial"] .perf-attribution-wrap h3 {
  color: var(--ol-accent) !important;
}
body[data-theme="editorial"] .operator-alert--warn {
  border-left: 3px solid var(--ol-gold);
  background: color-mix(in srgb, var(--ol-gold) 12%, var(--ol-surface));
}
body[data-theme="editorial"] .operator-alert--warn .operator-alert__headline {
  color: var(--ol-warn) !important;
}

/* ---- Dark-on-dark safety net (hardcoded navy leftovers) ---- */
body[data-theme="editorial"] #healthRibbon,
body[data-theme="editorial"] #healthRibbon .health-tile,
body[data-theme="editorial"] #healthRibbon .system-status-strip,
body[data-theme="editorial"] .system-status-strip,
body[data-theme="editorial"] .operations-status-strip {
  background: var(--ol-surface) !important;
  background-image: none !important;
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] #healthRibbon .health-label,
body[data-theme="editorial"] #healthRibbon .health-value,
body[data-theme="editorial"] #healthRibbon .muted,
body[data-theme="editorial"] #healthRibbon p,
body[data-theme="editorial"] #healthRibbon small,
body[data-theme="editorial"] #healthRibbon strong,
body[data-theme="editorial"] .system-status-strip,
body[data-theme="editorial"] .system-status-strip .muted,
body[data-theme="editorial"] .operations-status-strip,
body[data-theme="editorial"] .operations-status-strip .muted {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .system-status-strip .muted,
body[data-theme="editorial"] .operations-status-strip .muted,
body[data-theme="editorial"] #healthRibbon .muted,
body[data-theme="editorial"] #healthRibbon small {
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .system-status-pill,
body[data-theme="editorial"] .operations-status-pill {
  background: color-mix(in srgb, var(--ol-ok) 14%, var(--ol-surface)) !important;
  color: var(--ol-ok) !important;
  border: 1px solid color-mix(in srgb, var(--ol-ok) 35%, transparent) !important;
}

/* Solid accent fills must keep light text (never inherit body ink) */
body[data-theme="editorial"] .btn.primary,
body[data-theme="editorial"] .btn.good,
body[data-theme="editorial"] .app-topbar-brand .brand-mark {
  color: var(--ol-on-accent) !important;
  -webkit-text-fill-color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent) !important;
  -webkit-text-fill-color: var(--ol-on-accent) !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] .tab-num {
  color: var(--ol-on-accent) !important;
  -webkit-text-fill-color: var(--ol-on-accent) !important;
  background: transparent !important;
}

/* Nested research/decision panels that still ship navy fills from styles.css */
body[data-theme="editorial"] #decisionAblationTopWrap,
body[data-theme="editorial"] #validationRecentWrap,
body[data-theme="editorial"] #scMessages,
body[data-theme="editorial"] .chat-log-scroll,
body[data-theme="editorial"] .chat-bubble,
body[data-theme="editorial"] .chat-bubble-assistant,
body[data-theme="editorial"] .chat-bubble-user,
body[data-theme="editorial"] .chat-empty-hint,
body[data-theme="editorial"] .tool-output-host,
body[data-theme="editorial"] .decision-ablation-wrap,
body[data-theme="editorial"] .validation-recent-wrap,
body[data-theme="editorial"] .validation-steps,
body[data-theme="editorial"] .onboarding-stepper li,
body[data-theme="editorial"] .code-block,
body[data-theme="editorial"] pre.code-block {
  background: var(--ol-surface-soft) !important;
  background-image: none !important;
  color: var(--ol-text) !important;
  border-color: var(--ol-border) !important;
}

body[data-theme="editorial"] .chat-bubble-user {
  background: color-mix(in srgb, var(--ol-accent) 10%, var(--ol-surface)) !important;
}

body[data-theme="editorial"] .chat-empty-hint,
body[data-theme="editorial"] #scMessages .muted,
body[data-theme="editorial"] #decisionAblationTopWrap .muted,
body[data-theme="editorial"] #validationRecentWrap .muted,
body[data-theme="editorial"] .validation-steps summary {
  color: var(--ol-muted) !important;
}

/* Broad navy-panel wipe: styles.css still ships many rgba(9,16,35) / zinc
   fills that inherit dark body text under the editorial theme. */
body[data-theme="editorial"] .preset-subsection,
body[data-theme="editorial"] .scan-block,
body[data-theme="editorial"] .scan-block--blockers,
body[data-theme="editorial"] .report-claim-grid > div,
body[data-theme="editorial"] .shadow-plugin-card,
body[data-theme="editorial"] .plugin-shadow-card,
body[data-theme="editorial"] .decision-gate-tile,
body[data-theme="editorial"] .kpi-tile,
body[data-theme="editorial"] .health-tile,
body[data-theme="editorial"] .meter,
body[data-theme="editorial"] .funnel-stage,
body[data-theme="editorial"] .scan-funnel,
body[data-theme="editorial"] .task-card,
body[data-theme="editorial"] .near-miss-row,
body[data-theme="editorial"] .priority-feed-item,
body[data-theme="editorial"] .notif-item,
body[data-theme="editorial"] .cockpit-card,
body[data-theme="editorial"] .cockpit-panel,
body[data-theme="editorial"] .exec-monitor,
body[data-theme="editorial"] .risk-flag-list,
body[data-theme="editorial"] .sector-card,
body[data-theme="editorial"] #scanDetailChartContainer,
body[data-theme="editorial"] #authDebugPanel,
body[data-theme="editorial"] #onboardingHelp,
body[data-theme="editorial"] .auth-debug-panel,
body[data-theme="editorial"] .onboarding-help {
  background: var(--ol-surface) !important;
  background-image: none !important;
  color: var(--ol-text) !important;
  border-color: var(--ol-border) !important;
}

body[data-theme="editorial"] .preset-subsection h3,
body[data-theme="editorial"] .scan-block h3,
body[data-theme="editorial"] .health-tile .health-label,
body[data-theme="editorial"] .health-tile .health-value {
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .preset-subsection .muted,
body[data-theme="editorial"] .scan-block .muted,
body[data-theme="editorial"] .health-tile .muted {
  color: var(--ol-muted) !important;
}

/* ============================================================
   Tab comprehension redesign — nav subtitles + landing frame
   ============================================================ */
body[data-theme="editorial"] .app-topbar-tabs {
  align-items: stretch !important;
  gap: 4px !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 8px 12px 10px !important;
  border-radius: 12px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--ol-muted) !important;
  line-height: 1.2 !important;
  position: relative;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn .tab-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn .tab-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: inherit;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn .tab-subtitle {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ol-muted);
  max-width: 11.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn:hover {
  background: color-mix(in srgb, var(--ol-surface-soft) 80%, var(--ol-accent) 8%) !important;
  color: var(--ol-text) !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] {
  background: color-mix(in srgb, var(--ol-surface) 92%, var(--ol-accent) 8%) !important;
  color: var(--ol-text) !important;
  -webkit-text-fill-color: var(--ol-text) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--ol-gold, #c9a962);
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] .tab-num {
  color: var(--ol-gold, #c9a962) !important;
  -webkit-text-fill-color: var(--ol-gold, #c9a962) !important;
}

body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn[aria-selected="true"] .tab-subtitle {
  color: var(--ol-muted) !important;
  opacity: 0.95;
}

body[data-theme="editorial"] .tab-landing-frame.mode-header {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 22px 24px !important;
  border: 1px solid var(--ol-border) !important;
  border-radius: 18px !important;
  background: var(--ol-surface) !important;
}

body[data-theme="editorial"] .tab-landing-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
}

body[data-theme="editorial"] .tab-landing-identity {
  min-width: min(100%, 280px);
  flex: 1 1 280px;
}

/* Title + job subtitle carry identity; hide redundant eyebrows in landing frame. */
body[data-theme="editorial"] .tab-landing-frame .mode-eyebrow {
  display: none !important;
}

body[data-theme="editorial"] .tab-landing-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ol-muted) !important;
}

body[data-theme="editorial"] .tab-landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

body[data-theme="editorial"] .tab-landing-actions #screenContextCta {
  font-size: 0.9rem !important;
  padding: 0.55rem 1.1rem !important;
}

body[data-theme="editorial"] .tab-landing-secondary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

body[data-theme="editorial"] .tab-landing-link {
  color: var(--ol-accent) !important;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

body[data-theme="editorial"] .tab-landing-link:hover {
  border-bottom-color: color-mix(in srgb, var(--ol-accent) 45%, transparent);
}

body[data-theme="editorial"] .tab-landing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-theme="editorial"] .tab-landing-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--ol-border);
  background: var(--ol-bg);
  color: var(--ol-text);
  font-size: 0.78rem;
  font-weight: 600;
}

body[data-theme="editorial"] .tab-landing-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ol-muted);
  flex: 0 0 auto;
}

body[data-theme="editorial"] .tab-landing-chip--healthy {
  border-color: color-mix(in srgb, var(--ol-ok, #2f6b4f) 55%, var(--ol-border));
}
body[data-theme="editorial"] .tab-landing-chip--healthy .tab-landing-chip-dot {
  background: var(--ol-ok, #2f6b4f);
}
body[data-theme="editorial"] .tab-landing-chip--attention {
  border-color: color-mix(in srgb, var(--ol-warn, #8a5c1f) 55%, var(--ol-border));
}
body[data-theme="editorial"] .tab-landing-chip--attention .tab-landing-chip-dot {
  background: var(--ol-warn, #8a5c1f);
}
body[data-theme="editorial"] .tab-landing-chip--blocked {
  border-color: color-mix(in srgb, var(--ol-bad, #c94949) 55%, var(--ol-border));
}
body[data-theme="editorial"] .tab-landing-chip--blocked .tab-landing-chip-dot {
  background: var(--ol-bad, #c94949);
}

body[data-theme="editorial"] .tab-landing-anchors.mode-header-anchors {
  margin-top: 2px;
  opacity: 0.85;
}

body[data-theme="editorial"] .research-mode-chips.research-tab-nav {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px !important;
  padding: 10px !important;
  width: 100%;
}

body[data-theme="editorial"] .research-mode-chips .research-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px !important;
  border: 1px solid var(--ol-border) !important;
  border-radius: 14px !important;
  background: var(--ol-surface) !important;
  color: var(--ol-text) !important;
  text-align: left;
}

body[data-theme="editorial"] .research-mode-chips .research-tab-label {
  font-weight: 700;
  font-size: 0.95rem;
}

body[data-theme="editorial"] .research-mode-chips .research-tab-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ol-muted);
  line-height: 1.3;
}

body[data-theme="editorial"] .research-mode-chips .research-tab-btn.active {
  background: var(--ol-accent) !important;
  color: var(--ol-on-accent, #fdfaf4) !important;
  border-color: var(--ol-accent) !important;
}

body[data-theme="editorial"] .research-mode-chips .research-tab-btn.active .research-tab-hint {
  color: color-mix(in srgb, var(--ol-on-accent, #fff) 82%, transparent) !important;
}

body[data-theme="editorial"] .system-two-zone {
  display: grid;
  gap: 16px;
}

body[data-theme="editorial"] .system-zone {
  border: 1px solid var(--ol-border);
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--ol-bg);
}

body[data-theme="editorial"] .system-zone-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ol-muted);
}

body[data-theme="editorial"] .system-zone-verdict {
  display: block;
  font-family: var(--serif, "Fraunces", Georgia, serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  color: var(--ol-text);
}

body[data-theme="editorial"] .system-summary-landing[data-system-state="healthy"] .system-zone--trade {
  border-color: color-mix(in srgb, var(--ol-ok, #2f6b4f) 65%, var(--ol-border));
}
body[data-theme="editorial"] .system-summary-landing[data-system-state="healthy"] .system-zone-verdict {
  color: var(--ol-ok, #2f6b4f);
}
body[data-theme="editorial"] .system-summary-landing[data-system-state="blocked"] .system-zone--trade {
  border-color: color-mix(in srgb, var(--ol-bad, #c94949) 70%, var(--ol-border));
  border-width: 2px;
}
body[data-theme="editorial"] .system-summary-landing[data-system-state="blocked"] .system-zone-verdict {
  color: var(--ol-bad, #c94949);
}

body[data-theme="editorial"] .system-blocker-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

body[data-theme="editorial"] .system-blocker-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ol-surface);
}

body[data-theme="editorial"] .system-zone--calibrate {
  opacity: 0.92;
}

body[data-theme="editorial"] .system-zone-secondary-title {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

body[data-theme="editorial"] .system-zone-support {
  margin-top: 0.85rem;
}

body[data-theme="editorial"] .settings-connect-priority {
  border: 2px solid color-mix(in srgb, var(--ol-bad, #c94949) 65%, var(--ol-border));
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 14px;
  background: color-mix(in srgb, var(--ol-surface) 92%, var(--ol-bad, #c94949) 8%);
}

body[data-theme="editorial"] .settings-summary-landing--attention .settings-summary-guardrails--secondary {
  opacity: 0.88;
}

body[data-theme="editorial"] .settings-summary-landing--healthy .settings-connect-priority {
  display: none !important;
}

@media (max-width: 1200px) {
  body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn .tab-subtitle {
    max-width: 8.5rem;
  }
}

@media (max-width: 900px) {
  body[data-theme="editorial"] .app-topbar-tabs .screen-switch-btn .tab-subtitle {
    /* Keep visible (not hover-only); allow wrap on narrow desktop widths. */
    white-space: normal;
    max-width: 7.5rem;
  }
  body[data-theme="editorial"] .research-mode-chips.research-tab-nav {
    grid-template-columns: 1fr;
  }
}

/* System decision-facelift lane nav */
body[data-theme="editorial"] .system-command-strip {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.25rem;
}

body[data-theme="editorial"] .system-lane-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.85rem;
  border: 1px solid var(--ol-border);
  border-radius: 999px;
  background: var(--ol-surface);
  position: sticky;
  top: 0.5rem;
  z-index: 5;
}

body[data-theme="editorial"] .system-lane-nav__btn {
  border: 0;
  background: transparent;
  color: var(--ol-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

body[data-theme="editorial"] .system-lane-nav__btn.is-active {
  background: var(--ol-accent);
  color: var(--ol-surface);
}

body[data-theme="editorial"] .system-lane-nav__btn:focus-visible {
  outline: 2px solid var(--ol-gold);
  outline-offset: 2px;
}

body.ui-screen-diagnostics .system-lane-hidden {
  display: none !important;
}

body[data-theme="editorial"] .system-next-decision {
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ol-gold) 70%, var(--ol-border));
  background: var(--ol-surface);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

body[data-theme="editorial"] .system-next-decision[data-decision="fix"] {
  border-color: color-mix(in srgb, var(--ol-bad) 65%, var(--ol-border));
}

body[data-theme="editorial"] .system-next-decision__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ol-gold);
  font-weight: 600;
}

body[data-theme="editorial"] .system-next-decision[data-decision="fix"] .system-next-decision__eyebrow {
  color: var(--ol-bad);
}

body[data-theme="editorial"] .system-next-decision__title {
  font-family: var(--ol-font-display, "Fraunces", Georgia, serif);
  font-size: 1.05rem;
  color: var(--ol-text);
}

body[data-theme="editorial"] .system-next-decision__why {
  margin: 0;
  font-size: 0.85rem;
}

body[data-theme="editorial"] #systemSummaryLanding[data-system-state="healthy"] #systemZoneVerdict {
  color: var(--ol-ok);
}

body[data-theme="editorial"] #systemSummaryLanding[data-system-state="blocked"] #systemZoneVerdict {
  color: var(--ol-bad);
}

body[data-theme="editorial"] #systemSummaryLanding[data-system-state="unknown"] #systemZoneVerdict {
  color: var(--ol-muted);
}

body[data-theme="editorial"] #systemZoneVerdict {
  font-family: var(--ol-font-display, "Fraunces", Georgia, serif);
  font-size: 1.65rem;
  letter-spacing: 0.02em;
}

body[data-theme="editorial"] .system-blocker-item--clear {
  background: transparent;
  padding-left: 0;
}

/* Decide / quality / advanced: less nested-chrome noise when lane-focused */
body[data-system-lane="decide"] .system-decision-disclosure > .panel-disclosure-summary .disclosure-hint,
body[data-system-lane="calibrate"] .system-quality-disclosure > .panel-disclosure-summary .disclosure-hint,
body[data-system-lane="shadow"] .system-quality-disclosure > .panel-disclosure-summary .disclosure-hint,
body[data-system-lane="review"] .system-quality-disclosure > .panel-disclosure-summary .disclosure-hint {
  display: none;
}

body[data-system-lane="decide"] .system-decision-nested > .section-head {
  display: none;
}

body[data-system-lane="ready"] #healthRibbon {
  margin-top: 0.25rem;
}



