/* MarsGPS — dark Material-style map UI */

:root {
  --gm-surface: #202124;
  --gm-surface-elevated: #303134;
  --gm-surface-hover: #35363a;
  --gm-border: #3c4043;
  --gm-text-primary: #e8eaed;
  --gm-text-secondary: #9aa0a6;
  --gm-blue: #8ab4f8;
  --gm-blue-solid: #1a73e8;
  --gm-blue-tint: rgba(138, 180, 248, 0.14);
  --gm-red: #ea4335;
  --gm-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0e14;
  color: var(--gm-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Full-Bleed Map Viewport */
.gm-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

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

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

/* Directions drawer (left panel; bottom sheet on phones) */
.gm-directions-drawer {
  position: absolute;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: 392px;
  max-width: calc(100vw - 24px);
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 16px;
  box-shadow: var(--gm-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}

/* Top Product Header & Travel Mode Tabs */
.gm-drawer-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--gm-border);
}

.gm-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gm-logo-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gm-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--gm-text-primary);
  letter-spacing: -0.01em;
}

.gm-logo-text span {
  color: var(--gm-text-secondary);
  font-weight: 400;
}

.gm-datum-tag {
  font-size: 11px;
  color: var(--gm-text-secondary);
  background: var(--gm-surface-elevated);
  padding: 2px 8px;
  border-radius: 999px;
}

.gm-mars-now {
  margin: -4px 0 8px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--gm-text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Travel Mode Selector Tabs (car / transit / walk style) */
.gm-travel-modes {
  display: flex;
  gap: 4px;
}

.gm-mode-tab {
  flex: 1;
  background: transparent;
  color: var(--gm-text-secondary);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 6px 4px 8px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: background 0.15s, color 0.15s;
}

.gm-mode-tab:hover {
  background: var(--gm-surface-hover);
  color: var(--gm-text-primary);
}

.gm-mode-tab.active {
  color: var(--gm-blue);
  border-bottom-color: var(--gm-blue);
  background: var(--gm-blue-tint);
}

/* Waypoints Input Block (Origin ○ / Dots ⋮ / Red Pin) */
.gm-waypoints-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gm-border);
}

.gm-waypoints-grid {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-connector-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 18px;
  flex-shrink: 0;
}

.gm-origin-ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--gm-text-secondary);
}

.gm-dotted-stem {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 2px 0;
}

.gm-dotted-stem span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gm-text-secondary);
}

.gm-inputs-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.gm-input {
  width: 100%;
  background: var(--gm-surface-elevated);
  color: var(--gm-text-primary);
  border: 1px solid var(--gm-border);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.gm-input:focus {
  border-color: var(--gm-blue);
}

.gm-swap-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--gm-text-secondary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.gm-swap-btn:hover {
  background: var(--gm-surface-hover);
  color: var(--gm-text-primary);
}

/* Route Options & Quick Preset Chips */
.gm-route-options-toggle {
  display: none; /* phones only */
  align-items: center;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 2px 2px 4px;
  background: none;
  border: none;
  color: var(--gm-blue);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

.gm-route-options-toggle .gm-chevron {
  display: inline-block;
  transition: transform 0.15s;
}

.gm-route-options-toggle[aria-expanded="true"] .gm-chevron {
  transform: rotate(180deg);
}

.gm-options-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--gm-text-secondary);
}

.gm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

.gm-checkbox-label input {
  accent-color: var(--gm-blue-solid);
}

.gm-presets-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-top: 9px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.gm-presets-scroll::-webkit-scrollbar {
  display: none;
}

.gm-chip {
  background: var(--gm-surface-elevated);
  color: var(--gm-text-primary);
  border: 1px solid var(--gm-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.gm-chip:hover {
  background: var(--gm-surface-hover);
  border-color: var(--gm-blue);
}

/* Scrollable Body of Directions Drawer */
.gm-drawer-body {
  flex: 1;
  overflow-y: auto;
}

/* Route summary rows */
.gm-routes-list {
  border-bottom: 1px solid var(--gm-border);
}

.gm-route-row {
  position: relative;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--gm-border);
  cursor: pointer;
  transition: background 0.15s;
}

.gm-route-row:last-child {
  border-bottom: none;
}

.gm-route-row:hover {
  background: var(--gm-surface-hover);
}

.gm-route-row.selected {
  background: rgba(138, 180, 248, 0.08);
}

.gm-route-row.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--gm-blue);
}

