:root {
  --bg: #0e0e0e;
  --bg-grid: #0c0d10;
  --surface: #141414;
  --surface-raised: #16181d;
  --surface-muted: #1a1a1a;
  --input-bg: #141414;
  --border: #262626;
  --border-strong: #3a3f4a;
  --fg: #f3f4f6;
  --fg-strong: #ffffff;
  --muted: #8d95a7;
  --accent: #13674c;
  --accent-hover: #0f5a42;
  --accent-soft: rgba(19, 103, 76, .18);
  --positive: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #38bdf8;
  --radius-card: 6px;
  --radius-input: 4px;
  --shadow-panel: 0 16px 48px rgba(0, 0, 0, .45);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, Arial, sans-serif;
  font-feature-settings: "tnum" 1, "liga" 0, "calt" 0;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 1000;
  padding: 8px 12px;
  border-radius: var(--radius-input);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: calc(48px + env(safe-area-inset-bottom));
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  color: var(--fg);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: var(--shadow-panel);
  pointer-events: auto;
  cursor: pointer;
}

.toast-error {
  border-color: rgba(248, 113, 113, .45);
  background: rgba(127, 29, 29, .35);
}

.toast-success {
  border-color: rgba(74, 222, 128, .35);
  background: rgba(20, 83, 45, .35);
}

.toast-info {
  border-color: rgba(56, 189, 248, .35);
  background: rgba(12, 74, 110, .35);
}

.login-body {
  min-height: 100vh;
  background-color: var(--bg-grid);
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-position: -1px -1px;
  background-size: 24px 24px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
}

.login-brand,
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.login-brand {
  justify-content: center;
  margin-bottom: 10px;
}

.brand-logo-wrap {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-title {
  color: var(--fg-strong);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restricted {
  max-width: 420px;
  margin: 0 0 28px;
  color: rgba(243, 244, 246, .82);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.5;
  text-align: center;
}

.login-panel {
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-panel);
}

.credentials {
  padding: 22px 22px 20px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid #b8c0cc;
  border-radius: 8px;
  background: #eef2f7;
  color: #111827;
  font-size: 15px;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(19, 103, 76, .25);
  outline: none;
}

.auth-button {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #0f1115;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}

.auth-button:hover {
  border-color: #6b7280;
  background: #151820;
}

.login-error {
  min-height: 1.25em;
  margin: 0 0 10px;
  color: var(--danger);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: #2d323b;
}

.notice {
  padding: 18px 22px 22px;
  border-top: 1px solid #2d323b;
  background: rgba(0, 0, 0, .2);
}

.notice h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.notice p {
  margin: 0 0 8px;
  color: rgba(243, 244, 246, .88);
  font-size: 13px;
  line-height: 1.55;
}

.notice p:last-child {
  margin-bottom: 0;
}

.top {
  height: 64px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.top .brand-logo-wrap {
  width: 32px;
  height: 32px;
}

.top .brand-title {
  font-size: 20px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.backend-pill,
.status-pill,
.badge,
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.backend-pill {
  gap: 6px;
  padding: 7px 10px;
  font-size: 11px;
  text-transform: none;
}

.backend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .16);
}

.backend-pill.online .backend-dot {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .16);
}

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, .03);
  color: var(--fg);
  cursor: pointer;
  font-weight: 900;
}

.icon-button:hover,
.profile-btn:hover,
.button.secondary:hover {
  border-color: rgba(19, 103, 76, .45);
  background: rgba(19, 103, 76, .22);
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--fg);
  cursor: pointer;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #353a44;
  border-radius: 50%;
  background: #12161e;
  color: #d7deea;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.profile-avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.profile-avatar-xl {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.profile-caret {
  color: var(--muted);
  font-size: 11px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  min-width: 0;
  overflow: hidden;
}

.sidebar {
  min-width: 0;
  border-right: 1px solid var(--border);
  background: #0f0f0f;
  padding: 14px 10px;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(19, 103, 76, .4);
  background: var(--accent-soft);
  color: var(--fg);
}

.workspace {
  min-width: 0;
  padding: 16px 24px 28px;
  overflow: hidden;
}

.command-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.command-header > div {
  min-width: 0;
}

.layer-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-elevated);
}

.layer-status-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.layer-status-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.layer-warnings {
  color: var(--warning);
  font-weight: 600;
}

.layer-last-event {
  color: var(--text-muted);
}

.live-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  color: var(--fg-strong);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 3px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.subtext,
.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.command-actions,
.tab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.command-actions {
  justify-content: flex-end;
}

.command-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.command-meta-pill.disclosure {
  border-color: rgba(19, 103, 76, .32);
  background: rgba(19, 103, 76, .08);
  color: #7dd3ae;
}

.command-meta-pill.demo-data {
  border-color: rgba(180, 130, 40, .45);
  background: rgba(180, 130, 40, .10);
  color: #d6b64a;
}

.button,
.tab {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, .03);
  color: var(--fg);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  font-family: inherit;
}

.button.primary {
  border-color: rgba(19, 103, 76, .52);
  background: var(--accent);
}

.button.primary:hover {
  background: var(--accent-hover);
}

.button.secondary,
.tab {
  background: rgba(255, 255, 255, .03);
}

.button.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .14);
  color: var(--muted);
  font-weight: 700;
}

.button.ghost:hover {
  border-color: rgba(19, 103, 76, .45);
  background: rgba(255, 255, 255, .06);
  color: var(--fg);
}

.tab-row {
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow-x: auto;
}

.tab.active {
  border-color: rgba(19, 103, 76, .48);
  background: var(--accent-soft);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.metric-card {
  padding: 12px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  color: var(--fg-strong);
  font-size: 24px;
  line-height: 1;
}

.metric-delta {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
}

.positive,
.healthy,
.high {
  color: var(--positive);
}

.warning,
.med {
  color: var(--warning);
}

.danger,
.low {
  color: var(--danger);
}

.info {
  color: var(--info);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel {
  min-width: 0;
  padding: 12px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.status-pill {
  padding: 5px 8px;
}

.status-pill.healthy {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .12);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.control span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.control select {
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .02);
}

.filter-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.filter-pill {
  gap: 6px;
  padding: 5px 8px;
  color: var(--fg);
  cursor: pointer;
}

.filter-pill span {
  color: var(--muted);
}

.event-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  display: flex;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, .025);
}

.event-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

.event-list strong {
  display: block;
  color: var(--fg);
  font-size: 12px;
}

.event-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .16);
}

.table-wrap-limited {
  max-height: 380px;
}

.table-footer {
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.roadmap-table .roadmap-phase {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.event-list-limited {
  max-height: 360px;
  overflow-y: auto;
}

.release-notes-limited {
  max-height: 420px;
  overflow-y: auto;
}

.gov-health-section {
  margin: 16px 0 24px;
}

.gov-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.gov-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.gov-health-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  min-height: 132px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gov-health-card:hover {
  border-color: var(--accent);
  background: rgba(5, 150, 105, 0.07);
}

.gov-health-card.warning,
.gov-health-card.danger,
.gov-health-card.healthy {
  color: var(--fg);
}

.gov-health-count {
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
  color: var(--fg-strong);
}

.gov-health-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.32;
}

.gov-health-severity {
  margin-top: 4px;
}

.gov-health-card small {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.gov-findings {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg);
}

.gov-findings strong {
  color: var(--fg-strong);
  font-size: 16px;
}

.gov-findings ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.gov-finding {
  margin-bottom: 8px;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
}

.gov-finding code {
  margin-left: 4px;
  color: var(--info);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 5px;
  padding: 2px 5px;
}

.release-diff-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.release-diff-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.release-diff-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.release-diff-block {
  margin-top: 8px;
  font-size: 12px;
}

.release-diff-block ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.gov-link,
.link-button.gov-link {
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.gov-reset-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

td {
  color: var(--fg);
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  padding: 4px 7px;
}

.badge.high {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .12);
}

.badge.med {
  border-color: rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .12);
}

