/* ==========================================================================
   Dhaka Pathfinder — High-Contrast Minimalist Monochrome Design System
   Cloudflare Grid Separator Architecture (All in one unified grid)
   ========================================================================== */

:root {
  --bg-page: #141414;
  --bg-panel: #141414;
  --bg-panel-subtle: #191919;
  --bg-card: #1c1c1c;
  --bg-card-hover: #222222;
  --bg-inset: #0e0e0e;
  
  --border-color: #272727;
  --border-subtle: #1e1e1e;
  --border-hover: #3d3d3d;
  --border-active: #ffffff;
  
  --brand-mono-white: #ffffff;
  --brand-mono-silver: #e4e4e7;
  --brand-mono-gray: #a1a1aa;
  --brand-mono-dark: #27272a;
  --brand-mono-subtle: rgba(255, 255, 255, 0.08);
  --brand-mono-glow: rgba(255, 255, 255, 0.18);
  
  --text-main: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-disabled: #3f3f46;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --transition-fast: 0.15s ease;
}

/* Prevent accidental page scrollbars on desktop layout */
html, body {
  overflow: hidden;
  height: 100%;
  width: 100%;
  max-width: 100vw;
}

/* Global Minimalist Dark Scrollbars */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.font-mono {
  font-family: var(--font-mono);
}

.text-white {
  color: #ffffff !important;
}

/* Base Full-Bleed Application Frame */
.app-layout {
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--bg-page);
}

/* ==========================================================================
   1. Cloudflare Grid Header (Navbar)
   ========================================================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-panel);
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0 18px;
  height: 48px;
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.engine-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 999px;
}

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

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #1c1c1c;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
  border-color: var(--border-hover);
}

.nav-btn.active {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   2. Workspace Layout — Cloudflare Grid Separator System
   ========================================================================== */
.main-workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 510px;
  gap: 0;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-page);
  position: relative;
  height: calc(100vh - 48px);
}

.main-workspace.wide-map-mode {
  grid-template-columns: 310px minmax(0, 1fr) 0px;
}

.main-workspace.wide-map-mode .benchmark-panel {
  display: none;
}

@media (max-width: 1240px) {
  body {
    overflow-y: auto !important;
  }
  .app-layout {
    height: auto !important;
    overflow: visible !important;
  }
  .main-workspace {
    display: flex;
    flex-direction: column;
    height: auto;
    flex: none;
  }
  .canvas-panel {
    height: 560px !important;
    flex: none !important;
  }
  .benchmark-panel {
    height: auto !important;
    overflow-y: visible !important;
    border-left: none !important;
    border-top: 1px solid var(--border-color) !important;
  }
  .sidebar.unified-console {
    height: auto !important;
    overflow-y: visible !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
  }
}

/* ==========================================================================
   3. Cloudflare Grid Elements & Section Bar
   ========================================================================== */
.cf-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  user-select: none;
}

.cf-section-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ==========================================================================
   4. Left Column: Unified Routing Console
   ========================================================================== */
.sidebar.unified-console {
  background: var(--bg-panel);
  border: none;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: none;
  position: relative;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Clean Edge-to-Edge Grid Cells */
.console-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  position: relative;
}

.console-section.no-border {
  border-bottom: none;
}

/* Map Picker Segmented Bar: Single rectangle with simple line dividers */
.map-picker-pill-group {
  display: flex;
  align-items: stretch;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.map-picker-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.map-picker-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.map-picker-pill.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 600;
  border: none;
  border-right: 1px solid var(--border-color);
  box-shadow: none;
}

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

.picker-dot.dot-origin {
  background: #10b981;
}

.picker-dot.dot-destination {
  background: #ef4444;
}

.picker-dot.dot-roadblock {
  background: #ef4444;
}

.roadblock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.roadblock-bar-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.roadblock-icon {
  font-size: 11px;
}

.roadblock-text {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
}

.clear-roadblocks-btn {
  background: #14151c;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clear-roadblocks-btn:hover {
  background: #ffffff;
  color: #000000;
}

.map-picker-pill-swap {
  width: 34px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.map-picker-pill-swap:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: rotate(180deg);
}

/* Unified Waypoint Selector: Single clean rectangle with divider line */
.journey-track-box {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0;
  gap: 0;
  position: relative;
}

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

.waypoint-row-dot.dot-origin {
  background: #10b981;
}

.waypoint-row-dot.dot-destination {
  background: #ef4444;
}

