* {
  box-sizing: border-box;
}

:root {
  --layout-stack-gap: 18px;
  --bg: #04060c;
  --bg-elev: #0a101c;
  --panel: #0c1526;
  --panel-soft: #101a2e;
  --panel-2: #0a1220;
  --border: #1a2738;
  --border-strong: #2a3a4f;
  --muted: #8b9bb4;
  --text: #e4ebf5;
  --text-strong: #f6f8fc;
  --accent: #3d8ae8;
  --accent-2: #2f6fc4;
  --tone-info: #5b9bd5;
  --tone-stable: #3ec9a8;
  --tone-warn: #e8a84a;
  --tone-critical: #e85c5c;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 10px 22px rgba(0, 0, 0, 0.4);
  --risk-high: #e85c5c;
  --risk-medium: #e8a84a;
  --risk-low: #3ec9a8;
  --success-bg: #0a2e24;
  --success-border: #1d8a6a;
  --error-bg: #3a1414;
  --error-border: #b83c3c;
  --ring-track: rgba(100, 120, 150, 0.12);
  --ring-glow: rgba(62, 201, 168, 0.35);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  font-family: "IBM Plex Sans", Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(ellipse 70% 45% at 50% -15%, rgba(30, 80, 120, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 32%);
  z-index: -1;
}

a {
  color: #9ec1ff;
  text-decoration: none;
}

a:hover {
  color: #c4dbff;
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.nav-backdrop {
  display: none;
}

.mobile-nav-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 10px 0 0;
  padding: 0;
  border: 1px solid #395177;
  border-radius: 12px;
  background: linear-gradient(180deg, #1e314f, #17263f);
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-toggle-bars {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: #e7eefc;
  box-shadow:
    0 -6px 0 #e7eefc,
    0 6px 0 #e7eefc;
}

body.nav-mobile-open {
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  border-right: 1px solid var(--border-strong);
  padding: 22px 14px 20px;
  background: linear-gradient(180deg, #060910 0%, #080d16 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(140deg, #2a9d8f, #2180a8);
  color: #f0fffc;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
}

.nav-section-title {
  margin: 0 8px 4px;
  color: #7c91b4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  position: relative;
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #d6e3fa;
  border: 1px solid transparent;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.nav a.active {
  border-color: rgba(62, 201, 168, 0.45);
  background: linear-gradient(180deg, rgba(20, 48, 42, 0.55), rgba(12, 28, 32, 0.75));
  box-shadow: inset 0 1px 0 rgba(62, 201, 168, 0.12);
  color: #eef8f5;
}

.nav a:hover {
  text-decoration: none;
  border-color: #2f3d4e;
  background: #121a28;
  transform: translateX(1px);
}

.active-run-box {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel-2));
  box-shadow: var(--shadow-soft);
}

.active-run-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.active-run-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.active-run-pill[data-status="live"] {
  color: #b8f5e6;
  border-color: rgba(62, 201, 168, 0.45);
  background: rgba(15, 52, 44, 0.55);
}

.active-run-pill[data-status="idle"] {
  color: #e8d4a8;
  border-color: rgba(232, 168, 74, 0.35);
  background: rgba(48, 36, 12, 0.35);
}

.active-run-pill[data-status="none"] {
  opacity: 0.7;
}

.small-label {
  color: #95a9c8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.active-run-name {
  margin-top: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
}

.active-run-id {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

/* Column shell: header + status + page content stack in normal flow (no sticky overlap). */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border-strong);
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--layout-stack-gap);
  background: rgba(6, 9, 14, 0.92);
  backdrop-filter: blur(12px);
}

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

.topbar-wordmark {
  flex: 0 0 auto;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  text-decoration: none;
  line-height: 1.1;
}

.topbar-wordmark:hover {
  color: #c4dbff;
  text-decoration: none;
}

@media (max-width: 520px) {
  .topbar-wordmark {
    font-size: 1.15rem;
  }
}

.topbar-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 20px;
  align-items: stretch;
}

.topbar-controls-compact {
  display: block;
  border: none;
  background: transparent;
  padding: 0;
}

.topbar-compact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.topbar-compact-sep {
  flex: 0 0 1px;
  width: 1px;
  height: 24px;
  background: var(--border-strong);
  opacity: 0.85;
}

@media (max-width: 1100px) {
  .topbar-controls:not(.topbar-controls-compact) {
    grid-template-columns: 1fr;
  }

  .topbar-controls {
    grid-template-columns: 1fr;
  }

  .topbar-compact-sep {
    display: none;
  }
}

.topbar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.topbar-group-actions {
  max-width: 200px;
}

@media (max-width: 1100px) {
  .topbar-group-actions {
    max-width: none;
  }
}

.topbar-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a8ca8;
}

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

.topbar-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #6c7d96;
}

.topbar-refresh {
  min-width: 120px;
}

.title-block {
  flex: 1;
  min-width: 0;
}

.kicker {
  margin: 0 0 6px;
  color: #8da7cf;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-strong);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topbar-actions,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tenant-filters input {
  flex: 1 1 140px;
  min-width: 0;
}

.demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #38517a;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(19, 33, 57, 0.9), rgba(13, 24, 43, 0.93));
  color: #d5e4fb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.demo-toggle input[type="checkbox"] {
  margin: 0;
}

.main > .content {
  flex: 0 1 auto;
  min-width: 0;
}

.content {
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px;
  padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
}

.content:has(.page-dashboard) {
  padding-top: 20px;
  padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
}

.page {
  display: grid;
  gap: 22px;
}

.page.hidden,
.hidden {
  display: none !important;
}

.main > .status {
  flex: 0 0 auto;
}

.status {
  margin: 14px 24px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #2e4f86;
  background: linear-gradient(180deg, rgba(26, 53, 96, 0.65), rgba(19, 35, 66, 0.78));
  color: #d4e6ff;
  box-shadow: 0 14px 26px rgba(3, 9, 20, 0.38);
}

.status.ok {
  border-color: #2b598f;
}

.status.error {
  border-color: var(--error-border);
  background: linear-gradient(180deg, rgba(74, 19, 19, 0.84), rgba(57, 14, 14, 0.86));
  color: #ffd3d3;
}

.panel {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #e9f1ff;
}

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

.results-panel {
  border-color: #2f4569;
}

.control-center {
  padding: 22px 22px 20px;
  border-color: var(--border-strong);
  background: linear-gradient(165deg, #0c1422 0%, #080d14 100%);
}

.dashboard-hero {
  overflow: hidden;
  position: relative;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: -30% -15% auto auto;
  width: 45%;
  height: 90%;
  background: radial-gradient(circle, rgba(62, 201, 168, 0.06), transparent 60%);
  pointer-events: none;
}

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.48fr);
  gap: 24px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.dashboard-hero-primary {
  min-width: 0;
}

.dashboard-hero-kicker {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8ea6cc;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fd39a;
  box-shadow: 0 0 0 0 rgba(95, 211, 154, 0.55);
  animation: livePulse 2.4s ease-out infinite;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(95, 211, 154, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(95, 211, 154, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(95, 211, 154, 0);
  }
}

.dashboard-hero-score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 22px;
}

.health-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.health-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
  filter: none;
}

.health-ring-bg {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 8;
}

.health-ring-arc {
  fill: none;
  stroke: url(#healthRingGrad);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 480ms cubic-bezier(0.4, 0, 0.2, 1);
}

.health-ring-wrap svg defs {
  display: none;
}

.health-ring-wrap .health-ring {
  --arc-color: #5eb0ff;
}

.health-ring-arc {
  stroke: var(--arc-color, #5eb0ff);
}

.health-ring-arc[data-score="100"],
.health-ring-arc[data-score="99"],
.health-ring-arc[data-score="98"] {
  stroke: #5fd39a;
}

.health-ring-arc[data-score="0"],
.health-ring-arc[data-score="1"],
.health-ring-arc[data-score="2"] {
  stroke: #ff7a7a;
}

.health-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.health-ring-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  line-height: 1;
}

.health-ring-caption {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8aa0c4;
}

.dashboard-hero-health-col {
  flex-shrink: 0;
}

.dashboard-hero-state-block {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dashboard-status-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-hero-primary-status .signal-caption {
  margin-bottom: 4px;
}

.dashboard-state-row {
  margin-top: 4px;
}

.dashboard-state-primary {
  font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.65rem);
  letter-spacing: 0.04em;
}

.dashboard-hero-secondary-status {
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-hero-secondary-status .signal-label {
  margin-bottom: 4px;
}

.dashboard-risk-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dashboard-risk-value {
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.35rem);
  margin: 0;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.signal-risk-inline {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.1rem);
  margin: 0;
  line-height: 1;
}

.dashboard-narrative-strip {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
  line-height: 1.6;
  color: #d5dde9;
  max-width: 68ch;
}

.dashboard-operator-line {
  margin: 10px 0 0;
  padding: 0;
  max-width: 68ch;
  font-size: 12px;
  line-height: 1.55;
  color: #9eb0cb;
}

.dashboard-narrative-strip[data-severity="critical"] {
  border-color: rgba(200, 80, 80, 0.55);
  background: linear-gradient(90deg, rgba(90, 28, 28, 0.55), rgba(28, 16, 18, 0.75));
  color: #ffe8e8;
}

.dashboard-narrative-strip[data-severity="watch"] {
  border-color: rgba(200, 140, 60, 0.45);
  background: linear-gradient(90deg, rgba(80, 52, 18, 0.45), rgba(24, 20, 14, 0.72));
  color: #fff0dc;
}

.dashboard-trend-line {
  margin: 0;
  color: #b9c5d8;
  font-size: 12px;
}

.dashboard-hero-aside {
  display: grid;
  gap: 12px;
  align-content: start;
}

.dashboard-last-updated {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #7a8ca3;
}

.insight-tile {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 14px 13px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 160ms ease, transform 160ms ease;
}

.insight-tile:hover {
  border-color: #3a4a5e;
  transform: translateY(-1px);
}

.insight-tile-alert {
  border-color: rgba(62, 201, 168, 0.25);
}

.insight-tile-alert-watch {
  border-color: rgba(232, 168, 74, 0.45);
  box-shadow: inset 0 0 0 1px rgba(232, 168, 74, 0.12);
}

.insight-tile-alert-critical {
  border-color: rgba(232, 92, 92, 0.5);
  box-shadow: inset 0 0 0 1px rgba(232, 92, 92, 0.15);
}

.insight-tile-label {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #8ea6c9;
}

.insight-tile-value {
  margin: 8px 0 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-strong);
}

