/* features/map/base.css */
/* ============================================================
   Map base — the atlas shell.
   A docked editorial rail beside a full-bleed map plate.
   Layout only; rail internals live in atlas-rail.css and the
   on-map furniture (search, plate, popover) in map-plate.css.
   ============================================================ */

.map-wrapper.atlas-shell {
  --atlas-rail-width: clamp(300px, 24vw, 360px);

  flex-grow: 1;

  /* Keep the WebGL canvas viewport-sized. Without an explicit height, a
     long journal in the rail stretches the sibling map into a giant canvas,
     eventually exceeding the browser's renderable texture size. */
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  min-height: 0;
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

/* Hero map — fully immersive on the /map route */
body[data-route="/map"] .map-wrapper {
  border-radius: 0;
  box-shadow: none;
  border: 0;
}

body[data-route="/map"] .main-content {
  padding-top: var(--header-height);
  padding-bottom: 0;
  overflow: hidden;
}

body[data-route="/map"] .persistent-shell {
  padding: 0;
  margin: 0;
  min-height: 0;
}

body[data-route="/map"] .app-footer {
  display: none;
}

/* === Map container === */
#map {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  min-width: 0;
  position: relative; /* Anchor absolute children like #map-canvas + overlays */
  background-color: var(--surface-1);
  z-index: var(--z-base);
  outline: none;
}

#map.atlas-map {
  align-self: stretch;
  height: auto;
}

#map-canvas {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
}

/* Gentle ease-in as tiles arrive — replaces the old cinematic intro */
#map-canvas .mapboxgl-canvas {
  animation: atlas-map-reveal 600ms ease-out both;
}

@keyframes atlas-map-reveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #map-canvas .mapboxgl-canvas {
    animation: none;
  }
}

/* Prevent overscroll on map page to avoid interference with map gestures */
body.map-page {
  overscroll-behavior: none;
}

/* === Map Init Error Overlay === */
.map-init-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  z-index: var(--z-overlay);
  pointer-events: none;
}

.map-init-error-card {
  width: min(560px, 100%);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  text-align: center;
  pointer-events: auto;
}

.map-init-error-card h2 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

.map-init-error-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

/* === Map Canvas & Markers === */
.mapboxgl-canvas-container.mapboxgl-interactive,
.mapboxgl-canvas-container {
  cursor: default;
}

.mapboxgl-canvas-container.mapboxgl-interactive:active,
.mapboxgl-canvas-container:active {
  cursor: grabbing;
}

.mapboxgl-canvas {
  transition: opacity var(--transition-normal);
}

.mapboxgl-canvas.loading {
  opacity: 0.6;
}

.mapboxgl-marker {
  transition: filter 0.2s ease-out;
}

.mapboxgl-marker > * {
  transition: transform 0.2s ease-out;
  transform-origin: center;
}

.mapboxgl-marker:hover > * {
  transform: scale(1.1);
}

/* features/map/atlas-rail.css */
/* ============================================================
   Atlas rail — the docked editorial panel beside the map.
   Type-led masthead, hairline figure band, lens tabs, and
   lens panels (trip journal, coverage, places, flow).
   Desktop: docked left column. Mobile: bottom sheet.
   ============================================================ */

.atlas-rail {
  display: flex;
  flex-direction: column;
  width: var(--atlas-rail-width);
  flex: 0 0 auto;
  min-height: 0;
  background: var(--manual-paper);
  border-right: 1.5px solid var(--manual-ink);
  z-index: var(--z-dropdown);
  transition:
    margin-left var(--transition-normal),
    visibility var(--transition-normal);
}

/* Desktop collapse: slide the rail out of the layout */
@media (width > 768px) {
  .atlas-rail.is-collapsed {
    margin-left: calc(-1 * var(--atlas-rail-width));
    visibility: hidden;
  }
}

/* ---- Masthead ------------------------------------------------ */
.atlas-rail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5) var(--space-4);
}

