:root {
  --bg: #0a111a;
  --surface: #0f1824;
  --surface-2: #131e2d;
  --line: #213246;
  --ink: #eaf2fb;
  --muted: #8da2b9;
  --accent: #ff6b2d;
  --approved: #2ec27e;
  --conditional: #f6b23f;
  --hold: #ff4b5c;
  --rail-left-width: 210px;
  --rail-right-width: 240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 107, 45, 0.09), transparent 40%),
    radial-gradient(circle at 88% 20%, rgba(46, 194, 126, 0.08), transparent 42%),
    linear-gradient(170deg, #090f17 0%, #071019 45%, #070d14 100%);
  overflow: hidden;
}

body.is-emergency-live {
  overflow: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(rgba(255, 255, 255, 0.24) 0.5px, transparent 0.5px);
  background-size: 2px 2px;
  mix-blend-mode: soft-light;
}

.app-grid {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  height: 100svh;
  display: grid;
  grid-template-columns: var(--rail-left-width) minmax(0, 1fr) var(--rail-right-width);
}

.is-approval-mode .app-grid {
  grid-template-columns: var(--rail-left-width) minmax(0, 1fr) var(--rail-right-width);
}

.rail {
  background: linear-gradient(180deg, rgba(19, 30, 45, 0.8), rgba(12, 20, 31, 0.94));
  border-right: 1px solid var(--line);
  padding: 1.3rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow: auto;
}

.rail-left {
  position: relative;
}

.rail-right {
  border-right: none;
  border-left: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(141, 162, 185, 0.15);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 45, 0.8);
  position: relative;
}

.brand-mark span {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 45, 0.8);
}

.brand-mark span:last-child {
  inset: 14px;
}

.label {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

h1 {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  letter-spacing: 0.09em;
}

.nav {
  display: grid;
  gap: 0.35rem;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 0.86rem;
  padding: 0.55rem 0.45rem;
  border-left: 2px solid transparent;
  transition: 220ms ease;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  border-left-color: var(--accent);
  background: rgba(255, 107, 45, 0.09);
}

.rail-section h2,
.strip-section h3 {
  margin: 0 0 0.62rem;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.approval-sidebar {
  display: none;
}

.approval-sidebar[hidden] {
  display: none !important;
}

.is-approval-mode .approval-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.is-approval-mode .live-ops-only {
  display: none;
}

.is-approval-mode .workspace {
  grid-column: auto;
  grid-row: auto;
}

.is-approval-mode .rail-left {
  position: relative;
  z-index: auto;
  top: auto;
  left: auto;
  width: auto;
  max-height: none;
  padding: 1.3rem 1.1rem;
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 30, 45, 0.8), rgba(12, 20, 31, 0.94));
  box-shadow: none;
  backdrop-filter: none;
  overflow: auto;
}

.is-approval-mode .rail-left .brand {
  display: flex;
}

.is-approval-mode .rail-left .nav {
  gap: 0.35rem;
}

.is-approval-mode .rail-left .nav-item {
  padding: 0.55rem 0.45rem;
  font-size: 0.86rem;
}

.is-approval-mode .rail-right {
  display: flex;
}

.is-approval-mode .approval-sidebar .approval-command-bar,
.is-approval-mode .approval-sidebar .approval-topline,
.is-approval-mode .approval-sidebar .approval-feed-panel,
.is-approval-mode .approval-sidebar .approval-directory-panel,
.is-approval-mode .approval-sidebar .approval-control-panel,
.is-approval-mode .approval-sidebar .approval-map-legend {
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(141, 162, 185, 0.14);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  animation: none;
}

.is-approval-mode .approval-sidebar .approval-command-bar,
.is-approval-mode .approval-sidebar .approval-topline,
.is-approval-mode .approval-sidebar .approval-feed-panel,
.is-approval-mode .approval-sidebar .approval-directory-panel,
.is-approval-mode .approval-sidebar .approval-control-panel,
.is-approval-mode .approval-sidebar .approval-map-legend {
  grid-column: auto;
  grid-row: auto;
}

.is-approval-mode .approval-sidebar .approval-command-bar {
  grid-template-columns: 1fr;
  gap: 0.68rem;
  padding: 0.72rem;
}

.is-approval-mode .approval-sidebar .approval-command-metrics {
  min-width: 0;
}

.is-approval-mode .approval-sidebar .approval-topline {
  grid-template-columns: 1fr;
  align-items: stretch;
  padding: 0.7rem;
}

.is-approval-mode .approval-sidebar .approval-timeline {
  min-width: 0;
  width: 100%;
}

.is-approval-mode .approval-sidebar .approval-feed-panel,
.is-approval-mode .approval-sidebar .approval-directory-panel,
.is-approval-mode .approval-sidebar .approval-control-panel {
  padding: 0.95rem 0 0;
}

.is-approval-mode .approval-sidebar .approval-control-panel {
  grid-template-rows: auto auto auto;
  align-content: start;
}

.is-approval-mode .approval-sidebar .approval-feed-list,
.is-approval-mode .approval-sidebar .approval-directory-list {
  max-height: min(34svh, 420px);
  overflow: auto;
}

.is-approval-mode .approval-sidebar .approval-segment-panel {
  max-height: none;
  overflow: visible;
}

.is-approval-mode .approval-sidebar .approval-map-legend {
  justify-content: flex-start;
  gap: 0.72rem;
  padding: 0.9rem 0 0;
}

.approval-plain-status {
  margin: 0 0 0.5rem;
  line-height: 1.45;
}

.line-list,
.feed-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-list li,
.feed-list li {
  border-bottom: 1px solid rgba(141, 162, 185, 0.14);
  padding: 0.58rem 0;
  font-size: 0.85rem;
}

.inspector-empty {
  margin: 0;
  padding: 0.2rem 0 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.inspector-list li {
  padding: 0.5rem 0;
}

.inspector-list li strong {
  display: block;
}

.inspector-list .mono {
  font-size: 0.75rem;
}

.emergency-list li {
  padding: 0.44rem 0;
}

.emergency-item {
  width: 100%;
  border: 1px solid rgba(255, 75, 92, 0.28);
  background: rgba(255, 75, 92, 0.1);
  color: var(--ink);
  text-align: left;
  padding: 0.48rem 0.52rem;
  font: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}

.emergency-item strong {
  color: #ff9ea8;
}

.emergency-item.is-active {
  border-color: rgba(255, 75, 92, 0.62);
  background: rgba(255, 75, 92, 0.2);
}

.emergency-details {
  margin-top: 0.58rem;
  border: 1px solid rgba(255, 75, 92, 0.42);
  background: rgba(255, 75, 92, 0.08);
  padding: 0.62rem 0.58rem;
}

.emergency-details h3 {
  margin: 0 0 0.36rem;
  font-size: 0.82rem;
  color: #ffc9cf;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.emergency-details p {
  margin: 0 0 0.34rem;
  line-height: 1.45;
}

.emergency-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.34rem;
}

