/* FCAR Mission Control shared visual foundation.
 * Token source: mc-vision-20260719/grok5-report.md.
 * Font artifacts: Fontsource Google-font builds, vendored under ../fonts/.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  /* Core backgrounds */
  --mc-bg: #0a0a0c;
  --mc-surface: #111113;
  --mc-surface-2: #1a1a1f;
  --mc-surface-3: #212127;

  /* Borders and dividers */
  --mc-border: #25252b;
  --mc-border-subtle: rgba(255, 255, 255, 0.06);

  /* Typography */
  --mc-text-primary: #f4f4f7;
  --mc-text-secondary: #a3a3ac;
  --mc-text-muted: #6b6b75;
  --mc-text-mono: #c5c5d0;
  --mc-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mc-font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  --mc-font-size-xs: 11px;
  --mc-font-size-sm: 12.5px;
  --mc-font-size-base: 13.5px;
  --mc-font-size-md: 15px;
  --mc-line-height-dense: 1.35;
  --mc-line-height-prose: 1.55;
  --mc-ls-tight: -0.025em;
  --mc-ls-mono: normal;

  /* Accent and status */
  --mc-accent: #00f0d0;
  --mc-accent-hover: #00ffdb;
  --mc-nominal: #22c55e;
  --mc-warn: #facc15;
  --mc-critical: #ef4444;
  --mc-idle: #64748b;
  --mc-nominal-bg: rgba(34, 197, 94, 0.12);
  --mc-warn-bg: rgba(250, 204, 21, 0.12);
  --mc-critical-bg: rgba(239, 68, 68, 0.12);
  --mc-idle-bg: rgba(100, 116, 139, 0.14);

  /* Data visualization and panel chrome */
  --mc-grid-line: rgba(255, 255, 255, 0.035);
  --mc-panel-radius: 3px;
  --mc-panel-padding: 12px;
  --mc-panel-shadow:
    0 1px 0 rgba(255, 255, 255, 0.025),
    0 1px 3px rgba(0, 0, 0, 0.4);

  /* Interaction */
  --mc-focus-ring: var(--mc-accent);
  --mc-focus-halo: rgba(0, 240, 208, 0.18);
  --mc-duration-fast: 120ms;
  --mc-duration-normal: 180ms;
  --mc-duration-slow: 300ms;
  --mc-ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --mc-ease-out: cubic-bezier(0.17, 1, 0.32, 1);
  --mc-ease-in-out: cubic-bezier(0.66, 0, 0.34, 1);
}

html {
  background: var(--mc-bg);
  color: var(--mc-text-primary);
  font-family: var(--mc-font-sans);
  font-variant-numeric: tabular-nums lining-nums;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--mc-bg);
  color: var(--mc-text-primary);
  font-family: var(--mc-font-sans);
  font-size: var(--mc-font-size-base);
  line-height: var(--mc-line-height-dense);
}

button,
input,
select,
textarea {
  font: inherit;
}

:where(code, kbd, pre, samp, time, .mc-mono, .mc-data, .mc-telemetry, .mc-table, [data-mc-numeric]) {
  color: var(--mc-text-mono);
  font-family: var(--mc-font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: var(--mc-ls-mono);
}

:where(a[href], button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--mc-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--mc-focus-halo);
}

.mc-console {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  grid-template-rows: 48px minmax(0, 1fr) 32px;
  min-height: 100vh;
  gap: 1px;
  background: var(--mc-border);
}

.mc-panel {
  overflow: hidden;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-panel-radius);
  padding: var(--mc-panel-padding);
  background: var(--mc-surface);
  box-shadow: var(--mc-panel-shadow);
}

.mc-panel__header {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: calc(var(--mc-panel-padding) * -1) calc(var(--mc-panel-padding) * -1) 12px;
  border-bottom: 1px solid var(--mc-border-subtle);
  padding: 8px var(--mc-panel-padding);
  background: var(--mc-surface-3);
}