.journey-track-box #combo-start .combobox-trigger {
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 3px 3px 0 0;
  background: transparent;
  height: 38px;
  padding: 0 12px;
}

.journey-track-box #combo-goal .combobox-trigger {
  border: none;
  border-radius: 0 0 3px 3px;
  background: transparent;
  height: 38px;
  padding: 0 12px;
}

.journey-track-box .combobox-trigger:hover,
.journey-track-box .combobox-trigger:focus {
  background: rgba(255, 255, 255, 0.04);
}

.journey-track-box .custom-combobox.open .combobox-trigger {
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Custom Comboboxes with Search & Real Places
   ========================================================================== */
.custom-combobox {
  position: relative;
  width: 100%;
}

.combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  height: 38px;
  padding: 0 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.combobox-trigger:hover, .combobox-trigger:focus {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.custom-combobox.open .combobox-trigger {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.combobox-value-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.combobox-text {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combobox-text.combobox-placeholder {
  color: #71717a;
  font-weight: 500;
}

.combobox-algo-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  color: #ffffff;
}

.combobox-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.custom-combobox.open .combobox-chevron {
  transform: rotate(180deg);
  color: #ffffff;
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: #090a0e;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  max-height: 250px;
}

.custom-combobox.open .combobox-dropdown {
  display: flex;
}

.combobox-search-box {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  background: #06070a;
}

.combobox-search-input {
  width: 100%;
  background: #111218;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 11.5px;
  color: #ffffff;
  outline: none;
  font-family: var(--font-sans);
}

.combobox-search-input:focus {
  border-color: #ffffff;
}

.combobox-options-list {
  overflow-y: auto;
  max-height: 200px;
  display: flex;
  flex-direction: column;
}

.combobox-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s ease;
  gap: 12px;
}

.combobox-option:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
}

.combobox-option.selected {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 600;
}

.combobox-option-title {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combobox-option-area {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.combobox-option-cost {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #a1a1aa;
}

/* ==========================================================================
   Scenario Presets, Weights Sliders & Compute CTA Button
   ========================================================================== */
.preset-pill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.preset-pill {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  height: 28px;
  padding: 0 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.preset-pill:last-child {
  border-right: none;
}

.preset-pill:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.preset-pill.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 600;
}

.weights-box {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--bg-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.weight-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: #27272a;
  border-radius: 999px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #000000;
  box-shadow: none;
}

.range-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #000000;
}

/* Prominent High-Contrast Compute CTA */
.compute-cta-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 10px 14px;
  border: 1px solid #ffffff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.compute-cta-btn:hover {
  background: #f4f4f5;
  color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

.compute-cta-btn:active {
  background: #d4d4d8;
  transform: translateY(0);
}

.compute-cta-btn .btn-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

.compute-cta-btn.computing {
  background: #f4f4f5;
  color: #000000;
  cursor: wait;
  pointer-events: none;
  border-color: #ffffff;
  box-shadow: none;
}

.compute-cta-btn.computing .compute-btn-icon {
  display: none;
}

.compute-cta-btn.computing .btn-spinner {
  display: inline-block;
}

.compute-cta-btn.computed {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  box-shadow: none;
}

.compute-cta-btn.computed .btn-spinner {
  display: none;
}

.compute-cta-btn.computed .compute-btn-icon {
  display: inline-block;
}

.compute-cta-btn.needs-recompute {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: none;
}

.data-table tbody tr.row-flash {
  animation: tableFlash 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tableFlash {
  0% {
    background-color: rgba(56, 189, 248, 0.25);
  }
  100% {
    background-color: transparent;
  }
}

/* ==========================================================================
   Simulation Playback Controls & Telemetry
   ========================================================================== */
.transport-bar {
  display: flex;
  align-items: stretch;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.transport-btn {
  flex: 1;
  height: 32px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.transport-btn:last-child {
  border-right: none;
}

.transport-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.transport-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.transport-btn.play-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 600;
  border-right: 1px solid var(--border-color);
}

.speed-control-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 110px;
}

.speed-label {
  font-size: 10px;
  color: var(--text-muted);
  min-width: 38px;
  text-align: right;
}

.range-mini {
  height: 2px !important;
}

.telemetry-compact-grid {
  display: flex;
  align-items: stretch;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  margin-top: 8px;
}

.telemetry-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  padding: 6px 10px;
}

.telemetry-pill:last-child {
  border-right: none;
}

.telemetry-pill-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.telemetry-pill-val {
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  margin-top: 2px;
}

/* ==========================================================================
   5. Center Column: Map Viewport (Grid Centered Pane)
   ========================================================================== */
.viewport-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--bg-page);
  position: relative;
}

