/* ==========================================================================
 * NeuroCorridor-3D — Surgical Neuronavigation Console Stylesheet
 * Zero-Build · 100% Offline · Deep Obsidian-Slate Telemetry Theme
 * ========================================================================== */

:root {
  --bg-void: #090d14;
  --bg-surface: #0c121d;
  --bg-panel: #0f1623;
  --bg-elevated: #162033;
  --bg-elevated-hover: #1c2940;
  --bg-input: #0b111c;

  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --border-active: rgba(56, 189, 248, 0.55);

  --accent-cyan: #38bdf8;
  --accent-cobalt: #0ea5e9;
  --accent-indigo: #818cf8;

  --status-safe: #10b981;
  --status-safe-bg: rgba(16, 185, 129, 0.13);
  --status-caution: #f59e0b;
  --status-caution-bg: rgba(245, 158, 11, 0.14);
  --status-critical: #f43f5e;
  --status-critical-bg: rgba(244, 63, 94, 0.15);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --suite-bar-height: 36px;
  --shadow-hud: 0 8px 24px rgba(2, 6, 14, 0.58);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

[hidden] {
  display: none !important;
}

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

/* Custom Dark Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.24);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.45);
}

/* ==========================================================================
 * CORS Fallback Banner & Local Action Toasts
 * ========================================================================== */

.cors-banner {
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.22), rgba(245, 158, 11, 0.18));
  border-bottom: 1px solid rgba(244, 63, 94, 0.55);
  color: #ffe4e6;
  padding: 12px 18px;
  font-size: 13px;
}

.cors-banner code {
  background: rgba(9, 13, 20, 0.72);
  border: 1px solid rgba(248, 113, 113, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: #7dd3fc;
}

.toast-region {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: rgba(15, 22, 35, 0.96);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hud);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  animation: toastIn 0.2s ease-out;
}

.toast-item.toast-error {
  border-color: rgba(244, 63, 94, 0.7);
  color: #fecdd3;
}

.toast-item.toast-success {
  border-color: rgba(16, 185, 129, 0.65);
  color: #a7f3d0;
}

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

/* ==========================================================================
 * Application Shell & Top Neuronavigation Header
 * ========================================================================== */

.console-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--suite-bar-height));
  min-height: calc(100dvh - var(--suite-bar-height));
  background:
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.08), transparent 36%),
    radial-gradient(circle at 92% 0%, rgba(16, 185, 129, 0.05), transparent 28%),
    var(--bg-void);
}

@media (min-width: 1120px) and (min-height: 640px) {
  html,
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body {
    display: flex;
    flex-direction: column;
  }

  .console-shell {
    flex: 1 1 0;
    min-height: 0;
    height: calc(100vh - var(--suite-bar-height));
    height: calc(100dvh - var(--suite-bar-height));
    overflow: hidden;
  }

  /* If the window is too short for both, scroll the stage rather than squash the 3D view */
  .viz-stage {
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.console-header {
  flex-shrink: 0;
  background: rgba(12, 18, 29, 0.94);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  z-index: 40;
}

.header-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px;
  flex-wrap: wrap;
}

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

.brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.coord-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.brand-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mandatory Safety & Privacy Badges */
.safety-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-disclaimer {
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #fde68a;
}

.badge-privacy {
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: #a7f3d0;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-dot-amber {
  background: var(--status-caution);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.badge-dot-emerald {
  background: var(--status-safe);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* Header Mode Switcher & Export Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-switcher {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.08);
}

.mode-btn.is-active {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.28), rgba(14, 165, 233, 0.14));
  color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.mode-score-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(15, 22, 35, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.action-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Teaching Cases Sub-Bar */
.header-cases {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(9, 13, 20, 0.65);
}

.cases-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.case-pill-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 1 1 auto;
  scrollbar-width: none;
}

.case-pill-strip::-webkit-scrollbar {
  display: none;
}

.case-pill {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 22, 35, 0.82);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.case-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.case-pill.is-active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.22), rgba(56, 189, 248, 0.08));
  border-color: var(--border-active);
  color: #f0f9ff;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18);
}

.case-pill-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

.case-pill-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

.case-pill.is-active .case-pill-tag {
  color: #bae6fd;
}

.case-select-compact {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-family: var(--font-sans);
  font-size: 12px;
}