.atlas-masthead {
  min-width: 0;
}

.atlas-eyebrow {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--manual-rust-ink);
  font-family: var(--font-family-label);
}

.atlas-title {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.atlas-context {
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  min-height: 1.2em;
}

.atlas-rail-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.atlas-rail-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.atlas-rail-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ---- Figure band --------------------------------------------- */
.atlas-figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin: 0 var(--space-5);
  padding: var(--space-3) 0;
  border-top: 2px solid var(--manual-ink);
  border-bottom: 1px solid var(--manual-rule);
}

.atlas-figure {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.atlas-figure-value {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: var(--tracking-snug);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.atlas-figure-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--manual-ink-soft);
  white-space: normal;
  font-family: var(--font-family-label);
  line-height: 1.2;
}

/* ---- Lens tabs ------------------------------------------------ */
.atlas-lenses {
  display: flex;
  align-items: stretch;
  gap: var(--space-4);
  margin: 0 var(--space-5);
  border-bottom: 1px solid var(--border-color);
}

.atlas-lens-tab {
  position: relative;
  padding: var(--space-3) 0 calc(var(--space-3) - 2px);
  border: 0;
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-normal);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.atlas-lens-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background-color var(--transition-fast);
}

.atlas-lens-tab:hover {
  color: var(--text-secondary);
}

.atlas-lens-tab[aria-selected="true"] {
  color: var(--text-primary);
}

.atlas-lens-tab[aria-selected="true"]::after {
  background: var(--manual-ink);
}

.atlas-lens-tab:focus-visible {
  outline: var(--focus-outline);
  box-shadow: none;
  outline-offset: 2px;
}

/* ---- Rail body / lens panels ---------------------------------- */
.atlas-rail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) var(--space-5) var(--space-5);
  scrollbar-width: thin;
}

.atlas-lens-panel[hidden] {
  display: none;
}

.lens-empty,
.lens-hint {
  margin: var(--space-3) 0 0;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--text-tertiary);
}

.lens-empty {
  padding: var(--space-3);
  border: 1px dashed var(--border-color-light, var(--border-color));
  border-radius: var(--radius-md);
  background: rgb(var(--surface-rgb) / 34%);
}

.lens-block {
  margin-bottom: var(--space-5);
}

.lens-block-label {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-tertiary);
  font-family: var(--font-family-label);
}

/* ---- Shared small controls ------------------------------------ */
.lens-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.lens-segmented {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lens-segment {
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  border: 0;
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-normal);
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.lens-segment + .lens-segment {
  border-left: 1px solid var(--border-color);
}

.lens-segment[aria-pressed="true"] {
  background: rgb(var(--primary-rgb) / 14%);
  color: var(--text-primary);
}

.lens-segment:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.lens-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-tertiary);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-family-label);
}

.lens-check input {
  accent-color: var(--manual-ink);
  width: 14px;
  height: 14px;
  margin: 0;
}

.lens-check:has(input:checked) {
  color: var(--text-primary);
}

.lens-render-hint {
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  font-size: var(--font-size-xs);
  line-height: 1.45;
  color: var(--text-tertiary);
}

.lens-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.lens-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
  font-family: var(--font-family-label);
}

.lens-chip:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-color-light, var(--border-color));
}

.lens-chip.active {
  background: rgb(var(--primary-rgb) / 14%);
  border-color: var(--manual-rule);
  color: var(--text-primary);
}

.lens-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lens-chip:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ---- Trip journal --------------------------------------------- */
.trip-journal {
  list-style: none;
  margin: 0;
  padding: 0;
}

.journal-day {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-tertiary);
  font-family: var(--font-family-label);
}

.journal-day:first-child {
  margin-top: 0;
}

.journal-day::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-color);
  transform: translateY(-2px);
}

.journal-row {
  border-radius: var(--radius-sm);
}

.journal-row-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.journal-row-main:hover {
  background: var(--surface-1);
}

