/* BajaPe — estilos */
:root {
  --ink: #13223F;
  --ink-2: #33415C;
  --muted: #5E6B80;
  --paper: #EEF1F5;
  --card: #FFFFFF;
  --line: #D9DEE6;
  --signal: #FFC20E;
  --signal-ink: #13223F;
  --route: #0A8754;
  --alarm: #D93A26;
  --focus: #1F5FBF;
  --shadow: 0 1px 0 rgba(19, 34, 63, .06), 0 6px 18px -10px rgba(19, 34, 63, .35);
  --r-s: 10px; --r-m: 16px; --r-l: 26px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --tabh: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EAF0F8; --ink-2: #C3CDDC; --muted: #93A1B7; --paper: #0C1526; --card: #15223A;
    --line: #26354F; --signal-ink: #13223F; --route: #2BC78A; --alarm: #FF6A52; --focus: #8DB7FF;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #EAF0F8; --ink-2: #C3CDDC; --muted: #93A1B7; --paper: #0C1526; --card: #15223A;
  --line: #26354F; --signal-ink: #13223F; --route: #2BC78A; --alarm: #FF6A52; --focus: #8DB7FF;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--paper); color: var(--ink);
  font: 400 17px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--focus); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- estructura ---------- */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen {
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 28px);
  animation: in .22s ease-out;
}
.screen.full { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; min-height: 44px; }
.topbar h1 { font: 600 1.35rem/1.2 var(--font); margin: 0; flex: 1; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow); flex: none;
}

h2.sect { font: 600 1.05rem/1.3 var(--font); margin: 30px 0 10px; display: flex; align-items: baseline; justify-content: space-between; }
h2.sect small { font-weight: 400; color: var(--muted); font-size: .9rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ---------- inicio ---------- */
.hero { padding: 10px 0 4px; }
.hero h1 {
  font: 700 clamp(2.6rem, 11vw, 3.6rem)/.95 var(--cond); letter-spacing: -.01em; margin: 0 0 12px;
  text-wrap: balance;
}
.hero p { margin: 0; color: var(--ink-2); max-width: 34ch; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 1.05rem var(--cond); letter-spacing: .02em; margin-bottom: 22px; }
.brand svg { width: 26px; height: 26px; }

.searchbox {
  display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 0 8px 0 16px;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-m); min-height: 58px;
}
.searchbox input { flex: 1; border: 0; background: transparent; min-width: 0; height: 54px; font-size: 1.05rem; outline: none; }
.searchbox input::placeholder { color: var(--muted); }
.searchbox:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 60%, transparent); }

.active-banner {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0;
  background: var(--ink); color: var(--paper); border-radius: var(--r-m); padding: 14px 16px; margin-top: 18px;
}
.active-banner .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--signal); flex: none; animation: pulse 1.6s infinite; }
.active-banner b { display: block; }
.active-banner span { font-size: .92rem; opacity: .8; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 194, 14, .7); } 70% { box-shadow: 0 0 0 12px rgba(255, 194, 14, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 194, 14, 0); } }