/* ==========================================================================
 * Buttons & Segmented Controls
 * ========================================================================== */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: rgba(22, 32, 51, 0.72);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-ghost-sm {
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(22, 32, 51, 0.75);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost-sm:hover:not(:disabled) {
  background: var(--bg-elevated-hover);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.09);
}

.btn-primary-glow {
  background: linear-gradient(180deg, #0ea5e9, #0284c7);
  border-color: rgba(125, 211, 252, 0.45);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.28);
  padding: 6px 12px;
}

.btn-primary-glow:hover:not(:disabled) {
  background: linear-gradient(180deg, #38bdf8, #0ea5e9);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.38);
}

.btn-emerald-sm {
  padding: 5px 10px;
  font-size: 11px;
  background: linear-gradient(180deg, #10b981, #059669);
  border-color: rgba(110, 231, 183, 0.45);
  color: #ffffff;
}

.btn-emerald-sm:hover:not(:disabled) {
  background: linear-gradient(180deg, #34d399, #10b981);
}

.btn-amber-sm {
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.42);
  color: #fde68a;
}

.btn-amber-sm:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.24);
}

.btn-cyan-sm {
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}

.btn-cyan-sm:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.24);
}

.btn-micro {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: rgba(11, 17, 28, 0.8);
  color: var(--accent-cyan);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-micro:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--border-active);
}

.segmented-mini {
  display: inline-flex;
  background: rgba(9, 13, 20, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.is-active {
  background: rgba(56, 189, 248, 0.2);
  color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.42);
}

/* Consistent Keyboard Focus-Visible Rings */
.btn:focus-visible,
.btn-micro:focus-visible,
.mode-btn:focus-visible,
.case-pill:focus-visible,
.case-select-compact:focus-visible,
.seg-btn:focus-visible,
.preset-btn:focus-visible,
.tab-btn:focus-visible,
.filter-pill:focus-visible,
.quiz-dot-btn:focus-visible,
.quiz-option-btn:focus-visible,
.key-hazard-chip:focus-visible,
.hud-legend-pill:focus-visible,
.btn-fly-probe:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.hazard-row:focus-visible {
  outline: none;
  background: rgba(56, 189, 248, 0.16);
  box-shadow: inset 3px 0 0 var(--accent-cyan), inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

/* ==========================================================================
 * Main Workspace Grid
 * ========================================================================== */

.console-workspace {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(380px, 31vw, 452px);
  gap: 10px;
  padding: 10px;
}

/* ==========================================================================
 * Left / Center Multi-Viewport Visualization Stage
 * ========================================================================== */

.viz-stage {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  /* Default slice-strip height; overridden by the draggable splitter (--ortho-grid-h) */
  --ortho-grid-default-h: clamp(140px, calc((100dvh - var(--suite-bar-height)) * 0.19), 220px);
}

/* Hero 3D Stereotactic Viewport */
.viewport-hero-card {
  flex: 1 1 0;
  min-height: 340px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.canvas-stage-3d {
  position: relative;
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  min-height: 220px;
  overflow: hidden;
  /* HUD layout adapts to the 3D canvas width, not the window width */
  container-type: inline-size;
  container-name: stage3d;
}

#viewport-3d {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  outline: none;
}

#viewport-3d:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.65);
}

/* Floating 3D HUD Elements */
.hud-top-left {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  /* Leave room for the top-right display controls (~450px) */
  max-width: max(240px, calc(100% - 480px));
}

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

.hud-risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 5px;
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-hud);
}

.hud-risk-pill.tier-safe {
  background: rgba(6, 78, 59, 0.82);
  border-color: rgba(16, 185, 129, 0.65);
  color: #a7f3d0;
}

.hud-risk-pill.tier-caution {
  background: rgba(120, 53, 15, 0.84);
  border-color: rgba(245, 158, 11, 0.7);
  color: #fde68a;
}

.hud-risk-pill.tier-critical {
  background: rgba(136, 19, 55, 0.86);
  border-color: rgba(244, 63, 94, 0.82);
  color: #ffe4e6;
}