.journal-row-main:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.journal-time {
  font-family: var(--font-numeric);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.journal-dest {
  min-width: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-metric {
  font-family: var(--font-numeric);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.journal-row.is-selected .journal-row-main {
  background: var(--surface-1);
  box-shadow: inset 2px 0 0 var(--primary);
}

.journal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-2) var(--space-3) calc(var(--space-2) + 2px);
  margin: 0 calc(-1 * var(--space-2));
  border-left: 2px solid var(--manual-rule);
}

.journal-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.journal-detail dt {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-tertiary);
  font-family: var(--font-family-label);
}

.journal-detail dd {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Coverage lens --------------------------------------------- */
.coverage-progress {
  margin-bottom: var(--space-5);
}

.coverage-progress-readout {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.coverage-progress-value {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.coverage-progress-detail {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.coverage-progress-track {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}

.coverage-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 480ms cubic-bezier(0.4, 0, 0.2, 1);
}

.coverage-suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.coverage-suggestion {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.coverage-suggestion:hover {
  background: var(--surface-1);
}

.coverage-suggestion:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.coverage-suggestion-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coverage-suggestion-meta {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 1px;
}

.coverage-suggestion-distance {
  font-family: var(--font-numeric);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Location dropdown (coverage area selector) ---------------- */
.location-dropdown {
  position: relative;
}

.location-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.location-dropdown-trigger:hover {
  border-color: var(--border-color-light, var(--border-color));
}

.location-dropdown-trigger:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.location-dropdown-trigger .dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-dropdown-trigger .dropdown-label.is-placeholder {
  color: var(--text-tertiary);
}

.location-dropdown-trigger .dropdown-chevron {
  flex: 0 0 auto;
  font-size: 0.7em;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.location-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.location-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: var(--space-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-popover);
  display: none;
}

.location-dropdown.open .location-dropdown-menu {
  display: block;
}

.location-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.location-dropdown-item:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.location-dropdown-item.selected {
  color: var(--primary);
}

.location-dropdown-item .item-icon {
  font-size: 0.8em;
  color: var(--text-tertiary);
}

.location-dropdown-item.selected .item-icon {
  color: var(--primary);
}

.location-dropdown-empty {
  padding: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  text-align: center;
}

/* ---- Places lens ------------------------------------------------ */
.places-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.place-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.place-row:hover {
  background: var(--surface-1);
}

.place-row:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.place-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-meta {
  display: block;
  margin-top: 1px;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.place-visits {
  font-family: var(--font-numeric);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Legend footer ---------------------------------------------- */
.atlas-rail-footer {
  flex: 0 0 auto;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-color);
}

.atlas-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
}

.atlas-legend:empty {
  display: none;
}

.atlas-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-tertiary);
  font-family: var(--font-family-label);
}

.atlas-legend-swatch {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--legend-color, var(--text-tertiary));
}

.atlas-legend-swatch--dashed {
  background: repeating-linear-gradient(
    90deg,
    var(--legend-color, var(--text-tertiary)) 0 3px,
    transparent 3px 6px
  );
}

.atlas-legend-swatch--dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.atlas-legend-swatch--gradient {
  width: 34px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--legend-color, var(--warning)) 0%,
    var(--legend-color-2, var(--cat-coral)) 52%,
    var(--legend-color-3, var(--surface-1)) 100%
  );
}

/* A colour scale with its values beneath: trip heat, or trip age. */
.atlas-legend-item--scale {
  display: grid;
  grid-template-columns: auto minmax(120px, 184px);
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
}

.atlas-legend-ramp {
  grid-column: 2;
  height: 6px;
  border-radius: 1px;
}

.atlas-legend-ramp--heat {
  background: linear-gradient(
    90deg,
    var(--map-heat-0),
    var(--map-heat-1) 25%,
    var(--map-heat-2) 50%,
    var(--map-heat-3) 75%,
    var(--map-heat-4)
  );
}

