/*
 * Fun4Road Roadbook Live - Styles participant
 * Version: 2.0.12
 * Author: lx6dep@gmail.com pour Fun4road
 */

:root {
  --bg: #070b13;
  --panel: rgba(11, 17, 29, 0.72);
  --panel-strong: rgba(12, 18, 31, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f7faff;
  --muted: #aab5c8;
  --accent: #ff3048;
  --accent-2: #00ff38;
  --warning: #f4ff00;
  --danger: #ff3048;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
  --radius: 22px;
  --radius-sm: 15px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 48, 72, 0.18), transparent 30vw),
    radial-gradient(circle at bottom right, rgba(0, 255, 56, 0.10), transparent 34vw),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100dvh;
  padding: calc(6px + var(--safe-top)) 6px calc(6px + var(--safe-bottom));
}

.glass-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 8px;
  width: min(1480px, 100%);
  margin: 0 auto;
}

.map-card {
  position: relative;
  min-height: calc(100dvh - 12px - var(--safe-top) - var(--safe-bottom));
  overflow: hidden;
  border-radius: var(--radius);
  background: #101827;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.map-canvas { position: absolute; inset: 0; }
.mapboxgl-ctrl-logo, .mapboxgl-ctrl-attrib { opacity: 0.78; }

.map-overlay { position: absolute; z-index: 5; }
.top-right { top: 10px; right: 10px; }
.controls-stack { display: flex; gap: 7px; }

.map-brand {
  top: 11px;
  left: 11px;
  width: 101px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.map-logo {
  display: block;
  width: 101px;
  max-width: 101px;
  max-height: 45px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(255,255,255,0.82)) drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}

.map-status {
  top: 12px;
  left: 116px;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 360px);
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.60rem;
  font-weight: 950;
  border: 1px solid rgba(255,255,255,0.13);
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}
.pill-ok { color: #06150e; background: rgba(0,255,56,0.93); }
.pill-muted { color: #d7dfef; background: rgba(7, 11, 19, 0.72); }
.pill-warn { color: #1c1300; background: rgba(244,255,0,0.96); }
.pill-danger { color: #fff; background: rgba(255,48,72,0.96); }

.map-point-counter {
  left: 12px;
  bottom: 9px;
  min-width: 86px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #06150e;
  background: rgba(0,255,56,0.94);
  box-shadow: 0 14px 34px rgba(0,0,0,0.30);
  font-size: 0.88rem;
  font-weight: 1000;
  letter-spacing: 0.02em;
  text-align: center;
}

.map-distance-bubble {
  right: 13px;
  bottom: 9px;
  min-width: 112px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(7, 11, 19, 0.80);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 14px 34px rgba(0,0,0,0.30);
  font-size: 1.05rem;
  font-weight: 1000;
  text-align: center;
}

.control-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 15px;
  color: var(--text);
  background: rgba(7, 11, 19, 0.78);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  font-weight: 950;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.control-btn:active { transform: translateY(1px) scale(0.98); }
.control-btn.is-active { outline: 2px solid var(--accent-2); }

.route-hint {
  left: 50%;
  top: 50%;
  z-index: 6;
  transform: translate(-50%, -50%);
  width: min(88%, 520px);
  padding: 18px 20px;
  border-radius: 22px;
  text-align: center;
  font-weight: 950;
  line-height: 1.25;
}

.offroute-banner {
  position: absolute;
  left: 50%;
  top: 72px;
  z-index: 6;
  transform: translateX(-50%);
  width: min(92%, 560px);
  padding: 11px 15px;
  border-radius: 18px;
  background: rgba(255, 48, 72, 0.94);
  color: #fff;
  box-shadow: 0 16px 50px rgba(255, 48, 72, 0.28);
  text-align: center;
}
.offroute-banner strong { display: block; font-size: 1.02rem; }
.offroute-banner span { display: block; font-size: 0.85rem; opacity: 0.9; }

.roadbook-panel {
  min-height: calc(100dvh - 12px - var(--safe-top) - var(--safe-bottom));
  border-radius: var(--radius);
  padding: 8px;
  overflow: auto;
}
.panel-section { padding: 0; border-bottom: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

.route-loader label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  padding: 13px 12px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.04em;
  outline: none;
}
.helper-text { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; }
code { color: #dce7ff; }

.primary-btn, .secondary-btn {
  border: 0;
  border-radius: 15px;
  min-height: 42px;
  padding: 0 12px;
  font-weight: 950;
  cursor: pointer;
}
.primary-btn { color: #fff; background: linear-gradient(135deg, #ff3048, #ff6a35); box-shadow: 0 14px 32px rgba(255,48,72,0.22); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.secondary-btn { color: var(--text); background: rgba(255,255,255,0.08); border: 1px solid var(--line); }
.wide { width: 100%; }
.action-zone { display: grid; gap: 7px; margin-top: 8px; }
.compact-actions { grid-template-columns: 1fr 1fr; }

.roadbook-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-bottom: 8px;
  padding: 10px 13px;
  border-radius: 17px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.10);
  font-variant-numeric: tabular-nums;
}
.rb-distance-left,
.rb-distance-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: clamp(0.84rem, 2.25vw, 1.16rem);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -0.03em;
}
.rb-distance-left { justify-content: flex-start; color: var(--accent-2); }
.rb-distance-right { justify-content: flex-end; color: var(--accent-2); }
.stats-separator { color: rgba(255,255,255,0.64); }
#nextPartialKm { color: #aeb5c6; }
#nextPartialKm.is-alert { color: var(--danger); }
#cumulKm.is-reset { color: var(--warning); }
#cumulKm.is-blink { animation: resetBlink 0.46s linear 6; }
.rb-reset {
  min-width: 92px;
  text-align: center;
  color: var(--warning);
  font-size: clamp(0.82rem, 2.2vw, 1.12rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 14px rgba(244,255,0,0.35);
}
.rb-reset.is-hidden { visibility: hidden; }

.media-tabs {
  touch-action: pan-y;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.media-card { min-width: 0; }
.media-box {
  display: grid;
  place-items: center;
  min-height: 176px;
  border-radius: 16px;
  background: rgba(255,255,255,0.055);
  border: 1px solid var(--line);
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  padding: 8px;
  font-weight: 850;
  font-size: 0.9rem;
}
.media-box img { display: block; max-width: 100%; max-height: 242px; object-fit: contain; border-radius: 11px; background: #fff; }
.media-box.has-text { display: block; text-align: left; white-space: pre-wrap; line-height: 1.35; color: var(--text); font-weight: 720; overflow: auto; max-height: 242px; }
.media-box.empty { color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  #tulipBox,
  #notesBox { cursor: pointer; }
}

.sponsor-placeholder {
  margin-top: 8px;
  min-height: 70px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,0.18);
  font-weight: 850;
}

.consent-modal, .fatal-config {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 12, 0.72);
}
.consent-card, .fatal-card { width: min(520px, 100%); border-radius: 28px; padding: 22px; }
.consent-badge { display: inline-flex; margin-bottom: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(0,255,56,0.15); color: var(--accent-2); font-weight: 900; font-size: 0.78rem; }
.consent-card p { color: #dbe4f4; line-height: 1.45; }
.consent-card .muted { color: var(--muted); }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; color: var(--text); font-weight: 800; line-height: 1.35; }
.check-line input { width: 22px; height: 22px; accent-color: var(--accent-2); flex: 0 0 auto; }

@keyframes resetBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.12; }
}

[hidden] { display: none !important; }

@media (max-width: 1050px) {
  .main-grid { grid-template-columns: 1fr; }
  .map-card { min-height: 63dvh; }
  .roadbook-panel { min-height: auto; }
}

@media (max-width: 680px) {
  .app-shell { padding: calc(4px + var(--safe-top)) 4px calc(4px + var(--safe-bottom)); }
  .main-grid { gap: 5px; }
  .map-card { min-height: 58dvh; border-radius: 16px; }
  .roadbook-panel { border-radius: 16px; padding: 6px; }
  .top-right { top: 8px; right: 8px; }
  .controls-stack { gap: 5px; }
  .control-btn { width: 40px; height: 40px; border-radius: 13px; font-size: 0.9rem; }
  .map-brand { top: 8px; left: 8px; width: 94px; height: 42px; }
  .map-logo { width: 94px; max-width: 94px; max-height: 42px; }
  .map-status { top: 54px; left: 9px; max-width: 210px; gap: 4px; }
  .pill { min-height: 20px; padding: 3px 7px; font-size: 0.56rem; }
  .map-point-counter { left: 9px; bottom: 7px; min-width: 76px; padding: 7px 10px; font-size: 0.80rem; }
  .map-distance-bubble { right: 9px; bottom: 7px; min-width: 92px; padding: 8px 11px; font-size: 0.94rem; }
  .offroute-banner { top: 94px; padding: 9px 12px; }
  .route-hint { padding: 14px 16px; border-radius: 18px; }
  .roadbook-strip { min-height: 42px; margin-bottom: 6px; padding: 8px 10px; border-radius: 15px; gap: 6px; }
  .rb-distance-left, .rb-distance-right { gap: 4px; font-size: clamp(0.78rem, 4.0vw, 1.02rem); }
  .rb-reset { min-width: 72px; font-size: clamp(0.78rem, 3.8vw, 1.00rem); }
  .media-tabs { gap: 6px; }
  .media-box { min-height: 166px; padding: 6px; border-radius: 14px; font-size: 0.78rem; }
  .media-box img { max-height: 226px; }
  .media-box.has-text { max-height: 226px; line-height: 1.28; }
  .compact-actions { gap: 6px; }
  .primary-btn, .secondary-btn { min-height: 38px; padding: 0 10px; font-size: 0.82rem; }
}

@media (orientation: landscape) and (max-height: 620px) {
  .main-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
  .map-card, .roadbook-panel { min-height: calc(100dvh - 10px - var(--safe-top) - var(--safe-bottom)); }
  .media-box { min-height: 108px; }
  .media-box img, .media-box.has-text { max-height: 138px; }
}

.map-brand {
  top: 8px;
  left: 8px;
  width: 82px;
  height: 36px;
}
.map-logo {
  width: 82px;
  max-width: 82px;
  max-height: 36px;
}
.map-status {
  top: 46px;
  left: 8px;
}
.map-point-counter {
  bottom: 3px;
  min-width: 78px;
  padding: 7px 10px;
  font-size: 0.78rem;
}
.map-distance-bubble {
  bottom: 3px;
  min-width: 92px;
  padding: 7px 11px;
  font-size: 0.88rem;
}
.rb-distance-left,
.rb-distance-right {
  font-size: clamp(0.70rem, 1.85vw, 0.94rem);
  gap: 4px;
  letter-spacing: -0.045em;
}
.rb-reset {
  min-width: 76px;
  font-size: clamp(0.70rem, 1.85vw, 0.92rem);
}
.media-tabs,
.media-card,
.media-box {
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}
.control-btn.gps-control {
  width: 48px;
  font-size: 0.66rem;
  letter-spacing: -0.03em;
}
.control-btn.gps-control.is-active {
  color: #06150e;
  background: rgba(0,255,56,0.95);
  border-color: rgba(0,255,56,0.45);
}
body.app-fullscreen-fallback {
  overflow: hidden;
  background: #070b13;
}
body.app-fullscreen-fallback .app-shell {
  padding: 0;
  min-height: 100dvh;
}
body.app-fullscreen-fallback .main-grid {
  width: 100%;
  margin: 0;
  gap: 0;
}
body.app-fullscreen-fallback .map-card {
  border-radius: 0;
}
body.app-fullscreen-fallback .roadbook-panel {
  border-radius: 0;
}

@media (max-width: 680px) {
  .map-brand { top: 7px; left: 7px; width: 75px; height: 34px; }
  .map-logo { width: 75px; max-width: 75px; max-height: 34px; }
  .map-status { top: 43px; left: 7px; max-width: 190px; }
  .map-point-counter { left: 6px; bottom: 2px; min-width: 70px; padding: 6px 9px; font-size: 0.72rem; }
  .map-distance-bubble { right: 6px; bottom: 2px; min-width: 80px; padding: 6px 9px; font-size: 0.80rem; }
  .roadbook-strip { min-height: 36px; padding: 6px 8px; gap: 4px; }
  .rb-distance-left, .rb-distance-right { font-size: clamp(0.62rem, 3.25vw, 0.82rem); gap: 3px; }
  .rb-reset { min-width: 62px; font-size: clamp(0.62rem, 3.2vw, 0.80rem); }
  .control-btn.gps-control { width: 42px; font-size: 0.60rem; }
}


.map-brand {
  width: 66px;
  height: 30px;
}
.map-logo {
  width: 66px;
  max-width: 66px;
  max-height: 30px;
}
.map-status {
  top: 8px;
  left: 80px;
  max-width: calc(100% - 250px);
}
.map-point-counter {
  left: 24px;
  bottom: -1px;
  min-width: 68px;
  padding: 6px 9px;
  font-size: 0.70rem;
}
.map-distance-bubble {
  bottom: -1px;
  min-width: 78px;
  padding: 6px 9px;
  font-size: 0.78rem;
}
.rb-distance-left,
.rb-distance-right {
  font-size: clamp(0.60rem, 1.55vw, 0.78rem);
  gap: 3px;
  letter-spacing: -0.055em;
}
.rb-reset {
  min-width: 58px;
  font-size: clamp(0.60rem, 1.55vw, 0.78rem);
}
.gps-actions-compact {
  grid-template-columns: 1fr;
}
.control-btn.mode-3d-active {
  color: #06150e;
  background: rgba(0,255,56,0.95);
  border-color: rgba(0,255,56,0.48);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28), 0 0 0 2px rgba(0,255,56,0.26);
}

@media (max-width: 680px) {
  .map-brand { top: 7px; left: 7px; width: 60px; height: 28px; }
  .map-logo { width: 60px; max-width: 60px; max-height: 28px; }
  .map-status { top: 8px; left: 72px; max-width: 142px; gap: 3px; }
  .pill { min-height: 18px; padding: 2px 6px; font-size: 0.50rem; }
  .map-point-counter { left: 22px; bottom: -2px; min-width: 62px; padding: 5px 8px; font-size: 0.64rem; }
  .map-distance-bubble { right: 5px; bottom: -2px; min-width: 72px; padding: 5px 8px; font-size: 0.72rem; }
  .roadbook-strip { min-height: 32px; padding: 5px 7px; gap: 3px; }
  .rb-distance-left, .rb-distance-right { font-size: clamp(0.55rem, 2.85vw, 0.68rem); gap: 2px; }
  .rb-reset { min-width: 54px; font-size: clamp(0.55rem, 2.85vw, 0.68rem); }
}

.map-brand {
  top: 8px;
  left: 8px;
  width: 82px;
  height: 36px;
}
.map-logo {
  width: 82px;
  max-width: 82px;
  max-height: 36px;
}
.map-status {
  top: 8px;
  left: 96px;
  max-width: calc(100% - 250px);
}
.map-point-counter {
  left: 18px;
  bottom: 3px;
  min-width: 78px;
  padding: 7px 10px;
  font-size: 0.78rem;
}
.map-distance-bubble {
  bottom: 3px;
  min-width: 92px;
  padding: 7px 11px;
  font-size: 0.88rem;
}
.top-right { top: 8px; right: 8px; }
.controls-stack { gap: 4px; }
.control-btn,
.control-btn.gps-control {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0;
}
.control-btn.gps-control { letter-spacing: -0.04em; }
.control-btn.mode-3d-active {
  color: #06150e;
  background: rgba(0,255,56,0.95);
  border-color: rgba(0,255,56,0.48);
  box-shadow: 0 10px 22px rgba(0,0,0,0.26), 0 0 0 2px rgba(0,255,56,0.22);
}

@media (max-width: 680px) {
  .map-brand { top: 7px; left: 7px; width: 75px; height: 34px; }
  .map-logo { width: 75px; max-width: 75px; max-height: 34px; }
  .map-status { top: 7px; left: 87px; max-width: 142px; gap: 3px; }
  .map-point-counter { left: 14px; bottom: 2px; min-width: 70px; padding: 6px 9px; font-size: 0.72rem; }
  .map-distance-bubble { right: 6px; bottom: 2px; min-width: 80px; padding: 6px 9px; font-size: 0.80rem; }
  .top-right { top: 7px; right: 7px; }
  .controls-stack { gap: 4px; }
  .control-btn,
  .control-btn.gps-control {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 11px;
    font-size: 0.66rem;
  }
}


.f4r-route-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.map-point-counter {
  left: 34px !important;
  bottom: 12px !important;
}

.map-distance-bubble {
  bottom: 12px !important;
}

.control-btn,
.control-btn.gps-control {
  width: 31px !important;
  height: 31px !important;
  min-width: 31px !important;
  border-radius: 10px !important;
  font-size: 0.60rem !important;
  line-height: 1 !important;
  padding: 0 !important;
}

#nextPartialKm.is-alert {
  color: var(--danger) !important;
  text-shadow: 0 0 12px rgba(255,48,72,0.45);
}