.hud-case-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(9, 13, 20, 0.76);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 5px;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hud-stats-line {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  background: rgba(9, 13, 20, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 5px;
  padding: 3px 8px;
  width: fit-content;
  max-width: 100%;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Sleek Collapsible 3D Controls & Color-Key Legend Pill */
.hud-legend-wrap {
  position: relative;
  pointer-events: auto;
  width: fit-content;
  margin-top: 1px;
}

.hud-legend-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(9, 13, 20, 0.82);
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-hud);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.hud-legend-pill:hover,
.hud-legend-pill.is-open {
  background: rgba(15, 23, 39, 0.94);
  border-color: var(--border-active);
  color: #f0f9ff;
}

.legend-mini-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.legend-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-dot.dot-crit {
  background: var(--status-critical);
  box-shadow: 0 0 5px rgba(244, 63, 94, 0.7);
}

.legend-dot.dot-caut {
  background: var(--status-caution);
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.65);
}

.legend-dot.dot-safe {
  background: var(--status-safe);
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.65);
}

.legend-chevron {
  font-size: 9.5px;
  color: var(--accent-cyan);
  transition: transform 0.16s ease;
}

.hud-legend-pill.is-open .legend-chevron {
  transform: rotate(180deg);
}

.hud-legend-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: min(286px, calc(100vw - 34px));
  background: rgba(9, 13, 20, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-hud);
}

.legend-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-section + .legend-section {
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.legend-heading {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
}

.legend-inline-summary {
  font-size: 10px;
  color: var(--text-secondary);
}

.legend-kv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  font-size: 10.5px;
  color: #cbd5e1;
}

.legend-kv-list kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #e0f2fe;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px;
  padding: 1px 4px;
  margin-right: 3px;
}

.legend-risk-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
  color: #cbd5e1;
}

.legend-risk-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-risk-item strong {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-primary);
  min-width: 44px;
}

.legend-section-compact {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-secondary);
}

.legend-marker-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.swatch-tumor {
  background: #ec4899;
  box-shadow: 0 0 5px rgba(236, 72, 153, 0.7);
}

.swatch-probe {
  border: 1.5px solid #38bdf8;
  background: rgba(56, 189, 248, 0.24);
}

.swatch-opt {
  border: 1.5px dashed #7dd3fc;
  background: transparent;
}

/* Top-Right Floating Display Controls */
.hud-top-right {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hud-view-group .seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-view-group .seg-btn[aria-pressed="true"] {
  background: rgba(16, 185, 129, 0.2);
  color: #d1fae5;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.45);
}

.hud-control-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dec-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(9, 13, 20, 0.84);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  backdrop-filter: blur(8px);
}

.dec-chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.dec-r {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.22);
}

.dec-g {
  color: #86efac;
  background: rgba(34, 197, 94, 0.22);
}

.dec-b {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.24);
}

.hud-overlay-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 13, 20, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hud-slider-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hud-slider-label input[type="range"] {
  width: 68px;
}

.hud-check-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-left: 1px solid var(--border-subtle);
  padding-left: 8px;
}

.hud-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.hud-check input {
  accent-color: var(--accent-cyan);
  margin: 0;
  cursor: pointer;
}

.hud-check:hover {
  color: var(--text-primary);
}

/* Bottom-Center Floating Camera Presets (clear of left triad & right scale bar) */
.hud-bottom-center {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 170px);
}

.camera-preset-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(9, 13, 20, 0.84);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-hud);
  flex-wrap: nowrap;
  justify-content: flex-start;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.camera-preset-bar::-webkit-scrollbar {
  display: none;
}

.preset-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}

.preset-key {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 1.5px 4px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  transition: background 0.14s ease, color 0.14s ease;
}

.preset-btn:hover .preset-key {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.22);
}

.preset-btn.is-active .preset-key {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.28);
}

.preset-corridor.is-active .preset-key {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.28);
}

.preset-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-primary);
}

.preset-btn.is-active {
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.preset-corridor {
  color: #6ee7b7;
}

.preset-corridor.is-active {
  background: rgba(16, 185, 129, 0.22);
  color: #d1fae5;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.45);
}

.hud-nav-hint {
  font-size: 10px;
  color: rgba(148, 163, 184, 0.68);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  white-space: nowrap;
}

/* Interactive 3D Hover Tooltip */
.hover-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  background: rgba(9, 13, 20, 0.94);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  min-width: 170px;
  max-width: 245px;
  box-shadow: var(--shadow-hud);
  backdrop-filter: blur(8px);
}

.tt-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-primary);
}

.tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tt-meta {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
}

