/* Web del conductor, v2. Sistema visual en docs/DISENO.md.
   El panel de operación sigue usando /comun/estilos.css; esta hoja es solo del conductor. */

/* ---------- marca: tipografías del manual (docs/marca/manual-de-marca.pdf) ---------- */
/* Eurostile Extended es comercial: antes de publicar, EcoRoad confirma que su licencia cubre uso web (docs/DECISIONES.md). */
@font-face { font-family: "Eurostile Extended"; font-weight: 400; font-display: swap; src: url("/conductor/marca/fuentes/eurostile-extended.ttf") format("truetype"); }
@font-face { font-family: "Eurostile Extended"; font-weight: 500; font-display: swap; src: url("/conductor/marca/fuentes/eurostile-extended-medium.otf") format("opentype"); }
@font-face { font-family: "Oskari G2"; font-weight: 400; font-display: swap; src: url("/conductor/marca/fuentes/oskari-g2-regular.ttf") format("truetype"); }
@font-face { font-family: "Oskari G2"; font-weight: 600 700; font-display: swap; src: url("/conductor/marca/fuentes/oskari-g2-semibold.ttf") format("truetype"); }

/* ---------- colores y medidas ---------- */
/* Paleta del manual: negro (R36 G36 B36), blanco y azul de acento #A3B1FF, en proporción 60/30/10.
   El azul no alcanza contraste como texto sobre blanco (2,0): en claro va como relleno con texto negro
   encima; en oscuro sí es texto y acción (7,6 sobre el negro). Rojo, ámbar y el verde de la luz del
   cargador son colores de estado, fuera de la marca, y solo se usan para eso. */