#liveViewEmergencyActions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0 2rem 2rem;
}

#liveViewEmergencyActions[hidden] {
  display: none !important;
}

#liveViewEmergencyActions .emergency-action {
  padding: 1.2rem 1rem;
  font-size: 0.85rem;
  font-weight: bold;
  border-width: 2px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 75, 92, 0.1);
}

#liveViewEmergencyActions .emergency-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 75, 92, 0.3);
  background: rgba(255, 75, 92, 0.35);
}

.emergency-action {
  border: 1px solid rgba(255, 75, 92, 0.52);
  background: rgba(255, 75, 92, 0.16);
  color: #ffe5e9;
  font: inherit;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.4rem 0.44rem;
  cursor: pointer;
}

.emergency-action:hover {
  background: rgba(255, 75, 92, 0.24);
}

.emergency-action-live {
  border-color: rgba(255, 192, 91, 0.58);
  background: rgba(255, 192, 91, 0.12);
  color: #fff0cf;
}

.emergency-action-live:hover {
  background: rgba(255, 192, 91, 0.2);
}

.danger-list li {
  padding: 0.46rem 0;
}

.risk-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.18rem 0 0.28rem;
}

.risk-score {
  font-weight: 700;
}

.risk-bar {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(141, 162, 185, 0.18);
}

.risk-fill {
  display: block;
  height: 100%;
  width: var(--risk-fill, 0%);
  border-radius: 999px;
}

.risk-fill.status-approved {
  background: rgba(46, 194, 126, 0.95);
}

.risk-fill.status-conditional {
  background: rgba(246, 178, 63, 0.95);
}

.risk-fill.status-hold {
  background: rgba(255, 75, 92, 0.95);
}

.danger-chart {
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 170;
  display: block;
  margin-top: 0.58rem;
  border: 1px solid rgba(141, 162, 185, 0.22);
  background: rgba(8, 14, 22, 0.56);
}

.danger-gauge-base,
.danger-gauge-segment {
  fill: none;
  stroke-width: 16;
  stroke-linecap: butt;
}

.danger-gauge-base {
  stroke: rgba(141, 162, 185, 0.22);
}

.danger-gauge-segment.gauge-green {
  stroke: #2ec27e;
}

.danger-gauge-segment.gauge-yellow {
  stroke: #f6b23f;
}

.danger-gauge-segment.gauge-red {
  stroke: #ff4b5c;
}

.danger-needle {
  stroke-width: 3;
  stroke-linecap: round;
}

.danger-needle.status-approved {
  stroke: #2ec27e;
}

.danger-needle.status-conditional {
  stroke: #f6b23f;
}

.danger-needle.status-hold {
  stroke: #ff4b5c;
}

.danger-pivot {
  fill: #dfeaf8;
  stroke: rgba(10, 17, 26, 0.8);
  stroke-width: 1.2;
}

.danger-axis-label {
  fill: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-anchor: middle;
}

.danger-overall-label {
  fill: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-anchor: middle;
  text-transform: uppercase;
}

.danger-overall-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  text-anchor: middle;
}

.danger-overall-value.status-approved {
  fill: #2ec27e;
}

.danger-overall-value.status-conditional {
  fill: #f6b23f;
}

.danger-overall-value.status-hold {
  fill: #ff4b5c;
}

.danger-overall-state {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-anchor: middle;
  text-transform: uppercase;
}

.danger-overall-state.status-approved {
  fill: #2ec27e;
}

.danger-overall-state.status-conditional {
  fill: #f6b23f;
}

.danger-overall-state.status-hold {
  fill: #ff4b5c;
}

.line-list strong {
  font-size: 0.87rem;
  font-weight: 700;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0;
  font-size: 0.72rem;
}

.workspace {
  min-height: 100svh;
  position: relative;
}

.workspace-head {
  padding: 1.1rem 1.2rem 0.95rem;
  display: none;
}

.workspace-head h2 {
  margin: 0.3rem 0 0;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.1;
  max-width: 16ch;
}

.head-meta {
  text-align: right;
}

.map-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 460px;
}

.maplibregl-map {
  background: #dce6f2;
}

.maplibregl-canvas,
.maplibregl-canvas-container,
.maplibregl-marker {
  will-change: transform;
}

.hud-row {
  position: absolute;
  z-index: 550;
  left: 0.9rem;
  right: 0.9rem;
  display: grid;
  gap: 0.55rem;
  pointer-events: none;
}

.hud-row-top {
  top: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  animation: fadeDrop 700ms ease both;
}

.hud-row-bottom {
  bottom: 0.8rem;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  justify-content: start;
  background: rgba(10, 17, 26, 0.8);
  border: 1px solid rgba(141, 162, 185, 0.22);
  padding: 0.4rem 0.55rem;
}

.hud-row-bottom p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding-right: 0.7rem;
  border-right: 1px solid rgba(141, 162, 185, 0.2);
}

.hud-row-bottom p:last-child {
  border-right: 0;
  padding-right: 0;
}

.incident-chip {
  min-width: 32px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.24);
  color: #eef6ff;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  background: rgba(255, 255, 255, 0.06);
}

.incident-chip-police {
  border-color: rgba(110, 182, 255, 0.44);
  background: rgba(110, 182, 255, 0.18);
}

.incident-chip-accident {
  border-color: rgba(255, 109, 95, 0.46);
  background: rgba(255, 109, 95, 0.18);
}

.incident-chip-disruption {
  border-color: rgba(255, 179, 77, 0.44);
  background: rgba(255, 179, 77, 0.18);
}

.incident-chip-detour {
  border-color: rgba(98, 217, 166, 0.4);
  background: rgba(98, 217, 166, 0.16);
}

.emergency-notice {
  position: absolute;
  right: 1rem;
  bottom: 3.5rem;
  z-index: 700;
  max-width: min(420px, calc(100% - 2rem));
  border: 1px solid rgba(255, 75, 92, 0.72);
  background: rgba(31, 6, 10, 0.92);
  color: #ffdbe0;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.6rem 0.72rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  transform: translateY(6px);
  opacity: 0;
  transition: 220ms ease;
}

.emergency-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.map-emergency-card {
  position: absolute;
  z-index: 710;
  left: 1rem;
  bottom: 3.5rem;
  width: min(420px, calc(100% - 2rem));
  border: 1px solid rgba(255, 75, 92, 0.76);
  background:
    linear-gradient(180deg, rgba(37, 9, 14, 0.96), rgba(21, 6, 10, 0.94)),
    rgba(13, 4, 7, 0.85);
  color: #ffe6ea;
  padding: 0.62rem 0.7rem 0.68rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(8px);
  animation: riseIn 240ms ease both;
}

