/* Preferred September product design, applied to the real console's light-DOM
   routes. Existing authentication, capability gates, forms and API handlers stay
   in their original modules. Keep this sheet after the legacy shell styles. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-var.woff2') format('woff2');
}
:root {
  color-scheme: light;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: var(--sans);
  --cond: var(--sans);
  --canvas: #f3f4f5;
  --canvas-deep: #edf0f2;
  --bg: var(--canvas);
  --surface: #fff;
  --surface-2: #f8f9fa;
  --surface-pop: #fff;
  --border: #e0e4e7;
  --border-2: #cbd1d7;
  --text: #111418;
  --text2: #343a42;
  --muted: #596773;
  --foundry: #596773;
  --galvanized: #596773;
  --conduit: #32668f;
  --gold: #80580d;
  --amber: #80580d;
  --amber-ink: #6b4a0e;
  --paper: var(--surface);
  --panel: var(--surface-2);
  --patina-bg: var(--green-bg);
  --clearspan: #f3f4f5;
  --coldroll: #dde4e6;
  --navy-light: #edf4fa;
  --shadow-card: none;
  --shadow-pop: 0 20px 70px #11141826;
  --sidebar: 256px;
  --topbar: 76px;
  --ui-side: #12171d;
  --ui-side-ink: #a4adb8;
  --ui-side-active: #252f39;
}
html[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #101419;
  --canvas-deep: #0b0f14;
  --bg: var(--canvas);
  --surface: #171d24;
  --surface-2: #141a21;
  --surface-pop: #171d24;
  --border: #2a333e;
  --border-2: #3a4857;
  --text: #edf2f6;
  --text2: #c1cad4;
  --ironworks: #edf2f6;
  --forge: #c1cad4;
  --foundry: #9ca8b5;
  --muted: #9ca8b5;
  --galvanized: #a4b1bf;
  --clearspan: #202831;
  --coldroll: #2a333e;
  --deepwater: #99c8ee;
  --navy: #99c8ee;
  --navy-mid: #99c8ee;
  --navy-light: #1c3042;
  --green: #8cbbb6;
  --patina: #8cbbb6;
  --green-bg: #1b3233;
  --green-bd: #375451;
  --amber: #dcb574;
  --gold: #dcb574;
  --amber-ink: #dcb574;
  --amber-bg: #352d22;
  --amber-bd: #59492d;
  --red: #ef9c9e;
  --oil: #ef9c9e;
  --red-bg: #39272d;
  --red-bd: #604047;
  --alarm: #ffb4ab;
  --alarm-bg: #39272d;
  --blue: #99c8ee;
  --blue-bg: #1c3042;
  --blue-bd: #355571;
  --shadow-card: none;
  --shadow-pop: 0 24px 80px #0009;
  --ui-side: #0b0f14;
  --ui-side-ink: #a4adb8;
  --ui-side-active: #1e2b38;
}
html, body { font-size: 16px; line-height: 1.5; letter-spacing: 0; }
button, input, select, textarea { font-family: var(--sans); }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--blue); }
.topbar {
  background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border);
  clip-path: none; padding: 0 24px; gap: 16px;
}
.tb-logo { color: var(--text); gap: 14px; }
.tb-logo .tb-logo-mark { height: 25px; }
.tb-logo .tb-logo-sub {
  color: var(--muted); border-color: var(--border-2); font-size: 12px;
  letter-spacing: .06em; text-transform: none;
}
.tb-client { font-size: 14px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.tb-sep { background: var(--border); }
.topbar .tb-right { padding-right: 0; gap: 10px; min-width: 0; }
.tb-user { color: var(--muted); gap: 10px; min-width: 0; }
.tb-user-email { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.tb-rail, .tb-theme, .tb-cmdk, .tb-signout, .tb-portal {
  color: var(--text2); border-color: var(--border-2); border-radius: 4px;
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 10px; margin-right: 0; font-size: 13px; letter-spacing: 0;
  text-transform: none; background: transparent; flex-shrink: 0;
}
.tb-rail:hover, .tb-theme:hover, .tb-cmdk:hover, .tb-signout:hover, .tb-portal:hover {
  color: var(--text); border-color: var(--border-2); background: var(--surface-2);
}
.tb-theme { gap: 8px; border: 1px solid var(--border-2); cursor: pointer; }
.tb-theme svg { display: block; flex-shrink: 0; }
/* The tenant picker is created by the existing authenticated bootstrap. */
#tb-tenant-wrap { color: var(--muted) !important; font-size: 13px !important; }
#tb-tenant { background: var(--surface) !important; color: var(--text) !important;
  border-color: var(--border-2) !important; font-size: 14px !important; min-height: 38px; max-width: 220px; }
