/* Síguelo On Book · app del conductor. Misma piel que On Mix Conductor y las apps de On Bus: cabecera tinta con la
   patente en amarillo, una columna, letras y botones grandes para usar en la cabina (también al sol), pestañas abajo. */
html, body { background: var(--bg); color-scheme: light; }
body.cd { min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.cd-barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.cd-marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cd-marca img { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.cd-marca div { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.cd-marca b { font-weight: 600; font-size: 15px; white-space: nowrap; }
.cd-marca span { font-size: 12px; color: var(--marca); }
.cd-acc { display: flex; align-items: center; gap: 8px; }
.cd-patente { border: 0; background: var(--marca); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: 600 15px var(--mono); color: var(--ink); letter-spacing: .03em; white-space: nowrap; }
.cd-patente.sin { background: transparent; color: var(--marca); border: 1px dashed var(--marca); font: 600 13px var(--sans); }
.cd-icono { width: 40px; height: 40px; border-radius: 8px; border: 1px solid #3A414C; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.cd-red { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #1E7B3A; color: #fff; white-space: nowrap; }
.cd-red.cola { background: #B45309; }
.cd-red.sin { background: var(--red); }
.cd-red i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }

.cd-contenido { max-width: 560px; margin: 0 auto; padding: 14px 14px 0; display: flex; flex-direction: column; gap: 12px; }
.cd-cargando { text-align: center; color: var(--muted); padding: 40px 0; }
.cd-saludo { font-size: 15px; color: var(--ink-2); }
.cd-saludo b { color: var(--ink); }
.cd-tarjeta { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cd-tarjeta h2 { font-size: 17px; font-weight: 600; }
.cd-titulo { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
.cd-aviso { border-radius: 12px; padding: 12px 14px; font-size: 15px; display: flex; flex-direction: column; gap: 10px; }
.cd-aviso.marca { background: var(--marca-suave); color: var(--marca-texto); }
.cd-aviso.info { background: var(--amber-soft); color: var(--amber-ink); }
.cd-aviso.error { background: var(--red-soft); color: #7A1A12; }
.cd-aviso.ok { background: var(--green-soft); color: #14532D; }
.cd-aviso b { font-weight: 600; }

/* Estado actual */
.cd-estado-act { border-radius: 16px; padding: 18px 16px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); background: var(--card); position: relative; overflow: hidden; }
.cd-estado-act::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--act-f); }
.cd-estado-act.ac-CONDUCCION::before { background: var(--act-c); }
.cd-estado-act.ac-ESPERA::before { background: var(--act-e); }
.cd-estado-act.ac-DESCANSO::before { background: var(--act-d); }
.cd-estado-act .et { font-size: 13px; color: var(--muted); font-weight: 500; }
.cd-estado-act .act { font-size: 26px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.cd-estado-act .act .dot { width: 12px; height: 12px; }
.cd-reloj { font: 600 46px/1.05 var(--mono); letter-spacing: -.02em; }
.cd-estado-act .desde { font-size: 14px; color: var(--ink-2); }
.cd-estado-act .lb-medidor { margin-top: 10px; }
.cd-estado-act .lb-medidor small { font-size: 12px; }

/* Botones (iguales a On Mix) */
.cd-boton { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; width: 100%; border-radius: 12px; border: 1px solid #D0D5DD;
  background: var(--card); color: var(--ink); font: 600 16px var(--sans); text-decoration: none; cursor: pointer; padding: 0 16px; text-align: center; }
.cd-boton.primario { background: var(--marca); border-color: var(--marca); }
.cd-boton.oscuro { background: var(--ink); border-color: var(--ink); color: #fff; }
.cd-boton.peligro { color: var(--red); border-color: #F2C9C4; }
.cd-boton.grande { min-height: 72px; font-size: 21px; box-shadow: 0 2px 0 #E0B800; }
.cd-boton:disabled { opacity: .6; cursor: default; }
.cd-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cd-acciones .cd-boton { font-size: 15px; gap: 8px; padding: 0 10px; }
.cd-arriba { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cd-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cd-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; border-radius: 14px; border: 1.5px solid #D0D5DD; background: var(--card); color: var(--ink); font: 600 16px var(--sans); cursor: pointer; padding: 10px 6px; position: relative; }
.cd-act svg { width: 28px; height: 28px; }
.cd-act.ac-CONDUCCION svg { color: var(--act-c); } .cd-act.ac-ESPERA svg { color: var(--act-e); } .cd-act.ac-DESCANSO svg { color: var(--act-d); }
.cd-act.actual { background: var(--ink); border-color: var(--ink); color: #fff; cursor: default; }
.cd-act.actual svg { color: var(--marca); }
.cd-act.actual::after { content: 'Ahora'; position: absolute; top: 8px; right: 8px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--marca); }
.cd-act:not(.actual):active { transform: translateY(1px); }

/* Hoy en 24 h (una pista) */
.cd-pista { position: relative; height: 26px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px calc(100% / 24)), var(--soft); overflow: hidden; border: 1px solid var(--line); }
.cd-pista .lb-seg { top: 4px; bottom: 4px; }
.cd-horas { display: flex; justify-content: space-between; font: 500 10px var(--mono); color: var(--muted); }
.cd-totales { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cd-total { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.cd-total span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cd-total b { font: 600 20px var(--mono); }

/* Listas */
.cd-hitos { list-style: none; padding: 0; margin: 0; }
.cd-hitos li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0 10px 24px; position: relative; font-size: 15px; border-bottom: 1px solid var(--line-2); }
.cd-hitos li:last-child { border-bottom: 0; }
.cd-hitos li::before { content: ''; position: absolute; left: 3px; top: 50%; width: 11px; height: 11px; margin-top: -6px; border-radius: 50%; background: var(--ink); }
.cd-hitos li.ac-CONDUCCION::before { background: var(--act-c); } .cd-hitos li.ac-ESPERA::before { background: var(--act-e); } .cd-hitos li.ac-DESCANSO::before { background: var(--act-d); }
.cd-hitos li div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cd-hitos small { color: var(--muted); font-size: 12px; }
.cd-hitos .h { font: 600 15px var(--mono); }
.cd-fila-dato { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.cd-fila-dato:last-child { border-bottom: 0; }
.cd-fila-dato span:first-child { color: var(--muted); }
.cd-fila-dato span:last-child { text-align: right; font-weight: 500; }
.cd-codigo { font: 600 16px var(--mono); letter-spacing: .04em; color: var(--ink); text-decoration-color: var(--marca-naranjo); }
.cd-vacio { text-align: center; padding: 28px 16px; color: var(--muted); }
.cd-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.cd-chips .filtro { flex-shrink: 0; }

/* Mi libreta en el celular: la grilla de 96 tramos cabe en la pantalla */
.cd .lb-dia { overflow: hidden; }
.cd .lb-rejilla { min-width: 0; grid-template-columns: 44px minmax(0, 1fr) 42px; padding: 8px 10px 10px; }
.cd .lb-rejilla .et { font-size: 10px; letter-spacing: 0; }
.cd .lb-rejilla .et .dot { display: none; }
.cd .lb-rejilla .et .l { display: none; }
.cd .lb-rejilla .et .c { display: inline; }
.cd .lb-rejilla .tt { font-size: 11px; }
.cd .lb-horas-dia span:not(:nth-child(6n+1)) { visibility: hidden; }
.cd .lb-tramos { height: 20px; }
.cd .lb-tramos span { border-right-color: transparent; }
.cd .lb-tramos span.h { border-right-color: var(--line-2); }
.cd .lb-dia-cab { padding: 10px 12px; }

/* Pestañas (iguales a las apps de On Bus) */
.app-tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 640px; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px max(10px, env(safe-area-inset-bottom)); }
.app-tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 500; text-decoration: none; padding: 4px 0; position: relative; }
.app-tabs a svg { width: 46px; height: 28px; padding: 3px 12px; border-radius: 999px; }
.app-tabs a.on { color: var(--ink); font-weight: 600; }
.app-tabs a.on svg { background: var(--marca); }
.app-tabs a .n { position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font: 600 11px/18px var(--mono); text-align: center; padding: 0 5px; }
.animo { background: var(--marca); color: var(--ink); border-radius: 14px; padding: 16px; font-size: 18px; font-weight: 600; text-align: center; line-height: 1.35; }
.cd-pie { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0 4px; }
.cd .modal-fondo { padding: 12px; align-items: flex-end; }
.cd .modal { border-radius: 18px; }
.cd .modal-pie .btn { flex: 1; min-height: 50px; font-size: 16px; }
.cd .campo { min-height: 46px; font-size: 16px; }
.cd .login .campo { min-height: 50px; font-size: 17px; }
@media (min-width: 600px) { .cd .modal-fondo { align-items: flex-start; padding: 40px 16px; } }
.cd .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