.badge.low {
  border-color: rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .12);
}

.mini-chart {
  height: 210px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    rgba(0, 0, 0, .12);
  background-size: 100% 32px;
}

.mini-chart span {
  flex: 1;
  min-width: 14px;
  border: 1px solid rgba(19, 103, 76, .35);
  border-radius: 4px 4px 0 0;
  background: rgba(19, 103, 76, .55);
}

/* ── L0 Command Center shell ── */
.top-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: #0f0f0f;
  padding: 0 16px;
}

.top-tab {
  display: block;
  padding: 12px 16px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.top-tab:hover {
  color: var(--fg);
  background: rgba(19, 103, 76, .06);
}

.top-tab.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.l0-main {
  min-height: calc(100vh - 64px - 42px - 36px);
  padding: 16px 24px 12px;
  overflow-x: hidden;
}

.bottom-ledger {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 24px;
  border-top: 1px solid var(--border);
  background: #0a0a0a;
  min-height: 36px;
  align-items: center;
  max-width: 100vw;
}

.ledger-item {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  max-width: min(560px, calc(100vw - 48px));
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
}

.ledger-item.warning { color: var(--warning); }
.ledger-item.info { color: var(--info); }
.ledger-item.ack { color: var(--positive); }
.ledger-item.deploy { color: var(--muted); }

.ledger-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  opacity: .7;
}

.ledger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-badge {
  padding: 4px 8px;
  border: 1px solid rgba(19, 103, 76, .4);
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--positive);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.env-badge.demo-data,
.status-pill.demo-data,
.live-badge.demo-data {
  border-color: rgba(180, 130, 40, .45);
  background: rgba(180, 130, 40, .12);
  color: #c9a227;
}

.data-source-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(180, 130, 40, .35);
  border-radius: var(--radius-card);
  background: rgba(180, 130, 40, .08);
}

.data-source-banner-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #c9a227;
}

.data-source-banner-hint {
  font-size: 12px;
  color: var(--muted);
}

.master-section-head,
.infra-section-head,
.kpi-provenance {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.master-section-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.master-section-head h2 {
  margin: 0;
}

.provenance-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

.provenance-pill[data-source="live"] {
  border-color: rgba(60, 160, 100, .4);
  color: var(--positive);
}

.provenance-pill[data-source="probe"] {
  border-color: rgba(80, 140, 200, .45);
  color: #6eb5e8;
}

.provenance-pill.provenance-notice,
.provenance-pill[data-source="demo"],
.provenance-pill[data-source="fallback"],
.provenance-pill[data-source="mixed"],
.provenance-pill[data-source="stale"] {
  border-color: rgba(180, 130, 40, .45);
  background: rgba(180, 130, 40, .1);
  color: #c9a227;
}

.provenance-pill[data-source="stale"] {
  border-color: rgba(200, 100, 60, .45);
  color: #d4845a;
}

.provenance-inspectable {
  cursor: pointer;
}

.provenance-inspectable:hover {
  filter: brightness(1.08);
}

.panel-provenance {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.source-inspector .detail-grid code {
  font-size: 11px;
}

.mode-select select {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--fg);
  font-size: 11px;
  font-weight: 700;
}

.freshness-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.btn-sm {
  min-height: 28px !important;
  padding: 4px 10px !important;
  font-size: 10px !important;
}

/* Master layout */
.master-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 12px 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .02);
}

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

.master-filter-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.master-env-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  overflow: hidden;
}

.master-env-btn {
  min-height: 30px;
  padding: 4px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.master-env-btn.active {
  background: var(--accent-soft);
  color: var(--positive);
}

.master-env-btn:not(.active):hover {
  background: rgba(255, 255, 255, .04);
  color: var(--fg);
}

.master-filter-select {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--fg);
  font-size: 11px;
  font-weight: 700;
}

.master-filter-status {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.master-filter-demo {
  min-height: 30px;
}

.master-live-feed {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 999px;
  background: rgba(56, 189, 248, .07);
  color: #b8c3d6;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.master-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--info);
  box-shadow: 0 0 0 0 rgba(56, 189, 248, .45);
  animation: live-feed-pulse 1.4s ease-out infinite;
}

.master-live-window {
  color: var(--muted);
}

@keyframes live-feed-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, .45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(56, 189, 248, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  }
}

.master-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.master-primary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.master-status-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.master-status-section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.master-status-section h2 {
  margin: 0 0 12px;
  font-size: 13px;
}

.health-grid,
.freshness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.health-stack,
.freshness-stack {
  display: grid;
  gap: 8px;
}

.master-rail {
  min-width: 0;
}

.master-rail-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
}

.master-rail-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.master-rail h2 {
  margin: 0 0 4px;
  font-size: 13px;
}

.master-rail-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.master-rail-item {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .02);
  font-size: 11px;
}

.master-rail-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.master-rail-item-head strong {
  font-size: 12px;
}

.master-rail-item-head code {
  font-size: 10px;
  color: var(--muted);
}

.master-rail-item small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.master-rail-clickable {
  cursor: pointer;
  transition: border-color 0.15s;
}

.master-rail-clickable:hover {
  border-color: var(--accent);
}

.master-rail-panel .trace-list {
  margin-bottom: 0;
}

.rail-empty {
  margin: 0;
  padding: 8px 0 2px;
  font-size: 11px;
}

.master-canvas {
  min-width: 0;
}

/* Flow map */
.flow-map {
  position: relative;
  padding: 16px;
  border: 1px solid rgba(19, 103, 76, 0.35);
  border-radius: var(--radius-card);
  background: var(--surface);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: inset 0 0 0 1px rgba(19, 103, 76, 0.1);
}

.flow-map-lens-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(19, 103, 76, 0.35);
  background: rgba(19, 103, 76, 0.12);
}

.flow-map-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.flow-map-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.flow-map-section-pipeline {
  padding-top: 28px;
}

.flow-map-section-title {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-strong);
}

.health-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.health-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.health-card-name {
  font-size: 12px;
  font-weight: 700;
}

.health-card-metrics {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.health-card small {
  font-size: 10px;
  color: var(--muted);
}

.health-card-disconnected {
  border-style: dashed;
  opacity: 0.92;
}

.freshness-card.disconnected {
  border-style: dashed;
  opacity: 0.92;
}

.infra-map-card-disconnected {
  border-style: dashed;
  opacity: 0.92;
}

/* Flow map */
.flow-map-caption {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.flow-map-section-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-map-layers {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 16px;
}

.layer-node {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-muted);
  cursor: pointer;
  color: inherit;
  text-align: left;
  transition: background 0.15s;
}

.flow-map-layers .layer-node:first-child {
  border-radius: var(--radius-card) 0 0 var(--radius-card);
}

.flow-map-layers .layer-node:last-of-type {
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

.layer-node + .layer-node,
.flow-edge + .layer-node {
  border-left: 0;
}

.layer-node:hover {
  background: rgba(255, 255, 255, 0.04);
}

.layer-node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.layer-node-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.layer-node-head .status-pill {
  flex-shrink: 0;
  font-size: 9px;
  padding: 3px 6px;
}

.layer-node-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
}

.layer-node-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.layer-node-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
}

.layer-node-metrics div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.layer-node-metrics dt {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.layer-node-metrics dd {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.layer-node-time {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.flow-edge-line {
  display: block;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--border-strong), var(--accent), var(--border-strong));
  background-size: 200% 100%;
  animation: flow-edge-shimmer 2.4s linear infinite;
}

.flow-edge-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: flow-edge-travel 2.4s ease-in-out infinite;
}

.flow-edge--dense {
  flex: 0 0 36px;
}