.map-emergency-card .label {
  color: #ffadb7;
}

.map-emergency-card h3 {
  margin: 0.14rem 0 0.4rem;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-emergency-card p {
  margin: 0 0 0.34rem;
  font-size: 0.77rem;
  line-height: 1.45;
}

.map-approval-card {
  position: absolute;
  z-index: 720;
  left: 1rem;
  bottom: 3.5rem;
  width: min(340px, calc(100% - 2rem));
  border: 1px solid rgba(141, 162, 185, 0.32);
  background:
    linear-gradient(180deg, rgba(8, 14, 23, 0.95), rgba(5, 10, 17, 0.94)),
    rgba(6, 11, 18, 0.9);
  color: #e9f3fe;
  padding: 0.58rem 0.62rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.map-approval-card h3 {
  margin: 0.12rem 0 0.24rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-approval-card p {
  margin: 0;
  line-height: 1.38;
  font-size: 0.72rem;
}

#approvalMapSignal {
  margin-top: 0.38rem;
  color: #afc5dc;
}

.map-approval-grid {
  margin-top: 0.42rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.34rem;
}

.map-approval-grid > div {
  border: 1px solid rgba(141, 162, 185, 0.18);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.34rem 0.4rem;
}

.map-approval-grid strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
}

.map-approval-actions {
  margin-top: 0.58rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

#approvalMapRecommendation {
  margin-top: 0.56rem;
  color: #dbe9f8;
}

#approvalMapWhy {
  margin-top: 0.28rem;
}

.map-approval-signal-list {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.4rem;
  max-height: 22svh;
  overflow: auto;
  padding-right: 0.1rem;
}

.map-approval-signal-list:empty {
  display: none;
}

.map-approval-signal-item {
  border: 1px solid rgba(141, 162, 185, 0.18);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.44rem 0.48rem;
}

.map-approval-signal-item strong {
  display: block;
  font-size: 0.75rem;
  line-height: 1.38;
}

.map-approval-signal-item p {
  margin-top: 0.24rem;
  font-size: 0.72rem;
  color: #cbdcf0;
  line-height: 1.43;
}

.approval-map-event-marker {
  --event-glow: rgba(255, 179, 77, 0.34);
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.approval-map-event-ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--event-glow);
  filter: blur(8px);
  opacity: 0.95;
}

.approval-map-event-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.18), transparent 42%), rgba(6, 15, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.approval-map-event-core svg {
  width: 28px;
  height: 28px;
  display: block;
}

.approval-map-event-marker.is-police {
  --event-glow: rgba(110, 182, 255, 0.42);
}

.approval-map-event-marker.is-accident {
  --event-glow: rgba(255, 109, 95, 0.42);
}

.approval-map-event-marker.is-disruption {
  --event-glow: rgba(255, 179, 77, 0.4);
}

.approval-map-event-marker.is-detour {
  --event-glow: rgba(98, 217, 166, 0.38);
}

.approval-map-event-marker:hover .approval-map-event-core {
  transform: translateY(-1px) scale(1.05);
}

.emergency-live-view {
  position: fixed;
  inset: 0 var(--rail-right-width) 0 var(--rail-left-width);
  z-index: 980;
  display: grid;
  place-items: stretch;
  padding: 0;
  background:
    radial-gradient(circle at top, rgba(43, 74, 118, 0.18), transparent 34%),
    rgba(3, 7, 12, 0.82);
  backdrop-filter: blur(10px);
}

.emergency-live-view[hidden] {
  display: none;
}

.emergency-live-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100svh;
  max-height: 100svh;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(8, 14, 22, 0.98), rgba(5, 9, 15, 0.98)),
    rgba(5, 9, 15, 0.96);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.emergency-live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.9rem;
  border-bottom: 1px solid rgba(141, 162, 185, 0.12);
}

.emergency-live-head h3 {
  margin: 0.16rem 0 0.32rem;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.emergency-live-head p {
  margin: 0;
}

.emergency-live-close {
  min-height: 40px;
  padding: 0.52rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.22);
  background: rgba(17, 28, 42, 0.88);
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.emergency-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 420px);
  min-height: 0;
  height: 100%;
}

.emergency-live-stage {
  padding: 1rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.9rem;
  min-height: 0;
}

.emergency-live-canvas-frame,
.normal-live-video-frame {
  position: relative;
  height: 100%;
  max-height: none;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  background: #0a111a;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.normal-live-video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050912;
}

.emergency-live-3d-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.emergency-live-3d-map .maplibregl-ctrl-bottom-left,
.emergency-live-3d-map .maplibregl-ctrl-bottom-right {
  display: none;
}

.emergency-live-overlay-bar {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  right: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  z-index: 10;
  pointer-events: none;
}

.emergency-live-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.18);
  background: rgba(9, 17, 28, 0.78);
  backdrop-filter: blur(6px);
  color: #ebf2fb;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.emergency-live-hud-bottom {
  position: absolute;
  bottom: 2.8rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
  pointer-events: none;
}

.emergency-live-hint {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  padding: 0.28rem 0.54rem;
  border-radius: 999px;
  background: rgba(6, 11, 18, 0.68);
  backdrop-filter: blur(4px);
  color: rgba(233, 242, 251, 0.72);
  font-size: 0.68rem;
  z-index: 10;
  pointer-events: none;
}

/* ── Obstacle markers ── */
.em-marker {
  position: relative;
  width: 40px;
  height: 40px;
  cursor: default;
}

.em-marker-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 50%;
  background: rgba(10, 18, 30, 0.75);
  border: 2px solid var(--marker-color, #ff9640);
  box-shadow: 0 0 12px var(--marker-color, #ff9640);
  z-index: 2;
}

.em-marker-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--marker-color, #ff9640);
  opacity: 0.5;
  animation: em-pulse 2s ease-out infinite;
}

.em-marker-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 9px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  color: #ebf2fb;
  background: rgba(10, 18, 30, 0.7);
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@keyframes em-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

.em-marker[data-type="ambulance"] .em-marker-icon,
.em-marker[data-type="police"] .em-marker-icon {
  animation: em-flash 0.6s ease-in-out infinite alternate;
}

@keyframes em-flash {
  0% { box-shadow: 0 0 12px var(--marker-color); }
  100% { box-shadow: 0 0 28px var(--marker-color), 0 0 48px var(--marker-color); }
}

.sv-obstacle-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.emergency-live-foot {
  display: grid;
  gap: 0.55rem;
}

.emergency-live-summary {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #d8e4f1;
}