.insight-tile-sub {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #a8bddf;
}

.dashboard-deep-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3a5680;
  background: linear-gradient(180deg, #1a2d4e, #14243f);
  color: #d6e6ff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.dashboard-deep-link:hover {
  border-color: #5a7fc4;
  background: linear-gradient(180deg, #22375c, #182a48);
  color: #fff;
  text-decoration: none;
}

.dashboard-deep-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.dashboard-section-head h3 {
  margin: 0;
}

.section-subtitle {
  margin: 4px 0 0;
}

.insight-tile-metrics-split .insight-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.insight-tile-metrics-split .insight-metric-block {
  min-width: 0;
}

.insight-tile-value--sm {
  font-size: 26px;
  margin-top: 4px;
}

.page-dashboard {
  gap: 14px;
}

.page-dashboard > .panel:not(.control-center) {
  padding: 14px 16px;
}

.page-dashboard > .control-center {
  padding: 16px 18px;
}

.page-dashboard .dashboard-section-head {
  margin-bottom: 8px;
}

.page-subtitle-truncate {
  max-width: min(52ch, 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-card {
  border: 1px solid #31486f;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(14, 26, 47, 0.92), rgba(10, 19, 35, 0.95));
  min-height: 120px;
}

.insight-card-label {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8ea6c9;
}

.operator-message-compact {
  margin: 0;
  font-size: 14px;
  line-height: 1.62;
}

.stress-heatmap {
  display: grid;
  gap: 10px;
}

.stress-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.stress-bar-label {
  color: #a8bddf;
}

.stress-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(10, 20, 38, 0.95);
  border: 1px solid #2f4568;
  overflow: hidden;
}

.stress-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82c4, #5ec4e8);
  transition: width 320ms ease;
}

.stress-bar-row[data-tone="high"] .stress-bar-fill {
  background: linear-gradient(90deg, #e35b5b, #ff8a8a);
}

.stress-bar-row[data-tone="med"] .stress-bar-fill {
  background: linear-gradient(90deg, #d4923a, #ffbf56);
}

.stress-bar-row[data-tone="low"] .stress-bar-fill {
  background: linear-gradient(90deg, #3a9d6a, #68d497);
}

.stress-bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #d0dff8;
}

.stress-heatmap-legend {
  margin: 8px 0 0;
  font-size: 11px;
  color: #8fa5c7;
}

.stress-empty {
  margin: 0;
  color: #8fa5c7;
  font-size: 13px;
}

.mini-graph-host {
  position: relative;
  min-height: 160px;
  border-radius: 10px;
  background: #0a1018;
  border: 1px solid var(--border-strong);
}

.mini-graph {
  width: 100%;
  height: 160px;
  display: block;
}

.mini-graph-edge {
  stroke: url(#miniGraphGrad);
  stroke-width: 1.4;
  stroke-opacity: 0.75;
}

.mini-graph-node circle {
  fill: rgba(30, 52, 92, 0.95);
  stroke: rgba(121, 171, 255, 0.65);
  stroke-width: 1.2;
}

.mini-graph-label {
  fill: #b8cef5;
  font-size: 9px;
  font-weight: 600;
}

.mini-graph-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: #8b9bb4;
  max-width: 42ch;
  justify-self: center;
}

.dashboard-system-map .system-map3d-layout {
  position: relative;
  margin-top: 4px;
}

.system-map3d-host {
  width: 100%;
  height: min(360px, 42vw);
  min-height: 260px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #070b12;
  overflow: hidden;
}

.system-map3d-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.system-map3d-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(8, 12, 18, 0.94);
  color: #e8edf4;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.system-map3d-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: #7a8ca3;
}

@media (max-width: 740px) {
  .system-map3d-host {
    height: 280px;
    min-height: 0;
  }
}

.dashboard-signals .sparkline-wrap {
  margin-top: 6px;
}

.sparkline-canvas-wrap {
  position: relative;
  border-radius: 12px;
  border: 1px solid #304564;
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.95), rgba(7, 12, 22, 0.98));
  overflow: hidden;
}

#dashboardSparkline {
  display: block;
  width: 100%;
  height: 140px;
  vertical-align: middle;
  touch-action: none;
}

.sparkline-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 160px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(90, 130, 200, 0.55);
  background: rgba(8, 14, 26, 0.94);
  color: #dbe8ff;
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(2, 6, 14, 0.55);
}

.sparkline-tooltip strong {
  color: #fff;
  font-size: 11px;
}

.spark-tip-risk {
  color: #ffcf8a;
}

.sparkline-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: #8fa5c7;
}

.disclosure-panel {
  padding: 0;
  overflow: hidden;
}

.disclosure-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 700;
  color: #e9f1ff;
}

.disclosure-summary::-webkit-details-marker {
  display: none;
}

.disclosure-title {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.disclosure-hint {
  font-size: 12px;
  font-weight: 500;
  color: #8fa5c7;
}

.disclosure-panel[open] .disclosure-summary {
  border-bottom: 1px solid var(--border);
}

.dashboard-metrics-grid,
.disclosure-actions {
  padding: 0 18px 18px;
}

.disclosure-actions {
  padding-top: 4px;
  justify-content: flex-end;
}

.alerts-feed {
  gap: 8px;
}

.alert-feed-item {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #31476b;
  border-left: 3px solid #5f88dd;
  background: linear-gradient(180deg, rgba(16, 30, 55, 0.85), rgba(12, 24, 43, 0.9));
  font-size: 13px;
}

.alert-feed-critical {
  border-left-color: #d45c5c !important;
  background: linear-gradient(180deg, rgba(66, 22, 22, 0.84), rgba(42, 16, 16, 0.9)) !important;
}

.alert-feed-watch {
  border-left-color: #e0a25a !important;
  background: linear-gradient(180deg, rgba(70, 46, 18, 0.8), rgba(44, 29, 12, 0.88)) !important;
}

.page-demo-sii {
  gap: 20px;
}

.demo-hero {
  padding: 28px 24px;
  border-color: #35558a;
  background:
    radial-gradient(ellipse 70% 80% at 10% 0%, rgba(80, 130, 220, 0.2), transparent 55%),
    linear-gradient(180deg, rgba(18, 32, 58, 0.95), rgba(10, 18, 32, 0.98));
}

.demo-hero-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8eb6ff;
}

.demo-hero-title {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-strong);
  max-width: 28ch;
}

.demo-hero-lead {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: #b8cbe8;
  max-width: 62ch;
}

.demo-hero-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #5d92ff, #4379ea);
  color: #f3f8ff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 10px 16px rgba(23, 65, 149, 0.3);
}

.button-link:hover {
  background: linear-gradient(180deg, #699cff, #4a7ff0);
  color: #fff;
  text-decoration: none;
}

.demo-steps {
  display: grid;
  gap: 14px;
}

.demo-step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px;
}

.demo-step-index {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #6b8fd4;
  border: 1px solid #3a5280;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  background: rgba(12, 22, 40, 0.9);
}

.demo-step-body h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: #f0f6ff;
}

.demo-bullet-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #b4c8e8;
  line-height: 1.55;
  font-size: 14px;
}

.demo-compare .compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.compare-card {
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #31486f;
}

.compare-before {
  background: linear-gradient(180deg, rgba(40, 28, 28, 0.45), rgba(14, 18, 28, 0.92));
  border-color: #5a3a3a;
}

.compare-after {
  background: linear-gradient(180deg, rgba(22, 40, 70, 0.55), rgba(12, 22, 40, 0.95));
  border-color: #3d6a9a;
}

.compare-card h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #e8f1ff;
}