#nextPartialKm.is-blink-alert {
  animation: nextAlertBlink 0.46s linear 6;
}

@keyframes nextAlertBlink {
  0%, 49% {
    opacity: 1;
    color: var(--danger);
  }
  50%, 100% {
    opacity: 0.18;
    color: var(--danger);
  }
}

@media (max-width: 680px) {
  .map-point-counter {
    left: 30px !important;
    bottom: 10px !important;
  }

  .map-distance-bubble {
    bottom: 10px !important;
  }

  .control-btn,
  .control-btn.gps-control {
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
    border-radius: 9px !important;
    font-size: 0.56rem !important;
  }
}

.f4r-route-overlay {
  z-index: 4 !important;
  overflow: visible !important;
}
.f4r-route-overlay .f4r-wpt-dot {
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.48));
}
.f4r-route-overlay .f4r-finish-flag {
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.58));
}
.map-point-counter {
  bottom: 12px !important;
}
.map-distance-bubble {
  bottom: 12px !important;
}
@media (max-width: 680px) {
  .map-point-counter {
    bottom: 10px !important;
  }
  .map-distance-bubble {
    bottom: 10px !important;
  }
}

.mapboxgl-canvas-container,
.mapboxgl-canvas {
  z-index: 0 !important;
}
.f4r-route-overlay {
  z-index: 20 !important;
  overflow: visible !important;
}
.map-point-counter {
  bottom: 8px !important;
}
.map-distance-bubble {
  bottom: 8px !important;
}
@media (max-width: 680px) {
  .map-point-counter {
    bottom: 7px !important;
  }
  .map-distance-bubble {
    bottom: 7px !important;
  }
}