/* líneas: cada fila parece la franja de una línea */
.lines { display: grid; gap: 10px; }
.linebtn {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 14px; align-items: center; width: 100%; text-align: left;
  background: var(--card); border: 0; border-radius: var(--r-m); padding: 14px 16px 14px 0; box-shadow: var(--shadow); overflow: hidden;
}
.linebtn .bar { align-self: stretch; background: var(--c); margin: -14px 0; }
.linebtn b { display: block; font-weight: 600; }
.linebtn span { color: var(--muted); font-size: .9rem; }
.linebtn .chev { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 8px; font-size: .95rem;
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* lugares en inicio: atajos horizontales */
.places { display: flex; gap: 10px; overflow-x: auto; padding: 2px 20px 8px; margin: 0 -20px; scroll-snap-type: x mandatory; }
.place {
  scroll-snap-align: start; flex: none; width: 132px; min-height: 104px; text-align: left; border: 0; border-radius: var(--r-m);
  background: var(--card); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
}
.place .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; }
.place b { display: block; font-weight: 600; margin-top: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place.add { border: 2px dashed var(--line); background: transparent; box-shadow: none; color: var(--muted); }
.place.add b { white-space: normal; }

/* tarjetas de transporte */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 104px; padding: 14px;
  border: 0; border-top: 5px solid var(--c); border-radius: var(--r-m); background: var(--card); box-shadow: var(--shadow);
}
.mode .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--paper); display: grid; place-items: center; margin-bottom: 8px; }
.mode b { font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.mode .sub { color: var(--muted); font-size: .85rem; line-height: 1.25; }
.mode:active { background: var(--paper); }

/* ---------- listas ---------- */
.list { background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 14px 16px; min-height: 60px; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .txt { flex: 1; min-width: 0; }
.row .txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .txt span { display: block; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; flex: none; }
.row .end { color: var(--muted); font-size: .9rem; flex: none; }
.row.static { cursor: default; }
button.row:active { background: var(--paper); }
.empty { padding: 26px 20px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--r-m); border: 2px dashed var(--line); }
.status { font-size: .8rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.status.arrived { background: color-mix(in srgb, var(--route) 18%, transparent); color: var(--route); }
.status.passed, .status.interrupted { background: color-mix(in srgb, var(--alarm) 15%, transparent); color: var(--alarm); }

/* ---------- diagrama de línea ---------- */
.diagram { position: relative; background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 8px 0; }
.diagram::before { content: ""; position: absolute; left: 33px; top: 30px; bottom: 30px; width: 6px; border-radius: 3px; background: var(--c); }
.stop {
  position: relative; display: flex; align-items: center; gap: 16px; width: 100%; border: 0; background: transparent;
  text-align: left; padding: 10px 16px 10px 24px; min-height: 52px;
}
.stop .node { width: 24px; height: 24px; border-radius: 50%; background: var(--card); border: 5px solid var(--c); flex: none; position: relative; z-index: 1; }
.stop .nm { flex: 1; font-weight: 500; }
.stop .tag { font-size: .8rem; color: var(--muted); }
.stop:active { background: var(--paper); }
.stop.term .node { width: 28px; height: 28px; margin-left: -2px; }
.stop.past { opacity: .45; }
.stop.cp .node { border-color: var(--signal); background: var(--signal); }
.stop.dest .node { background: var(--ink); border-color: var(--ink); width: 30px; height: 30px; margin-left: -3px; }
.stop.dest .nm { font-weight: 700; }
.dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }

/* ---------- formularios ---------- */
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-weight: 600; margin-bottom: 8px; }
.input, select.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line);
  background: var(--card); outline: none;
}
.input:focus { border-color: var(--ink); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  flex: 1 1 auto; min-height: 46px; padding: 8px 12px; border-radius: var(--r-s); border: 1.5px solid var(--line); background: var(--card);
  font-weight: 500;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.note { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }
.err { color: var(--alarm); font-size: .92rem; margin: 6px 0 0; min-height: 1em; }
.cpbox { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-s); background: var(--paper); }
.cpbox label { display: block; font-size: .9rem; font-weight: 600; margin: 8px 0 6px; }
.cpbox label:first-child { margin-top: 0; }