[data-bs-theme="dark"] .atlas-legend-ramp--heat {
  box-shadow: 0 0 6px rgb(var(--manual-rust-rgb) / 35%);
}

.atlas-legend-ramp--fade {
  background: linear-gradient(
    90deg,
    rgb(var(--map-trip-path-rgb) / 30%),
    rgb(var(--map-trip-path-rgb) / 90%)
  );
}

.atlas-legend-ticks {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-numeric);
  font-weight: var(--font-weight-normal);
  letter-spacing: var(--tracking-normal);
  text-transform: none;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.atlas-legend-item--scale .atlas-legend-label {
  grid-row: 1;
  white-space: nowrap;
}

/* ---- Mobile: rail becomes the bottom sheet ----------------------- */
@media (width <= 768px) {
  body.sheet-open {
    overflow: hidden;
    touch-action: none;
  }

  .atlas-rail {
    --sheet-offset: calc(100% - 96px);

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 85vh;
    max-height: 85vh;
    border-right: 0;
    border-top: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--surface-0);
    transform: translate3d(0, var(--sheet-offset), 0);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: var(--z-drawer);
  }

  .atlas-rail.expanded {
    --sheet-offset: 0px;
  }

  .atlas-rail.dragging {
    transition: none;
  }

  /* Dynamic transition duration set by JS for velocity-based snapping */
  .atlas-rail.snap-transition {
    transition: transform var(--snap-duration, 300ms) cubic-bezier(0.32, 0.72, 0, 1);
  }

  .atlas-rail-header {
    padding: var(--space-2) var(--space-4) var(--space-3);
  }

  .atlas-rail-toggle {
    display: none;
  }

  .atlas-figures {
    margin: 0 var(--space-4);
  }

  .atlas-lenses {
    margin: 0 var(--space-4);
    gap: var(--space-3);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .atlas-lens-tab {
    min-height: var(--touch-target);
    white-space: nowrap;
  }

  .lens-tools {
    align-items: stretch;
  }

  .lens-segment,
  .lens-check,
  .journal-row-main,
  .coverage-suggestion,
  .place-row {
    min-height: var(--touch-target);
  }

  .lens-check {
    padding: 0 var(--space-1);
  }

  .atlas-rail-body {
    padding: var(--space-3) var(--space-4) var(--space-4);
    -webkit-overflow-scrolling: touch;
  }

  .atlas-rail-footer {
    display: none;
  }

  .mobile-sheet-handle-container {
    display: flex;
    justify-content: center;
    padding: var(--space-2) 0 0;
    touch-action: none;
  }

  .mobile-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: var(--surface-4);
  }

  .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(4 8 15 / 50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: calc(var(--z-drawer) - 1);
    transition:
      opacity 200ms ease,
      visibility 200ms ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-sheet-backdrop.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (width > 768px) {
  .mobile-sheet-handle-container {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-rail,
  .coverage-progress-fill {
    transition: none;
  }
}

/* features/map/map-plate.css */
/* ============================================================
   On-map furniture: the top bar (search + view popover), the
   cartographic plate notation, and the rail reopen tab.
   Quiet, typographic, hairline-bordered — no heavy chrome.
   ============================================================ */

/* ---- Top bar ---------------------------------------------------- */
.map-topbar {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  z-index: var(--z-dropdown);
  pointer-events: none;
}

.map-topbar > * {
  pointer-events: auto;
}

.map-topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: var(--space-2);
}

.map-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(340px, 60vw);
}

.map-search-icon {
  position: absolute;
  left: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  pointer-events: none;
}

.map-search-input {
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3) var(--space-2) calc(var(--space-3) + 1.35rem);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.map-search-input::placeholder {
  color: var(--text-tertiary);
}

.map-search-input:focus {
  outline: none;
  border-color: var(--manual-rule);
  box-shadow: var(--focus-ring);
}