/* ==========================================================================
 * Synchronized Orthogonal Tri-Planar Slices + Probe's-Eye Strip
 * ========================================================================== */

.ortho-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ortho-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  flex-wrap: nowrap;
  min-height: 26px;
}

.ortho-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.ortho-toolbar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.probe-hazard-readout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1.5px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 22, 35, 0.85);
  color: var(--text-secondary);
  white-space: nowrap;
}

.probe-hazard-readout.tier-safe {
  border-color: rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
}

.probe-hazard-readout.tier-caution {
  border-color: rgba(245, 158, 11, 0.48);
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.probe-hazard-readout.tier-critical {
  border-color: rgba(244, 63, 94, 0.58);
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

.ortho-toolbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.ortho-click-label {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.ortho-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  height: var(--ortho-grid-h, var(--ortho-grid-default-h));
}

.slice-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.slice-card-probe {
  border-color: rgba(56, 189, 248, 0.28);
}

.slice-canvas-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  background: #080c13;
}

.slice-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.slice-scrubber {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(11, 17, 28, 0.95);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.slice-scrubber-probe {
  gap: 5px;
  padding: 4px 7px;
}

.btn-fly-probe {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.btn-fly-probe:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  color: #f0f9ff;
}

.btn-fly-probe.is-playing {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.65);
  color: #a7f3d0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.28);
}

.fly-probe-icon {
  font-size: 9px;
  line-height: 1;
}

.scrubber-axis {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  min-width: 14px;
}

.axis-x {
  color: #34d399;
}

.axis-y {
  color: #818cf8;
}

.axis-z {
  color: #38bdf8;
}

.axis-probe {
  color: #38bdf8;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.slice-scrubber input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
}

.scrubber-val {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  min-width: 44px;
  text-align: right;
  white-space: nowrap;
}

/* ==========================================================================
 * Precision Range Sliders & Numeric Inputs
 * ========================================================================== */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  outline: none;
  cursor: pointer;
  transition: background 0.14s ease;
}

input[type="range"]:hover {
  background: rgba(148, 163, 184, 0.34);
}

input[type="range"]:focus-visible {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 2px solid #090d14;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease, box-shadow 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]:active::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb {
  transform: scale(1.16);
  background: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 2px solid #090d14;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease, box-shadow 0.12s ease;
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:active::-moz-range-thumb,
input[type="range"]:focus-visible::-moz-range-thumb {
  transform: scale(1.16);
  background: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

.num-input {
  width: 60px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 3px 5px;
  text-align: right;
  outline: none;
  transition: border-color 0.14s ease;
}

.num-input:focus {
  border-color: var(--border-active);
}

/* ==========================================================================
 * Right Interactive Control & Telemetry Panel
 * ========================================================================== */

.control-console {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.console-tabs {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(9, 13, 20, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.08);
}

.tab-btn.is-active {
  background: var(--bg-elevated);
  color: #e0f2fe;
  box-shadow: inset 0 -2px 0 var(--accent-cyan), inset 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.tab-panel {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Cards inside Control Panel */
.panel-card {
  background: rgba(11, 17, 28, 0.68);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.mono-mini {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.mono-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

.mono-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #f0abfc;
  background: rgba(217, 70, 239, 0.14);
  border: 1px solid rgba(217, 70, 239, 0.35);
  border-radius: 5px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

/* Overall Risk Banner */
.risk-banner {
  border-radius: var(--radius-md);
  padding: 10px 11px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-banner.tier-safe {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(11, 17, 28, 0.92));
  border-color: rgba(16, 185, 129, 0.48);
}

.risk-banner.tier-caution {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(11, 17, 28, 0.92));
  border-color: rgba(245, 158, 11, 0.55);
}

.risk-banner.tier-critical {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.22), rgba(11, 17, 28, 0.94));
  border-color: rgba(244, 63, 94, 0.65);
}

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

.risk-banner-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.risk-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tier-safe .risk-pulse-dot {
  background: var(--status-safe);
  box-shadow: 0 0 8px var(--status-safe);
}

.tier-caution .risk-pulse-dot {
  background: var(--status-caution);
  box-shadow: 0 0 8px var(--status-caution);
}

.tier-critical .risk-pulse-dot {
  background: var(--status-critical);
  box-shadow: 0 0 10px var(--status-critical);
  animation: critPulse 1.3s ease-in-out infinite;
}

@keyframes critPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.32);
    opacity: 0.65;
  }
}

.risk-banner-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tier-safe .risk-banner-title {
  color: #6ee7b7;
}

.tier-caution .risk-banner-title {
  color: #fcd34d;
}

.tier-critical .risk-banner-title {
  color: #fda4af;
}

.risk-mode-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: rgba(9, 13, 20, 0.65);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.kpi-cell {
  background: rgba(9, 13, 20, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.kpi-cell:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(12, 18, 29, 0.82);
}

.kpi-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tier-critical #metric-min-clearance,
.tier-critical #metric-hazard-counts {
  color: #fda4af;
}

.tier-caution #metric-min-clearance,
.tier-caution #metric-hazard-counts {
  color: #fcd34d;
}