.sidebar {
  background: var(--ui-side); color: var(--ui-side-ink); border-right: 1px solid #ffffff0a;
  box-shadow: none; padding-top: 18px; scrollbar-width: thin; scrollbar-color: #394652 transparent;
}
.nav-section { color: #8796a6; font: 12px var(--mono); letter-spacing: .1em; padding: 24px 26px 9px; }
.nav-item { color: var(--ui-side-ink); min-height: 44px; margin: 2px 12px; padding: 11px 12px;
  border-radius: 4px; border: 1px solid transparent; font-size: 14px; font-weight: 500; gap: 11px; }
.nav-item:hover { color: #edf2f6; background: #ffffff08; }
.nav-item.active { color: #f4f7f9; background: var(--ui-side-active); border-color: #4a668344; font-weight: 500; }
.nav-item.active .icon { color: #9ac5e5; }
.nav-chip, .nav-badge { font-size: 12px; letter-spacing: 0; }
.nav-chip { color: #e5c48a; background: #b77e292c; border-color: transparent; }
.sidebar-bottom { border-color: #ffffff12; padding: 20px; }
.conn-status { color: #a4adb8; font-size: 12px; letter-spacing: .03em; text-transform: none; }
.content { min-width: 0; padding: 36px; }
.section { max-width: 1640px; margin-inline: auto; }
.page-header { align-items: flex-end; gap: 24px; border: 0; margin-bottom: 28px; padding-bottom: 0; }
.page-title { font-size: 36px; line-height: 1.15; font-weight: 500; letter-spacing: -.04em; }
.page-sub { font-size: 15px; line-height: 1.65; letter-spacing: 0; text-transform: none; margin-top: 10px; max-width: 850px; }
.page-actions, .panel-actions { flex-wrap: wrap; }
.page-actions { flex-shrink: 0; }
.panel, .kpi-card { border: 1px solid var(--border); border-radius: 5px; clip-path: none; box-shadow: none; }
.panel { margin-bottom: 22px; }
.panel-header { background: var(--surface); padding: 22px 24px; gap: 16px; flex-wrap: wrap; }
.panel-title { font-size: 16px; letter-spacing: -.015em; text-transform: none; }
.panel-meta { font-size: 13px; }
.kpi-row { gap: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); overflow: hidden; margin-bottom: 24px; }
.kpi-card { border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 24px; min-width: 0; }
.kpi-card:last-child { border-right: 0; }
.kpi-label { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.kpi-val { font-size: 34px; line-height: 1.2; font-weight: 450; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-val-sm { font-size: 25px; white-space: normal; }
.kpi-sub, .kpi-change { font-size: 13px; }
.ov-cols, .ov-row2 { gap: 22px; }
.ov-feed-item, .ov-attn-row { padding: 14px 22px; }
.ov-feed-item { flex-wrap: wrap; }
.ov-feed-type { font-size: 14px; overflow-wrap: anywhere; }
.ov-feed-meta, .ov-attn-age { font-size: 12px; }
.ov-attn-ref { font-size: 14px; }
.ov-mini { padding: 18px 24px; }
.ov-stat-line { font-size: 15px; }
.btn { font-size: 14px; min-height: 40px; padding: 9px 13px; border-radius: 4px; letter-spacing: 0; text-transform: none; }
.btn-sm { font-size: 13px; min-height: 34px; padding: 6px 10px; }
.btn-primary { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn-primary:hover { background: var(--text2); color: var(--surface); }
.filter-bar { padding: 16px 22px; gap: 10px; }
.filter-label { font-size: 13px; letter-spacing: 0; text-transform: none; }
select.filter-sel, input.filter-inp { font-size: 15px; min-height: 40px; padding: 8px 12px; }
th { font: 12px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .025em; padding: 14px 18px; background: var(--surface-2); }
td { font-size: 14px; padding: 16px 18px; }
.id-cell, .amount-cell { font-size: 14px; }
.entity-name { font-size: 14px; }
.entity-sub, .status, .status-pill { font-size: 12px; }
.status { border-radius: 3px; padding: 4px 8px; }
.table-wrap { max-width: 100%; }
.keys-grid { grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); padding: 22px 24px; }
.keys-k { font-size: 13px; letter-spacing: .02em; }
.keys-v { font-size: 16px; }
.keys-mono { font-size: 14px; }
.detail-panel, .review-panel, .dash-panel { max-width: 100vw; }
.detail-title, .review-title, .dash-title { font-size: 26px; }
.cmdk-panel { border-radius: 6px; }
.cmdk-input { font-size: 17px; }
.cmdk-item { padding: 13px 20px; font-size: 15px; }
.cmdk-hint, .cmdk-foot { font-size: 12px; }
input, select, textarea { max-width: 100%; }
pre { max-width: 100%; overflow: auto; }
.bg-warning-text { font-size: 15px; text-transform: none; letter-spacing: 0; }
/* Preserve the existing icon-only rail, including its keyboard/tooltips. */
html[data-sidebar='rail'] { --sidebar: 72px; }
html[data-sidebar='rail'] .sidebar .nav-item { font-size: 0; min-height: 44px; }
html[data-sidebar='rail'] .sidebar .nav-section { font-size: 0; }
html[data-sidebar='rail'] .conn-status { font-size: 0; }
@media (max-width: 1400px) {
  .tb-client, .tb-sep { display: none; }
  .tb-user-email { max-width: 180px; }
  .kpi-row.ov-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-card { border-bottom: 1px solid var(--border); }
  .page-header { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 1100px) {
  .content { padding: 28px; }
  .tb-logo .tb-logo-sub { display: none; }
  .topbar { gap: 10px; padding-inline: 16px; }
  .tb-user-email { display: none; }
  .kpi-row.ov-kpis, .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-cols, .ov-row2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; --topbar: 122px; }
  html[data-sidebar='rail'] { --sidebar: 0px; }
  .topbar { align-content: center; flex-wrap: wrap; height: var(--topbar); gap: 8px 12px; padding: 12px 16px; }
  .tb-logo { order: -2; }
  .tb-rail { order: -3; }
  .topbar .tb-right { width: 100%; margin-left: 0; gap: 8px; }
  .tb-right .tb-user { margin-left: auto; }
  #tb-tenant-wrap { gap: 5px !important; }
  #tb-tenant { max-width: 130px; }
  .tb-cmdk { display: none; }
  .tb-theme .theme-label { display: none; }
  .tb-portal { font-size: 12px; padding-inline: 8px; }
  .sidebar { width: min(280px, 85vw); z-index: 98; box-shadow: 15px 0 40px #0004; }
  /* On small screens the existing sidebar button toggles an overlay. */
  html[data-sidebar='rail'] .sidebar { display: none; }
  .content { margin-left: 0; padding: 24px 16px; width: 100%; }
  .page-title { font-size: 30px; }
  .page-header { gap: 16px; }
  .page-actions { flex-shrink: 1; }
  .panel-header { padding: 18px; }
  .kpi-card { padding: 20px 16px; }
  .kpi-val { font-size: 28px; }
  .keys-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .keys-v { margin-bottom: 14px; }
  .alert-row, .flow-form, .dash-body, .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-inp { width: min(100%, 240px); }
  input, select, textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* Operational summary controls use the same keyboard and pointer affordances. */
.ov-freshness { font: 12px/1.6 var(--mono); color: var(--muted); margin-top: 12px; }
.ov-scope { color: var(--muted); font-size: 13px; margin: 0 0 22px; line-height: 1.6; }
.panel > .ov-scope { padding: 14px 22px 0; margin-bottom: 8px; }
.ov-kpi-link { position: relative; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.ov-kpi-link:hover { background: var(--surface-2); }
.ov-kpi-link > span { display: block; }
.ov-kpi-link .kpi-val { font-size: 30px; }
.ov-kpi-arrow { position: absolute; top: 20px; right: 18px; color: var(--muted); }
.ov-source-error, .ov-filter-scope { color: var(--amber-ink); background: var(--amber-bg); padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.ov-filter-scope { margin-bottom: 22px; border: 1px solid var(--amber-bd); border-radius: 4px; }
.ov-data-link { border: 0; background: none; color: var(--blue); font: inherit; text-align: left; cursor: pointer; padding: 5px 0; }
.ov-data-link:hover { text-decoration: underline; }
.ov-feed-item.ov-data-link { width: 100%; padding: 14px 22px; text-decoration: none; }
.ov-feed-item:hover { background: var(--surface-2); }
.ov-feed { max-height: 380px; }
.ov-attn-row { width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.ov-attn-ref { white-space: normal; overflow-wrap: anywhere; }
.ov-attn-ref small { display: block; font: 12px/1.6 var(--mono); color: var(--muted); margin-top: 5px; }
.ov-widget-note { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 14px; }
.ov-funding-row, .ov-rail-row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.ov-amount { font: 14px/1.6 var(--mono); overflow-wrap: anywhere; }
@media (max-width: 760px) { .ov-attn-row { flex-wrap: wrap; } .ov-attn-age { margin-left: auto; } }
/* Supersede the legacy dark theme's blue chrome explicitly. */
html[data-theme='dark'] .topbar { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme='dark'] .topbar .tb-logo { color: var(--text); }
html[data-theme='dark'] .btn-primary { background: var(--text); border-color: var(--text); color: var(--surface); }
html[data-theme='dark'] .btn-primary:hover { background: var(--text2); border-color: var(--text2); color: var(--surface); }
.btn { clip-path: none; }
.ov-kpi-link[aria-pressed='true'] { box-shadow: inset 0 -2px var(--blue); }
.bg-warning-banner { background: #60373b; }

/* Semantic pairs cover legacy badges, forms and secondary dialogs in both themes. */
.status[data-tone='warning'], .status-tone-warning { color: var(--amber-ink); }
.status[data-tone='muted'], .status-tone-muted { color: var(--muted); }
.corridor-dvp, .st-un { background: var(--blue-bg); color: var(--blue); }
.pol-status-active { background: var(--green-bg); color: var(--green); }
.btn-danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-bd); }
.btn-restore:hover { background: var(--green-bg); color: var(--green); border-color: var(--green-bd); }
input, select, textarea { color: var(--text); background-color: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.flow-step-tab.done .step-num { background: var(--green-bg); color: var(--green); }
.flow-step-tab.active .step-num { background: var(--blue-bg); color: var(--blue); }
.theater-outage-badge, .theater-axis, .theater-card, .theater-panel { background: var(--surface); }
.theater-card { opacity: 1; }
.theater-card:not(.lit):not(.sandbox) { border-style: dashed; }
.theater-controls { background: var(--surface-2); color: var(--text); }
.theater-controls button { color: var(--text); border-color: var(--border-2); }
.theater-controls button:hover { background: var(--surface); color: var(--text); }
.theater-controls button.primary { background: var(--green-bg); color: var(--green); border-color: var(--green-bd); }
.theater-controls button.primary:hover { background: var(--green-bg); color: var(--green); }
.theater-status { color: var(--muted); }
.theater-status .ok { color: var(--green); }
