:root {
  --bg-glass: rgba(13, 18, 28, 0.78);
  --bg-glass-strong: rgba(13, 18, 28, 0.92);
  --border-glass: rgba(148, 163, 184, 0.22);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0284c7;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --radius: 12px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070b14;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  -webkit-tap-highlight-color: transparent;
}

#cesiumContainer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cesium-widget-credits {
  bottom: 138px !important;
  left: 332px !important;
  opacity: 0.85;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

body.eco-mode .glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(11, 16, 26, 0.90);
}

.hidden {
  display: none !important;
}

/* Top Bar */
.top-bar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius);
}

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

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

.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.lake-select {
  font-weight: 600;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.92);
}

.scenario-select {
  font-weight: 600;
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.92);
}

.scenario-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scenario-select option:disabled {
  color: #64748b;
}

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

.pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-demo {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.pill-real {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.quality-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.fps-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #4ade80;
  min-width: 52px;
}

.gpu-hint {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 135px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inputs & Buttons */
select, .text-input {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
}

select:focus, .text-input:focus {
  border-color: var(--accent);
}

.full-select {
  width: 100%;
  margin-bottom: 4px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.08s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
}

.btn-primary:hover {
  background: #0369a1;
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.75);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.btn-secondary:hover {
  background: rgba(71, 85, 105, 0.85);
}

.icon-btn, .icon-btn-sm {
  background: rgba(51, 65, 85, 0.65);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.icon-btn-sm {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

/* Left Sidebar */
.sidebar {
  position: fixed;
  top: 72px;
  left: 12px;
  bottom: 138px;
  width: 308px;
  z-index: 15;
  border-radius: var(--radius);
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar.collapsed {
  transform: translateX(-340px);
  opacity: 0;
  pointer-events: none;
}

.panel-section {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding-bottom: 10px;
}

.panel-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.panel-section h2 {
  margin: 0 0 8px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}

.layer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.layer-btn {
  text-align: left;
  background: rgba(30, 41, 59, 0.65);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.layer-btn:hover {
  background: rgba(51, 65, 85, 0.8);
}

.layer-btn.active {
  background: rgba(2, 132, 199, 0.35);
  border-color: var(--accent);
  font-weight: 600;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 12px;
}

.toggle-row input {
  accent-color: var(--accent);
  cursor: pointer;
}

.slider-row {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 4px 0;
  font-size: 11px;
  color: var(--text-muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Legend */
.legend-bar {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

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

.legend-swatch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Camera Buttons */
.cam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cam-btn {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
}

.cam-btn:hover {
  border-color: var(--accent);
  background: rgba(51, 65, 85, 0.85);
}

/* POIs */
.poi-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poi-item {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.poi-item:hover {
  border-color: var(--accent);
}

.poi-item.impacted {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(127, 29, 29, 0.35);
}

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

.poi-name {
  font-weight: 600;
  font-size: 12px;
}

.poi-eta {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--accent);
}

.poi-eta.hit {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.poi-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.micro-note {
  margin: 0 0 8px 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Right Stack */
.right-stack {
  position: fixed;
  top: 72px;
  right: 12px;
  width: 288px;
  max-height: calc(100vh - 266px);
  overflow-y: auto;
  z-index: 16;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.right-stack > * {
  pointer-events: auto;
}

.exposure-hud {
  border-radius: var(--radius);
  padding: 11px 12px;
  border-color: rgba(56, 189, 248, 0.35);
}

.exp-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.exp-hud-header h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #7dd3fc;
}

.exp-bridge-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.exp-metric {
  margin-bottom: 8px;
}

.exp-metric:last-child {
  margin-bottom: 0;
}

.exp-metric-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  margin-bottom: 4px;
}

.exp-metric-top strong {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #fff;
}

.exp-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.exp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.14s linear;
}

.exp-bar-bldg {
  background: linear-gradient(90deg, #38bdf8, #fef08a);
}

.exp-bar-road {
  background: linear-gradient(90deg, #7dd3fc, #f8fafc);
}

/* Click-to-Inspect Card */
.inspector {
  width: 100%;
  border-radius: var(--radius);
  padding: 12px;
}

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

.inspector-header h3 {
  margin: 0;
  font-size: 13px;
}

.insp-coords {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 8px 0;
}

.hazard-banner {
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  margin-bottom: 10px;
}

.hazard-banner.class-0 { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.hazard-banner.class-1 { background: rgba(250, 204, 21, 0.22); color: #fde047; }
.hazard-banner.class-2 { background: rgba(251, 146, 60, 0.25); color: #fdba74; }
.hazard-banner.class-3 { background: rgba(239, 68, 68, 0.28); color: #fca5a5; }
.hazard-banner.class-4 { background: rgba(153, 27, 27, 0.55); color: #fecaca; border: 1px solid #ef4444; }

.insp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stat-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
}

.stat-box strong {
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: 2px;
}

.insp-advice {
  margin: 9px 0 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Compact Horizontal 3D Camera Nav Bar */
.nav-widget {
  position: fixed;
  right: 12px;
  bottom: 138px;
  z-index: 18;
  border-radius: 12px;
  padding: 5px 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
}

.nav-compass {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.nav-compass:hover {
  border-color: var(--accent);
}

.compass-needle {
  font-size: 10px;
  color: #f87171;
  display: inline-block;
  transition: transform 0.12s linear;
}

.compass-label {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
}

.nav-group {
  display: flex;
  flex-direction: row;
  gap: 3px;
}

.nav-btn {
  width: 30px;
  height: 28px;
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: var(--accent);
}

.nav-btn:active {
  transform: scale(0.94);
}

/* Bottom Dock */
.bottom-dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 118px;
  z-index: 20;
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.playback-col {
  flex: 1;
  min-width: 240px;
}

.playback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clock-readout {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

#timeDisplay {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.wave-status {
  font-size: 11px;
  color: var(--text-muted);
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hydro-col {
  width: 370px;
  flex-shrink: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  padding-left: 14px;
}

.hydro-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hydro-stats {
  font-family: var(--font-mono);
  color: var(--text-main);
}

#hydrographCanvas {
  width: 100%;
  height: 78px;
  display: block;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
}

/* Full-Screen Analytics & Graphs Dashboard */
.analytics-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.86);
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.analytics-panel {
  width: 100%;
  max-width: 1360px;
  background: #080f1d;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding-bottom: 12px;
}

.analytics-header h2 {
  margin: 0;
  font-size: 19px;
}

.analytics-subtitle {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

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

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
}

.kpi-card {
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
}

.kpi-card.kpi-exposure {
  border-color: rgba(239, 68, 68, 0.4);
}

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

.kpi-val {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
  margin: 4px 0 2px 0;
}

.kpi-card.kpi-exposure .kpi-val {
  color: #f87171;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
}

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

.chart-card {
  background: #0b1220;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.chart-card-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.chart-card-header p {
  margin: 3px 0 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.chart-export-btn {
  padding: 4px 9px;
  font-size: 11px;
  flex-shrink: 0;
}

.analytics-canvas {
  width: 100%;
  height: 255px;
  display: block;
  border-radius: 8px;
}

.chart-card-wide .analytics-canvas {
  height: 280px;
}

/* Print-Friendly Light Report Theme */
.analytics-light .analytics-panel {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.analytics-light .analytics-header {
  border-bottom-color: #cbd5e1;
}

.analytics-light .analytics-subtitle,
.analytics-light .kpi-label,
.analytics-light .kpi-sub,
.analytics-light .chart-card-header p {
  color: #475569;
}

.analytics-light .kpi-card,
.analytics-light .chart-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

.analytics-light .kpi-val {
  color: #0284c7;
}

.analytics-light .kpi-card.kpi-exposure .kpi-val {
  color: #dc2626;
}

.analytics-light .btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.analytics-light .btn-secondary:hover {
  background: #cbd5e1;
}

/* API Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  width: 100%;
  max-width: 460px;
  border-radius: 14px;
  padding: 18px;
  background: var(--bg-glass-strong);
}

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

.modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.modal-copy {
  margin: 0 0 12px 0;
  line-height: 1.45;
  color: #cbd5e1;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin: 10px 0 4px 0;
  color: var(--text-muted);
}

.text-input {
  width: 100%;
  padding: 8px 10px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px 0;
  flex-wrap: wrap;
}

.muted {
  color: var(--text-muted);
  font-weight: 400;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 24px);
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: fadeSlide 0.25s ease;
}

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

/* --- Tablet Breakpoints --- */
@media (max-width: 1140px) {
  .gpu-hint { display: none; }
}

@media (max-width: 900px) {
  .hydro-col { width: 250px; }
  .sidebar { width: 270px; }
  .analytics-grid { grid-template-columns: 1fr; }
}

/* --- Clean Mobile Layout (Phones <= 768px) --- */
@media (max-width: 768px) {
  /* Single sleek compact top bar (~48px tall) */
  .top-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 6px 8px;
    gap: 6px;
  }

  .brand {
    flex: 1;
    gap: 6px;
  }

  .brand > div {
    flex: 1;
    min-width: 0;
  }

  .title-row {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .brand h1,
  .subtitle,
  #dataBadge,
  .quality-widget,
  #btnSnapshot,
  #btnSettings {
    display: none !important;
  }

  .lake-select {
    flex: 1;
    min-width: 0;
    max-width: 165px;
    font-size: 11.5px;
    padding: 5px 6px;
  }

  .scenario-select {
    max-width: 96px;
    font-size: 11px;
    padding: 5px 5px;
  }

  #btnAnalytics {
    padding: 6px 9px;
    font-size: 11.5px;
  }

  /* Slide-over drawer (auto-collapsed on load!) */
  .sidebar {
    top: 60px;
    left: 8px;
    bottom: calc(98px + env(safe-area-inset-bottom, 0px));
    width: min(85vw, 300px);
    z-index: 35;
    background: rgba(11, 16, 26, 0.95);
  }

  /* Compact slim live exposure bar right beneath top bar + clean full-width inspector */
  .right-stack {
    top: 60px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - 210px);
    gap: 6px;
  }

  .exposure-hud {
    padding: 6px 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
  }

  .exp-hud-header {
    display: none;
  }

  .exp-metric {
    margin-bottom: 0;
  }

  .exp-metric-top {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .exp-metric-top strong {
    font-size: 11.5px;
  }

  .inspector {
    padding: 10px;
  }

  .insp-advice {
    display: none;
  }

  /* Compact bottom-right camera bar above playback dock */
  .nav-widget {
    right: 8px;
    bottom: calc(98px + env(safe-area-inset-bottom, 0px));
    padding: 4px 5px;
    gap: 4px;
  }

  .nav-compass {
    width: 28px;
    height: 28px;
  }

  .nav-btn {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  /* Compact thumb-friendly bottom playback dock */
  .bottom-dock {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    height: 84px;
    padding: 7px 10px;
    gap: 0;
  }

  .hydro-col {
    display: none !important;
  }

  .playback-col {
    min-width: 0;
  }

  .playback-header {
    margin-bottom: 5px;
  }

  #timeDisplay {
    font-size: 15px;
  }

  .wave-status {
    display: none;
  }

  .timeline-ticks span:first-child {
    font-size: 9px;
  }

  .cesium-widget-credits {
    left: 8px !important;
    bottom: calc(98px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: 45vw;
    font-size: 9px !important;
  }

  /* Analytics dashboard optimized for phone scrolling */
  .analytics-backdrop {
    padding: 6px;
  }

  .analytics-panel {
    padding: 12px;
    border-radius: 12px;
    gap: 12px;
  }

  .analytics-header h2 {
    font-size: 15px;
  }

  .analytics-actions {
    width: 100%;
    justify-content: space-between;
  }

  .analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .kpi-card {
    padding: 8px 10px;
  }

  .kpi-val {
    font-size: 16px;
  }

  .chart-card {
    padding: 10px;
  }

  .analytics-canvas {
    height: 215px;
  }

  .chart-card-wide .analytics-canvas {
    height: 245px;
  }

  .toast-container {
    top: 112px;
  }
}