.status-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0 16px;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.status-ribbon-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1a1aa;
  flex-shrink: 0;
}

.status-indicator.ready {
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.status-indicator.running {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

.layer-switcher {
  display: inline-flex;
  align-items: center;
  background: #181818;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.layer-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layer-btn:last-child {
  border-right: none;
}

.layer-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.layer-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
}

.status-text {
  font-size: 12px;
  font-weight: 500;
  color: #e4e4e7;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Canvas Panel */
.canvas-panel {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  background: #101010;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

#map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  user-select: none;
}

#map-canvas:active {
  cursor: grabbing;
}

/* Floating Map Navigation & Zoom Controls */
.map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  background: #181818;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 20;
}

.map-ctrl-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.map-ctrl-btn:last-child {
  border-bottom: none;
}

.map-ctrl-btn:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
}

.map-zoom-level {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

/* Minimal Map Legend */
.map-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #181818;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  z-index: 20;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot.dot-start { background: #10b981; }
.legend-dot.dot-goal { background: #ef4444; }
.legend-dot.dot-path { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.8); }
.legend-dot.dot-roadblock { background: #ffffff; border: 1px solid #000000; }

.canvas-tooltip {
  position: absolute;
  display: none;
  background: rgba(6, 7, 10, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 11px;
  color: #ffffff;
  pointer-events: none;
  z-index: 30;
  max-width: 260px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}

/* Route Details Ribbon (Grid Bottom Border) */
.route-details-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel);
  border: none;
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0 16px;
  height: 38px;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.route-tag {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: var(--brand-mono-subtle);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.route-tag.preview-tag {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 700;
  border-color: #ffffff;
}

.route-breadcrumb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-grow: 1;
}

/* ==========================================================================
   6. Right Column: Integrated Benchmark & Evaluation Panel
   ========================================================================== */
.benchmark-panel {
  background: var(--bg-panel);
  border: none;
  border-left: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: none;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.benchmark-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-panel);
  flex-shrink: 0;
}

/* Table Frame with Clean Minimal Scrollbar */
.table-frame {
  width: 100%;
  overflow-x: auto;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  flex-shrink: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: left;
}

.data-table th {
  background: #161616;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody tr.optimal-row {
  background: rgba(255, 255, 255, 0.04);
}

.data-table tbody tr.selected-row {
  background: rgba(255, 255, 255, 0.1);
  outline: 1px solid rgba(255, 255, 255, 0.35);
}

.data-table tbody tr.hovered-preview-row {
  background: rgba(255, 255, 255, 0.14) !important;
  outline: 1px solid rgba(255, 255, 255, 0.45);
}

.badge-tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 9.5px;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-optimal {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.badge-hop-optimal {
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4d8;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.badge-suboptimal {
  background: #111218;
  color: var(--text-muted);
  border: 1px solid #1c1e27;
}

.empty-message {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-style: italic;
}

/* Route Breakdown & Multi-Criteria Inspector Card */
.route-inspector-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.015);
  flex-shrink: 0;
}

.inspector-badge {
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 2px 7px;
  border-radius: 3px;
}

.inspector-ratings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-inset);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.inspector-rating-pill {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border-right: 1px solid var(--border-color);
}

.inspector-rating-pill:last-child {
  border-right: none;
}

.inspector-rating-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.inspector-rating-val {
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  margin-top: 2px;
}

.inspector-corridors-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.inspector-corridors-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.inspector-corridors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.corridor-chip {
  font-size: 10.5px;
  font-weight: 500;
  color: #e4e4e7;
  background: #1c1c1c;
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 3px;
}

.corridor-arrow {
  color: var(--text-muted);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
}

/* Metrics Grid & Charts */
.metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: none;
}

.metric-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-card:last-child {
  border-bottom: none;
}

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-chart-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chart-bar-row {
  display: grid;
  grid-template-columns: 85px 1fr 65px;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.chart-bar-label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  height: 6px;
  background: #12141c;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-bar-fill.optimal-fill {
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.chart-bar-fill.suboptimal-fill {
  background: #52525b;
}

.chart-bar-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #ffffff;
  text-align: right;
}
