/* Layout: mapa a pantalla completa; indicación de giro arriba, panel deslizante abajo, botones a la derecha */
:root {
  --green-900: #163626;
  --green-800: #24543a;
  --green-600: #2f7a50;
  --senda: #e0301e;
  --pista: #9a6b3c;
  --asfalto: #8a8f96;
  --route: #1f6feb;
  --bg: #ffffff;
  --bg-2: #f1f4f1;
  --fg: #18241c;
  --muted: #5a675e;
  --line: #dfe5df;
  --danger: #c2321f;
  --shadow: 0 6px 24px rgba(16, 32, 22, .18);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18211b; --bg-2: #222d25; --fg: #e8eee9; --muted: #9eaca2; --line: #2f3c33;
    --shadow: 0 6px 24px rgba(0,0,0,.45); color-scheme: dark;
  }
}
/* Modo noche (ajustes): igual que el modo oscuro del sistema */
:root[data-theme="dark"] {
  --bg: #18211b; --bg-2: #222d25; --fg: #e8eee9; --muted: #9eaca2; --line: #2f3c33;
  --shadow: 0 6px 24px rgba(0,0,0,.45); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg-2); color: var(--fg); font: 15px/1.4 var(--font-body); overscroll-behavior: none; }
#map { position: fixed; inset: 0; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Desde dónde / a dónde vas ---------- */
.topbar {
  position: fixed; z-index: 20; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r));
  top: calc(12px + var(--safe-t)); max-width: 520px;
}
.planner {
  display: flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 16px;
  box-shadow: var(--shadow); padding: 4px 6px 4px 14px;
}
.plan-rows { flex: 1; min-width: 0; display: grid; position: relative; }
.plan-rows::before { /* línea que une los puntos */
  content: ""; position: absolute; left: 4px; top: 24px; bottom: 24px; border-left: 2px dotted var(--muted); opacity: .5;
}
.plan-row { display: flex; align-items: center; gap: 10px; min-height: 46px; position: relative; }
#viaRows .plan-row, .plan-row[data-field="dest"] { border-top: 1px solid var(--line); }
.plan-row input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font-size: 16px; outline: none; padding: 10px 0;
}
.plan-row input:focus-visible { outline: none; }
.plan-row input::placeholder { color: var(--muted); }
.plan-row input.is-me { color: var(--route); font-weight: 600; }
.plan-row input::-webkit-search-cancel-button { display: none; }
.via-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 10px 0; }
.clear {
  width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px;
}
.clear:hover { background: var(--bg-2); }
.plan-row .dot { z-index: 1; }
.dot.v {
  width: 16px; height: 16px; margin: 0 -2px; background: #f2b705; color: #3a2c00; border: 0; box-shadow: none;
  font: 700 10px/16px var(--font-body); text-align: center;
}
.swap {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.swap:hover { background: var(--bg-2); }
.swap svg { width: 22px; height: 22px; fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.results {
  list-style: none; margin: 6px 0 0; padding: 6px; background: var(--bg); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 55vh; overflow: auto;
}
.results li button {
  width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  display: flex; gap: 12px; align-items: center;
}
.results li button > span:last-child { display: grid; gap: 1px; min-width: 0; }
.results li button:hover, .results li button:focus-visible { background: var(--bg-2); }
.results b { font-weight: 600; }
.results small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-ico { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; }
.r-ico svg { width: 18px; height: 18px; fill: none; stroke: var(--green-600); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.r-msg { padding: 10px; color: var(--muted); font-size: 14px; }

/* ---------- Indicación de giro ---------- */
.instruction {
  position: fixed; z-index: 20; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); top: calc(10px + var(--safe-t));
  max-width: 520px; display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--green-800); color: #fff; border-radius: 18px; box-shadow: var(--shadow);
}
.turn-ico { width: 58px; height: 58px; flex: none; }
.turn-ico svg { width: 100%; height: 100%; }
.turn-dist { font: 700 34px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.turn-label { font-size: 16px; opacity: .92; margin-top: 4px; }
.banner {
  position: fixed; z-index: 21; left: 50%; transform: translateX(-50%); top: calc(110px + var(--safe-t));
  background: #2b2b2b; color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
}
.banner.warn { background: var(--danger); }

/* ---------- Botones flotantes ---------- */
.fabs {
  position: fixed; z-index: 15; right: calc(12px + var(--safe-r)); top: calc(var(--top-h, 100px) + 24px + var(--safe-t));
  display: flex; flex-direction: column; gap: 10px;
}
body.navigating .fabs { top: calc(118px + var(--safe-t)); }
.fab {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--bg); box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer;
}
.fab svg { width: 22px; height: 22px; fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fab .n { fill: var(--senda); stroke: none; }
.fab .s { fill: var(--muted); stroke: none; }
#btnCompass svg { transition: transform .2s; }
.fab.active { background: var(--route); }
.fab.active svg { stroke: #fff; }

.layers {
  position: fixed; z-index: 16; right: calc(68px + var(--safe-r)); top: calc(var(--top-h, 100px) + 24px + var(--safe-t));
  background: var(--bg); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 10px;
  min-width: 0; max-width: calc(100vw - 90px);
}
.layers h3 { margin: 0; font: 600 13px var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.layers label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.sw { width: 26px; height: 0; flex: none; border-top: 4px solid var(--senda); }
.sw.pista { border-top: 3px dashed var(--pista); }
.sw.ruta { border-top: 8px solid rgba(160, 60, 220, .5); }

.recenter {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b));
  background: var(--route); color: #fff; border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600;
  box-shadow: var(--shadow); cursor: pointer;
}

/* ---------- Panel inferior ---------- */
.sheet {
  position: fixed; z-index: 18; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding: 16px max(16px, var(--safe-r)) calc(14px + var(--safe-b)) max(16px, var(--safe-l));
  display: grid; gap: 10px; max-height: 62vh; overflow-y: auto; overscroll-behavior: contain;
}
.pane { display: grid; gap: 12px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.c-senda { color: var(--senda); }
.c-pista { color: var(--pista); }
.status { font-size: 13px; color: var(--muted); min-height: 0; }
.status:empty { display: none; }
.status.error { color: var(--danger); }

.point-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.eyebrow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.point-head h2 { margin: 2px 0 0; font: 700 19px/1.2 var(--font-display); text-wrap: balance; }
.meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.meta .tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg-2); margin: 3px 4px 0 0; }

.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 12px;
  padding: 12px 14px; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--green-800); border-color: var(--green-800); color: #fff; flex: 2; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: wait; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  cursor: pointer; font-size: 16px; display: grid; place-items: center;
}