.flow-edge--dense .flow-edge-line {
  animation-duration: 1.8s;
}

.flow-edge--dense .flow-edge-pulse {
  animation-duration: 1.8s;
}

.flow-edge--dense .flow-edge-pulse--2 {
  animation-delay: 0.45s;
}

.flow-edge--dense .flow-edge-pulse--3 {
  animation-delay: 0.9s;
}

.flow-edge--medium {
  flex: 0 0 28px;
}

.flow-edge--medium .flow-edge-line,
.flow-edge--medium .flow-edge-pulse {
  animation-duration: 2.6s;
}

.flow-edge--medium .flow-edge-pulse--2 {
  animation-delay: 0.8s;
}

.flow-edge--light {
  flex: 0 0 22px;
}

.flow-edge--light .flow-edge-line,
.flow-edge--light .flow-edge-pulse {
  animation-duration: 3.4s;
}

.flow-edge--sparse {
  flex: 0 0 18px;
}

.flow-edge--sparse .flow-edge-line,
.flow-edge--sparse .flow-edge-pulse {
  animation-duration: 4.6s;
  opacity: 0.75;
}

.flow-edge {
  position: relative;
  flex: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border-strong);
}

@keyframes flow-edge-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes flow-edge-travel {
  0%, 100% { transform: translateX(-8px); opacity: 0.3; }
  50% { transform: translateX(8px); opacity: 1; }
}

.infra-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.infra-map-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.infra-map-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.infra-map-card-name {
  font-size: 12px;
  font-weight: 700;
}

.infra-map-card-metrics {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.infra-map-card small {
  font-size: 10px;
  color: var(--muted);
}

.flow-map-section-timeline .event-timeline-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow-x: auto;
  overflow-y: hidden;
}

.event-timeline-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

.event-timeline-table thead {
  background: rgba(19, 103, 76, 0.12);
}

.event-timeline-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid rgba(19, 103, 76, 0.25);
}

.event-timeline-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.timeline-table-row {
  cursor: pointer;
  transition: background 0.15s;
}

.timeline-table-row:hover {
  background: var(--accent-soft);
}

.timeline-table-row.warning {
  background: rgba(251, 191, 36, 0.05);
}

.timeline-table-row.danger,
.timeline-table-row.critical {
  background: rgba(248, 113, 113, 0.05);
}

.timeline-table-row.warning td:first-child,
.timeline-table-row.danger td:first-child,
.timeline-table-row.critical td:first-child {
  box-shadow: inset 3px 0 0 var(--warning);
}

.timeline-table-row.danger td:first-child,
.timeline-table-row.critical td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.timeline-col-status {
  width: 88px;
  white-space: nowrap;
}

.timeline-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-status-badge.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.timeline-status-badge.healthy {
  color: var(--positive);
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.timeline-status-badge.warning {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.timeline-status-badge.danger {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.timeline-col-time {
  white-space: normal;
  color: var(--fg-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 168px;
  max-width: 210px;
}

.timeline-col-time .event-time-clock {
  font-weight: 700;
}

.timeline-col-time .event-time-meta,
.timeline-col-time .event-time-utc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  font-weight: 500;
}

.timeline-col-time .event-time-utc {
  font-family: var(--font-mono, ui-monospace, monospace);
  opacity: 0.85;
}

.timeline-col-layer {
  width: 64px;
}

.timeline-col-symbol {
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 88px;
}

.timeline-col-source {
  white-space: nowrap;
  color: var(--muted);
  text-transform: capitalize;
  min-width: 96px;
}

.timeline-layer-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid rgba(19, 103, 76, 0.6);
  letter-spacing: 0.04em;
}

.timeline-col-action {
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.timeline-col-detail {
  color: var(--fg);
}

.event-timeline-table th:last-child,
.timeline-col-trace {
  min-width: 120px;
  text-align: right;
}

.timeline-trace-id {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--info);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  white-space: nowrap;
}

.backbone-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.backbone-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.backbone-table thead {
  background: rgba(19, 103, 76, 0.1);
}

.backbone-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid rgba(19, 103, 76, 0.2);
}

.backbone-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.backbone-table tbody tr:hover {
  background: rgba(19, 103, 76, 0.06);
}

.backbone-table-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-strong);
}

.flow-map-infra {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

.flow-map-infra-label {
  display: block;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-map-infra-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.service-node {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, .02);
}

/* Timeline */
.event-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 52px 36px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  font-size: 11px;
}

.timeline-row:hover {
  border-color: rgba(19, 103, 76, .4);
  background: var(--accent-soft);
}

.timeline-time {
  grid-row: span 2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline-layer {
  font-weight: 900;
  color: var(--accent);
  font-size: 10px;
}

.timeline-type {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.timeline-msg {
  grid-column: 2 / -1;
  color: var(--fg);
}

/* Lineage drawer */
.lineage-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  z-index: 200;
  border-left: 1px solid var(--border);
  background: #15171c;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(0, 0, 0, .38);
}

.lineage-drawer.open {
  transform: translateX(0);
}

.lineage-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .015);
}

.lineage-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 28px;
}

.lineage-section {
  margin-bottom: 18px;
}

.lineage-section h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lineage-step {
  padding: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}

.lineage-step code {
  font-size: 10px;
  color: var(--info);
}

.lineage-layer {
  font-weight: 900;
  color: var(--accent);
}

.lineage-event {
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}

.lineage-event p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.lineage-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.lineage-flow-track {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  padding: 8px 0;
}

.lineage-flow-step {
  flex: 1 1 120px;
  min-width: 100px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lineage-flow-step.selected,
.lineage-flow-step:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}

.lineage-flow-layer {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--layer-color, var(--accent)) 20%, transparent);
  color: var(--layer-color, var(--accent));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.lineage-flow-type {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lineage-flow-label {
  display: block;
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.3;
}

.lineage-flow-id {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.7;
}

.lineage-flow-arrow {
  align-self: center;
  color: var(--text-muted);
  font-size: 18px;
  padding: 0 2px;
}

.lineage-object-detail h4 {
  margin: 0 0 12px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 750;
  text-transform: capitalize;
}

.lineage-graph-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 4px;
}

.lineage-graph {
  display: block;
  min-width: 320px;
}

.lineage-graph-edge {
  fill: none;
  stroke: var(--border-strong, var(--border));
  stroke-width: 1.5;
  opacity: 0.85;
}

.lineage-graph-arrowhead {
  fill: var(--border-strong, var(--border));
}

.lineage-graph-node {
  cursor: pointer;
  outline: none;
}

.lineage-graph-node-bg {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1;
  transition: stroke 0.15s, filter 0.15s;
}

.lineage-graph-node:hover .lineage-graph-node-bg,
.lineage-graph-node:focus-visible .lineage-graph-node-bg {
  stroke: var(--layer-color, var(--accent));
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--layer-color, var(--accent)) 35%, transparent));
}

.lineage-graph-node.selected .lineage-graph-node-bg {
  stroke: var(--layer-color, var(--accent));
  stroke-width: 2;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--layer-color, var(--accent)) 45%, transparent));
}

.lineage-graph-node-layer {
  fill: var(--layer-color, var(--accent));
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-anchor: middle;
  pointer-events: none;
}

.lineage-graph-node-type {
  fill: var(--text-muted);
  font-size: 8px;
  text-transform: uppercase;
  text-anchor: middle;
  pointer-events: none;
}

.lineage-graph-node-label {
  fill: var(--fg);
  font-size: 9px;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
}

.lineage-graph-node-label {
  fill: var(--fg);
  font-size: 9px;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
}

.lineage-summary-header {
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
}

.lineage-summary-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.lineage-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.lineage-summary-headline {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
}

.lineage-summary-meta {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.lineage-source-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lineage-view-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101216;
}