.compare-list {
  margin: 0;
  padding-left: 18px;
  color: #b8cbe8;
  font-size: 13px;
  line-height: 1.55;
}

.control-center-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
  gap: 14px;
}

.signal-primary {
  border: 1px solid #3a507a;
  border-radius: 16px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(19, 34, 61, 0.78), rgba(14, 24, 44, 0.85));
  box-shadow: inset 0 1px 0 rgba(203, 220, 252, 0.06), var(--shadow-soft);
}

.signal-caption {
  margin: 0;
  color: #9ab3d9;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.signal-main-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.signal-state {
  margin: 0;
  font-size: clamp(1.34rem, 1rem + 1.4vw, 2rem);
  letter-spacing: -0.03em;
  font-weight: 760;
  color: #f3f8ff;
  text-transform: uppercase;
}

.signal-state[data-state="critical"] {
  color: #ffb4b4;
}

.signal-state[data-state="watch"] {
  color: #f5d7a8;
}

.signal-state[data-state="stable"] {
  color: #9ee8c4;
}

.signal-risk-wrap {
  margin-top: 14px;
}

.signal-label {
  display: block;
  margin-bottom: 6px;
  color: #8ea6cc;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.signal-risk {
  margin: 0;
  font-size: clamp(2.5rem, 2rem + 2.2vw, 4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #d0ddf4;
}

p.dashboard-risk-value.signal-risk {
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.35rem);
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.metric-risk[data-risk="LOW"] {
  color: var(--tone-stable);
}

.metric-risk[data-risk="MEDIUM"] {
  color: var(--tone-warn);
}

.metric-risk[data-risk="HIGH"] {
  color: var(--tone-critical);
}

.metric-risk[data-risk="UNKNOWN"] {
  color: #a8b8d0;
}

.signal-subline {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.signal-trend {
  margin: 0;
  color: #cfe0fc;
  font-size: 13px;
}

.signal-secondary {
  display: grid;
  gap: 10px;
}

.signal-meta-card {
  border: 1px solid #30445f;
  border-radius: 14px;
  padding: 14px 14px 13px;
  background: linear-gradient(180deg, rgba(16, 30, 53, 0.76), rgba(11, 22, 38, 0.84));
  box-shadow: var(--shadow-soft);
}

.signal-meta-label {
  margin: 0;
  color: #8ea6c9;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.signal-meta-value {
  margin: 8px 0 0;
  font-size: clamp(1.22rem, 1rem + 0.8vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #f2f7ff;
  font-weight: 720;
  word-break: break-word;
}

.signal-meta-value.compact {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.02rem, 0.9rem + 0.62vw, 1.3rem);
}

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

.metric-card {
  grid-column: span 2;
  margin: 0;
  border: 1px solid #2a3c5a;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(14, 27, 48, 0.93), rgba(10, 20, 35, 0.95));
  padding: 14px 15px;
  min-height: 112px;
  box-shadow: var(--shadow-soft);
}

.metric-card h3 {
  margin: 0;
  color: #9ab0d2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-value {
  margin: 10px 0 0;
  font-size: clamp(1.36rem, 1.14rem + 0.72vw, 1.95rem);
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #f4f8ff;
  word-break: break-word;
}

.metric-card.emphasis {
  grid-column: span 3;
  border-color: #35558a;
  background: linear-gradient(145deg, rgba(27, 49, 86, 0.75), rgba(15, 26, 44, 0.96));
}

.metric-card.emphasis .metric-value {
  font-size: clamp(1.52rem, 1.3rem + 1.02vw, 2.2rem);
}

.subtle-row {
  margin: 9px 0 0;
  color: #9ab0cf;
  font-size: 12px;
  font-weight: 500;
}

.operator-panel {
  border-color: #4266a3;
  background:
    linear-gradient(90deg, rgba(70, 110, 184, 0.14), transparent 32%),
    linear-gradient(145deg, rgba(29, 48, 83, 0.6), rgba(15, 24, 41, 0.95));
  box-shadow: 0 0 0 1px rgba(79, 130, 219, 0.18), var(--shadow);
}

.risk-explanation {
  margin-top: 12px;
  border: 1px solid #3a5683;
  border-radius: 12px;
  padding: 11px 12px;
  background:
    linear-gradient(90deg, rgba(74, 118, 196, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(20, 35, 61, 0.72), rgba(12, 23, 40, 0.94));
}

.risk-explanation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.risk-explanation h4 {
  margin: 0;
  font-size: 13px;
  color: #e8f1ff;
}

.operator-message {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.72;
  color: #e1ecff;
  max-width: 92ch;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #d2def5;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #334b72;
  background: #0c182e;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #7f95b8;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: #4d7fd4;
  box-shadow: 0 0 0 3px rgba(95, 143, 225, 0.2);
}

textarea {
  resize: vertical;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  background: linear-gradient(180deg, #5d92ff, #4379ea);
  color: #f3f8ff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  box-shadow: 0 10px 16px rgba(23, 65, 149, 0.3);
}

button:hover {
  background: linear-gradient(180deg, #699cff, #4a7ff0);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  border-color: #395177;
  background: linear-gradient(180deg, #1e314f, #17263f);
  box-shadow: none;
}

button.secondary:hover {
  background: linear-gradient(180deg, #23385b, #1c2d49);
}

button.small {
  padding: 6px 10px;
  font-size: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row.wrap {
  flex-wrap: wrap;
}

input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #5d92ff;
  box-shadow: none;
}

input[type="file"] {
  padding: 7px 8px;
}

.filters {
  margin-bottom: 12px;
}

.filters input,
.filters select {
  max-width: 320px;
}

.tenant-filters {
  align-items: end;
}

.tenant-filters input {
  min-width: 170px;
}

.table-wrap {
  border: 1px solid #2c415f;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(11, 20, 37, 0.96), rgba(8, 16, 29, 0.98));
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid rgba(47, 66, 98, 0.78);
  padding: 11px 10px;
  vertical-align: middle;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #112039;
  color: #9db3d4;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  white-space: nowrap;
}

.data-table tbody tr {
  background: transparent;
  transition: background-color 120ms ease;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(20, 34, 59, 0.34);
}

.data-table tbody tr:hover {
  background: rgba(83, 126, 200, 0.17);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td a {
  font-weight: 600;
}

.data-table td:nth-child(5),
.data-table td:nth-child(6),
.data-table td:nth-child(7),
.data-table td:nth-child(8),
.data-table td:nth-child(9) {
  font-variant-numeric: tabular-nums;
}

.dashboard-results-table td:nth-child(5),
.dashboard-results-table td:nth-child(6),
.run-results-table td:nth-child(7),
.run-results-table td:nth-child(8),
.runs-table td:nth-child(4) {
  text-align: right;
}

.dashboard-results-table th:nth-child(5),
.dashboard-results-table th:nth-child(6),
.run-results-table th:nth-child(7),
.run-results-table th:nth-child(8),
.runs-table th:nth-child(4) {
  text-align: right;
}

.data-table td:nth-child(4) .badge-risk-high,
.data-table td:nth-child(6) .badge-risk-high {
  box-shadow: 0 0 0 1px rgba(188, 47, 47, 0.35), 0 0 18px rgba(188, 47, 47, 0.28);
}

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

.signal-card {
  border: 1px solid #31486f;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(16, 28, 49, 0.9), rgba(11, 21, 37, 0.95));
  box-shadow: var(--shadow-soft);
}

.signal-card .k {
  display: block;
  color: #8ea6c9;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.signal-card .v {
  margin-top: 6px;
  font-size: 15px;
  color: #eff6ff;
  font-weight: 700;
  line-height: 1.3;
}

.signal-card.state .v {
  color: #d7e6ff;
}

.signal-card.risk .v .badge {
  font-size: 11px;
  padding: 5px 10px;
}

.signal-card.trend .v {
  color: #d1e0f9;
}

.run-signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.signal-chip {
  border: 1px solid #324a74;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(16, 29, 51, 0.9), rgba(11, 21, 37, 0.95));
  box-shadow: var(--shadow-soft);
}

.signal-chip .k {
  display: block;
  color: #8ea6c9;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.signal-chip .v {
  margin-top: 6px;
  color: #edf5ff;
  font-weight: 700;
}

.timeline-transition-strip {
  margin: 0 0 10px;
  border: 1px solid #3b5682;
  border-radius: 10px;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(19, 33, 57, 0.88), rgba(12, 22, 39, 0.92));
  color: #d7e6ff;
  font-size: 12px;
}

.timeline-transition-strip strong {
  color: #f2f7ff;
}

.timeline-transition-strip.high {
  border-color: #9a4343;
  background: linear-gradient(180deg, rgba(66, 22, 22, 0.84), rgba(41, 15, 15, 0.9));
  color: #ffd8d8;
}

.timeline-transition-strip.watch {
  border-color: #a27335;
  background: linear-gradient(180deg, rgba(74, 49, 19, 0.82), rgba(49, 31, 12, 0.9));
  color: #ffe3c0;
}

.timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.empty-state {
  border: 1px dashed #38517b;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(21, 36, 65, 0.5), rgba(14, 26, 47, 0.58));
  color: #ccddf7;
  margin-bottom: 10px;
}

.empty-state p {
  margin: 0 0 8px;
}

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

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

.chart-panel {
  border: 1px solid #31486f;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(14, 26, 47, 0.93), rgba(10, 19, 35, 0.93));
  padding: 12px 12px 20px;
  min-height: 380px;
  height: 400px;
  box-sizing: border-box;
}

.chart-panel h4 {
  margin: 0 0 10px;
  font-size: 12px;
  color: #9db2d1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-panel canvas {
  display: block;
  width: 100% !important;
  height: calc(100% - 38px) !important;
  min-height: 300px;
}

.timeline-item {
  border: 1px solid #2d4267;
  border-radius: 12px;
  padding: 10px 11px;
  background: linear-gradient(180deg, rgba(14, 26, 47, 0.92), rgba(10, 19, 35, 0.94));
  display: grid;
  gap: 7px;
}

.timeline-item.timeline-critical {
  border-color: #9a4343;
  box-shadow: inset 0 0 0 1px rgba(183, 74, 74, 0.34), 0 0 0 1px rgba(183, 74, 74, 0.12);
}

.timeline-item.timeline-watch {
  border-color: #8b6130;
  box-shadow: inset 0 0 0 1px rgba(185, 131, 67, 0.32), 0 0 0 1px rgba(185, 131, 67, 0.1);
}

.timeline-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-state {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3b5682;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  color: #d8e6ff;
  background: rgba(16, 30, 52, 0.9);
}

.timeline-trend-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3b5682;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  color: #d2e1f8;
  background: rgba(16, 30, 52, 0.9);
}

.timeline-transition {
  font-size: 11px;
  color: #c9dcff;
}

.timeline-critical .timeline-transition {
  color: #ffd0d0;
}

.timeline-watch .timeline-transition {
  color: #ffdfb6;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #80a8eb;
  box-shadow: 0 0 0 4px rgba(89, 132, 213, 0.18);
  display: inline-block;
  margin-right: 6px;
}

.timeline-phase {
  font-size: 13px;
  font-weight: 700;
}

.timeline-meta {
  font-size: 12px;
  color: var(--muted);
}

.result-row-normal td {
  background: transparent;
}

.result-row-watch td {
  background: rgba(84, 57, 24, 0.2);
}

.result-row-critical td {
  background: rgba(90, 28, 28, 0.22);
}

.state-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #39527a;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.state-pill-stable {
  border-color: #2e8057;
  color: #c8f4dc;
  background: rgba(19, 64, 42, 0.65);
}

.state-pill-watch {
  border-color: #9f6627;
  color: #ffe3bc;
  background: rgba(79, 49, 15, 0.68);
}

.state-pill-critical {
  border-color: #bf3d3d;
  color: #ffd6d6;
  background: rgba(84, 25, 25, 0.72);
}

.state-pill-unknown {
  border-color: #3b4c69;
  color: #c9d7f0;
  background: #1a253a;
}

.trend-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a537c;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  color: #d2e2fa;
  background: rgba(15, 29, 51, 0.9);
}

.row-transition {
  margin-top: 6px;
  font-size: 11px;
}

.row-transition-normal {
  color: #a8bbdc;
}

.row-transition-watch {
  color: #ffdfb6;
}

.row-transition-critical {
  color: #ffd0d0;
}

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

.messages li {
  border: 1px solid #31476b;
  border-left: 3px solid #5384df;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(16, 30, 55, 0.85), rgba(12, 24, 43, 0.9));
  font-size: 13px;
}

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

.alerts-list li {
  border: 1px solid #31476b;
  border-left: 3px solid #5f88dd;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(17, 31, 54, 0.88), rgba(12, 24, 42, 0.94));
  font-size: 13px;
}

.alert-item-critical {
  border-left-color: #d45c5c !important;
  background: linear-gradient(180deg, rgba(66, 22, 22, 0.84), rgba(42, 16, 16, 0.9)) !important;
}

.alert-item-high {
  border-left-color: #e0a25a !important;
  background: linear-gradient(180deg, rgba(70, 46, 18, 0.8), rgba(44, 29, 12, 0.88)) !important;
}

.alert-item-info {
  border-left-color: #6c93de !important;
}

.alert-head {
  color: #97abca;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.message-item-critical {
  border-left-color: #d45c5c !important;
  background: linear-gradient(180deg, rgba(66, 22, 22, 0.84), rgba(42, 16, 16, 0.9)) !important;
}

.message-item-watch {
  border-left-color: #e0a25a !important;
  background: linear-gradient(180deg, rgba(70, 46, 18, 0.8), rgba(44, 29, 12, 0.88)) !important;
}

.message-item-normal {
  border-left-color: #4f7fd8 !important;
}

.demo-playback {
  margin: 0 0 12px;
  border: 1px solid #3a5680;
  border-radius: 12px;
  padding: 10px 11px;
  background: linear-gradient(180deg, rgba(19, 34, 58, 0.86), rgba(13, 24, 42, 0.92));
}

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

.demo-playback strong {
  color: #eef5ff;
  font-size: 13px;
}

.demo-key-events {
  margin: 0 0 12px;
  border: 1px solid #36527a;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(18, 32, 56, 0.86), rgba(12, 22, 39, 0.92));
}

.demo-key-events .panel-header {
  margin-bottom: 8px;
}

.demo-key-events h4 {
  margin: 0;
  font-size: 13px;
  color: #ecf4ff;
}

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

.demo-key-event {
  border: 1px solid #36527a;
  border-left: 3px solid #4e82de;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(12, 22, 40, 0.9);
  font-size: 12px;
  color: #d9e7fd;
  opacity: 0.75;
}

.demo-key-event.reached {
  opacity: 1;
}

.demo-key-event.watch {
  border-left-color: #e0a25a;
}

.demo-key-event.critical {
  border-left-color: #d35a5a;
}

.message-item .msg-head {
  color: #97abca;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.message-item .msg-subtle {
  margin-top: 6px;
  color: #9eb2d1;
  font-size: 11px;
}

.range-controls {
  display: flex;
  gap: 6px;
}

.range-controls button {
  border-color: #3a537e;
  background: linear-gradient(180deg, #172742, #13223a);
  box-shadow: none;
}

.range-controls button.active {
  border-color: #4f7ad1;
  background: linear-gradient(180deg, #3764b9, #2a4f95);
}

.geometry-panel {
  border-color: rgba(54, 82, 123, 0.95);
  background:
    radial-gradient(circle at 88% 10%, rgba(90, 132, 212, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(15, 27, 48, 0.94), rgba(10, 20, 36, 0.98));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 48px rgba(0, 0, 0, 0.35);
}

.geometry-models-panel .panel-header h3 {
  margin-bottom: 4px;
}

.geometry-models-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .geometry-models-columns {
    grid-template-columns: 1fr;
  }
}

.geometry-model-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #d6e4ff;
}

.geometry-model-dl {
  margin: 0;
  display: grid;
  gap: 6px 12px;
}

.geometry-model-dl > div {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgba(86, 126, 196, 0.18);
}

.geometry-model-dl > div:last-child {
  border-bottom: none;
}

.geometry-model-dl dt {
  margin: 0;
  font-size: 12px;
  color: #9bb4dc;
  font-weight: 500;
}

.geometry-model-dl dd {
  margin: 0;
  font-size: 13px;
  color: #e8f0ff;
  word-break: break-word;
}

.geometry-model-empty {
  margin: 0;
}

.geometry-subtitle {
  margin: 0;
}

.geometry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(248px, 292px);
  gap: 12px;
  align-items: stretch;
}

.geometry-canvas-wrap {
  position: relative;
  height: clamp(340px, 56vh, 520px);
  min-height: 340px;
  border: 1px solid rgba(48, 69, 100, 0.95);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 16%, rgba(93, 136, 218, 0.22), transparent 42%),
    radial-gradient(circle at 84% 80%, rgba(77, 126, 204, 0.16), transparent 48%),
    linear-gradient(180deg, #0a1425, #081120);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 20px 56px rgba(0, 0, 0, 0.42);
}

.geometry-canvas-wrap--flow {
  border-color: rgba(45, 212, 191, 0.28);
  background:
    radial-gradient(ellipse 92% 58% at 50% 36%, rgba(34, 180, 200, 0.16), transparent 56%),
    radial-gradient(circle at 12% 88%, rgba(56, 120, 220, 0.12), transparent 40%),
    linear-gradient(165deg, #070f1c 0%, #050a12 100%);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.geometry-meta-flow {
  font-size: 11px;
  line-height: 1.45;
  color: #8fa6c4;
  max-width: 58ch;
  margin-top: 2px;
}

.geometry-metric-definitions {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(48, 71, 102, 0.45);
  font-size: 10px;
  line-height: 1.5;
  color: #7a92b8;
  max-width: 62ch;
}

.geometry-details--flow {
  align-content: start;
}

/* Compact legend under Structural flow title (field colors + arrow). */
.geometry-flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.35;
  color: #8ea6c8;
}

.geometry-flow-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.geometry-flow-legend--compact {
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 1px solid rgba(48, 71, 102, 0.45);
  border-radius: 8px;
  background: rgba(6, 12, 22, 0.35);
}

.geometry-flow-legend__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.geometry-flow-legend__swatch--cyan {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.85), rgba(56, 189, 248, 0.55));
  border: 1px solid rgba(94, 234, 212, 0.45);
}

.geometry-flow-legend__swatch--amber {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.75), rgba(249, 115, 22, 0.65));
  border: 1px solid rgba(251, 146, 60, 0.5);
}