:root {
  color-scheme: light dark;
  --negro: #242424; --blanco: #ffffff; --azul: #a3b1ff;
  --papel: #f3f3f5; --hoja: #ffffff; --hoja-2: #e9e9ee; --linea: #d6d6dd; --linea-fuerte: #84848f;
  --tinta: #242424; --tinta-2: #5a5a64;
  --accion: #242424; --accion-sobre: #ffffff; --accion-hover: #000000;
  --acento: #a3b1ff; --acento-sobre: #242424; --acento-suave: #e6e9ff; --acento-tinta: #242424;
  --pista: #242424;
  --lista: #1a8f52;
  --error: #b42318; --error-sobre: #ffffff; --error-hover: #8f1c12; --error-suave: #fde4e1; --error-tinta: #7a1209;
  --aviso: #8a4b00; --aviso-suave: #fff1d6; --aviso-tinta: #5e3300;
  --neutro: #55555e; --neutro-suave: #e9e9ee;
  --foco: #242424;
  --sombra: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px -12px rgba(0, 0, 0, .22);
  /* Principal (títulos y cifras) y de soporte (texto), como en el manual. */
  --f-cifras: "Eurostile Extended", "Bahnschrift", system-ui, sans-serif;
  --f-texto: "Oskari G2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --e1: .25rem; --e2: .5rem; --e3: .75rem; --e4: 1rem; --e5: 1.5rem; --e6: 2rem; --e7: 3rem;
  --r-chico: .5rem; --r: .875rem; --r-grande: 1.25rem;
  --alto-pestanas: 3.75rem;
  --escenario: #242424;
  --cg-acento: #a3b1ff; --cg-acento-claro: #c9d1ff; --cg-acento-oscuro: #7584e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papel: #242424; --hoja: #2e2e30; --hoja-2: #38383b; --linea: #45454a; --linea-fuerte: #80808a;
    --tinta: #ffffff; --tinta-2: #b4b4bc;
    --accion: #a3b1ff; --accion-sobre: #242424; --accion-hover: #bcc6ff;
    --acento-suave: #2f3350; --acento-tinta: #a3b1ff;
    --pista: #0f0f10; --escenario: #18181a;
    --lista: #3ecf84;
    --error: #ff8a7a; --error-sobre: #2a0704; --error-hover: #ffa698; --error-suave: #3a1512; --error-tinta: #ffc8bf;
    --aviso: #f0b860; --aviso-suave: #33250d; --aviso-tinta: #f6d59b;
    --neutro: #b4b4bc; --neutro-suave: #323236;
    --foco: #a3b1ff;
    --sombra: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .8);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { font-synthesis: none; margin: 0; overscroll-behavior-y: none; background: var(--papel); color: var(--tinta); font: 1rem/1.5 var(--f-texto); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1 { font: 500 1.375rem/1.2 var(--f-cifras); text-wrap: balance; }
h2 { font: 500 1.0625rem/1.25 var(--f-cifras); }
h1:focus { outline: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.suave { color: var(--tinta-2); }
.chico { font-size: .875rem; }
.cifras { font-family: var(--f-cifras); font-variant-numeric: tabular-nums; }
/* Eurostile no trae cifras proporcionales (todas miden 933/1000; la tinta del 1 va de 156 a 625):
   en las cifras grandes cada 1 va en .u1 (cifraHtml en util.js) y se le recorta el aire de los costados. */
.u1 { margin-inline: -.09em -.24em; font: inherit; color: inherit; }
.no-partir { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-radius: 4px; }
.salto { position: absolute; left: var(--e3); top: -4rem; z-index: 30; background: var(--hoja); color: var(--tinta); padding: var(--e3) var(--e4); border-radius: var(--r-chico); }
.salto:focus { top: var(--e3); }
.sin-js { padding: var(--e4); }

/* ---------- marco: cabecera, pestañas y contenido ---------- */
.marco { min-height: 100dvh; display: flex; flex-direction: column; }
.cabecera { display: flex; align-items: center; min-height: 3.25rem; padding: 0 var(--e4); padding-top: env(safe-area-inset-top); }
/* Marca. En el celular va el isotipo (el manual lo indica para interfaces y espacios chicos); en
   escritorio, el logotipo a 50 mm, su ancho mínimo. Nunca los dos juntos. Se usan los archivos del
   manual tal cual (negro o blanco según el fondo), con aire alrededor de al menos su propia altura. */
.marca { display: inline-flex; align-items: center; min-height: 3rem; padding: var(--e2) var(--e2) var(--e2) 0; text-decoration: none; }
.marca img { display: block; height: auto; }
.marca-iso img { width: 3.25rem; }
.marca-logo { display: none; }
/* El isotipo queda solo en Inicio (la lista de cargadores); en el resto, el título de la pantalla es la cabecera. */
@media (max-width: 59.99rem) {
  .marco:has(#p-cargar[hidden]) .cabecera, .marco:has(#lista[hidden]) .cabecera { display: none; }
  .marco:has(#p-cargar[hidden]) main, .marco:has(#lista[hidden]) main { padding-top: calc(env(safe-area-inset-top) + var(--e5)); }
}
main { flex: 1; min-width: 0; padding: var(--e2) var(--e4) calc(var(--alto-pestanas) + env(safe-area-inset-bottom) + var(--e6)); }
main:focus { outline: none; }
.seccion { max-width: 34rem; margin: 0 auto; }

.pestanas {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: color-mix(in srgb, var(--hoja) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom);
}
.pestanas a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--alto-pestanas); padding: 6px 0 5px; min-width: 0; text-decoration: none; color: var(--tinta-2);
  font-size: .75rem; line-height: 1.1; font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.pestanas svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pestanas .largo { display: none; }
.pestanas .corto { max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
/* Cinco pestañas (A2). La activa: ícono y rótulo en el color de texto pleno; las demás, en el suave. */
.pestanas a[aria-current="page"] { color: var(--tinta); }
.pestanas a[aria-current="page"] svg { stroke-width: 2.1; }
.pestanas a:focus-visible { outline-offset: -3px; }
@media (max-width: 339px) { .pestanas a { font-size: .6875rem; letter-spacing: -.01em; } }
/* Conectar, Elegir y Pago (D3 c): sin barra de pestañas, el contenido baja hasta el borde seguro. */
body[data-tarea] .marco:has(#p-cargar:not([hidden])) .pestanas { display: none; }
body[data-tarea] .marco:has(#p-cargar:not([hidden])) main { padding-bottom: calc(env(safe-area-inset-bottom) + var(--e6)); }

/* ---------- botones ---------- */
.btn {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: var(--e2); min-height: 3.25rem; padding: .625rem var(--e5);
  border: 2px solid transparent; border-radius: var(--r-chico); font: 600 1.0625rem/1.25 var(--f-texto); letter-spacing: normal; cursor: pointer; text-decoration: none; text-align: center;
  position: relative; overflow: hidden;
}
.btn-primario { background: var(--accion); color: var(--accion-sobre); }
.btn-secundario { background: transparent; color: var(--acento-tinta); border-color: var(--linea-fuerte); }
.btn-peligro { background: var(--error); color: var(--error-sobre); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.enlace { display: inline-flex; align-items: center; gap: var(--e2); min-height: 3rem; padding: 0 var(--e2) 0 0; background: none; border: 0; color: var(--acento-tinta); font-weight: 600; cursor: pointer; text-decoration: none; }
.enlace svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pila > * + * { margin-top: var(--e4); }
.pila-chica > * + * { margin-top: var(--e2); }

/* ---------- respuesta al toque (A1) ---------- */
/* Todo lo tocable se hunde al presionar (no al soltar), sin el destello gris del navegador ni selección
   de texto por un toque largo. Botones y tarjetas: escala 0,97; renglones a todo el ancho: 0,98 (más se
   ve exagerado); pestañas, solapas, celdas y enlaces de texto: solo opacidad. El :hover vive solo donde
   hay mouse: en el teléfono queda pegado después del toque. */
.btn, .enlace, .estacion, .pestanas a, .tope, .plegado summary, .renglon-enlace, .sugeridas button, .interruptor,
.dias button, .horas button, .mapa-controles button, .ficha-cerrar {
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn, .estacion, .tope, .plegado summary, .renglon-enlace, .sugeridas button, .interruptor { transition: transform 120ms ease-out; }
.enlace, .pestanas a, .dias button, .horas button, .mapa-controles button, .ficha-cerrar { transition: opacity 120ms ease-out; }
.btn:active:not(:disabled), .estacion:active { transform: scale(.97); }
.tope:active:not(.tope-ya), .plegado summary:active, .renglon-enlace:active, .sugeridas button:active, .interruptor:active { transform: scale(.98); }
.enlace:active, .pestanas a:active, .dias button:active, .horas button:active:not(:disabled), .mapa-controles button:active, .ficha-cerrar:active { opacity: .6; }
@media (hover: hover) and (pointer: fine) {
  .btn-primario:hover:not(:disabled) { background: var(--accion-hover); }
  .btn-secundario:hover:not(:disabled) { background: var(--acento-suave); border-color: var(--acento-tinta); }
  .btn-peligro:hover:not(:disabled) { background: var(--error-hover); }
  .estacion:hover .estacion-ir::after { transform: translateX(4px); }
}

/* ---------- estado de un cargador: forma + color + palabra ---------- */
.estado { display: inline-flex; align-items: center; gap: .4375rem; font-weight: 700; font-size: .9375rem; line-height: 1.2; white-space: nowrap; }
.estado i { width: .75rem; height: .75rem; border-radius: 50%; flex: none; position: relative; }
.estado-disponible, .estado-enchufado { color: var(--tinta); }
.estado-enchufado i { background: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 30%, transparent); }
.estado-disponible i { background: var(--lista); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lista) 22%, transparent); }
.estado-en_uso { color: var(--tinta); }
.estado-en_uso i { background: var(--acento); box-shadow: 0 0 0 1.5px var(--tinta); }
.estado-fuera, .estado-sin_conexion, .estado-consultando { color: var(--neutro); }
.estado-fuera i { border: 2px solid var(--neutro); }
.estado-fuera i::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px; margin-top: -1px; background: var(--neutro); transform: rotate(-45deg); }
.estado-sin_conexion i { border: 2px dashed var(--neutro); }
.estado-consultando i { border: 2px solid var(--linea); border-top-color: var(--neutro); animation: gira .9s linear infinite; }


/* ---------- escenario: la franja negra donde viven los dibujos ---------- */
/* El 60 % de negro de la marca. Adentro todo va como en oscuro, también con el teléfono en claro. */
.estacion, .escena {
  --tinta: #ffffff; --tinta-2: #b4b4bc; --acento-tinta: #a3b1ff; --neutro: #b4b4bc; --linea: #45454a; --linea-fuerte: #80808a;
  --lista: #3ecf84; --foco: #a3b1ff;
  background: var(--escenario); color: var(--tinta);
}

/* ---------- lista de estaciones ---------- */
.lista > * + * { margin-top: var(--e4); }
.estacion {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--e4); align-items: center; width: 100%; text-align: left;
  border: 0; border-radius: var(--r-grande); padding: var(--e4) var(--e4) 0 var(--e3); cursor: pointer; overflow: hidden;
}
.estacion .dibujo { width: 7.5rem; align-self: end; }
.estacion-cuerpo { display: grid; gap: var(--e1); padding-bottom: var(--e4); min-width: 0; }
.estacion-nombre { font: 500 1.0625rem/1.2 var(--f-cifras); overflow-wrap: anywhere; }
.estacion-datos { color: var(--tinta-2); font-size: .9375rem; }
.estacion-ir { margin-top: var(--e2); font-weight: 600; color: var(--acento-tinta); }
.estacion-ir::after { content: "→"; display: inline-block; margin-left: var(--e2); transition: transform 200ms cubic-bezier(.2, .8, .2, 1); }
.grupo-titulo { font: 600 .9375rem/1.3 var(--f-texto); color: var(--tinta-2); margin-top: var(--e6); }
.proximas { margin-top: var(--e2); border-top: 1px solid var(--linea); }
.proximas li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e3); padding: var(--e3) 0; border-bottom: 1px solid var(--linea); }
.proximas li span { min-width: 0; overflow-wrap: anywhere; }
.proximas li i { font-style: normal; font-size: .875rem; color: var(--tinta-2); white-space: nowrap; }

/* Lo que se abre a pedido: un renglón con un más, sin caja. */
.plegado { border-top: 1px solid var(--linea); }
.plegado summary { min-height: 3rem; display: flex; align-items: center; justify-content: space-between; gap: var(--e3); cursor: pointer; color: var(--tinta-2); font-weight: 600; list-style: none; }
.plegado summary::-webkit-details-marker { display: none; }
.plegado summary::after { content: "+"; font: 400 1.25rem/1 var(--f-cifras); flex: none; }
.plegado[open] summary::after { content: "−"; }
.plegado > :not(summary) { margin-bottom: var(--e3); }
.otro-codigo { margin-top: var(--e6); border-bottom: 1px solid var(--linea); }
/* En el teléfono la lista de próximas ya cierra con un filete: el plegado se pega a ese, sin hueco. */
.lista-grilla + .otro-codigo { margin-top: 0; border-top: 0; }
.otro-codigo form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--e2); align-items: end; }
.otro-codigo label { display: block; font-weight: 600; font-size: .875rem; grid-column: 1 / -1; }
.otro-codigo input { width: 100%; min-width: 0; min-height: 3rem; padding: .5rem var(--e3); font: inherit; color: var(--tinta); background: var(--hoja); border: 1.5px solid var(--linea-fuerte); border-radius: var(--r-chico); }
.otro-codigo .btn { width: auto; min-height: 3rem; }