/* ---------- botones ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 12px 18px;
  border-radius: var(--r-m); border: 0; font-weight: 700; font-size: 1.08rem; letter-spacing: .01em;
}
.btn.primary { background: var(--signal); color: var(--signal-ink); box-shadow: 0 3px 0 #C99600; }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #C99600; }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); font-weight: 600; }
.btn.danger { background: transparent; color: var(--alarm); border: 1.5px solid color-mix(in srgb, var(--alarm) 40%, transparent); font-weight: 600; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn + .btn { margin-top: 10px; }
.linkbtn { border: 0; background: none; color: var(--focus); font-weight: 600; padding: 8px 0; min-height: 44px; }
.stack > * + * { margin-top: 10px; }

/* ---------- mapa ---------- */
.map { height: 240px; border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow); background: var(--line); position: relative; z-index: 0; }
.map.tall { height: calc(100vh - 230px); height: calc(100dvh - 230px); min-height: 320px; }
.leaflet-container { font: inherit; background: var(--line); }
.pin { width: 40px; height: 52px; }
.pin svg { width: 40px; height: 52px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #1F7AFF; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(31, 122, 255, .35); }
.st-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--c); }
.maptools { position: absolute; right: 10px; bottom: 26px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.maphint {
  position: absolute; left: 10px; right: 10px; top: 10px; z-index: 1000; background: var(--card); color: var(--ink);
  border-radius: var(--r-s); padding: 10px 12px; font-size: .95rem; box-shadow: var(--shadow); text-align: center;
}

/* ---------- viaje activo ---------- */
.trip-head { display: flex; align-items: center; gap: 10px; }
.trip-head .st { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.trip-head .st i { width: 10px; height: 10px; border-radius: 50%; background: var(--route); animation: pulse2 1.6s infinite; }
@keyframes pulse2 { 50% { opacity: .3; } }
.bignum { margin: 22px 0 4px; display: flex; align-items: baseline; gap: 8px; }
.bignum b { font: 700 clamp(5rem, 26vw, 8.5rem)/.85 var(--cond); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bignum span { font: 600 2rem var(--cond); color: var(--ink-2); }
.dest-name { font: 600 1.4rem/1.2 var(--font); margin: 0; }
.trip-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); font-size: .9rem; box-shadow: var(--shadow); }
.pill.warn { background: color-mix(in srgb, var(--alarm) 14%, var(--card)); color: var(--alarm); }
.pill.ok { color: var(--route); }
.progress { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 6px 0 18px; }
.progress i { display: block; height: 100%; background: var(--signal); border-radius: 6px; transition: width .6s ease; }
.banner { padding: 12px 14px; border-radius: var(--r-s); background: var(--card); border-left: 5px solid var(--signal); margin: 0 0 14px; font-size: .95rem; box-shadow: var(--shadow); }
.banner.warn { border-left-color: var(--alarm); }
.banner b { display: block; }
body.near .screen.trip { background: linear-gradient(var(--signal) 0, var(--signal) 4px, transparent 4px); }

/* aviso de llegada a pantalla completa */
.alarm-ov {
  position: fixed; inset: 0; z-index: 3000; background: var(--signal); color: #13223F;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 40px) 24px calc(env(safe-area-inset-bottom, 0px) + 28px);
  animation: flash 1s ease-in-out 3;
}
.alarm-ov.passed { background: #FF8A73; }
@keyframes flash { 50% { filter: brightness(1.12); } }
.alarm-ov h1 { font: 700 clamp(4.2rem, 22vw, 7.5rem)/.85 var(--cond); margin: 0 0 18px; letter-spacing: -.02em; }
.alarm-ov p { font-size: 1.25rem; margin: 0; max-width: 24ch; }
.alarm-ov .btn.dark { background: #13223F; color: #fff; min-height: 64px; font-size: 1.2rem; }
.alarm-ov .btn.ghost { border-color: rgba(19, 34, 63, .35); color: #13223F; }
.alarm-ov.passed h1 { font-size: clamp(3rem, 14vw, 5.5rem); line-height: .9; }
.alarm-ov svg.big { width: 88px; height: 88px; stroke: #13223F; stroke-width: 2.4; fill: none; margin-bottom: 18px; }

/* ---------- barra de pestañas ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabh); }
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
  color: var(--muted); font-size: .78rem; font-weight: 600; position: relative;
}
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--signal); }
.tabs .live { position: absolute; top: 10px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--signal); border: 2px solid var(--card); }
body.no-tabs .tabs { display: none; }

/* ---------- hoja inferior / diálogo ---------- */
.scrim { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 14, 28, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--card); color: var(--ink);
  border-radius: var(--r-l) var(--r-l) 0 0; padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet h2 { font: 700 1.6rem/1.15 var(--cond); margin: 0 0 8px; }
.sheet p { margin: 0 0 18px; color: var(--ink-2); }
.sheet .privacy p { margin: 0 0 12px; }
@media (min-width: 600px) { .scrim { align-items: center; } .sheet { border-radius: var(--r-l); } }

/* ---------- onboarding ---------- */
.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px calc(env(safe-area-inset-bottom, 0px) + 28px); }
.ob .art { height: 210px; display: grid; place-items: center; }
.ob h1 { font: 700 clamp(2.4rem, 10vw, 3.2rem)/.95 var(--cond); margin: 0 0 14px; }
.ob p { color: var(--ink-2); font-size: 1.08rem; margin: 0; max-width: 34ch; }
.dots { display: flex; gap: 6px; margin: 22px 0; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s; }
.dots i.on { width: 26px; background: var(--ink); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 2500; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r-s);
  display: flex; gap: 16px; align-items: center; max-width: calc(100% - 32px); width: max-content; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5);
  animation: up .2s;
}
.toast button { border: 0; background: none; color: var(--signal); font-weight: 700; padding: 6px 0; }
body.no-tabs .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loadrow { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--muted); }

.profile-card { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--r-m); padding: 16px; box-shadow: var(--shadow); }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--signal); color: #13223F; display: grid; place-items: center; font: 700 1.5rem var(--cond); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); min-height: 60px; }
.prow:first-child { border-top: 0; }
.prow > div { min-width: 0; }
.prow b { font-weight: 600; display: block; }
.prow small { color: var(--muted); display: block; }
.prow select { min-height: 42px; border-radius: var(--r-s); border: 1.5px solid var(--line); background: var(--card); padding: 6px 10px; max-width: 52%; }
.prow .linkbtn { white-space: nowrap; }
.prow .blk { padding: 0; }
.prow.col { display: block; }