.geometry-flow-legend__swatch--red {
  background: rgba(239, 68, 68, 0.75);
  border: 1px solid rgba(248, 113, 113, 0.55);
}

.geometry-flow-legend__swatch--arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid rgba(56, 189, 248, 0.95);
  border-radius: 0;
  background: none;
  border-top: none;
}

.geometry-flow-playback {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

.geometry-flow-playback__modes {
  display: inline-flex;
  gap: 6px;
}

.flow-mode-btn {
  border: 1px solid rgba(71, 85, 105, 0.9);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.flow-mode-btn.active {
  border-color: rgba(56, 189, 248, 0.58);
  background: rgba(14, 116, 144, 0.26);
  color: #d8f4ff;
}

.geometry-flow-playback__speed,
.geometry-flow-playback__history {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #9fb7d6;
}

.geometry-flow-playback__speed select {
  background: rgba(8, 17, 32, 0.95);
  color: #dbeafe;
  border: 1px solid rgba(71, 85, 105, 0.85);
  border-radius: 8px;
  font-size: 11px;
  padding: 4px 6px;
}

.geometry-flow-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.geometry-flow-metric {
  padding: 7px 8px 8px;
  border-radius: 10px;
  border: 1px solid rgba(48, 71, 102, 0.75);
  background: rgba(0, 0, 0, 0.2);
  min-width: 0;
}

.geometry-flow-metric .metric-k {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8ea6c8;
}

.geometry-flow-metric__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}

.geometry-flow-metric__value {
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: #e2e8f0;
}

.geometry-flow-metric__hint {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  flex-shrink: 0;
}

.geometry-flow-metric__sub {
  font-size: 10px;
  color: #7fb3c4;
  margin-top: 2px;
}

.geometry-flow-microbar {
  height: 3px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  margin-top: 6px;
  overflow: hidden;
}

.geometry-flow-microbar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.55), rgba(56, 189, 248, 0.85));
  width: 0%;
  transition: width 0.2s ease;
}