.tier-safe #metric-min-clearance {
  color: #6ee7b7;
}

/* Coordinate Slider Blocks */
.control-row-wide {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.coord-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.coord-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.coord-block-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.axis-slider-grid {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 5px 8px;
}

.axis-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Optimizer Actions & Before/After Banner */
.optimizer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 4px;
}

.optimizer-actions .btn-primary-glow {
  flex: 1 1 auto;
}

.optimizer-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(16, 185, 129, 0.09));
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-sm);
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.opt-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.opt-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.05em;
}

.opt-summary-text {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-primary);
  line-height: 1.4;
}

.opt-delta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.delta-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(9, 13, 20, 0.72);
  color: var(--text-primary);
}

.delta-pill.is-good {
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.delta-pill.is-warn {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.opt-banner-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
 * Surgical / DES Pearl Inspector Card (Popover Drawer)
 * ========================================================================== */

.inspector-card {
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.96), rgba(11, 17, 28, 0.96));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 8px 20px rgba(2, 6, 14, 0.45);
}

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

.inspector-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.inspector-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.inspector-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.inspector-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.inspector-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inspector-metric-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(9, 13, 20, 0.72);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.inspector-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspector-field {
  font-size: 11.5px;
  line-height: 1.42;
  color: #cbd5e1;
}

.inspector-field strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 1px;
}

.inspector-field.field-pearl {
  background: rgba(16, 185, 129, 0.09);
  border-left: 2px solid var(--status-safe);
  padding: 5px 8px;
  border-radius: 0 5px 5px 0;
}

.inspector-field.field-pearl strong {
  color: #6ee7b7;
}

.inspector-field.field-des {
  background: rgba(245, 158, 11, 0.08);
  border-left: 2px solid var(--status-caution);
  padding: 5px 8px;
  border-radius: 0 5px 5px 0;
}

.inspector-field.field-des strong {
  color: #fcd34d;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

/* ==========================================================================
 * Live Sorted Proximity & Risk Matrix Table
 * ========================================================================== */

.filter-pill-group {
  display: inline-flex;
  gap: 3px;
}

.filter-pill {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-pill.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--border-active);
  color: #e0f2fe;
}

.table-hint {
  margin: -4px 0 0;
  font-size: 10.5px;
  color: var(--text-muted);
}

.hazard-table-wrap {
  max-height: 310px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(9, 13, 20, 0.55);
}

.hazard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.hazard-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0d1523;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 6px 7px;
  border-bottom: 1px solid var(--border-subtle);
}

.hazard-table th.num-col,
.hazard-table td.num-col {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hazard-table th.risk-col,
.hazard-table td.risk-col {
  text-align: right;
  white-space: nowrap;
}

.hazard-row {
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.12s ease;
}

.hazard-row:hover {
  background: rgba(56, 189, 248, 0.09);
}

.hazard-row.is-selected {
  background: rgba(56, 189, 248, 0.18);
  box-shadow: inset 3px 0 0 var(--accent-cyan);
}

.hazard-row td {
  padding: 6px 7px;
  vertical-align: middle;
}

.hazard-name-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.hazard-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hazard-name-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hazard-short-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hazard-short {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.hazard-kind-pill {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.1);
  padding: 0 4px;
  border-radius: 3px;
}

.hazard-full {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.risk-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.risk-pill.tier-safe {
  background: var(--status-safe-bg);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.risk-pill.tier-caution {
  background: var(--status-caution-bg);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.42);
}

.risk-pill.tier-critical {
  background: var(--status-critical-bg);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.5);
}

/* ==========================================================================
 * Tab 2: Atlas Toggles, Custom Lesion & Local NIfTI Dropzone
 * ========================================================================== */

.atlas-shortcut-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.atlas-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tract-system-group {
  background: rgba(15, 22, 35, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tract-system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.atlas-check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 0;
}

.atlas-check-label input {
  accent-color: var(--accent-cyan);
  margin: 0;
  cursor: pointer;
}

.tract-hemi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 20px;
}

.atlas-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(15, 22, 35, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius-sm);
}