/* ---------- los dibujos ---------- */
.dibujo, .dibujo-auto { display: block; line-height: 0; }
.dibujo svg, .dibujo-auto svg { display: block; width: 100%; height: auto; }
/* Cuando se muestra solo una parte del poste, el corte se funde en vez de terminar en una línea. */
.dibujo[data-recorte="caja"] svg { -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 99%); mask-image: linear-gradient(to bottom, #000 80%, transparent 99%); }
.dibujo[data-recorte="conector"] svg { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent 99%); mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent 99%); }
/* En la lista, el nombre de transición se le pone por JS solo a la estación que se abre. */
.escena .dibujo { view-transition-name: cargador; }
::view-transition-group(cargador) { animation-duration: 380ms; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(cargador), ::view-transition-new(cargador) { height: 100%; width: 100%; object-fit: contain; }
::view-transition-old(cargador) { animation-duration: 140ms; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }

/* ---------- flujo: escena + panel ---------- */
.flujo { display: grid; gap: var(--e4); }
.flujo-arriba { margin-bottom: calc(var(--e3) * -1); }
.escena { display: grid; gap: var(--e3); border-radius: var(--r-grande); padding: var(--e4); overflow: hidden; min-width: 0; }
.escena .dibujo { width: min(58%, 13rem); margin-inline: auto; }
.escena .dibujo-auto { width: 100%; max-width: 24rem; margin-inline: auto; }
.escena-texto { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--e1) var(--e3); min-width: 0; }
.escena-nombre { font: 500 1rem/1.25 var(--f-cifras); min-width: 0; overflow-wrap: anywhere; }
.escena-sello { font: 400 .8125rem/1.3 var(--f-texto); color: var(--tinta-2); margin-left: var(--e1); white-space: nowrap; }
.escena-estado:empty { display: none; }
.escena[data-tam="chica"] { grid-template-columns: 3.25rem minmax(0, 1fr); align-items: center; padding: var(--e2) var(--e3); border-radius: var(--r); }
.escena[data-tam="chica"] .dibujo { width: 3.25rem; }
.escena[data-tam="chica"] .dibujo-auto { width: 5rem; }
.escena[data-tam="chica"][data-modo="auto"] { grid-template-columns: 5rem minmax(0, 1fr); }
.escena[data-tam="chica"] .escena-texto { display: block; }
.escena[data-tam="chica"] .escena-nombre { font-size: .875rem; }
.escena[data-tam="chica"] .escena-sello { display: none; }
/* D10 b / A5: más bajo donde se decide (estación, Conectar, Elegir): 300 px de alto como máximo. */
.escena[data-tam="media"] { padding: var(--e3) var(--e4); gap: var(--e2); max-height: 300px; }
.escena[data-tam="media"] .dibujo { width: min(42%, 9.5rem); }
.escena[data-tam="media"] .dibujo-auto { max-width: 17rem; }
@media (max-height: 700px) { .escena[data-tam="media"] .dibujo { width: min(34%, 7.5rem); } .escena[data-tam="media"] .dibujo-auto { max-width: 13rem; } }
.escena.entra .dibujo { animation: entra 320ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entra { from { opacity: 0; transform: scale(.9); } }
/* El auto llega rodando cuando el cargador lo detecta. */
.escena.llega .dibujo-auto { animation: llega 900ms cubic-bezier(.16, .84, .24, 1) both; }
@keyframes llega { from { opacity: 0; transform: translateX(-42%); } 55% { opacity: 1; } }
.panel { min-width: 0; }
.panel > * + * { margin-top: var(--e4); }
/* Al cambiar de paso del flujo (Conectar → Elegir → Pago → Cargando → Fin), lo de abajo del escenario
   entra con fundido y 8 px hacia arriba. Al cambiar de pestaña, nada. */
.panel.paso-entra { animation: paso-entra 200ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes paso-entra { from { opacity: 0; transform: translateY(8px); } }
.aparece > * { animation: aparece 360ms cubic-bezier(.2, .8, .2, 1) both; }
.aparece > :nth-child(2) { animation-delay: 60ms; }
.aparece > :nth-child(3) { animation-delay: 120ms; }
.aparece > :nth-child(4) { animation-delay: 180ms; }
.aparece > :nth-child(n+5) { animation-delay: 240ms; }
@keyframes aparece { from { opacity: 0; transform: translateY(10px); } }

/* La chapa de características: tres datos entre dos filetes. */
.placa { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: space-between; gap: var(--e3); padding: var(--e3) 0; border-block: 1px solid var(--linea); }
.placa div { min-width: 0; }
.placa dt { font-size: .8125rem; color: var(--tinta-2); }
.placa dd { font: 500 .9375rem/1.35 var(--f-cifras); font-variant-numeric: tabular-nums; }
.placa dd small { display: block; font: 400 .75rem/1.3 var(--f-texto); color: var(--tinta-2); }

/* Esperando al auto */
.esperando { display: grid; justify-items: center; gap: var(--e2); }
.esperando .dibujo-auto { width: min(64%, 15rem); }
.dibujo-auto.fantasma { opacity: .35; animation: respira 2.4s ease-in-out infinite; }
@keyframes respira { 50% { opacity: .7; } }
.esperando-texto { font-weight: 600; }
.panel > .esperando-texto:first-child { margin-top: calc(var(--e1) * -1); }
.sin-deteccion { display: grid; gap: var(--e2); }
.puntos i { display: inline-block; width: .3125rem; height: .3125rem; margin-left: .25rem; border-radius: 50%; background: currentColor; animation: punto 1.2s infinite both; }
.puntos i:nth-child(2) { animation-delay: .2s; }
.puntos i:nth-child(3) { animation-delay: .4s; }
@keyframes punto { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* Batería del auto y hasta dónde cargar */
.cifra-soc { font: 500 2.75rem/1 var(--f-cifras); font-variant-numeric: tabular-nums; }
h1 .cifra-soc { font-size: inherit; white-space: nowrap; }
/* A5: el número a la derecha del deslizador, a 22 px. El pulgar se dibuja de 22 px con un borde
   transparente de 11 px: la zona que se toca es de 44 × 44. */
.deslizador { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--e3); }
.deslizador-cifra { font: 500 1.375rem/1 var(--f-cifras); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; min-width: 5.6ch; }
.deslizador input { --f: .5; width: 100%; height: 2.75rem; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; cursor: pointer; }
.deslizador input::-webkit-slider-runnable-track { height: .375rem; border-radius: 999px; background: linear-gradient(to right, var(--accion) calc(var(--f) * 100%), var(--linea) 0); }
.deslizador input::-moz-range-track { height: .375rem; border-radius: 999px; background: var(--linea); }
.deslizador input::-moz-range-progress { height: .375rem; border-radius: 999px; background: var(--accion); }
.deslizador input::-webkit-slider-thumb { -webkit-appearance: none; box-sizing: content-box; width: 1.375rem; height: 1.375rem; margin-top: -1.1875rem; border: .6875rem solid transparent; border-radius: 50%; background: var(--hoja); background-clip: padding-box; box-shadow: inset 0 0 0 1.5px var(--linea-fuerte); }
.deslizador input::-moz-range-thumb { box-sizing: content-box; width: 1.375rem; height: 1.375rem; border: .6875rem solid transparent; border-radius: 50%; background: var(--hoja); background-clip: padding-box; }
.deslizador input:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; border-radius: var(--r-chico); }
/* La capacidad del auto, plegada en un renglón. */
.auto-plegado summary { display: flex; justify-content: space-between; align-items: center; gap: var(--e3); }
.auto-plegado summary::after { display: none; }
.auto-plegado summary b { font-weight: 600; color: var(--tinta); }
.auto-plegado .cambiar { color: var(--acento-tinta); font-weight: 600; }
.auto-plegado[open] .cambiar { visibility: hidden; }
/* El botón de seguir queda fijo abajo: a la vista sin desplazar, aun en 667 px de alto. */
.accion-fija { position: sticky; bottom: 0; z-index: 2; margin-inline: calc(var(--e4) * -1); padding: var(--e3) var(--e4) calc(env(safe-area-inset-bottom) + var(--e3)); background: color-mix(in srgb, var(--papel) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--linea); }
.accion-fija > * + * { margin-top: var(--e2); }
.accion-fija .reserva:empty { display: none; }
body[data-tarea] .marco:has(.accion-fija) main { padding-bottom: 0; }
.renglon { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); }
.renglon label { font-weight: 600; }
.renglon select { min-height: 3rem; min-width: 0; max-width: 62%; padding: 0 var(--e3); font: inherit; color: var(--tinta); background: var(--hoja); border: 1.5px solid var(--linea-fuerte); border-radius: var(--r-chico); }
.topes { border: 0; padding: 0; margin-inline: 0; min-width: 0; border-bottom: 1px solid var(--linea); }
.topes legend { padding: 0; margin-bottom: var(--e2); font: 500 1rem/1.3 var(--f-cifras); }
.tope { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--e3); min-height: 3.75rem; padding: var(--e2) 0; border-top: 1px solid var(--linea); cursor: pointer; }
.tope input { appearance: none; -webkit-appearance: none; width: 1.375rem; height: 1.375rem; margin: 0; border: 2px solid var(--linea-fuerte); border-radius: 50%; display: grid; place-content: center; flex: none; }
.tope input::before { content: ""; width: .6875rem; height: .6875rem; border-radius: 50%; background: var(--accion); transform: scale(.5); opacity: 0; transition: transform 150ms cubic-bezier(.2, .8, .2, 1), opacity 150ms cubic-bezier(.2, .8, .2, 1); }
.tope input:checked { border-color: var(--accion); }
.tope input:checked::before { transform: scale(1); opacity: 1; }
.tope-nombre { font-weight: 600; min-width: 0; }
.tope-detalle { text-align: right; font-size: .875rem; line-height: 1.35; color: var(--tinta-2); font-variant-numeric: tabular-nums; }
.tope-detalle b { color: var(--tinta); }
.tope-ya { opacity: .55; cursor: not-allowed; }
.topes-grupo { font-size: .8125rem; color: var(--tinta-2); padding-top: var(--e2); }
.etiqueta { font-weight: 700; font-size: 1.0625rem; }

