:root {
  --bg-void: #04070f;
  --bg-deep: #070c18;
  --bg-panel: rgba(11, 17, 32, 0.92);
  --bg-panel-solid: #0b1120;
  --bg-card: rgba(17, 25, 45, 0.78);
  --bg-card-hover: rgba(24, 35, 62, 0.92);
  --bg-glass: rgba(13, 20, 38, 0.88);

  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-highlight: rgba(56, 189, 248, 0.35);
  --border-emerald: rgba(16, 185, 129, 0.4);
  --border-amber: rgba(245, 158, 11, 0.45);

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

  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.22);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.22);
  --indigo: #6366f1;
  --violet: #a855f7;
  --amber: #f59e0b;
  --rose: #f43f5e;

  --land-base: #131d33;
  --land-hover: #1e2f52;
  --land-border: #293c63;
  --ocean-base: #050913;
  --inv-zoom: 1;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Main App Grid */
.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 45%, #0a1326 0%, #050811 70%, #03050a 100%);
}

/* Top Navigation & Telemetry Header */
.top-header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 11, 22, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 40;
  flex-shrink: 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-orb {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-orb svg {
  width: 20px;
  height: 20px;
  color: var(--cyan);
}

.brand-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #93c5fd, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-pills {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}

.mode-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.mode-pill.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(99, 102, 241, 0.22));
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.header-telemetry {
  display: flex;
  align-items: center;
  gap: 14px;
}

.telemetry-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.telemetry-chip .label {
  color: var(--text-muted);
}

.telemetry-chip .val {
  color: var(--cyan);
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
}

/* Workspace Body */
.workspace {
  position: relative;
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Left Sidebar: Country Explorer & Presets */
.sidebar-left {
  width: 330px;
  height: 100%;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 30;
  flex-shrink: 0;
}

.panel-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.section-title {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

/* Search & Filter Controls */
.search-box {
  position: relative;
  margin-bottom: 10px;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: rgba(8, 13, 26, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.search-box input:focus {
  border-color: var(--cyan);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-select {
  flex: 1;
  background: rgba(8, 13, 26, 0.9);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
}

/* Country Scrollable List */
.country-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  contain: content;
}

.country-list::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar {
  width: 5px;
}

.country-list::-webkit-scrollbar-thumb,
.sidebar-right::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

.country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid transparent;
  cursor: pointer;
}

.country-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.28);
}

.country-item.selected {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.14));
  border-color: var(--cyan);
}

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

.country-flag {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.country-names {
  min-width: 0;
}

.country-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-meta-sub {
  font-size: 0.69rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.country-item-right {
  text-align: right;
  flex-shrink: 0;
}

.country-area-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #e2e8f0;
}

.country-distortion-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  margin-top: 2px;
}

/* Curated Presets */
.presets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 195px;
  overflow-y: auto;
}

.preset-btn {
  text-align: left;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary);
  cursor: pointer;
}

.preset-btn:hover {
  border-color: var(--cyan);
  background: rgba(30, 41, 70, 0.85);
}

.preset-btn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 2px;
}

.preset-btn-sub {
  font-size: 0.69rem;
  color: var(--text-secondary);
}

/* Center Map Viewport */
.map-stage {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: #040812;
  contain: strict;
}

#world-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  shape-rendering: optimizeSpeed;
}

#world-map-svg.panning {
  cursor: grabbing;
}

#world-map-svg.dragging-country {
  cursor: move;
}

.map-zoom-layer {
  will-change: transform;
}

/* SVG Cartography Elements (GPU optimized without expensive filters or per-frame vector-effect) */
.sphere-bg {
  fill: #050a15;
}

.graticule-line {
  fill: none;
  stroke: rgba(56, 189, 248, 0.065);
  stroke-width: calc(0.6px * var(--inv-zoom, 1));
  pointer-events: none;
}

.equator-line {
  fill: none;
  stroke: rgba(56, 189, 248, 0.28);
  stroke-width: calc(1.1px * var(--inv-zoom, 1));
  stroke-dasharray: 6 4;
  pointer-events: none;
}

.tropic-line {
  fill: none;
  stroke: rgba(168, 85, 247, 0.15);
  stroke-width: calc(0.8px * var(--inv-zoom, 1));
  stroke-dasharray: 3 4;
  pointer-events: none;
}

.mercator-ghost-path {
  fill: rgba(15, 23, 42, 0.28);
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: calc(0.55px * var(--inv-zoom, 1));
  pointer-events: none;
}