.emergency-live-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.emergency-live-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.12rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #c6d7ea;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.emergency-live-rail {
  border-left: 1px solid rgba(141, 162, 185, 0.12);
  background: linear-gradient(180deg, rgba(8, 13, 21, 0.98), rgba(4, 8, 14, 0.98));
  padding: 1rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
}

.emergency-live-rail-head p {
  margin: 0;
}

.emergency-chat-log {
  overflow: auto;
  display: grid;
  gap: 0.65rem;
  padding-right: 0.2rem;
}

.emergency-chat-message {
  padding: 0.72rem 0.78rem;
  border-radius: 18px;
  border: 1px solid rgba(141, 162, 185, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.emergency-chat-message p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.emergency-chat-message strong {
  display: block;
  margin-bottom: 0.24rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffb5be;
}

.emergency-chat-message[data-role="operator"] {
  border-color: rgba(76, 179, 255, 0.2);
  background: rgba(76, 179, 255, 0.08);
}

.emergency-chat-message[data-role="operator"] strong {
  color: #96d3ff;
}

.emergency-chat-message[data-role="assistant"] {
  border-color: rgba(255, 191, 103, 0.18);
  background: rgba(255, 191, 103, 0.08);
}

.emergency-chat-form {
  display: grid;
  gap: 0.5rem;
}

.emergency-chat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.emergency-chat-input {
  min-height: 92px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(141, 162, 185, 0.18);
  background: rgba(10, 17, 27, 0.88);
  color: var(--ink);
  font: inherit;
  padding: 0.72rem 0.78rem;
}

.emergency-chat-submit {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 191, 103, 0.36);
  background: linear-gradient(180deg, rgba(255, 191, 103, 0.2), rgba(255, 147, 43, 0.16));
  color: #fff1d1;
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.emergency-chat-submit:hover {
  background: linear-gradient(180deg, rgba(255, 191, 103, 0.28), rgba(255, 147, 43, 0.22));
}

.approval-editor {
  position: absolute;
  inset: 0;
  z-index: 780;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(380px, 1fr) minmax(340px, 420px);
  grid-template-rows: auto auto 1fr auto;
  gap: 0.78rem;
  padding: clamp(0.78rem, 1vw, 1.08rem);
  pointer-events: none;
}

.approval-editor[hidden] {
  display: none;
}

.approval-command-bar,
.approval-topline,
.approval-feed-panel,
.approval-directory-panel,
.approval-control-panel,
.approval-map-legend {
  pointer-events: auto;
}

.approval-command-bar,
.approval-topline,
.approval-feed-panel,
.approval-directory-panel,
.approval-control-panel,
.approval-map-legend {
  border: 1px solid rgba(141, 162, 185, 0.2);
  background:
    linear-gradient(180deg, rgba(7, 14, 23, 0.95), rgba(5, 10, 17, 0.93)),
    rgba(5, 10, 17, 0.92);
  backdrop-filter: blur(16px);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.approval-command-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.92rem 0.98rem;
  border-radius: 20px;
  animation: approvalRise 360ms ease both;
}

.approval-command-copy h3 {
  margin: 0.15rem 0 0.3rem;
  font-size: clamp(1rem, 1.6vw, 1.24rem);
  letter-spacing: 0.03em;
}

.approval-editor-copy {
  margin: 0;
  color: #ccdae8;
  font-size: 0.79rem;
  line-height: 1.52;
  max-width: 62ch;
}

.approval-command-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.48rem;
  min-width: min(390px, 100%);
}

.approval-command-metric {
  min-width: 104px;
  padding: 0.66rem 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.approval-command-metric span {
  display: block;
  margin-bottom: 0.22rem;
  font-size: 0.66rem;
}

.approval-command-metric strong {
  display: block;
  font-size: 1.04rem;
  line-height: 1;
}

.approval-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.42rem;
}

.approval-back-button {
  min-height: 40px;
  padding: 0.48rem 0.84rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.24);
  background: rgba(17, 28, 42, 0.84);
  color: var(--ink);
  font: inherit;
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.approval-back-button:hover {
  border-color: rgba(76, 179, 255, 0.54);
  background: rgba(76, 179, 255, 0.15);
  transform: translateY(-1px);
}

.approval-topline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.9rem;
  padding: 0.68rem 0.84rem;
  border-radius: 16px;
  animation: approvalRise 360ms ease both 30ms;
}

.approval-filter-stack {
  display: grid;
  gap: 0.4rem;
}

.approval-inline-label {
  margin: 0;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.approval-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.approval-filter {
  min-height: 33px;
  padding: 0.32rem 0.66rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: #dbe7f4;
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.approval-filter:hover,
.approval-filter.is-active {
  border-color: rgba(76, 179, 255, 0.58);
  background: rgba(76, 179, 255, 0.18);
  color: #f2f8ff;
}

.approval-timeline {
  display: grid;
  grid-template-columns: auto minmax(160px, 260px) auto;
  align-items: center;
  gap: 0.56rem;
  white-space: nowrap;
  min-width: 360px;
  padding: 0.44rem 0.62rem;
  border-radius: 12px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.approval-timeline input {
  width: 100%;
  accent-color: #4cb3ff;
}

.approval-feed-panel {
  grid-column: 1;
  grid-row: 3 / span 2;
  align-self: stretch;
  border-radius: 18px;
  padding: 0.86rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  animation: approvalRise 360ms ease both 60ms;
}

.approval-directory-panel {
  grid-column: 2;
  grid-row: 3;
  align-self: stretch;
  border-radius: 18px;
  padding: 0.86rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  animation: approvalRise 360ms ease both 90ms;
}

.approval-control-panel {
  grid-column: 3;
  grid-row: 3 / span 2;
  align-self: stretch;
  border-radius: 18px;
  padding: 0.86rem;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  animation: approvalRise 360ms ease both 120ms;
}

.approval-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.72rem;
  padding-bottom: 0.64rem;
  border-bottom: 1px solid rgba(141, 162, 185, 0.15);
}

.approval-panel-head h4 {
  margin: 0.12rem 0 0;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.approval-state-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.54rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.34);
  background: rgba(141, 162, 185, 0.12);
  color: #dbe6f3;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.approval-state-badge[hidden] {
  display: none !important;
}

.approval-state-badge.is-open {
  border-color: rgba(46, 194, 126, 0.32);
  background: rgba(46, 194, 126, 0.12);
  color: #d7f7e7;
}

.approval-state-badge.is-conditional {
  border-color: rgba(246, 178, 63, 0.34);
  background: rgba(246, 178, 63, 0.14);
  color: #fff0cc;
}

.approval-state-badge.is-closed {
  border-color: rgba(255, 75, 92, 0.38);
  background: rgba(255, 75, 92, 0.16);
  color: #ffe1e5;
}

.approval-segment-meta {
  margin: 0.74rem 0 0;
  line-height: 1.45;
}

.approval-empty-state {
  margin-top: 0.8rem;
  padding: 0.84rem 0.9rem;
  border-radius: 14px;
  border: 1px dashed rgba(141, 162, 185, 0.24);
  background: rgba(255, 255, 255, 0.01);
  color: #c7d3df;
  font-size: 0.79rem;
  line-height: 1.5;
}

.approval-empty-state[hidden] {
  display: none !important;
}

.approval-directory-list {
  display: grid;
  gap: 0.46rem;
  overflow: auto;
  min-height: 0;
  margin-top: 0.76rem;
  padding-right: 0.12rem;
}

.approval-segment-row {
  text-align: left;
  width: 100%;
  padding: 0.72rem 0.76rem;
  border-radius: 12px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.approval-segment-row:hover {
  border-color: rgba(76, 179, 255, 0.42);
  background: rgba(76, 179, 255, 0.09);
  transform: translateY(-1px);
}

.approval-segment-row.is-active {
  border-color: rgba(76, 179, 255, 0.62);
  background: rgba(76, 179, 255, 0.15);
}

.approval-segment-row.is-elevated {
  border-color: rgba(246, 178, 63, 0.26);
}

.approval-segment-row.is-critical {
  border-color: rgba(255, 75, 92, 0.3);
}

.approval-segment-row-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.6rem;
}

.approval-segment-row strong {
  font-size: 0.8rem;
  line-height: 1.38;
}

.approval-segment-row-copy {
  margin: 0.32rem 0 0;
  color: #d2e0ee;
  font-size: 0.74rem;
  line-height: 1.45;
}

.approval-row-state {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.42rem;
  border-radius: 999px;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: 1px solid rgba(141, 162, 185, 0.34);
  background: rgba(141, 162, 185, 0.12);
  color: #dbe6f3;
}

.approval-row-state.is-open {
  border-color: rgba(46, 194, 126, 0.34);
  background: rgba(46, 194, 126, 0.14);
  color: #d7f7e7;
}

.approval-row-state.is-conditional {
  border-color: rgba(246, 178, 63, 0.36);
  background: rgba(246, 178, 63, 0.15);
  color: #fff0cc;
}

.approval-row-state.is-closed {
  border-color: rgba(255, 75, 92, 0.4);
  background: rgba(255, 75, 92, 0.16);
  color: #ffe1e5;
}

.approval-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.42rem;
}

