/* =====================================================================
   Gato · sistema visual
   ===================================================================== */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Dirección Nocturno (marca Gato) */
  --bg: #070B14;
  --bg-2: #0B1120;
  --panel: rgba(14, 21, 36, 0.86);
  --panel-solid: #0E1524;
  --card: rgba(21, 32, 54, 0.55);
  --card-hi: rgba(30, 43, 71, 0.75);
  --line: rgba(120, 150, 200, 0.14);
  --line-hi: rgba(140, 170, 220, 0.24);
  --text: #EAF0FA;
  --muted: #A3B1C8;
  --dim: #6B7A93;
  --good: #34D399;
  --warn: #FBBF24;
  --bad: #F43F5E;
  --info: #7AA2FF;
  --acc: #4DF0E0;
  --acc-2: #7AA2FF;
  --acc-rgb: 77, 240, 224;
  --acc-ink: #04211E;
  --route-alt: #5B6B88;
  --radar: #FF5A5F;
  --zbe: #B794F6;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.65), 0 2px 0 rgba(255, 255, 255, 0.03) inset;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-d: "Space Grotesk", "Inter", system-ui, sans-serif;
  --panel-w: 408px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
body.veh-moto {
  --acc: #FFB547;
  --acc-2: #FF8A3D;
  --acc-rgb: 255, 181, 71;
  --acc-ink: #241400;
}
/* Dirección alternativa "Asfalto y señal" */
html[data-direction=asfalto] body {
  --bg: #141517; --bg-2: #1C1D20; --panel: #1C1D20; --panel-solid: #1C1D20;
  --card: #26282C; --card-hi: #313338; --line: #3A3D42; --line-hi: #4a4d53;
  --text: #F4F4F2; --muted: #B5B7BA; --dim: #7E8186; --route-alt: #6B6E74;
  --acc: #F4F4F2; --acc-2: #d9d9d4; --acc-rgb: 244, 244, 242; --acc-ink: #141517;
  --r-lg: 12px; --r-md: 8px; --r-sm: 6px;
  --font: "Barlow", "Inter", system-ui, sans-serif; --font-d: "Barlow Condensed", "Space Grotesk", system-ui, sans-serif;
}
html[data-direction=asfalto] body.veh-moto { --acc: #FFC72C; --acc-2: #FFB000; --acc-rgb: 255, 199, 44; --acc-ink: #141517; }
html[data-direction=asfalto] .panel, html[data-direction=asfalto] .mc, html[data-direction=asfalto] .zones, html[data-direction=asfalto] .weather-chip { backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-direction=asfalto] .panel::before, html[data-direction=asfalto] .hero::after, html[data-direction=asfalto] .cta-shine { display: none; }
html[data-direction=asfalto] .cta, html[data-direction=asfalto] .vs-thumb { background: var(--acc); box-shadow: none; }
html[data-direction=asfalto] .hero { background: var(--card); border-color: var(--line); border-left: 4px solid var(--acc); }
html[data-direction=asfalto] .sec-title, html[data-direction=asfalto] .set-group-title { color: var(--acc); }
html[data-direction=asfalto] .brand h1, html[data-direction=asfalto] .hero-eta { letter-spacing: 0; text-transform: uppercase; }
/* Dirección alternativa "Cristal" */
html[data-direction=cristal] body {
  --bg: #0B0D12; --panel: rgba(18, 21, 28, 0.55); --panel-solid: #12151c;
  --card: rgba(255,255,255,.06); --card-hi: rgba(255,255,255,.1); --line: rgba(255,255,255,.12); --line-hi: rgba(255,255,255,.2);
  --text: #F2F4F8; --muted: #A9B0BD; --dim: #737B8A; --route-alt: #5E6675;
  --acc: #8CF5D2; --acc-2: #9DB4FF; --acc-rgb: 140, 245, 210; --acc-ink: #06231A;
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px;
  --font: "Manrope", "Inter", system-ui, sans-serif; --font-d: "Manrope", "Inter", system-ui, sans-serif;
}
html[data-direction=cristal] body.veh-moto { --acc: #FFC48A; --acc-2: #FF9DB0; --acc-rgb: 255, 196, 138; --acc-ink: #2a1300; }
html[data-direction=cristal] .panel { backdrop-filter: blur(26px) saturate(1.6); -webkit-backdrop-filter: blur(26px) saturate(1.6); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; overflow: clip; min-width: 0; }
body { font-size: 14px; line-height: 1.45; letter-spacing: -0.005em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
b { font-weight: 600; }
::selection { background: rgba(var(--acc-rgb), .35); }

/* ---------- Mapa ---------- */
.map { position: fixed; inset: 0; background: radial-gradient(1200px 700px at 60% 40%, #10141c, var(--bg)); }
.map-vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(130% 90% at 65% 45%, transparent 55%, rgba(0,0,0,.55)); z-index: 1; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-logo { display: none !important; }
.map-attrib { position: fixed; right: 12px; bottom: 8px; z-index: 3; font-size: 10.5px; color: var(--dim); pointer-events: auto; }
.map-attrib a { color: var(--muted); text-decoration: none; }

/* ---------- Panel ---------- */
.panel {
  position: fixed; z-index: 10; top: 16px; left: 16px; bottom: 16px; width: var(--panel-w);
  display: flex; flex-direction: column;
  background: var(--panel); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  overflow: hidden; overflow: clip; min-width: 0;
}
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 160px; pointer-events: none; background: radial-gradient(400px 160px at 20% -40px, rgba(var(--acc-rgb), .16), transparent 70%); transition: background .5s var(--ease); }
.sheet-handle { display: none; }
.panel-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 18px 22px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; position: relative; }
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 6px; }

.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; position: relative; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); border: 1px solid var(--line-hi); }
.brand-mark img { width: 30px; height: 30px; display: block; }
.brand-text { flex: 1; min-width: 0; }
.brand h1 { margin: 0; font-family: var(--font-d); font-size: 23px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.chip-status { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.chip-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(52,211,153,.18); }
.chip-status.offline .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(251,191,36,.18); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--muted); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--card-hi); color: var(--text); }