.route-ends { display: grid; gap: 4px; font-size: 14px; }
.route-ends > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.route-ends span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.dot.a { background: var(--green-600); }
.dot.b { background: var(--senda); }

.profiles { display: flex; gap: 6px; overflow-x: auto; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 7px 13px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--green-800); border-color: var(--green-800); color: #fff; }

.route-stats, .nav-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.route-stats { grid-template-columns: repeat(4, 1fr); }
#paneRoute.loading .route-stats, #paneRoute.loading .mix, #paneRoute.loading .elev { opacity: .4; transition: opacity .2s; }
.route-stats div, .nav-stats div { display: grid; }
.route-stats b, .nav-stats b { font: 700 21px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.nav-stats b { font-size: 26px; }
.route-stats span, .nav-stats span { font-size: 12px; color: var(--muted); }

.mix-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.mix-bar i { display: block; height: 100%; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; background: var(--c); }

/* Marcadores */
.me {
  width: 22px; height: 22px; border-radius: 50%; background: var(--route); border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(31, 111, 235, .22), 0 2px 6px rgba(0,0,0,.3);
}
.me.nav {
  width: 40px; height: 40px; border: 0; background: none; box-shadow: none;
}
.me.nav svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin.a { background: var(--green-600); }
.pin.b { background: var(--senda); }
.pin.tmp { background: #555; }

/* Atribución de mapas siempre visible, justo encima del panel inferior */
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: var(--sheet-h, 0px); }
.maplibregl-ctrl-attrib { font-size: 11px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Chip de ajustes */
.chip.tune { display: inline-flex; align-items: center; gap: 6px; }
.chip.tune svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.warn-note { font-size: 13px; color: var(--danger); background: rgba(194, 50, 31, .1); padding: 8px 10px; border-radius: 10px; }

/* Perfil de altura */
.elev { margin: 0; display: grid; gap: 4px; color: var(--muted); }
.elev svg { width: 100%; height: 70px; display: block; touch-action: none; cursor: crosshair; border-bottom: 1px solid var(--line); }
.elev figcaption { font-size: 12.5px; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.elev-dot { width: 14px; height: 14px; border-radius: 50%; background: #2f7a50; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.via {
  width: 22px; height: 22px; border-radius: 50%; background: #f2b705; color: #3a2c00; border: 2px solid #fff;
  font: 700 12px/18px var(--font-body); text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* Diálogo de tipos de camino */
.dialog-back { position: fixed; inset: 0; z-index: 40; background: rgba(10, 20, 14, .45); display: grid; align-items: end; justify-items: center; }
.dialog {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 16px max(16px, var(--safe-r)) calc(16px + var(--safe-b)) max(16px, var(--safe-l)); display: grid; gap: 14px;
  box-shadow: var(--shadow);
}
@media (min-width: 700px) { .dialog-back { align-items: center; } .dialog { border-radius: 20px; } }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font: 700 20px var(--font-display); }
.dialog .hint { margin-top: -6px; }
.tune-kinds { display: grid; gap: 14px; }
.tune-row { display: grid; gap: 7px; }
.tune-row b { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.tune-row small, .switch-row small { display: block; color: var(--muted); font-size: 12.5px; }
.kdot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-2); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 9px 4px; font-size: 13.5px; font-weight: 500; cursor: pointer; min-width: 0; }
.seg button[aria-pressed="true"] { background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.18); font-weight: 700; color: var(--green-800); }
.seg[data-kind] button[data-v="nunca"][aria-pressed="true"] { color: var(--danger); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { color: #8fd3a8; } }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { color: #8fd3a8; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--green-800); flex: none; }
.hint.small { font-size: 12.5px; }

/* ================= Mejoras ================= */

/* Mapa de noche: se invierte y se gira el color para que siga pareciendo un mapa, pero oscuro */
body.night #map .maplibregl-canvas { filter: invert(.9) hue-rotate(180deg) brightness(.95) contrast(.92); }

.sw.relieve { border-top: 8px solid rgba(60, 60, 60, .35); }
.sw.parque { border-top: 3px dashed #2b8a3e; }

.dialog-head { gap: 8px; }
.dialog-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.back { font-size: 26px; line-height: 1; }
.icon-btn.txt { width: auto; padding: 0 10px; font-weight: 700; font-size: 13px; }
.dlg-body { display: grid; gap: 14px; }
#btnSaveRoute svg { width: 20px; height: 20px; fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; }
#btnSaveRoute.on svg { fill: #f2b705; stroke: #b88a00; }

/* Menú */
.menu-list, .item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu-list button {
  width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; background: none; border: 0;
  padding: 10px 8px; border-radius: 12px; cursor: pointer;
}
.menu-list button:hover, .menu-list button:focus-visible { background: var(--bg-2); }
.menu-list b { display: block; font-weight: 600; }
.menu-list small { display: block; color: var(--muted); font-size: 12.5px; }
.m-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--bg-2); display: grid; place-items: center; color: var(--green-600); }
.m-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-list .is-rec .m-ico { background: #fde2e1; color: var(--danger); }

/* Listas de rutas, recorridos y zonas */
.item-list li { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item-list li:last-child { border-bottom: 0; }
.it-main b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.it-main small { color: var(--muted); font-size: 12.5px; }
.it-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.small { flex: 0 0 auto; padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.danger-ghost { color: var(--danger); }
.btn.danger-ghost.armed { background: var(--danger); color: #fff; border-color: var(--danger); }

.field { display: grid; gap: 6px; }
.field span { font-weight: 600; }
.field input, .field-row input {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 10px; padding: 10px 12px; font-size: 16px;
}
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.field-row small { display: block; color: var(--muted); font-size: 12.5px; }
.field-row .num { display: flex; align-items: center; gap: 6px; flex: none; }
.field-row .num input { width: 84px; text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--green-800); }

.progress { height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--green-600); transition: width .2s; }

/* Panel de ruta: alternativas, vuelta, avisos */
#paneRoute.is-gpx .profiles { display: none; }
.alts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.alts button {
  border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 7px 8px; text-align: left; cursor: pointer;
  display: grid; gap: 1px; min-width: 0;
}
.alts button b { font-size: 13px; }
.alts button span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.alts button[aria-pressed="true"] { border-color: var(--route); box-shadow: inset 0 0 0 1px var(--route); }
.loop-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); }
.info-note { font-size: 13px; color: var(--fg); background: var(--bg-2); padding: 8px 10px; border-radius: 10px; }
.warn-note b { font-weight: 700; }

.fuel {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid #fff; background: #2b6cb0; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer; padding: 0;
}
.fuel svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Navegación: velocímetro, gasolinera siguiente, grabación */
.speedo {
  position: fixed; z-index: 16; left: calc(12px + var(--safe-l)); bottom: calc(var(--sheet-h, 0px) + 56px);
  width: 78px; height: 78px; border-radius: 50%; background: var(--bg); box-shadow: var(--shadow);
  display: grid; place-content: center; text-align: center; line-height: 1;
}
.speedo b { font: 700 30px var(--font-display); font-variant-numeric: tabular-nums; }
.speedo span { font-size: 11px; color: var(--muted); }
.nav-extra { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); min-height: 32px; }
.rec-toggle, .rec-chip {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.rec-toggle i, .rec-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.rec-toggle.on i, .rec-chip i { background: var(--danger); animation: recblink 1.4s infinite; }
.rec-toggle.on { color: var(--danger); border-color: rgba(194, 50, 31, .4); }
.rec-chip { position: fixed; z-index: 19; left: calc(12px + var(--safe-l)); top: calc(var(--top-h, 100px) + 22px + var(--safe-t)); box-shadow: var(--shadow); }
@keyframes recblink { 50% { opacity: .35; } }

/* Botones grandes (con guantes) */
body.big .fab { width: 58px; height: 58px; }
body.big .fab svg { width: 28px; height: 28px; }
body.big .btn { padding: 16px 16px; font-size: 17px; }
body.big .icon-btn { width: 54px; height: 54px; font-size: 19px; }
body.big .chip { padding: 10px 16px; font-size: 15px; }
body.big .turn-ico { width: 72px; height: 72px; }
body.big .turn-dist { font-size: 44px; }
body.big .turn-label { font-size: 19px; }
body.big .nav-stats b { font-size: 32px; }
body.big .rec-toggle { padding: 10px 16px; font-size: 15px; }
body.big .speedo { width: 96px; height: 96px; }
body.big .speedo b { font-size: 38px; }
body.big.navigating .fabs { top: calc(140px + var(--safe-t)); }

/* Ayuda de ubicación */
.steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.45; }
.steps li::marker { font-weight: 700; color: var(--green-600); }
.hint.error { color: var(--danger); }
.link-btn { border: 0; background: none; padding: 0; color: var(--route); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: inherit; }

/* Ventana para pedir la ubicación */
.ask-loc { display: grid; justify-items: center; text-align: center; gap: 8px; }
.ask-loc svg { width: 72px; height: 72px; }
.ask-loc p { margin: 0; }
.ask-loc p b { font: 700 18px/1.3 var(--font-display); }

/* Panel de ruta plegable: plegado solo enseña lo justo para ver el mapa */
.grabber {
  display: grid; place-items: center; width: 100%; height: 22px; margin: -10px 0 -4px; padding: 0;
  border: 0; background: none; cursor: grab; touch-action: none;
}
.grabber i { width: 44px; height: 5px; border-radius: 999px; background: var(--line); }
.grabber:hover i { background: var(--muted); }
.details-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  border: 0; background: var(--bg-2); border-radius: 10px; padding: 8px 12px; cursor: pointer; text-align: left;
  font-size: 13px; color: var(--muted);
}
.details-toggle span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.details-toggle b { flex: none; color: var(--fg); font-weight: 600; }
.details-toggle b::after { content: " ▴"; }
.sheet:not(.collapsed) .details-toggle { display: none; }
.sheet.collapsed #paneRoute .profiles,
.sheet.collapsed #paneRoute .mix-legend,
.sheet.collapsed #altList,
.sheet.collapsed #loopBar,
.sheet.collapsed #routeWarn,
.sheet.collapsed #routeParks,
.sheet.collapsed #routeFuel,
.sheet.collapsed #elev { display: none !important; }
.sheet.collapsed #paneRoute { gap: 10px; }
.sheet.collapsed .route-stats b { font-size: 18px; }
.sheet.collapsed .route-stats span { font-size: 11.5px; }
.sheet.collapsed .mix-bar { height: 7px; }
.details-toggle .warn-dot { color: var(--danger); font-weight: 700; }
/* Que ningún elemento del panel lo ensanche más que la pantalla */
.sheet > *, .pane > *, .dlg-body > * { min-width: 0; }
.alts button span { overflow: hidden; text-overflow: ellipsis; }