.country-path {
  fill: var(--land-base);
  stroke: var(--land-border);
  stroke-width: calc(0.65px * var(--inv-zoom, 1));
  cursor: grab;
}

@media (hover: hover) and (pointer: fine) {
  .country-path:hover {
    fill: var(--land-hover);
    stroke: #60a5fa;
    stroke-width: calc(1.1px * var(--inv-zoom, 1));
  }
}

.country-path.source-ghost {
  fill: rgba(56, 189, 248, 0.07);
  stroke: rgba(56, 189, 248, 0.45);
  stroke-width: calc(1.1px * var(--inv-zoom, 1));
}

.country-path.target-hovered {
  fill: rgba(16, 185, 129, 0.28) !important;
  stroke: var(--emerald) !important;
  stroke-width: calc(1.4px * var(--inv-zoom, 1)) !important;
}

/* Active Dragged Country Layer — zero drop-shadow filter so mobile GPUs run at locked 60fps */
.dragged-country-path {
  fill: rgba(56, 189, 248, 0.38);
  stroke: #38bdf8;
  stroke-width: calc(1.8px * var(--inv-zoom, 1));
  pointer-events: none;
  will-change: d;
}

.dragged-country-path.returning {
  fill: rgba(168, 85, 247, 0.34);
  stroke: #c084fc;
}

.geodesic-arc {
  fill: none;
  stroke: var(--amber);
  stroke-width: calc(1.5px * var(--inv-zoom, 1));
  stroke-dasharray: 5 4;
  pointer-events: none;
}

.centroid-marker {
  fill: var(--cyan);
  stroke: #ffffff;
  stroke-width: calc(1.4px * var(--inv-zoom, 1));
  pointer-events: none;
}

/* Floating Instruction Banner on Map */
.map-top-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 13, 25, 0.92);
  border: 1px solid var(--border-highlight);
  border-radius: 999px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
  pointer-events: none;
  white-space: nowrap;
}

.banner-tag {
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  color: #030712;
  font-weight: 800;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
}

.banner-text {
  font-size: 0.81rem;
  color: var(--text-primary);
  font-weight: 500;
}

.banner-text strong {
  color: var(--cyan);
}

/* Floating Live Comparison HUD Overlay */
.live-comparison-hud {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 580px;
  max-width: 92%;
  background: rgba(8, 13, 26, 0.94);
  border: 1px solid var(--border-highlight);
  border-radius: 16px;
  padding: 14px 20px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hud-country-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(17, 25, 45, 0.88);
  border: 1px solid var(--border-subtle);
}

.hud-country-box.source-box {
  border-color: rgba(56, 189, 248, 0.45);
}

.hud-country-box.target-box {
  border-color: rgba(16, 185, 129, 0.45);
}

.hud-flag {
  font-size: 1.6rem;
}

.hud-c-info {
  min-width: 0;
}

.hud-c-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--text-muted);
}

.hud-c-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.hud-c-area {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--cyan);
}

.hud-target .hud-c-area {
  color: var(--emerald);
}

.hud-vs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 135px;
  text-align: center;
}

.hud-ratio-badge {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 3px 12px;
  border-radius: 999px;
}

.hud-ratio-sub {
  font-size: 0.69rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.hud-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  gap: 14px;
}

.hud-telemetry-bar span strong {
  color: #fff;
}

/* Map Zoom & Projection Controls */
.map-controls-dock {
  position: absolute;
  right: 18px;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 25;
}

.ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(11, 17, 32, 0.92);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
}

