/* =====================================================================
 * Rutapi · Temas claro / oscuro
 * Base neutra + un acento (rosa) + colores de seguridad:
 * verde = iluminado · ámbar = precaución · rojo = oscuro/solitario
 * ===================================================================== */
:root,
:root[data-theme="claro"] {
  color-scheme: light;
  --bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #f1f1f3;
  --ink: #18181b;
  --muted: #6b6b76;
  --line: #e5e5e9;
  --brand: #e98aa8;
  --brand-hover: #b94a70;
  --brand-2: #f3bccd;
  --brand-soft: #fcebf1;
  --brand-tint: #fffafc;
  --on-brand: #ffffff;
  --btn: #18181b;
  --btn-hover: #2e2e33;
  --on-btn: #ffffff;
  --brand-grad: var(--btn);
  --pin-b: #18181b;
  --lit: #16a34a;
  --lit-soft: #e8f7ee;
  --lit-ink: #166534;
  --caution: #d97706;
  --caution-soft: #fdf4e4;
  --caution-ink: #92400e;
  --dark: #dc2626;
  --dark-soft: #fdeded;
  --dark-ink: #991b1b;
  --bus: #2563eb;
  --bus-soft: #e8effd;
  --bus-ink: #1d4ed8;
  --casing: #18181b;
  --casing-inner: #ffffff;
  --walk-casing: #ffffff;
  --station-fill: #ffffff;
  --station-stroke: #18181b;
  --lit-axis: #facc15;
  --overlay: rgba(255, 255, 255, .96);
  --backdrop: rgba(24, 24, 27, .45);
  --map-bg: #eef0f2;
  --tile-filter: grayscale(.75) brightness(1.04) contrast(.9);
  --radius: 14px;
  --radius-sm: 11px;
  --pill: 10px;
  --shadow: 0 1px 2px rgba(24, 24, 27, .05), 0 8px 24px rgba(24, 24, 27, .07);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --bg-pattern: none;
  --metro-tint: 0;
}

:root[data-theme="oscuro"] {
  color-scheme: dark;
  --bg: #0e0e10;
  --surface: #17171a;
  --surface-2: #212125;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --line: #2c2c31;
  --brand: #f2a6bd;
  --brand-hover: #f7c4d3;
  --brand-2: #8f5a6c;
  --brand-soft: #332329;
  --brand-tint: #1d181b;
  --on-brand: #18181b;
  --btn: #f4f4f5;
  --btn-hover: #e4e4e7;
  --on-btn: #18181b;
  --pin-b: #a1a1aa;
  --lit: #4ade80;
  --lit-soft: #12301f;
  --lit-ink: #bbf7d0;
  --caution: #fbbf24;
  --caution-soft: #33260c;
  --caution-ink: #fde68a;
  --dark: #f87171;
  --dark-soft: #3a1618;
  --dark-ink: #fecaca;
  --bus: #60a5fa;
  --bus-soft: #16263d;
  --bus-ink: #93c5fd;
  --casing: #050506;
  --casing-inner: #17171a;
  --walk-casing: #050506;
  --station-fill: #17171a;
  --station-stroke: #f4f4f5;
  --lit-axis: #fde047;
  --overlay: rgba(23, 23, 26, .95);
  --backdrop: rgba(0, 0, 0, .6);
  --map-bg: #141416;
  --tile-filter: invert(1) hue-rotate(180deg) brightness(.8) contrast(.9) saturate(.2);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--brand-2); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 400px 1fr; height: 100vh; height: 100dvh; }