.atlas-item-row:hover {
  border-color: rgba(148, 163, 184, 0.24);
}

.atlas-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(9, 13, 20, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  cursor: pointer;
}

.atlas-chip-toggle input {
  accent-color: var(--accent-cyan);
  margin: 0;
  cursor: pointer;
}

.atlas-cat-tag {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.atlas-row-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.lesion-editor-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.privacy-mini {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 1px 6px;
  border-radius: 4px;
}

.nifti-dropzone {
  border: 1.5px dashed rgba(56, 189, 248, 0.42);
  background: rgba(14, 165, 233, 0.05);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nifti-dropzone:hover,
.nifti-dropzone:focus-visible,
.nifti-dropzone.is-dragover {
  background: rgba(56, 189, 248, 0.13);
  border-color: var(--accent-cyan);
  outline: none;
}

.dropzone-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
}

.dropzone-copy strong {
  color: var(--text-primary);
}

.dropzone-copy code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 11px;
}

.dropzone-copy span {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.nifti-dropzone.is-error {
  border-color: rgba(244, 63, 94, 0.65);
  background: rgba(244, 63, 94, 0.08);
}

.nifti-status-card {
  background: rgba(9, 13, 20, 0.78);
  border: 1px solid rgba(16, 185, 129, 0.42);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nifti-status-card.is-error {
  border-color: rgba(244, 63, 94, 0.55);
  background: rgba(136, 19, 55, 0.16);
  color: #fecdd3;
}

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

.nifti-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #cbd5e1;
}

.nifti-warn-list {
  margin: 2px 0 0;
  padding-left: 16px;
  color: #fde68a;
  font-size: 10.5px;
}

/* ==========================================================================
 * Tab 3: Case Brief & Surgical Pearls
 * ========================================================================== */

.pearls-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-brief-hero {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(15, 22, 35, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: var(--radius-md);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.case-brief-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.case-brief-pathology {
  font-size: 11.5px;
  font-weight: 600;
  color: #f0abfc;
}

.case-brief-approach {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #7dd3fc;
}

.brief-section-label {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
}

.brief-prose {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #cbd5e1;
}

.monitoring-callout {
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-left: 3px solid var(--status-caution);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.monitoring-callout .brief-section-label {
  color: #fcd34d;
}

.key-hazard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.key-hazard-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(15, 22, 35, 0.88);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.key-hazard-chip:hover {
  border-color: var(--border-active);
  background: var(--bg-elevated);
}

.pearls-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pearls-list li {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.48;
  color: #cbd5e1;
  background: rgba(15, 22, 35, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 6px;
  padding: 7px 9px;
}

.pearl-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--status-safe);
  flex-shrink: 0;
}

/* ==========================================================================
 * Tab 4: Guided Neuroanatomy & Surgical Approach Quiz
 * ========================================================================== */

.quiz-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.quiz-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.quiz-score-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  padding: 4px 9px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quiz-progress-track {
  height: 6px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cobalt), var(--status-safe));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.quiz-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.quiz-dot-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 22, 35, 0.85);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.quiz-dot-btn:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.quiz-dot-btn.is-current {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.22);
  color: #ffffff;
}

.quiz-dot-btn.is-correct {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

.quiz-dot-btn.is-wrong {
  border-color: rgba(244, 63, 94, 0.6);
  background: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
}

.quiz-question-card {
  gap: 10px;
}

.quiz-case-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.quiz-case-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 5px;
  padding: 2px 7px;
}

.quiz-highlight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.quiz-hl-chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
}

.quiz-stem {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.52;
  color: var(--text-primary);
  font-weight: 500;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.quiz-option-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  background: rgba(15, 22, 35, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.42;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--border-active);
  background: var(--bg-elevated);
}