.mc-panel__title {
  margin: 0;
  color: var(--mc-text-primary);
  font-size: var(--mc-font-size-md);
  font-weight: 600;
  letter-spacing: var(--mc-ls-tight);
}

.mc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--mc-font-size-sm);
}

.mc-table tr {
  height: 28px;
}

.mc-table :where(td, th) {
  border-bottom: 1px solid var(--mc-border-subtle);
  padding: 2px 8px;
  text-align: left;
}

.mc-table th {
  color: var(--mc-text-secondary);
  font-family: var(--mc-font-sans);
  font-weight: 500;
}

.mc-status {
  --mc-status-color: var(--mc-idle);
  --mc-status-bg: var(--mc-idle-bg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--mc-status-color), transparent 55%);
  border-radius: var(--mc-panel-radius);
  padding: 3px 6px;
  background: var(--mc-status-bg);
  color: var(--mc-status-color);
  font-family: var(--mc-font-mono);
  font-size: var(--mc-font-size-xs);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
}

.mc-status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.mc-status--nominal,
.mc-status[data-status="nominal"] {
  --mc-status-color: var(--mc-nominal);
  --mc-status-bg: var(--mc-nominal-bg);
}

.mc-status--warn,
.mc-status[data-status="warn"] {
  --mc-status-color: var(--mc-warn);
  --mc-status-bg: var(--mc-warn-bg);
}

.mc-status--critical,
.mc-status[data-status="critical"] {
  --mc-status-color: var(--mc-critical);
  --mc-status-bg: var(--mc-critical-bg);
}

.mc-status--idle,
.mc-status[data-status="idle"] {
  --mc-status-color: var(--mc-idle);
  --mc-status-bg: var(--mc-idle-bg);
}

.mc-transition {
  transition-duration: var(--mc-duration-normal);
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-timing-function: var(--mc-ease-smooth);
}

.mc-status-pulse {
  animation: mc-status-pulse 1200ms var(--mc-ease-out) 1;
}

.mc-log-line {
  animation: mc-log-fade var(--mc-duration-slow) var(--mc-ease-out) both;
}

.mc-terminal {
  position: relative;
}

.mc-terminal::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 240, 208, 0.025) 50%);
  background-size: 100% 4px;
  content: "";
  opacity: 0.15;
}

@keyframes mc-status-pulse {
  0% { background-color: var(--mc-warn-bg); }
  100% { background-color: transparent; }
}

@keyframes mc-log-fade {
  from {
    opacity: 0.4;
    transform: translateY(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  :where(a[href], button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
    outline-color: Highlight;
    box-shadow: none;
  }
}

/* -------------------------------------------------------------------------- */
/* AXIOM Mission Control — imported shell                                      */
/*                                                                            */
/* This layer intentionally composes the existing Mission Control modules. It */
/* owns page structure, navigation, and responsive layout only; panel modules  */
/* remain bound to the collector through mc-live-data.js.                      */
/* -------------------------------------------------------------------------- */

:root {
  --mc-shell-bg: #060a10;
  --mc-shell-bg-elevated: #0a1019;
  --mc-shell-bg-active: #111a28;
  --mc-shell-line: #172131;
  --mc-shell-line-bright: #24344a;
  --mc-shell-text: #d8e2ef;
  --mc-shell-muted: #66758a;
  --mc-shell-dim: #3f4d61;
  --mc-shell-signal: #18e6c1;
  --mc-shell-signal-soft: rgba(24, 230, 193, 0.12);
  --mc-shell-amber: #ffbd39;
  --mc-shell-red: #ff5b67;
  --mc-sidebar-width: 196px;
  --mc-topbar-height: 48px;
}

html,
body {
  min-width: 320px;
  background: var(--mc-shell-bg);
  color: var(--mc-shell-text);
}

body {
  overflow: hidden;
}

.mc-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--mc-sidebar-width) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 21%, rgba(19, 67, 88, 0.12), transparent 31rem),
    var(--mc-shell-bg);
  isolation: isolate;
}