/* ---- View control ------------------------------------------------ */
.map-view-control {
  position: relative;
}

.map-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-normal);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.map-view-toggle i {
  font-size: var(--font-size-xs);
}

.map-view-toggle span {
  display: none;
}

.map-view-toggle:hover,
.map-view-toggle[aria-expanded="true"] {
  color: var(--text-primary);
  border-color: var(--border-color-light, var(--border-color));
}

.map-view-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.view-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(232px, calc(100vw - var(--space-4)));
  padding: var(--space-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-popover);
}

.view-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: left;
}

button.view-popover-row {
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

button.view-popover-row:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

button.view-popover-row:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.view-popover-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-tertiary);
  font-family: var(--font-family-label);
}

.view-popover-select {
  flex: 1 1 auto;
  max-width: 128px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.view-popover-select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.view-switch-mark {
  flex: 0 0 auto;
  width: 26px;
  height: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-1);
  position: relative;
  transition: background-color var(--transition-fast);
}

.view-switch-mark::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast);
}

.view-popover-switch[aria-pressed="true"] .view-switch-mark {
  background: rgb(var(--primary-rgb) / 22%);
  border-color: var(--manual-rule);
}

.view-popover-switch[aria-pressed="true"] .view-switch-mark::after {
  transform: translateX(12px);
  background: var(--primary);
}