.quiz-option-btn:disabled {
  cursor: default;
}

.quiz-opt-letter {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.quiz-option-btn.opt-correct {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.65);
  color: #ecfdf5;
}

.quiz-option-btn.opt-correct .quiz-opt-letter {
  background: var(--status-safe);
  color: #052e16;
}

.quiz-option-btn.opt-wrong {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.65);
  color: #fff1f2;
}

.quiz-option-btn.opt-wrong .quiz-opt-letter {
  background: var(--status-critical);
  color: #ffffff;
}

.quiz-option-btn.opt-dim {
  opacity: 0.55;
}

.quiz-feedback {
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.48;
}

.quiz-feedback.is-correct {
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.42);
}

.quiz-feedback.is-wrong {
  background: rgba(244, 63, 94, 0.11);
  border: 1px solid rgba(244, 63, 94, 0.42);
}

.quiz-feedback-verdict {
  font-weight: 700;
  font-size: 12px;
}

.quiz-feedback.is-correct .quiz-feedback-verdict {
  color: #6ee7b7;
}

.quiz-feedback.is-wrong .quiz-feedback-verdict {
  color: #fda4af;
}

.quiz-pearl-box {
  background: rgba(9, 13, 20, 0.65);
  border-left: 2px solid var(--accent-cyan);
  padding: 6px 8px;
  border-radius: 0 5px 5px 0;
  color: #e2e8f0;
}

.quiz-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quiz-summary-card {
  border-color: rgba(16, 185, 129, 0.48);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(11, 17, 28, 0.92));
}

.summary-tier {
  font-size: 13px;
  font-weight: 700;
  color: #6ee7b7;
}

.summary-domain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.summary-domain-table th,
.summary-domain-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
}

.summary-domain-table th:last-child,
.summary-domain-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
}


/* ==========================================================================
 * Resizable 3D Stage: Splitter, Expand-3D Mode & Fullscreen
 * ========================================================================== */

.stage-splitter {
  flex: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: row-resize;
  touch-action: none;
  user-select: none;
  border-radius: 6px;
  outline: none;
}

.stage-splitter-grip {
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.26);
  transition: background 0.14s ease, width 0.14s ease;
}

.stage-splitter:hover .stage-splitter-grip,
.stage-splitter.is-dragging .stage-splitter-grip,
.stage-splitter:focus-visible .stage-splitter-grip {
  width: 96px;
  background: var(--accent-cyan);
}

.stage-splitter:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

body.is-resizing-stage,
body.is-resizing-stage * {
  cursor: row-resize !important;
  user-select: none !important;
}

.ortho-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(9, 13, 20, 0.6);
}

.ortho-collapse-chevron {
  font-size: 9.5px;
  color: var(--accent-cyan);
  transition: transform 0.16s ease;
}

.viz-stage.is-3d-expanded .ortho-collapse-chevron {
  transform: rotate(180deg);
}

/* Expand-3D: collapse the slice strip so the 3D viewport fills the stage */
.viz-stage.is-3d-expanded .ortho-grid,
.viz-stage.is-3d-expanded .stage-splitter {
  display: none;
}

.viz-stage.is-3d-expanded .ortho-section {
  padding-top: 8px;
}

.viz-stage.is-3d-expanded .ortho-toolbar-right .ortho-click-label,
.viz-stage.is-3d-expanded #click-mode-group {
  display: none;
}

/* Fullscreen: 3D stage + corridor planning panel */
.console-workspace:fullscreen {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.08), transparent 36%),
    var(--bg-void);
}

.console-workspace:fullscreen .control-console {
  max-height: none;
}

.console-workspace::backdrop {
  background: var(--bg-void);
}

/* HUD adapts to the 3D canvas width */
@container stage3d (max-width: 880px) {
  .hud-view-group .seg-btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .hud-view-group .seg-btn {
    font-size: 12px;
    padding: 2px 7px;
  }
}

@container stage3d (max-width: 900px) {
  .hud-nav-hint {
    display: none;
  }

  .hud-slider-label input[type="range"] {
    width: 48px;
  }

  .hud-check-group {
    gap: 5px;
    padding-left: 6px;
  }

  .hud-check,
  .hud-slider-label {
    font-size: 10px;
  }

  .hud-overlay-bar {
    gap: 6px;
    padding: 3px 6px;
  }
}