.approval-row-meta span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.approval-segment-panel {
  display: grid;
  gap: 0.84rem;
  margin-top: 0.8rem;
  min-height: 0;
  overflow: visible;
  padding-right: 0.15rem;
}

.approval-segment-panel[hidden] {
  display: none !important;
}

.approval-action-grid-inline {
  margin-top: 0.08rem;
}

.approval-segment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.56rem;
}

.approval-segment-grid > div {
  padding: 0.66rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.approval-segment-grid strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.9rem;
}

.approval-detail-block {
  display: grid;
  gap: 0.34rem;
}

.approval-detail-block[hidden] {
  display: none !important;
}

.approval-detail-copy {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.5;
  color: #d9e6f3;
}

.approval-chip-list,
.approval-detour-list,
.approval-audit-list {
  display: grid;
  gap: 0.46rem;
}

.approval-chip-list:empty::before {
  content: "No linked intelligence signals in the selected window.";
  color: var(--muted);
  font-size: 0.76rem;
}

.approval-detour-list:empty::before {
  content: "No detour path available for this segment.";
  color: var(--muted);
  font-size: 0.76rem;
}

.approval-audit-list:empty::before {
  content: "No actions recorded yet.";
  color: var(--muted);
  font-size: 0.76rem;
}

.approval-signal-chip,
.approval-detour-item,
.approval-audit-item {
  padding: 0.62rem 0.68rem;
  border-radius: 12px;
  border: 1px solid rgba(141, 162, 185, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.approval-signal-chip {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  border-color: rgba(255, 179, 77, 0.28);
  background: rgba(255, 179, 77, 0.1);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.approval-signal-chip:hover {
  border-color: rgba(255, 179, 77, 0.62);
  background: rgba(255, 179, 77, 0.2);
  transform: translateY(-1px);
}

.approval-signal-chip.is-active {
  border-color: rgba(255, 179, 77, 0.62);
  background: rgba(255, 179, 77, 0.2);
}

.approval-signal-chip strong,
.approval-detour-item strong,
.approval-audit-item strong {
  display: block;
  font-size: 0.77rem;
}

.approval-signal-chip strong {
  color: #ffd48a;
}

.approval-signal-chip p,
.approval-detour-item p,
.approval-audit-item p {
  margin: 0.2rem 0 0;
  font-size: 0.73rem;
  line-height: 1.45;
  color: #d7e3ef;
}

.approval-signal-chip .mono {
  font-size: 0.75rem;
  color: #f2dbb0;
}

.approval-chip-meta,
.approval-detour-meta,
.approval-audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.42rem;
}

.approval-chip-meta span,
.approval-detour-meta span,
.approval-audit-meta span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.approval-feed-list {
  display: grid;
  gap: 0.5rem;
  overflow: auto;
  min-height: 0;
  margin-top: 0.76rem;
  padding-right: 0.12rem;
}

.approval-feed-item {
  text-align: left;
  width: 100%;
  padding: 0.74rem 0.76rem;
  border-radius: 12px;
  border: 1px solid rgba(141, 162, 185, 0.16);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.approval-feed-item:hover,
.approval-feed-item.is-active {
  border-color: rgba(76, 179, 255, 0.48);
  background: rgba(76, 179, 255, 0.14);
  transform: translateY(-1px);
}

.approval-feed-item.is-critical {
  border-color: rgba(255, 75, 92, 0.34);
}

.approval-feed-item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.6rem;
}

.approval-feed-item strong {
  display: block;
  font-size: 0.81rem;
  line-height: 1.4;
}

.approval-feed-item p {
  margin: 0.26rem 0 0;
  font-size: 0.74rem;
  line-height: 1.46;
  color: #d7e4f1;
}

.approval-feed-item .mono {
  margin-top: 0.45rem;
}

.approval-confidence {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #f0f6ff;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.approval-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.approval-action-button {
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  border-radius: 11px;
  border: 1px solid rgba(141, 162, 185, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.approval-action-button:hover {
  border-color: rgba(76, 179, 255, 0.46);
  background: rgba(76, 179, 255, 0.16);
  transform: translateY(-1px);
}

.approval-action-button.is-critical {
  border-color: rgba(255, 75, 92, 0.42);
  background: rgba(255, 75, 92, 0.16);
  color: #ffe7ea;
}

.approval-action-button.is-critical:hover {
  background: rgba(255, 75, 92, 0.18);
}

.approval-action-button:disabled,
.approval-action-button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  border-color: rgba(141, 162, 185, 0.2);
  background: rgba(141, 162, 185, 0.08);
}

.approval-note-input {
  min-height: 94px;
  resize: vertical;
  padding: 0.68rem 0.72rem;
  border-radius: 11px;
  border: 1px solid rgba(141, 162, 185, 0.22);
  background: rgba(10, 17, 27, 0.88);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.approval-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.56rem;
}

.approval-note-state {
  transition: color 160ms ease;
}

.approval-note-state.is-dirty {
  color: #ffd09f;
}

.approval-map-legend {
  grid-column: 2;
  grid-row: 4;
  justify-self: stretch;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.76rem;
  border-radius: 14px;
  color: #dbe6f2;
  font-size: 0.68rem;
  animation: approvalRise 360ms ease both 140ms;
}

.approval-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.approval-legend-alert i {
  width: 18px;
  height: 6px;
  border-radius: 999px;
  display: inline-block;
  background: linear-gradient(90deg, rgba(255, 78, 66, 0.95), rgba(255, 178, 68, 0.95));
}

.approval-back-button:focus-visible,
.approval-filter:focus-visible,
.approval-feed-item:focus-visible,
.approval-segment-row:focus-visible,
.approval-action-button:focus-visible,
.approval-note-input:focus-visible {
  outline: 2px solid rgba(76, 179, 255, 0.85);
  outline-offset: 2px;
}

@keyframes approvalRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.is-approval-mode .map-emergency-card,
.is-approval-mode .emergency-notice {
  display: none;
}

.is-approval-mode .workspace {
  min-height: 100svh;
}

.is-approval-mode .map-stage {
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
}

.is-approval-mode .hud-row-top {
  left: 0.9rem;
  right: 0.9rem;
}

.is-approval-mode .vehicle-dot-icon {
  display: none;
  pointer-events: none;
}

.map-emergency-actions {
  margin-top: 0.42rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.34rem;
}

.hud-item {
  background: rgba(10, 17, 26, 0.74);
  border: 1px solid rgba(141, 162, 185, 0.24);
  padding: 0.46rem 0.6rem;
}

.hud-item span {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hud-item strong {
  font-size: 1rem;
  font-weight: 800;
}

#criticalCount {
  color: var(--hold);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-approved {
  background: var(--approved);
}

.dot-conditional {
  background: var(--conditional);
}

.dot-hold {
  background: var(--hold);
}

.ops-strip {
  display: none;
}

.strip-section {
  padding: 0.9rem 1rem;
}

.strip-section + .strip-section {
  border-left: 1px solid var(--line);
}

.feed-list {
  max-height: 172px;
  overflow: auto;
}

.feed-list li {
  font-size: 0.82rem;
  line-height: 1.35;
}

.feed-list li[data-severity="critical"] {
  color: #ff8f9a;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.61rem;
  padding: 0.08rem 0.36rem;
}

.status-approved {
  color: var(--approved);
}

.status-conditional {
  color: var(--conditional);
}

.status-hold {
  color: var(--hold);
}

.vehicle-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fce8de;
  box-shadow: 0 0 0 0 rgba(255, 107, 45, 0.64);
  position: relative;
  display: block;
  animation: pulse 1.9s infinite;
}

.vehicle-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 45, 0.46);
  animation: pulseRing 1.9s infinite;
}

.vehicle-dot-icon {
  background: transparent;
  border: 0;
}

.vehicle-dot-map {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: block;
  background: var(--vehicle-fill, var(--accent));
  border: 2px solid var(--vehicle-ring, #fce8de);
  box-shadow: 0 0 0 1px rgba(5, 12, 20, 0.32);
}

.vehicle-dot-map.is-selected {
  animation: selectedFlash 1.8s ease-in-out infinite;
}

.map-reset-control {
  display: flex;
  align-items: center;
}

.map-reset-control.maplibregl-ctrl-group {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.map-reset-control.maplibregl-ctrl-group button + button {
  border-top: 0;
}

.map-reset-control .map-reset-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #eef7ff;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.18), transparent 45%), rgba(12, 21, 32, 0.92);
  border: 1px solid rgba(141, 162, 185, 0.52);
  border-radius: 999px;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.map-reset-control .map-reset-button .map-reset-icon {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}

.map-reset-control .map-reset-button .map-reset-icon::before,
.map-reset-control .map-reset-button .map-reset-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: currentColor;
  border-radius: 999px;
}

.map-reset-control .map-reset-button .map-reset-icon::before {
  width: 2px;
  height: 12px;
}

.map-reset-control .map-reset-button .map-reset-icon::after {
  width: 12px;
  height: 2px;
}

.map-reset-control .map-reset-button:hover {
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.23), transparent 45%), rgba(23, 47, 78, 0.95);
  color: #ffffff;
  transform: translateY(-1px);
}