.mc-shell::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(55, 77, 103, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 77, 103, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent 72%);
}

/* Sidebar ------------------------------------------------------------------ */

.mc-sidebar {
  position: relative;
  z-index: 40;
  display: flex;
  min-width: 0;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--mc-shell-line);
  background: rgba(6, 10, 16, 0.94);
}

.mc-sidebar-brand {
  display: flex;
  height: var(--mc-topbar-height);
  flex: 0 0 var(--mc-topbar-height);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--mc-shell-line);
  padding: 0 20px;
  color: var(--mc-shell-text);
  font-family: var(--mc-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.mc-sidebar-brand img {
  border: 1px solid rgba(24, 230, 193, 0.24);
  border-radius: 3px;
  box-shadow: 0 0 18px rgba(24, 230, 193, 0.08);
}

.mc-sidebar-nav {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding: 14px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--mc-shell-line-bright) transparent;
}

.mc-nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 36px;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0 10px;
  background: transparent;
  color: #8b9bb0;
  cursor: pointer;
  font-family: var(--mc-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  transition:
    color var(--mc-duration-fast) ease,
    background-color var(--mc-duration-fast) ease,
    border-color var(--mc-duration-fast) ease;
}

.mc-nav-item:hover {
  border-color: rgba(36, 52, 74, 0.8);
  background: rgba(17, 26, 40, 0.62);
  color: var(--mc-shell-text);
}

.mc-nav-item[aria-current="page"] {
  border-color: #17263a;
  background: var(--mc-shell-bg-active);
  color: var(--mc-shell-text);
}

.mc-nav-item[aria-current="page"]::before {
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 2px;
  background: var(--mc-shell-signal);
  box-shadow: 0 0 10px rgba(24, 230, 193, 0.5);
  content: "";
}

.mc-nav-code {
  display: grid;
  width: 22px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--mc-shell-line-bright);
  border-radius: 2px;
  color: #617187;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.mc-nav-item[aria-current="page"] .mc-nav-code {
  border-color: rgba(24, 230, 193, 0.64);
  color: var(--mc-shell-signal);
}

.mc-sidebar-footer {
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
  border-top: 1px solid var(--mc-shell-line);
  padding: 14px 20px 17px;
  color: var(--mc-shell-dim);
  font-family: var(--mc-font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

/* Main shell --------------------------------------------------------------- */

.mc-root {
  display: block;
  height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--mc-shell-line-bright) var(--mc-shell-bg);
}

.mc-root > * {
  min-width: 0;
  min-height: 0;
}

.mc-topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  display: flex;
  height: var(--mc-topbar-height);
  grid-area: auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--mc-shell-line);
  padding: 0 20px;
  background: rgba(6, 10, 16, 0.92);
  backdrop-filter: blur(14px);
}