.geometry-details[data-geometry-risk="HIGH"] .geometry-flow-microbar__fill {
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.55), rgba(249, 115, 22, 0.85));
}

.geometry-details[data-geometry-risk="MEDIUM"] .geometry-flow-microbar__fill {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.45), rgba(45, 212, 191, 0.65));
}

.geometry-flow-manifold-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 10px;
  line-height: 1.45;
  color: #94a3b8;
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(6, 12, 22, 0.35);
  border: 1px solid rgba(48, 71, 102, 0.45);
}

.geometry-flow-manifold-line .metric-k {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7b8fad;
}

.geometry-flow-manifold-line__v {
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
}

.geometry-flow-manifold-line__sep {
  opacity: 0.35;
}

.geometry-flow-hero {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px 7px;
  border-radius: 12px;
  border: 1px solid rgba(45, 180, 200, 0.22);
  background: linear-gradient(150deg, rgba(10, 38, 48, 0.5), rgba(6, 14, 26, 0.94));
  margin-bottom: 6px;
}

.geometry-flow-status {
  font-size: 11px;
  font-weight: 650;
  color: #cbd5e1;
}

.geometry-flow-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7fb3c4;
}

.geometry-flow-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #b8f0e8;
  font-variant-numeric: tabular-nums;
}

.geometry-details[data-geometry-risk="HIGH"] .geometry-flow-value {
  color: #ffb8a8;
}

.geometry-details[data-geometry-risk="MEDIUM"] .geometry-flow-value {
  color: #ffd9a0;
}

.geometry-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 10px;
}

.geometry-flow-stat {
  padding: 8px 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(48, 71, 102, 0.85);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.geometry-flow-stat .metric-k {
  font-size: 9px;
}

.geometry-flow-stat .metric-v {
  font-size: 15px;
  font-weight: 750;
}

.geometry-flow-details {
  margin-top: 4px;
  border-radius: 10px;
  border: 1px solid rgba(48, 71, 102, 0.55);
  padding: 6px 10px 8px;
  background: rgba(6, 12, 22, 0.45);
}

.geometry-flow-details summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #8ea6c8;
  list-style: none;
}

.geometry-flow-details summary::-webkit-details-marker {
  display: none;
}

.geometry-kv--compact dt {
  font-size: 9px;
}

.geometry-kv--compact dd {
  font-size: 12px;
}

.geometry-legend--minimal:empty {
  display: none;
}

@media (max-width: 980px) {
  .geometry-flow-grid {
    grid-template-columns: 1fr;
  }
  .geometry-flow-metrics {
    grid-template-columns: 1fr;
  }
}

.geometry-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 200px;
}

.geometry-viewport.geometry-viewport--loading {
  background: linear-gradient(145deg, rgba(10, 18, 34, 0.98) 0%, rgba(6, 12, 24, 0.99) 100%);
}

.geometry-canvas-wrap.geometry-canvas-wrap--loading {
  position: relative;
}

.geometry-canvas-wrap.geometry-canvas-wrap--loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(45, 212, 191, 0.07) 50%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: geometry-flow-shimmer 1.15s ease-in-out infinite;
  opacity: 0.9;
}

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

#geometryCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.geometry-debug-label {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(86, 126, 196, 0.84);
  background: rgba(8, 16, 30, 0.72);
  color: #cbdcf9;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
}

.geometry-status {
  margin: 0;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: #cfdcf5;
  background: rgba(8, 16, 30, 0.82);
  z-index: 2;
}

.geometry-status.warn {
  color: #ffe1ad;
}

.geometry-status.error {
  color: #ffd4d4;
}

.geometry-status.hidden {
  display: none !important;
}

.geometry-status.info {
  color: #c9daf8;
}

.geometry-fallback.error {
  border-color: #9b3c3c;
  color: #ffd4d4;
  background: rgba(52, 14, 14, 0.72);
}

.geometry-fallback--info {
  border-color: var(--border-strong);
  color: #c8d4e8;
  background: rgba(10, 16, 28, 0.85);
}

.geometry-fallback--warn {
  border-color: rgba(232, 168, 74, 0.45);
  color: #f5e6c8;
  background: rgba(40, 32, 12, 0.55);
}

.geometry-run-metrics {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.2);
}

.geometry-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
}

.geometry-metric-row .metric-k {
  color: #8b9bb4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.geometry-metric-row .metric-v {
  color: var(--text-strong);
  font-weight: 600;
  text-align: right;
}

#geometryViewport.geometry-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.geometry-renderer-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.geometry-renderer-canvas.geometry-flow-2d {
  image-rendering: auto;
  touch-action: none;
}

.geometry-details {
  border: 1px solid #304766;
  border-radius: 12px;
  padding: 11px;
  background: linear-gradient(180deg, rgba(14, 24, 41, 0.92), rgba(10, 18, 32, 0.95));
  display: grid;
  gap: 10px;
}

.geometry-details h4 {
  margin: 0;
  color: #eff6ff;
  font-size: 14px;
}

.geometry-details dl {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.geometry-details dl > div {
  border-top: 1px solid rgba(56, 82, 121, 0.58);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}

.geometry-details dl > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.geometry-details dt {
  margin: 0;
  color: #8ea7cb;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.geometry-details dd {
  margin: 0;
  color: #f0f6ff;
  font-size: 13px;
  line-height: 1.42;
  word-break: break-word;
}

.geometry-projection-note {
  margin: 8px 0 0;
  color: #8fa5c7;
  font-size: 12px;
}

.geom-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.geom-detail-row span {
  color: #9ab1d3;
  font-size: 12px;
}

.geom-detail-row strong {
  color: #eff6ff;
  font-size: 12px;
}

.geom-detail-empty {
  color: #a9bfdc;
  font-size: 12px;
}

.geometry-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geometry-structure-note {
  margin: 0;
  color: #9cb2d5;
  font-size: 12px;
  line-height: 1.45;
}

.geom-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #38517b;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  color: #cfe0fa;
  background: rgba(13, 25, 45, 0.8);
}

.geom-pill-unstable {
  border-color: #a84c4c;
  color: #ffd9d9;
  background: rgba(62, 20, 20, 0.8);
}

#geometryCanvas.hidden {
  opacity: 0;
  pointer-events: none;
}

.geometry-node-unstable dd {
  color: #ffd8d8;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid #3a4e6f;
}

.badge-risk-low {
  background: rgba(17, 58, 39, 0.76);
  border-color: #2d8156;
  color: #bcf4d2;
  box-shadow: 0 0 14px rgba(50, 154, 103, 0.18);
}