/* Reserva: el monto máximo, sin caja */
.reserva b { font-family: var(--f-cifras); font-weight: 500; }
.reserva-rotulo { color: var(--tinta-2); font-size: .9375rem; }
.reserva-monto { display: block; font: 500 clamp(1.75rem, 8.5vw, 2.5rem)/1.1 var(--f-cifras); font-variant-numeric: tabular-nums; margin: .125rem 0 var(--e2); overflow-wrap: anywhere; }
.reserva p + p { margin-top: var(--e1); }

/* Avisos en el cuerpo (D13 b): sin caja. Error y alerta son texto en su tinta de estado con un ícono;
   el escenario cuenta el resto (la luz apagada). Info es texto común. La única superficie con fondo
   propio sigue siendo el escenario. */
.aviso { position: relative; overflow-wrap: anywhere; line-height: 1.4; }
.aviso strong { display: block; font-weight: 600; }
.aviso-error, .aviso-alerta { padding-left: 1.75rem; }
.aviso-error::before, .aviso-alerta::before {
  content: ""; position: absolute; left: 0; top: .125rem; width: 1.125rem; height: 1.125rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19L12 4Z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19L12 4Z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.aviso-error { color: var(--error-tinta); }
.aviso-alerta { color: var(--aviso-tinta); }
.aviso-exito, .aviso-info { color: var(--tinta); }
.aviso-info:has(.girando) { display: flex; align-items: center; gap: var(--e3); color: var(--tinta-2); }

/* Fin con corte (A4): el ícono de aviso en lugar del tilde, en ámbar de estado */
.cobro-corte { width: 2.75rem; height: 2.75rem; margin: 0 0 var(--e2); display: block; fill: none; stroke: var(--aviso); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Listas de datos (resumen, comprobante): un ticket, filete arriba y renglones */
.tarjeta { border-top: 2px solid var(--tinta); padding-top: var(--e4); }
.datos-lista { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: var(--e2) var(--e3); }
.datos-lista dt { color: var(--tinta-2); }
.datos-lista dd { text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.datos-lista .fuerte { font-weight: 700; color: var(--tinta); }
.mono { font-family: var(--f-mono); font-size: .8125rem; }

/* Pago (A7, D7 c): un botón. Los del pago simulado, solo con ?prueba=1; sin franja de color (4.4) y
   el rechazo como texto rojo, no como botón lleno (4.3). */
.simulado { border-top: 1px solid var(--linea); padding-top: var(--e4); }
.enlace-peligro { color: var(--error-tinta); width: 100%; justify-content: center; }
.pago-nota { text-align: center; }
#brick { min-width: 0; }

/* Espera */
.girando { width: 1.25rem; height: 1.25rem; border: 3px solid var(--linea); border-top-color: var(--accion); border-radius: 50%; animation: gira .8s linear infinite; display: inline-block; vertical-align: middle; flex: none; }
@keyframes gira { to { transform: rotate(360deg); } }
.espera { display: flex; align-items: center; gap: var(--e3); padding: var(--e4) 0; color: var(--tinta-2); }

/* ---------- carga en vivo ---------- */
.hitos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--e2); counter-reset: hito; }
.hitos li { counter-increment: hito; position: relative; padding-top: 1.75rem; font-size: .8125rem; line-height: 1.25; color: var(--tinta-2); text-align: center; overflow-wrap: anywhere; }
.hitos li::before { content: counter(hito); position: absolute; top: 0; left: 50%; width: 1.375rem; height: 1.375rem; margin-left: -.6875rem; border-radius: 50%; border: 1.5px solid var(--linea-fuerte); background: var(--papel); display: grid; place-items: center; font: 500 .625rem/1 var(--f-cifras); z-index: 1; }
.hitos li::after { content: ""; position: absolute; top: .625rem; left: calc(-50% - var(--e2) / 2); width: calc(100% + var(--e2)); height: 1.5px; background: var(--linea); }
.hitos li:first-child::after { display: none; }
.hitos li[data-e="hecho"] { color: var(--tinta); }
.hitos li[data-e="hecho"]::before { content: "✓"; background: var(--tinta); border-color: var(--tinta); color: var(--papel); font-family: var(--f-texto); font-size: .75rem; }
.hitos li[data-e="hecho"]::after, .hitos li[data-e="actual"]::after { background: var(--tinta); }
.hitos li[data-e="actual"] { color: var(--tinta); font-weight: 600; }
.hitos li[data-e="actual"]::before { border-color: var(--tinta); background: var(--acento); color: var(--acento-sobre); }

.nivel-barra { display: block; position: relative; height: .875rem; border-radius: 999px; background: var(--pista); overflow: hidden; }
.nivel-barra i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--acento); transition: width 900ms cubic-bezier(.2, .8, .2, 1); }
.nivel-barra u { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: .85; }
.cifras-fila { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--e3); border-block: 1px solid var(--linea); }
.cifras-fila div { display: flex; flex-direction: column; padding: var(--e3) 0; min-width: 0; }
.cifras-fila .ancha { grid-column: 1 / -1; border-bottom: 1px solid var(--linea); }
.cifras-fila dd { font: 500 1.25rem/1.2 var(--f-cifras); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cifras-fila .ancha dd { font-size: clamp(1.5rem, 7.5vw, 2rem); }
.cifras-fila dt { font-size: .8125rem; color: var(--tinta-2); }

/* A6: una protagonista (km sumados o kWh), lo demás baja. */
.hitos.se-va { opacity: 0; transition: opacity 200ms ease-out; }
.vivo { display: grid; gap: var(--e2); }
.vivo-cifra { display: flex; align-items: baseline; gap: .375rem; }
.vivo-cifra b { font: 500 4rem/1 var(--f-cifras); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.vivo-cifra small { font: 500 1.5rem/1 var(--f-cifras); }
.vivo-cifra .vivo-mas { font: 500 2rem/1 var(--f-texto); margin-right: -.25rem; }
.vivo-sub { font: 400 1.25rem/1.3 var(--f-texto); color: var(--tinta-2); font-variant-numeric: tabular-nums; }
.vivo-barra { position: relative; margin-top: var(--e2); }
.vivo-barra.con-tope { padding-bottom: 1.25rem; }
.vivo-tope { position: absolute; bottom: 0; transform: translateX(-50%); font-size: .75rem; line-height: 1; color: var(--tinta-2); }
.vivo-llega { font-weight: 600; font-variant-numeric: tabular-nums; }
.vivo-monto { display: grid; gap: .125rem; padding-block: var(--e3); border-block: 1px solid var(--linea); }
.vivo-monto b { font: 500 1.75rem/1.15 var(--f-cifras); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vivo-monto > span { font-size: .875rem; color: var(--tinta-2); }
/* D4 b: Detener neutro, en el color de texto y con filete; el rojo aparece solo al armarlo. */
.btn-detener { background: transparent; color: var(--tinta); border: 1px solid var(--linea-fuerte); }
.btn-detener[data-armado] { background: var(--error); color: var(--error-sobre); border-color: var(--error); }
@media (hover: hover) and (pointer: fine) { .btn-detener:hover:not(:disabled):not([data-armado]) { background: var(--hoja-2); } }
.btn-detener[data-armado]::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: currentColor; opacity: .55; transform-origin: left; animation: vence 4s linear forwards; }
@keyframes vence { to { transform: scaleX(0); } }

/* ---------- fin ---------- */
.cobro { padding: var(--e2) 0; }
.cobro-marca { width: 2.75rem; height: 2.75rem; margin: 0 0 var(--e2); display: block; }
.cobro-marca circle { fill: none; stroke: var(--accion); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 0; }
.cobro-marca path { fill: none; stroke: var(--accion); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 0; }
.cobro-marca.dibuja circle { animation: traza 250ms ease-out both; }
.cobro-marca.dibuja path { animation: traza-tilde 250ms 180ms ease-out both; }
@keyframes traza { from { stroke-dashoffset: 151; } }
@keyframes traza-tilde { from { stroke-dashoffset: 30; } }
.cobro-rotulo { color: var(--tinta-2); }
.cobro-monto { display: block; font: 500 clamp(1.875rem, 9vw, 2.75rem)/1.1 var(--f-cifras); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.comparacion { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-block: 1px solid var(--linea); }
.comparacion div { padding: var(--e3) 0; min-width: 0; }
.comparacion div + div { padding-left: var(--e4); border-left: 1px solid var(--linea); }
.comparacion dt { color: var(--tinta-2); font-size: .8125rem; }
.comparacion dd { font: 500 1rem/1.3 var(--f-cifras); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- escritorio ---------- */
@media (min-width: 60rem) {
  .marco { display: grid; grid-template-columns: 17rem minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .cabecera { grid-column: 1; grid-row: 1; padding: var(--e5) var(--e5) var(--e3); min-height: 0; position: sticky; top: 0; }
  .marca-iso { display: none; }
  .marca-logo { display: block; }
  .marca-logo img { width: 50mm; }
  .pestanas { position: sticky; top: 6rem; inset: auto; grid-column: 1; grid-row: 2; align-self: start; display: flex; flex-direction: column; gap: 2px; padding: 0 var(--e3); background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; }
  .pestanas a { flex-direction: row; justify-content: flex-start; gap: var(--e3); min-height: 3rem; padding: 0 var(--e3); border-radius: var(--r-chico); font-size: 1rem; font-weight: 600; }
  .pestanas .corto { display: none; }
  .pestanas .largo { display: inline; min-width: 0; }
  .pestanas a:active { opacity: 1; }
  @media (hover: hover) and (pointer: fine) { .pestanas a:hover { background: var(--hoja-2); } }
  .pestanas a[aria-current="page"] { background: var(--hoja); }
  main { grid-column: 2; grid-row: 1 / 3; padding: var(--e6) var(--e6) var(--e7); border-left: 1px solid var(--linea); min-height: 100dvh; }
  .seccion { max-width: 62rem; margin: 0; }
  h1 { font-size: 1.875rem; }

  .lista-grilla { display: grid; grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); gap: var(--e6); align-items: start; margin-top: var(--e5); }
  .lista-grilla > * { margin-top: 0; }
  .lista-grilla .grupo-titulo { margin-top: 0; }
  .lista-grilla + .otro-codigo { margin-top: var(--e6); border-top: 1px solid var(--linea); }
  .estacion { grid-template-columns: 10rem minmax(0, 1fr); padding: var(--e5) var(--e5) 0 var(--e4); }
  .estacion .dibujo { width: 10rem; }
  .estacion-nombre { font-size: 1.25rem; }

  .flujo { grid-template-columns: minmax(18rem, 26rem) minmax(0, 30rem); gap: var(--e4) var(--e7); align-items: start; }
  .flujo-arriba { grid-column: 1 / -1; margin-bottom: 0; }
  .escena, .escena[data-tam="chica"], .escena[data-tam="media"], .escena[data-tam="chica"][data-modo="auto"] { max-height: none; position: sticky; top: var(--e6); grid-template-columns: 1fr; padding: var(--e5); border-radius: var(--r-grande); }
  .escena .dibujo, .escena[data-tam="chica"] .dibujo, .escena[data-tam="media"] .dibujo { width: min(70%, 15rem); }
  .escena .dibujo-auto, .escena[data-tam="chica"] .dibujo-auto, .escena[data-tam="media"] .dibujo-auto { width: 100%; max-width: 24rem; }
  .escena .escena-nombre, .escena[data-tam="chica"] .escena-nombre { font-size: 1.125rem; }
  .escena[data-tam="chica"] .escena-texto { display: flex; }
  .escena[data-tam="chica"] .escena-sello { display: inline; }
}

/* ---------- impresión del comprobante y movimiento reducido ---------- */
@media print {
  :root { --papel: #fff; --hoja: #fff; --tinta: #000; --tinta-2: #333; --linea: #999; }
  .pestanas, .cabecera, .escena, .no-imprimir, .salto { display: none !important; }
  main { padding: 0; border: 0; }
  .flujo { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .girando, .estado-consultando i { animation: none !important; border-top-color: var(--linea); }
  .btn-detener[data-armado]::after { animation: none !important; transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  /* con movimiento reducido, el paso del flujo se funde (sin desplazarse) en vez de cambiar de golpe */
  .panel.paso-entra { animation: paso-funde 200ms ease-out both !important; }
  @keyframes paso-funde { from { opacity: 0; } }
}

/* ---------- aviso de conexión arriba de la lista ---------- */
/* Sin conexión: el único aviso con fondo propio de la lista, porque es lo primero que hay que ver.
   Usa el plegado de la app (+/−); los pasos, en texto común. Conectado: una línea chica, sin caja. */
#aviso-conexion:empty { display: none; }
.conexion-ok { display: flex; align-items: center; gap: .4375rem; margin: 0 0 var(--e3); font-size: .875rem; font-weight: 600; color: color-mix(in srgb, var(--lista) 65%, var(--tinta)); }
.conexion-ok i { width: .625rem; height: .625rem; border-radius: 50%; flex: none; background: var(--lista); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lista) 22%, transparent); }
.conexion-falta { margin: 0 0 var(--e5); padding: 0 var(--e4); border: 0; border-radius: var(--r-chico); background: var(--error-suave); color: var(--error-tinta); }
.conexion-falta summary { min-height: 3.5rem; color: var(--error-tinta); font-size: 1.0625rem; font-weight: 700; padding-left: 1.75rem; position: relative; }
.conexion-falta summary::before {
  content: ""; position: absolute; left: 0; top: 50%; margin-top: -.5625rem; width: 1.125rem; height: 1.125rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19L12 4Z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19L12 4Z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.conexion-falta ol { margin: 0; padding: 0 0 var(--e4) 1.75rem; list-style: decimal; display: grid; gap: var(--e2); color: var(--tinta); line-height: 1.45; }
.conexion-falta li { padding-left: .25rem; }
.conexion-falta li::marker { font-weight: 700; color: var(--error-tinta); }