.mc-brandline {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.mc-brand {
  overflow: hidden;
  color: var(--mc-shell-text);
  font-family: var(--mc-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-brand b {
  color: var(--mc-shell-signal);
  font-weight: 700;
}

.mc-screen-label {
  border-left: 1px solid var(--mc-shell-line-bright);
  padding-left: 14px;
  color: var(--mc-shell-muted);
  font-family: var(--mc-font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.mc-topbar-status {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.mc-voice-cluster {
  min-width: 0;
  gap: 6px !important;
  margin-left: 0 !important;
}

.mc-voice-session,
.mc-voice-qual,
#mc-chat-topbar-btn {
  display: none !important;
}

.mc-voice-live[hidden] {
  display: none !important;
}

:where(.mc-shell) :where(button, [role="button"]) {
  min-width: 24px;
  min-height: 24px;
}

.mc-shell input:not([type="range"]) {
  min-height: 24px;
}

.mc-conn-badge,
.mc-topbar-chip,
.mc-topbar-clock {
  display: inline-flex;
  min-height: 24px;
  box-sizing: border-box;
  align-items: center;
  border: 1px solid var(--mc-shell-line-bright);
  border-radius: 2px;
  padding: 0 9px;
  background: rgba(10, 16, 25, 0.74);
  font-family: var(--mc-font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mc-conn-badge {
  color: #7d8da2;
}

.mc-conn--linked {
  border-color: rgba(24, 230, 193, 0.48);
  color: var(--mc-shell-signal);
}

.mc-conn--connecting {
  color: #75a8c5;
}

.mc-conn--auth_required,
.mc-conn--down {
  border-color: rgba(255, 91, 103, 0.45);
  color: var(--mc-shell-red);
}

.mc-topbar-chip {
  gap: 7px;
  color: var(--mc-shell-muted);
}

.mc-topbar-chip strong {
  color: #a9b6c7;
  font-weight: 500;
}

.mc-topbar-chip--approval {
  border-color: rgba(255, 189, 57, 0.38);
  color: var(--mc-shell-amber);
}

.mc-topbar-chip--approval strong {
  color: var(--mc-shell-amber);
}

.mc-topbar-chip[data-quality="high"] {
  border-color: rgba(24, 230, 193, 0.3);
}

.mc-topbar-chip[data-quality="high"] strong {
  color: var(--mc-shell-signal);
}

.mc-topbar-chip[data-quality="degraded"],
.mc-topbar-chip[data-quality="stale"] {
  border-color: rgba(255, 189, 57, 0.38);
}

.mc-topbar-chip[data-quality="degraded"] strong,
.mc-topbar-chip[data-quality="stale"] strong {
  color: var(--mc-shell-amber);
}

.mc-topbar-chip[data-quality="unknown"] {
  border-color: rgba(102, 117, 138, 0.48);
}

.mc-topbar-chip[data-quality="unknown"] strong {
  color: var(--mc-shell-muted);
}

.mc-topbar-chip[data-quality="critical"] {
  border-color: rgba(255, 91, 103, 0.42);
}

.mc-topbar-chip[data-quality="critical"] strong {
  color: var(--mc-shell-red);
}

.mc-topbar-clock {
  min-width: 108px;
  justify-content: center;
  color: #7c8ca1;
}

.mc-unlock-mount {
  border-bottom: 1px solid var(--mc-shell-line);
}

/* Overview hero ------------------------------------------------------------ */

.mc-overview-hero {
  display: grid;
  height: clamp(520px, 55vh, 640px);
  grid-template-columns: 210px minmax(440px, 1fr) 300px;
  border-bottom: 1px solid var(--mc-shell-line);
  background:
    linear-gradient(90deg, rgba(12, 20, 31, 0.28), transparent 28%, transparent 72%, rgba(12, 20, 31, 0.24)),
    rgba(5, 9, 15, 0.36);
}

.mc-hero-metrics {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-right: 1px solid rgba(23, 33, 49, 0.78);
  padding: 22px 18px;
}

.mc-section-kicker,
.mc-static-view-code {
  color: #74849a;
  font-family: var(--mc-font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.mc-hero-metrics h1,
.mc-operations-heading h2,
.mc-static-view h2 {
  margin: 7px 0 0;
  color: #dce6f2;
  font-family: var(--mc-font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.mc-hero-metrics .mc-kpi-mount {
  height: auto;
  margin-top: 20px;
}

.mc-hero-metrics .mc-kpi-strip {
  display: grid;
  height: auto;
  align-items: start;
  gap: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.mc-hero-metrics .mc-kpi {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 8px;
  border: 0;
  padding: 0 0 16px;
}

.mc-hero-metrics .mc-kpi-label {
  grid-column: 1 / -1;
  color: #738299;
  font-size: 8px;
  letter-spacing: 0.17em;
}

.mc-hero-metrics .mc-kpi-value,
.mc-hero-metrics .mc-kpi-value--sub {
  align-self: end;
  color: #d8e3ef;
  font-family: var(--mc-font-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: none;
}

.mc-hero-metrics .mc-kpi--hero .mc-kpi-value {
  color: var(--mc-shell-signal);
  text-shadow: 0 0 14px rgba(24, 230, 193, 0.18);
}

.mc-hero-metrics .mc-kpi--approval .mc-kpi-value {
  color: var(--mc-shell-amber);
}

.mc-hero-metrics .mc-kpi-value--alert {
  color: var(--mc-shell-red);
}

.mc-hero-metrics .mc-kpi-unit {
  color: #627087;
  font-size: 9px;
}

.mc-hero-metrics .mc-kpi-spark {
  width: 68px;
  height: 18px;
  align-self: end;
  justify-self: end;
  opacity: 0.72;
}

.mc-hero-metrics .mc-kpi--svc {
  padding-top: 2px;
}

.mc-hero-metrics .mc-kpi-dots {
  grid-column: 1 / -1;
  gap: 9px;
}

.mc-hero-metrics .mc-dot {
  gap: 4px;
  font-size: 11px;
}

.mc-hero-metrics .mc-dot i {
  width: 6px;
  height: 6px;
}

.mc-hero-metrics .mc-kpi-awaiting {
  position: static;
  grid-column: 1 / -1;
  transform: none;
  padding: 8px 0;
  font-size: 8px;
}

.mc-center {
  position: relative;
  grid-area: auto;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(15, 65, 83, 0.15), transparent 37%),
    transparent;
  box-shadow: none;
}

.mc-center::before {
  border-color: rgba(31, 52, 72, 0.34);
  opacity: 0.45;
}

.mc-center::after {
  opacity: 0.22;
}

#mc-canvas {
  position: absolute;
  inset: 36px 0 28px;
  width: 100%;
  height: calc(100% - 64px);
}

.mc-brain3d-host {
  z-index: 1;
  overflow: hidden;
}

.mc-brain3d-labels {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.mc-brain3d-label {
  position: absolute;
  border-bottom: 1px solid #274458;
  padding: 2px 4px;
  color: #718398;
  font-family: var(--mc-font-mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.mc-brain3d-label[data-state="running"] { border-color: rgba(24, 230, 193, 0.55); color: #9bffe9; }
.mc-brain3d-label[data-state="gated"] { border-color: rgba(255, 189, 57, 0.55); color: #ffdc83; }
.mc-brain3d-label[data-state="error"] { border-color: rgba(255, 91, 103, 0.55); color: #ff9ba3; }

.mc-brain-heading {
  position: absolute;
  z-index: 4;
  top: 22px;
  right: 22px;
  left: 22px;
  display: flex;
  justify-content: space-between;
  color: #4c5c70;
  font-family: var(--mc-font-mono);
  font-size: 7px;
  letter-spacing: 0.24em;
}

.mc-brain-heading span:last-child {
  color: #52647a;
  letter-spacing: 0.12em;
}

.mc-brain-legend {
  position: absolute;
  z-index: 4;
  bottom: 14px;
  left: 20px;
  display: flex;
  gap: 15px;
  color: #6c7b90;
  font-family: var(--mc-font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.mc-brain-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mc-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mc-shell-dim);
}

.mc-legend-dot--running { background: var(--mc-shell-signal); }
.mc-legend-dot--gated { background: var(--mc-shell-amber); }
.mc-legend-dot--error { background: var(--mc-shell-red); }
.mc-legend-dot--idle { background: #45556b; }

.mc-brain-hint {
  position: absolute;
  z-index: 4;
  right: 20px;
  bottom: 14px;
  color: #415065;
  font-family: var(--mc-font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.mc-rightrail {
  display: flex;
  min-height: 0;
  grid-area: auto;
  flex-direction: column;
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid rgba(23, 33, 49, 0.78);
  scrollbar-width: thin;
  scrollbar-color: var(--mc-shell-line-bright) transparent;
}

.mc-rightrail > div {
  border-bottom: 1px solid var(--mc-shell-line);
}

.mc-rightrail .glass-panel,
.mc-leftrail .glass-panel,
.mc-operations-main .glass-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mc-rightrail .mc-panel,
.mc-leftrail .mc-panel {
  padding: 14px 16px;
}

.mc-rightrail .mc-panel-head,
.mc-leftrail .mc-panel-head,
.mc-operations-main .mc-panel-head {
  min-height: 20px;
  border-bottom: 0;
}

.mc-rightrail .mc-panel-title,
.mc-leftrail .mc-panel-title,
.mc-operations-main .mc-panel-title {
  color: #8291a5;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.mc-rightrail .mc-firehose {
  min-height: 240px;
}

.mc-rightrail .mc-firehose-feed {
  min-height: 150px;
}

/* Operations --------------------------------------------------------------- */

.mc-operations {
  border-bottom: 1px solid var(--mc-shell-line);
  background: rgba(6, 10, 16, 0.7);
}

.mc-operations-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--mc-shell-line);
  padding: 0 20px;
}

.mc-operations-heading h2 {
  margin-top: 4px;
  font-size: 12px;
}

.mc-projection-badge {
  border: 1px solid var(--mc-shell-line-bright);
  border-radius: 2px;
  padding: 5px 8px;
  color: #526176;
  font-family: var(--mc-font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.mc-operations-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.85fr) minmax(0, 1.7fr);
}

.mc-leftrail {
  display: flex;
  min-height: 660px;
  grid-area: auto;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  border-right: 1px solid var(--mc-shell-line);
}

.mc-leftrail > div {
  min-height: 0;
  border-bottom: 1px solid var(--mc-shell-line);
}

.mc-leftrail .mc-fleet {
  min-height: 320px;
}

.mc-operations-main {
  display: grid;
  min-width: 0;
  align-content: start;
}

.mc-kanban-host,
.mc-engines-host,
.mc-optimizer-host {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  max-height: none;
  grid-area: auto;
  overflow: visible;
  border-bottom: 1px solid var(--mc-shell-line);
}

.mc-operations-main > * > .mc-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.mc-kanban-host {
  min-height: 300px;
}

.mc-engines-host {
  min-height: 220px;
}

.mc-optimizer-host {
  min-height: 260px;
}

.mc-kanban-host > .mc-panel,
.mc-engines-host > .mc-panel,
.mc-optimizer-host > .mc-panel {
  padding: 15px 18px;
}

.mc-timebar-mount {
  position: sticky;
  z-index: 24;
  bottom: 0;
  min-height: 56px;
  grid-area: auto;
  border-top: 1px solid var(--mc-shell-line);
  background: rgba(6, 10, 16, 0.94);
  backdrop-filter: blur(14px);
}

/* Focus navigation --------------------------------------------------------- */

.mc-nav-focus {
  position: relative;
  z-index: 1;
  box-shadow:
    inset 2px 0 0 var(--mc-shell-signal),
    0 0 0 1px rgba(24, 230, 193, 0.24),
    0 0 34px rgba(24, 230, 193, 0.06);
}

.mc-static-view {
  min-height: calc(100vh - var(--mc-topbar-height) - 56px);
  box-sizing: border-box;
  border-bottom: 1px solid var(--mc-shell-line);
  padding: clamp(42px, 8vw, 110px);
  background:
    linear-gradient(90deg, rgba(17, 26, 40, 0.44), transparent 35%),
    var(--mc-shell-bg);
}

.mc-static-view[hidden] {
  display: none;
}

.mc-static-view h2 {
  max-width: 680px;
  margin-top: 14px;
  font-size: clamp(22px, 3vw, 40px);
  letter-spacing: -0.04em;
}

.mc-static-view p {
  max-width: 720px;
  margin: 18px 0 0;
  color: #7a899e;
  font-size: 13px;
  line-height: 1.7;
}

.mc-static-view-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.mc-schedule-state {
  flex: 0 0 auto;
  border: 1px solid rgba(136, 157, 188, 0.25);
  color: #7a899e;
  font: 700 10px/1 var(--mc-font-mono);
  letter-spacing: 0.12em;
  padding: 8px 10px;
}

.mc-schedule-state[data-state="live"] {
  border-color: rgba(24, 230, 193, 0.35);
  color: var(--mc-shell-signal);
}

.mc-schedule-state[data-state="degraded"] {
  border-color: rgba(255, 189, 57, 0.42);
  color: var(--mc-shell-amber);
}

.mc-schedules-host {
  margin-top: 24px;
}

.mc-schedule-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: #6f8098;
  font: 600 9px/1.4 var(--mc-font-mono);
  letter-spacing: 0.08em;
}

.mc-schedule-list {
  display: grid;
  gap: 8px;
}

.mc-schedule-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 0.8fr) minmax(140px, 0.6fr);
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(112, 143, 184, 0.2);
  background: rgba(8, 15, 27, 0.72);
  padding: 13px 15px;
}

.mc-schedule-identity,
.mc-schedule-next,
.mc-schedule-last {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mc-schedule-identity strong,
.mc-schedule-next strong {
  overflow: hidden;
  color: var(--mc-shell-text);
  font: 700 12px/1.25 var(--mc-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-schedule-identity span,
.mc-schedule-next time,
.mc-schedule-last {
  overflow: hidden;
  color: #718198;
  font: 500 10px/1.35 var(--mc-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-schedule-last span {
  color: var(--mc-shell-signal);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.mc-schedule-empty {
  display: grid;
  gap: 7px;
  border: 1px dashed rgba(112, 143, 184, 0.24);
  background: rgba(8, 15, 27, 0.46);
  padding: 24px;
  color: #718198;
  font: 500 11px/1.5 var(--mc-font-mono);
}

.mc-schedule-empty strong {
  color: var(--mc-shell-text);
  font-size: 12px;
  letter-spacing: 0.08em;
}

@media (max-width: 760px) {
  .mc-static-view-heading {
    display: grid;
  }

  .mc-schedule-state {
    justify-self: start;
  }

  .mc-schedule-meta,
  .mc-schedule-row {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.mc-settings-list {
  display: grid;
  max-width: 760px;
  margin: 36px 0 0;
  border-top: 1px solid var(--mc-shell-line);
}

.mc-settings-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(0, 1.4fr);
  gap: 24px;
  border-bottom: 1px solid var(--mc-shell-line);
  padding: 16px 0;
}

.mc-settings-list dt {
  color: #65758b;
  font-family: var(--mc-font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mc-settings-list dd {
  margin: 0;
  color: #b3c0d0;
  font-family: var(--mc-font-mono);
  font-size: 11px;
}

/* Provider discovery ------------------------------------------------------- */

.status-dot[data-provider-state="unknown"] {
  background: #4b5667;
  box-shadow: none;
}

.status-dot[data-provider-state="live"] {
  background: var(--mc-shell-signal);
  box-shadow: 0 0 5px rgba(24, 230, 193, 0.72);
}

.status-dot[data-provider-state="idle"] {
  background: #617087;
  box-shadow: none;
}

.status-dot[data-provider-state="error"] {
  background: var(--mc-shell-red);
  box-shadow: 0 0 5px rgba(255, 91, 103, 0.68);
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1180px) {
  :root {
    --mc-sidebar-width: 64px;
  }

  .mc-sidebar-brand {
    justify-content: center;
    padding: 0;
  }

  .mc-sidebar-brand span,
  .mc-sidebar-footer,
  .mc-nav-item > span:last-child {
    display: none;
  }

  .mc-sidebar-nav {
    padding-inline: 8px;
  }

  .mc-nav-item {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .mc-overview-hero {
    grid-template-columns: 190px minmax(390px, 1fr) 270px;
  }

  .mc-topbar-clock {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .mc-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .mc-sidebar {
    position: fixed;
    z-index: 80;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58px;
    flex-direction: row;
    border-top: 1px solid var(--mc-shell-line-bright);
    border-right: 0;
    background: rgba(6, 10, 16, 0.97);
    backdrop-filter: blur(14px);
  }

  .mc-sidebar-brand,
  .mc-sidebar-footer {
    display: none;
  }

  .mc-sidebar-nav {
    display: flex;
    width: 100%;
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
  }

  .mc-nav-item {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .mc-root {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding-bottom: 58px;
  }

  .mc-topbar {
    padding-inline: 12px;
  }

  .mc-screen-label,
  .mc-topbar-chip {
    display: none;
  }

  .mc-topbar-clock,
  .mc-voice-approvals,
  .mc-voice-waiting,
  .mc-voice-cmd-hint,
  .mc-voice-mute {
    display: none !important;
  }

  .mc-voice-cluster {
    flex: 0 0 auto;
  }

  .mc-overview-hero {
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .mc-hero-metrics,
  .mc-rightrail {
    border-right: 0;
    border-bottom: 1px solid var(--mc-shell-line);
    border-left: 0;
  }

  .mc-hero-metrics {
    padding: 18px 16px;
  }

  .mc-hero-metrics .mc-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 12px;
  }

  .mc-hero-metrics .mc-kpi {
    min-height: 74px;
    padding-bottom: 8px;
  }

  .mc-hero-metrics .mc-kpi-value,
  .mc-hero-metrics .mc-kpi-value--sub {
    font-size: 24px;
  }

  .mc-center {
    min-height: 430px;
  }

  .mc-rightrail {
    max-height: 460px;
  }

  .mc-operations-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .mc-leftrail {
    min-height: 0;
    border-right: 0;
  }

  .mc-timebar-mount {
    bottom: 58px;
  }
}

@media (max-width: 600px) {
  .mc-brand {
    max-width: 170px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .mc-conn-badge {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mc-hero-metrics .mc-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mc-hero-metrics .mc-kpi--svc {
    grid-column: 1 / -1;
  }

  .mc-center {
    min-height: 360px;
  }

  .mc-brain-hint {
    display: none;
  }

  .mc-brain3d-label {
    font-size: 6px;
  }

  .mc-operations-heading {
    padding-inline: 14px;
  }

  .mc-projection-badge {
    display: none;
  }

  .mc-settings-list > div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .mc-static-view {
    padding: 42px 18px;
  }

  .mc-timebar-mount { min-height: 72px; }
  .mc-timebar {
    display: grid;
    height: 72px;
    grid-template-areas: "live transport speed . badge" "slider slider slider slider times";
    grid-template-columns: auto auto auto 1fr auto;
    gap: 4px 6px;
    padding: 5px 8px;
  }
  .mc-tb-btn--live { grid-area: live; }
  .mc-tb-transport { grid-area: transport; }
  .mc-tb-speed { grid-area: speed; }
  .mc-tb-slider-wrap { min-width: 64px; grid-area: slider; }
  .mc-tb-badge { grid-area: badge; }
  .mc-tb-times { grid-area: times; }
  .mc-tb-time--start, .mc-tb-time--sep, .mc-tb-time--cursor { display: none; }
  .mc-rightrail .mc-system-health {
    box-sizing: border-box;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  .mc-system-health > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mc-kb-sub::after { content: "SWIPE BOARD →"; color: var(--mc-shell-signal); }
  .mc-kb-board { scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  .mc-kb-col { scroll-snap-align: start; }
  .mc-sidebar-nav { box-shadow: inset -20px 0 18px -20px var(--mc-shell-signal); scrollbar-width: thin; }
}

@media (prefers-reduced-motion: reduce) {
  .mc-root {
    scroll-behavior: auto;
  }
}
