@font-face { font-family: 'Unbounded'; src: url(../fonts/Unbounded.woff2) format('woff2'); font-weight: 200 900; font-display: swap; }
@font-face { font-family: 'Azeret Mono'; src: url(../fonts/AzeretMono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url(../fonts/InstrumentSans.woff2) format('woff2'); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }

:root {
  /* Madrid hoy family, dark only. Four views, one type system: Unbounded shouts, Azeret Mono counts, Instrument Sans talks.
     Status colours (verde, ambar, rojo) only for status; hielo is the accent for selection and for what moves. */
  --ink: #0A0A0A; --panel: #141413; --line: #2A2A28; --paper: #F5F5F0; --mute: #8A8A82;
  --hielo: #8FD3FF; --verde: #5BE38A; --ambar: #FFB547; --rojo: #FF5A5F; --tren: #FFD27A;
  --shout: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --count: 'Azeret Mono', ui-monospace, Menlo, monospace;
  --talk: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --top: max(14px, env(safe-area-inset-top));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--talk); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--hielo); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--hielo); outline-offset: 2px; }

/* Shell */
.bar { position: fixed; z-index: 2000; top: var(--top); left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { font-family: var(--shout); font-weight: 900; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; color: var(--paper); text-decoration: none; background: rgba(10,10,10,.72); backdrop-filter: blur(8px); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 16px; }
.views { display: flex; gap: 4px; background: rgba(10,10,10,.72); backdrop-filter: blur(8px); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px; }
.views a { text-decoration: none; color: var(--mute); font-size: 14px; font-weight: 600; border-radius: 999px; padding: 8px 15px; }
.views a:hover { color: var(--paper); }
.views a[aria-current="page"] { color: var(--ink); background: var(--paper); }
.bar-right { display: flex; gap: 8px; align-items: center; }
.views.meta { align-items: center; }
.views.meta a, .views.meta button { display: inline-flex; align-items: center; height: 34px; line-height: 1; box-sizing: border-box; font: 600 13px/1 var(--count); letter-spacing: .04em; color: var(--mute); background: none; border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer; text-decoration: none; }
.views.meta a:hover, .views.meta button:hover { color: var(--paper); }
.cities { display: flex; align-items: center; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1.5px solid var(--line); }
.views.meta .cities a[aria-current="page"] { color: var(--ink); background: var(--paper); cursor: default; }
.live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--count); font-size: 12px; color: var(--mute); letter-spacing: .06em; text-transform: uppercase; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); }
.live.on i { background: var(--verde); box-shadow: 0 0 0 4px rgba(91,227,138,.18); }
@media (max-width: 720px) {
  .bar { flex-direction: column; align-items: stretch; }
  .brand { align-self: flex-start; font-size: 13px; padding: 8px 13px; }
  .views a { flex: 1; text-align: center; padding: 8px 6px; font-size: 13px; }
  .bar-right { align-items: stretch; }
  .bar-right > .views:first-child { flex: 1; }
}
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 1240px; margin: 0 auto; padding: calc(var(--top) + 74px) clamp(16px, 3vw, 32px) 48px; display: grid; gap: 14px; }
@media (max-width: 720px) { .wrap { padding-top: calc(var(--top) + 116px); } }
.card { background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px; min-width: 0; }
h2 { font-family: var(--shout); font-weight: 700; font-size: 15px; margin: 0; letter-spacing: .01em; text-wrap: balance; }
.note { font-size: 13px; color: var(--mute); margin: 6px 0 12px; max-width: 72ch; line-height: 1.45; }
.pill { display: inline-block; font-family: var(--count); font-weight: 600; font-size: 12px; padding: 2px 7px; border-radius: 6px; color: var(--ink); white-space: nowrap; }