.gm-route-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.gm-route-via {
  font-size: 14px;
  font-weight: 500;
  color: var(--gm-text-primary);
}

.gm-route-dur {
  font-size: 15px;
  font-weight: 600;
  color: var(--gm-blue);
  white-space: nowrap;
}

.gm-route-subrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
  font-size: 12px;
  color: var(--gm-text-secondary);
}

.gm-route-dist {
  font-weight: 500;
  color: var(--gm-text-primary);
}

/* Third line: the drive at a real rover's pace, and an Earth distance the length matches */
.gm-route-facts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--gm-text-secondary);
}

.gm-route-facts:empty,
.gm-route-facts span:empty {
  display: none;
}

.gm-route-pace strong {
  font-weight: 600;
  color: var(--gm-text-primary);
}

/* Elevation section */
.gm-elevation-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gm-border);
  background: rgba(0, 0, 0, 0.14);
}

.gm-elev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.gm-elev-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gm-text-primary);
}

.gm-elev-sub {
  font-size: 11px;
  color: var(--gm-text-secondary);
}

.gm-elev-canvas-wrap {
  height: 108px;
  width: 100%;
  position: relative;
}

#elevation-profile-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Rover Traverse Preview Bar inside Drawer */
.gm-sim-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gm-border);
}

.gm-sim-btn {
  background: var(--gm-blue-solid);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.gm-sim-btn:hover {
  background: #1b66c9;
}

.gm-sim-scrubber {
  flex: 1;
  accent-color: var(--gm-blue);
  cursor: pointer;
}

.gm-sim-readout {
  font-size: 11px;
  color: var(--gm-text-secondary);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Turn-by-Turn Steps */
.gm-steps-header {
  padding: 10px 16px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gm-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gm-steps-list {
  padding: 0 16px 16px;
}

.gm-step-row {
  display: flex;
  gap: 12px;
  padding: 10px 4px;
  cursor: pointer;
  border-radius: 8px;
}

.gm-step-row:hover {
  background: var(--gm-surface-hover);
}

.gm-step-icon {
  width: 22px;
  height: 22px;
  color: var(--gm-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.gm-step-content {
  flex: 1;
  min-width: 0;
}

.gm-step-primary {
  font-size: 13px;
  font-weight: 500;
  color: var(--gm-text-primary);
}

.gm-step-secondary {
  font-size: 12px;
  color: var(--gm-text-secondary);
  margin-top: 2px;
}

.gm-step-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--gm-text-secondary);
}

.gm-step-line {
  flex: 1;
  height: 1px;
  background: var(--gm-border);
}

/* Floating Bottom-Center Place Sheet (knowledge card) */
.gm-place-card {
  position: absolute;
  bottom: 24px;
  left: 420px;
  width: 440px;
  max-width: calc(100vw - 440px);
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 16px;
  box-shadow: var(--gm-shadow);
  padding: 14px;
  display: flex;
  gap: 14px;
  z-index: 15;
}

.gm-place-media {
  width: 124px;
  height: 124px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #14171f;
  border: 1px solid var(--gm-border);
}

#place-preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#place-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.gm-place-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.gm-place-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gm-text-primary);
}

.gm-place-subtitle {
  font-size: 12px;
  color: var(--gm-text-secondary);
  margin-top: 1px;
}

.gm-close-btn {
  background: transparent;
  color: var(--gm-text-secondary);
  border: none;
  cursor: pointer;
  padding: 2px;
}

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

.gm-place-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
  font-size: 11px;
  color: var(--gm-blue);
}

.gm-place-desc {
  font-size: 12px;
  color: var(--gm-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gm-place-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.gm-pill-action {
  background: var(--gm-surface-elevated);
  color: var(--gm-blue);
  border: 1px solid var(--gm-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.gm-pill-action:hover {
  background: var(--gm-blue-tint);
  border-color: var(--gm-blue);
}

/* Floating Top-Right Layers Bar & MOLA Scale Legend */
.gm-top-right-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 15;
}

.gm-layer-switcher {
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: var(--gm-shadow);
}

.gm-layer-btn {
  background: transparent;
  color: var(--gm-text-secondary);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.gm-layer-btn.active {
  background: var(--gm-blue-solid);
  color: #ffffff;
}

.gm-globe-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--gm-text-primary);
  border-left: 1px solid var(--gm-border);
  cursor: pointer;
}

.gm-hardware-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: #fdd663;
  border: none;
  border-left: 1px solid var(--gm-border);
  border-radius: 0 999px 999px 0;
  padding: 6px 12px 6px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.gm-hardware-toggle-btn:hover {
  background: rgba(251, 188, 4, 0.14);
}

.gm-hardware-toggle-btn.active {
  background: #f9ab00;
  color: #202124;
  font-weight: 600;
  border-radius: 999px;
}

.gm-hardware-drawer {
  width: 300px;
  max-height: 330px;
  background: rgba(32, 33, 36, 0.96);
  border: 1px solid var(--gm-border);
  border-radius: 12px;
  box-shadow: var(--gm-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.gm-hardware-drawer.hidden {
  display: none;
}

.gm-hardware-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--gm-border);
}

.gm-hardware-title {
  font-size: 13px;
  font-weight: 600;
  color: #fdd663;
}

.gm-hardware-subtitle {
  font-size: 11px;
  color: var(--gm-text-secondary);
  margin-top: 1px;
}

.gm-hardware-list {
  overflow-y: auto;
  max-height: 270px;
  padding: 4px 0;
}

.gm-hardware-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(60, 64, 67, 0.45);
  transition: background 0.12s;
}

.gm-hardware-item:last-child {
  border-bottom: none;
}

.gm-hardware-item:hover {
  background: var(--gm-surface-hover);
}

.gm-hardware-item.selected {
  background: rgba(251, 188, 4, 0.14);
  border-left: 3px solid #fbbc04;
}

.gm-hw-item-main {
  min-width: 0;
  flex: 1;
}

.gm-hw-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--gm-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-hw-item-meta {
  font-size: 10.5px;
  color: var(--gm-text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-hw-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.gm-hw-badge.active {
  background: rgba(129, 201, 149, 0.16);
  color: #81c995;
  border: 1px solid rgba(129, 201, 149, 0.4);
}

.gm-hw-badge.historic {
  background: rgba(253, 214, 99, 0.14);
  color: #fdd663;
  border: 1px solid rgba(253, 214, 99, 0.35);
}

.gm-mola-legend {
  background: rgba(32, 33, 36, 0.92);
  border: 1px solid var(--gm-border);
  border-radius: 999px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--gm-text-secondary);
  box-shadow: var(--gm-shadow);
}

.gm-mola-bar {
  width: 96px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    #342220 0%,
    #563026 18%,
    #804430 35%,
    #a65a3a 50%,
    #c47448 64%,
    #d8905c 76%,
    #e4ae7e 88%,
    #faeee2 100%
  );
}

/* Bottom-right zoom stack & scale footer */
.gm-bottom-right-stack {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 15;
}

.gm-zoom-pill {
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 8px;
  box-shadow: var(--gm-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gm-icon-ctrl {
  width: 36px;
  height: 36px;
  background: transparent;
  color: var(--gm-text-primary);
  border: none;
  border-bottom: 1px solid var(--gm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.gm-icon-ctrl:last-child {
  border-bottom: none;
}

.gm-icon-ctrl:hover {
  background: var(--gm-surface-hover);
}

.gm-telemetry-footer {
  background: rgba(32, 33, 36, 0.9);
  border: 1px solid var(--gm-border);
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--gm-text-secondary);
  font-variant-numeric: tabular-nums;
}

.gm-scale-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-scale-line {
  width: 64px;
  height: 5px;
  border-bottom: 2px solid var(--gm-text-primary);
  border-left: 2px solid var(--gm-text-primary);
  border-right: 2px solid var(--gm-text-primary);
}


/* =========================================================================
   MarsGPS additions: brand mark, loading chip, about sheet, phone bottom sheet
   ========================================================================= */
.gm-viewport {
  height: 100dvh;
}

#mars-map-canvas {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.gm-logo-mark {
  flex-shrink: 0;
}

.gm-sheet-handle {
  display: none;
}

.gm-about-btn {
  color: var(--gm-text-secondary);
}

.gm-loading {
  position: absolute;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--gm-surface-elevated);
  color: var(--gm-text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--gm-border);
  box-shadow: var(--gm-shadow);
  pointer-events: none;
  white-space: nowrap;
}

.gm-about {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gm-about-card {
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 20px 22px 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--gm-text-primary);
  box-shadow: var(--gm-shadow);
}

.gm-about-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.gm-about-card h2 {
  font-size: 18px;
  font-weight: 600;
}

.gm-about-card h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gm-text-secondary);
  margin: 14px 0 4px;
}

.gm-about-card p,
.gm-about-card ul {
  margin: 6px 0;
  color: #d5d8dc;
}

.gm-about-card ul {
  padding-left: 18px;
}

.gm-about-card a {
  color: var(--gm-blue);
}

.gm-about-foot {
  color: var(--gm-text-secondary) !important;
  font-size: 12px;
  margin-top: 14px !important;
}

/* Phones: the drawer becomes a bottom sheet, the globe sits above it */
@media (max-width: 760px) {
  .gm-directions-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 46dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    transition: height 0.25s ease;
  }

  .gm-directions-drawer.expanded {
    height: 88dvh;
  }

  .gm-sheet-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  .gm-sheet-handle span {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #5f6368;
  }

  .gm-drawer-header {
    padding: 2px 12px 6px;
  }

  .gm-brand-row {
    margin-bottom: 2px;
  }

  .gm-datum-tag {
    display: none;
  }

  /* Mars time shares the brand row (right-aligned, short form written by app.js) */
  .gm-mars-now {
    margin: -23px 0 4px 118px;
    line-height: 20px;
    text-align: right;
    font-size: 10px;
  }

  /* Avoid-checkboxes and preset chips fold behind one line so the route rows fit the half-height sheet */
  .gm-route-options-toggle {
    display: flex;
  }

  .gm-route-options {
    display: none;
  }

  .gm-route-options.open {
    display: block;
  }

  .gm-top-right-controls {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  /* One compact row: Satellite · Terrain · Relief | 3D | spacecraft icon | About */
  .gm-layer-switcher {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0;
    padding: 3px;
    border-radius: 999px;
    max-width: 100%;
    margin-left: auto;
  }
  .gm-layer-btn {
    padding: 6px 8px;
    font-size: 11.5px;
  }
  .gm-long {
    display: none;
  }
  .gm-globe-toggle {
    padding: 0 7px;
    font-size: 11.5px;
    gap: 4px;
  }
  .gm-hardware-toggle-btn {
    padding: 6px 9px 6px 8px;
  }
  .gm-hardware-toggle-btn span {
    display: none;
  }

  .gm-mola-legend {
    display: none;
  }

  .gm-hardware-drawer {
    width: min(360px, calc(100vw - 20px));
    max-height: 36dvh;
  }

  .gm-hardware-list {
    max-height: calc(36dvh - 60px);
  }

  .gm-place-card {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    bottom: calc(46dvh + 10px);
    padding: 10px 12px;
    gap: 10px;
  }

  .gm-directions-drawer.expanded ~ .gm-place-card {
    display: none;
  }

  .gm-place-media {
    width: 64px;
    height: 64px;
  }

  .gm-place-desc {
    display: none;
  }

  .gm-place-actions {
    margin-top: 6px;
  }

  .gm-bottom-right-stack {
    display: none;
  }

  .gm-loading {
    bottom: calc(46dvh + 10px);
  }
}

#elevation-profile-canvas {
  touch-action: none;
}

/* Rover-track readout: sol and odometer at the hovered / tapped point of a driven path */
.gm-track-tip {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, calc(-100% - 12px));
  background: rgba(32, 33, 36, 0.94);
  border: 1px solid rgba(255, 213, 74, 0.55);
  color: #ffe08a;
  font: 500 12px/1.3 -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.gm-track-tip.hidden {
  display: none;
}