@media (prefers-reduced-motion: reduce) {
  .screen, .sheet, .scrim, .toast { animation: none; }
  .alarm-ov { animation: none; }
}

/* preguntas frecuentes y pie */
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--muted); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 18px 18px; color: var(--ink-2); }
.sitefoot { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }
.sitefoot a { color: var(--muted); }
.prerender h1 { font: 700 2.2rem/1.05 var(--cond); }
.prerender h2 { font-size: 1.1rem; margin: 1.4em 0 .4em; }
.prerender h3 { font-size: 1rem; margin: 1em 0 .2em; }

/* mapa en modo oscuro (OpenStreetMap no tiene versión oscura) */
.map-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.55); }
textarea.input { resize: vertical; min-height: 96px; font: inherit; }

/* controles del mapa: ampliar, acercar, alejar */
.map-ctl { display: flex; flex-direction: column; gap: 8px; }
.map-btn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--card); color: var(--ink); display: grid; place-items: center;
  font: 600 26px/1 var(--font); box-shadow: 0 2px 8px rgba(0, 0, 0, .28); cursor: pointer; }
.map-btn svg { width: 22px; height: 22px; }
.map-btn:active { background: var(--paper); }
.map.map-full { position: fixed; inset: 0; z-index: 2400; height: 100vh !important; height: 100dvh !important; border-radius: 0; box-shadow: none; }
.map-full .leaflet-top { padding-top: env(safe-area-inset-top, 0px); }
.map-full .leaflet-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }
body.map-open { overflow: hidden; }
body.map-open .tabs { display: none; }
.maphint { right: 64px !important; }
/* etiqueta de mapa (obligatoria por licencia): pequeña y discreta */
.leaflet-container .leaflet-control-attribution { font-size: 10px; line-height: 1.5; padding: 0 6px; border-radius: 8px 0 0 0;
  background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--muted); }
.leaflet-container .leaflet-control-attribution a { color: var(--muted); text-decoration: none; }