/* ---- Plate notation ---------------------------------------------- */
.map-plate {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  font-family: var(--font-family-label);
  font-size: var(--font-size-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  z-index: var(--z-base);
  pointer-events: none;
  user-select: none;
}

.map-plate-sep {
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* ---- Rail reopen tab ---------------------------------------------- */
.atlas-rail-reopen {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  cursor: pointer;
  z-index: var(--z-dropdown);
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
  font-family: var(--font-family-label);
}

.atlas-rail-reopen:hover {
  color: var(--text-primary);
  border-color: var(--border-color-light, var(--border-color));
}

.atlas-rail-reopen:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.atlas-rail-reopen i {
  font-size: var(--font-size-xs);
}

/* When the rail is open the reopen tab is out of the flow entirely */
.atlas-rail-reopen[hidden] {
  display: none;
}

/* Rail reopen shifts the search bar right when visible */
.atlas-rail-reopen:not([hidden]) ~ .map-topbar .map-search {
  margin-left: calc(96px + var(--space-2));
}

/* ---- Mobile ------------------------------------------------------- */
@media (width <= 768px) {
  .map-topbar {
    top: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
  }

  .map-search {
    flex: 1 1 auto;
    width: auto;
  }

  .map-view-toggle {
    justify-content: center;
    min-width: var(--touch-target);
    padding: var(--space-2);
  }

  .map-plate {
    display: none;
  }

  .atlas-rail-reopen {
    display: none;
  }
}

@media (width > 768px) {
  .map-view-toggle span {
    display: inline;
  }
}

/* features/map/layers.css */
/* Map Layers */

/* === Feature Styling (Trips, Streets) === */
.trip-path {
  /* Generic class for trip lines */
  transition:
    stroke-width 0.15s ease-out,
    opacity 0.15s ease-out,
    filter 0.15s ease-out;
  cursor: pointer;

  /* Default style set by JS, this is for interactions */
}

.trip-path:hover {
  /* stroke-width: increased by JS or specific layer paint properties */
  opacity: 1; /* Ensure hover is visible */
  filter: drop-shadow(0 0 3px rgb(255 255 255 / 70%));
}

.trip-path.selected {
  /* stroke-width: further increased by JS */
  filter: drop-shadow(0 0 6px var(--primary)); /* Use primary color for selection glow */
}

/* features/map/popups.css */
/* Map Popups */

/* === Mapbox GL JS Popup Styling === */
.mapboxgl-popup {
  z-index: var(--z-popover);
  animation: fadeInScale 0.2s ease-out; /* From map-enhancements */
}

/* Note: @keyframes fadeInScale moved to animations.css */

.mapboxgl-popup-content {
  font-family: var(--font-family);
  background-color: var(--manual-paper);
  color: var(--text-primary);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--manual-rule-faint);
  padding: 0; /* Remove default padding, handle in custom content */
  max-width: 350px;
  border: 1px solid var(--manual-ink);
}

.mapboxgl-popup-close-button {
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  padding: var(--space-2);
  line-height: 1;
  right: var(--space-2);
  top: var(--space-2);
  transition: all var(--transition-fast);
  border-radius: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mapboxgl-popup-close-button:hover {
  color: var(--text-primary);
  background: var(--manual-paper-shade);
}

/* === Trip Popup Styling === */

.trip-popup-content {
  padding: var(--space-4);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  min-width: 260px;
}

.trip-popup-header {
  font-weight: 800;
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
  padding-bottom: var(--space-2);
  border-bottom: 3px double var(--manual-ink);
  font-family: var(--font-family-display);
}

.trip-popup-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
}

.trip-popup-label {
  color: var(--text-secondary);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
  font-family: var(--font-family-label);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.trip-popup-value {
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
}

.trip-popup-actions {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--divider-color);
  display: flex;
  gap: var(--space-2);
}

.trip-popup-actions .btn {
  font-size: var(--font-size-xs);
  padding: var(--space-1) var(--space-3);
}

/* === Google Maps InfoWindow Styling === */

/* Strip Google's default InfoWindow backgrounds and shadows
   so the inner .mapboxgl-popup-content styling is visible. */
.gm-style-iw.gm-style-iw-c {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

/* Background container behind InfoWindow content */
.gm-style-iw-d {
  overflow: visible !important;
  max-height: none !important;
}

/* Remove the painted background panel behind the InfoWindow */
.gm-style .gm-style-iw-tc,
.gm-style .gm-style-iw-tc::after {
  display: none !important;
}

/* Hide Google's default close button (popups use their own) */
.gm-style-iw button.gm-ui-hover-effect {
  display: none !important;
}

/* Give the inner popup content its own visual card */
.gm-style-iw .mapboxgl-popup-content {
  background-color: var(--surface-1);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  min-width: 280px;
}

/* === Trip heat readout: the trip count under the pointer === */
.trip-heat-tip {
  pointer-events: none;
  animation: none;
}

.trip-heat-tip .mapboxgl-popup-content {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--manual-ink);
  box-shadow: 2px 2px 0 var(--manual-rule-faint);
  font-family: var(--font-numeric);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trip-heat-tip .mapboxgl-popup-tip {
  display: none;
}

/* features/map/live-tracking.css */
/* ============================================================
   Live trip strip — appears bottom-center of the map while a
   trip is in progress. Editorial: hairline border, mono figures,
   small-cap LIVE marker. Hidden entirely when inactive.
   ============================================================ */

.live-trip-hud {
  position: absolute;
  left: 50%;
  bottom: var(--space-4);
  transform: translate(-50%, 6px);
  z-index: var(--z-dropdown);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  max-width: min(480px, calc(100% - var(--space-8)));
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--transition-normal),
    transform var(--transition-normal);
}

.live-trip-hud.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.live-trip-hud.data-stale {
  opacity: 0.6;
}

.live-trip-hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.live-trip-hud.data-stale .live-trip-hud-dot {
  background: var(--warning);
}

.live-trip-hud-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--success);
  font-family: var(--font-family-label);
}

.live-trip-hud.data-stale .live-trip-hud-label {
  color: var(--warning);
}

.live-trip-hud-speed {
  font-family: var(--font-family-display);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  line-height: 1;
  color: var(--text-primary);
  min-width: 2ch;
  text-align: right;
}