.map-reset-control .map-reset-button:disabled {
  cursor: not-allowed;
  color: rgba(169, 188, 207, 0.5);
  background: rgba(12, 21, 32, 0.9);
  transform: none;
}

.map-stage .maplibregl-ctrl-top-right,
.map-stage .maplibregl-ctrl-top-left,
.map-stage .maplibregl-ctrl-bottom-right,
.map-stage .maplibregl-ctrl-bottom-left {
  z-index: 760;
}

.map-stage .maplibregl-ctrl-top-right {
  top: 4.7rem;
  right: 0.9rem;
}

.route-label-popup .maplibregl-popup-content {
  background: rgba(7, 14, 20, 0.92);
  color: #eaf2fb;
  border: 1px solid rgba(141, 162, 185, 0.4);
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  font-size: 0.7rem;
  padding: 0.24rem 0.36rem;
}

.route-label-popup .maplibregl-popup-tip {
  border-top-color: rgba(7, 14, 20, 0.92);
}

.authority-hover-popup .maplibregl-popup-content {
  background: rgba(7, 14, 21, 0.96);
  color: #edf5ff;
  border: 1px solid rgba(94, 118, 147, 0.3);
  border-radius: 11px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
  padding: 0.44rem 0.52rem;
}

.authority-hover-popup .maplibregl-popup-tip {
  border-top-color: rgba(7, 14, 21, 0.94);
}

.authority-hover-card strong {
  display: block;
  font-size: 0.72rem;
  line-height: 1.34;
}

.authority-hover-card span {
  display: block;
  margin-top: 0.16rem;
  font-size: 0.66rem;
  color: #cddcee;
  line-height: 1.38;
}

.authority-signal-popup .maplibregl-popup-content {
  background: rgba(8, 14, 22, 0.97);
  color: #eaf2fb;
  border: 1px solid rgba(94, 118, 147, 0.34);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
  padding: 0.64rem 0.72rem;
}