/* modo ahorro de batería */
.saver-ov { position: fixed; inset: 0; z-index: 2800; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; cursor: pointer; }
.saver-ov b { font: 700 4rem/1 var(--cond); color: #5a5a5a; }
.saver-ov span { font-size: .95rem; color: #444; max-width: 26ch; }

/* ===== Rediseño 2.1 ===== */
.tile { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.tile svg { width: 22px; height: 22px; }
.tile.y { background: #FFF3D1; color: #C98A00; } .tile.b { background: #E3EDFF; color: #1F5FBF; } .tile.r { background: #FFE6E3; color: #D93A26; }
.tile.gr { background: #DFF5EA; color: #0A8754; } .tile.p { background: #EEE6FB; color: #7A3FA6; } .tile.g0 { background: var(--paper); color: var(--muted); }
:root[data-theme="dark"] .tile:not(.g0) { filter: saturate(.9) brightness(.85); }
.prow .grow { flex: 1; min-width: 0; } .prow { justify-content: flex-start; } .prow > select, .prow > .linkbtn, .prow > .pill-btn { margin-left: auto; }
.prow .grow small { display: block; }
.sect-row { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 10px; } .sect-row .sect { margin: 0; }
.see-all { font-weight: 600; text-decoration: none; color: var(--focus); }
.sect-sub { margin: -6px 0 12px; color: var(--muted); font-size: .95rem; }
.page-title { font: 700 2.6rem/1 var(--cond); margin: 6px 0 18px; }
.screen.profile { background: radial-gradient(260px 200px at 108% -4%, rgba(255, 194, 14, .22), transparent 70%); }
.pill-btn { border: 0; background: #E3EDFF; color: #1F5FBF; font-weight: 700; padding: 10px 14px; border-radius: 12px; }
.pad-row { padding: 0 14px 14px; }
.danger-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 14px; padding: 16px; background: #FFE9E6; color: #D93A26; font-weight: 700; text-align: left; }
.danger-row span { flex: 1; }
/* franja superior azul */
.screen.banded { padding: 0 0 calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 28px); }
.screen.banded.full { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); }
.band { position: relative; overflow: hidden; color: #fff; background-color: #13223F;
  background-image: repeating-linear-gradient(35deg, rgba(255,255,255,.05) 0 2px, transparent 2px 46px), repeating-linear-gradient(-55deg, rgba(255,255,255,.04) 0 2px, transparent 2px 60px);
  padding: calc(env(safe-area-inset-top, 0px) + 26px) 20px 58px; min-height: 190px; }
.band-txt { position: relative; z-index: 1; max-width: 66%; }
.band h1 { font: 700 2.15rem/1.05 var(--cond); margin: 0 0 8px; } .band p { margin: 0; opacity: .85; font-size: .98rem; }
.band-back { margin-bottom: 16px; position: relative; z-index: 1; }
.band-art { position: absolute; right: 8px; bottom: 26px; width: 42%; max-width: 190px; }
.band-art svg { width: 100%; height: auto; display: block; }
.band-body { position: relative; margin-top: -30px; background: var(--paper); border-radius: 28px 28px 0 0; padding: 22px 20px 0; }
.empty-card { background: var(--card); border-radius: 22px; padding: 18px 18px 22px; text-align: center; box-shadow: var(--shadow); }
.empty-card .art-big { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto 4px; }
.empty-card h2 { font: 700 1.45rem/1.2 var(--font); margin: 6px 0 8px; } .empty-card p { color: var(--muted); margin: 0 0 18px; }
.empty-card .btn { border-radius: 999px; max-width: 360px; margin: 0 auto; }
.info-box { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: #E3EDFF; color: #1F4EA8; font-size: .93rem; text-align: left; }
.info-box svg { flex: none; width: 22px; height: 22px; }
:root[data-theme="dark"] .info-box { background: #1B2D50; color: #BFD4F5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .info-box { background: #1B2D50; color: #BFD4F5; } }
.examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ex { border: 0; background: var(--card); border-radius: 18px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: var(--shadow); font-weight: 600; }
.ex .tile { width: 54px; height: 54px; border-radius: 50%; }
.quick2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.qcard { border: 1.5px solid #D6E3FA; background: #F4F8FF; border-radius: 18px; padding: 14px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; text-align: left; align-items: center; }
.qcard .tile { grid-row: span 2; } .qcard b { font-size: .98rem; } .qcard span:last-child { font-size: .85rem; color: var(--muted); }
:root[data-theme="dark"] .qcard { background: var(--card); border-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qcard { background: var(--card); border-color: var(--line); } }
.row-card { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; border: 0; background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); text-align: left; color: var(--ink); }
.row-card b { flex: 1; } .row-card > svg:first-child { color: #1F5FBF; }
.row.wrap .txt span { white-space: normal; }
.loadrow svg { width: 20px; height: 20px; }
/* inicio */
.home-hero { position: relative; margin: 0 -20px; padding: 0 20px 6px; min-height: 230px; }
.hero-art { position: absolute; right: 0; top: -18px; width: 64%; max-width: 330px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 34%); mask-image: linear-gradient(90deg, transparent, #000 34%); }
.hero-art svg { width: 100%; height: auto; display: block; }
.home-hero .brand, .home-hero .hero { position: relative; z-index: 1; } .home-hero .hero h1, .home-hero .hero p { max-width: 62%; }
:root[data-theme="dark"] .hero-art { opacity: .45; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-art { opacity: .45; } }
.searchbox.pill { border: 0; border-radius: 999px; box-shadow: 0 6px 24px -10px rgba(19, 34, 63, .45); padding-left: 20px; }
.iconbtn.flat { box-shadow: none; background: transparent; }
.place { position: relative; width: 150px; cursor: pointer; }
.place .tile { width: 46px; height: 46px; border-radius: 50%; }
.place small { display: block; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kebab { position: absolute; top: 6px; right: 4px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.kebab svg { width: 18px; height: 18px; fill: currentColor; }
.mode { position: relative; min-height: 118px; padding: 14px 14px 16px; }
.mode .mic { width: 46px; height: 46px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; margin-bottom: 10px; }
.mode .chev { position: absolute; right: 12px; bottom: 16px; color: var(--muted); }
.cta-row { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 14px; border: 0; border-radius: 18px; padding: 16px; background: #E3EDFF; color: var(--ink); text-align: left; }
.cta-row div { flex: 1; } .cta-row b { display: block; } .cta-row span { font-size: .9rem; color: var(--ink-2); }
:root[data-theme="dark"] .cta-row { background: #1B2D50; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta-row { background: #1B2D50; } }
/* pestañas: activa en amarillo */
.tabs a[aria-current="page"] svg { color: #F2A900; }
/* ajustes 2.1 */
.mode { padding-right: 30px; } .mode b, .mode .sub { display: block; overflow-wrap: anywhere; }
.home-hero .hero h1 { font-size: clamp(2.3rem, 9.6vw, 3.2rem); max-width: 60%; }
.hero-art { width: 54%; top: 34px; }
.profile-card b, .prow .grow b { overflow-wrap: anywhere; }
.prow > select { flex: none; max-width: 40%; }
.mode b { font-size: 1rem; overflow-wrap: break-word; } .mode .sub { overflow-wrap: break-word; }
.prow .grow b.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }

/* ===== Inicio: igual a la maqueta ===== */
.screen.home { background: #F3F6FB; padding-top: calc(env(safe-area-inset-top, 0px) + 16px); }
:root[data-theme="dark"] .screen.home { background: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .screen.home { background: transparent; } }
.home-hero { position: relative; margin: 0 -20px; padding: 0 20px; min-height: 262px; }
.hero-img { position: absolute; right: 0; top: calc(-16px - env(safe-area-inset-top, 0px)); width: 58%; max-width: 300px; height: auto; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 36%), linear-gradient(to bottom, #000 68%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent 0, #000 36%), linear-gradient(to bottom, #000 68%, transparent 100%); mask-composite: intersect; }
:root[data-theme="dark"] .hero-img { opacity: .5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-img { opacity: .5; } }
.home-hero .brand { position: relative; z-index: 1; margin-bottom: 18px; font-size: 1.1rem; }
.home-hero .hero { position: relative; z-index: 1; }
.home-hero .hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); line-height: .98; max-width: 64%; margin-bottom: 12px; }
.home-hero .hero p { max-width: 60%; font-size: .98rem; line-height: 1.35; }
.searchbox.pill { position: relative; z-index: 2; margin-top: -4px; min-height: 56px; }
.places { gap: 9px; }
.place { width: 108px; min-height: 104px; padding: 12px 10px 10px; border-radius: 16px; gap: 0; justify-content: flex-start; }
.place .pic { width: 44px; height: 44px; display: block; margin-bottom: 8px; }
.place .tile.round { width: 44px; height: 44px; margin-bottom: 8px; }
.place b { margin: 0; font-size: .95rem; line-height: 1.15; }
.place small { margin-top: 2px; }
.place.add { width: 90px; justify-content: center; border: 1.5px dashed #C9D3E2; background: transparent; }
.place.add .plus { color: var(--ink-2); margin-bottom: 8px; display: block; } .place.add b { font-size: .92rem; color: var(--muted); font-weight: 500; }
.tile.round { border-radius: 50%; }
.modes { gap: 10px; }
.mode { min-height: 108px; padding: 14px 14px 14px; border-radius: 20px; border-top-width: 4px; overflow: hidden;
  background: var(--card) url(/img/bus-mark.png) no-repeat right -4px top 6px / 128px auto; }
.mode .mpic { width: 44px; height: 44px; display: block; margin-bottom: 10px; }
.mode b { font-size: 1.05rem; } .mode .sub { font-size: .85rem; }
.mode .chev { right: 12px; bottom: 14px; color: var(--ink); }
.more-tp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.more-tp > span { width: 100%; font-size: .85rem; color: var(--muted); font-weight: 600; }
.more-tp .chip svg { width: 18px; height: 18px; }
.cta-row { background: #DCE9FB; border-radius: 18px; padding: 16px 16px; margin-top: 16px; }
.cta-row .tile.round { width: 48px; height: 48px; background: rgba(255,255,255,.75); color: #1F5FBF; }
/* ajuste fino Inicio */
.home-hero { min-height: 214px; }
.home-hero .brand { margin-bottom: 14px; }
.home-hero .hero h1 { font-size: clamp(2rem, 8.4vw, 2.7rem); max-width: 72%; margin-bottom: 8px; }
.home-hero .hero p { max-width: 74%; font-size: .92rem; line-height: 1.32; color: var(--ink-2); }
.hero-img { width: 56%; }
.searchbox.pill { margin-top: 2px; min-height: 54px; }
.screen.home .sect-row, .screen.home h2.sect { margin: 20px 0 10px; } .screen.home .sect-row .sect { margin: 0; }
.place { width: 92px; min-height: 100px; padding: 11px 8px 9px; border-radius: 15px; }
.place b { font-size: .86rem; } .place small { font-size: .74rem; }
.place .pic, .place .tile.round { width: 40px; height: 40px; margin-bottom: 7px; }
.place.add { width: 78px; } .place.add b { font-size: .84rem; }
.kebab { top: 4px; right: 0; width: 28px; height: 28px; }
.places { gap: 8px; padding-right: 20px; }
.mode { background: var(--card); min-height: 104px; padding: 12px 12px 12px; }
.mode::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background: url(/img/bus-mark.png) no-repeat right -6px top 4px / 118px auto; }
.mode > * { position: relative; z-index: 1; } .mode > .chev { position: absolute; }
.mode b { font-size: 1rem; }
:root[data-theme="dark"] .mode::before { opacity: .18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mode::before { opacity: .18; } }
:root[data-theme="dark"] .hero-img { opacity: .4; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 58%), linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 58%), linear-gradient(to bottom, #000 62%, transparent 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-img { opacity: .4; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 58%), linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 58%), linear-gradient(to bottom, #000 62%, transparent 100%); } }

/* retoques finales Inicio */
.home-hero { min-height: 204px; }
.home-hero .hero h1 { font-size: clamp(2rem, 9.4vw, 2.9rem); max-width: 56%; line-height: .96; }
.home-hero .hero p { max-width: 70%; font-size: .86rem; }
.hero-img { width: 50%; max-width: 270px; }
:root[data-theme="dark"] .hero-img { opacity: .5; -webkit-mask-composite: source-over; mask-composite: add;
  -webkit-mask-image: radial-gradient(ellipse 85% 80% at 62% 38%, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse 85% 80% at 62% 38%, #000 30%, transparent 78%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-img { opacity: .5; -webkit-mask-composite: source-over; mask-composite: add;
  -webkit-mask-image: radial-gradient(ellipse 85% 80% at 62% 38%, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse 85% 80% at 62% 38%, #000 30%, transparent 78%); } }
.home-hero .hero h1 { max-width: 66%; }

/* Inicio: texto siempre visible, barra a lo ancho */
.home-hero { isolation: isolate; min-height: 196px; }
.hero-img { z-index: -1 !important; width: 52% !important; max-width: 290px; -webkit-mask-image: none !important; mask-image: none !important; }
:root[data-theme="dark"] .hero-img { opacity: .55; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-img { opacity: .55; } }
.home-hero .brand, .home-hero .hero { z-index: 3; }
.home-hero .hero h1 { font-size: clamp(2.1rem, 9.8vw, 2.75rem); max-width: none; white-space: nowrap; margin-bottom: 10px; }
.home-hero .hero p { max-width: none; font-size: .86rem; line-height: 1.35; color: var(--ink-2); }
.home-hero .hero p span { display: block; }
html[lang^="es"] .home-hero .hero p span { white-space: nowrap; }
.searchbox.pill { display: flex; width: 100%; padding: 0 8px 0 20px; font-size: 1rem; gap: 10px; }
.places { scroll-padding-left: 20px; scroll-padding-right: 20px; }

/* ===== Lugares: igual a la maqueta ===== */
.screen.lugares .band { min-height: 178px; padding-bottom: 54px; }
.screen.lugares .band-txt { max-width: 60%; } .screen.lugares .band h1 { font-size: 2.45rem; }
.screen.lugares .band p { font-size: .95rem; line-height: 1.35; opacity: .88; }
.band-art.flush { right: 0; bottom: 0; top: 0; width: 55%; max-width: 250px; display: flex; }
.band-art.flush img { width: 100%; height: 100%; object-fit: cover; object-position: left center; display: block; }
.screen.lugares .band-body { background: #F3F6FB; margin-top: -28px; padding-top: 20px; }
:root[data-theme="dark"] .screen.lugares .band-body { background: var(--paper); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .screen.lugares .band-body { background: var(--paper); } }
.empty-card.light { background: #F8FBFF; border: 1px solid #E4ECF7; box-shadow: none; padding: 14px 18px 22px; }
.empty-card.light .ill { display: block; width: 100%; max-width: 330px; height: auto; margin: 0 auto 2px; mix-blend-mode: multiply; }
.empty-card.light h2 { color: #13223F; font: 700 1.4rem/1.2 var(--font); margin: 4px 0 8px; } .empty-card.light p { color: #5E6B80; }
.btn.primary.round { border-radius: 999px; box-shadow: 0 12px 24px -10px rgba(255, 194, 14, .85); }
.examples { gap: 10px; } .ex { border-radius: 18px; padding: 16px 6px 14px; gap: 8px; }
.ex img { width: 56px; height: 56px; display: block; }
.info-box svg.ifill { width: 26px; height: 26px; }

/* Lugares: ajuste fino */
.band-art.flush { top: 6px; bottom: auto; width: 46%; max-width: 190px; display: block; }
.band-art.flush img { width: 100%; height: auto; object-fit: initial; }
.screen.lugares { background: #F3F6FB; min-height: 100vh; }
:root[data-theme="dark"] .screen.lugares { background: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .screen.lugares { background: transparent; } }
.screen.lugares .band-txt { max-width: 64%; } .screen.lugares .band h1 { font-size: 2.35rem; }
.screen.lugares .band p { font-size: .92rem; }
.empty-card.light .ill { mix-blend-mode: normal; max-width: 320px; }
.empty-card.light h2 { font-size: 1.28rem; white-space: nowrap; } .empty-card.light p { font-size: .92rem; line-height: 1.4; margin-bottom: 16px; }
.empty-card.light .btn { min-height: 52px; font-size: 1.02rem; }
.band-art.flush { width: 40%; max-width: 160px; top: 10px; }

.sos-sirsel{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0 8px}.sos-sirsel select{flex:1;max-width:60%;padding:8px;border-radius:10px;border:1px solid var(--line,#ccd);background:var(--card,#fff);color:inherit;font:inherit}

/* Accesibilidad: tamaño de texto y alto contraste */
html[data-text="large"] { font-size: 112.5%; }
html[data-text="xl"] { font-size: 125%; }
:root[data-contrast="high"] { --muted: #2B364C; --ink-2: #13223F; --line: #7B879B; }
@media (prefers-color-scheme: dark) { :root[data-contrast="high"]:not([data-theme="light"]) { --muted: #D5DEEB; --ink-2: #EAF0F8; --line: #6F82A3; } }
:root[data-theme="dark"][data-contrast="high"] { --muted: #D5DEEB; --ink-2: #EAF0F8; --line: #6F82A3; }