.live-trip-hud-unit {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.live-trip-hud-divider {
  width: 1px;
  height: 16px;
  background: var(--border-color);
  flex-shrink: 0;
}

.live-trip-hud-street {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-trip-hud-follow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
  flex-shrink: 0;
  padding: 0;
}

.live-trip-hud-follow:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.live-trip-hud-follow.is-active {
  color: var(--primary);
  background: rgb(var(--primary-rgb) / 14%);
  border-color: var(--manual-rule);
}

.live-trip-hud-follow:disabled {
  opacity: 0.4;
  cursor: default;
}

.live-trip-hud-follow:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* === Mobile: sit above the bottom sheet === */
@media (width <= 768px) {
  .live-trip-hud {
    bottom: calc(var(--map-sheet-visible-height, 96px) + var(--space-3));
    max-width: min(92vw, 400px);
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }

  .live-trip-hud-street {
    max-width: 120px;
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .live-trip-hud {
    transition: none;
  }

  .live-trip-hud-dot {
    animation: none;
  }
}

/* features/map/particle-flow.css */
/* Particle Flow Visualization */
.particle-flow-canvas {
  image-rendering: auto;
  will-change: contents;
}

@media (prefers-reduced-motion: reduce) {
  .particle-flow-canvas {
    display: none;
  }
}

/* features/map/destination-bloom.css */
/* ============================
   Destination Bloom
   ============================ */

.destination-bloom-canvas {
  image-rendering: auto;
  will-change: contents;
}

.destination-bloom-canvas.blend-screen {
  mix-blend-mode: screen;
}

.destination-bloom-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 11rem;
  max-width: 14rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgb(255 206 135 / 18%);
  border-radius: var(--radius-sm);
  background: rgb(13 12 11 / 96%);
  box-shadow: var(--shadow-xs);
  color: rgb(247 235 212);
  font-size: var(--font-size-sm);
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translate(-9999px, -9999px);
  transition: opacity 140ms ease;
  z-index: calc(var(--z-dropdown) + 1);
}

.destination-bloom-tooltip.is-visible {
  opacity: 1;
}

.destination-bloom-tooltip.is-interactive {
  pointer-events: auto;
}

.destination-bloom-tooltip__title {
  margin-bottom: 0.25rem;
  color: rgb(255 223 166);
  font-weight: var(--font-weight-semibold);
}

.destination-bloom-tooltip__actions {
  display: flex;
  margin-top: 0.625rem;
}

.destination-bloom-tooltip__button {
  appearance: none;
  border: 1px solid rgb(255 205 135 / 28%);
  border-radius: var(--radius-sm);
  background: rgb(255 176 88 / 18%);
  color: rgb(255 233 191);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 0.35rem 0.7rem;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.destination-bloom-tooltip__button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgb(255 219 162 / 42%);
  background: rgb(255 188 96 / 26%);
}

.destination-bloom-tooltip__button:disabled {
  cursor: wait;
  opacity: 0.72;
}

@media (width <= 768px) {
  .destination-bloom-tooltip {
    max-width: min(13rem, calc(100vw - 2rem));
  }
}

.destination-bloom-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.75rem 1.25rem;
  border: 1px solid rgb(255 206 135 / 16%);
  border-radius: var(--radius-md, 0.75rem);
  background: rgb(14 12 10 / 88%);
  color: rgb(255 225 175 / 72%);
  font-size: var(--font-size-sm, 0.8125rem);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms ease;
  z-index: 12;
}

.destination-bloom-empty.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .destination-bloom-canvas {
    animation: none;
  }

  .destination-bloom-empty {
    transition: none;
  }
}

/* features/map/trip-replay.css */
/* Trip Replay Controls */
.replay-controls {
  display: inline-flex;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(-8px);
  animation: fadeInDown 0.25s ease-out forwards;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-normal);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.replay-btn i {
  font-size: var(--font-size-xs);
}

.replay-btn-label {
  display: none;
}

.replay-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--primary);
}

.replay-btn.active {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
}

.replay-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

@media (width > 768px) {
  .replay-btn-label {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .replay-controls {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

