/* Maratón NY 2026 · póster editorial de los cinco distritos sobre la base de tetrisOS:
   Geist + Geist Mono, neutros cálidos, radios grandes y acentos suaves.
   Colores por distrito (Staten Island, Brooklyn, Queens, Bronx, Manhattan) y por categoría de actividad.
   Tema: sigue al sistema; data-theme="light" | "dark" en <html> lo fija a mano. */
:root {
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 6px; --r: 8px; --r-lg: 10px; --r-xl: 12px; --r-full: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --maxw: 1280px;

  --bg: #f4f2ec;
  --bg-2: #ebe8df;
  --surface: #fffdf8;
  --surface-2: #f2efe7;
  --border: rgba(30, 26, 10, 0.08);
  --border-strong: rgba(30, 26, 10, 0.15);
  --fg: #151513;
  --fg-muted: #5d5b53;
  --fg-faint: #9a978d;
  --solid: #151513; --on-solid: #fffdf8;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px -16px rgba(0,0,0,.18);

  /* Distritos */
  --si: #9a7cf0; --si-bg: #eee8ff;
  --bk: #e5689a; --bk-bg: #fde7ef;
  --qn: #ef8a3c; --qn-bg: #fdecdc;
  --bx: #d8ac1c; --bx-bg: #fbf2d2;
  --mh: #4f78ea; --mh-bg: #e5ecff;

  /* Categorías (tetrisOS) */
  --blue: #3567e0;   --blue-bg: #e5ecff;
  --green: #1b8f4c;  --green-bg: #e2f4e8;
  --violet: #7650e0; --violet-bg: #eee8ff;
  --amber: #b86506;  --amber-bg: #fcefd9;
  --rose: #cf3f69;   --rose-bg: #fde7ee;
  --gray: #5e5c55;   --gray-bg: #ebe8e0;
  --race: #ec6420;   --race-bg: #ffe8da;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0c0c0b; --bg-2: #141412; --surface: #151513; --surface-2: #1e1e1b;
  --border: rgba(255, 250, 235, .08); --border-strong: rgba(255, 250, 235, .16);
  --fg: #f3f1ea; --fg-muted: #b3b0a6; --fg-faint: #78766e;
  --solid: #f3f1ea; --on-solid: #0c0c0b;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px -16px rgba(0,0,0,.18);
  --si: #b9a3f8; --si-bg: rgba(185,163,248,.13);
  --bk: #f497bb; --bk-bg: rgba(244,151,187,.13);
  --qn: #f7aa6b; --qn-bg: rgba(247,170,107,.13);
  --bx: #efcf5a; --bx-bg: rgba(239,207,90,.12);
  --mh: #8eabff; --mh-bg: rgba(142,171,255,.13);
  --blue: #8eabff; --blue-bg: rgba(142,171,255,.13);
  --green: #74dc9d; --green-bg: rgba(116,220,157,.12);
  --violet: #b9a3f8; --violet-bg: rgba(185,163,248,.13);
  --amber: #f6c25c; --amber-bg: rgba(246,194,92,.12);
  --rose: #ff92b0; --rose-bg: rgba(255,146,176,.12);
  --gray: #b3b0a6; --gray-bg: rgba(255,250,235,.07);
  --race: #ff9b5e; --race-bg: rgba(255,155,94,.13);
  color-scheme: dark;
}}
:root[data-theme="dark"] {
  --bg: #0c0c0b; --bg-2: #141412; --surface: #151513; --surface-2: #1e1e1b;
  --border: rgba(255, 250, 235, .08); --border-strong: rgba(255, 250, 235, .16);
  --fg: #f3f1ea; --fg-muted: #b3b0a6; --fg-faint: #78766e;
  --solid: #f3f1ea; --on-solid: #0c0c0b;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px -16px rgba(0,0,0,.18);
  --si: #b9a3f8; --si-bg: rgba(185,163,248,.13);
  --bk: #f497bb; --bk-bg: rgba(244,151,187,.13);
  --qn: #f7aa6b; --qn-bg: rgba(247,170,107,.13);
  --bx: #efcf5a; --bx-bg: rgba(239,207,90,.12);
  --mh: #8eabff; --mh-bg: rgba(142,171,255,.13);
  --blue: #8eabff; --blue-bg: rgba(142,171,255,.13);
  --green: #74dc9d; --green-bg: rgba(116,220,157,.12);
  --violet: #b9a3f8; --violet-bg: rgba(185,163,248,.13);
  --amber: #f6c25c; --amber-bg: rgba(246,194,92,.12);
  --rose: #ff92b0; --rose-bg: rgba(255,146,176,.12);
  --gray: #b3b0a6; --gray-bg: rgba(255,250,235,.07);
  --race: #ff9b5e; --race-bg: rgba(255,155,94,.13);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); letter-spacing: -0.011em; -webkit-font-smoothing: antialiased; overflow-x: clip; transition: background-color .4s var(--ease), color .4s var(--ease); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 1001; background: var(--bg); }
::selection { background: var(--bk-bg); color: var(--fg); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--fg-muted); }
a { color: inherit; }
em { font-style: normal; color: var(--fg-muted); }
:focus-visible { outline: 2px solid var(--mh); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--solid); color: var(--on-solid); padding: 10px 14px; border-radius: var(--r-full); text-decoration: none; }
.skip:focus { top: 12px; }