/* Vehículo */
.vehicle-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: rgba(0,0,0,.35); border: 1px solid var(--line); margin-bottom: 14px; }
.vs-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: linear-gradient(135deg, var(--acc), var(--acc-2)); box-shadow: 0 8px 24px -6px rgba(var(--acc-rgb), .6), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .45s var(--ease), background .45s; }
body.veh-moto .vs-thumb { transform: translateX(100%); }
.vs-opt { position: relative; z-index: 1; height: 44px; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .3s; border-radius: 12px; }
.vs-opt svg { width: 20px; height: 20px; }
.vs-opt.active { color: var(--acc-ink); }

/* Origen / destino */
.od-card { position: relative; display: flex; align-items: stretch; gap: 10px; padding: 6px 6px 6px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); transition: border-color .2s; }
.od-card:focus-within { border-color: rgba(var(--acc-rgb), .45); box-shadow: 0 0 0 4px rgba(var(--acc-rgb), .08); }
.od-rail { display: flex; flex-direction: column; align-items: center; padding: 17px 0; }
.od-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.od-dot.o { background: var(--acc); box-shadow: 0 0 0 4px rgba(var(--acc-rgb), .18); }
.od-dot.d { border: 2.5px solid var(--acc-2); }
.od-line { flex: 1; width: 2px; margin: 5px 0; background: repeating-linear-gradient(to bottom, var(--dim) 0 3px, transparent 3px 7px); }
.od-fields { flex: 1; min-width: 0; }
.od-sep { height: 1px; background: var(--line); margin-right: 4px; }
.field { display: flex; align-items: center; }
.field input { flex: 1; min-width: 0; height: 44px; background: transparent; border: 0; outline: 0; font-size: 14.5px; font-weight: 500; text-overflow: ellipsis; }
.field input::placeholder { color: var(--dim); font-weight: 400; }
.field-act { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--dim); transition: color .2s, background .2s; }
.field-act:hover { color: var(--text); background: var(--card-hi); }
.field-act svg { width: 16px; height: 16px; }
.swap-btn { align-self: center; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); color: var(--muted); background: rgba(0,0,0,.25); transition: transform .35s var(--ease), color .2s; }
.swap-btn:hover { color: var(--text); transform: rotate(180deg); }
.swap-btn svg { width: 16px; height: 16px; }

.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; padding: 6px; border-radius: var(--r-md); background: var(--panel-solid); border: 1px solid var(--line-hi); box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.sg-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 11px; text-align: left; }
.sg-item:hover, .sg-item.hl { background: var(--card-hi); }
.sg-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--card); color: var(--muted); flex: none; }
.sg-ico svg { width: 16px; height: 16px; }
.sg-item.fav .sg-ico { color: var(--acc); background: rgba(var(--acc-rgb), .1); }
.sg-txt { min-width: 0; flex: 1; }
.sg-main { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-empty { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }
.sg-label { padding: 8px 10px 4px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 600; }

/* Favoritos */
.favs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.favs::-webkit-scrollbar { display: none; }
.fav { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px 0 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text); transition: background .2s, border-color .2s; }
.fav:hover { background: var(--card-hi); border-color: var(--line-hi); }
.fav svg { width: 15px; height: 15px; color: var(--acc); }
.fav.add { color: var(--muted); background: transparent; border-color: var(--line-hi); }
.fav.add svg { color: var(--dim); }
.fav.route { background: rgba(var(--acc-rgb), .1); border-color: rgba(var(--acc-rgb), .3); }