.f4r-route-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 30 !important;
  pointer-events: none !important;
  overflow: visible !important;
  transform: translateZ(0);
}
.f4r-route-overlay path {
  vector-effect: non-scaling-stroke;
}


.client-logo-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  max-width: 82px;
  padding: 0 4px;
  pointer-events: none;
}
.client-logo-control[hidden] {
  display: none !important;
}
.client-logo-control img {
  display: block;
  width: auto;
  max-width: 82px;
  max-height: 31px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.50));
}
#offlineBtn {
  color: transparent !important;
  text-shadow: none !important;
  cursor: default;
}
@media (max-width: 680px) {
  .client-logo-control {
    height: 29px;
    max-width: 75px;
    padding: 0 3px;
  }
  .client-logo-control img {
    max-width: 75px;
    max-height: 29px;
  }
}


.consent-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.consent-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.lang-btn {
  appearance: none;
  border: 0;
  min-width: 34px;
  min-height: 26px;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font-size: 0.66rem;
  font-weight: 950;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--accent-2);
  color: #07101d;
}

.consent-link-line {
  margin: 8px 0 10px;
}

.consent-link-line a {
  color: #d9ffe2;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}


.message-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 7px;
  align-items: stretch;
  margin-top: 8px;
}
.message-zone {
  margin-top: 0;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.045);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.message-zone:focus-visible {
  outline: 3px solid rgba(244,255,0,.42);
  outline-offset: 2px;
}
.message-envelope {
  font-size: 1.28rem;
  line-height: 1;
  opacity: .78;
  filter: drop-shadow(0 0 12px rgba(255,255,255,.16));
}
.message-zone.has-message {
  border-color: rgba(244,255,0,.38);
  background: rgba(244,255,0,.055);
}
.message-ticker {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.message-ticker-track {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  color: var(--warning);
  font-weight: 1000;
  font-size: clamp(.86rem, 2.4vw, 1.08rem);
  line-height: 1;
  text-shadow: 0 0 10px rgba(244,255,0,.42), 0 1px 8px rgba(0,0,0,.8);
  animation: f4rMessageScroll 13s linear infinite;
}
@keyframes f4rMessageScroll {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(-100%,0,0); }
}

