:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #03100f;
  --panel: #0d1c1a;
  --panel-soft: #0a1716;
  --line: rgba(176, 211, 201, .18);
  --text: #f5faf8;
  --muted: #9eaaa7;
  --mint: #78efb6;
  --amber: #ffbd3d;
  --red: #ff3e45;
  background: var(--bg);
}

@font-face { font-family: "Material Symbols Rounded"; src: url("./drive-assets/material-symbols-rounded.ttf?v=0.43.2") format("truetype"); font-display: block; }

* { box-sizing: border-box; }
html, body, button, a, input, label { touch-action: manipulation; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100svh; background: radial-gradient(circle at 50% -20%, #0c2622 0, var(--bg) 48%); }
.welcome-screen { position: fixed; z-index: 140; inset: 0; overflow: auto; padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: radial-gradient(circle at 74% 12%, rgba(34,112,89,.42), transparent 34%), radial-gradient(circle at 0 82%, rgba(120,239,182,.12), transparent 38%), #03100f; }
.welcome-screen[hidden] { display: none; }
.welcome-content { width: min(850px, 100%); min-height: calc(100svh - max(56px, env(safe-area-inset-top) + env(safe-area-inset-bottom))); display: flex; flex-direction: column; justify-content: center; margin: auto; }
.welcome-brand { display: flex; align-items: center; gap: 10px; color: var(--mint); font-size: 24px; font-style: italic; font-weight: 950; letter-spacing: -.04em; }
.welcome-brand .material-symbols-rounded { font-size: 35px; }
.welcome-content > small { margin-top: 30px; color: var(--mint); font-size: 12px; font-weight: 950; letter-spacing: .15em; }
.welcome-content h2 { margin: 9px 0 0; font-size: clamp(42px, 8vw, 76px); line-height: .98; letter-spacing: -.055em; }
.welcome-content h2 em { color: var(--mint); font-style: normal; }
.welcome-lead { max-width: 720px; margin: 21px 0 0; color: #c7d2cf; font-size: clamp(17px, 2.4vw, 22px); line-height: 1.45; }
.welcome-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.welcome-features article { min-width: 0; display: grid; grid-template-columns: 50px minmax(0,1fr); gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(16,37,32,.92), rgba(6,21,18,.94)); }
.welcome-features article > .material-symbols-rounded { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; background: rgba(120,239,182,.12); color: var(--mint); font-size: 29px; }
.welcome-features strong { display: block; font-size: 17px; }
.welcome-features p { margin: 6px 0 0; color: #aebbb7; font-size: 13px; line-height: 1.38; }
.welcome-note { display: flex; align-items: flex-start; gap: 9px; margin: 18px 0 0; color: #8f9d99; font-size: 12px; line-height: 1.4; }
.welcome-note .material-symbols-rounded { color: var(--mint); font-size: 19px; flex: none; }
.welcome-continue { width: min(460px, 100%); min-height: 62px; display: flex; align-items: center; justify-content: space-between; margin-top: 23px; padding: 0 20px 0 24px; border: 0; border-radius: 15px; background: linear-gradient(110deg, #78eeb4, #8cebb9); color: #041b15; font-size: 14px; font-weight: 950; letter-spacing: .04em; box-shadow: 0 18px 48px rgba(14,89,66,.28); }
.welcome-continue .material-symbols-rounded { font-size: 25px; }
@media (max-width: 620px) {
  .welcome-content { justify-content: flex-start; }
  .welcome-content > small { margin-top: 23px; }
  .welcome-content h2 { font-size: clamp(39px, 12vw, 57px); }
  .welcome-lead { margin-top: 16px; font-size: 16px; }
  .welcome-features { grid-template-columns: 1fr; margin-top: 23px; }
  .welcome-features article { padding: 14px; }
  .welcome-continue { position: sticky; bottom: max(0px, env(safe-area-inset-bottom)); flex: none; }
}
button { font: inherit; }
.material-symbols-rounded { display: inline-block; overflow: hidden; font-family: "Material Symbols Rounded"; font-style: normal; font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 32; }
.shell { width: min(1180px, 100%); height: 100svh; min-height: 100svh; margin: auto; padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 12px; }
.topbar { min-height: 42px; display: flex; align-items: center; justify-content: center; position: relative; }
.view-switch { position: absolute; left: 0; display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3,16,15,.78); }
.view-switch button { min-width: 72px; height: 38px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; }
.view-switch button .material-symbols-rounded { font-size: 17px; }
.view-switch button.active { background: rgba(120,239,182,.15); color: var(--mint); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--mint); }
.brand > span { font-size: 34px; }
h1 { margin: 0; color: var(--mint); font-size: clamp(22px, 2.3vw, 30px); font-style: italic; font-weight: 900; letter-spacing: -.04em; }
.settings-mark { position: absolute; right: 0; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text); }
.settings-mark .material-symbols-rounded { font-size: 28px; }
.notice { grid-row: 2; padding: 10px 14px; border: 1px solid rgba(255,189,61,.34); border-radius: 12px; background: rgba(255,189,61,.09); color: #ffe0a0; font-size: 13px; }
.warning { border-color: rgba(255,62,69,.45); color: #ffb4b6; }
.dashboard { grid-row: 3; min-height: 0; height: 100%; position: relative; z-index: 1; }
.metrics[hidden], .map-view[hidden] { display: none !important; }
.panel-map-background { display: none; position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; touch-action: none; background: #03100f; }
.ride-running:not(.map-selected):not(.group-mode) .panel-map-background { display: block; }
#panel-map-canvas { position: absolute; inset: -8%; width: 116%; height: 116%; opacity: 1; filter: none; transform: scale(1.04); }
.panel-map-background::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,16,15,.2), rgba(3,16,15,.06) 34%, rgba(3,16,15,.08) 72%, rgba(3,16,15,.24)); }
.ride-running:not(.map-selected):not(.group-mode) .metrics { position: relative; z-index: 2; text-shadow: 0 2px 12px #03100f, 0 1px 3px #03100f; }
.idle-ride-hero { display: none; height: 100%; min-height: 0; position: relative; overflow: hidden; align-content: center; justify-items: center; gap: clamp(13px, 2.2vh, 24px); padding: clamp(20px, 4vh, 42px) clamp(18px, 5vw, 64px); border: 1px solid rgba(120,239,182,.2); border-radius: 28px; background: radial-gradient(circle at 50% 17%, rgba(120,239,182,.18), transparent 29%), linear-gradient(155deg, rgba(10,34,29,.98), rgba(3,16,15,.99) 65%); text-align: center; isolation: isolate; }
.idle-ride-hero::before, .idle-ride-hero::after { content: ""; position: absolute; z-index: -1; width: 54%; height: 160%; top: 42%; border: 1px solid rgba(120,239,182,.08); transform: perspective(420px) rotateX(62deg) rotateZ(18deg); }
.idle-ride-hero::before { left: -13%; }.idle-ride-hero::after { right: -13%; transform: perspective(420px) rotateX(62deg) rotateZ(-18deg); }
.idle-experience:not(.map-selected):not(.group-mode) .idle-ride-hero, .gps-calibrating:not(.map-selected):not(.group-mode) .idle-ride-hero { display: grid; }
.idle-experience:not(.map-selected):not(.group-mode) .metrics, .gps-calibrating:not(.map-selected):not(.group-mode) .metrics { display: none; }
.idle-experience:not(.map-selected):not(.group-mode) .testbar .actions { display: none; }
.idle-road-art { width: clamp(72px, 12vh, 110px); height: clamp(72px, 12vh, 110px); display: grid; place-items: center; border: 1px solid rgba(120,239,182,.42); border-radius: 50%; background: rgba(120,239,182,.11); color: var(--mint); box-shadow: 0 0 0 12px rgba(120,239,182,.035), 0 24px 70px rgba(0,0,0,.38); }
.idle-road-art .material-symbols-rounded { font-size: clamp(39px, 7vh, 62px); font-variation-settings: "FILL" 1, "wght" 650, "GRAD" 0, "opsz" 48; }
.idle-copy > small, .idle-suggestion small, .idle-calibrating small { color: var(--mint); font-size: 12px; font-weight: 950; letter-spacing: .16em; }
.idle-copy h2 { margin: 8px 0 0; font-size: clamp(38px, 6.3vh, 68px); line-height: .96; letter-spacing: -.055em; }
.idle-copy h2 em { color: var(--mint); font-style: normal; }
.idle-copy p { margin: 16px 0 0; color: #c6d2ce; font-size: clamp(15px, 2.2vh, 20px); line-height: 1.35; transition: opacity .25s ease, transform .25s ease; }
.idle-copy p.changing { opacity: 0; transform: translateY(5px); }
.idle-suggestion { width: min(560px, 100%); display: flex; align-items: center; gap: 14px; padding: 14px 17px; border: 1px solid rgba(120,239,182,.2); border-radius: 17px; background: rgba(2,15,13,.6); text-align: left; }
.idle-suggestion > .material-symbols-rounded { color: var(--amber); font-size: 30px; }.idle-suggestion div { min-width: 0; }.idle-suggestion small, .idle-suggestion strong { display: block; }.idle-suggestion strong { margin-top: 5px; color: #dce7e3; font-size: 14px; line-height: 1.3; }
.idle-start-button { width: min(560px, 100%); min-height: 80px; display: grid; grid-template-columns: 52px minmax(0,1fr) 28px; align-items: center; gap: 10px; padding: 10px 18px; border: 0; border-radius: 22px; background: linear-gradient(110deg, #75edb2, #99f0c3); color: #031b14; text-align: left; box-shadow: 0 20px 50px rgba(29,139,101,.25); }
.idle-start-button > .material-symbols-rounded:first-child { font-size: 38px; font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 40; }.idle-start-button > span:nth-child(2) { min-width: 0; }.idle-start-button b, .idle-start-button small { display: block; }.idle-start-button b { font-size: clamp(18px, 3vw, 24px); font-weight: 950; }.idle-start-button small { margin-top: 3px; color: rgba(3,27,20,.7); font-size: 12px; font-weight: 750; }
.idle-calibrating { width: min(560px, 100%); display: none; grid-template-columns: 62px minmax(0,1fr); align-items: center; gap: 16px; padding: 17px; border: 1px solid rgba(255,189,61,.34); border-radius: 20px; background: rgba(29,23,7,.58); text-align: left; }.idle-calibrating strong, .idle-calibrating em { display: block; }.idle-calibrating strong { margin-top: 5px; font-size: 16px; }.idle-calibrating em { margin-top: 4px; color: #bdc9c5; font-size: 12px; font-style: normal; }
.gps-calibrating .idle-start-button, .gps-calibrating .idle-suggestion { display: none; }.gps-calibrating .idle-calibrating { display: grid; }
.gps-pulse { width: 58px; height: 58px; position: relative; display: grid; place-items: center; border-radius: 50%; background: rgba(255,189,61,.12); color: var(--amber); }.gps-pulse i { position: absolute; inset: 0; border: 2px solid var(--amber); border-radius: inherit; animation: gps-search 1.5s ease-out infinite; }.gps-pulse .material-symbols-rounded { font-size: 31px; }
@keyframes gps-search { from { opacity: .8; transform: scale(.65); } to { opacity: 0; transform: scale(1.45); } }
@keyframes ride-data-in { from { opacity: 0; } to { opacity: 1; } }
.ride-data-reveal .metrics { animation: ride-data-in 2s ease-out both; }
@media (prefers-reduced-motion: reduce) { .gps-pulse i, .ride-data-reveal .metrics { animation: none !important; } }
.map-view { position: absolute; inset: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--panel-soft); }
#map-canvas { width: 100%; height: 100%; }
.map-view.high-contrast #map-canvas canvas { filter: contrast(1.28) saturate(1.18) brightness(1.08); }
.map-telemetry { position: absolute; z-index: 3; left: 10px; bottom: 30px; width: min(760px, calc(100% - 82px)); min-height: 92px; display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: stretch; overflow: hidden; border: 1px solid rgba(176,211,201,.28); border-radius: 17px; background: linear-gradient(120deg, rgba(3,16,15,.96), rgba(5,22,19,.86)); box-shadow: 0 10px 30px rgba(0,0,0,.38); backdrop-filter: blur(10px); }
.map-speed { display: grid; place-content: center; padding: 8px; border-right: 1px solid var(--line); text-align: center; }
.map-speed strong { font-size: 52px; font-weight: 900; line-height: .82; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.map-speed small { margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.map-telemetry-grid { min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: center; }
.map-telemetry-grid span { min-width: 0; padding: 8px 7px; text-align: center; }
.map-telemetry-grid small, .map-telemetry-grid b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-telemetry-grid small { color: var(--mint); font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.map-telemetry-grid b { margin-top: 7px; font-size: 15px; font-variant-numeric: tabular-nums; }
.gps-map-marker { width: 52px; height: 52px; display: grid; place-items: center; border: 4px solid #f5faf8; border-radius: 50%; background: var(--mint); color: #052219; box-shadow: 0 8px 28px rgba(0,0,0,.65), 0 0 0 8px rgba(120,239,182,.2); }
.gps-map-marker .material-symbols-rounded { font-size: 32px; font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 32; }
.group-gap-alert { position: absolute; z-index: 6; top: 84px; left: 12px; max-width: min(420px, calc(100% - 82px)); display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid rgba(255,189,61,.65); border-radius: 13px; background: rgba(42,29,7,.94); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.group-gap-alert[hidden] { display: none; }.group-gap-alert > .material-symbols-rounded { color: var(--amber); font-size: 27px; }.group-gap-alert p { margin: 0; }.group-gap-alert strong, .group-gap-alert small { display: block; }.group-gap-alert strong { color: #ffe0a0; font-size: 14px; }.group-gap-alert small { margin-top: 2px; color: #d9c99e; font-size: 11px; }
.map-legend { position: absolute; z-index: 2; right: 12px; bottom: 32px; display: flex; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3,16,15,.9); color: var(--text); font-size: 12px; font-weight: 800; backdrop-filter: blur(7px); }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend i { width: 9px; height: 9px; border-radius: 50%; background: #55c8ff; }
.map-legend i.incident { background: var(--amber); }.map-legend i.moto { background: var(--red); }
#map-status { position: absolute; z-index: 2; top: 12px; left: 50%; margin: 0; max-width: 60%; padding: 9px 13px; border-radius: 11px; background: rgba(3,16,15,.9); color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; transform: translateX(-50%); }
.route-hud:not([hidden]) ~ #map-status { top: 90px; }
.route-hud { position: absolute; z-index: 3; top: 12px; left: 12px; display: flex; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(3,16,15,.9); backdrop-filter: blur(8px); }
.route-hud[hidden] { display: none; }
.route-hud span { min-width: 92px; padding: 8px 10px; border-radius: 10px; text-align: center; }.route-hud small, .route-hud b { display: block; }.route-hud small { color: #55c8ff; font-size: 11px; font-weight: 900; letter-spacing: .08em; }.route-hud b { margin-top: 4px; font-size: 20px; line-height: 1; }
.route-hud .off-route { background: rgba(255,62,69,.16); }.route-hud .off-route small, .route-hud .off-route b { color: var(--red); }
.map-controls { position: absolute; z-index: 3; right: 10px; top: 52px; display: grid; gap: 7px; }
.map-controls button { width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: rgba(3,16,15,.9); color: var(--mint); box-shadow: 0 5px 20px rgba(0,0,0,.35); }
.map-controls button[hidden] { display: none; }.map-controls .material-symbols-rounded { font-size: 24px; }
.maplibregl-ctrl-attrib { font-size: 9px; }
.metrics { height: 100%; display: grid; grid-template-columns: minmax(320px, .82fr) minmax(500px, 1.18fr); gap: 12px; }
.speed-card, .weather-card { border: 0; background: transparent; box-shadow: none; }
.summary-grid article, #elevation-chart { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(15,32,29,.98), rgba(7,20,18,.98)); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.speed-card { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
.speed-label { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 850; letter-spacing: .12em; }
.speed-gauge { min-height: 120px; display: grid; place-items: center; margin: 0; flex: none; }
.speed-gauge strong { color: var(--text); font-size: clamp(92px, 13vw, 164px); font-weight: 800; line-height: .82; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.speed-card > span:not(.material-symbols-rounded) { color: var(--muted); font-size: clamp(18px, 2vw, 26px); font-weight: 650; }
.trip-strip { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; margin-top: 28px; }
.trip-strip > div { min-width: 0; text-align: center; }
.trip-strip small { display: block; color: var(--mint); font-size: 13px; font-weight: 850; letter-spacing: .08em; }
.trip-strip b { display: block; margin-top: 7px; font-size: clamp(22px, 2.4vw, 31px); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sensor-strip { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; }
.sensor-strip > div { min-width: 0; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5px; }
.sensor-strip small { color: var(--mint); font-size: 14px; font-weight: 850; letter-spacing: .08em; }
.sensor-reading { min-width: 0; height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; margin-top: 9px; }
.sensor-icon { margin: 0; font-size: 34px; }
.compass { position: relative; width: 46px; height: 46px; display: grid; place-items: center; margin: 0; border: 2px solid rgba(245,250,248,.72); border-radius: 50%; flex: none; }
.compass i { position: absolute; top: -2px; color: var(--mint); font-size: 8px; font-style: normal; font-weight: 900; }
.compass .material-symbols-rounded { color: var(--text); font-size: 26px; transform-origin: center; transition: transform .55s ease-out; }
.compass.inactive { opacity: .42; }
.sensor-strip b { font-size: clamp(29px, 3.3vw, 42px); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ride-info { min-width: 0; display: grid; grid-template-rows: auto auto; align-content: start; gap: 10px; }
.landscape-sensors { display: none; }
.weather-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.weather-card { min-width: 0; min-height: 92px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; padding: 6px 8px; overflow: hidden; text-align: center; }
.weather-icon { color: var(--text); font-size: 43px; }
.rain-card .weather-icon { color: #55c8ff; }
.weather-reading { min-width: 0; min-height: 43px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.weather-reading > div { min-width: 0; }
.weather-card small { display: block; color: var(--mint); font-size: 13px; font-weight: 850; letter-spacing: .08em; }
.weather-temperature { color: var(--text); white-space: nowrap; }
.rain-card strong { color: var(--amber); }
.weather-card strong { display: block; margin-top: 5px; font-size: clamp(19px, 2.2vw, 27px); line-height: 1.05; }
.weather-card em { display: block; margin-top: 5px; color: #c2ceca; font-size: 14px; font-style: normal; }
#wind-card { position: relative; }
#wind-card em { white-space: nowrap; }
.dgt-panel { min-height: 0; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(15,32,29,.98), rgba(7,20,18,.98)); }
.dgt-panel > header { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--amber); }
.dgt-panel > header .material-symbols-rounded { font-size: 22px; }
.dgt-panel h2 { margin: 0; color: var(--text); font-size: 15px; letter-spacing: .08em; }
.dgt-panel header small { display: none; }
.dgt-alerts { display: grid; gap: 7px; }
.dgt-alert, .dgt-empty { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid rgba(255,189,61,.28); border-radius: 13px; background: rgba(255,189,61,.055); }
.dgt-alert > .material-symbols-rounded { color: var(--amber); font-size: 27px; }
.dgt-alert.moto-risk { border-color: rgba(255,62,69,.32); background: rgba(255,62,69,.055); }
.dgt-alert.moto-risk > .material-symbols-rounded { color: var(--red); }
.dgt-alert.radar-fixed, .dgt-alert.radar-section { border-color: rgba(85,200,255,.3); background: rgba(85,200,255,.055); }
.dgt-alert.radar-fixed > .material-symbols-rounded, .dgt-alert.radar-section > .material-symbols-rounded { color: #55c8ff; }
.dgt-alert.radar-fixed small, .dgt-alert.radar-section small { color: #55c8ff; }
.dgt-alert > div { min-width: 0; flex: 1; }
.dgt-alert small { display: block; color: var(--amber); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.dgt-alert strong, .dgt-empty strong { display: block; font-size: 17px; }
.dgt-alert em, .dgt-empty span { display: block; overflow: hidden; margin-top: 3px; color: #c2ceca; font-size: 13px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.dgt-alert > b { color: var(--text); font-size: 18px; white-space: nowrap; }
.dgt-empty { display: block; border-color: var(--line); text-align: center; }
.dgt-empty.good strong { color: var(--mint); }.dgt-empty.error strong { color: var(--red); }
.dgt-toast { position: fixed; z-index: 30; top: max(18px, env(safe-area-inset-top)); left: 50%; width: min(760px, calc(100% - 24px)); min-height: 158px; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto 42px; align-items: center; gap: 18px; overflow: hidden; padding: 20px 18px 23px; border: 2px solid rgba(255,189,61,.82); border-radius: 26px; background: linear-gradient(135deg, rgba(34,30,15,.99), rgba(7,20,18,.99) 62%); box-shadow: 0 24px 75px rgba(0,0,0,.72), 0 0 0 1px rgba(255,189,61,.1) inset; transform: translate(-50%, -140%); opacity: 0; pointer-events: none; transition: transform .45s cubic-bezier(.2,.85,.25,1), opacity .3s ease; }
.dgt-toast[hidden] { display: none; }
.dgt-toast.visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.dgt-toast-accent { width: 78px; height: 78px; display: grid; place-items: center; border-radius: 22px; background: rgba(255,189,61,.16); color: var(--amber); }
.dgt-toast-accent .material-symbols-rounded { font-size: 49px; font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 48; }
.dgt-toast-copy { min-width: 0; }
.dgt-toast-copy small { display: block; margin-bottom: 7px; color: var(--amber); font-size: 12px; font-weight: 900; letter-spacing: .13em; }
.dgt-toast-copy strong { display: block; overflow: hidden; font-size: clamp(25px, 3.2vw, 34px); line-height: 1.08; text-overflow: ellipsis; white-space: nowrap; }
.dgt-toast-copy span { display: block; overflow: hidden; margin-top: 8px; color: var(--muted); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.dgt-toast > b { color: var(--text); font-size: clamp(25px, 3vw, 34px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dgt-toast button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--muted); }
.dgt-toast button .material-symbols-rounded { font-size: 19px; }
.dgt-toast > i { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--amber); transform-origin: left; }
.dgt-toast.visible > i { animation: dgt-toast-time 20s linear forwards; }
.dgt-toast.leaving { transform: translate(-50%, -125%); opacity: 0; }
.dgt-toast.radar { border-color: rgba(85,200,255,.78); background: linear-gradient(135deg, rgba(10,35,46,.99), rgba(7,20,18,.99) 62%); }
.dgt-toast.radar .dgt-toast-accent { background: rgba(85,200,255,.15); color: #55c8ff; }
.dgt-toast.radar .dgt-toast-copy small { color: #55c8ff; }
.dgt-toast.radar > i { background: #55c8ff; }
@keyframes dgt-toast-time { to { transform: scaleX(0); } }
#wind-card.caution strong, #wind-card.caution em { color: var(--amber); }
#wind-card.danger strong, #wind-card.danger em { color: var(--red); }
.ride-alert { align-self: center; margin: 0; padding: 14px 16px; border: 1px solid rgba(255,189,61,.42); border-radius: 14px; background: rgba(255,189,61,.1); color: #ffe0a0; font-size: 13px; font-weight: 700; text-align: center; }
.testbar { grid-row: 4; position: relative; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.actions { width: auto; display: flex; justify-content: center; gap: 12px; }
.actions button { width: 56px !important; min-width: 56px; height: 56px; min-height: 56px !important; padding: 0 !important; border-radius: 50%; }
.actions button[hidden] { display: none !important; }
.actions button .material-symbols-rounded { font-size: 29px; }
.actions .pause-button { border-color: #ffd06a; color: #ffd06a; }
.actions .finish-button, .ride-running .actions #test-button { border-color: #ff7479; background: rgba(72,13,16,.9); color: #ff8d91; }
.actions .group-sos-footer { display: grid; place-items: center; border: 1px solid #ff6065; background: #e9323a; color: white; }
button.primary, button.secondary { min-height: 55px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 12px; padding: 0 20px; border: 1px solid var(--line); font-size: 13px; font-weight: 850; letter-spacing: .02em; }
button.primary { width: 100%; border-color: transparent; background: linear-gradient(110deg, #78eeb4, #8cebb9); color: #041b15; }
button.primary.calibrating { background: linear-gradient(110deg, #ffd26f, #ffb83d); }
button.primary.calibrating .material-symbols-rounded { animation: gps-pulse 1.1s ease-in-out infinite; }
@keyframes gps-pulse { 50% { transform: scale(1.22); opacity: .55; } }
button.primary > * { position: relative; z-index: 1; }
button.secondary { background: rgba(4,16,15,.75); color: var(--mint); border-color: var(--mint); }
button:disabled { opacity: .4; }
.disclaimer { color: #b5c1bd; font-size: 12px; }
.ride-running .disclaimer, .ride-paused .disclaimer, .gps-calibrating .disclaimer, .map-selected .disclaimer { display: none; }
.disclaimer a { color: inherit; text-underline-offset: 2px; }
.app-version { position: static; display: block; width: 100%; margin: 1px auto 0; color: rgba(181,193,189,.72); font-size: 10px; font-weight: 750; line-height: 1; letter-spacing: .04em; text-align: center; }
.update-screen { position: fixed; z-index: 120; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(30px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background: radial-gradient(circle at 50% 34%, #174b3e 0, #061411 48%, #020908 100%); color: var(--text); text-align: center; }
.update-screen[hidden] { display: none; }
.update-screen > .material-symbols-rounded { width: 112px; height: 112px; display: grid; place-items: center; border: 1px solid rgba(120,239,182,.46); border-radius: 30px; background: rgba(120,239,182,.12); color: var(--mint); font-size: 68px; box-shadow: 0 20px 70px rgba(0,0,0,.45); }
.update-screen > small { margin-top: 26px; color: var(--mint); font-size: 13px; font-weight: 950; letter-spacing: .14em; }
.update-screen h2 { margin: 10px 0 0; font-size: clamp(34px, 9vw, 62px); line-height: 1; }
.update-screen p { max-width: 560px; margin: 20px 0 0; color: #c4d0cc; font-size: clamp(16px, 4vw, 21px); line-height: 1.45; }
.update-screen > b { margin-top: 18px; color: var(--amber); font-size: 18px; }
.update-notes { width: min(560px, 100%); margin-top: 22px; padding: 18px 20px; border: 1px solid rgba(120,239,182,.28); border-radius: 18px; background: rgba(4,20,17,.6); text-align: left; }
.update-notes > strong { display: block; margin-bottom: 10px; color: var(--mint); font-size: 12px; letter-spacing: .12em; text-align: center; }
.update-notes ul { display: grid; gap: 9px; margin: 0; padding-left: 21px; color: #dce7e3; font-size: 15px; line-height: 1.4; }
.update-notes li::marker { color: var(--mint); }
.update-screen .primary { width: min(430px, 100%); margin-top: 30px; }
.portrait-required { position: fixed; z-index: 110; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background: radial-gradient(circle at 50% 38%, #174b3e 0, #061411 52%, #020908 100%); color: var(--text); text-align: center; }
.portrait-required > .material-symbols-rounded { width: 104px; height: 104px; display: grid; place-items: center; border: 1px solid rgba(120,239,182,.46); border-radius: 28px; background: rgba(120,239,182,.12); color: var(--mint); font-size: 62px; }
.portrait-required small { margin-top: 24px; color: var(--mint); font-size: 13px; font-weight: 950; letter-spacing: .14em; }
.portrait-required h2 { margin: 10px 0 0; font-size: clamp(34px, 8vw, 56px); line-height: 1; }
.portrait-required p { max-width: 520px; margin: 18px 0 0; color: #c4d0cc; font-size: clamp(16px, 3vw, 21px); line-height: 1.45; }
dialog { max-width: 440px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: #0b1b19; color: var(--text); }
dialog { max-height: calc(100svh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
dialog h2 { margin-top: 0; }
dialog p { color: #bac6c2; font-size: 14px; line-height: 1.5; }
.action-confirm-dialog { width: min(560px, calc(100vw - 28px)); max-width: none; padding: clamp(24px, 6vw, 38px); overflow: visible; border-color: rgba(255,189,61,.45); border-radius: 28px; background: radial-gradient(circle at 50% 0, rgba(255,189,61,.13), transparent 48%), #0a1917; text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.7); }
.action-confirm-icon { width: 82px; height: 82px; display: grid; place-items: center; margin: 0 auto 19px; border: 1px solid rgba(255,189,61,.52); border-radius: 24px; background: rgba(255,189,61,.12); color: var(--amber); font-size: 48px; font-variation-settings: "FILL" 1, "wght" 650, "GRAD" 0, "opsz" 48; }
.action-confirm-dialog > small { display: block; color: var(--amber); font-size: 12px; font-weight: 950; letter-spacing: .14em; }
.action-confirm-dialog h2 { margin: 9px 0 0; font-size: clamp(30px, 8vw, 46px); line-height: 1.04; letter-spacing: -.035em; }
.action-confirm-dialog > p { max-width: 460px; margin: 16px auto 0; color: #d7e1de; font-size: clamp(17px, 4.4vw, 21px); line-height: 1.45; }
.action-confirm-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 11px; margin-top: 28px; }
.action-confirm-actions button { min-height: 62px; font-size: 14px; }
.action-confirm-dialog.danger { border-color: rgba(255,62,69,.62); background: radial-gradient(circle at 50% 0, rgba(255,62,69,.18), transparent 50%), #190b0c; }
.action-confirm-dialog.danger .action-confirm-icon { border-color: rgba(255,62,69,.62); background: rgba(255,62,69,.14); color: #ff7479; }
.action-confirm-dialog.danger > small { color: #ff8d91; }.action-confirm-dialog.danger #action-confirm-accept { background: linear-gradient(110deg, #ff5d63, #ed343c); color: white; }
@media (max-width: 480px) { .action-confirm-dialog { padding: 25px 20px; }.action-confirm-actions { grid-template-columns: 1fr; }.action-confirm-actions #action-confirm-accept { grid-row: 1; }.action-confirm-actions button { min-height: 60px; } }
.group-break-dialog { width: min(620px, calc(100vw - 24px)); max-width: none; padding: clamp(22px, 5vw, 34px); border-color: rgba(120,239,182,.45); border-radius: 28px; background: radial-gradient(circle at 50% 0, rgba(120,239,182,.14), transparent 42%), #091916; text-align: center; }
.group-break-icon { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 23px; background: rgba(120,239,182,.13); color: var(--mint); font-size: 46px; font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 48; }
.group-break-dialog > small { color: var(--mint); font-size: 11px; font-weight: 950; letter-spacing: .14em; }.group-break-dialog h2 { margin: 8px 0 0; font-size: clamp(29px, 7vw, 42px); line-height: 1.05; }.group-break-dialog > p { margin: 14px auto 0; color: #d3dedb; font-size: 16px; }
.group-break-dialog section { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; text-align: left; }.group-break-dialog section h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 15px; }.group-break-dialog section h3 .material-symbols-rounded { font-size: 22px; }.group-break-dialog ul { display: grid; gap: 6px; margin: 10px 0 0; padding-left: 21px; color: #c7d3cf; font-size: 14px; line-height: 1.35; }
.group-break-safe { background: rgba(120,239,182,.06); }.group-break-safe h3 { color: var(--mint); }.group-break-avoid { border-color: rgba(255,189,61,.36) !important; background: rgba(255,189,61,.06); }.group-break-avoid h3 { color: #ffd06a; }.group-break-resume { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.04); font-size: 14px !important; }.group-break-dialog > .primary { min-height: 60px; margin-top: 18px; }
.map-settings-dialog { width: min(520px, calc(100vw - 24px)); max-width: none; padding: 20px; }
.map-settings-dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.map-settings-dialog header small { color: var(--mint); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.map-settings-dialog header h2 { margin: 3px 0 0; }
.faq-entry { width: 100%; min-height: 68px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 24px; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px 12px; border: 1px solid rgba(120,239,182,.38); border-radius: 15px; background: rgba(120,239,182,.09); color: var(--text); text-align: left; }
.faq-entry > .material-symbols-rounded:first-child { color: var(--mint); font-size: 30px; }.faq-entry > .material-symbols-rounded:last-child { color: var(--muted); }
.faq-entry b, .faq-entry small { display: block; }.faq-entry b { font-size: 16px; }.faq-entry small { margin-top: 4px; color: #bac6c2; font-size: 12px; line-height: 1.3; }
.welcome-replay-entry { margin-top: -10px; border-color: var(--line); background: var(--panel-soft); }
.map-settings-dialog fieldset { margin: 0 0 14px; padding: 0; border: 0; }
.map-settings-dialog legend { margin-bottom: 8px; color: #bac6c2; font-size: 13px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.segmented-control label { min-height: 48px; position: relative; display: grid; place-items: center; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 10px; color: #bac6c2; font-size: 14px; font-weight: 800; }
.segmented-control input:checked + span { background: rgba(120,239,182,.16); color: var(--mint); }
.map-style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.map-style-grid label { position: relative; min-width: 0; }
.map-style-grid input { position: absolute; opacity: 0; }
.map-style-grid span { min-height: 62px; display: grid; align-content: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.map-style-grid b, .map-style-grid small { display: block; }.map-style-grid b { font-size: 15px; }.map-style-grid small { margin-top: 3px; color: #9dafaa; font-size: 11px; }
.map-style-grid input:checked + span { border-color: var(--mint); background: rgba(120,239,182,.13); color: var(--mint); box-shadow: 0 0 0 1px rgba(120,239,182,.12) inset; }
.settings-list { display: grid; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.settings-list > label { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.settings-list > label:last-child { border-bottom: 0; }
.settings-list b, .settings-list small { display: block; }
.settings-list b { font-size: 16px; }.settings-list small { margin-top: 3px; color: #bac6c2; font-size: 13px; }
.settings-list input[role="switch"] { width: 50px; height: 29px; flex: none; appearance: none; border: 1px solid var(--line); border-radius: 99px; background: #34423f; transition: .2s; }
.settings-list input[role="switch"]::before { content: ""; display: block; width: 23px; height: 23px; margin: 2px; border-radius: 50%; background: white; transition: transform .2s; }
.settings-list input[role="switch"]:checked { background: var(--mint); }.settings-list input[role="switch"]:checked::before { transform: translateX(21px); }
.layer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.layer-grid label { min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); font-size: 14px; font-weight: 750; }
.layer-grid input { width: 21px; height: 21px; accent-color: var(--mint); }
.map-detail-layers { max-height: 250px; overflow: auto; padding-right: 2px; }
.map-settings-reset { width: 100%; min-height: 48px; margin-bottom: 12px; }
.vehicle-settings { display: grid; gap: 8px; }
.vehicle-settings > label { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); }
.vehicle-settings b, .vehicle-settings small { display: block; }.vehicle-settings b { font-size: 15px; }.vehicle-settings small { margin-top: 3px; color: #9dafaa; font-size: 12px; }
.setting-number { display: flex; align-items: center; gap: 6px; flex: none; }
.setting-number input { width: 70px; height: 42px; padding: 0 8px; border: 1px solid rgba(120,239,182,.42); border-radius: 10px; outline: 0; background: #061310; color: var(--text); font-size: 18px; font-weight: 850; text-align: right; }
.setting-number input:focus { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(120,239,182,.12); }
.setting-number i { width: 55px; color: var(--mint); font-size: 11px; font-style: normal; font-weight: 850; }
.settings-privacy { margin: 9px 2px 0 !important; color: #9dafaa !important; font-size: 11px !important; text-align: left !important; }
.map-settings-dialog > p { margin: 2px 0 0; font-size: 10px; text-align: center; }
.faq-dialog { width: min(760px, calc(100vw - 24px)); max-width: none; padding: 22px; }
.faq-dialog > header { position: sticky; z-index: 3; top: -22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -22px -22px 18px; padding: 22px 22px 14px; background: linear-gradient(#0b1b19 82%, rgba(11,27,25,.94)); }
.faq-dialog header small { color: var(--mint); font-size: 12px; font-weight: 900; letter-spacing: .1em; }.faq-dialog header h2 { margin: 4px 0 0; font-size: clamp(22px, 5vw, 30px); }
.faq-intro { margin: 0 0 18px; color: #d5dfdc !important; font-size: 16px !important; }
.faq-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 22px; }
.faq-quick-grid article { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid rgba(120,239,182,.22); border-radius: 14px; background: rgba(120,239,182,.07); }
.faq-quick-grid .material-symbols-rounded { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(120,239,182,.12); color: var(--mint); font-size: 23px; }
.faq-quick-grid b, .faq-quick-grid small { display: block; }.faq-quick-grid b { font-size: 14px; }.faq-quick-grid small { margin-top: 2px; color: #9eafaa; font-size: 11px; line-height: 1.2; }
.faq-list { display: grid; gap: 9px; }
.faq-list > h3 { margin: 14px 2px 2px; color: var(--mint); font-size: 12px; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
.faq-list > h3:first-child { margin-top: 0; }
.faq-list details { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.faq-list summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; color: var(--text); font-size: 16px; font-weight: 850; line-height: 1.25; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }.faq-list summary::after { content: "+"; flex: none; color: var(--mint); font-size: 25px; font-weight: 500; }.faq-list details[open] summary::after { content: "−"; }
.faq-list details[open] summary { border-bottom: 1px solid var(--line); color: var(--mint); }
.faq-list details p { margin: 0; padding: 14px 15px 16px; color: #c2ceca; font-size: 15px; line-height: 1.55; }
.faq-safety { display: flex; align-items: flex-start; gap: 11px; margin: 18px 0 0; padding: 14px; border: 1px solid rgba(255,189,61,.4); border-radius: 14px; background: rgba(255,189,61,.08); color: #ffe0a0 !important; font-size: 14px !important; }.faq-safety .material-symbols-rounded { flex: none; color: var(--amber); font-size: 28px; }.faq-safety b { display: block; margin-bottom: 3px; }
@media (max-width: 560px) { .faq-quick-grid { grid-template-columns: 1fr; }.faq-quick-grid article { min-height: 58px; } }
.routes-dialog, .route-detail-dialog { width: min(760px, calc(100vw - 24px)); max-width: none; max-height: min(780px, calc(100svh - 24px)); overflow: auto; }
.routes-dialog header, .route-detail-dialog header, .publish-route-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.routes-dialog header small, .route-detail-dialog header small, .publish-route-dialog header small { color: var(--mint); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.routes-dialog h2, .route-detail-dialog h2, .publish-route-dialog h2 { margin: 3px 0 0; }
.routes-intro { margin: 0 0 15px; font-size: 15px; }
.routes-list { display: grid; gap: 18px; }
.library-topbar { min-height: 64px; display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.library-topbar .library-switch { justify-self: start; }
.library-topbar .brand { grid-column: 2; }
.library-topbar .settings-mark { grid-column: 3; justify-self: end; }
.routes-heading { margin: 18px 0 8px; text-align: center; }
.routes-heading small { color: var(--mint); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.routes-heading h2 { margin: 4px 0 0; font-size: clamp(28px, 5vw, 42px); }
.route-region { min-width: 0; }
.route-region > header { position: static !important; display: grid !important; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 0 9px !important; padding: 10px 12px !important; border-bottom: 1px solid rgba(120,239,182,.25); background: transparent !important; }
.route-region > header > .material-symbols-rounded { color: var(--mint); font-size: 30px; }
.route-region > header small { color: #9dafaa; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.route-region > header h3 { margin: 2px 0 0; font-size: 21px; }
.route-region > header b { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(120,239,182,.12); color: var(--mint); }
.route-region-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.route-card { min-width: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(15,32,29,.98), rgba(7,20,18,.98)); color: var(--text); text-align: left; }
.route-card > .material-symbols-rounded { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(120,239,182,.12); color: var(--mint); font-size: 29px; }
.route-card strong, .route-card small { display: block; }.route-card strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }.route-card small { margin-top: 6px; color: #bac6c2; font-size: 13px; }
.route-card .route-card-place { overflow: hidden; color: var(--mint); text-overflow: ellipsis; white-space: nowrap; }
.routes-loading, .routes-empty { grid-column: 1 / -1; padding: 34px 12px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; }
.route-detail-dialog header { display: grid; grid-template-columns: 44px 1fr 44px; text-align: center; }
.route-detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 15px 0; }
.route-detail-stats span { padding: 13px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); text-align: center; }
.route-detail-stats small, .route-detail-stats b { display: block; }.route-detail-stats small { color: var(--mint); font-size: 11px; font-weight: 850; }.route-detail-stats b { margin-top: 5px; font-size: 20px; }
.route-author { display: block; margin-bottom: 16px; color: var(--mint); }
.route-location { margin: 8px 0; color: var(--text); font-size: 12px; font-weight: 750; }
.route-detail-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.route-action { min-height: 55px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); color: var(--mint); font-size: 14px; font-weight: 850; text-decoration: none; }
.route-action .material-symbols-rounded { font-size: 20px; }
.page-view { width: min(1180px, 100%); min-height: 100svh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: transparent; }
.page-view[hidden] { display: none; }
body.library-open { overflow: auto; }
body.library-open .shell { display: none; }
.routes-dialog, .route-detail-dialog { max-width: none; max-height: none; overflow: visible; }
.routes-dialog header, .route-detail-dialog header { position: sticky; z-index: 12; top: 0; padding: 10px 0 14px; background: linear-gradient(var(--bg) 78%, transparent); }
.routes-dialog .routes-list { grid-template-columns: 1fr; }
.routes-more { width: min(420px, 100%); margin: 18px auto 0; }
.routes-more[hidden] { display: none; }
.route-preview-shell { position: relative; width: 100%; }
.route-preview-map { width: 100%; height: clamp(440px, 65svh, 760px); overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #07100f; }
.route-map-styles { position: absolute; z-index: 5; top: 12px; left: 12px; display: flex; gap: 5px; padding: 5px; border: 1px solid rgba(176,211,201,.28); border-radius: 14px; background: rgba(3,16,15,.88); box-shadow: 0 8px 26px rgba(0,0,0,.4); backdrop-filter: blur(10px); }
.route-map-styles button { min-width: 66px; height: 48px; display: grid; grid-template-columns: 22px auto; place-content: center; align-items: center; gap: 5px; padding: 0 9px; border: 0; border-radius: 10px; background: transparent; color: #bdc9c5; font-size: 11px; }
.route-map-styles button .material-symbols-rounded { font-size: 19px; }.route-map-styles button[aria-pressed="true"] { background: rgba(120,239,182,.18); color: var(--mint); }.route-map-styles button b { font-weight: 850; }
@media (max-width: 440px) { .route-map-styles { right: 10px; left: 10px; }.route-map-styles button { min-width: 0; flex: 1; padding: 0 5px; }.route-map-styles button b { font-size: 9px; } }
.route-detail-dialog .route-detail-stats { grid-template-columns: repeat(5, 1fr); }
.route-detail-dialog > p, .route-detail-dialog > small { max-width: 850px; margin-inline: auto; text-align: center; }
.route-detail-dialog .route-detail-actions { grid-template-columns: minmax(220px, 1fr) repeat(3, auto); margin-top: 18px; }
.route-navigation-note { margin-top: 16px !important; color: #aebdb8 !important; font-size: 12px !important; }
.route-story { width: min(850px, 100%); margin: 28px auto 8px; padding: clamp(18px, 4vw, 28px); border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(14,34,30,.96), rgba(5,19,17,.98)); }
.route-story > header { position: static; display: flex; align-items: center; gap: 12px; padding: 0; background: none; text-align: left; }
.route-story > header > .material-symbols-rounded { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: rgba(120,239,182,.14); color: var(--mint); font-size: 29px; }
.route-story header small { color: var(--mint); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.route-story h3 { margin: 3px 0 0; font-size: clamp(22px, 5vw, 31px); }
#route-story-status { margin: 14px 0 20px; color: #aebdb8; font-size: 13px; }
.route-timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.route-timeline::before { content: ""; position: absolute; top: 24px; bottom: 24px; left: 21px; width: 2px; background: linear-gradient(var(--mint), rgba(120,239,182,.16)); }
.route-timeline-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 13px; min-height: 86px; padding-bottom: 18px; }
.route-timeline-marker { z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid #245649; border-radius: 50%; background: #09201b; color: var(--mint); font-size: 23px; }
.route-timeline-item.start .route-timeline-marker, .route-timeline-item.finish .route-timeline-marker { background: var(--mint); color: #052019; }
.route-timeline-item.fastest .route-timeline-marker { border-color: rgba(255,189,61,.72); color: var(--amber); }
.route-timeline-item > div { padding: 2px 0 0; }
.route-timeline-item small { display: block; color: var(--mint); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.route-timeline-item strong { display: block; margin-top: 3px; font-size: 18px; }
.route-timeline-item p { margin: 4px 0 0; color: #adbbb7; font-size: 13px; line-height: 1.4; }
.route-detail-dialog .route-story > header { position: static; display: grid; grid-template-columns: 48px minmax(0, 1fr); justify-content: initial; align-items: center; gap: 12px; margin: 0; padding: 0; background: none; text-align: left; }
.route-detail-dialog .route-story > header > div { min-width: 0; text-align: left; }
.route-detail-dialog .route-story > header small, .route-detail-dialog .route-story > header h3 { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; }
.route-detail-dialog .route-detail-actions { grid-template-columns: 1fr; width: min(850px, 100%); margin-inline: auto; }
.route-detail-dialog #share-route { width: 100%; min-height: 58px; }
.map-telemetry { right: 14px; bottom: 14px; left: 14px; width: auto; min-height: 104px; grid-template-columns: 1fr 1fr; }
.map-speed, .map-distance { display: grid; place-content: center; padding: 10px; text-align: center; }
.map-speed { border-right: 1px solid var(--line); }
.map-speed strong, .map-distance strong { font-size: clamp(48px, 10vw, 68px); font-weight: 950; line-height: .9; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.map-speed small, .map-distance small { margin-top: 9px; color: var(--mint); font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.publish-route-dialog { width: min(520px, calc(100vw - 24px)); max-width: none; }
.publish-route-dialog > p { margin: 0 0 14px; font-size: 12px; }
.publish-route-dialog > p a { color: var(--mint); }
.publish-route-dialog > label { display: block; margin-bottom: 12px; color: #bac6c2; font-size: 13px; font-weight: 800; letter-spacing: .03em; }
.publish-route-dialog input, .publish-route-dialog textarea { width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: var(--panel-soft); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }
.publish-route-dialog select { width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); color: var(--text); font: inherit; font-size: 14px; }
.publish-route-dialog input:focus, .publish-route-dialog textarea:focus { border-color: var(--mint); }
.form-error { padding: 9px 11px; border: 1px solid rgba(255,62,69,.45); border-radius: 10px; background: rgba(255,62,69,.08); color: #ffb4b6 !important; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.summary-dialog { width: min(960px, calc(100vw - 28px)); max-width: none; }
.summary-dialog header { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 16px; text-align: center; }
.summary-dialog h2 { margin: 0; color: var(--mint); }
.summary-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--mint); }
.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.summary-grid article { padding: 16px 10px; text-align: center; border-radius: 16px; }
.summary-grid small { display: block; min-height: 30px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.summary-grid article > .material-symbols-rounded { display: block; margin: 4px 0; font-size: 29px; }
.summary-grid strong { display: block; font-size: clamp(17px, 2.2vw, 25px); white-space: nowrap; }
#elevation-chart { width: 100%; height: 150px; margin-top: 10px; border-radius: 16px; }
.summary-actions { margin-top: 10px; }
.summary-actions button { flex: 1; }
.pdf-report-screen { position: fixed; z-index: 180; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: max(12px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom)); background: #dfe7e3; color: #10231d; -webkit-overflow-scrolling: touch; }
.pdf-report-screen[hidden] { display: none; }
.pdf-report-toolbar { position: sticky; z-index: 3; top: 0; width: min(900px, 100%); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 0 auto 12px; padding: 10px; border-radius: 15px; background: rgba(4,20,17,.96); box-shadow: 0 8px 28px rgba(0,0,0,.22); color: white; text-align: center; }
.pdf-report-toolbar button { min-height: 46px; }
.pdf-report-content { width: min(794px, 100%); min-height: 1123px; margin: 0 auto; padding: clamp(24px, 6vw, 52px); background: white; box-shadow: 0 14px 45px rgba(0,0,0,.2); color: #10231d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.pdf-report-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 14px; border-bottom: 5px solid #18b77d; }
.pdf-report-header h1 { margin: 0; color: #092d23; font-size: 32px; font-style: italic; }.pdf-report-header p, .pdf-muted { margin: 4px 0 0; color: #61736d; }
.pdf-report-content h2 { margin: 24px 0 10px; color: #087a57; font-size: 17px; letter-spacing: .04em; }
.pdf-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0; }.pdf-metric, .pdf-card { padding: 12px; border: 1px solid #dbe6e1; border-radius: 12px; background: #f8fbf9; }.pdf-metric small { display: block; min-height: 23px; color: #557068; font-size: 9px; font-weight: 900; letter-spacing: .08em; }.pdf-metric strong { display: block; margin-top: 5px; color: #10231d; font-size: 19px; }
.pdf-map { position: relative; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; border: 1px solid #cbdad4; border-radius: 16px; background: #edf2ef; }.pdf-map img { position: absolute; width: 256px; height: 256px; max-width: none; }.pdf-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }.pdf-map-attribution { position: absolute; right: 5px; bottom: 4px; padding: 2px 5px; background: rgba(255,255,255,.86); color: #31443e; font-size: 8px; }
.pdf-profile svg { display: block; width: 100%; height: auto; border: 1px solid #dbe6e1; border-radius: 14px; background: #f8fbf9; }.pdf-profile svg text { fill: #61736d; font-size: 11px; }.pdf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }.pdf-card b { display: block; margin-bottom: 5px; }.pdf-chips { display: flex; flex-wrap: wrap; gap: 6px; }.pdf-chip { padding: 7px 10px; border-radius: 99px; background: #e8f8f1; font-weight: 750; }.pdf-empty { padding: 28px; border: 1px dashed #cbdad4; border-radius: 12px; color: #61736d; text-align: center; }.pdf-report-footer { margin-top: 24px; padding-top: 10px; border-top: 1px solid #dbe6e1; color: #61736d; font-size: 10px; }
.recovery-dialog { width: min(520px, calc(100vw - 24px)); max-width: none; padding: 28px; text-align: center; }
.recovery-icon { display: block; margin: 0 auto 8px; color: var(--mint); font-size: 52px; }
.recovery-dialog > small { color: var(--mint); font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.recovery-dialog h2 { margin: 7px 0 8px; font-size: clamp(25px, 6vw, 34px); }
.recovery-dialog > p { margin: 0 auto 20px; max-width: 390px; font-size: 16px; }
.recovery-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.recovery-stats span { padding: 15px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.recovery-stats small { display: block; margin-bottom: 5px; color: var(--mint); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.recovery-stats strong { font-size: clamp(21px, 6vw, 29px); }
.recovery-actions { display: grid; gap: 10px; }
.recovery-actions .secondary { width: 100%; }
.recovery-discard { min-height: 42px; border: 0; background: transparent; color: #aebdb8; font-weight: 750; text-decoration: underline; }
.groups-dialog { width: min(540px, calc(100vw - 24px)); max-width: none; }
.groups-page { width: min(1180px, 100%); min-height: 100svh; max-width: none; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: transparent; }
.groups-page[hidden], .groups-content[hidden] { display: none; }
.groups-page > .library-topbar { position: sticky; z-index: 12; top: 0; width: 100%; padding: 10px 0 14px; background: linear-gradient(var(--bg) 78%, transparent); }
.groups-content { width: min(560px, 100%); margin: 22px auto 0; padding: clamp(18px, 4vw, 28px); border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(15,32,29,.96), rgba(7,20,18,.96)); box-shadow: 0 18px 55px rgba(0,0,0,.28); }
.groups-heading { margin-bottom: 12px; text-align: center; }
.groups-heading small { color: var(--mint); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.groups-heading h2 { margin: 4px 0 0; font-size: clamp(28px, 6vw, 40px); }
.groups-content > p { text-align: center; }
.groups-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.groups-dialog header small { color: var(--mint); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.groups-dialog header h2 { margin: 3px 0 0; }
.routes-dialog > .library-topbar, .groups-page > .library-topbar { position: relative; z-index: auto; top: auto; width: 100%; margin: 0; padding: 0; background: transparent; }
.group-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #06110f; }
.group-tabs button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: #9fb1ab; font-size: 12px; font-weight: 900; }
.group-tabs button.active { background: var(--mint); color: #041b15; }
.group-form { display: grid; gap: 13px; }
.group-form[hidden] { display: none; }
.group-form label { color: #bac6c2; font-size: 13px; font-weight: 800; }
.group-form input { width: 100%; margin-top: 6px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: var(--panel-soft); color: var(--text); font: inherit; font-size: 16px; }
.group-form input:focus { border-color: var(--mint); }
.group-hud { position: absolute; z-index: 5; top: 12px; left: 12px; right: 12px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: center; gap: 8px; padding: 12px; border: 1px solid rgba(118,242,189,.4); border-radius: 16px; background: rgba(4,18,16,.92); box-shadow: 0 8px 28px rgba(0,0,0,.38); backdrop-filter: blur(10px); }
.group-hud[hidden] { display: none; }
.group-hud div { min-width: 0; grid-column: 1 / 6; }
.group-hud > #group-share { grid-column: 6; }
.group-hud small, .group-hud strong, .group-hud span { display: block; }
.group-hud small { color: var(--mint); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.group-hud strong { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.group-hud span { color: #b7c5c0; font-size: 12px; }
.group-hud > button { min-height: 48px; border: 1px solid var(--line); border-radius: 11px; background: #102421; color: var(--text); }
.active-group-status { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); color: var(--mint) !important; font-weight: 850; text-align: center; }
.group-sos-toast { position: fixed; z-index: 80; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; background: radial-gradient(circle at center, #792025, #180708 72%); color: white; text-align: center; }
.group-sos-toast[hidden] { display: none; }
.group-sos-toast > .material-symbols-rounded { font-size: clamp(76px, 24vw, 140px); }
.group-sos-toast small { margin-top: 8px; font-size: clamp(16px, 4vw, 24px); font-weight: 950; letter-spacing: .14em; }
.group-sos-toast strong { margin-top: 14px; font-size: clamp(34px, 9vw, 68px); line-height: 1.03; }
.group-sos-toast p { margin: 16px 0 28px; font-size: clamp(17px, 4vw, 25px); }
.group-sos-coordinates { margin-bottom: 18px; font-size: clamp(18px, 5vw, 28px) !important; font-variant-numeric: tabular-nums; }
.group-sos-links { width: min(560px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.group-sos-links a { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(255,255,255,.5); border-radius: 13px; background: rgba(0,0,0,.3); color: white; font-size: clamp(12px, 3.3vw, 16px); font-weight: 900; text-decoration: none; }
.group-sos-toast .primary { max-width: 440px; }
.group-safety-alert { position: fixed; z-index: 170; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 34%, #8b272c, #26090b 66%, #090202); color: white; text-align: center; }
.group-safety-alert[hidden] { display: none; }
.group-safety-alert > .material-symbols-rounded { font-size: clamp(72px, 22vw, 120px); }
.group-safety-alert > small { margin-top: 10px; font-size: 13px; font-weight: 950; letter-spacing: .16em; }
.group-safety-alert h2 { margin: 10px 0 0; font-size: clamp(42px, 12vw, 70px); }
.group-safety-alert > p { max-width: 560px; margin: 13px 0 0; font-size: clamp(16px, 4.5vw, 22px); line-height: 1.35; }
.group-safety-alert > strong { width: 132px; height: 132px; display: grid; place-content: center; margin-top: 20px; border: 4px solid rgba(255,255,255,.76); border-radius: 50%; font-size: 38px; font-variant-numeric: tabular-nums; }
.group-safety-alert > div { width: min(560px, 100%); display: grid; gap: 10px; margin-top: 24px; }
.group-safety-alert button { width: 100%; min-height: 60px; }
.group-active-dialog .primary, .group-active-dialog .secondary { width: 100%; margin-top: 10px; }
.group-active-dialog button[hidden] { display: none !important; }
.group-leave { color: #ff8a8f !important; border-color: #a53a3e !important; }
.group-members { margin: 16px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(4,17,15,.55); }
.group-members-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.group-members-heading small { color: var(--mint); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.group-members-heading h3 { margin: 2px 0 0; font-size: 18px; }
.group-members-heading > span { color: #aebdb8; font-size: 11px; font-weight: 800; }
.group-members-list { display: grid; gap: 7px; }
.group-member { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px; border-radius: 11px; background: var(--panel-soft); }
.group-member-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #173b33; color: var(--mint); font-size: 15px; font-weight: 950; text-transform: uppercase; }
.group-member-main { min-width: 0; }
.group-member-main strong, .group-member-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-member-main strong { font-size: 14px; }
.group-member-main small { margin-top: 2px; color: #9fb0aa; font-size: 11px; }
.group-member-main .group-member-telemetry { margin-top: 5px; color: var(--mint); white-space: normal; line-height: 1.25; }
.group-member.separated { box-shadow: inset 3px 0 var(--amber); }.group-member.behind { box-shadow: inset 3px 0 var(--red); }
.group-member-kick { min-width: 38px; min-height: 38px; display: grid; place-items: center; border: 1px solid #7e3438; border-radius: 10px; background: transparent; color: #ff858a; }
.group-member-kick .material-symbols-rounded { font-size: 20px; }
.group-member-state { width: 9px; height: 9px; border-radius: 50%; background: #64736e; box-shadow: 0 0 0 4px rgba(100,115,110,.12); }
.group-member-state.online { background: var(--mint); box-shadow: 0 0 0 4px rgba(118,242,189,.13); }
.summary-participants { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-soft); }
.summary-participants > small { color: var(--mint); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.summary-participants > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.summary-rider { padding: 8px 11px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); font-size: 12px; font-weight: 800; }.summary-rider b, .summary-rider small { display: block; }.summary-rider small { margin-top: 3px; color: #9fb0aa; font-size: 10px; font-weight: 650; }

@media (orientation: portrait), (max-width: 700px) {
  body.library-open .page-view:not([hidden]) { position: fixed; z-index: 100; inset: 0; width: 100%; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) 12px max(30px, env(safe-area-inset-bottom)); background: var(--bg); overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .pdf-report-toolbar { grid-template-columns: 1fr 1fr; }.pdf-report-toolbar > strong { display: none; }.pdf-report-toolbar button { padding-inline: 9px; font-size: 11px; }
  .pdf-report-content { min-height: 0; padding: 22px 15px; }.pdf-report-header { align-items: start; }.pdf-report-header h1 { font-size: 25px; }.pdf-report-header .pdf-muted { font-size: 10px; text-align: right; }
  .pdf-metrics { grid-template-columns: 1fr 1fr; }.pdf-metric strong { font-size: 16px; }.pdf-grid { grid-template-columns: 1fr; }
  .map-settings-dialog[open] { position: fixed; top: max(12px, calc(env(safe-area-inset-top) + 8px)); right: max(12px, env(safe-area-inset-right)); bottom: auto; left: max(12px, env(safe-area-inset-left)); width: auto; height: calc(100dvh - max(12px, calc(env(safe-area-inset-top) + 8px)) - max(12px, calc(env(safe-area-inset-bottom) + 8px))); min-height: 0; max-width: none; max-height: none; margin: 0; padding: 20px 20px max(32px, calc(env(safe-area-inset-bottom) + 20px)); overflow-x: hidden; overflow-y: scroll; overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .map-settings-dialog header { position: sticky; z-index: 4; top: -20px; min-height: 68px; align-items: flex-start; margin: -20px -20px 16px; padding: 24px 20px 10px; background: linear-gradient(#0b1b19 78%, rgba(11,27,25,.92)); }
  .map-settings-dialog #close-map-settings { flex: none; margin-top: 0; }
  .map-settings-dialog .map-detail-layers { max-height: none; overflow: visible; padding-right: 0; }
  .faq-dialog[open] { position: fixed; top: max(12px, calc(env(safe-area-inset-top) + 8px)); right: max(12px, env(safe-area-inset-right)); bottom: auto; left: max(12px, env(safe-area-inset-left)); width: auto; height: calc(100dvh - max(12px, calc(env(safe-area-inset-top) + 8px)) - max(12px, calc(env(safe-area-inset-bottom) + 8px))); min-height: 0; max-height: none; margin: 0; padding: 20px 16px max(28px, calc(env(safe-area-inset-bottom) + 18px)); overflow-x: hidden; overflow-y: scroll; overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .faq-dialog > header { top: -20px; margin: -20px -16px 16px; padding: 24px 16px 12px; }
  .faq-list summary { font-size: 15px; }
  .shell { width: 100%; min-height: 100svh; padding: max(15px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); gap: 9px; }
  .topbar { min-height: 84px; display: grid; grid-template-columns: 44px 1fr 44px; grid-template-rows: 38px 40px; row-gap: 6px; }
  .brand { grid-column: 1 / -1; grid-row: 1; justify-self: center; margin: 0; }
  .view-switch { position: static; grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .library-topbar .library-switch { justify-self: center; }
  .settings-mark { top: 0; right: 0; }
  .view-switch button { min-width: 42px; padding: 0 6px; }
  .view-switch button b { display: none; }
  .brand > span { font-size: 27px; }
  h1 { font-size: 22px; }
  .map-selected .shell { padding-right: max(7px, env(safe-area-inset-right)); padding-left: max(7px, env(safe-area-inset-left)); gap: 6px; }
  .map-selected .topbar { min-height: 42px; grid-template-rows: 40px; }
  .map-selected .topbar .brand { display: none; }
  .map-selected .view-switch { grid-row: 1; }
  .map-selected .settings-mark { top: 0; right: 2px; }
  .map-selected .dashboard { margin-right: -1px; margin-left: -1px; }
  .map-selected .map-view { border-radius: 18px; }
  .metrics { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 4px; }
  .speed-card { border: 0; background: transparent; box-shadow: none; }
  .speed-label { display: none; }
  .speed-gauge { min-height: 112px; margin: 0 auto; }
  .speed-gauge strong { font-size: clamp(88px, 28vw, 122px); }
  .speed-card > span:not(.material-symbols-rounded) { margin-top: -3px; }
  .trip-strip { margin-top: 24px; gap: 21px 8px; }
  .trip-strip small { font-size: 12px; }
  .trip-strip b { margin-top: 7px; font-size: clamp(20px, 6vw, 25px); }
  .sensor-strip { width: 100%; margin-top: 22px; gap: 8px; }
  .sensor-strip > div { min-height: 82px; }
  .sensor-strip small { font-size: 13px; }
  .sensor-icon { font-size: 32px; }
  .sensor-strip b { font-size: clamp(30px, 8.8vw, 38px); }
  .sensor-reading { height: 46px; gap: 9px; margin-top: 8px; }
  .ride-info { grid-template-rows: auto auto; margin-top: 17px; }
  .weather-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .weather-card { min-height: 108px; gap: 8px; padding: 6px 2px; }
  .weather-row .weather-card { width: 100%; }
  .weather-icon { font-size: 35px; }
  .weather-card small { font-size: 13px; }
  .weather-card strong { font-size: 21px; }
  .weather-card em { font-size: 14px; }
  .weather-reading { gap: 7px; }
  .testbar { margin-top: 0; }
  button.primary { min-height: 59px; font-size: 15px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid article:last-child { grid-column: 1 / -1; }
  .summary-actions { flex-direction: column; }
  .routes-list { grid-template-columns: 1fr; }
  .route-detail-actions { grid-template-columns: 1fr 1fr; }.route-detail-actions .primary { grid-column: 1 / -1; }
  .routes-dialog .routes-list { grid-template-columns: 1fr; }
  .route-region-list { grid-template-columns: 1fr; }
  .route-detail-dialog .route-detail-stats { grid-template-columns: 1fr 1fr; }
  .route-detail-dialog .route-detail-stats span:last-child { grid-column: 1 / -1; }
  .route-detail-dialog .route-detail-actions { grid-template-columns: 1fr 1fr; }
  .route-detail-dialog .route-detail-actions .primary { grid-column: 1 / -1; }
  .route-preview-map { height: 58svh; min-height: 390px; }
  .route-detail-stats b { font-size: 17px; }
  .map-legend { display: none; }
  .map-telemetry { right: 66px; bottom: 25px; left: 7px; width: auto; min-height: 112px; grid-template-columns: 86px minmax(0, 1fr); border-radius: 15px; }
  .map-speed { padding: 7px 5px; }.map-speed strong { font-size: 46px; }.map-speed small { font-size: 11px; }
  .map-telemetry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-telemetry-grid span { padding: 5px 3px; }.map-telemetry-grid span:nth-child(n+4) { grid-column: span 1; }
  .map-telemetry-grid small { font-size: 8px; }.map-telemetry-grid b { margin-top: 4px; font-size: 13px; }
  .route-hud { right: 8px; left: 8px; justify-content: center; }.route-hud span { min-width: 0; flex: 1; }.route-hud b { font-size: 20px; }
  .map-controls { top: 82px; }
  .dgt-toast { top: max(10px, env(safe-area-inset-top)); width: calc(100% - 16px); grid-template-columns: 60px minmax(0, 1fr) auto 34px; gap: 10px; min-height: 172px; padding: 16px 12px 19px; border-radius: 22px; }
  .dgt-toast-accent { width: 58px; height: 58px; border-radius: 17px; }
  .dgt-toast-accent .material-symbols-rounded { font-size: 39px; }
  .dgt-toast-copy small { font-size: 10px; }
  .dgt-toast-copy strong { font-size: clamp(22px, 6.5vw, 28px); white-space: normal; }
  .dgt-toast-copy span { font-size: 13px; white-space: normal; }
  .dgt-toast > b { font-size: 23px; }
}

@media (max-height: 760px) and (orientation: portrait) {
  .shell { overflow: auto; }
  .metrics { grid-template-rows: auto minmax(0, 1fr); }
  .speed-gauge { min-height: 96px; }
  .sensor-strip > div { min-height: 62px; }
}

@media (orientation: landscape) {
  .shell { width: 100%; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); gap: 5px; }
  .topbar { min-height: 28px; }
  .brand > span { font-size: 27px; } h1 { font-size: 23px; }
  .view-switch button { height: 34px; font-size: 12px; }
  .metrics { grid-template-columns: .72fr 1.28fr; }
  .speed-card { border: 0; background: transparent; box-shadow: none; }
  .speed-label { display: none; }
  .speed-gauge { min-height: 105px; margin: 0 auto; }
  .speed-gauge strong { font-size: clamp(68px, 10vw, 104px); }
  .sensor-strip { display: none; }
  .ride-info { grid-template-rows: auto auto; gap: 7px; }
  .landscape-sensors { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .landscape-sensors article { min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .landscape-sensors small { color: var(--mint); font-size: 12px; font-weight: 850; }
  .landscape-sensors .sensor-icon { margin: 0; font-size: 32px; }
  .landscape-sensors .compass .material-symbols-rounded { margin: 0; font-size: 26px; }
  .landscape-sensors strong { font-size: clamp(22px, 4vw, 34px); }
  .weather-card { min-height: 76px; padding: 9px 14px; }
  .trip-strip { margin-top: 22px; }
  .dgt-panel { align-self: end; width: 100%; max-height: 76px; padding: 6px 9px; overflow: hidden; }
  .dgt-panel > header { margin-bottom: 3px; }
  .dgt-panel > header .material-symbols-rounded { font-size: 17px; }
  .dgt-panel h2 { font-size: 13px; }
  .dgt-alert, .dgt-empty { min-height: 36px; padding: 4px 8px; }
  .dgt-alert strong, .dgt-empty strong { font-size: 15px; }
  .dgt-alert em, .dgt-empty span { font-size: 11px; }
  .dgt-alerts .dgt-alert:nth-child(2) { display: none; }
  .weather-icon { font-size: 33px; }
  button.primary { min-height: 50px; font-size: 15px; }
  .testbar { width: calc(64% - 4px); margin-left: auto; }
  .map-selected .shell { padding-right: max(8px, env(safe-area-inset-right)); padding-left: max(8px, env(safe-area-inset-left)); }
  .map-selected .brand { display: none; }
  .map-selected .topbar { min-height: 36px; }
  .map-selected .map-view { border-radius: 16px; }
  .map-selected .testbar { width: auto; margin-left: 0; }
  .map-selected .map-telemetry { width: min(760px, calc(100% - 150px)); min-height: 76px; grid-template-columns: 96px minmax(0, 1fr); }
  .map-selected .map-speed strong { font-size: 44px; }
  .disclaimer { display: none; }
  .summary-dialog { padding: 14px; }
  #elevation-chart { height: 105px; }
  .dgt-toast { top: max(8px, env(safe-area-inset-top)); min-height: 142px; padding-top: 14px; padding-bottom: 18px; }
}

/* El modo vertical es una limitación del móvil, no de los ordenadores. */
@media (orientation: landscape) and (pointer: coarse) {
  .portrait-required { display: flex; }
}

/* Alertas de conducción: ocupan la pantalla para que puedan leerse sin fijar la vista. */
.dgt-toast { inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); left: 8px; width: auto; min-height: 0; grid-template-columns: 1fr; grid-template-rows: auto auto auto; place-content: center; gap: clamp(16px, 4svh, 30px); padding: max(28px, env(safe-area-inset-top)) 28px max(34px, env(safe-area-inset-bottom)); border-width: 3px; border-radius: 28px; text-align: center; transform: translateY(-110%); }
.dgt-toast.visible { transform: translateY(0); }
.dgt-toast.leaving { transform: translateY(-110%); }
.dgt-toast-accent { width: clamp(86px, 17vw, 132px); height: clamp(86px, 17vw, 132px); margin: 0 auto; border-radius: 50%; }
.dgt-toast-accent .material-symbols-rounded { font-size: clamp(54px, 10vw, 82px); }
.dgt-toast-copy small { margin-bottom: 12px; font-size: clamp(15px, 2.6vw, 24px); }
.dgt-toast-copy strong { font-size: clamp(36px, 7vw, 70px); line-height: 1; white-space: normal; }
.dgt-toast-copy span { margin-top: 14px; font-size: clamp(18px, 3vw, 28px); white-space: normal; }
.dgt-toast > b { font-size: clamp(68px, 17vw, 150px); line-height: .8; }
.dgt-toast button { position: absolute; top: 18px; right: 18px; width: 50px; height: 50px; }
.dgt-toast.moto-risk { border-color: rgba(255,62,69,.86); background: linear-gradient(135deg, rgba(45,12,15,.995), rgba(7,20,18,.995) 70%); }
.dgt-toast.moto-risk .dgt-toast-accent { background: rgba(255,62,69,.16); color: var(--red); }
.dgt-toast.moto-risk .dgt-toast-copy small { color: var(--red); }
.dgt-toast.moto-risk > i { background: var(--red); }

/* iPhone 11 y posteriores: 360–440 CSS px, formato vertical. */
@media (orientation: portrait) and (pointer: coarse) and (min-width: 350px) and (max-width: 440px) {
  html, body { width: 100%; height: 100%; min-height: 100dvh; overflow: hidden; }
  body { overscroll-behavior: none; }
  .shell { height: 100dvh; min-height: 100dvh; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); grid-template-rows: 76px auto minmax(0, 1fr) auto; gap: 7px; overflow: hidden; }
  .shell > .notice[hidden] { display: none; }
  .topbar { min-height: 76px; grid-template-rows: 31px 38px; row-gap: 5px; }
  .brand > span { font-size: 24px; }
  h1 { font-size: 20px; }
  .view-switch { padding: 2px; border-radius: 11px; }
  .view-switch button { min-width: 45px; height: 34px; padding: 0 8px; }
  .view-switch button .material-symbols-rounded { font-size: 20px; }
  .settings-mark { width: 36px; height: 36px; }
  .settings-mark .material-symbols-rounded { font-size: 25px; }
  .dashboard { grid-row: 3; }
  .idle-ride-hero { gap: clamp(9px, 1.4vh, 15px); padding: clamp(12px, 2vh, 20px) 13px; border-radius: 22px; overflow-y: auto; }
  .idle-road-art { width: clamp(62px, 9.5vh, 82px); height: clamp(62px, 9.5vh, 82px); }.idle-road-art .material-symbols-rounded { font-size: clamp(34px, 5.6vh, 46px); }
  .idle-copy h2 { margin-top: 5px; font-size: clamp(34px, 5.4vh, 48px); }.idle-copy p { margin-top: 9px; font-size: clamp(14px, 2vh, 17px); }
  .idle-suggestion { padding: 11px 13px; }.idle-suggestion > .material-symbols-rounded { font-size: 25px; }.idle-suggestion strong { font-size: 12px; }
  .idle-start-button { min-height: 70px; grid-template-columns: 43px minmax(0,1fr) 24px; padding: 8px 13px; border-radius: 18px; }.idle-start-button > .material-symbols-rounded:first-child { font-size: 32px; }.idle-start-button b { font-size: 18px; }.idle-start-button small { font-size: 10px; }
  .idle-calibrating { padding: 13px; grid-template-columns: 52px minmax(0,1fr); }.gps-pulse { width: 50px; height: 50px; }.idle-calibrating strong { font-size: 14px; }
  .metrics { height: 100%; grid-template-rows: minmax(0, auto) auto; align-content: center; gap: 3px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .metrics::-webkit-scrollbar { display: none; }
  .speed-card { justify-content: flex-start; overflow: visible; }
  .speed-gauge { min-height: 84px; }
  .speed-gauge strong { font-size: clamp(78px, 24vw, 104px); }
  .speed-card > span:not(.material-symbols-rounded) { margin-top: -1px; font-size: 17px; }
  .trip-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 4px; margin-top: 13px; }
  .trip-strip small { min-height: 22px; display: flex; align-items: flex-end; justify-content: center; font-size: clamp(8px, 2.35vw, 10px); line-height: 1.1; letter-spacing: .045em; }
  .trip-strip b { margin-top: 4px; overflow: hidden; font-size: clamp(16px, 4.55vw, 19px); letter-spacing: -.035em; text-overflow: clip; }
  .sensor-strip { margin-top: 13px; gap: 5px; }
  .sensor-strip > div { min-height: 64px; padding: 2px; }
  .sensor-strip small { font-size: 10px; }
  .sensor-reading { height: 38px; gap: 7px; margin-top: 4px; }
  .sensor-icon { font-size: 27px; }
  .sensor-strip b { font-size: clamp(25px, 7.4vw, 32px); }
  .compass { width: 38px; height: 38px; }
  .compass .material-symbols-rounded { font-size: 22px; }
  .ride-info { margin-top: 8px; gap: 2px; }
  .weather-row { gap: 5px; }
  .weather-card { min-height: 78px; padding: 3px 1px; gap: 3px; }
  .weather-card small { font-size: 10px; }
  .weather-reading { min-height: 36px; gap: 5px; }
  .weather-icon { font-size: 28px; }
  .weather-card strong { max-width: 100%; font-size: clamp(15px, 4.2vw, 18px); overflow-wrap: anywhere; }
  .weather-card em { margin-top: 3px; font-size: clamp(11px, 3vw, 13px); }
  .testbar { grid-row: 4; gap: 4px; }
  .actions { gap: 10px; }
  .actions button { width: 52px !important; min-width: 52px; height: 52px; min-height: 52px !important; }
  .actions button .material-symbols-rounded { font-size: 27px; }
  .disclaimer { max-width: 94%; font-size: 9px; line-height: 1.2; text-align: center; }
  .app-version { font-size: 9px; }
  .map-selected .shell { grid-template-rows: 38px auto minmax(0, 1fr) auto; padding-right: max(5px, env(safe-area-inset-right)); padding-left: max(5px, env(safe-area-inset-left)); }
  .map-selected .topbar { min-height: 38px; }
  .map-selected .dashboard { grid-row: 3; }
  .map-selected .map-view { border-radius: 16px; }
  .map-telemetry { right: 58px; bottom: 8px; left: 6px; min-height: 98px; grid-template-columns: 74px minmax(0, 1fr); }
  .map-speed strong { font-size: 40px; }
  .map-telemetry-grid span { padding: 4px 2px; }
  .map-telemetry-grid small { font-size: 7px; }
  .map-telemetry-grid b { font-size: 11px; }
  .map-controls { top: 70px; right: 6px; gap: 5px; }
  .map-controls button { width: 42px; height: 42px; }
  #map-status { top: 8px; max-width: calc(100% - 116px); padding: 7px 9px; font-size: 11px; }
  .route-hud { top: 7px; right: 6px; left: 6px; }
  .route-hud small { font-size: 8px; }
  .route-hud b { font-size: 16px; }
  .group-hud { top: 7px; right: 7px; left: 7px; padding: 9px; }
  .group-hud strong { font-size: 16px; }
  body.library-open { height: auto; min-height: 100dvh; overflow: auto; overscroll-behavior: auto; }
  body.library-open .page-view:not([hidden]) { position: fixed; z-index: 100; inset: 0; width: 100%; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) 12px max(30px, env(safe-area-inset-bottom)); background: var(--bg); overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .page-view, .groups-page { min-height: 100dvh; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .library-topbar { min-height: 76px; grid-template-rows: 31px 38px; }
  .routes-heading, .groups-content { margin-top: 14px; }
  .routes-heading h2, .groups-heading h2 { font-size: 28px; }
  .route-card { grid-template-columns: 46px minmax(0, 1fr); padding: 10px; }
  .route-card > .material-symbols-rounded { width: 46px; height: 46px; }
  .route-preview-map { height: 58dvh; min-height: 390px; }
  .route-detail-dialog .route-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .route-detail-dialog .route-detail-stats span:last-child { grid-column: 1 / -1; }
  .route-detail-dialog .route-detail-actions { grid-template-columns: 1fr 1fr; }
  .route-detail-dialog .route-detail-actions .primary { grid-column: 1 / -1; }
  .groups-content { padding: 17px 14px; }
  dialog { width: calc(100vw - 20px); max-height: calc(100dvh - max(20px, env(safe-area-inset-top) + env(safe-area-inset-bottom))); padding: 18px 14px max(20px, env(safe-area-inset-bottom)); }
  .summary-grid { gap: 6px; }
  .summary-grid article { padding: 11px 5px; }
  .summary-grid small { min-height: 25px; font-size: 9px; }
  .summary-grid strong { font-size: 17px; }
  #elevation-chart { height: 118px; }
  .group-sos-toast { padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
  .group-sos-links { grid-template-columns: 1fr; }
  .welcome-screen { padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); }
  .welcome-brand { font-size: 21px; }
  .welcome-content h2 { font-size: clamp(37px, 11vw, 49px); }
  .welcome-features { gap: 8px; }
  .welcome-features article { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 11px; }
  .welcome-features article > .material-symbols-rounded { width: 42px; height: 42px; font-size: 25px; }
  .welcome-features strong { font-size: 15px; }
  .welcome-features p { font-size: 12px; }
  .welcome-continue { min-height: 58px; }
}

/* iPhone compactos (11 Pro, 12/13 mini) y barra del navegador visible. */
@media (orientation: portrait) and (pointer: coarse) and (min-width: 350px) and (max-width: 390px) and (max-height: 820px) {
  .shell { grid-template-rows: 70px auto minmax(0, 1fr) auto; }
  .topbar { min-height: 70px; }
  .speed-gauge { min-height: 72px; }
  .speed-gauge strong { font-size: 76px; }
  .trip-strip { margin-top: 8px; row-gap: 8px; }
  .sensor-strip { margin-top: 8px; }
  .ride-info { margin-top: 3px; }
  .weather-card { min-height: 68px; }
  .actions button { width: 48px !important; min-width: 48px; height: 48px; min-height: 48px !important; }
  .welcome-content > small { margin-top: 18px; }
  .welcome-content h2 { font-size: 37px; }
  .welcome-lead { font-size: 14px; }
}

/* Android: teléfonos compactos, estándar y grandes con Chrome/PWA. */
@media (orientation: portrait) and (pointer: coarse) and (max-width: 520px) {
  .platform-android, .platform-android body { width: 100%; height: 100%; min-height: 100dvh; overflow: hidden; }
  .platform-android body { overscroll-behavior: none; }
  .platform-android .shell { width: 100%; height: 100dvh; min-height: 100dvh; grid-template-rows: 72px auto minmax(0, 1fr) auto; gap: 6px; padding: max(8px, env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left)); overflow: hidden; }
  .platform-android .topbar { min-height: 72px; grid-template-rows: 29px 37px; row-gap: 5px; }
  .platform-android .brand > span { font-size: 23px; }
  .platform-android h1 { font-size: 20px; }
  .platform-android .view-switch { padding: 2px; border-radius: 10px; }
  .platform-android .view-switch button { min-width: 46px; height: 33px; padding: 0 8px; }
  .platform-android .view-switch button .material-symbols-rounded { font-size: 20px; }
  .platform-android .settings-mark { width: 35px; height: 35px; }
  .platform-android .dashboard { grid-row: 3; }
  .platform-android .metrics { height: 100%; grid-template-rows: minmax(0, auto) auto; align-content: center; gap: 3px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; }
  .platform-android .metrics::-webkit-scrollbar { display: none; }
  .platform-android .speed-card { justify-content: flex-start; overflow: visible; }
  .platform-android .speed-gauge { min-height: clamp(72px, 12dvh, 100px); }
  .platform-android .speed-gauge strong { font-size: clamp(76px, 23vw, 112px); }
  .platform-android .speed-card > span:not(.material-symbols-rounded) { margin-top: 0; font-size: 17px; }
  .platform-android .trip-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.7dvh, 14px) 4px; margin-top: clamp(8px, 1.7dvh, 15px); }
  .platform-android .trip-strip small { min-height: 21px; display: flex; align-items: flex-end; justify-content: center; font-size: clamp(8px, 2.3vw, 10px); line-height: 1.08; letter-spacing: .04em; }
  .platform-android .trip-strip b { margin-top: 4px; font-size: clamp(17px, 5vw, 23px); }
  .platform-android .sensor-strip { margin-top: clamp(8px, 1.6dvh, 14px); gap: 5px; }
  .platform-android .sensor-strip > div { min-height: clamp(58px, 8.5dvh, 70px); padding: 2px; }
  .platform-android .sensor-strip small { font-size: 10px; }
  .platform-android .sensor-reading { height: 38px; gap: 7px; margin-top: 4px; }
  .platform-android .sensor-icon { font-size: 27px; }
  .platform-android .sensor-strip b { font-size: clamp(25px, 7.2vw, 34px); }
  .platform-android .compass { width: 38px; height: 38px; }
  .platform-android .compass .material-symbols-rounded { font-size: 22px; }
  .platform-android .ride-info { margin-top: clamp(3px, 1dvh, 8px); gap: 2px; }
  .platform-android .weather-row { gap: 5px; }
  .platform-android .weather-card { min-height: clamp(68px, 10dvh, 82px); padding: 3px 1px; gap: 3px; }
  .platform-android .weather-card small { font-size: 10px; }
  .platform-android .weather-reading { min-height: 35px; gap: 5px; }
  .platform-android .weather-icon { font-size: 28px; }
  .platform-android .weather-card strong { font-size: clamp(16px, 4.6vw, 21px); }
  .platform-android .weather-card em { margin-top: 3px; font-size: clamp(11px, 3vw, 13px); }
  .platform-android .testbar { grid-row: 4; gap: 3px; }
  .platform-android .actions { gap: 9px; }
  .platform-android .actions button { width: 50px !important; min-width: 50px; height: 50px; min-height: 50px !important; }
  .platform-android .actions button .material-symbols-rounded { font-size: 27px; }
  .platform-android .disclaimer { max-width: 96%; font-size: 9px; line-height: 1.15; text-align: center; }
  .platform-android .app-version { font-size: 9px; }

  .platform-android .map-selected .shell { grid-template-rows: 37px auto minmax(0, 1fr) auto; padding-right: max(5px, env(safe-area-inset-right)); padding-left: max(5px, env(safe-area-inset-left)); }
  .platform-android .map-selected .topbar { min-height: 37px; }
  .platform-android .map-selected .map-view { border-radius: 15px; }
  .platform-android .map-telemetry { right: 58px; bottom: 7px; left: 6px; min-height: 96px; grid-template-columns: 72px minmax(0, 1fr); }
  .platform-android .map-speed { padding: 4px; }
  .platform-android .map-speed strong { font-size: 39px; }
  .platform-android .map-telemetry-grid span { padding: 4px 2px; }
  .platform-android .map-telemetry-grid small { font-size: 7px; }
  .platform-android .map-telemetry-grid b { font-size: 11px; }
  .platform-android .map-controls { top: 67px; right: 6px; gap: 5px; }
  .platform-android .map-controls button { width: 42px; height: 42px; }
  .platform-android #map-status { top: 7px; max-width: calc(100% - 112px); padding: 7px 9px; font-size: 11px; }
  .platform-android .route-hud { top: 6px; right: 6px; left: 6px; }
  .platform-android .route-hud small { font-size: 8px; }
  .platform-android .route-hud b { font-size: 16px; }
  .platform-android .group-hud { top: 7px; right: 7px; left: 7px; padding: 9px; }

  .platform-android body.library-open { height: auto; min-height: 100dvh; overflow: auto; overscroll-behavior: auto; }
  .platform-android body.library-open .page-view:not([hidden]) { position: fixed; z-index: 100; inset: 0; width: 100%; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) 12px max(30px, env(safe-area-inset-bottom)); background: var(--bg); overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .platform-android .page-view, .platform-android .groups-page { min-height: 100dvh; padding: max(9px, env(safe-area-inset-top)) max(11px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(11px, env(safe-area-inset-left)); }
  .platform-android .library-topbar { min-height: 72px; grid-template-rows: 29px 37px; }
  .platform-android .routes-heading, .platform-android .groups-content { margin-top: 13px; }
  .platform-android .routes-heading h2, .platform-android .groups-heading h2 { font-size: 28px; }
  .platform-android .route-region > header { grid-template-columns: 36px minmax(0, 1fr) auto; padding-inline: 7px !important; }
  .platform-android .route-region > header > .material-symbols-rounded { font-size: 27px; }
  .platform-android .route-card { grid-template-columns: 45px minmax(0, 1fr); padding: 10px; }
  .platform-android .route-card > .material-symbols-rounded { width: 45px; height: 45px; font-size: 26px; }
  .platform-android .route-preview-map { height: 58dvh; min-height: 380px; }
  .platform-android .route-detail-dialog .route-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .platform-android .route-detail-dialog .route-detail-stats span:last-child { grid-column: 1 / -1; }
  .platform-android .route-detail-dialog .route-detail-actions { grid-template-columns: 1fr 1fr; }
  .platform-android .route-detail-dialog .route-detail-actions .primary { grid-column: 1 / -1; }
  .platform-android .groups-content { padding: 17px 14px; }
  .platform-android dialog { width: calc(100vw - 18px); max-height: calc(100dvh - max(18px, env(safe-area-inset-top) + env(safe-area-inset-bottom))); padding: 17px 14px max(19px, env(safe-area-inset-bottom)); }
  .platform-android .map-settings-dialog[open], .platform-android .faq-dialog[open] { top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); left: max(8px, env(safe-area-inset-left)); height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))); }
  .platform-android .summary-grid { gap: 6px; }
  .platform-android .summary-grid article { padding: 10px 5px; }
  .platform-android .summary-grid small { min-height: 25px; font-size: 9px; }
  .platform-android .summary-grid strong { font-size: 17px; }
  .platform-android #elevation-chart { height: 115px; }
  .platform-android .welcome-screen { padding: max(16px, env(safe-area-inset-top)) 15px max(16px, env(safe-area-inset-bottom)); }
  .platform-android .welcome-content h2 { font-size: clamp(36px, 10.8vw, 52px); }
  .platform-android .welcome-features { gap: 8px; }
  .platform-android .welcome-features article { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 11px; }
  .platform-android .welcome-features article > .material-symbols-rounded { width: 42px; height: 42px; font-size: 25px; }
  .platform-android .welcome-features strong { font-size: 15px; }
  .platform-android .welcome-features p { font-size: 12px; }
}

/* Android compacto: 320–359 px o poca altura útil. */
@media (orientation: portrait) and (pointer: coarse) and (max-width: 359px), (orientation: portrait) and (pointer: coarse) and (max-height: 700px) {
  .platform-android .shell { grid-template-rows: 66px auto minmax(0, 1fr) auto; padding-inline: 7px; }
  .platform-android .topbar { min-height: 66px; grid-template-rows: 27px 34px; }
  .platform-android .brand > span { font-size: 21px; }
  .platform-android h1 { font-size: 18px; }
  .platform-android .view-switch button { min-width: 41px; height: 31px; padding-inline: 6px; }
  .platform-android .speed-gauge { min-height: 62px; }
  .platform-android .speed-gauge strong { font-size: 68px; }
  .platform-android .trip-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; row-gap: 6px; }
  .platform-android .trip-strip small { min-height: 11px; font-size: 8px; }
  .platform-android .trip-strip b { font-size: 17px; }
  .platform-android .sensor-strip { margin-top: 6px; }
  .platform-android .sensor-strip > div { min-height: 52px; }
  .platform-android .ride-info { margin-top: 2px; }
  .platform-android .weather-card { min-height: 61px; }
  .platform-android .weather-icon { font-size: 24px; }
  .platform-android .actions button { width: 46px !important; min-width: 46px; height: 46px; min-height: 46px !important; }
  .platform-android .disclaimer { display: none; }
  .platform-android .welcome-content > small { margin-top: 17px; }
  .platform-android .welcome-content h2 { font-size: 34px; }
  .platform-android .welcome-lead { font-size: 14px; }
}

/* Android grande y plegables en una sola columna estrecha. */
@media (orientation: portrait) and (pointer: coarse) and (min-width: 441px) and (max-width: 600px) {
  .platform-android .shell { width: min(520px, 100%); }
  .platform-android .page-view, .platform-android .groups-page { width: min(560px, 100%); }
  .platform-android .trip-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .platform-android .route-region-list { grid-template-columns: 1fr 1fr; }
}

/* Navegación móvil tipo app: acciones principales siempre accesibles abajo. */
@media (orientation: portrait), (max-width: 700px) {
  .shell {
    grid-template-rows: 44px auto minmax(0, 1fr) auto !important;
    padding-bottom: calc(68px + env(safe-area-inset-bottom)) !important;
  }
  .topbar, .library-topbar {
    min-height: 44px !important;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-rows: 44px !important;
  }
  .topbar .brand, .library-topbar .brand {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex !important;
    justify-self: center;
  }
  .topbar .settings-mark, .library-topbar .settings-mark {
    position: absolute;
    z-index: 2;
    top: 2px;
    right: 0;
  }
  .view-switch, .library-topbar .view-switch {
    position: fixed;
    z-index: 95;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: calc(62px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    justify-self: auto;
    padding: 4px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    border: 1px solid rgba(176, 211, 201, .22);
    border-radius: 22px 22px 0 0;
    background: rgba(5, 20, 18, .96);
    box-shadow: 0 -10px 34px rgba(0, 0, 0, .38), 0 1px 0 rgba(255,255,255,.05) inset;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .view-switch button, .library-topbar .view-switch button {
    min-width: 0;
    height: 53px;
    flex-direction: column;
    gap: 1px;
    padding: 3px 2px 2px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 800;
  }
  .view-switch button .material-symbols-rounded { font-size: 25px; }
  .view-switch button b { display: block; line-height: 1.05; }
  .view-switch button.active {
    background: linear-gradient(180deg, rgba(120,239,182,.2), rgba(120,239,182,.09));
    box-shadow: 0 0 0 1px rgba(120,239,182,.08) inset;
  }
  body.library-open .page-view:not([hidden]), .page-view, .groups-page {
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }
  .routes-heading, .groups-content { margin-top: 12px; }
  .map-selected .shell {
    grid-template-rows: 44px auto minmax(0, 1fr) auto !important;
    padding-bottom: calc(68px + env(safe-area-inset-bottom)) !important;
  }
  .map-selected .topbar { min-height: 44px !important; }
  .map-selected .topbar .brand { display: flex !important; }
  .map-selected .map-telemetry { bottom: 8px; }
  .map-selected .map-telemetry { right: 8px; left: 8px; width: auto; min-height: 96px; grid-template-columns: 1fr 1fr; }
  .map-selected .map-speed strong, .map-selected .map-distance strong { font-size: clamp(46px, 14vw, 62px); }
  body.group-mode.map-selected .shell { grid-template-rows: 0 auto minmax(0, 1fr) auto !important; padding-top: env(safe-area-inset-top) !important; gap: 2px; }
  body.group-mode.map-selected .topbar { min-height: 0 !important; height: 0; overflow: visible; }
  body.group-mode.map-selected .topbar .brand, body.group-mode.map-selected .settings-mark { display: none !important; }
  body.group-mode.map-selected .map-view { border-radius: 0; border-inline: 0; }
  body.group-mode.map-selected .map-telemetry { min-height: 72px; bottom: 4px; }
  body.group-mode.map-selected .map-speed strong, body.group-mode.map-selected .map-distance strong { font-size: clamp(38px, 12vw, 52px); }
  body.group-mode .group-hud { top: 6px; right: 6px; left: 6px; padding: 8px 9px; }
  body.group-mode .group-gap-alert { top: 75px; left: 7px; }
}

@page { size: A4; margin: 12mm; }
@media print {
  html, body { width: auto !important; height: auto !important; overflow: visible !important; background: white !important; }
  body > *:not(#pdf-report-screen) { display: none !important; }
  #pdf-report-screen { position: static !important; display: block !important; overflow: visible !important; padding: 0 !important; background: white !important; }
  .pdf-report-toolbar { display: none !important; }
  .pdf-report-content { width: 100% !important; min-height: 0 !important; padding: 0 !important; box-shadow: none !important; }
  .pdf-page-break { break-before: page; }
  .pdf-map { break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