/* Opciones */
.row-opts { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 14px; }
.depart { position: relative; display: flex; gap: 8px; align-items: center; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--text); }
.pill-btn svg { width: 15px; height: 15px; color: var(--muted); }
.pill-btn.set { border-color: rgba(var(--acc-rgb), .4); color: var(--acc); }
.depart-input { position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.depart-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 25; width: 270px; padding: 12px; border-radius: var(--r-md); background: var(--panel-solid); border: 1px solid var(--line-hi); box-shadow: var(--shadow); }
.dm-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,.35); margin-bottom: 10px; }
.dm-seg button { height: 30px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.dm-seg button.on { background: var(--card-hi); color: var(--text); }
.dm-row { display: flex; gap: 8px; }
.dm-row input { flex: 1; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color-scheme: dark; min-width: 0; }
.dm-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dm-quick button { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.dm-quick button:hover { color: var(--text); }
.dm-ok { margin-top: 10px; width: 100%; height: 36px; border-radius: 10px; background: var(--acc); color: var(--acc-ink); font-weight: 600; }

.factors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.factor { display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--dim); font-size: 12.5px; font-weight: 500; transition: all .25s var(--ease); }
.factor svg { width: 15px; height: 15px; }
.factor.on { color: var(--text); background: rgba(var(--acc-rgb), .09); border-color: rgba(var(--acc-rgb), .32); }
.factor.on svg { color: var(--acc); }

/* CTA */
.cta { position: relative; overflow: hidden; width: 100%; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; color: var(--acc-ink); background: linear-gradient(135deg, var(--acc), var(--acc-2)); box-shadow: 0 14px 34px -10px rgba(var(--acc-rgb), .65), inset 0 1px 0 rgba(255,255,255,.4); transition: transform .2s var(--ease), box-shadow .3s, opacity .3s, filter .3s; }
.cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 40px -10px rgba(var(--acc-rgb), .8), inset 0 1px 0 rgba(255,255,255,.4); }
.cta:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.cta:disabled { filter: grayscale(.7) brightness(.55); cursor: default; box-shadow: none; }
.cta-arrow { width: 18px; height: 18px; stroke-width: 2.2; transition: transform .3s var(--ease); }
.cta:hover:not(:disabled) .cta-arrow { transform: translateX(3px); }
.cta-shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-100%); }
.cta.loading .cta-shine { animation: shine 1.1s infinite; }
.cta.loading .cta-arrow { display: none; }
@keyframes shine { to { transform: translateX(100%); } }

