@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fuentes/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fuentes/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --verde: #0e6b55; --verde-osc: #084536; --verde-claro: #e4f3ed;
  --rojo: #b42318; --rojo-claro: #fdeceb;
  --ambar: #8a5a00; --ambar-claro: #fff4dc;
  --azul: #2350c8; --azul-claro: #eaf0fd;
  --texto: #16201c; --texto-2: #5b6560; --borde: #dfe3df;
  --fondo: #f4f6f4; --blanco: #ffffff;
  --sombra: 0 1px 2px rgba(16,32,28,.06), 0 4px 16px rgba(16,32,28,.06);
  --radio: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  color: var(--texto); background: var(--fondo);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--fondo); }
main { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 40px); }
h1 { font-size: 1.6rem; margin: .4em 0; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; margin: 1.2em 0 .5em; font-weight: 700; }
h3 { font-size: 1.05rem; margin: .8em 0 .4em; }
p { line-height: 1.5; }
a { color: var(--azul); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.oculto { display: none !important; }
.texto-2 { color: var(--texto-2); }
.centro { text-align: center; }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fila-entre { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.crecer { flex: 1; min-width: 0; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--borde); background: var(--blanco); font-weight: 600; font-size: 1rem; text-decoration: none; color: var(--texto); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-principal { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-azul { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn-peligro { background: var(--blanco); border-color: var(--rojo); color: var(--rojo); }
.btn-plano { background: transparent; border-color: transparent; color: var(--azul); padding: 8px 10px; min-height: 40px; }
.btn-bloque { display: flex; width: 100%; }
.btn-pequeno { min-height: 38px; padding: 6px 12px; font-size: .92rem; }

/* Tarjetas y formularios */
.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; margin: 12px 0; box-shadow: var(--sombra); }
.tarjeta.verde { background: var(--verde-claro); border-color: #9fe1cb; }
.tarjeta.ambar { background: var(--ambar-claro); border-color: #f2d58b; }
.tarjeta.roja { background: var(--rojo-claro); border-color: #f4b8b2; }
label.campo { display: block; margin: 12px 0; font-weight: 600; }
label.campo > span { display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; font-size: 1.05rem; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid #8fb4ff; outline-offset: 1px; }
.error { color: var(--rojo); font-weight: 600; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #eeece6; font-size: .9rem; font-weight: 600; }
.chip.verde { background: var(--verde-claro); color: var(--verde-osc); }
.chip.ambar { background: var(--ambar-claro); color: var(--ambar); }
.chip.roja { background: var(--rojo-claro); color: var(--rojo); }
.chip.azul { background: var(--azul-claro); color: var(--azul); }

/* Carga */
.cargando { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; color: var(--texto-2); }
.rueda { width: 42px; height: 42px; border: 4px solid #d8d6cf; border-top-color: var(--verde); border-radius: 50%; animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* Pantalla de inicio */
.portada { text-align: center; padding-top: 4vh; }
.portada .logo { width: 96px; height: 96px; border-radius: 24px; }
.eleccion { display: grid; gap: 16px; margin-top: 24px; }
.eleccion .btn { min-height: 110px; font-size: 1.3rem; flex-direction: column; gap: 4px; }
.eleccion .btn small { font-weight: 400; font-size: .95rem; opacity: .9; }

/* ===== MODO MAYOR: todo grande ===== */
.mayor { font-size: 22px; }
.mayor h1 { font-size: 2rem; }
.mayor .reloj { font-size: 3.2rem; font-weight: 800; letter-spacing: -1px; line-height: 1; margin: 8px 0 0; }
.mayor .fecha { font-size: 1.15rem; color: var(--texto-2); margin: 4px 0 0; }
.toma-grande { background: var(--blanco); border: 3px solid var(--verde); border-radius: 22px; padding: 18px; margin: 18px 0; text-align: center; }
.toma-grande.tarde { border-color: var(--rojo); }
.toma-grande .hora { font-size: 1.1rem; font-weight: 700; color: var(--texto-2); }
.toma-grande .nombre { font-size: 1.7rem; font-weight: 800; margin: 8px 0 4px; line-height: 1.2; word-break: break-word; }
.toma-grande .cantidad { font-size: 1.5rem; font-weight: 700; color: var(--verde-osc); }
.toma-grande .instr { font-size: 1.15rem; margin-top: 6px; }
.fotos { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.fotos img { max-width: 48%; max-height: 170px; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid var(--borde); }
.btn-tomada { width: 100%; min-height: 96px; font-size: 1.6rem; font-weight: 800; border-radius: 20px; border: none; background: var(--verde); color: #fff; margin-top: 14px; box-shadow: 0 4px 0 var(--verde-osc); }
.btn-tomada:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--verde-osc); }
.btn-escuchar { font-size: 1.15rem; min-height: 64px; width: 100%; margin-top: 8px; }
.nada-ahora { text-align: center; padding: 26px 12px; background: var(--verde-claro); border-radius: 22px; margin: 18px 0; }
.nada-ahora .grande { font-size: 1.7rem; font-weight: 800; color: var(--verde-osc); }
.lista-hoy { list-style: none; padding: 0; margin: 0; }
.lista-hoy li { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--borde); font-size: 1.15rem; }
.lista-hoy .h { font-weight: 800; min-width: 3.2em; }
.lista-hoy .estado { font-size: 1.5rem; }
.aviso-activar { background: var(--ambar-claro); border: 2px solid #f2d58b; border-radius: 18px; padding: 16px; margin: 14px 0; }
.aviso-activar .btn { width: 100%; min-height: 70px; font-size: 1.3rem; margin-top: 10px; }
.mayor input.codigo { font-size: 2.2rem; text-align: center; letter-spacing: 6px; min-height: 76px; font-weight: 800; }
.mayor .btn { min-height: 64px; font-size: 1.25rem; }
.mayor .pie { margin-top: 40px; text-align: center; font-size: 1rem; }

/* Mensaje "Muy bien" */
.felicitacion { position: fixed; inset: 0; background: rgba(15,110,86,.96); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 60; text-align: center; padding: 24px; }
.felicitacion .tick { font-size: 7rem; line-height: 1; }
.felicitacion .txt { font-size: 2.4rem; font-weight: 800; margin-top: 12px; }

/* ===== MODO FAMILIA ===== */
.cabecera { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cabecera h1 { flex: 1; margin: 0; font-size: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pestanas { display: flex; gap: 6px; background: #e9e7e1; padding: 4px; border-radius: 12px; margin: 8px 0 12px; position: sticky; top: 0; z-index: 5; }
.pestanas button { flex: 1; border: none; background: transparent; padding: 10px 6px; border-radius: 9px; font-weight: 700; color: var(--texto-2); min-height: 44px; }
.pestanas button.activa { background: #fff; color: var(--texto); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.persona { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.persona .avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--verde-claro); color: var(--verde-osc); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; flex: none; }
.resumen-dia { display: flex; gap: 10px; flex-wrap: wrap; }
.toma-fila { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.toma-fila:last-child { border-bottom: none; }
.toma-fila .h { font-weight: 800; font-size: 1.05rem; min-width: 3.1em; padding-top: 14px; }
.toma-fila .miniatura, .med-fila .miniatura { width: 52px; height: 52px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--borde); flex: none; }
.miniatura.vacia { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: #f0eee8; }
.med-fila { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.med-fila:last-child { border-bottom: none; }
.med-fila .nombre { font-weight: 700; }
.horas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.codigo-grande { font-size: 2rem; font-weight: 800; letter-spacing: 4px; text-align: center; padding: 10px; background: #fff; border: 2px dashed var(--borde); border-radius: 12px; margin: 10px 0; user-select: all; }
.dias-semana { display: flex; gap: 6px; flex-wrap: wrap; }
.dias-semana button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--borde); background: #fff; font-weight: 800; }
.dias-semana button.si { background: var(--verde); border-color: var(--verde); color: #fff; }
.hora-fila { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.hora-fila input[type=time] { max-width: 150px; }
.resultados { list-style: none; margin: 8px 0; padding: 0; max-height: 50vh; overflow: auto; border: 1px solid var(--borde); border-radius: 10px; background: #fff; }
.resultados li { padding: 12px; border-bottom: 1px solid var(--borde); cursor: pointer; }
.resultados li:last-child { border-bottom: none; }
.resultados li:hover, .resultados li:focus { background: var(--verde-claro); }
.navegar-dia { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.navegar-dia strong { text-align: center; flex: 1; }

/* Ventana (modal) */
#capa:empty { display: none; }
.fondo-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--fondo); width: 100%; max-width: 760px; max-height: 94vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 24px); }
@media (min-width: 700px) { .fondo-modal { align-items: center; } .modal { border-radius: 20px; } }
.modal-pie { position: sticky; bottom: calc(-1 * (env(safe-area-inset-bottom) + 24px)); background: var(--fondo); padding: 12px 0 4px; display: flex; gap: 10px; }
.modal-pie .btn { flex: 1; }

#aviso-flotante { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18px); transform: translateX(-50%) translateY(150%);
  background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 80; max-width: 92vw; transition: transform .25s; font-weight: 600; text-align: center; }
#aviso-flotante.visible { transform: translateX(-50%) translateY(0); }
video.escaner { width: 100%; border-radius: 12px; background: #000; max-height: 50vh; }

/* ===== Iconos ===== */
.ico { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.22em; }
.ico.verde { color: var(--verde); } .ico.ambar { color: #c27c0e; } .ico.gris { color: #9aa39e; }
.chip .ico { width: 1em; height: 1em; }
.btn .ico { width: 1.25em; height: 1.25em; }
.btn-icono { padding: 8px; min-width: 44px; }
.con-ico { display: flex; gap: 6px; align-items: center; }
.titulo-seccion { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.titulo-seccion .ico { color: var(--verde); }
.logo-marca { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--verde); color: #fff; flex: none; }
.logo-marca .ico { width: 22px; height: 22px; transform: rotate(0deg); }
.cabecera .logo-marca { margin-right: 4px; }
.miniatura.vacia .ico { width: 26px; height: 26px; color: #8a9a92; }
.toma-grande .hora .ico, .toma-grande .instr .ico { color: inherit; }
.toma-grande.tarde .hora { color: var(--rojo); }
.btn-tomada .ico { width: 1.1em; height: 1.1em; vertical-align: -0.15em; stroke-width: 3; }
.nada-ahora .grande-ico { width: 64px; height: 64px; color: var(--verde); margin-bottom: 6px; }
.felicitacion .tick .ico { width: 8rem; height: 8rem; stroke-width: 2.5; }
.lista-hoy .estado .ico { width: 30px; height: 30px; }

/* ===== Portada ===== */
.inicio { max-width: 560px; padding-top: 0; }
.portada { text-align: left; padding-top: 0; }
.portada-foto { margin: 0 -16px; height: 340px; background-color: #2d4a40; background-size: cover; background-position: center 30%; border-radius: 0 0 26px 26px; overflow: hidden; position: relative; }
.portada-capa { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px 22px 26px;
  background: linear-gradient(180deg, rgba(8,30,24,.15) 0%, rgba(8,30,24,.25) 40%, rgba(8,30,24,.82) 100%); color: #fff; }
.portada-capa .marca { position: absolute; top: calc(env(safe-area-inset-top) + 18px); left: 20px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.portada-capa .marca .logo-marca { background: rgba(255,255,255,.95); color: var(--verde); }
.portada-capa h1 { font-size: 2rem; line-height: 1.12; margin: 0 0 10px; color: #fff; }
.portada-capa p { margin: 0; font-size: 1.05rem; opacity: .92; line-height: 1.45; }
.eleccion { display: grid; gap: 12px; margin-top: -22px; position: relative; z-index: 2; padding: 0 4px; }
.opcion { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--borde); border-radius: 18px; padding: 16px; box-shadow: var(--sombra); }
.opcion:active { transform: scale(.99); }
.opcion-ico { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.opcion-ico .ico { width: 28px; height: 28px; }
.opcion-ico.verde { background: var(--verde-claro); color: var(--verde); }
.opcion-ico.azul { background: var(--azul-claro); color: var(--azul); }
.opcion-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opcion-txt b { font-size: 1.15rem; }
.opcion-txt small { color: var(--texto-2); font-size: .95rem; }
.ventajas { list-style: none; padding: 0 8px; margin: 26px 0 8px; display: grid; gap: 14px; }
.ventajas li { display: flex; gap: 12px; align-items: flex-start; color: var(--texto-2); line-height: 1.4; }
.ventajas .ico { color: var(--verde); margin-top: 1px; }
.credito { font-size: .75rem; color: #9aa39e; text-align: center; margin-top: 24px; }