@media (max-width: 680px) {
  .message-row { margin-top: 6px; grid-template-columns: minmax(0, 1fr) 38px; gap: 6px; }
  .message-zone { min-height: 44px; border-radius: 14px; }
  .message-envelope { font-size: 1.08rem; }
  .message-ticker-track { font-size: .82rem; animation-duration: 12s; }
}


.rb-reset.is-dynamic-distance {
  font-size: clamp(0.92rem, 2.55vw, 1.32rem);
  color: #f4ff00;
  text-shadow: 0 0 18px rgba(244,255,0,0.58), 0 0 7px rgba(244,255,0,0.28);
  letter-spacing: -0.05em;
}
.rb-reset.is-reset-label {
  color: var(--warning);
}
.user-arrow-puck {
  --puck-bearing: 0deg;
  width: 64px;
  height: 78px;
  position: relative;
  transform: rotate(var(--puck-bearing)) translateZ(0);
  transform-origin: 50% 60%;
  filter: drop-shadow(0 13px 24px rgba(0,0,0,0.48));
}
.user-arrow-shadow {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 48px;
  height: 32px;
  border-radius: 999px;
  background: rgba(0,0,0,0.30);
  transform: translate(-50%, -50%) rotateX(58deg);
  filter: blur(1px);
}
.user-arrow-body {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 70px;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0%, 92% 70%, 61% 61%, 50% 100%, 39% 61%, 8% 70%);
  background: linear-gradient(145deg, #dfffea 0%, #00ff38 46%, #008d29 100%);
  border: 3px solid #07101d;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.72), inset 0 -7px 13px rgba(0,0,0,0.32), 0 0 0 7px rgba(0,255,56,0.16);
}
.user-arrow-body::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 27%;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #07101d;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
.user-arrow-body span {
  display: none;
}