/* Bloques de marca (distritos) */
.b-si { --c: var(--si); --cb: var(--si-bg); } .b-bk { --c: var(--bk); --cb: var(--bk-bg); }
.b-qn { --c: var(--qn); --cb: var(--qn-bg); } .b-bx { --c: var(--bx); --cb: var(--bx-bg); }
.b-mh { --c: var(--mh); --cb: var(--mh-bg); }

/* ---------- Header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1000; padding: 10px var(--gutter) 0; pointer-events: none; }
.top-in { pointer-events: auto; max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 16px; border-radius: var(--r-full); background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); border: 1px solid var(--border); box-shadow: var(--shadow); }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { text-decoration: none; color: var(--fg-muted); padding: 7px 13px; border-radius: var(--r-full); font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.nav a:hover { color: var(--fg); background: var(--surface-2); }
.nav a.on { color: var(--on-solid); background: var(--solid); }
.search { position: relative; flex: 1; max-width: 340px; min-width: 0; margin-left: auto; }
.search svg { position: absolute; left: 13px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); fill: none; stroke: var(--fg-faint); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; height: 38px; border-radius: var(--r-full); border: 1px solid transparent; background: var(--surface-2); color: var(--fg); font: inherit; font-size: 14px; padding: 0 38px 0 36px; transition: border-color .2s, box-shadow .2s, background .2s; }
.search input::placeholder { color: var(--fg-faint); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--mh); box-shadow: 0 0 0 4px var(--mh-bg); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 11px var(--mono); color: var(--fg-faint); border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 6px; }
.results { position: absolute; top: 48px; right: 0; width: min(440px, calc(100vw - 32px)); max-height: min(60vh, 460px); overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; }
.res { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; }
.res:hover, .res.sel { background: var(--surface-2); }
.res small { color: var(--fg-faint); font: 12px var(--mono); flex: none; min-width: 78px; }
.res mark { background: var(--bx-bg); color: inherit; border-radius: 4px; padding: 0 1px; }
.res-empty { padding: 12px; color: var(--fg-muted); }
.theme { position: relative; flex: none; }
.theme-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--r-full); background: var(--surface-2); color: var(--fg); cursor: pointer; }
.theme-btn:hover { background: var(--border-strong); }
.theme-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 1100; min-width: 160px; padding: 4px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.theme-menu[hidden] { display: none; }
.theme-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg-muted); font: 500 14px var(--font); text-align: left; cursor: pointer; }
.theme-menu button:hover { background: var(--surface-2); color: var(--fg); }
.theme-menu button[aria-checked="true"] { color: var(--fg); background: var(--surface-2); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(28px, 6vw, 72px) var(--gutter) 28px; overflow: hidden; }
.hero::before, .hero::after { content: none; }
.hero-in { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 14px var(--font); letter-spacing: -0.01em; color: var(--fg-muted); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--race); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--race) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.hero-title { margin: 0; font-size: clamp(40px, 6.2vw, 92px); line-height: .98; font-weight: 600; letter-spacing: -0.045em; text-wrap: balance; }
.hero-title em { color: var(--fg-muted); }
.count { display: flex; align-items: flex-end; gap: 18px 24px; flex-wrap: wrap; margin-top: clamp(20px, 3vw, 36px); }
.big { margin: 0; display: flex; align-items: baseline; gap: 10px; line-height: .9; }
.big .num { font: 600 clamp(56px, 7vw, 104px)/.85 var(--font); letter-spacing: -0.06em; font-variant-numeric: tabular-nums; color: var(--fg); }
.big .unit { font: 500 clamp(20px, 2.2vw, 28px)/1 var(--font); letter-spacing: -0.02em; color: var(--fg-muted); }
.sub { margin: 0 0 6px; color: var(--fg-muted); max-width: 30ch; font-size: 15px; }

.course { margin: 0; position: relative; display: grid; gap: 14px; justify-items: center; }
#courseSvg { width: 100%; max-width: 380px; height: auto; overflow: visible; }
#courseSvg .road { fill: none; stroke: var(--border); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
#courseSvg .line { fill: none; stroke: var(--fg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 3.2s .3s var(--ease) forwards; }
#courseSvg .runner { fill: var(--surface); stroke: var(--race); stroke-width: 3; opacity: 0; animation: appear .3s 3.4s forwards; }
#courseSvg .end { fill: var(--surface); stroke-width: 3; }
#courseSvg .lbl { font: 600 11px var(--mono); fill: var(--fg-muted); letter-spacing: .06em; text-transform: uppercase; }
#courseSvg .lbl-big { font: 500 15px var(--font); fill: var(--fg); letter-spacing: -0.01em; text-transform: none; }
#courseSvg .mile { font: 500 10px var(--mono); fill: var(--fg-faint); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
.boroughs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bo { font: 500 12px var(--font); padding: 4px 10px 4px 8px; border-radius: var(--r-full); background: var(--cb); color: var(--fg); display: inline-flex; align-items: center; gap: 6px; }
.bo::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }

.hero-foot { max-width: var(--maxw); margin: clamp(28px, 4vw, 48px) auto 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 16px; }
.now, .starts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.now h3, .starts h3, .tips-box h3 { margin: 0 0 2px 4px; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--fg-faint); }
.now-item { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); cursor: pointer; border: 1px solid transparent; color: inherit; font: inherit; text-align: left; width: 100%; transition: transform .3s var(--ease), border-color .2s; }
.now-item:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.now-item.live { background: var(--race-bg); border-color: color-mix(in srgb, var(--race) 35%, transparent); }
.now-item b { font-weight: 600; display: block; }
.now-item span { color: var(--fg-muted); font-size: 13px; }
.start-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.start-row .t { font: 600 22px var(--mono); letter-spacing: -0.03em; min-width: 66px; }
.start-row b { display: block; font-weight: 600; }
.start-row span { font-size: 13px; color: var(--fg-muted); }
.wave { width: 10px; align-self: stretch; border-radius: 6px; background: var(--c); flex: none; }

/* Marquesina */
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- Layout general ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 24px; display: grid; gap: clamp(64px, 9vw, 120px); }
.wrap { padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.banner { background: var(--amber-bg); border-radius: var(--r); padding: 12px 16px; font-size: 14px; margin-bottom: calc(-1 * clamp(40px, 6vw, 90px)); }
.block { display: grid; gap: 22px; min-width: 0; }
.sec-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: baseline; border-top: 1px solid var(--border-strong); padding-top: 18px; }
.sec-num { font-size: 13px; color: var(--fg-faint); grid-row: span 2; padding-top: 10px; }
.sec-head h2 { margin: 0; font-size: clamp(30px, 4vw, 52px); line-height: 1; letter-spacing: -0.04em; font-weight: 600; text-wrap: balance; }
.sec-head h2 em { color: var(--fg-muted); }
.sec-head p { margin: 6px 0 0; max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }

/* Revelado al hacer scroll (sólo con JS) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Tags y categorías ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: var(--r-full); white-space: nowrap; }
.tag.al { background: var(--rose-bg); color: var(--rose); }
.tag.ex { background: var(--amber-bg); color: var(--amber); }
.tag.op { background: var(--violet-bg); color: var(--violet); }
.c-vuelo { --c: var(--blue); --cb: var(--blue-bg); }
.c-carrera { --c: var(--race); --cb: var(--race-bg); }
.c-actividad { --c: var(--violet); --cb: var(--violet-bg); }
.c-comida { --c: var(--green); --cb: var(--green-bg); }
.c-traslado { --c: var(--gray); --cb: var(--gray-bg); }
.c-descanso { --c: var(--rose); --cb: var(--rose-bg); }
.tag.cat { background: var(--cb); color: var(--c); }

/* ---------- Itinerario: línea de tiempo + mapa ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.mapbox { position: sticky; top: 84px; }
.mapcard { overflow: hidden; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.map-head { padding: 10px; border-bottom: 1px solid var(--border); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-muted); font: 500 13px var(--font); padding: 6px 12px; border-radius: var(--r-full); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { color: var(--fg); border-color: var(--fg-faint); }
.chip[aria-pressed="true"] { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
#map { height: min(64vh, 600px); background: var(--surface-2); }
.mapcard.full { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; border: 0; border-radius: 0; box-shadow: none; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.mapcard.full #map { flex: 1; height: auto; min-height: 0; }
body.map-full { overflow: hidden; }
.map-fs-btn { display: grid !important; place-items: center; }
.map-fs-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-foot { margin: 0; padding: 12px 16px; font-size: 13px; color: var(--fg-muted); border-top: 1px solid var(--border); }
.pin { width: 28px; height: 28px; border-radius: 6px; background: var(--c); color: #fff; display: grid; place-items: center; font: 600 12px var(--mono); border: 2.5px solid var(--surface); box-shadow: 0 4px 12px rgba(0,0,0,.25); transition: transform .3s var(--ease); }
.pin.ico { position: relative; }
.pin.ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pin-n { position: absolute; top: -8px; right: -8px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--surface); color: var(--fg); font: 600 10px/16px var(--mono); text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.pin.hot { transform: scale(1.35) rotate(-6deg); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--fg); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { font: 14px/1.45 var(--font); margin: 12px 16px; }
.leaflet-container { font-family: var(--font); }
.leaflet-container a.leaflet-popup-close-button { color: var(--fg-faint); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--fg-faint) !important; border-radius: 8px 0 0 0; }
.leaflet-control-attribution a { color: var(--fg-muted) !important; }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-bar a { background: var(--surface); color: var(--fg); border-color: var(--border) !important; }

.timeline { display: grid; gap: 12px; min-width: 0; }
.day { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: box-shadow .3s var(--ease), border-color .3s; }
.day:hover { box-shadow: var(--shadow); }
.day.today { border-color: var(--race); }
.day.past { opacity: .7; }
.day > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 14px; }
.day > summary::-webkit-details-marker { display: none; }
.dnum { width: 58px; flex: none; text-align: center; border-radius: 8px; background: var(--surface-2); padding: 6px 0 7px; line-height: 1.05; }
.dnum b { display: block; font: 650 26px/1 var(--font); letter-spacing: -0.05em; }
.dnum small { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted); }
.day.race .dnum { background: var(--solid); color: var(--on-solid); }
.day.race .dnum small { color: inherit; opacity: .75; }
.day.today .dnum { background: var(--race); color: #fff; }
.day.today .dnum small { color: rgba(255,255,255,.9); }
.dtitle { flex: 1; min-width: 0; }
.dtitle b { display: block; font-weight: 600; font-size: 18px; letter-spacing: -0.025em; }
.dtitle span { color: var(--fg-muted); font-size: 13px; }
.chev { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--surface-2); stroke: var(--fg-muted); fill: none; stroke-width: 2; transition: transform .4s var(--ease), background .2s; flex: none; }
.day[open] .chev { transform: rotate(180deg); }
.day > summary:hover .chev { background: var(--border-strong); }
.items { list-style: none; margin: 0; padding: 0 18px 16px 14px; position: relative; }
.items::before { content: ""; position: absolute; left: 42px; top: 6px; bottom: 24px; width: 2px; background: var(--border); border-radius: 2px; }
.item { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 16px; padding: 7px 0; }
.item .time { font: 500 13px var(--mono); color: var(--fg-muted); text-align: center; margin-top: 11px; align-self: start; background: var(--surface); position: relative; z-index: 1; padding: 2px 0; }
.item .time small { display: block; font-size: 10px; color: var(--fg-faint); letter-spacing: .06em; }
.item .dot { position: absolute; left: 24px; top: 38px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--surface); }
.ibody { background: var(--surface-2); border-radius: var(--r); padding: 12px 15px; cursor: pointer; border: 1px solid transparent; transition: border-color .2s, background .2s, transform .3s var(--ease); min-width: 0; position: relative; }
.ibody::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); opacity: .7; }
.ibody:hover { border-color: var(--border-strong); transform: translateX(3px); }
.ihead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ihead b { font-weight: 600; margin-right: auto; }
.ibody p { margin: 5px 0 0; color: var(--fg-muted); font-size: 14px; }
.ibody .where { font-size: 13px; color: var(--fg-faint); margin-top: 5px; }
.legsw { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--mc); vertical-align: middle; margin-right: 6px; }
.m-pie { --mc: var(--green); } .m-pie .legsw { border-top-style: dotted; }
.m-bici { --mc: var(--violet); } .m-bici .legsw { border-top-style: dashed; }
.m-metro { --mc: var(--blue); } .m-tren { --mc: var(--amber); } .m-bus { --mc: var(--rose); } .m-carrera { --mc: var(--race); } .m-carrera .legsw { border-top-style: dotted; }
.map-foot .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.ibody .where.how { color: var(--fg-muted); }
.item.done .ibody { opacity: .55; }
.item.live .ibody { background: var(--race-bg); border-color: color-mix(in srgb, var(--race) 50%, transparent); }
.item.live .time { color: var(--race); font-weight: 600; }
.item.live .dot { animation: pulse 2.2s var(--ease) infinite; background: var(--race); }
.item.alerta .ibody { background: var(--rose-bg); border-color: color-mix(in srgb, var(--rose) 40%, transparent); }
.item.flash .ibody { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--mh-bg); border-color: var(--mh); } 100% { box-shadow: none; } }
.nowline { display: flex; align-items: center; gap: 8px; margin: 4px 0 4px 34px; font: 600 11px var(--mono); color: var(--race); text-transform: uppercase; letter-spacing: .08em; }
.nowline::after { content: ""; flex: 1; height: 2px; background: var(--race); opacity: .5; border-radius: 2px; }
.nowline::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--race); margin-left: 3px; animation: pulse 2.2s var(--ease) infinite; }

/* ---------- Vuelos ---------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; align-items: start; }
.flight { padding: 20px; display: grid; gap: 14px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.flight > .fl-top b { font: 650 24px var(--font); letter-spacing: -0.04em; }
.fl-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fl-top b { font: 600 15px var(--mono); }
.fl-seg { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); }
.fl-route { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.fl-route .ap { font: 650 clamp(30px, 4vw, 40px)/1 var(--font); letter-spacing: -0.05em; }
.fl-route .tm { color: var(--fg-muted); font-size: 13px; margin-top: 4px; }
.fl-route .tm b { color: var(--fg); font-weight: 600; }
.fl-line { height: 2px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px); position: relative; }
.fl-line::after { content: "✈"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); color: var(--mh); background: var(--surface-2); padding: 0 8px; font-size: 16px; }
.fl-lay { font-size: 13px; color: var(--amber); background: var(--amber-bg); border-radius: var(--r-full); padding: 5px 14px; justify-self: center; text-align: center; }
.fl-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--fg-muted); }
.st { background: var(--gray-bg); color: var(--gray); }
.st.ok { background: var(--green-bg); color: var(--green); }
.st.warn { background: var(--amber-bg); color: var(--amber); }
.st.bad { background: var(--rose-bg); color: var(--rose); }
.fl-ck { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.fl-ck small { flex-basis: 100%; color: var(--fg-muted); font-size: 12.5px; }
.ck-btn { display: inline-flex; align-items: center; gap: 4px; font: 500 13px var(--font); padding: 7px 14px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), border-color .2s, color .2s; }
.ck-btn:hover { border-color: var(--mh); color: var(--mh); transform: translateY(-1px); }
.ck-btn.solid { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.ck-btn.solid:hover { color: var(--on-solid); }
.ck-all { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 14px 20px; border-radius: var(--r-lg); background: var(--mh-bg); color: var(--fg); font-size: 14px; }
.ck-link { display: inline-block; margin-top: 6px; font-size: 13.5px; font-weight: 500; color: var(--mh); text-decoration: none; }
.ck-link:hover { text-decoration: underline; }
.ck-code { font-size: 13px; color: var(--fg-muted); }
.ck-code b { color: var(--fg); font-weight: 600; }

/* ---------- Reservas ---------- */
.res-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.book-list { display: grid; gap: 10px; }
.book { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); transition: transform .3s var(--ease), box-shadow .3s; }
.book:hover { border-color: var(--border-strong); }
.book .by { font: 500 12px/1.35 var(--mono); color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; }
.book .by.soon { color: var(--race); }
.book .by.late { color: var(--rose); }
.book b { font-weight: 600; letter-spacing: -0.015em; }
.book p { margin: 3px 0 0; color: var(--fg-muted); font-size: 14px; }
.tips-box { position: sticky; top: 84px; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.tips { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; counter-reset: t; }
.tips li { counter-increment: t; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 10px 4px; font-size: 14px; border-top: 1px solid var(--border); }
.tips li:first-child { border-top: 0; }
.tips li::before { content: counter(t, decimal-leading-zero); font: 500 12px var(--mono); color: var(--fg-faint); padding-top: 2px; }

/* ---------- Grupo ---------- */
.crew { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.person { padding: 20px; display: grid; gap: 14px; border-radius: var(--r-xl); position: relative; overflow: hidden; transition: transform .4s var(--ease), box-shadow .3s; }
.person:hover { border-color: var(--border-strong); }
.person::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--av, var(--surface-2)); opacity: .14; }
.avatar { width: 56px; height: 56px; border-radius: 8px; display: grid; place-items: center; font: 650 20px var(--font); letter-spacing: -0.03em; color: #fff; flex: none; }
.person b { display: block; font-size: 20px; letter-spacing: -0.03em; }
.person span { color: var(--fg-muted); font-size: 13px; }

/* ---------- Footer ---------- */
.foot { max-width: var(--maxw); margin: clamp(48px, 8vw, 120px) auto 0; padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-strong); font-size: 13px; }