.badge-risk-medium {
  background: rgba(84, 51, 16, 0.76);
  border-color: #b97631;
  color: #ffe2b4;
  box-shadow: 0 0 14px rgba(201, 131, 54, 0.2);
}

.badge-risk-high {
  background: rgba(84, 25, 25, 0.78);
  border-color: #cd4242;
  color: #ffd6d6;
  box-shadow: 0 0 16px rgba(198, 57, 57, 0.34);
}

.badge-risk-unknown {
  background: #1a253a;
  border-color: #3b4c69;
  color: #c9d7f0;
}

.badge-phase {
  background: rgba(27, 40, 62, 0.88);
  border-color: #405777;
  color: #d8e4f9;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
}

.badge-phase-stable {
  background: rgba(19, 61, 42, 0.8);
  border-color: #2b8056;
  color: #c2f5d8;
}

.badge-phase-watch,
.badge-phase-drift {
  background: #50310e;
  border-color: #9f6627;
  color: #ffdfab;
}

.badge-phase-alert,
.badge-phase-unstable {
  background: rgba(84, 25, 25, 0.8);
  border-color: #bf3d3d;
  color: #ffd5d5;
}

#metricRisk {
  color: #f2f7ff;
}

.signal-risk[data-risk="HIGH"],
#metricRisk[data-risk="HIGH"] {
  color: #ffd3d3;
  text-shadow: 0 0 12px rgba(227, 91, 91, 0.5), 0 0 34px rgba(214, 65, 65, 0.32);
}

.signal-risk[data-risk="MEDIUM"],
#metricRisk[data-risk="MEDIUM"] {
  color: #ffe3bf;
  text-shadow: 0 0 10px rgba(255, 179, 83, 0.36), 0 0 24px rgba(244, 160, 61, 0.24);
}

.signal-risk[data-risk="LOW"],
#metricRisk[data-risk="LOW"] {
  color: #c7f4d9;
  text-shadow: 0 0 9px rgba(101, 205, 151, 0.3), 0 0 22px rgba(76, 181, 129, 0.22);
}

.upload-panel {
  max-width: 840px;
}

.upload-dropzone {
  border: 1.5px dashed #3f5b86;
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(17, 32, 56, 0.58), rgba(12, 23, 41, 0.68));
  display: grid;
  gap: 8px;
}

.upload-dropzone.dragging {
  border-color: #6ea3ff;
  background: linear-gradient(180deg, rgba(28, 52, 88, 0.75), rgba(20, 37, 63, 0.84));
}

.upload-dropzone input[type="file"] {
  display: block;
}

.upload-cta {
  font-weight: 700;
  color: #e7f0ff;
}

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

.upload-file-name {
  font-size: 13px;
  color: #cae0ff;
}

.upload-progress {
  border: 1px solid #35517b;
  border-radius: 12px;
  padding: 11px;
  background: linear-gradient(180deg, rgba(15, 30, 52, 0.85), rgba(11, 22, 40, 0.9));
  display: grid;
  gap: 8px;
}

.upload-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d8e6ff;
}

.upload-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #345179;
  background: #0a1527;
  overflow: hidden;
}

.upload-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f8cff, #79abff);
  transition: width 180ms ease;
}

.upload-progress-errors {
  margin: 0;
  padding-left: 17px;
  color: #ffd2d2;
  font-size: 12px;
  display: grid;
  gap: 4px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.result-field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel-2);
}

.result-field .k {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.result-field .v {
  margin-top: 4px;
  font-size: 14px;
}

.toast-container {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 70;
  display: grid;
  gap: 8px;
  max-width: calc(100vw - 28px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}

.toast {
  min-width: 250px;
  max-width: 360px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid #38598f;
  background: linear-gradient(180deg, rgba(35, 62, 111, 0.95), rgba(23, 43, 78, 0.95));
  color: #e1ecff;
  box-shadow: 0 20px 30px rgba(4, 11, 24, 0.52);
}

.toast.success {
  background: linear-gradient(180deg, rgba(15, 63, 39, 0.95), rgba(11, 49, 31, 0.95));
  border-color: #27744b;
  color: #cff8df;
}

.toast.error {
  background: linear-gradient(180deg, rgba(77, 20, 20, 0.94), rgba(58, 14, 14, 0.95));
  border-color: #a13333;
  color: #ffd4d4;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 9, 18, 0.62);
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}

.loading-card {
  min-width: 240px;
  text-align: center;
  border: 1px solid #32496f;
  background: linear-gradient(180deg, rgba(22, 39, 67, 0.94), rgba(16, 30, 51, 0.96));
  border-radius: 14px;
  padding: 20px 16px;
  box-shadow: 0 20px 34px rgba(3, 8, 18, 0.5);
}

.spinner {
  margin: 0 auto 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(158, 185, 227, 0.32);
  border-top-color: #90b8ff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .control-center-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-score-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-compare .compare-grid {
    grid-template-columns: 1fr;
  }

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

  .metric-card,
  .metric-card.emphasis {
    grid-column: span 2;
  }

  .filters input,
  .filters select {
    max-width: 100%;
  }
}

@media (max-width: 980px) {
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(2, 6, 14, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .nav-backdrop:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 40;
    align-self: stretch;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    padding: max(14px, env(safe-area-inset-top, 0px)) 14px max(18px, env(safe-area-inset-bottom, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, rgba(10, 18, 33, 0.98), rgba(8, 13, 24, 0.99));
    box-shadow: 12px 0 40px rgba(1, 4, 11, 0.55);
    transform: translateX(-104%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .nav {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
    display: flex;
    flex-wrap: wrap;
  }

  .nav-section-title {
    display: none;
  }

  .nav a {
    display: inline-flex;
    width: auto;
    min-height: 44px;
    align-items: center;
  }

  .topbar {
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
  }

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

  .metric-card,
  .metric-card.emphasis {
    grid-column: auto;
  }

  .signal-risk {
    font-size: clamp(2.22rem, 1.8rem + 1.8vw, 3.3rem);
  }

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

  .geometry-layout {
    grid-template-columns: 1fr;
  }

  .geometry-canvas-wrap,
  .geometry-fallback {
    min-height: 300px;
  }

  .geometry-canvas-wrap {
    height: clamp(280px, 48vh, 420px);
  }
}

@media (max-width: 740px) {
  .content {
    padding: 12px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .topbar {
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: var(--layout-stack-gap);
  }

  .topbar .title-block {
    flex: 1;
    min-width: 0;
  }

  .topbar-main {
    width: 100%;
  }

  .topbar-actions,
  .topbar-controls {
    width: 100%;
    flex-basis: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions button,
  .topbar-controls button,
  .tenant-filters .demo-toggle {
    min-height: 44px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .panel-actions button {
    flex: 1 1 auto;
  }

  .panel {
    padding: 13px;
    border-radius: 14px;
  }

  .control-center {
    padding: 14px;
  }

  .signal-primary {
    padding: 14px 14px 12px;
  }

  .signal-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-meta-card {
    padding: 12px;
  }

  .summary-grid {
    gap: 10px;
  }

  .metric-card {
    padding: 12px;
    min-height: 96px;
  }

  .table-wrap {
    margin: 0 -4px;
  }

  .data-table {
    min-width: 740px;
  }

  .range-controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .filters {
    display: grid;
    gap: 8px;
  }

  .filters input,
  .filters select {
    max-width: 100%;
  }

  .geometry-canvas-wrap,
  .geometry-fallback {
    min-height: 270px;
  }

  .geometry-canvas-wrap {
    height: min(60vh, 360px);
  }

  .geometry-details {
    padding: 10px;
  }
}

@media (max-width: 520px) {
  .control-center-grid {
    gap: 10px;
  }

  .signal-main-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .signal-risk {
    font-size: clamp(2.08rem, 1.82rem + 1.7vw, 2.7rem);
  }

  .signal-secondary {
    grid-template-columns: 1fr;
  }

  .signal-meta-card {
    padding: 10px 11px;
  }

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

  .metric-card,
  .metric-card.emphasis {
    min-height: 0;
  }

  .brand {
    padding: 10px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
  }

  .chart-panel {
    min-height: 300px;
    height: 320px;
  }

  .chart-panel canvas {
    min-height: 200px;
  }

  .geometry-layout {
    gap: 10px;
  }

  .geometry-canvas-wrap {
    min-height: 300px;
    height: min(58vh, 340px);
  }

  .geometry-details--flow {
    padding: 8px 8px 10px;
  }

  .geometry-flow-grid {
    gap: 5px;
  }

  .geometry-flow-stat {
    padding: 6px 6px 7px;
  }
}

/* —— Demo: compact strip + one button (keep UI calm) —— */

.dashboard-demo-hero {
  border: 1px solid var(--border-strong);
  background: var(--panel-soft);
  margin-bottom: var(--layout-stack-gap);
  padding: 12px 16px;
}

.dashboard-demo-hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-demo-hero-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
}

.dashboard-demo-hero-sub {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.btn-hero-demo {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0a1020;
  background: linear-gradient(135deg, #5eead4 0%, #3d8ae8 100%);
  box-shadow: 0 4px 16px rgba(61, 138, 232, 0.25);
}

.btn-hero-demo:hover {
  filter: brightness(1.06);
}

.mono-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: #b8cff7;
}

.run-detail-demo-hero {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #3d5a8a;
  background: linear-gradient(135deg, rgba(30, 70, 120, 0.35), rgba(12, 22, 42, 0.95));
}

.run-detail-demo-hero-card h3 {
  margin: 4px 0 8px;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.run-detail-demo-hero-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8eb7f0;
}

.run-current-state {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 28, 48, 0.92), rgba(10, 18, 32, 0.96));
}

.run-current-state-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.run-current-state-head strong {
  font-size: 13px;
  color: #e8f0ff;
}

.run-current-state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .run-current-state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mini-gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-gauge-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mini-gauge-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(80, 100, 130, 0.25);
  overflow: hidden;
}

.mini-gauge-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 0.35s ease;
}

.mini-gauge-fill-drift {
  background: linear-gradient(90deg, #4e82de, #79abff);
}

.mini-gauge-fill-inst {
  background: linear-gradient(90deg, #c98a3a, #ffbf56);
}

.mini-gauge-fill-risk {
  background: linear-gradient(90deg, #3ec9a8, #e8a84a, #e85c5c);
}

.mini-gauge-fill-health {
  background: linear-gradient(90deg, #2a6d5a, #3ec9a8);
}

.mini-gauge-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
}

.run-current-state[data-risk="HIGH"] {
  border-color: rgba(232, 92, 92, 0.45);
}

.demo-playback-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-playback-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(62, 201, 168, 0.2);
  border: 1px solid rgba(62, 201, 168, 0.45);
  color: #9cf0dc;
}

.demo-playback-bar-wrap {
  height: 6px;
  border-radius: 999px;
  background: rgba(60, 80, 110, 0.35);
  overflow: hidden;
  margin: 6px 0 8px;
}

.demo-playback-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4e82de, #79abff, #e8a84a);
  transition: width 0.35s ease;
}

.demo-playback-narration {
  margin: 0 0 12px;
  min-height: 2.6em;
  color: #b8cff7;
}

.upload-dropzone-highlight {
  outline: 2px solid #5eead4;
  outline-offset: 4px;
  border-radius: 12px;
  animation: uploadPulse 1.1s ease-in-out 2;
}

@keyframes uploadPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.35);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(94, 234, 212, 0.08);
  }
}

.result-row-latest td {
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.35);
  background: rgba(20, 55, 48, 0.22);
}