.lineage-view-tab {
  flex: 1;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lineage-view-tab.active {
  color: var(--fg);
  background: rgba(255, 255, 255, .075);
  box-shadow: none;
}

.lineage-state-banner {
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.45;
}

.lineage-state-banner.warning {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.lineage-state-banner.info {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.lineage-state-banner.danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

.lineage-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lineage-timeline-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
  color: var(--fg);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.lineage-timeline-item.selected,
.lineage-timeline-item:hover {
  border-color: #4b5563;
  background: #151820;
}

.lineage-timeline-item.selected {
  box-shadow: 0 0 0 1px rgba(148, 163, 184, .12);
}

.lineage-timeline-item.current {
  border-color: #3f4754;
}

.lineage-timeline-item.held {
  border-color: rgba(251, 191, 36, .35);
}

.lineage-timeline-item.blocked {
  border-color: rgba(248, 113, 113, .35);
}

.lineage-timeline-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--layer-color, var(--accent)) 14%, #111317);
  border: 1px solid color-mix(in srgb, var(--layer-color, var(--accent)) 48%, transparent);
}

.lineage-timeline-layer {
  font-size: 11px;
  font-weight: 900;
  color: var(--layer-color, var(--accent));
}

.lineage-timeline-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
  min-width: 0;
}

.lineage-timeline-head strong {
  min-width: min(100%, 160px);
  color: var(--fg);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
  letter-spacing: 0;
}

.lineage-timeline-head .badge,
.lineage-timeline-head .status-pill {
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 850;
}

.lineage-timeline-body {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #d7dce5;
}

.lineage-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.detail-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.detail-kv {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
}

.lineage-object-detail {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
}

.trace-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trace-list-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
}

.trace-list-item:hover {
  border-color: var(--accent);
}

.trace-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rail-section-title {
  margin-top: 16px;
}

.mode-disclosure-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(19, 103, 76, 0.35);
  border-radius: var(--radius-card);
  background: rgba(19, 103, 76, 0.08);
  font-size: 13px;
}

.mode-disclosure-label {
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.mode-disclosure-hint {
  color: var(--text-muted);
}

.profile-menu {
  position: relative;
}

.profile-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  min-width: 240px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12161e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.profile-dropdown-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.profile-dropdown-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-dropdown-meta strong {
  font-size: 14px;
  color: var(--fg-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-role {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-item {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.profile-dropdown-ico {
  color: var(--muted);
  font-size: 12px;
}

.profile-dropdown-action {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.profile-dropdown-logout {
  color: var(--danger);
}

.profile-dropdown-logout:hover {
  background: rgba(248, 113, 113, 0.08);
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.profile-modal[hidden] {
  display: none;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.profile-modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-panel);
}

.profile-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.profile-modal-body {
  padding: 16px;
}

.profile-card-readonly {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 14px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.profile-avatar-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-readonly-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-readonly-field.span-2 {
  grid-column: span 2;
}

.profile-readonly-field strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  word-break: break-word;
}

.profile-bio-text {
  font-weight: 500;
  line-height: 1.45;
}

.profile-modal-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--muted);
  font-size: 14px;
}

.profile-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(19, 103, 76, 0.15);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, .5);
}

.drawer-backdrop[hidden] {
  display: none;
}

/* Layer views */
.investor-blurb {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.investor-blurb p {
  margin: 0;
  font-size: 13px;
  color: var(--fg);
  line-height: 1.5;
}

.investor-blurb-inline {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.callout-panel,
.info-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.info-panel strong,
.callout-panel strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

.info-panel p,
.callout-panel p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.info-panel.warning {
  border-color: rgba(251, 191, 36, .35);
  background: rgba(251, 191, 36, .06);
}

.info-panel.compact,
.callout-panel.compact {
  padding: 10px 12px;
  margin: 12px 0;
}

.client-capital-banner {
  margin-bottom: 16px;
}

/* Heatmap */
.heatmap-grid {
  display: grid;
  gap: 4px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 48px repeat(3, 1fr);
  gap: 4px;
  align-items: center;
}

.heatmap-header .heatmap-bucket {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.heatmap-label {
  font-size: 11px;
  font-weight: 700;
}

.heatmap-cell {
  height: 28px;
  border-radius: 4px;
  background: rgba(19, 103, 76, calc(var(--intensity, 0) * 0.85));
  border: 1px solid var(--border);
}

.classifier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.classifier-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.classifier-card strong {
  font-size: 20px;
}

/* L1 detection view */
.l1-dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.l1-dashboard-grid > .panel {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
  overflow: hidden;
}

.l1-panel-vcse {
  min-height: 0;
}

.l1-panel-vcse .panel-head {
  margin-bottom: 10px;
}

.vcse-snapshot-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vcse-meta-strip {
  margin-bottom: 0;
}

.vcse-output-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.vcse-output-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
}

.vcse-output-card strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
  line-height: 1.1;
  color: var(--fg-strong);
}

.vcse-output-card small {
  font-size: 11px;
  color: var(--muted);
}

.vcse-output-card.positive {
  border-color: rgba(34, 197, 94, .35);
}

.vcse-output-card.warning {
  border-color: rgba(234, 179, 8, .35);
}

.vcse-output-card.danger {
  border-color: rgba(239, 68, 68, .35);
}

.vcse-mid-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
}

.vcse-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vcse-section {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .015);
}

.vcse-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.vcse-section-head strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.vcse-direction-mix,
.vcse-signal-state {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .015);
}

.vcse-direction-bar {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
}

.vcse-direction-seg {
  display: block;
  height: 100%;
}

.vcse-direction-seg.positive {
  background: var(--positive);
}

.vcse-direction-seg.warning {
  background: var(--warning);
}

.vcse-direction-seg.danger {
  background: var(--danger);
}

.vcse-direction-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.vcse-direction-legend strong {
  color: var(--fg-strong);
}

.vcse-feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.vcse-feature-chip {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
}

.vcse-feature-chip em {
  font-style: normal;
  font-weight: 800;
  color: var(--fg-strong);
}

.vcse-components-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vcse-component-card {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.vcse-component-card.inactive {
  opacity: .65;
}

.vcse-component-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.vcse-component-bar {
  height: 6px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}

.vcse-component-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(19, 103, 76, .8), rgba(56, 189, 248, .8));
}

.vcse-shap-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vcse-shap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.vcse-shap-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  overflow: hidden;
}

.vcse-shap-bar span {
  display: block;
  height: 100%;
}

.vcse-shap-bar.positive span {
  background: var(--positive);
}

.vcse-shap-bar.danger span {
  background: var(--danger);
}

.vcse-sparkline-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.vcse-sparkline {
  width: 100%;
  height: 56px;
  margin: 6px 0;
}

.vcse-sparkline polyline {
  fill: none;
  stroke: rgba(56, 189, 248, .9);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.vcse-sparkline-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
}

.vcse-feedback-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
}