.ctrl-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Map Legend */
.map-legend {
  position: absolute;
  left: 18px;
  bottom: 20px;
  background: rgba(11, 17, 32, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 10px 14px;
  z-index: 20;
  font-size: 0.72rem;
}

.legend-title {
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-size: 0.67rem;
}

.legend-gradient {
  width: 160px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #132347 0%, #0284c7 35%, #6366f1 65%, #a855f7 85%, #f43f5e 100%);
  margin-bottom: 4px;
}

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

/* Right Sidebar: Geodesic Inspector */
.sidebar-right {
  width: 350px;
  height: 100%;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 30;
  flex-shrink: 0;
  contain: content;
}

.inspector-hero {
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.inspector-flag {
  font-size: 2.2rem;
  line-height: 1;
}

.inspector-name {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.inspector-official {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.inspector-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.meta-pill strong {
  color: var(--cyan);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}

.metric-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-value.accent-cyan { color: var(--cyan); }
.metric-value.accent-emerald { color: var(--emerald); }
.metric-value.accent-amber { color: var(--amber); }
.metric-value.accent-violet { color: #c084fc; }

.metric-sub {
  font-size: 0.66rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.curvature-callout {
  margin: 14px 16px;
  padding: 12px 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.28);
  font-size: 0.78rem;
  line-height: 1.5;
  color: #dbeafe;
}

.curvature-callout-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comparison-bars {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.bar-group {
  margin-bottom: 12px;
}

.bar-group:last-child {
  margin-bottom: 0;
}

.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  margin-bottom: 5px;
  color: var(--text-secondary);
}

.bar-header strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.bar-track {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-fill.fill-cyan {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.bar-fill.fill-emerald {
  background: linear-gradient(90deg, #059669, #10b981);
}

.bar-fill.fill-violet {
  background: linear-gradient(90deg, #6366f1, #a855f7);
}

.distortion-curve-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.curve-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
}

.curve-lat {
  color: var(--text-secondary);
  width: 48px;
}

.curve-bar-wrap {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  margin: 0 10px;
  overflow: hidden;
}

.curve-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 999px;
}

.curve-mult {
  color: var(--cyan);
  font-weight: 600;
  width: 48px;
  text-align: right;
}

/* Cursor Tooltip */
.map-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  background: rgba(7, 11, 22, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.76rem;
  opacity: 0;
  transform: translate(14px, 14px);
}

.map-tooltip.visible {
  opacity: 1;
}

.tt-title {
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.tt-sub {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--cyan);
}

.tt-hint {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Mobile & Phone Support (Drawers, Touch Controls, Responsive HUD) */
.brand-row-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-btns {
  display: none;
  align-items: center;
  gap: 6px;
}

.mobile-sheet-btn {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mobile-sheet-btn:active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cyan);
}

.mobile-close-btn {
  display: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.72);
  z-index: 45;
}

.mobile-backdrop.visible {
  display: block;
}

@media (max-width: 1180px) {
  .sidebar-left { width: 260px; }
  .sidebar-right { width: 280px; }
  .live-comparison-hud { min-width: 400px; }
}

@media (max-width: 900px) {
  .top-header {
    height: auto;
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    backdrop-filter: none;
  }

  .brand-row-mobile {
    width: 100%;
  }

  .brand-orb {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .brand-title {
    font-size: 0.84rem;
  }

  .mobile-drawer-btns {
    display: flex;
  }

  .mobile-close-btn {
    display: inline-flex;
  }

  .brand-subtitle,
  .header-telemetry,
  .map-top-banner,
  .map-legend,
  .map-tooltip {
    display: none !important;
  }

  .header-controls {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 6px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .mode-pills {
    flex-shrink: 0;
  }

  .mode-pill {
    padding: 5px 9px;
    font-size: 0.69rem;
  }

  .sidebar-left,
  .sidebar-right {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(86vw, 330px);
    z-index: 50;
    background: var(--bg-panel-solid);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    transition: transform 0.22s ease;
  }

  .sidebar-left {
    left: 0;
    transform: translateX(-105%);
  }

  .sidebar-left.mobile-open {
    transform: translateX(0);
  }

  .sidebar-right {
    right: 0;
    transform: translateX(105%);
  }

  .sidebar-right.mobile-open {
    transform: translateX(0);
  }

  .map-zoom-controls {
    right: 10px;
    top: 10px;
    gap: 5px;
  }

  .zoom-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .live-comparison-hud {
    min-width: 0;
    width: calc(100% - 16px);
    max-width: none;
    bottom: 8px;
    padding: 8px 10px;
    border-radius: 12px;
  }

  .hud-row-main {
    gap: 6px;
    margin-bottom: 6px;
  }

  .hud-country-box {
    padding: 5px 7px;
    gap: 6px;
    border-radius: 8px;
  }

  .hud-flag {
    font-size: 1.15rem;
  }

  .hud-c-label {
    font-size: 0.56rem;
  }

  .hud-c-name {
    font-size: 0.74rem;
  }

  .hud-c-area {
    font-size: 0.66rem;
  }

  .hud-vs-center {
    min-width: 74px;
    padding: 0 2px;
  }

  .hud-ratio-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  .hud-ratio-sub {
    font-size: 0.58rem;
    max-width: 95px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hud-telemetry-bar {
    font-size: 0.62rem;
    padding-top: 6px;
    flex-wrap: wrap;
    gap: 4px 8px;
  }
}