.authority-signal-popup .maplibregl-popup-tip {
  border-top-color: rgba(8, 14, 22, 0.96);
}

.authority-signal-detail h4 {
  margin: 0.2rem 0 0.36rem;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.authority-signal-detail p {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.44;
  color: #d4e2f2;
}

.authority-signal-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.42rem;
}

.authority-signal-detail-meta span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 185, 0.2);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.61rem;
  letter-spacing: 0.04em;
  color: #d8e5f5;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 45, 0.68);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(255, 107, 45, 0);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.88);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

@keyframes selectedFlash {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 1px rgba(5, 12, 20, 0.32), 0 0 0 0 rgba(59, 130, 246, 0.18);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 0 1px rgba(5, 12, 20, 0.32), 0 0 0 4px rgba(59, 130, 246, 0.16);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDrop {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1320px) {
  :root {
    --rail-left-width: 188px;
    --rail-right-width: 210px;
  }

  .app-grid {
    grid-template-columns: var(--rail-left-width) minmax(0, 1fr) var(--rail-right-width);
  }
}

@media (max-width: 1080px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: 100svh;
    height: auto;
  }

  .emergency-live-view {
    inset: 0;
  }

  .rail,
  .rail-right {
    border: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

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

  .is-approval-mode .rail-left {
    width: auto;
  }

  .is-approval-mode .rail-left .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .is-approval-mode .hud-row-top {
    left: 0.9rem;
    right: 0.9rem;
  }

  .workspace {
    min-height: auto;
  }

  .map-stage {
    height: min(68svh, 620px);
    min-height: 360px;
    max-height: none;
  }

  .emergency-live-grid {
    grid-template-columns: 1fr;
  }

  .emergency-live-rail {
    border-left: 0;
    border-top: 1px solid rgba(141, 162, 185, 0.12);
    min-height: 320px;
  }
}

@media (max-width: 760px) {
  .rail {
    padding: 1rem 0.9rem;
    gap: 1rem;
  }

  .workspace-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .head-meta {
    text-align: left;
  }

  .hud-row-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    top: calc(0.7rem + env(safe-area-inset-top, 0px));
  }

  .is-approval-mode .hud-row-top {
    top: calc(0.7rem + env(safe-area-inset-top, 0px));
  }

  .hud-row-bottom {
    grid-auto-flow: row;
    grid-auto-columns: 1fr;
    left: 0.7rem;
    right: 0.7rem;
    bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  }

  .hud-row-bottom p {
    border-right: none;
    padding-right: 0;
  }

  .map-stage {
    height: min(62svh, 520px);
    min-height: 320px;
    max-height: none;
  }

  .map-emergency-card {
    left: 0.8rem;
    right: 0.8rem;
    width: auto;
    bottom: calc(3.35rem + env(safe-area-inset-bottom, 0px));
  }

  .map-approval-card {
    left: 0.8rem;
    right: 0.8rem;
    width: auto;
    bottom: calc(3.35rem + env(safe-area-inset-bottom, 0px));
  }

  .map-approval-grid {
    grid-template-columns: 1fr;
  }

  .map-emergency-actions {
    grid-template-columns: 1fr;
  }

  .emergency-live-view {
    padding: 0;
  }

  .emergency-live-shell {
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    border-radius: 0;
  }

  .emergency-live-head {
    padding: 0.9rem 0.9rem 0.82rem;
  }

  .emergency-live-stage,
  .emergency-live-rail {
    padding: 0.82rem;
  }

  .emergency-live-canvas-frame {
    min-height: 360px;
  }

  .emergency-live-overlay-bar {
    gap: 0.36rem;
  }

  .emergency-live-pill {
    font-size: 0.64rem;
  }

  .approval-toolbar {
    justify-content: stretch;
  }

  .approval-toolbar .approval-back-button {
    flex: 1 1 0;
  }

  .strip-section + .strip-section {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .map-stage .maplibregl-ctrl-top-right {
    top: calc(7.1rem + env(safe-area-inset-top, 0px));
    right: 0.7rem;
  }

}

/* Loader Base */
.normal-live-video-frame {
  position: relative;
}

.video-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 5;
}

/* Loader Text */
.video-loader p {
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6eb6ff;
  margin: 0;
}

/* Spinner Element */
.video-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(110, 182, 255, 0.15);
  border-top-color: #6eb6ff;
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
}

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

/* Standalone Views (Incidents, Transmission) */
.standalone-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100svh;
  overflow: auto;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  background: var(--bg);
  z-index: 200;
  display: flex !important;
  flex-direction: column;
}

.standalone-stage[hidden] {
  display: none !important;
}

body.is-incidents-mode .map-stage,
body.is-incidents-mode .ops-strip,
body.is-transmission-mode .map-stage,
body.is-transmission-mode .ops-strip {
  display: none !important;
}

.section-head {
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
  flex-shrink: 0;
}
.section-head h2 { margin: 0 0 0.4rem; font-size: 1.6rem; }
.section-head .mono { color: var(--muted); }