.result-row-risk-HIGH td:nth-child(6) {
  background: rgba(120, 36, 36, 0.24);
}

.result-row-risk-MEDIUM td:nth-child(6) {
  background: rgba(100, 65, 22, 0.22);
}

.result-row-risk-LOW td:nth-child(6) {
  background: rgba(22, 72, 52, 0.2);
}

.result-row-risk-UNKNOWN td:nth-child(6) {
  background: rgba(40, 55, 70, 0.15);
}

body.demo-mode-active .chart-panel {
  position: relative;
}

body.demo-mode-active .chart-panel::after {
  content: "DEMO SCENARIO";
  position: absolute;
  pointer-events: none;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.06);
  transform: rotate(-12deg);
  z-index: 0;
}

body.demo-mode-active .chart-panel canvas {
  position: relative;
  z-index: 1;
}

body.demo-mode-active .chart-panel h4 {
  position: relative;
  z-index: 1;
}

body.demo-mode-active #phaseTimeline {
  position: relative;
}

body.demo-mode-active #phaseTimeline::before {
  content: "DEMO SCENARIO";
  position: absolute;
  pointer-events: none;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) rotate(-10deg);
  font-size: clamp(20px, 3.5vw, 36px);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.05);
  z-index: 0;
}

body.demo-mode-active #phaseTimeline .timeline-item {
  position: relative;
  z-index: 1;
}

/* CSV semantic mapping (upload) */
.csv-mapping-panel {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(14, 26, 46, 0.95), rgba(8, 14, 26, 0.98));
}

.csv-mapping-panel h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-strong);
}

.csv-mapping-messages {
  margin: 0 0 10px 18px;
  padding: 0;
  color: var(--tone-warn);
  font-size: 13px;
}

.csv-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.csv-mapping-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.csv-mapping-field select {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.csv-mapping-sensors {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.csv-mapping-sensors legend {
  font-size: 12px;
  color: var(--muted);
  padding: 0 6px;
}

.csv-mapping-sensor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.csv-sensor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #3a537c;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  background: rgba(12, 22, 40, 0.85);
}

.csv-sensor-chip input {
  margin: 0;
}

/* ==== Premium dashboard refresh ==== */
:root {
  --lux-grad-a: #091227;
  --lux-grad-b: #05070f;
  --glass-bg: rgba(18, 27, 46, 0.56);
  --glass-border: rgba(133, 168, 255, 0.18);
  --glow-blue: rgba(77, 139, 255, 0.35);
  --glow-purple: rgba(132, 96, 255, 0.26);
}

body {
  background:
    radial-gradient(1200px 650px at 20% -15%, rgba(78, 141, 255, 0.24), transparent 52%),
    radial-gradient(920px 520px at 85% -10%, rgba(150, 103, 255, 0.24), transparent 48%),
    linear-gradient(160deg, var(--lux-grad-a), var(--lux-grad-b));
}

.command-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(6, 12, 22, 0.9), rgba(7, 10, 18, 0.68));
  border-bottom: 1px solid rgba(105, 136, 201, 0.26);
}