/* Vacío */
.hist-pane-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.hist-pane-stats > div { padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.hist-pane-stats b { display: block; font-size: 22px; font-family: var(--font-d); }
.hist-pane-stats span { font-size: 12px; color: var(--muted); }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; margin: 4px 0 10px; }
.howto { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--text); font-weight: 600; padding: 6px 0; }
.howto p { margin: 6px 0; }
.ghost-btn.danger { color: #FF8A9E; border-color: rgba(255, 92, 122, .4); }
.link-btn { color: var(--acc); font: inherit; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.route-error { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 6px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255, 92, 122, .35); background: rgba(255, 92, 122, .08); color: var(--text); }
.route-error > svg { flex: none; width: 20px; height: 20px; color: #FF5C7A; margin-top: 2px; }
.route-error b { font-size: 14px; }
.route-error p { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.empty { text-align: center; padding: 26px 10px 6px; color: var(--muted); }
.empty-art img { width: 108px; height: 135px; display: block; margin: 0 auto; filter: drop-shadow(0 12px 30px rgba(var(--acc-rgb), .12)); animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-5px); } }
@keyframes dash { to { stroke-dashoffset: -400; } }
.empty h2 { margin: 10px 0 6px; color: var(--text); font-family: var(--font-d); font-weight: 600; font-size: 19px; letter-spacing: -.02em; }
.empty p { margin: 0 auto; max-width: 300px; font-size: 13px; }

/* ---------- Resultados ---------- */
.results { margin-top: 18px; animation: rise .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero { position: relative; padding: 18px; border-radius: var(--r-md); background: linear-gradient(160deg, rgba(var(--acc-rgb), .14), rgba(255,255,255,.02) 55%); border: 1px solid rgba(var(--acc-rgb), .22); overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(rgba(var(--acc-rgb), .22), transparent 70%); pointer-events: none; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hero-top > div { min-width: 0; }
.hero-eta { font-family: var(--font-d); font-size: 46px; font-weight: 700; letter-spacing: -.04em; line-height: .95; }
.hero-eta small { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: -.01em; }
.hero-meta { white-space: nowrap; margin-top: 8px; color: var(--muted); font-size: 13px; display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.hero-meta b { color: var(--text); font-weight: 600; }
.hero-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(var(--acc-rgb), .16); color: var(--acc); white-space: nowrap; flex: none; max-width: 100%; }
.hero-badge svg { width: 13px; height: 13px; }
.compare-line { margin-top: 16px; }
.cl-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.cl-labels b { color: var(--text); }
.cl-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.06); gap: 2px; }
.cl-bar span { height: 100%; transition: width .7s var(--ease); }
.cl-bar .b-base { background: linear-gradient(90deg, var(--acc), var(--acc-2)); border-radius: 99px 0 0 99px; }
.cl-bar .b-traffic { background: var(--warn); }
.cl-bar .b-weather { background: var(--info); }
.cl-bar .b-incidents { background: var(--bad); }
.cl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cl-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.cl-legend b { color: var(--text); font-weight: 600; }
.est-note { margin-top: 10px; font-size: 11px; color: var(--dim); display: flex; gap: 6px; align-items: center; }
.est-note svg { width: 13px; height: 13px; }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.alert { display: flex; gap: 11px; padding: 11px 12px; border-radius: 13px; font-size: 12.5px; background: var(--card); border: 1px solid var(--line); }
.alert .a-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert .a-ico svg { width: 16px; height: 16px; }
.alert b { display: block; font-size: 13px; margin-bottom: 1px; }
.alert span { color: var(--muted); }
.alert.warn .a-ico { background: rgba(251,191,36,.12); color: var(--warn); }
.alert.bad .a-ico { background: rgba(251,113,133,.12); color: var(--bad); }
.alert.info .a-ico { background: rgba(96,165,250,.12); color: var(--info); }
.alert.good .a-ico { background: rgba(52,211,153,.12); color: var(--good); }
.alerts-more { align-self: flex-start; font-size: 12px; color: var(--muted); padding: 2px 4px; }
.alerts-more:hover { color: var(--text); }

.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
.sec-title button { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.sec-title button:hover { color: var(--text); }

.routes { display: flex; flex-direction: column; gap: 8px; }
.rcard { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; width: 100%; padding: 13px 14px 13px 16px; border-radius: 14px; text-align: left; background: var(--card); border: 1px solid var(--line); transition: border-color .2s, background .2s; overflow: hidden; }
.rcard::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--dim); transition: background .2s; }
.rcard:hover { background: var(--card-hi); }
.rcard.sel { border-color: rgba(var(--acc-rgb), .4); background: rgba(var(--acc-rgb), .06); }
.rcard.sel::before { background: linear-gradient(var(--acc), var(--acc-2)); }
.rc-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-sub { grid-column: 1; font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rc-time { grid-row: 1 / span 2; grid-column: 2; text-align: right; align-self: center; }
.rc-time b { display: block; font-family: var(--font-d); font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.rc-time small { font-size: 11.5px; color: var(--muted); }
.rc-time .delta { color: var(--warn); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 600; background: rgba(255,255,255,.06); color: var(--muted); }
.tag.acc { background: rgba(var(--acc-rgb), .14); color: var(--acc); }
.tag.good { background: rgba(52,211,153,.12); color: var(--good); }
.tag.warn { background: rgba(251,191,36,.12); color: var(--warn); }

/* Tarjetas de extras */
.xcard { margin-top: 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.xcard > summary { list-style: none; display: flex; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer; user-select: none; }
.xcard > summary::-webkit-details-marker { display: none; }
.xcard > summary .x-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(var(--acc-rgb), .1); color: var(--acc); flex: none; }
.xcard > summary .x-ico svg { width: 16px; height: 16px; }
.x-head { flex: 1; min-width: 0; }
.x-head b { display: block; font-size: 13px; }
.x-head span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-chev { color: var(--dim); transition: transform .3s var(--ease); }
.xcard[open] .x-chev { transform: rotate(180deg); }
.x-body { padding: 2px 14px 14px; }

/* Gráfica mejor hora */
.bh-chart { position: relative; height: 128px; display: flex; align-items: flex-end; gap: 3px; padding-top: 22px; }
.bh-bar { position: relative; flex: 1; border-radius: 4px 4px 2px 2px; background: rgba(255,255,255,.09); min-height: 6px; transition: height .6s var(--ease), background .2s; cursor: pointer; }
.bh-bar:hover { background: rgba(255,255,255,.2); }
.bh-bar.now { background: rgba(var(--acc-rgb), .4); }
.bh-bar.best { background: linear-gradient(var(--good), rgba(52,211,153,.5)); }
.bh-bar .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--good); white-space: nowrap; }
.bh-axis { display: flex; gap: 3px; margin-top: 6px; font-size: 10px; color: var(--dim); }
.bh-axis span { flex: 1; text-align: center; }
.bh-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.bh-hint b { color: var(--good); }
.bh-hover { position: absolute; top: 0; left: 0; font-size: 11.5px; color: var(--text); }