.vcse-feedback-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.vcse-signal-lines {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.vcse-deploy-tag,
.vcse-eval-meta {
  font-size: 10px;
  color: var(--muted);
}

.vcse-eval-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.l1-panel-metric {
  min-height: 100%;
}

.l1-panel-metric .signal-output-grid-expanded,
.l1-panel-metric .l1-pulse-grid,
.l1-panel-body-health {
  flex: 1;
  min-height: 0;
}

.l1-panel-body-health {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.table-wrap-l1-health {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap-l1-health .l1-health-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.table-wrap-l1-health th,
.table-wrap-l1-health td {
  padding: 7px 10px;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 11px;
}

.l1-panel-health .table-footer {
  flex-shrink: 0;
  margin-top: 8px;
}

.l1-panel-health .badge {
  font-size: 9px;
  padding: 3px 6px;
}

.l1-panel-candidates .table-wrap-l1-candidates {
  max-height: none;
  min-height: 300px;
}

.table-wrap-l1-candidates table {
  font-size: 12px;
}

.table-wrap-l1-candidates th,
.table-wrap-l1-candidates td {
  padding: 8px 10px;
  vertical-align: middle;
}

.table-wrap-l1-candidates tr.row-newest td {
  background: rgba(56, 189, 248, .04);
}

.table-wrap-l1-candidates tr.row-newest td:first-child {
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, .55);
}

.event-time-cell {
  min-width: 168px;
  max-width: 220px;
  white-space: normal;
}

.event-time {
  display: block;
  line-height: 1.35;
}

.event-time-clock {
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.event-time-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  font-weight: 500;
}

.event-time-utc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  font-family: var(--font-mono, ui-monospace, monospace);
  opacity: 0.85;
}

.candidate-id {
  font-size: 10px;
  word-break: break-all;
}

.symbol-cell {
  min-width: 120px;
  white-space: nowrap;
}

.symbol-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.symbol-label {
  font-size: 13px;
  font-weight: 700;
}

.badge-newest {
  flex-shrink: 0;
  border-color: rgba(56, 189, 248, .65);
  background: rgba(56, 189, 248, .22);
  color: #bae6fd;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  padding: 4px 7px;
  line-height: 1;
}

.signal-output-grid-expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signal-engine-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.signal-engine-meta-highlight {
  padding: 4px 7px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 999px;
  background: rgba(56, 189, 248, .07);
  color: #bae6fd;
  font-weight: 800;
}

.l1-pulse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pulse-stat-block {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .12);
}

.pulse-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
}

.pulse-stat-row strong {
  font-variant-numeric: tabular-nums;
}

.pulse-freshness .badge {
  font-size: 9px;
}

.layer-operational-truth {
  position: relative;
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid rgba(56, 189, 248, .34);
}

.layer-operational-truth::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: min(360px, 46%);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 197, 94, .86), rgba(56, 189, 248, .52), rgba(56, 189, 248, 0));
  box-shadow: 0 0 18px rgba(34, 197, 94, .16);
}

.layer-operational-truth .panel {
  margin-bottom: 0;
}

.scanner-truth-panel,
.operational-truth-panel {
  display: grid;
  gap: 12px;
}

.truth-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgba(56, 189, 248, .10), rgba(34, 197, 94, .05));
  color: #dbeafe;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.truth-flow i {
  flex: 1 1 42px;
  min-width: 26px;
  height: 1px;
  background: linear-gradient(90deg, rgba(56, 189, 248, .15), rgba(34, 197, 94, .65));
  position: relative;
}

.truth-flow i::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(34, 197, 94, .8);
  border-right: 1px solid rgba(34, 197, 94, .8);
  transform: rotate(45deg);
}

.truth-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.truth-tile {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .14);
}

.truth-tile.healthy {
  border-color: rgba(34, 197, 94, .26);
  background: rgba(34, 197, 94, .06);
}

.truth-tile.warning {
  border-color: rgba(245, 158, 11, .30);
  background: rgba(245, 158, 11, .06);
}

.truth-tile.danger {
  border-color: rgba(248, 113, 113, .32);
  background: rgba(248, 113, 113, .07);
}

.truth-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.truth-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .08);
  flex: 0 0 auto;
}

.truth-dot.healthy { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .10); }
.truth-dot.warning { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .12); }
.truth-dot.danger { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .12); }

.truth-tile strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.truth-tile small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.truth-interpretation {
  padding: 11px 12px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: var(--radius-card);
  background: rgba(56, 189, 248, .06);
}

.truth-interpretation.healthy {
  border-color: rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .07);
}

.truth-interpretation.warning {
  border-color: rgba(245, 158, 11, .32);
  background: rgba(245, 158, 11, .07);
}

.truth-interpretation.danger {
  border-color: rgba(248, 113, 113, .34);
  background: rgba(248, 113, 113, .08);
}

.truth-interpretation-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.truth-interpretation strong {
  font-size: 13px;
  line-height: 1.4;
}

.truth-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.truth-detail-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .12);
}

.truth-detail-card h4 {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.truth-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.truth-check {
  display: flex;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .11);
}

.truth-check.healthy { border-color: rgba(34, 197, 94, .20); }
.truth-check.warning { border-color: rgba(245, 158, 11, .24); }
.truth-check.danger { border-color: rgba(248, 113, 113, .28); }

.truth-check-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 auto;
}

.truth-check.healthy .truth-check-icon { background: rgba(34, 197, 94, .13); color: #86efac; }
.truth-check.warning .truth-check-icon { background: rgba(245, 158, 11, .14); color: #fcd34d; }
.truth-check.danger .truth-check-icon { background: rgba(248, 113, 113, .15); color: #fca5a5; }

.truth-check strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.truth-check small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.classifier-board {
  display: grid;
  gap: 12px;
}

.classifier-summary {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.l1-classifier-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.l1-classifier-card {
  text-align: left;
  padding: 12px;
}

.classifier-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}

.classifier-type {
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.classifier-count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.classifier-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
  margin-bottom: 8px;
}

.classifier-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(19, 103, 76, .85);
}

.l1-classifier-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.l1-classifier-card.classifier-card-empty {
  opacity: 0.72;
}

.l1-classifier-card.classifier-card-empty .classifier-bar span {
  background: rgba(255, 255, 255, .12);
}

.classifier-group + .classifier-group {
  margin-top: 14px;
}

.classifier-group-head {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.activity-panel {
  display: grid;
  gap: 12px;
}

.activity-summary-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.activity-subsection {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .015);
}

.activity-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.activity-funnel-bar,
.activity-source-bar {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  margin-top: 6px;
}

.activity-funnel-seg,
.activity-source-seg {
  display: block;
  height: 100%;
  min-width: 4px;
}

.activity-funnel-seg.positive,
.activity-source-seg.scanner {
  background: var(--positive);
}

.activity-funnel-seg.warning {
  background: var(--warning);
}

.activity-funnel-seg.info,
.activity-source-seg.other {
  background: var(--info);
}

.activity-funnel-seg.danger {
  background: var(--danger);
}

.activity-source-seg.vcse {
  background: #a855f7;
}

.activity-source-seg.vol {
  background: #38bdf8;
}

.activity-funnel-legend,
.activity-source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}

.activity-funnel-legend strong,
.activity-source-legend strong {
  color: var(--fg-strong);
}

.activity-bucket-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 72px;
  margin-top: 6px;
}

.activity-bucket-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.activity-bucket-bar {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: flex-end;
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
}

.activity-bucket-bar span {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, rgba(56, 189, 248, .35), rgba(19, 103, 76, .85));
  border-radius: 4px 4px 0 0;
}

.activity-bucket-col small {
  font-size: 9px;
  color: var(--muted);
}

.activity-type-list {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.activity-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(60px, 1fr) 24px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.activity-type-row strong {
  text-align: right;
  color: var(--fg-strong);
}

.activity-symbol-list-compact .activity-symbol-row {
  padding: 6px 0;
}

.activity-symbol-list-compact .activity-symbol-row:first-child {
  border-top: none;
}

.activity-recent-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.activity-recent-row {
  display: grid;
  grid-template-columns: 72px 44px auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
  font-size: 11px;
}

.activity-recent-time {
  grid-row: span 2;
  color: var(--muted);
  font-size: 10px;
}

.activity-recent-row strong {
  color: var(--fg-strong);
}

.activity-recent-row small {
  grid-column: 2 / -1;
  color: var(--muted);
}

.activity-pulse-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(19, 103, 76, .06);
  font-size: 10px;
  color: var(--muted);
}

.activity-pulse-strip strong {
  color: var(--fg-strong);
}

.l1-panel-activity .panel-body,
.l1-panel-activity > :not(.panel-head) {
  flex: 1;
}