.telemetry-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip { border: 1px solid var(--glass-border); background: rgba(20, 30, 50, 0.7); border-radius: 999px; padding: 6px 11px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.chip-live { color: #b2ffe8; }
.chip-demo { color: #ffe09f; }
.chip-offline { color: #ff9d9d; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4bf0b8; display: inline-block; margin-right: 6px; animation: liveBlink 1.2s ease-in-out infinite; }
.streaming { color: #b8ceff; animation: liveBlink 1s ease-in-out infinite; }
@keyframes liveBlink { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

.dashboard-grid-v2 {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  gap: 16px;
}

.sii-hero {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background:
    radial-gradient(70% 120% at 8% 0%, rgba(95, 151, 255, 0.18), transparent 52%),
    linear-gradient(160deg, rgba(13, 22, 38, 0.88), rgba(9, 14, 26, 0.82));
}

.sii-hero-kicker {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: #9fc2ff;
}

.sii-hero h3 {
  margin: 0;
  font-size: 1.18rem;
  color: #f3f8ff;
}

.sii-hero .subtitle {
  margin: 6px 0 0;
  max-width: 780px;
  color: #b9cceb;
}

.sii-hero-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
}

.control-stack { display: grid; gap: 10px; }
button, .button-link {
  border-radius: 12px;
  background: linear-gradient(135deg, #223f73, #1a2f59);
  border: 1px solid rgba(121, 164, 255, 0.35);
  transition: transform 140ms ease, box-shadow 220ms ease;
}
button:hover, .button-link:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(157,191,255,0.25), 0 8px 24px var(--glow-blue); }
button:active, .button-link:active { transform: translateY(1px) scale(0.99); }

.animated-ring::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(147, 179, 255, 0.24);
  animation: ringPulse 2.8s ease-out infinite;
}
@keyframes ringPulse { 0% { transform: scale(.92); opacity: .2; } 70% { transform: scale(1.06); opacity: .52; } 100% { transform: scale(1.12); opacity: 0; } }

.demo-progress-panel { margin-top: 10px; padding: 10px; border: 1px solid rgba(125,165,255,.24); border-radius: 12px; background: rgba(12,20,35,.7); }
.demo-progress-head { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #b6caf0; }
.demo-progress-track { height: 8px; border-radius: 999px; margin-top: 8px; background: rgba(90,130,210,.2); overflow: hidden; }
.demo-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #5e99ff, #8f72ff); transition: width 260ms ease; }

.intelligence-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.intel-metric { padding: 10px; border: 1px solid rgba(131,162,229,.2); border-radius: 10px; background: rgba(10,18,33,.58); }
.intel-metric p { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #9fb4da; }
.intel-metric strong { font-size: 1.15rem; color: #edf3ff; }
.intelligence-list { margin: 8px 0 0; padding-left: 18px; color: #cfddfb; }

.geometry-showcase { margin-top: 16px; }
#dashboardGeometryState.geometry-ready { color: #8effd7; }

.recommendation-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(129, 170, 255, 0.28);
  background: linear-gradient(180deg, rgba(13, 24, 42, 0.8), rgba(9, 17, 30, 0.78));
}

.recommendation-head {
  align-items: center;
  margin-bottom: 8px;
}

.recommendation-head h4 {
  margin: 0;
  letter-spacing: 0.01em;
}

.recommendation-primary {
  margin: 0 0 10px;
  color: #ecf3ff;
  font-weight: 600;
}

.recommendation-label {
  margin: 8px 0 3px;
  font-size: 11px;
  color: #9cb7df;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.recommendation-card .subtitle {
  margin: 0;
}

.sparkline-canvas-wrap canvas { transition: filter 220ms ease; }
.sparkline-canvas-wrap canvas:hover { filter: drop-shadow(0 0 14px rgba(100,148,255,.26)); }

@media (max-width: 1180px) {
  .dashboard-grid-v2 { grid-template-columns: 1fr; }
  .intelligence-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sii-hero {
    flex-direction: column;
  }
  .sii-hero-tags {
    justify-content: flex-start;
  }
}
@media (max-width: 720px) {
  .intelligence-grid { grid-template-columns: 1fr; }
  .sii-hero {
    padding: 14px;
  }
  .sii-hero h3 {
    font-size: 1.02rem;
  }
  .chip {
    padding: 8px 11px;
  }
  .recommendation-card {
    padding: 11px;
  }
}

/* ==== 2026 Q1 UI polish pass (dashboard/upload/runs/detail) ==== */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --panel-strong: rgba(11, 18, 31, 0.88);
  --panel-muted: rgba(13, 21, 36, 0.72);
  --border-soft: rgba(139, 167, 214, 0.2);
  --text-dim: #99adc9;
}

.content { padding: var(--space-6); gap: var(--space-6); }
.page { display: grid; gap: var(--space-6); }
.panel { border-radius: var(--radius-lg); padding: var(--space-5); background: linear-gradient(180deg, var(--panel-strong), var(--panel-muted)); }
.panel-header h3 { font-size: 1.1rem; letter-spacing: -0.01em; }
.subtitle { color: var(--text-dim); }

button,
.button-link {
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

button.primary,
#seedDemoBtn {
  background: linear-gradient(135deg, #4d8eff, #3968d8);
  border-color: rgba(153, 188, 255, 0.52);
  color: #f5f9ff;
  box-shadow: 0 8px 24px rgba(67, 122, 230, 0.4);
}

button.secondary {
  background: rgba(20, 33, 56, 0.85);
  border: 1px solid rgba(139, 169, 219, 0.33);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible,
label:focus-within {
  outline: 2px solid rgba(115, 167, 255, 0.92);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(72, 126, 225, 0.28);
}

.dashboard-grid-v2 { grid-template-columns: minmax(250px, .85fr) minmax(430px, 1.5fr) minmax(300px, 1fr); gap: var(--space-5); align-items: start; }
.control-panel { position: relative; }
.demo-toggle { background: rgba(15, 25, 43, 0.9); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 10px 12px; min-height: 44px; }
.demo-primary-btn { font-size: 0.95rem; }
.status-message-rail { border-radius: var(--radius-md); background: rgba(8, 14, 25, 0.68); border: 1px solid rgba(126, 157, 206, 0.18); }
.mission-panel { background: linear-gradient(172deg, rgba(17, 30, 51, 0.95), rgba(9, 15, 27, 0.85)); }
.dashboard-narrative-strip { border-left: 3px solid rgba(103, 148, 255, 0.65); padding-left: 10px; }
.intelligence-panel .intel-metric { border-radius: var(--radius-md); }

.filters {
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  background: rgba(9, 16, 28, 0.54);
  border: 1px solid rgba(121, 150, 195, 0.2);
  border-radius: var(--radius-md);
}
.filters input,
.filters select,
input,
select,
textarea {
  background: rgba(8, 14, 25, 0.84);
  border: 1px solid rgba(126, 157, 206, 0.34);
  border-radius: var(--radius-sm);
  color: var(--text);
  min-height: 40px;
}

.data-table thead th {
  background: rgba(83, 122, 186, 0.14);
  color: #dce8fb;
  font-size: 0.77rem;
  letter-spacing: 0.08em;
}
.data-table tbody tr:hover { background: rgba(66, 105, 170, 0.15); }
.data-table td { color: #d6e3f7; }

.upload-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-4); }
.upload-kicker { margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9dc2ff; }
.upload-head-chip { margin-top: 2px; }
.upload-dropzone {
  border: 1px dashed rgba(128, 170, 244, 0.7);
  background: linear-gradient(180deg, rgba(21, 35, 59, 0.74), rgba(14, 24, 40, 0.78));
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  min-height: 168px;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
}
.upload-dropzone-icon { font-size: 1.75rem; color: #a8c9ff; line-height: 1; }
.upload-cta { font-size: 1.05rem; font-weight: 700; color: #f0f6ff; }
.upload-hint { max-width: 720px; color: #abc2e6; }
.upload-file-name { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(126, 157, 206, 0.28); background: rgba(8, 14, 24, 0.72); }
.upload-dropzone.dragging { border-color: #95bfff; background: linear-gradient(180deg, rgba(35, 60, 98, 0.7), rgba(15, 25, 44, 0.85)); box-shadow: 0 0 0 3px rgba(84, 137, 244, 0.3); }

.csv-mapping-panel { border-radius: var(--radius-md); padding: var(--space-4); background: rgba(9, 15, 27, 0.76); border: 1px solid rgba(122, 155, 206, 0.26); }
.csv-mapping-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.csv-mapping-grid { gap: var(--space-3); }
.csv-mapping-field { font-size: 12px; font-weight: 600; color: #bdd1ee; }
.csv-mapping-sensors { border-radius: var(--radius-md); padding: 12px; background: rgba(8, 13, 24, 0.76); }
.csv-sensor-chip { padding: 7px 12px; border-color: rgba(118, 157, 222, 0.45); border-radius: 999px; }
.csv-sensor-chip:has(input:checked) { background: rgba(53, 92, 159, 0.4); border-color: rgba(137, 183, 255, 0.8); }
.upload-progress { border: 1px solid rgba(126, 157, 206, 0.3); border-radius: var(--radius-md); background: rgba(8, 14, 25, 0.8); padding: var(--space-4); }
.upload-progress-track { height: 10px; }

.chart-panel,
.run-current-state,
.timeline-item,
.messages li,
.risk-explanation {
  border-radius: var(--radius-md);
}
.messages li { background: rgba(11, 18, 31, 0.72); border: 1px solid rgba(119, 151, 202, 0.2); padding: 12px 14px; }
.mini-gauge-track { height: 10px; border-radius: 999px; background: rgba(87, 117, 170, 0.24); }
.mini-gauge-fill { border-radius: 999px; box-shadow: 0 0 10px rgba(84, 141, 255, 0.33); }

@media (max-width: 980px) {
  .content { padding: var(--space-4); }
  .panel { padding: var(--space-4); }
  .upload-head { flex-direction: column; }
}

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr; }
  .upload-dropzone { min-height: 152px; padding: var(--space-5) var(--space-4); }
  button, .button-link { min-height: 44px; }
}

/* ==== SII dashboard mission-control refinement (2026-03) ==== */
.command-topbar {
  padding: 10px 20px 12px;
}

.telemetry-title h2 {
  font-size: clamp(1.28rem, 1.05rem + 0.95vw, 1.72rem);
  letter-spacing: -0.02em;
}

.telemetry-title .subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #9db0cf;
}

.telemetry-status-strip {
  gap: 7px;
}

.sii-hero {
  margin-bottom: 10px;
  gap: 16px;
  padding: 16px 18px;
}

.sii-hero-copy {
  min-width: 0;
}

.sii-hero h3 {
  font-size: clamp(1.12rem, 0.98rem + 0.55vw, 1.34rem);
  line-height: 1.2;
}

.sii-hero .subtitle {
  margin-top: 8px;
  max-width: 72ch;
  color: #c2d3ec;
}

.sii-hero-tags .chip {
  letter-spacing: 0.05em;
  text-transform: none;
  font-weight: 600;
  background: rgba(16, 27, 46, 0.76);
}

.control-panel .panel-header {
  margin-bottom: 10px;
}

.control-panel .panel-header h3 {
  font-size: 1.03rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #c8dbff;
}

.control-stack {
  gap: 12px;
}

.demo-primary-btn {
  min-height: 54px;
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 30px rgba(75, 126, 232, 0.44);
}

.control-secondary-btn {
  min-height: 42px;
  font-size: 0.92rem;
  color: #c9daf6;
  background: rgba(17, 29, 48, 0.78);
}

.status-message-rail {
  margin-top: 12px;
  padding: 11px 12px;
}

.status-message-line {
  margin: 0;
  color: #d5e5ff;
  font-size: 0.9rem;
  font-weight: 500;
}

@media (max-width: 740px) {
  .command-topbar {
    padding: 10px 14px 11px;
  }

  .topbar-main {
    gap: 10px;
  }

  .telemetry-status-strip {
    gap: 6px;
  }

  .sii-hero {
    padding: 14px;
    gap: 12px;
  }

  .sii-hero .subtitle {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.48;
  }

  .control-panel {
    padding: 14px;
  }

  .demo-primary-btn {
    min-height: 56px;
    font-size: 1.02rem;
  }

  .control-secondary-btn {
    min-height: 44px;
  }

  .status-message-rail {
    margin-top: 10px;
  }
}