@media (max-width: 680px) {
  .rb-reset.is-dynamic-distance {
    min-width: 72px;
    font-size: clamp(0.82rem, 4.1vw, 1.02rem);
  }
}


.roadbook-strip {
  min-height: 52px;
  padding: 11px 14px;
  gap: 9px;
}
.rb-distance-left,
.rb-distance-right {
  font-size: clamp(0.98rem, 2.65vw, 1.34rem);
  font-weight: 1000;
  letter-spacing: -0.052em;
}
.rb-reset {
  min-width: 104px;
  font-size: clamp(1.02rem, 2.85vw, 1.42rem);
}
.rb-reset.is-dynamic-distance {
  min-width: 106px;
  font-size: clamp(1.28rem, 3.45vw, 1.74rem);
  font-weight: 1000;
  color: #f4ff00;
  text-shadow: 0 0 20px rgba(244,255,0,0.62), 0 0 8px rgba(244,255,0,0.36);
}
.user-arrow-puck {
  width: 68px;
  height: 82px;
  transform: translateZ(0);
}
.user-arrow-shadow {
  width: 50px;
  height: 34px;
}
.user-arrow-body {
  width: 58px;
  height: 74px;
  transform: translate(-50%, -50%) rotate(var(--puck-bearing));
  transform-origin: 50% 60%;
}
.user-arrow-body::after {
  width: 12px;
  height: 12px;
}
@media (max-width: 680px) {
  .roadbook-strip {
    min-height: 48px;
    padding: 8px 7px;
    gap: 4px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .rb-distance-left,
  .rb-distance-right {
    gap: 2px;
    font-size: clamp(0.76rem, 3.95vw, 1.02rem);
    letter-spacing: -0.074em;
  }
  .rb-reset {
    min-width: 78px;
    font-size: clamp(0.92rem, 4.4vw, 1.16rem);
    letter-spacing: -0.066em;
  }
  .rb-reset.is-dynamic-distance {
    min-width: 82px;
    font-size: clamp(1.12rem, 5.95vw, 1.52rem);
    letter-spacing: -0.082em;
  }
  .stats-separator { margin: 0 -1px; }
  .user-arrow-puck { width: 64px; height: 78px; }
  .user-arrow-body { width: 54px; height: 70px; }
}
@media (max-width: 380px) {
  .roadbook-strip { padding-left: 5px; padding-right: 5px; gap: 3px; }
  .rb-distance-left,
  .rb-distance-right { font-size: clamp(0.70rem, 3.75vw, 0.92rem); }
  .rb-reset.is-dynamic-distance { min-width: 76px; font-size: clamp(1.04rem, 5.6vw, 1.38rem); }
}


.rb-reset.is-dynamic-distance {
  min-width: 124px;
  font-size: clamp(1.48rem, 4.2vw, 2.08rem);
  letter-spacing: -0.092em;
  text-shadow: 0 0 24px rgba(244,255,0,0.70), 0 0 10px rgba(244,255,0,0.42);
}
@media (max-width: 680px) {
  .roadbook-strip {
    grid-template-columns: minmax(0, .9fr) minmax(96px, auto) minmax(0, .9fr);
  }
  .rb-reset.is-dynamic-distance {
    min-width: 96px;
    font-size: clamp(1.34rem, 7.25vw, 1.90rem);
    letter-spacing: -0.096em;
  }
}
@media (max-width: 380px) {
  .rb-reset.is-dynamic-distance {
    min-width: 92px;
    font-size: clamp(1.22rem, 6.90vw, 1.68rem);
    letter-spacing: -0.102em;
  }
}


.quick-gpx-btn {
  min-height: 54px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.075);
  color: #f4f7fb;
  font-weight: 1000;
  font-size: 1.1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.quick-gpx-btn:active { transform: translateY(1px); }
.quick-gpx-modal[hidden] { display: none !important; }
.quick-gpx-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.52);
}
.quick-gpx-card {
  width: min(420px, 100%);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: #111827;
  color: #f4f7fb;
  padding: 18px;
  box-shadow: 0 24px 90px rgba(0,0,0,.48);
}
.quick-gpx-card h3 { margin: 0 0 8px; }
.quick-gpx-card p { margin: 0 0 12px; color: #aab5c8; font-size: .92rem; }
.quick-gpx-card input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: #070b13;
  color: #f4f7fb;
  padding: 12px 13px;
  font-weight: 900;
  letter-spacing: .03em;
}
.quick-gpx-msg { min-height: 20px; color: #ffb020; font-size: .84rem; margin-top: 8px; }
.quick-gpx-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.quick-gpx-actions button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 1000;
  background: #00ff38;
  color: #06150e;
}
.quick-gpx-actions .btn-ghost { background: rgba(255,255,255,.10); color: #f4f7fb; border: 1px solid rgba(255,255,255,.12); }
@media (max-width: 680px) {
  .quick-gpx-btn { min-height: 44px; border-radius: 12px; font-size: .98rem; }
}

.mapboxgl-marker.user-arrow-puck,
.user-arrow-puck {
  z-index: 80 !important;
  pointer-events: none;
}

.guidance-panel {
  position: absolute;
  left: 50%;
  bottom: 52px;
  z-index: 38;
  transform: translateX(-50%);
  width: min(92%, 560px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(7, 11, 19, 0.86);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 16px 45px rgba(0,0,0,0.34);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}
.guidance-panel.is-active {
  border-color: rgba(244,255,0,0.42);
  background: rgba(14, 16, 10, 0.88);
}
.guidance-panel.is-warn {
  border-color: rgba(255,48,72,0.42);
  background: rgba(33, 11, 18, 0.90);
}
.guidance-info {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}
.guidance-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.guidance-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  color: #07101d;
  background: rgba(244,255,0,0.96);
  font-size: 0.68rem;
  font-weight: 1000;
  cursor: pointer;
  white-space: nowrap;
}
.guidance-btn:disabled {
  opacity: .54;
  cursor: wait;
}
.guidance-main {
  background: rgba(0,255,56,0.96);
}
.guidance-muted {
  color: #fff;
  background: rgba(255,255,255,0.10);
}
@media (max-width: 680px) {
  .guidance-panel {
    bottom: 42px;
    width: min(94%, 520px);
    gap: 5px;
    padding: 6px 7px;
  }
  .guidance-info {
    font-size: 0.66rem;
  }
  .guidance-actions {
    gap: 4px;
  }
  .guidance-btn {
    min-height: 27px;
    padding: 0 7px;
    font-size: 0.58rem;
  }
}

.roadbook-strip {
  min-height: 50px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.rb-distance-block {
  display: grid;
  grid-template-rows: auto auto;
  align-items: center;
  row-gap: 2px;
}
.rb-distance-left.rb-distance-block {
  justify-items: start;
  justify-content: start;
}
.rb-distance-right.rb-distance-block {
  justify-items: end;
  justify-content: end;
}
.rb-distance-label {
  display: block;
  padding: 0 3px;
  color: rgba(219, 228, 244, 0.68);
  font-size: clamp(0.50rem, 1.24vw, 0.68rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rb-distance-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(4, 8, 16, 0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.media-tabs {
  gap: 7px;
}
.media-box {
  min-height: 160px;
  padding: 5px;
}
.media-box img {
  max-height: 226px;
}
.media-box.has-text {
  max-height: 226px;
}
@media (max-width: 680px) {
  .roadbook-strip {
    min-height: 47px;
    padding: 5px 6px;
    gap: 3px;
  }
  .rb-distance-left,
  .rb-distance-right {
    font-size: clamp(0.64rem, 3.35vw, 0.86rem);
    letter-spacing: -0.060em;
  }
  .rb-distance-label {
    padding: 0 2px;
    font-size: clamp(0.42rem, 1.95vw, 0.54rem);
    letter-spacing: 0.035em;
  }
  .rb-distance-frame {
    gap: 2px;
    min-height: 21px;
    padding: 2px 4px;
    border-radius: 8px;
  }
  .rb-reset {
    min-width: 76px;
  }
  .rb-reset.is-dynamic-distance {
    min-width: 92px;
  }
  .media-tabs {
    gap: 5px;
  }
  .media-box {
    min-height: 148px;
    padding: 4px;
    border-radius: 13px;
  }
  .media-box img,
  .media-box.has-text {
    max-height: 205px;
  }
}
@media (max-width: 380px) {
  .roadbook-strip {
    min-height: 45px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .rb-distance-left,
  .rb-distance-right {
    font-size: clamp(0.58rem, 3.15vw, 0.74rem);
  }
  .rb-distance-label {
    font-size: clamp(0.39rem, 1.82vw, 0.50rem);
  }
  .rb-distance-frame {
    padding-left: 3px;
    padding-right: 3px;
  }
}