/* Pulso */
#pulso canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pulso-veil { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(10,10,10,.94) 0, rgba(10,10,10,.62) 30%, rgba(10,10,10,0) 55%); }
.pulso-text { position: absolute; left: clamp(18px, 5vw, 64px); bottom: max(40px, env(safe-area-inset-bottom)); width: min(660px, calc(100% - 36px)); display: grid; gap: 16px; }
.eyebrow { font-family: var(--count); font-size: 13px; letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.giant { font-family: var(--shout); font-weight: 900; font-size: clamp(84px, 13vw, 176px); line-height: .82; letter-spacing: -.045em; color: var(--verde); font-variant-numeric: tabular-nums; }
.pulso-text p { margin: 0; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.25; max-width: 30ch; text-wrap: balance; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { display: inline-flex; align-items: baseline; gap: 8px; background: rgba(20,20,19,.85); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; color: var(--mute); text-decoration: none; }
.fact b { font-family: var(--count); font-weight: 600; color: var(--paper); }
.fact.cut b { color: var(--rojo); }
.fact.train b { color: var(--tren); }
.fact:hover { border-color: var(--hielo); }
.pulso-legend { position: absolute; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; gap: 14px; font-size: 12px; color: var(--mute); }
.pulso-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pulso-legend i { width: 9px; height: 9px; border-radius: 50%; }
@media (max-width: 720px) {
  .pulso-veil { background: linear-gradient(0deg, rgba(10,10,10,.96) 0, rgba(10,10,10,.75) 38%, rgba(10,10,10,0) 62%); }
  .pulso-legend { display: none; }
}

.pulso-tip { z-index: 5; max-width: 280px; white-space: normal; }
#pulsoCanvas { cursor: crosshair; touch-action: none; }
#pulsoCanvas:active { cursor: grabbing; }
.pulso-side { position: absolute; right: 20px; top: calc(var(--top) + 70px); width: 300px; display: grid; gap: 10px; }
.ticker { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ticker li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.3; background: rgba(20,20,19,.82); border: 1.5px solid var(--line); border-left-width: 1.5px; border-radius: 12px; padding: 8px 10px; }
.ticker li.wait { grid-template-columns: 1fr; color: var(--mute); }
.ticker time { font-family: var(--count); font-size: 11px; color: var(--mute); }
.ticker li.bike span::before, .ticker li.bikeout span::before, .ticker li.train span::before, .ticker li.cut span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.ticker li.bike span::before { background: var(--verde); }
.ticker li.bikeout span::before { background: var(--ambar); }
.ticker li.train span::before { background: var(--tren); }
.ticker li.cut span::before { background: var(--rojo); }
.ticker li.fresh { border-color: var(--hielo); animation: arrive .6s cubic-bezier(.2,.8,.2,1); }
@keyframes arrive { from { transform: translateY(-8px); opacity: 0; } }
.pulso-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--mute); }
.pulso-tools button { white-space: nowrap; font-size: 12px; background: rgba(20,20,19,.9); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
@media (max-width: 720px) { .pulso-side { left: 16px; right: 16px; width: auto; top: calc(var(--top) + 112px); } .ticker li:nth-child(n+3) { display: none; } .pulso-tools span { display: none; } }

/* Líneas: the departure board */
.board-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--line); padding-bottom: 18px; }
.board-head h1 { font-family: var(--shout); font-weight: 900; font-size: clamp(30px, 5vw, 60px); line-height: .9; margin: 0; letter-spacing: -.02em; }
.board-head p { margin: 8px 0 0; color: var(--mute); max-width: 56ch; }
.flaps { display: inline-flex; gap: 3px; }
.flap { width: 24px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-family: var(--count); font-weight: 600; font-size: 18px;
  background: linear-gradient(#1D1D1B 0 49%, #0A0A0A 49% 51%, #232321 51% 100%); color: var(--verde); }
.clock .flap { width: clamp(38px, 5vw, 58px); height: clamp(54px, 7vw, 82px); font-size: clamp(34px, 4.6vw, 60px); color: var(--paper); border-radius: 8px; }
.board { display: grid; gap: 4px; }
.group-title { font-family: var(--count); font-size: 12px; letter-spacing: .14em; color: var(--mute); text-transform: uppercase; margin: 18px 0 6px; }
.row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto 150px; gap: 14px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1.5px solid transparent; background: none; cursor: pointer; text-align: left; width: 100%; }
.row:hover { border-color: var(--line); background: var(--panel); }
.chip { height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--shout); font-weight: 900; font-size: 16px; }
.route { font-size: 14px; color: #C9C6BD; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route small { display: block; color: var(--mute); font-size: 12px; }
.health { display: flex; align-items: center; gap: 8px; font-family: var(--count); font-size: 12px; color: var(--mute); }
.health .bar30 { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.health .bar30 span { display: block; height: 100%; border-radius: 3px; }
.dots { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 150px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--tren); }
@media (max-width: 860px) {
  .row { grid-template-columns: 52px minmax(0, 1fr); row-gap: 6px; }
  .row .flaps, .row .health { grid-column: 2; }
  .flap { width: 19px; height: 28px; font-size: 15px; }
}

/* Mapa */
#map { position: absolute; inset: 0; background: var(--ink); }
.leaflet-container { background: var(--ink); font-family: var(--talk); }
.dark-tiles { filter: invert(1) hue-rotate(180deg) grayscale(.85) brightness(.62) contrast(1.15); }
.leaflet-control-attribution { background: rgba(10,10,10,.7) !important; color: var(--mute) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--mute) !important; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--paper) !important; border-color: var(--line) !important; }
.leaflet-tooltip { background: var(--ink); color: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--talk); font-size: 13px; box-shadow: none; padding: 6px 9px; }
.leaflet-tooltip::before { display: none; }
.leaflet-tooltip .t { color: var(--mute); font-family: var(--count); font-size: 11px; }
.leaflet-div-icon { background: none; border: 0; }
.map-top { position: absolute; z-index: 1000; left: 16px; top: calc(var(--top) + 64px); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
@media (max-width: 720px) { .map-top { top: calc(var(--top) + 104px); } }
.map-layers { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; background: rgba(20,20,19,.94); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.toggle .n { font-family: var(--count); font-weight: 600; }
.toggle .k { color: var(--mute); }
.toggle[aria-pressed="false"] { opacity: .45; }
.toggle i { width: 10px; height: 10px; border-radius: 50%; }
.map-panel { position: absolute; z-index: 1000; left: 16px; bottom: max(26px, env(safe-area-inset-bottom)); width: min(380px, calc(100% - 32px)); max-height: 36vh; overflow: auto; background: rgba(20,20,19,.94); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.map-panel .st { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.35; }
.map-panel .st:first-of-type { border-top: 0; }
.map-panel .hint { font-size: 12px; color: var(--mute); margin-top: 8px; }
.tr { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); box-shadow: 0 0 0 1.5px var(--paper); }
.bus { font-family: var(--count); font-weight: 700; font-size: 11px; color: var(--ink); background: var(--hielo); border-radius: 6px; padding: 1px 5px; border: 1.5px solid var(--ink); white-space: nowrap; transform: translate(-50%, -50%); display: inline-block; }

/* Historia */
.lead { font-size: clamp(17px, 2vw, 21px); margin: 0; max-width: 60ch; text-wrap: balance; line-height: 1.35; }
.lead b { font-family: var(--count); font-weight: 600; }
.hist-title { font-family: var(--shout); font-weight: 900; font-size: clamp(30px, 5vw, 56px); line-height: .92; margin: 0 0 10px; letter-spacing: -.02em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.tile .k { font-size: 13px; color: var(--mute); }
.tile .v { font-family: var(--count); font-weight: 600; font-size: clamp(26px, 3vw, 34px); font-variant-numeric: tabular-nums; margin: 6px 0; }
.tile .s { font-size: 13px; color: var(--mute); }
.up { color: var(--verde) !important; } .down { color: var(--rojo) !important; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--sw); }
.chart { position: relative; min-height: 220px; }
.chart.tall { min-height: 320px; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--mute); font-size: 12px; font-family: var(--talk); }
.chart .tick text { font-family: var(--count); font-size: 11px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; white-space: nowrap; z-index: 2; }
.tip .d { color: var(--mute); font-family: var(--count); font-size: 12px; }
.eps { max-height: 26rem; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; background: var(--panel); text-align: left; color: var(--mute); font-weight: 600; padding: 6px 8px; border-bottom: 1.5px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.m { font-family: var(--count); font-size: 12px; white-space: nowrap; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.counts span { font-size: 13px; color: var(--mute); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.counts b { font-family: var(--count); color: var(--paper); margin-right: 6px; }
.notes { font-size: 13px; color: var(--mute); line-height: 1.5; }
.notes ul { margin: 8px 0 0; padding-left: 1.1rem; display: grid; gap: 4px; }
.loading { color: var(--mute); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Modo pantalla */
.screen-btn { cursor: pointer; color: var(--paper); gap: 7px; align-items: center; }
.screen-btn svg { color: var(--hielo); }
.director { display: none; }
body.screen .bar, body.screen .pulso-text, body.screen .pulso-side, body.screen .pulso-legend, body.screen .pulso-veil, body.screen .pulso-tip { display: none !important; }
body.screen .director { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 10; }
body.screen #pulsoCanvas { cursor: default; }
body.screen.still-mouse, body.screen.still-mouse #pulsoCanvas { cursor: none; }
.dir-caption { position: absolute; left: clamp(24px, 5vw, 80px); bottom: clamp(32px, 7vh, 90px); max-width: min(900px, 80vw); display: grid; gap: 10px; opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.dir-caption.in { opacity: 1; transform: none; }
.dir-caption .k { font-family: var(--count); font-size: clamp(13px, 1.2vw, 17px); letter-spacing: .14em; text-transform: uppercase; color: var(--cap, var(--paper)); }
.dir-caption .t { font-family: var(--shout); font-weight: 900; font-size: clamp(34px, 5.2vw, 84px); line-height: .98; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 30px rgba(0,0,0,.8); }
.dir-caption .s { font-size: clamp(16px, 1.6vw, 24px); color: #CFCFC8; max-width: 60ch; text-shadow: 0 1px 16px rgba(0,0,0,.9); }
.dir-brand { position: absolute; right: clamp(20px, 3vw, 44px); top: clamp(18px, 3vh, 36px); display: flex; gap: 18px; align-items: center; font-family: var(--count); font-size: 13px; color: var(--mute); letter-spacing: .06em; }
.dir-exit { position: absolute; right: 20px; bottom: 20px; pointer-events: auto; font-size: 13px; background: rgba(20,20,19,.9); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: opacity .4s; }
body.still-mouse .dir-exit { opacity: 0; }
body.screen::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 5; background: radial-gradient(ellipse at 30% 85%, rgba(10,10,10,.75), rgba(10,10,10,0) 55%); }

/* Mi Madrid */
.mm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.mm-block { background: var(--panel); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px; display: grid; gap: 10px; align-content: start; position: relative; overflow: hidden; }
.mm-block::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--st, transparent); }
.mm-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mm-top .chip { width: 52px; }
.mm-label { font-family: var(--count); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.mm-where { font-size: 13px; color: #C9C6BD; margin-left: auto; }
.mm-pin { width: 10px; height: 10px; border-radius: 50%; background: var(--hielo); box-shadow: 0 0 0 4px rgba(143,211,255,.18); }
.mm-big { font-family: var(--shout); font-weight: 900; font-size: clamp(36px, 4vw, 52px); line-height: .95; letter-spacing: -.02em; color: var(--st, var(--paper)); }
.mm-text { margin: 0; font-size: 15px; line-height: 1.35; }
.mm-sub { margin: 0; font-size: 13px; color: var(--mute); line-height: 1.4; }
.mm-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.mm-rail { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-pill { font-family: var(--count); font-size: 12px; font-weight: 600; color: var(--paper); text-decoration: none; border: 1.5px solid var(--lc); border-radius: 999px; padding: 4px 9px; display: inline-flex; gap: 6px; align-items: center; }
.mm-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.mm-buses { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mm-buses li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.mm-buses .bus { transform: none; font-size: 12px; padding: 2px 7px; }
.mm-dest small { color: var(--mute); font-size: 12px; }
.mm-dest { color: #C9C6BD; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-eta { font-family: var(--count); font-weight: 600; color: var(--hielo); }
.mm-link { font-size: 13px; }
.mm-empty { grid-column: 1 / -1; background: var(--panel); border: 1.5px dashed var(--line); border-radius: 20px; padding: 24px; }
.mm-empty h2 { font-size: 22px; } .mm-empty p { color: var(--mute); max-width: 60ch; }
.mm-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.mm-add { display: grid; gap: 6px; margin-top: 8px; }
.mm-add label, .mm-buslabel { font-size: 12px; color: var(--mute); margin-top: 6px; display: block; }
.mm-edit input { font: inherit; color: var(--paper); background: var(--ink); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.mm-edit input:focus { border-color: var(--hielo); outline: none; }
.mm-hits { display: grid; gap: 4px; }
.mm-hit { display: flex; justify-content: space-between; gap: 10px; text-align: left; background: var(--ink); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.mm-hit:hover { border-color: var(--hielo); }
.mm-hit small { color: var(--mute); }
.mm-places { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.mm-places li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.mm-places li span { color: var(--mute); flex: 1; }
.mm-x { font-size: 12px; background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 9px; cursor: pointer; color: var(--mute); }
.mm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-chip { font-family: var(--count); font-weight: 600; font-size: 12px; min-width: 44px; padding: 6px 8px; border-radius: 8px; background: transparent; border: 1.5px solid var(--lc); cursor: pointer; color: var(--paper); }
.mm-chip[aria-pressed="true"] { background: var(--lc); color: var(--ink); }
.mm-foot a, .wrap .note a { color: var(--hielo); }

/* Night: Metro closed, the city dims and the caption becomes a quiet clock */
body.night .dir-caption .t { font-weight: 700; font-size: clamp(56px, 9vw, 150px); color: #CFE7FF; text-shadow: 0 0 40px rgba(143,211,255,.25); }
body.night .dir-caption .s { color: #9FB3C8; }
body.night .dir-brand { opacity: .5; }

/* Search */
.search { position: relative; display: grid; gap: 6px; }
.search input { font: inherit; font-size: 15px; color: var(--paper); background: rgba(10,10,10,.9); backdrop-filter: blur(8px); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px 12px 38px; width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8A82' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px center; }
.search input:focus { outline: none; border-color: var(--hielo); }
.s-hits { display: grid; gap: 2px; background: rgba(10,10,10,.96); border: 1.5px solid var(--line); border-radius: 14px; padding: 6px; }
.s-hits[hidden] { display: none; }
.s-hit { display: flex; justify-content: space-between; gap: 12px; text-align: left; background: none; border: 0; border-radius: 9px; padding: 9px 10px; cursor: pointer; font-size: 14px; }
.s-hit:hover, .s-hit:focus-visible { background: var(--panel); }
.s-hit small { color: var(--mute); white-space: nowrap; }
.s-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.s-chip { font-size: 13px; font-weight: 600; color: var(--ink); background: var(--hielo); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.s-chip.s-geo { color: var(--paper); background: rgba(20,20,19,.94); border: 1.5px solid var(--line); font-weight: 400; }
.pulso-search { position: absolute; left: clamp(18px, 5vw, 64px); top: calc(var(--top) + 70px); width: min(420px, calc(100% - 36px)); z-index: 4; }
@media (max-width: 720px) { .pulso-search { top: calc(var(--top) + 112px); } .pulso-side { display: none; } }

/* Place card on the map */
.place-card { position: absolute; z-index: 1000; right: 16px; top: calc(var(--top) + 64px); width: min(380px, calc(100% - 32px)); max-height: calc(100% - var(--top) - 96px); overflow: auto; background: rgba(20,20,19,.96); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; }
@media (max-width: 720px) { .place-card { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; max-height: 52vh; } }
.pc { display: grid; gap: 14px; }
.pc-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.pc-kind { font-family: var(--count); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--hielo); }
.pc-name { font-family: var(--shout); font-weight: 700; font-size: 20px; line-height: 1.1; margin-top: 4px; }
.pc-x { font-size: 12px; background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer; color: var(--mute); }
.pc-bikes { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.pc-big { font-family: var(--shout); font-weight: 900; font-size: 52px; line-height: .9; }
.pc-t { font-size: 15px; }
.pc-s { font-size: 13px; color: var(--mute); line-height: 1.4; }
.pc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pc-pill { font-family: var(--count); font-size: 12px; font-weight: 600; color: var(--paper); text-decoration: none; border: 1.5px solid var(--lc); border-radius: 999px; padding: 4px 9px; display: inline-flex; gap: 6px; align-items: center; }
.pc-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.pc-buses ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pc-buses li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.pc-buses .bus { transform: none; font-size: 12px; padding: 2px 7px; }
.pc-dest { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #DADAD3; }
.pc-dest small { color: var(--mute); }
.pc-eta { font-family: var(--count); font-weight: 600; color: var(--hielo); }
.pc-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.pc-btn { font-size: 13px; background: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.pc-btn:hover { border-color: var(--hielo); }
.pc-foot input { font: inherit; font-size: 13px; color: var(--paper); background: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; width: 130px; }
.place-pin { display: block; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid var(--hielo); box-shadow: 0 0 0 6px rgba(143,211,255,.25); animation: pin 1.8s ease-out infinite; }
@keyframes pin { 70% { box-shadow: 0 0 0 16px rgba(143,211,255,0); } 100% { box-shadow: 0 0 0 0 rgba(143,211,255,0); } }
.saved-pin { display: inline-block; transform: translate(-50%, -130%); font-size: 12px; font-weight: 700; color: var(--ink); background: var(--hielo); border-radius: 8px; padding: 3px 8px; white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 2px var(--ink); }
.screen-toggle { gap: 7px; } .screen-toggle svg { color: var(--hielo); }

/* Screen mode on the map */
body.screen-map .bar, body.screen-map .map-top, body.screen-map .map-panel, body.screen-map .place-card, body.screen-map .leaflet-control-zoom { display: none !important; }
body.screen-map .map-director { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 1500; }
body.screen-map #mapa::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1400; background: radial-gradient(ellipse at 28% 88%, rgba(10,10,10,.82), rgba(10,10,10,0) 55%); }
body.screen-map.still-mouse, body.screen-map.still-mouse .leaflet-container { cursor: none; }
body.screen-map .bus { font-size: 13px; padding: 2px 7px; }
body.screen-map.night .dark-tiles { filter: invert(1) hue-rotate(180deg) grayscale(.95) brightness(.36) contrast(1.1); }
body.screen-map.night #map .leaflet-pane { transition: opacity 2s; }
body.screen-map.night .leaflet-overlay-pane, body.screen-map.night .leaflet-marker-pane { opacity: .55; }

/* ?pantalla: kiosk for the macOS screen saver and big screens */
body.kiosk #dirExit { display: none !important; }
body.kiosk, body.kiosk * { cursor: none !important; }

/* Bay: express lane and bridge price tags */
.toll { display: inline-block; transform: translate(-50%, -50%); font: 700 11px/1 var(--count); color: var(--ink); background: var(--ambar); border: 1.5px solid var(--ink); border-radius: 6px; padding: 3px 5px; white-space: nowrap; }