/* Incident Layout */
.flight-strip-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.flight-strip-header {
  display: grid;
  grid-template-columns: 180px 1fr 2fr 180px;
  gap: 1.5rem;
  padding: 0.5rem 1rem 0.5rem 1.5rem;
  border-bottom: 1px solid rgba(141, 162, 185, 0.4);
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.flight-strip-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.flight-strip-item {
  background: rgba(19, 30, 45, 0.6);
  display: flex;
  flex-direction: column;
  transition: all 250ms ease;
}
.flight-strip-item.is-critical {
  border: 1px solid rgba(255, 75, 92, 0.3);
}
.flight-strip-item.is-ok {
  border: 1px solid rgba(46, 194, 126, 0.3);
}
.flight-strip-item.is-critical:hover {
  background: rgba(19, 30, 45, 0.9);
  border-color: rgba(255, 75, 92, 0.6);
}
.flight-strip-item.is-ok:hover {
  background: rgba(19, 30, 45, 0.9);
  border-color: rgba(46, 194, 126, 0.6);
}

.strip-main-row {
  display: grid;
  grid-template-columns: 180px 1fr 2fr 180px;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem 1rem 1rem 1.5rem;
  cursor: pointer;
}

.strip-id-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.strip-id-box {
  font-family: 'ibm-plex-mono', monospace;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.4rem 0.6rem;
  letter-spacing: 0.05em;
}
.flight-strip-item.is-critical .strip-id-box {
  border: 1px solid rgba(255, 75, 92, 0.8);
  background: rgba(255, 75, 92, 0.15);
  color: #ff9ea8;
}
.flight-strip-item.is-ok .strip-id-box {
  border: 1px solid rgba(46, 194, 126, 0.8);
  background: rgba(46, 194, 126, 0.15);
  color: #2ec27e;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.flight-strip-item.is-critical .live-dot {
  background: #ff4b5c;
  box-shadow: 0 0 8px #ff4b5c;
  animation: pulse-dot 1.5s infinite alternate;
}
.flight-strip-item.is-ok .live-dot {
  background: #2ec27e;
  box-shadow: 0 0 8px #2ec27e;
  opacity: 0.5;
}
@keyframes pulse-dot { 0% { opacity: 0.3; } 100% { opacity: 1; } }

.strip-sparkline {
  height: 24px;
  width: 100%;
  display: flex;
  align-items: center;
}

.strip-waterfall {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.72rem;
}
.flight-strip-item.is-critical .strip-waterfall { color: #ffc9cf; }
.flight-strip-item.is-ok .strip-waterfall { color: #2ec27e; }

.waterfall-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.flight-strip-item.is-critical .waterfall-dot { background: rgba(255, 75, 92, 0.5); }
.flight-strip-item.is-ok .waterfall-dot { background: rgba(46, 194, 126, 0.5); }

.waterfall-line {
  flex: 1;
  height: 1px;
}
.flight-strip-item.is-critical .waterfall-line { background: rgba(255, 75, 92, 0.3); }
.flight-strip-item.is-ok .waterfall-line { background: rgba(46, 194, 126, 0.3); }

.strip-timer {
  font-family: 'ibm-plex-mono', monospace;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: right;
}
.flight-strip-item.is-critical .strip-timer { color: #ff9ea8; }
.flight-strip-item.is-ok .strip-timer { color: #2ec27e; font-size: 1rem; opacity: 0.8; }

/* Expansion Action Console */
.strip-console {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px dashed rgba(255, 75, 92, 0.3);
  border-bottom: 2px solid rgba(255, 75, 92, 0.6);
}

.console-pane {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pane-label {
  font-family: 'ibm-plex-mono', monospace;
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sensor-grid-box, .sensor-p, .term-log, .term-log span.err, .kill-grid, .kill-btn, .kill-btn.extreme {
  display: none;
}

.data-panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 0.5rem;
}
.data-panel-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(141, 162, 185, 0.15);
  padding-bottom: 0.4rem;
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.75rem;
}
.data-key { color: var(--muted); }
.data-val { color: var(--ink); font-weight: 500; }
.data-val.alert { color: #ff9ea8; }

.action-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.simple-action-btn {
  background: transparent;
  border: 1px solid rgba(141, 162, 185, 0.3);
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: all 150ms;
}
.simple-action-btn:hover {
  background: rgba(141, 162, 185, 0.1);
  border-color: rgba(141, 162, 185, 0.8);
}
.simple-action-btn.priority {
  border-color: rgba(255, 75, 92, 0.4);
  color: #ff9ea8;
}
.simple-action-btn.priority:hover {
  background: rgba(255, 75, 92, 0.15);
  border-color: rgba(255, 75, 92, 0.8);
}
.simple-action-btn.is-loading {
  background: repeating-linear-gradient(45deg, rgba(46, 194, 126, 0.1), rgba(46, 194, 126, 0.1) 10px, transparent 10px, transparent 20px);
  color: var(--approved);
  border-color: var(--approved);
  pointer-events: none;
  animation: bg-scroll 1s linear infinite;
  text-align: center;
  font-weight: bold;
}
@keyframes bg-scroll {
  from { background-position: 0 0; }
  to { background-position: 28px 0; }
}

/* Node Control Layout */
.node-control-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 150px;
  gap: 1.5rem;
  overflow-y: auto;
  align-content: start;
}

.node-card {
  background: linear-gradient(135deg, rgba(14, 22, 34, 0.9), rgba(19, 30, 45, 0.95));
  border: 1px solid rgba(141, 162, 185, 0.15);
  border-top: 1px solid rgba(141, 162, 185, 0.3);
  border-left: 3px solid var(--approved);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.node-card:hover {
  background: linear-gradient(135deg, rgba(19, 30, 45, 0.95), rgba(25, 38, 55, 0.95));
  border-color: rgba(141, 162, 185, 0.4);
  box-shadow: inset 0 0 10px rgba(46, 194, 126, 0.05), 0 6px 16px rgba(0,0,0,0.4);
}
.node-card.is-active {
  border-color: rgba(141, 162, 185, 0.6);
  border-left-width: 5px;
  box-shadow: 0 0 0 1px rgba(46, 194, 126, 0.4), inset 0 0 20px rgba(46, 194, 126, 0.15);
}
.node-card.is-degraded {
  border-left-color: #f6b23f;
}
.node-card.is-degraded.is-active {
  box-shadow: 0 0 0 1px rgba(246, 178, 63, 0.4), inset 0 0 20px rgba(246, 178, 63, 0.15);
}

.node-name {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.node-status {
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2ec27e;
  margin-bottom: 1rem;
}
.node-card.is-degraded .node-status { color: #f6b23f; }

.node-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: auto;
}
.n-stat {
  display: flex;
  flex-direction: column;
}
.n-stat span {
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
}
.n-stat strong {
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.9rem;
  color: var(--ink);
}

.node-log-terminal {
  flex: none;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(141, 162, 185, 0.2);
  padding: 0.8rem;
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.65rem;
  color: var(--approved);
  height: 120px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

/* Node Inspector */
.node-inspector {
  background: rgba(19, 30, 45, 0.6);
  border: 1px solid rgba(141, 162, 185, 0.3);
  display: flex;
  flex-direction: column;
}

.node-inspector-content {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.node-inspector-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(141, 162, 185, 0.2);
  padding-bottom: 1rem;
}
.node-inspector-header h2 {
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
}
.node-inspector-header .ping-stat {
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.8rem;
  color: #2ec27e;
}
.node-inspector-header .ping-stat.degraded { color: #f6b23f; }

.ops-table-wrapper {
  margin-bottom: 2rem;
  border: 1px solid rgba(141, 162, 185, 0.2);
  background: rgba(0, 0, 0, 0.2);
}
.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'ibm-plex-mono', monospace;
  font-size: 0.75rem;
  text-align: left;
}
.ops-table th {
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-weight: 400;
  border-bottom: 1px solid rgba(141, 162, 185, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
}
.ops-table td {
  padding: 0.8rem 1rem;
  color: var(--ink);
  border-bottom: 1px solid rgba(141, 162, 185, 0.1);
}
.ops-table tr:last-child td {
  border-bottom: none;
}
.ops-table tr:hover {
  background: rgba(141, 162, 185, 0.05);
}
.ops-table .t-crit {
  color: #ff4b5c;
  font-weight: bold;
}
.ops-table .t-warn {
  color: #f6b23f;
}
.ops-table .t-ok {
  color: #2ec27e;
}