@container stage3d (max-width: 760px) {
  .preset-key {
    display: none;
  }

  .hud-bottom-center {
    max-width: calc(100% - 20px);
  }
}

/* ==========================================================================
 * Responsive Breakpoints (Laptop, Tablet & Compact Displays)
 * ========================================================================== */

@media (max-width: 1320px) {
  .console-workspace {
    grid-template-columns: minmax(0, 1fr) 390px;
  }

  .brand-subtitle {
    display: none;
  }
}

@media (min-width: 1120px) and (max-height: 639px) {
  .console-workspace {
    flex: 0 0 auto;
    height: auto;
  }

  .viewport-hero-card,
  .canvas-stage-3d {
    min-height: 360px;
    height: 56vh;
  }

  .control-console,
  .tab-panel {
    max-height: none;
    overflow: visible;
  }

  .tab-panel {
    flex: 0 0 auto;
  }
}

@media (max-width: 1119px) {
  /* Stacked layout must grow with its content; flex-basis 0 made the slice strip overlap the planning panel */
  .console-workspace {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    height: auto;
  }

  .viewport-hero-card,
  .canvas-stage-3d {
    min-height: 430px;
    height: 58vh;
  }

  .stage-splitter {
    display: none;
  }

  .ortho-toolbar,
  .ortho-toolbar-left {
    flex-wrap: wrap;
  }

  .ortho-section {
    margin-top: 10px;
  }

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

  .slice-card {
    height: 225px;
  }

  .control-console {
    max-height: none;
    overflow: visible;
  }

  .tab-panel {
    flex: 0 0 auto;
    overflow: visible;
  }
}

@media (max-width: 960px) {
  .preset-key {
    display: none;
  }
}

@media (max-width: 760px) {
  .header-primary {
    padding: 8px 10px;
  }

  .badge-disclaimer {
    white-space: normal;
    line-height: 1.3;
  }

  .case-pill-strip {
    display: none;
  }

  .case-select-compact {
    display: block;
  }

  .hud-top-left {
    max-width: calc(100% - 20px);
  }

  .hud-top-right {
    top: auto;
    bottom: 66px;
    right: 8px;
  }

  .hud-bottom-center {
    max-width: calc(100% - 16px);
  }

  .hud-nav-hint {
    display: none;
  }

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

  .slice-card {
    height: 240px;
  }
}

/* === PRAZG_SUITE_BANNER_CSS_START === */
.prazg-suite-bar {
  position: relative;
  z-index: 9999;
  flex: none;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 5px 14px;
  background: linear-gradient(90deg, #070d18 0%, #0b1322 55%, #070d18 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
}
.prazg-suite-bar *,
.prazg-suite-bar *::before,
.prazg-suite-bar *::after {
  box-sizing: border-box;
}
.prazg-suite-bar a.prazg-suite-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  border-radius: 6px;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.prazg-suite-bar a.prazg-suite-brand:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
}
.prazg-suite-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.85);
  flex: none;
}
.prazg-suite-links {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 1px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}
.prazg-suite-links::-webkit-scrollbar {
  height: 4px;
}
.prazg-suite-links::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}
.prazg-suite-sep {
  flex: none;
  width: 1px;
  height: 15px;
  margin: 0 4px;
  background: rgba(148, 163, 184, 0.28);
}
.prazg-suite-bar a.prazg-suite-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}
.prazg-suite-bar a.prazg-suite-link:hover {
  color: #f8fafc;
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(148, 163, 184, 0.45);
}
.prazg-suite-bar a.prazg-suite-link.prazg-suite-link--active {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.68);
  font-weight: 600;
}
.prazg-suite-bar a.prazg-suite-link:focus-visible,
.prazg-suite-bar a.prazg-suite-brand:focus-visible,
.prazg-suite-bar a.prazg-suite-gh:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.prazg-suite-bar a.prazg-suite-gh {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: color 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}
.prazg-suite-bar a.prazg-suite-gh:hover {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.7);
}
@media (max-width: 720px) {
  .prazg-suite-bar {
    padding: 5px 10px;
    gap: 7px;
  }
  .prazg-suite-bar a.prazg-suite-gh {
    display: none;
  }
}
@media print {
  .prazg-suite-bar {
    display: none !important;
  }
}
/* === PRAZG_SUITE_BANNER_CSS_END === */