.activity-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.activity-summary-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
}

.activity-summary-grid strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.1;
}

.activity-summary-grid small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.activity-heatmap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.activity-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.activity-legend i {
  width: 44px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(19, 103, 76, .16), rgba(34, 197, 94, .72));
}

.heatmap-compact {
  gap: 5px;
}

.heatmap-row-compact {
  grid-template-columns: 44px repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.heatmap-cell-compact {
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .78);
  font-size: 10px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.activity-symbol-list {
  display: grid;
  gap: 8px;
}

.activity-symbol-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 1.4fr) 38px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.activity-symbol-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.activity-symbol-row strong {
  display: block;
  color: var(--fg);
  font-size: 12px;
}

.activity-symbol-row span,
.activity-symbol-row small {
  color: var(--muted);
  font-size: 10px;
}

.activity-mini-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}

.activity-mini-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #13674c, #38bdf8);
}

.l1-panel-activity .panel-head p,
.l1-panel-pulse .panel-head p {
  max-width: 28ch;
}

/* Confidence bars */
.confidence-stack {
  display: grid;
  gap: 10px;
}

.confidence-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.confidence-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.confidence-label {
  text-transform: capitalize;
  color: var(--muted);
}

.confidence-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}

.confidence-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.confidence-val {
  font-weight: 900;
  text-align: right;
}

/* Sizing / exposure */
.l3-main-grid {
  display: grid;
  gap: 12px;
}

.l3-top-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 12px;
  align-items: stretch;
}

.l3-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr);
  gap: 12px;
  align-items: stretch;
}

.l3-panel-sizing,
.l3-panel-exposure,
.l3-options-panel,
.l3-handoff-panel-wrap {
  display: flex;
  flex-direction: column;
}

.l3-options-panel .options-positioning-panel,
.l3-handoff-panel-wrap .l3-handoff-panel {
  flex: 1;
}

.sizing-preview {
  display: grid;
  gap: 8px;
}

.sizing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}

.sizing-row span:first-child {
  color: var(--muted);
}

.exposure-map {
  padding: 8px 0;
}

.exposure-map-expanded {
  display: grid;
  gap: 12px;
  padding: 0;
}

.exposure-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.exposure-summary-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
}

.exposure-summary-grid strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.exposure-summary-grid small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.exposure-bars {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .14);
}

.exposure-bar {
  height: 24px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, .2);
  border: 1px solid rgba(239, 68, 68, .3);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
}

.exposure-bar.gross {
  width: 100%;
}

.exposure-bar.net {
  background: rgba(19, 103, 76, .25);
  border-color: rgba(19, 103, 76, .4);
  width: 70%;
}

.exposure-bar.net.short {
  background: rgba(239, 68, 68, .18);
  border-color: rgba(239, 68, 68, .35);
}

.exposure-bar.net.long {
  background: rgba(34, 197, 94, .18);
  border-color: rgba(34, 197, 94, .34);
}

.exposure-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .025);
}

.l3-handoff-panel {
  display: grid;
  gap: 12px;
}

.l3-handoff-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.l3-handoff-summary > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
}

.l3-handoff-summary strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.l3-handoff-summary small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.l3-handoff-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: 282px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.l3-handoff-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, .12);
}

.l3-handoff-row.healthy {
  border-color: rgba(34, 197, 94, .22);
  background: rgba(34, 197, 94, .05);
}

.l3-handoff-row.warning {
  border-color: rgba(245, 158, 11, .24);
  background: rgba(245, 158, 11, .055);
}

.l3-handoff-main {
  min-width: 0;
}

.l3-handoff-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.l3-handoff-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.l3-handoff-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.l3-handoff-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.options-positioning-panel {
  display: grid;
  gap: 12px;
}

.options-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.options-summary-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111317;
}

.options-summary-grid strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.options-summary-grid small {
  color: var(--muted);
  font-size: 10px;
}

.options-ingestion-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: var(--radius-card);
  background: rgba(56, 189, 248, .06);
}

.options-ingestion-strip strong {
  color: var(--fg);
  font-size: 13px;
}

.options-freshness {
  display: grid;
  gap: 4px;
}

.option-greek {
  display: inline-flex;
  margin: 0 5px 4px 0;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .03);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.drawdown-chart span {
  background: rgba(248, 113, 113, .55) !important;
  border-color: rgba(239, 68, 68, .35) !important;
}

/* Infrastructure */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.infra-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.infra-card-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.infra-card-type {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
}

.infra-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.infra-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
}

.infra-metric-grid {
  margin: 8px 0 0;
}

.infra-metric-kv {
  padding: 5px 7px;
}

.infra-metric-kv .metric-label {
  display: block;
  font-size: 9px;
  margin-bottom: 2px;
}

.infra-metric-kv strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
}

.infra-metric-kv strong.warning {
  color: var(--warning);
}

.infra-pre {
  margin-top: 8px;
  padding: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .3);
  font-size: 10px;
  color: var(--info);
  overflow-x: auto;
}

/* Idea intake */
.idea-form {
  display: grid;
  gap: 10px;
}

.idea-form-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

.control textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--fg);
  font-size: 12px;
  resize: vertical;
}

.control input[type="text"],
.control input:not([type]) {
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--fg);
  font-size: 12px;
}

.priority-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.priority-col h3 {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--muted);
}

.priority-card {
  padding: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}

.priority-card strong {
  display: block;
  font-size: 12px;
}

.priority-card small {
  color: var(--muted);
}

.reporting-center-host {
  margin-bottom: 12px;
}