/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
}
@media (max-width: 920px) {
  .hero-in, .hero-foot { grid-template-columns: 1fr; }
  .course { order: -1; }
  #courseSvg { max-width: 260px; }
  .split, .res-grid { grid-template-columns: 1fr; }
  .mapbox { position: relative; top: 0; order: -1; }
  .tips-box { position: relative; top: 0; }
  #map { height: 320px; }
}
@media (max-width: 560px) {
  .top-in { padding-left: 12px; gap: 8px; }
  .search kbd { display: none; }
  .book { grid-template-columns: 1fr auto; }
  .book .by { grid-column: 1 / -1; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-num { grid-row: auto; padding-top: 0; }
  .items { padding-right: 12px; }
  .flight { padding: 14px; }
  .fl-seg { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  #courseSvg .line { stroke-dashoffset: 0; }
  #courseSvg .runner { opacity: 1; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Celular (iPhone 15 Pro: 393 × 852, Dynamic Island, Safari) ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { touch-action: manipulation; }
.tabbar { display: none; }
@media (max-width: 920px) {
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .top { padding-top: max(8px, env(safe-area-inset-top, 0px)); top: 0; }
  body::before { display: none; }
  .tabbar { display: flex; position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 24px)); justify-content: space-between; padding: 6px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: saturate(1.5) blur(20px); -webkit-backdrop-filter: saturate(1.5) blur(20px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .tabbar a { flex: 1; min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--fg-faint); font: 500 10.5px var(--font); letter-spacing: 0; border-radius: 8px; transition: background .25s, color .25s; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--fg); background: var(--surface-2); }
  .tabbar a.on svg { stroke: var(--race); }
  .search { max-width: none; }
  .results { top: 50px; left: auto; right: -46px; }
  .hero { padding-top: 22px; }
  .chip, .ck-btn { min-height: 38px; }
  .day > summary { min-height: 64px; }
}
@media (max-width: 560px) {
  .search input { font-size: 16px; height: 40px; } /* 16 px: Safari no hace zoom al enfocar */
  .results { position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; width: auto; max-height: 60svh; }
  .hero-title { font-size: clamp(36px, 10.5vw, 52px); }
  .big .num { font-size: clamp(64px, 20vw, 88px); }
  .now, .starts { padding: 12px; border-radius: var(--r-lg); }
  .marquee-track { font-size: 30px; }
  .sec-head h2 { font-size: clamp(28px, 8.5vw, 36px); }
  #map { height: 300px; }
  .fl-route .ap { font-size: 30px; }
  .crew { grid-template-columns: 1fr 1fr; gap: 10px; }
  .person { padding: 14px; gap: 10px; }
  .avatar { width: 44px; height: 44px; border-radius: 8px; font-size: 16px; }
  .person b { font-size: 16px; }
}
.split > *, .res-grid > *, .hero-in > *, .hero-foot > * { min-width: 0; }

/* ---------- ¿Quién sos? ---------- */
.me { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 4px; border-radius: var(--r-full); border: 0; background: var(--surface-2); color: var(--fg); font: 500 14px var(--font); cursor: pointer; flex: none; transition: background .2s; }
.me:hover { background: var(--border-strong); }
.me .avatar { width: 30px; height: 30px; border-radius: 50%; font-size: 12px; }
.avatar.all { background: var(--solid); color: var(--on-solid); }
.fl-who { margin-left: 8px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: var(--r-full); background: var(--mh-bg); color: var(--mh); white-space: nowrap; }
.who { border: 0; padding: 0; margin: auto; width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); border-radius: var(--r-xl); background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); }
.who::backdrop { background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.who[open] { animation: rise .6s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.who-in { padding: clamp(22px, 5vw, 36px); display: grid; gap: 14px; }
.who-in .eyebrow { justify-self: start; margin: 0; }
.who-in h2 { margin: 0; font-size: clamp(34px, 8vw, 48px); line-height: 1; letter-spacing: -0.045em; font-weight: 600; }

.who-in > p { margin: 0; }
.who-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 6px; }
.who-opt { display: grid; justify-items: start; gap: 2px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .3s var(--ease), border-color .2s; }
.who-opt:hover { border-color: var(--border-strong); }
.who-opt.on { border-color: var(--fg); }
.who-opt .avatar { width: 46px; height: 46px; border-radius: 8px; margin-bottom: 8px; font-size: 17px; }
.who-opt b { font-size: 20px; letter-spacing: -0.03em; }
.who-opt span:not(.avatar) { font-size: 13px; color: var(--fg-muted); }
.who-all { justify-self: center; border: 0; background: none; color: var(--fg-muted); font: 500 14px var(--font); padding: 10px 14px; border-radius: var(--r-full); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.who-all:hover { color: var(--fg); }

@media (max-width: 920px) {
  .course { order: 0; }
  .hero-in { gap: 8px; }
  #courseSvg { max-width: 300px; max-height: 300px; }
  .boroughs { display: none; }
}
@media (max-width: 560px) {
  .me { padding: 0 4px; }
  .me .me-n { display: none; }
  #courseSvg { max-width: 240px; max-height: 250px; }
}
.b-na { --c: var(--fg-faint); --cb: var(--surface-2); }

/* ---------- Detalle (modal; hoja desde abajo en celular) ---------- */
.ibody, .book, .person { cursor: pointer; }
.sheet { border: 1px solid var(--border); padding: 0; margin: auto; width: min(520px, calc(100vw - 32px)); max-height: min(80vh, 720px); border-radius: var(--r-xl); background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet[open] { animation: rise .35s var(--ease); }
.d-in { padding: 20px 22px 22px; display: grid; gap: 14px; }
.d-grab { display: none; }
.d-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.d-top h3 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 600; }
.d-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--fg-muted); font-size: 14px; cursor: pointer; }
.d-x:hover { color: var(--fg); }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.sheet dl { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.d-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.d-row dt { color: var(--fg-muted); }
.d-row dd { margin: 0; }
.d-note { margin: 0; font-size: 15px; line-height: 1.6; color: var(--fg); }
.d-acts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 12px 12px 0 0; border-bottom: 0; max-height: 88svh; }
  .sheet[open] { animation: slideup .35s var(--ease); }
  .d-in { padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .d-grab { display: block; justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin-bottom: 4px; }
  .d-row { grid-template-columns: 96px minmax(0, 1fr); }
  .d-acts .ck-btn { flex: 1 1 auto; justify-content: center; padding: 11px 14px; }
}
@keyframes slideup { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }

/* Costos estimados */
.costs { margin-top: 20px; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.costs-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.costs h3 { margin: 0; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--fg-faint); }
.costs-head .muted { font-size: 13px; }
.cost-g h4 { margin: 18px 0 2px; font: 600 13px var(--font); color: var(--fg-muted); }
.cost { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.cost b { font-weight: 500; font-size: 14px; }
.cost p { margin: 2px 0 0; font-size: 13px; color: var(--fg-muted); }
.cost > span { white-space: nowrap; font-size: 13px; padding-top: 1px; }
.cost.total { margin-top: 8px; border-top-color: var(--fg-faint); }
.cost.total b { font-weight: 600; }
.cost.total span { font-weight: 600; }

/* Aviso de versión nueva */
.upd { position: fixed; z-index: 1001; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-lg); background: var(--fg); color: var(--bg); font: 500 14px var(--font); box-shadow: 0 8px 30px rgba(0,0,0,.25); animation: upd-in .25s ease-out; }
.upd-go { border: 0; border-radius: var(--r-sm); padding: 7px 12px; background: var(--bg); color: var(--fg); font: 600 13px var(--font); cursor: pointer; }
.upd-x { border: 0; background: none; color: inherit; opacity: .6; font-size: 14px; padding: 6px; cursor: pointer; }
@keyframes upd-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
.cost .ck-link { display: inline-block; margin-top: 6px; }
#apps .cost > .ck-link { margin-top: 1px; white-space: nowrap; }
#apps .cost:first-child { margin-top: 10px; }
.d-links { display: grid; gap: 8px; margin: 14px 0 4px; }
.d-link { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-2, var(--surface)); }
.d-lh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.d-lh b { font-weight: 500; font-size: 14px; }
.d-lh .mono { font-size: 13px; white-space: nowrap; }
.d-link p { margin: 4px 0 0; font-size: 13px; color: var(--fg-muted); }

/* PDF: documento imprimible sólo con lo confirmado */
.pdf-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pdf-btn:disabled { opacity: .5; cursor: progress; }
.mapcard.full #map { height: auto; }

.leaflet-tooltip.hito-tip { padding: 2px 6px; font: 600 11px var(--font); }
.m-trote { --mc: var(--race); }
.ibody .where.how a.gmaps { color: var(--blue); text-decoration: none; white-space: nowrap; }