/* ---------- Panel ---------- */
.panel { display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); min-height: 0; z-index: 2; background-image: var(--bg-pattern); background-size: 24px 24px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.logo { width: 40px; height: 40px; color: var(--brand); flex: none; }
.logo svg { width: 100%; height: 100%; }
.brand h1 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.tagline { margin: 1px 0 0; font-size: 12px; color: var(--muted); line-height: 1.3; }
.source-badge { margin-left: auto; font-size: 11px; padding: 4px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.source-badge.warn { background: var(--caution-soft); color: var(--caution-ink); }

.theme-row { display: flex; align-items: center; gap: 8px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.theme-switch button { border: 0; background: transparent; color: var(--muted); border-radius: 99px; padding: 5px 10px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; transition: background .15s, color .15s; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.scroll { flex: 1; overflow-y: auto; padding: 14px 16px 8px; min-height: 0; }

.planner { display: grid; gap: 8px; }
.field { position: relative; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 6px 6px 6px 10px; transition: border-color .15s, background .15s; }
.field:focus-within { border-color: var(--brand-2); background: var(--surface); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 7px 0; font-size: 14px; }
.field input::placeholder { color: var(--muted); }
.pin { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.pin-a { background: var(--brand); color: var(--on-brand); }
.pin-b { background: var(--pin-b); }
.icon-btn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.icon-btn svg circle:first-child { fill: currentColor; stroke: none; }

.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 1000; display: none; max-height: 260px; overflow-y: auto; }
.suggestions.open { display: block; }
.suggestions li { padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.35; cursor: pointer; }
.suggestions li:hover, .suggestions li.active { background: var(--brand-soft); }
.suggestions li.muted { color: var(--muted); cursor: default; background: none; }

.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.btn { border: 0; border-radius: var(--pill); padding: 10px 14px; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--btn); color: var(--on-btn); flex: 1; justify-content: center; transition: filter .15s, transform .1s; }
.btn.primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn.primary:active:not(:disabled) { transform: translateY(1px); }
.btn.primary:disabled { opacity: .3; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.demo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 10px; font-size: 12px; color: var(--ink); }
.chip:hover { border-color: var(--brand-2); color: var(--brand); }

.progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 10px 12px; background: var(--brand-soft); color: var(--brand); border-radius: 12px; font-size: 13px; font-weight: 600; }
.progress[hidden] { display: none; }
.spinner { width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Íconos ---------- */
.ic { width: 14px; height: 14px; flex: none; vertical-align: -2px; }
.tone-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.tone-dot.green { background: var(--lit); }
.tone-dot.amber { background: var(--caution); }
.tone-dot.red { background: var(--dark); }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.sw-claro { background: #ffffff; }
.sw-oscuro { background: #18181b; }

/* ---------- Tarjetas ---------- */
.refine { margin: 12px 0 0; font-size: 12px; color: var(--brand); display: flex; align-items: center; gap: 6px; }
.refine[hidden] { display: none; }
.refine::before { content: ''; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.refine.done { color: var(--lit); }
.refine.warn { color: var(--caution-ink); }
.refine.done .ic { width: 13px; height: 13px; }
.refine.done::before, .refine.warn::before { display: none; }
.results { display: grid; gap: 10px; margin-top: 14px; }
.results:empty { display: none; }
.card { position: relative; text-align: left; width: 100%; color: var(--ink); border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover, .card.selected { box-shadow: var(--shadow); }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-title { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.badge { margin-left: auto; flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; }
.badge.rec { background: var(--lit); color: var(--surface); }
.badge.est { background: var(--caution-soft); color: var(--caution-ink); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.metric { background: var(--surface-2); border-radius: 10px; padding: 7px 8px; }
.metric b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.metric span { font-size: 11px; color: var(--muted); }
.litbar { height: 5px; border-radius: 9px; background: var(--dark-soft); margin-top: 5px; overflow: hidden; }
.litbar i { display: block; height: 100%; background: var(--lit); border-radius: 9px; }
.modes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.mode { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink); }
.mode.metro { color: #fff; }
.mode.bus { background: var(--bus-soft); color: var(--bus); }
.card-alerts { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--dark); font-weight: 600; }
.card-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- Detalle ---------- */
.details { margin-top: 14px; }
.details:empty { display: none; }
.details h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; padding: 7px 4px; font-size: 13px; line-height: 1.4; border-radius: 8px; }
.step-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.step-ic.metro { color: #fff; font-weight: 800; font-size: 10px; }
.step-ic.bus { background: var(--bus-soft); color: var(--bus); }
.step-ic.light { background: var(--lit-soft); color: var(--lit-ink); }
.alerts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.alerts li { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: var(--dark-soft); color: var(--dark-ink); cursor: pointer; }
.alerts li.caution { background: var(--caution-soft); color: var(--caution-ink); }
.alerts li:hover { outline: 1.5px solid currentColor; }

.disclaimer { font-size: 11.5px; color: var(--muted); margin: 16px 0 6px; line-height: 1.45; }
.disclaimer code { font-size: 11px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }

/* ---------- Emergencia ---------- */
.emergency { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--surface); }
.em-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 14px; white-space: nowrap; }
.btn.share, .btn.wa { background: var(--share); color: var(--share-ink, #fff); padding: 8px 12px; font-size: 13px; }
.btn.share:hover, .btn.wa:hover { background: var(--share-hover); }
.btn.share svg { width: 16px; height: 16px; fill: currentColor; }
.em-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 6px; }
.em-btn { display: flex; flex-direction: column; justify-content: center; gap: 1px; text-decoration: none; color: #fff; border-radius: var(--radius-sm); padding: 7px 8px; min-height: 52px; }
.em-btn b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.em-btn span { font-size: 10px; line-height: 1.15; opacity: .95; }
.em-violet { background: var(--em-1); color: var(--em-1-ink, #fff); }
.em-green { background: var(--em-2); color: var(--em-2-ink, #fff); }
.em-teal { background: var(--em-3); color: var(--em-3-ink, #fff); }
.em-blue { background: var(--em-4); color: var(--em-4-ink, #fff); }
.em-btn:hover { filter: brightness(1.1); }
.live { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--lit-ink); background: var(--lit-soft); padding: 7px 10px; border-radius: 10px; }
.live[hidden] { display: none; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lit); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); } 100% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } }
.link { margin-left: auto; border: 0; background: none; color: inherit; text-decoration: underline; font-size: 12.5px; }

/* ---------- Mapa ---------- */
.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.leaflet-container { font-family: var(--font); background: var(--map-bg); }
.base-tiles { filter: var(--tile-filter); transition: filter .3s; }
.layers { position: absolute; top: 12px; right: 12px; z-index: 500; background: var(--overlay); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px; display: grid; gap: 4px; font-size: 13px; }
.layers label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.layers input { accent-color: var(--brand); }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw-metro { background: conic-gradient(#E1251B 0 25%, #FFC20E 0 50%, #0033A0 0 75%, #00A651 0); border-radius: 50%; }
.sw-bus { background: var(--bus); }
.sw-routes { background: repeating-linear-gradient(90deg, var(--bus) 0 3px, var(--bus-soft) 3px 6px); }
.sw-lit { background: var(--lit-axis); box-shadow: inset 0 0 0 2px #eab308; }
.routes-box { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; max-width: 220px; }
.routes-box input:not([type]) { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; outline: 0; }
.routes-box input:not([type]):focus { border-color: var(--brand-2); }
.routes-box small { color: var(--muted); font-size: 11px; }
.routes-box small[hidden], .route-info[hidden] { display: none; }
.route-info { font-size: 12px; line-height: 1.4; background: var(--surface-2); border-radius: 8px; padding: 6px 8px; }
.legend { position: absolute; left: 12px; bottom: 22px; z-index: 500; background: var(--overlay); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; display: grid; gap: 3px; font-size: 12px; }
.lg { display: inline-block; width: 26px; height: 0; vertical-align: middle; margin-right: 6px; border-top-width: 4px; }
.lg-lit { border-top: 4px solid var(--lit); }
.lg-caution { border-top: 4px dashed var(--caution); }
.lg-dark { border-top: 4px dotted var(--dark); }
.lg-metro { height: 8px; border: 2px solid var(--casing-inner); background: linear-gradient(90deg, #E1251B, #0033A0); box-shadow: 0 0 0 1.5px var(--casing); border-radius: 4px; }
.lg-bus { height: 8px; border: 2px solid var(--casing-inner); background: var(--bus); box-shadow: 0 0 0 1.5px var(--casing); border-radius: 4px; }
.sos-fab { display: none; }

/* Controles y popups de Leaflet según tema */
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-control-attribution { background: var(--overlay) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--brand); }
.leaflet-control-scale-line { background: var(--overlay); color: var(--ink); border-color: var(--ink); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip, .leaflet-tooltip { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-tooltip-top::before { border-top-color: var(--surface); }
.leaflet-popup-content a { color: var(--brand); }

/* Marcadores */
.mk-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); border: 2.5px solid #fff; }
.mk-pin span { transform: rotate(45deg); color: #fff; font-weight: 800; font-size: 12px; }
.mk-a { background: var(--brand); }
.mk-a span { color: var(--on-brand); }
.mk-b { background: var(--pin-b); }
.mk-transit { display: flex; align-items: center; gap: 3px; background: var(--surface); color: var(--ink); border-radius: 99px; padding: 2px 7px 2px 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); font-size: 11px; font-weight: 800; white-space: nowrap; }
.mk-transit i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10px; }
.mk-transit i .ic { width: 12px; height: 12px; }
.mk-alert { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: #fff; font-weight: 900; font-size: 14px; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }
.mk-alert.caution { background: var(--caution); }
.leaflet-tooltip.station-tip { font-family: var(--font); font-size: 12px; font-weight: 600; }
.leaflet-popup-content { font-family: var(--font); font-size: 13px; }

/* Diálogo */
.dialog { border: 0; border-radius: var(--radius); padding: 18px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: var(--backdrop); }
.dialog h3 { margin: 0 0 6px; font-family: var(--font-display); }
.dialog .muted { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; resize: vertical; background: var(--surface-2); }
.dialog .actions { margin-top: 12px; }

/* =====================================================================
 * Panel (diseño v2): jerarquía tipográfica, menos cajas, color como acento
 * ===================================================================== */
.brand { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); gap: 12px; }
.logo { width: 34px; height: 34px; }
.brand-text { flex: 1; min-width: 0; }
.brand h1 { font-size: 19px; line-height: 1.1; }
.tagline { font-size: 12.5px; margin-top: 2px; }
.theme-switch { gap: 4px; padding: 3px; background: transparent; border: 0; }
.theme-switch button { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.theme-switch .swatch { width: 18px; height: 18px; }
.theme-switch { background: var(--surface-2); border-radius: 99px; }
.theme-switch button { color: var(--muted); }
.theme-switch button .ic { width: 15px; height: 15px; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

.od { position: relative; display: grid; grid-template-columns: 14px 1fr 34px; align-items: stretch; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px 4px 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: border-color .15s; }
.od:focus-within { border-color: var(--brand-2); }
.od-rail { display: flex; flex-direction: column; align-items: center; padding: 19px 0; }
.od-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.od-dot.a { border: 2.5px solid var(--brand); background: var(--surface); }
.od-dot.b { background: var(--ink); }
.od-line { flex: 1; width: 0; border-left: 2px dotted var(--muted); opacity: .45; margin: 4px 0; }
.od-fields { display: grid; min-width: 0; }
.od .field { background: transparent; border: 0; border-radius: 0; padding: 3px 0; }
.od .field:focus-within { background: transparent; border: 0; }
.od .field + .field { border-top: 1px solid var(--line); }
.od .field input { padding: 9px 0; font-size: 14.5px; }
.od-swap { align-self: center; }

.planner .actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.planner .hint { flex: 1; margin: 0; font-size: 12.5px; }
.planner .btn.primary { flex: none; padding: 9px 20px; font-size: 14px; }
.planner .btn.ghost { padding: 9px 10px; font-size: 13.5px; font-weight: 600; }
.examples { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.examples[hidden] { display: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 600; font-size: inherit; text-decoration: underline; text-decoration-color: var(--brand); text-underline-offset: 3px; }
.link-btn:hover { color: var(--brand); }

.refine { color: var(--muted); margin-top: 16px; }
.refine.done { color: var(--muted); }
.refine.done .ic { color: var(--lit); }
.results { gap: 8px; margin-top: 12px; }
.card { padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: none; }
.card:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.card.selected { border-color: var(--brand-2); box-shadow: 0 0 0 1px var(--brand-2); background: var(--brand-tint); }
.card-row { display: flex; gap: 12px; align-items: flex-start; }
.card-main { flex: 1; min-width: 0; }
.card .card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.card .tone-dot { width: 8px; height: 8px; margin-right: 2px; vertical-align: 0; }
.rec { font-size: 11px; font-weight: 600; color: var(--brand-hover); background: var(--brand-soft); padding: 2px 8px; border-radius: 99px; }
.journey { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.j-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; line-height: 1.4; }
.j-chip .ic { width: 12px; height: 12px; }
.j-chip.bus { background: var(--bus-soft); color: var(--bus-ink, var(--bus)); }
.j-walk { display: inline-flex; align-items: flex-end; color: var(--muted); }
.j-walk .ic { width: 15px; height: 15px; }
.j-walk small { font-size: 10px; font-weight: 700; margin-left: -1px; }
.j-sep { color: var(--muted); opacity: .55; font-size: 13px; line-height: 1; }
.card-time { text-align: right; line-height: 1; padding-top: 1px; }
.card-time b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.card-time span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.litmeter { display: inline-flex; align-items: center; gap: 6px; }
.litmeter i { width: 40px; height: 4px; border-radius: 9px; background: var(--surface-2); overflow: hidden; display: inline-block; }
.litmeter b { display: block; height: 100%; background: var(--lit); border-radius: 9px; }
.risk { display: inline-flex; align-items: center; gap: 4px; color: var(--caution-ink); }
.risk.dark { color: var(--dark); }
.risk.ok { color: var(--muted); }
.risk .ic { width: 13px; height: 13px; }
.card .card-note { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }

.details { margin-top: 22px; }
.details h2.section-label { text-transform: none; letter-spacing: 0; margin: 0; font-size: 13.5px; color: var(--ink); }
.details-sub { margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }

.disclaimer { font-size: 11.5px; margin-top: 22px; }
.data-status { display: block; margin-top: 4px; }
.data-status.warn { color: var(--caution-ink); }

.emergency { padding: 14px 20px 16px; }
.em-head { margin-bottom: 10px; }
.section-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.btn.share { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 6px 12px; font-size: 12.5px; font-weight: 600; }
.btn.share:hover { background: var(--surface-2); }
.btn.share svg { fill: #25a45b; }
.em-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.em-btn { border-radius: 12px; padding: 9px 10px; min-height: 58px; gap: 2px; transition: filter .15s; }
.em-btn b { font-size: 17px; font-variant-numeric: tabular-nums; }
.em-btn span { font-size: 10.5px; opacity: .78; }
.em-btn.em-1 { background: var(--em-1, var(--brand-soft)); color: var(--em-1-ink, var(--brand-hover)); }
.em-btn.em-2 { background: var(--em-2, var(--surface-2)); color: var(--em-2-ink, var(--ink)); }
.em-btn.em-3 { background: var(--em-3, var(--surface-2)); color: var(--em-3-ink, var(--ink)); }
.em-btn.em-4 { background: var(--em-4, var(--surface-2)); color: var(--em-4-ink, var(--ink)); }
.em-btn:hover { filter: brightness(.97); }

.mobile-toggle, .panel-close-btn { display: none; }

/* ---------- Móvil ---------- */
@media (max-width: 820px) {
  .app { display: block; position: relative; height: 100dvh; overflow: hidden; }
  .mapwrap { height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 1; }
  .panel { position: fixed; bottom: 0; left: 0; width: 100%; height: auto; max-height: 90vh; border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); z-index: 1000; box-shadow: 0 -10px 40px rgba(0,0,0,0.15); border: 0; border-right: 0; border-top: 1px solid var(--line); margin-top: 0; }
  .panel.open { transform: translateY(0); }
  
  .mobile-toggle { display: grid; place-items: center; position: absolute; z-index: 600; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 12px rgba(0,0,0,0.15); cursor: pointer; }
  .mobile-toggle svg { width: 22px; height: 22px; }
  .layers-btn { top: 12px; right: 12px; }
  .panel-btn { bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--btn); color: var(--on-btn); border: 0; width: auto; border-radius: 99px; padding: 0 20px; font-weight: 700; gap: 8px; display: flex; box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
  
  .panel-close-btn { display: grid; place-items: center; position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 0; color: var(--ink); z-index: 10; cursor: pointer; }

  .brand { padding: 12px 16px 8px; }
  .tagline { display: none; }
  .legend { display: none; }
  .layers { display: none; top: 64px; right: 12px; font-size: 12px; }
  .layers.open { display: grid; }
  .em-btn span { font-size: 10px; }
  .sos-fab { display: grid; place-items: center; position: absolute; left: 12px; top: 12px; z-index: 600; width: 54px; height: 54px; border-radius: 50%; background: var(--dark); color: #fff; font-weight: 900; text-decoration: none; box-shadow: 0 4px 14px rgba(220, 38, 38, .5); }
}