.l5-reporting-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.l5-reporting-stack .performance-story-card,
.l5-reporting-stack .reporting-center-host {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.l5-reporting-kpis {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.l5-reporting-kpis .kpi-grid {
  margin-bottom: 0;
}

.l5-reporting-stack .metric-card {
  background: var(--surface-muted);
}

.l5-reporting-stack .performance-story-footer {
  margin-top: 14px;
}

.l5-reporting-stack .reporting-grid {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.l5-reporting-stack .reporting-center-host > .kpi-grid {
  margin-bottom: 0;
}

.reporting-grid {
  grid-template-columns: 1fr;
}

.reporting-scope-note {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.report-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-detail h4 {
  margin: 14px 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.performance-story-card {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.l5-reporting-stack .performance-story-card {
  margin-bottom: 0;
}

.performance-story-card.empty {
  opacity: 0.92;
}

.performance-story-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.performance-story-headline {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
}

.performance-story-head h2 {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.performance-story-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.performance-story-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.performance-story-breakdown,
.performance-breakdown {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.performance-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  height: 100%;
}

.performance-story-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.performance-story-item strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.performance-story-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.performance-breakdown {
  margin-top: 0;
}

.performance-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 34%) minmax(0, 1fr) minmax(72px, auto);
  gap: 12px;
  align-items: center;
}

.performance-breakdown-label {
  font-size: 12px;
  color: var(--muted);
}

.performance-breakdown-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.performance-breakdown-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.performance-breakdown-row.gain .performance-breakdown-bar span {
  background: var(--positive, #3ecf8e);
}

.performance-breakdown-row.cost .performance-breakdown-bar span {
  background: var(--warning, #f5a623);
}

.performance-breakdown-row.net .performance-breakdown-bar span {
  background: var(--accent, #6ea8fe);
}

.performance-breakdown-value {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.performance-story-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.performance-story-readiness {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.reporting-center-host {
  margin-top: 4px;
}

.report-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.report-preview-head h3 {
  margin: 4px 0 0;
}

@media (max-width: 820px) {
  .performance-story-body {
    grid-template-columns: 1fr;
  }

  .performance-story-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .performance-breakdown-row {
    grid-template-columns: 1fr;
  }

  .performance-breakdown-value {
    text-align: left;
  }
}

.client-capital-banner {
  margin-bottom: 12px;
}

.spec-preview {
  max-height: 420px;
  overflow-y: auto;
}

.spec-section-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spec-section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-elevated);
  padding: 10px 12px;
}

.spec-section-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.spec-section-card h3 {
  margin: 0;
  font-size: 13px;
}

.spec-section-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(19, 103, 76, 0.2);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.spec-section-body {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.spec-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--info);
  font-size: 10px;
  text-transform: uppercase;
}

.layer-tag-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
}

.layer-tag-fieldset legend {
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px;
}

.layer-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.layer-tag-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.idea-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.idea-actions {
  white-space: nowrap;
}

.idea-detail-drawer {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 180;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.idea-detail-inner {
  position: relative;
  padding: 14px 16px;
}

.idea-detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.spec-pre {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--fg);
}

.spec-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.empty-state {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.error-state {
  padding: 24px;
  text-align: center;
}

.trace-btn {
  font-size: 9px !important;
}

code {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(56, 189, 248, .1);
  color: var(--info);
}

/* Mode disclosure */
body[data-mode="investor"] .mode-eng-only,
body[data-mode="investor"] .mode-admin-only,
body[data-mode="operator"] .mode-admin-only {
  display: none !important;
}

body[data-mode="investor"] .mode-investor-only {
  display: block;
}

body:not([data-mode="investor"]) .mode-investor-only {
  display: none;
}

body[data-mode="engineering"] .mode-eng-only,
body[data-mode="admin"] .mode-eng-only,
body[data-mode="admin"] .mode-admin-only,
body[data-mode="operator"] .mode-eng-only,
body[data-mode="client"] .mode-client-only {
  display: revert;
}

body[data-mode="client"] .mode-eng-only,
body[data-mode="client"] .mode-admin-only {
  display: none !important;
}

body[data-mode="investor"] .mode-ops-only,
body[data-mode="client"] .mode-ops-only {
  display: none !important;
}

body:not([data-mode="client"]):not([data-mode="admin"]) .mode-client-only {
  display: none !important;
}

/* Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.filter-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.filter-control select,
.filter-control input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 6px 10px;
  color: var(--fg);
  min-width: 120px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(19, 103, 76, .08);
}

/* Freshness rail */
.freshness-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freshness-grid .freshness-card {
  margin: 0;
}

.freshness-card {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  font-size: 12px;
}

.freshness-card.warning {
  border-color: rgba(251, 191, 36, .4);
}

.freshness-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.freshness-card code {
  font-size: 11px;
  color: var(--muted);
}

.rail-section-title {
  margin-top: 20px;
  font-size: 13px;
}

.rail-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px;
}

/* Flow map enhancements */
.flow-map-backbone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.12);
}

.flow-map-backbone .flow-map-section-label {
  flex: 0 0 auto;
  margin: 0;
}

.backbone-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}

.backbone-pill {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: ui-monospace, monospace;
  color: var(--fg);
}

.flow-portfolio-snapshot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
  margin-bottom: 0;
}

.flow-portfolio-snapshot .flow-map-section-label {
  flex: 0 0 auto;
  margin: 0;
}

.flow-heat-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 200px;
  min-width: 0;
}

.flow-heat-bar {
  flex: 1 1 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.flow-heat-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.flow-heat-inline strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.flow-heat-limit {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Signal outputs */
.signal-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.signal-output-card {
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.signal-output-card strong {
  display: block;
  font-size: 1.25rem;
  margin: 4px 0;
}

/* Detail drawer */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

/* OMS lifecycle */
.oms-lifecycle-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.l4-oms-panel,
.l4-oms-panel .panel-body {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.oms-compact-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}

.oms-compact-summary > div {
  min-width: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .025);
}

.oms-compact-summary span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .07em;
  line-height: 1.1;
  text-transform: uppercase;
}

.oms-compact-summary strong {
  display: block;
  color: var(--fg);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.oms-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .018);
}

.oms-step {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(10, 12, 15, .52);
  color: var(--text-muted);
  overflow: hidden;
}

.oms-step:not(:last-child)::after {
  display: none;
}

.oms-step-node {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 999px;
  background: rgba(15, 18, 22, .92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.oms-step strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oms-step small {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oms-step.active {
  border-color: rgba(16, 185, 129, .34);
  background: rgba(16, 185, 129, .07);
  color: var(--fg);
}

.oms-step.active .oms-step-node {
  border-color: rgba(16, 185, 129, .58);
  background: rgba(16, 185, 129, .16);
  color: #86efac;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .06);
}

.oms-step.active:not(:last-child)::after {
  background: rgba(16, 185, 129, .42);
}

.oms-step.terminal.active .oms-step-node {
  border-color: rgba(56, 189, 248, .48);
  background: rgba(56, 189, 248, .13);
  color: #7dd3fc;
}

.oms-step.terminal.active {
  border-color: rgba(56, 189, 248, .32);
  background: rgba(56, 189, 248, .07);
}

.oms-lifecycle-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.heat-gauge-wrap {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.heat-gauge {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.heat-gauge span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.heat-gauge span[data-high="1"],
.heat-gauge-wrap[data-heat-high="1"] .heat-gauge span {
  background: var(--warning);
}

.heat-gauge span[data-proximity="watch"],
.limit-proximity[data-proximity="watch"] .limit-proximity-bar span {
  background: var(--info);
}

.heat-gauge span[data-proximity="near_limit"],
.limit-proximity[data-proximity="near_limit"] .limit-proximity-bar span {
  background: var(--warning);
}

.heat-gauge span[data-proximity="breached"],
.limit-proximity[data-proximity="breached"] .limit-proximity-bar span {
  background: var(--danger);
}

.risk-action-queue-compact {
  gap: 0;
}

.risk-queue-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.risk-queue-row:last-child {
  border-bottom: none;
}

.risk-queue-title {
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-queue-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.risk-queue-actions .button {
  background: rgba(255, 255, 255, .04);
}

.risk-queue-actions .button.ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--fg);
}

.risk-queue-actions .button.ghost:hover,
.risk-queue-actions .button.secondary:hover {
  border-color: rgba(19, 103, 76, .45);
  background: rgba(19, 103, 76, .22);
}

.risk-action-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.risk-queue-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.risk-queue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.risk-queue-detail {
  margin: 0 0 6px;
  font-size: 13px;
}

.risk-queue-meta,
.risk-queue-action,
.queue-ack-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.risk-queue-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.limit-proximity {
  min-width: 120px;
}

.limit-proximity-bar {
  height: 6px;
  background: var(--surface-muted);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.limit-proximity-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.limit-proximity-label {
  font-size: 10px;
}

.panel-span-2 {
  grid-column: 1 / -1;
}

tr.row-focus,
.heat-gauge-wrap.row-focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.decision-tree,
.event-flow-pre {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface-muted);
  padding: 12px;
  border-radius: var(--radius-card);
  overflow-x: auto;
}

.decision-path {
  font-size: 12px;
  font-weight: 500;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* Legacy — roadmap now uses .roadmap-table */
.phase-card {
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.phase-card h4 {
  margin: 6px 0;
  font-size: 14px;
}

.l4-alert-list {
  gap: 10px;
}

.l4-alert-list .l4-alert-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  background: #111317;
}

.l4-alert-row.open.warning {
  border-color: rgba(245, 158, 11, .30);
  background: rgba(245, 158, 11, .055);
}

.l4-alert-row.open.danger {
  border-color: rgba(248, 113, 113, .32);
  background: rgba(248, 113, 113, .06);
}

.l4-alert-row.acknowledged {
  opacity: .74;
}

.l4-alert-marker {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .10);
}

.l4-alert-row.warning .l4-alert-marker {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .14);
}

.l4-alert-row.danger .l4-alert-marker {
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, .14);
}

.l4-alert-row.healthy .l4-alert-marker {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.l4-alert-main {
  min-width: 0;
}

.l4-alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.l4-alert-head strong,
.l4-alert-main > strong {
  min-width: 0;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.25;
}

.l4-alert-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.l4-alert-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.l4-alert-row .ack-alert {
  min-width: 58px;
}

.infra-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.infra-view-toggle {
  display: inline-flex;
  gap: 6px;
  margin-right: 8px;
}

.infra-view-toggle .button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.incident-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.incident-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-elevated);
  padding: 12px 14px;
}

.incident-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.incident-source {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.incident-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.incident-meta,
.incident-times {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.incident-cause,
.incident-action {
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0 0;
}

.incident-next-action {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.probe-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.probe-timeline li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.failed-job-summary {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
}

.backend-pill.warning .backend-dot {
  background: var(--warning);
}

/* Demo tour — floating coach panel, dashboard stays interactive */
.demo-tour-panel {
  position: fixed;
  right: 16px;
  bottom: 44px;
  z-index: 2000;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.demo-tour-panel[hidden] {
  display: none;
}

.demo-tour-card {
  pointer-events: auto;
  padding: 14px 16px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.demo-tour-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.demo-tour-head .eyebrow {
  margin: 0;
}

.demo-tour-close {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.demo-tour-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.3;
}

.demo-tour-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.demo-tour-progress {
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0;
  font-variant-numeric: tabular-nums;
}

.demo-tour-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .master-layout {
    grid-template-columns: 1fr;
  }

  .master-status-panels {
    grid-template-columns: 1fr;
  }

  .flow-map-layers {
    flex-wrap: wrap;
    gap: 8px;
  }

  .flow-map-layers .layer-node,
  .flow-map-layers .layer-node:first-child,
  .flow-map-layers .layer-node:last-of-type {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
  }

  .flow-edge {
    display: none;
  }

  .kpi-grid,
  .dashboard-grid,
  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: span 2;
  }

  .span-3 {
    grid-column: span 2;
  }

  .l1-classifier-grid,
  .signal-output-grid-expanded,
  .truth-tile-grid,
  .truth-detail-grid,
  .options-summary-grid,
  .exposure-summary-grid,
  .exposure-detail-grid,
  .l3-handoff-summary,
  .oms-compact-summary,
  .truth-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .oms-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .priority-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .classifier-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .demo-tour-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: calc(40px + env(safe-area-inset-bottom));
  }

  .login-page {
    align-items: stretch;
    justify-content: flex-start;
    padding: calc(24px + env(safe-area-inset-top)) 12px calc(28px + env(safe-area-inset-bottom));
  }

  .login-brand,
  .restricted {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    justify-content: flex-start;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .login-panel {
    max-width: none;
    border-radius: 8px;
  }

  .credentials,
  .notice {
    padding: 18px 16px;
  }

  .top {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .top-actions {
    width: 100%;
    overflow-x: auto;
  }

  .l0-main {
    padding: 12px;
  }

  .command-header {
    flex-direction: column;
  }

  .command-actions {
    width: 100%;
  }

  .button {
    flex: 1;
  }

  .kpi-grid,
  .dashboard-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .span-3 {
    grid-column: auto;
  }

  .l1-pulse-grid,
  .l1-classifier-grid,
  .signal-output-grid-expanded,
  .vcse-output-grid,
  .vcse-mid-grid,
  .vcse-lower-grid,
  .vcse-components-grid,
  .vcse-feedback-strip,
  .activity-dual-grid,
  .activity-summary-grid-compact,
  .truth-tile-grid,
  .truth-detail-grid,
  .options-summary-grid,
  .exposure-summary-grid,
  .exposure-detail-grid,
  .l3-handoff-summary,
  .oms-compact-summary,
  .truth-checklist {
    grid-template-columns: 1fr;
  }

  .oms-timeline {
    grid-template-columns: 1fr;
  }

  .oms-lifecycle-foot {
    display: grid;
  }

  .l4-alert-list .l4-alert-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .l4-alert-row .ack-alert {
    grid-column: 2;
    justify-self: flex-start;
  }

  .l3-top-grid,
  .l3-lower-grid {
    grid-template-columns: 1fr;
  }

  .l3-handoff-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .l3-handoff-row .trace-btn {
    grid-column: 2;
    justify-self: flex-start;
  }

  .options-ingestion-strip {
    grid-template-columns: 1fr;
  }

  .truth-flow {
    flex-direction: column;
    text-align: center;
  }

  .truth-flow i {
    flex: 0 0 18px;
    height: 18px;
    width: 1px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(56, 189, 248, .15), rgba(34, 197, 94, .65));
  }

  .truth-flow i::after {
    right: -3px;
    top: auto;
    bottom: -1px;
    transform: rotate(135deg);
  }
}

/* ── Platform Home ── */
.view-home {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-header {
  align-items: flex-start;
}

.home-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.home-health-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  text-align: center;
}

.home-health-ring.healthy {
  border-color: rgba(34, 197, 94, .45);
  background: rgba(34, 197, 94, .08);
}

.home-health-ring.warning {
  border-color: rgba(234, 179, 8, .45);
  background: rgba(234, 179, 8, .08);
}

.home-health-ring.danger {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .08);
}

.home-health-score {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: var(--fg-strong);
}

.home-health-label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-health-pending {
  margin-top: 4px;
  font-size: 10px;
  color: var(--warning);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
}

.home-primary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.home-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.home-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-platform-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: linear-gradient(145deg, var(--surface), rgba(255, 255, 255, .02));
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.home-platform-card:hover {
  border-color: rgba(19, 103, 76, .45);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.home-platform-icon {
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.home-platform-icon svg {
  width: 20px;
  height: 20px;
}

.home-platform-body {
  min-width: 0;
}

.home-platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-platform-head strong {
  font-size: 14px;
  color: var(--fg-strong);
}

.home-platform-body p {
  margin: 4px 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.home-platform-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.home-platform-tag {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-platform-tag.positive {
  border-color: rgba(34, 197, 94, .35);
  color: var(--positive);
}

.home-platform-action {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}

.home-platform-external {
  font-size: 14px;
  color: var(--muted);
}

.home-platform-card.accent-blue .home-platform-icon {
  background: rgba(56, 189, 248, .12);
  color: #38bdf8;
}

.home-platform-card.accent-purple .home-platform-icon {
  background: rgba(168, 85, 247, .12);
  color: #a855f7;
}

.home-platform-card.accent-amber .home-platform-icon {
  background: rgba(245, 158, 11, .12);
  color: #f59e0b;
}

.home-platform-card.accent-teal .home-platform-icon {
  background: rgba(20, 184, 166, .12);
  color: #14b8a6;
}

.home-platform-card.accent-slate .home-platform-icon {
  background: rgba(148, 163, 184, .12);
  color: #94a3b8;
}

.home-platform-card.accent-gold .home-platform-icon {
  background: rgba(234, 179, 8, .12);
  color: #eab308;
}

.home-platform-card.accent-red .home-platform-icon {
  background: rgba(239, 68, 68, .12);
  color: #ef4444;
}

.home-health-section {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.home-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.home-section-head h2 {
  margin: 0;
  font-size: 16px;
}

.home-health-grid {
  margin-bottom: 10px;
}

.home-health-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-health-inputs li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
}

.home-health-input-score {
  font-weight: 900;
}

.home-layer-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-layer-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  transition: border-color .15s ease;
}

.home-layer-card:hover {
  border-color: rgba(19, 103, 76, .4);
}

.home-layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.home-layer-blurb {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.home-layer-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

.home-layer-metrics em {
  font-style: normal;
  font-weight: 800;
  color: var(--fg-strong);
}

@media (max-width: 1100px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-platform-grid {
    grid-template-columns: 1fr;
  }
}