/* Comparativa */
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-col { padding: 12px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.cmp-col.win { border-color: rgba(52,211,153,.35); }
.cmp-col h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cmp-col h4 svg { width: 16px; height: 16px; }
.cmp-col .big { font-family: var(--font-d); font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.cmp-col dl { margin: 8px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; font-size: 12px; }
.cmp-col dt { color: var(--muted); }
.cmp-col dd { margin: 0; text-align: right; font-weight: 500; }
.cmp-foot { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* Listas (gasolineras, parking, indicaciones, historial) */
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 11px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.05); color: var(--muted); }
.li-ico svg { width: 15px; height: 15px; }
.li-txt { flex: 1; min-width: 0; }
.li-txt b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-txt span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-end { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.li-end b { display: block; font-family: var(--font-d); color: var(--text); font-size: 15px; }
.li.click { cursor: pointer; border-radius: 10px; }
.li.click:hover { background: var(--card-hi); }
.li .price-best { color: var(--good); }
.step-dist { font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.muted { color: var(--muted); }
.fine { font-size: 11.5px; color: var(--dim); margin: 10px 0 0; }
.fine code { color: var(--muted); }
.loading-row { display: flex; align-items: center; gap: 10px; padding: 12px 2px; color: var(--muted); font-size: 12.5px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.12); border-top-color: var(--acc); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.actions-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px 6px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); font-weight: 500; transition: background .2s, color .2s; }
.act svg { width: 18px; height: 18px; color: var(--text); }
.act:hover { background: var(--card-hi); color: var(--text); }
.act.primary { background: rgba(var(--acc-rgb), .12); border-color: rgba(var(--acc-rgb), .3); color: var(--acc); }
.act.primary svg { color: var(--acc); }

/* Historial */
.hist-chart { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin: 6px 0 10px; }
.hist-chart span { flex: 1; border-radius: 3px; background: rgba(var(--acc-rgb), .45); min-height: 4px; }
.hist-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.hist-stats div { padding: 9px; border-radius: 10px; background: rgba(0,0,0,.25); text-align: center; }
.hist-stats b { display: block; font-family: var(--font-d); font-size: 18px; }
.hist-stats span { font-size: 11px; color: var(--muted); }

/* Viaje en curso */
.trip-live { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.3); }
.trip-live .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.trip-live div { flex: 1; font-size: 12.5px; color: var(--muted); }
.trip-live b { color: var(--text); display: block; font-size: 13px; }
.trip-live button { height: 32px; padding: 0 12px; border-radius: 9px; background: var(--good); color: #02140c; font-weight: 600; font-size: 12.5px; }
.trip-live button.x { background: transparent; color: var(--muted); padding: 0 6px; }

/* ---------- Barra superior / controles ---------- */
.topbar { position: fixed; z-index: 5; top: 16px; left: calc(var(--panel-w) + 32px); right: 72px; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.weather-chip { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 10px; border-radius: 14px; background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; animation: rise .5s var(--ease); }
.weather-chip .w-ico { font-size: 22px; line-height: 1; }
.weather-chip b { font-family: var(--font-d); font-size: 17px; font-weight: 600; }
.weather-chip span { color: var(--muted); }
.weather-chip .w-div { width: 1px; height: 20px; background: var(--line-hi); }
.zones { display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: var(--shadow); margin-left: auto; }
.zones button { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; font-weight: 500; color: var(--muted); transition: all .2s; white-space: nowrap; }
.zones button:hover { color: var(--text); }
.zones button.active { background: var(--card-hi); color: var(--text); }

.map-ctrls { position: fixed; z-index: 5; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 6px; }
.mc { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--muted); transition: color .2s, background .2s; }
.mc:hover, .mc.on { color: var(--text); background: var(--panel-solid); }
.mc.on { color: var(--acc); }
.mc-gap { height: 6px; }
.layers-pop { position: absolute; right: calc(100% + 10px); top: 100px; width: 268px; max-height: min(78vh, 620px); overflow-y: auto; padding: 6px; border-radius: var(--r-md); background: var(--panel-solid); border: 1px solid var(--line-hi); box-shadow: var(--shadow); animation: rise .25s var(--ease); }
.lp-title { padding: 8px 10px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.lp-bases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 2px 6px 8px; }
.lp-base { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); padding: 0; }
.lp-base.on { color: var(--text); font-weight: 600; }
.lp-thumb { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line-hi); background-size: cover; }
.lp-base.on .lp-thumb { border-color: var(--acc); }
.lp-base:focus-visible .lp-thumb { outline: 2px solid var(--acc); outline-offset: 2px; }
.th-noche { background: linear-gradient(135deg, transparent 46%, #2b3550 47% 53%, transparent 54%), linear-gradient(35deg, transparent 60%, #1f2840 61% 64%, transparent 65%), radial-gradient(circle at 70% 30%, #4DF0E0 0 2px, transparent 3px), #0b1020; }
.th-dia { background: linear-gradient(135deg, transparent 46%, #ffffff 47% 53%, transparent 54%), linear-gradient(35deg, transparent 60%, #f5d58a 61% 64%, transparent 65%), linear-gradient(0deg, #cfe6c8 0 22%, transparent 23%), #eceef2; }
.th-satelite { background: radial-gradient(circle at 25% 30%, #6b7b4a 0 18%, transparent 19%), radial-gradient(circle at 70% 70%, #8a7a5c 0 22%, transparent 23%), linear-gradient(135deg, #3d4a2e, #6e6a52 55%, #4b5a3a); }
.th-hibrido { background: linear-gradient(135deg, transparent 46%, #f2c94c 47% 51%, transparent 52%), radial-gradient(circle at 25% 30%, #6b7b4a 0 18%, transparent 19%), radial-gradient(circle at 70% 70%, #8a7a5c 0 22%, transparent 23%), linear-gradient(135deg, #3d4a2e, #6e6a52 55%, #4b5a3a); }
.lp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 10px; font-size: 13px; cursor: pointer; }
.lp-row:hover { background: var(--card-hi); }

/* Interruptor */
input[type=checkbox] + .sw { position: relative; width: 36px; height: 21px; border-radius: 99px; background: rgba(255,255,255,.12); flex: none; transition: background .25s; }
input[type=checkbox] + .sw::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .3s var(--ease); }
input[type=checkbox]:checked + .sw { background: var(--acc); }
input[type=checkbox]:checked + .sw::after { transform: translateX(15px); }
/* El checkbox real queda oculto DENTRO de su etiqueta (que es position: relative). Antes quedaba posicionado respecto a la
   tarjeta de Ajustes y, al tocar un interruptor de abajo (p. ej. «Modo conducción»), el navegador desplazaba la tarjeta
   (overflow: hidden) para enseñar el checkbox y Ajustes se quedaba en blanco (fallo de la 1.1, corregido en la 1.1.2). */
label:has(> input[type=checkbox]) { position: relative; }
input[type=checkbox] { position: absolute; top: 50%; left: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
input[type=checkbox]:focus-visible + .sw { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---------- Marcadores ---------- */
.mk-root { line-height: 0; }
.mk-place { pointer-events: none; font: 600 11px/1.2 var(--font); color: #7d89a6; text-shadow: 0 0 3px #070B14, 0 0 6px #070B14; white-space: nowrap; }
.mk-place.city { font-size: 13px; color: #a9b4cc; }
.mk-place.town { font-size: 12px; color: #93a0bb; }
.mk-shield { pointer-events: none; padding: 1px 5px; border-radius: 4px; font: 700 9.5px/1.4 var(--font); color: #cfd8ea; background: #263352; border: 1px solid #3a4766; }
.mk { position: relative; width: 22px; height: 22px; }
.mk-o { border-radius: 50%; background: var(--acc); border: 4px solid #0b0d12; box-shadow: 0 0 0 2px var(--acc), 0 0 22px rgba(var(--acc-rgb), .8); }
.mk-d { width: 34px; height: 44px; }
.mk-d svg { width: 34px; height: 44px; stroke: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.mk-me { width: 18px; height: 18px; border-radius: 50%; background: #60a5fa; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(96,165,250,.25); }
.mk-inc { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #fff; border: 2px solid rgba(0,0,0,.5); box-shadow: 0 4px 12px rgba(0,0,0,.5); cursor: pointer; transition: transform .2s; }
.mk-inc:hover { transform: scale(1.15); }
.mk-inc svg { width: 15px; height: 15px; stroke-width: 2.2; }
.mk-inc.accident { background: #f43f5e; }
.mk-inc.works { background: #f59e0b; }
.mk-inc.congestion { background: #ef4444; }
.mk-inc.closure { background: #7f1d1d; }
.mk-inc.weather { background: #3b82f6; }
.mk-inc.other { background: #64748b; }
.mk-inc.dim { opacity: .55; transform: scale(.8); }
.mk-poi { min-width: 30px; height: 26px; padding: 0 7px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; color: #0b0d12; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.5); cursor: pointer; white-space: nowrap; }
.mk-poi svg { width: 13px; height: 13px; stroke-width: 2.2; }
.mk-poi.fuel { background: #34d399; }
.mk-poi.fuel.best { background: #a3e635; outline: 2px solid #fff; }
.mk-poi.park { background: #60a5fa; color: #fff; }
.mk-poi.park.moto { background: #ff8a3d; }
.mk-poi.cam { background: #e2e8f0; }
.mk-poi.radar { background: var(--radar); color: #fff; }
.mk-poi.radar.section { background: #FF8A3D; }
.mk-label { padding: 4px 8px; border-radius: 8px; background: var(--panel-solid); border: 1px solid var(--line-hi); font-size: 11.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); }
.mk-label.sel { background: var(--acc); color: var(--acc-ink); border-color: transparent; }

/* Popups */
.maplibregl-popup-content { background: var(--panel-solid) !important; color: var(--text); border: 1px solid var(--line-hi); border-radius: 14px !important; padding: 12px 14px !important; box-shadow: var(--shadow) !important; font-family: var(--font); max-width: 290px; }
.maplibregl-popup-tip { border-top-color: var(--panel-solid) !important; border-bottom-color: var(--panel-solid) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; right: 6px; top: 4px; }
.pp-title { font-weight: 600; font-size: 13.5px; margin: 0 14px 4px 0; }
.pp-sub { font-size: 12px; color: var(--muted); }
.pp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pp-actions { display: flex; gap: 6px; margin-top: 10px; }
.pp-actions button { flex: 1; height: 32px; padding: 0 10px; border-radius: 9px; background: var(--card-hi); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.pp-actions button.p { background: var(--acc); color: var(--acc-ink); border-color: transparent; }
.pp-img { display: block; width: 100%; border-radius: 10px; margin-top: 8px; background: #000; min-height: 120px; object-fit: cover; }
.hover-tip { position: fixed; z-index: 20; pointer-events: none; padding: 5px 9px; border-radius: 8px; background: var(--panel-solid); border: 1px solid var(--line-hi); font-size: 12px; font-weight: 500; transform: translate(12px, 12px); }

/* ---------- Modal ajustes ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3,4,6,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(620px, 100%); max-height: min(760px, calc(100dvh - 40px)); display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--panel-solid); border: 1px solid var(--line-hi); box-shadow: 0 40px 100px -20px rgba(0,0,0,.8); animation: pop .35s var(--ease); overflow: hidden; overflow: clip; min-width: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px 22px; }
.modal-head h2 { margin: 0; font-family: var(--font-d); font-size: 20px; letter-spacing: -.02em; }
.tabs { flex: none; display: flex; gap: 4px; padding: 6px 18px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; height: 40px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tabs button.active { color: var(--text); }
.tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--acc); }
.modal-body { overflow-y: auto; min-height: 0; padding: 18px 22px 24px; }
.pane { display: none; }
.pane.active { display: block; animation: rise .3s var(--ease); }
.pane-intro { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.set-group { display: flex; flex-direction: column; gap: 6px; }
.set-group-title { margin: 14px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.set-group-title:first-child { margin-top: 0; }
.set-toggle, .feat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.feat .f-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--acc-rgb), .1); color: var(--acc); flex: none; }
.feat .f-ico svg { width: 17px; height: 17px; }
.feat .f-txt { flex: 1; min-width: 0; }
.feat .f-txt b { display: block; font-size: 13.5px; font-weight: 600; }
.feat .f-txt span { display: block; font-size: 12px; color: var(--muted); }
.set-toggle span { flex: 1; font-size: 13px; }
.set-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-size: 14px; font-weight: 600; }
.set-h:first-child { margin-top: 0; }
.set-h svg { color: var(--acc); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.set-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.set-field.wide { grid-column: 1 / -1; }
.set-field input, .set-field select { height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--text); outline: 0; font-size: 13.5px; color-scheme: dark; min-width: 0; }
.set-field input:focus, .set-field select:focus { border-color: rgba(var(--acc-rgb), .5); }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.primary-btn { height: 40px; padding: 0 16px; border-radius: 11px; background: var(--acc); color: var(--acc-ink); font-weight: 600; font-size: 13px; }
.ghost-btn { height: 40px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-hi); color: var(--text); font-size: 13px; font-weight: 500; }
.ghost-btn:hover { background: var(--card-hi); }
.conn-card { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; }
.conn-card h3 { margin: 0 0 4px; font-size: 15px; }
.conn-card p { margin: 0; font-size: 12.5px; }
.conn-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.badge { align-self: flex-start; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(52,211,153,.12); color: var(--good); white-space: nowrap; }
.qr-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr { width: 132px; height: 132px; padding: 8px; border-radius: 14px; background: #fff; flex: none; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.lan-urls { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-d); font-size: 15px; }
.lan-urls small { font-family: var(--font); font-size: 11.5px; color: var(--muted); }
.sources { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.sources li { display: flex; justify-content: space-between; gap: 10px; }
.sources li b { color: var(--text); font-weight: 500; }
.places-list { display: flex; flex-direction: column; gap: 8px; }
.place-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); }
.place-row .f-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--acc-rgb), .1); color: var(--acc); flex: none; }
.place-row .p-txt { flex: 1; min-width: 0; }
.place-row .p-txt b { display: block; font-size: 13.5px; }
.place-row .p-txt span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-row .p-act { display: flex; gap: 4px; }
.place-search { position: relative; margin-top: 4px; }
.place-search input { width: 100%; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(0,0,0,.3); outline: 0; }
.place-search .suggest { top: calc(100% + 4px); }
.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.35); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--card-hi); color: var(--text); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 13px; background: var(--panel-solid); border: 1px solid var(--line-hi); box-shadow: var(--shadow); font-size: 13px; animation: toastIn .35s var(--ease); }
.toast svg { width: 16px; height: 16px; color: var(--acc); }
.toast.err svg { color: var(--bad); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Arranque ---------- */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--bg); transition: opacity .6s var(--ease), visibility .6s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-mark img { width: 72px; height: 72px; display: block; }
.boot-bar { width: 120px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, #4DF0E0, #7AA2FF); border-radius: 3px; animation: bootbar 1.1s var(--ease) infinite; }
@keyframes bootbar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Modo conducción ---------- */
.drive { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: radial-gradient(900px 600px at 50% 0%, rgba(var(--acc-rgb), .14), transparent 60%), #030405; padding: calc(20px + var(--safe-t)) 22px calc(22px + var(--safe-b)); animation: fade .4s; }
.drive-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 15px; }
.drive-top .clock { font-family: var(--font-d); font-size: 22px; color: var(--text); font-weight: 600; }
.drive-close { height: 44px; padding: 0 18px; border-radius: 14px; background: rgba(255,255,255,.08); font-size: 15px; font-weight: 600; }
.drive-main { width: 100%; max-width: 860px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.drive-eta { font-family: var(--font-d); font-size: clamp(84px, 24vw, 170px); font-weight: 700; letter-spacing: -.05em; line-height: .9; }
.drive-eta small { font-size: .3em; color: var(--muted); letter-spacing: -.02em; margin-left: 6px; }
.drive-sub { font-size: clamp(18px, 4.5vw, 26px); color: var(--muted); }
.drive-sub b { color: var(--text); }
.drive-step { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: clamp(18px, 4.8vw, 26px); font-weight: 600; }
.drive-step .ds-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--acc); color: var(--acc-ink); flex: none; }
.drive-step .ds-ico svg { width: 34px; height: 34px; stroke-width: 2.4; }
.drive-step small { display: block; font-size: .65em; color: var(--muted); font-weight: 500; margin-top: 2px; }
.drive-alert { margin-top: 12px; padding: 14px 18px; border-radius: 16px; background: rgba(251,191,36,.1); color: var(--warn); font-size: 17px; font-weight: 600; }
.drive-nav { display: flex; gap: 10px; margin-top: 14px; }
.drive-nav button { flex: 1; height: 56px; border-radius: 16px; background: rgba(255,255,255,.07); font-size: 16px; font-weight: 600; }

/* ---------- Responsive: móvil ---------- */
@media (max-width: 760px) {
  :root { --panel-w: 100vw; }
  body { font-size: 15px; }
  .panel {
    left: 0; right: 0; bottom: 0; top: auto; width: 100%;
    height: calc(100dvh - 64px - var(--safe-t));
    border-radius: 24px 24px 0 0; border-bottom: 0;
    transform: translateY(var(--sheet-y, 55%));
    transition: transform .45s var(--ease);
    box-shadow: 0 -20px 60px -10px rgba(0,0,0,.7);
    touch-action: pan-y;
  }
  .panel.dragging { transition: none; }
  .sheet-handle { display: flex; justify-content: center; padding: 10px 0 2px; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 42px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.22); }
  .brand { padding: 6px 16px 12px; touch-action: none; }
  .brand-mark { width: 36px; height: 36px; }
  .brand h1 { font-size: 19px; }
  .panel-scroll { padding: 2px 16px calc(28px + var(--safe-b) + var(--sheet-hidden, 0px)); }
  .field input { font-size: 16px; } /* evita zoom en iOS */
  .topbar { left: 12px; right: 12px; top: calc(10px + var(--safe-t)); gap: 8px; }
  .zones { margin-left: auto; }
  .zones button { padding: 0 9px; font-size: 12px; height: 32px; }
  .weather-chip { height: 42px; padding: 0 11px 0 8px; }
  .weather-chip .w-extra { display: none; }
  .map-ctrls { top: auto; bottom: calc((100dvh - 64px) * .58 + 12px); right: 12px; transition: opacity .3s, bottom .45s var(--ease); }
  body[data-sheet=peek] .map-ctrls { bottom: calc((100dvh - 64px) * .28 + 12px); }
  body.sheet-full .map-ctrls, body.sheet-full .topbar { opacity: 0; pointer-events: none; }
  .map-ctrls #zoomIn, .map-ctrls #zoomOut, .map-ctrls .mc-gap { display: none; }
  .layers-pop { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 64px); bottom: auto; right: 12px; left: auto; width: min(300px, calc(100vw - 24px)); max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 64px - 16px - env(safe-area-inset-bottom, 0px)); z-index: 40; }
  body.layers-open .map-ctrls { z-index: 45; opacity: 1; pointer-events: auto; }
  .map-attrib { display: none; }
  .hero-eta { font-size: 42px; }
  .toasts { bottom: calc(16px + var(--safe-b)); }
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; animation: sheetUp .4s var(--ease); }
  .modal-body { padding-bottom: calc(24px + var(--safe-b)); }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
  .set-grid { grid-template-columns: 1fr; }
  .depart-menu { width: min(300px, calc(100vw - 32px)); }
}
@media (max-width: 380px) {
  .chip-status #providerLabel { display: none; }
  .factor span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.voice-line { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(var(--acc-rgb), .08); border-left: 3px solid var(--acc); font-size: 13.5px; font-weight: 500; color: var(--text); }

/* Tipo de mapa: con mapa claro o satélite se suaviza la viñeta oscura */
html[data-map-base=dia] .map-vignette, html[data-map-base=satelite] .map-vignette, html[data-map-base=hibrido] .map-vignette { opacity: .35; }

/* Marcas de gasolinera (Ajustes › Vehículos) */
.brand-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.brand-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; font-weight: 500; }
.brand-chip small { color: var(--muted); font-size: 11px; font-weight: 500; }
.brand-chip[aria-pressed="true"] { border-color: rgba(var(--acc-rgb), .55); background: rgba(var(--acc-rgb), .14); color: var(--acc); }
.brand-chip[aria-pressed="true"] small { color: inherit; opacity: .75; }
.brand-chip.all { font-weight: 600; }
.fuel-pop .pp-price { font-family: var(--font-d); font-size: 18px; font-weight: 700; margin: 2px 0 4px; }
.fuel-pop .pp-price small { font-family: var(--font-b, inherit); font-size: 11px; font-weight: 500; }
.mk-poi.fuel.t1 { background: #fbbf24; }
.mk-poi.fuel.t2 { background: #f87171; }

/* Móviles emparejados (Ajustes › Conexión) */
.dev-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.dev-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; }

/* FUN-09: brújula (norte arriba) */
#compassBtn svg { transition: transform .12s linear; }
#compassBtn .cn-n { fill: #ff5a4e; stroke: none; }
#compassBtn .cn-s { fill: currentColor; opacity: .55; stroke: none; }

/* Mapa sin conexión */
.offline-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin: 10px 0 4px; }
.offline-bar i { display: block; height: 100%; width: 0; background: var(--accent, #3ad6ff); transition: width .3s; }
