/* caja.css — registro CAJA (tableta horizontal, claro y de alto contraste). Fuente de verdad: docs/maquetas/caja y SPEC §3.3.
   Atkinson Hyperlegible Next (Google Fonts, por <link> en cada página), fondo #eceee9, superficie #fff, tinta #16181a,
   ocupada #f2b33d, alerta #b42318, listo #2f6b3f, borde #c9cdd6 (en la maqueta #c9cdc6). Nada se mueve más de 160 ms. */
:root {
  --caja-fondo: #eceee9; --caja-superficie: #ffffff; --caja-tinta: #16181a; --caja-tinta-2: #4a4f52; --caja-borde: #c9cdc6;
  --caja-ocupada: #f2b33d; --caja-alerta: #b42318; --caja-listo: #2f6b3f; --caja-nuevo: #c2410c; --caja-miel: #fbe7c2; --caja-miel-tinta: #6b4300;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --t-fast: 160ms; --demo-h: 44px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", -apple-system, "Segoe UI", sans-serif; background: var(--caja-fondo); color: var(--caja-tinta);
       display: flex; flex-direction: column; font-size: 16px; line-height: 1.4; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
body > .app { flex: 1; min-height: 0; display: flex; position: relative; }
[hidden] { display: none !important; }
button { font: inherit; }
.meta { font-size: 13px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--caja-tinta); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* ===================== Caja · componentes (maquetas Main, Cocina, Premio) ===================== */
.lateral { width: 112px; flex-shrink: 0; background: #fff; border-right: 2px solid #d5d9d2; display: flex; flex-direction: column; gap: 6px; padding: 16px 10px; overflow-y: auto; }
.lateral a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; color: var(--caja-tinta);
             text-decoration: none; font-size: 15px; font-weight: 700; min-height: 44px; transition: background var(--t-fast); }
.lateral a:hover { background: #f4f5f2; }
.lateral a[aria-current="page"] { background: #16181a; color: #fff; }
.lateral svg { width: 26px; height: 26px; flex: none; }
.insignia { position: absolute; top: 6px; right: 14px; min-width: 24px; height: 24px; border-radius: 12px; color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0 6px; font-weight: 700; }
.insignia.naranja { background: var(--caja-nuevo); }
.insignia.roja { background: var(--caja-alerta); }
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 18px 20px 20px; gap: 14px; overflow-y: auto; }
.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.encabezado .izq { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.encabezado h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.encabezado .sub { font-size: 18px; font-weight: 600; }
.encabezado .der { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; flex-wrap: wrap; }
.pill-ejemplo { background: var(--caja-miel); color: var(--caja-miel-tinta); font-size: 14px; padding: 6px 10px; border-radius: 999px; font-weight: 700; }
.leyenda { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 15px; font-weight: 600; color: #3b3f3a; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.k1 { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.zonas { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.zona { display: flex; flex-direction: column; gap: 8px; }
.zona h2 { margin: 0; font-size: 16px; font-weight: 700; color: #3b3f3a; }
.rejilla { display: grid; gap: 10px; }
.rejilla.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rejilla.c8 { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.mesa { font: inherit; text-align: left; min-height: 74px; border-radius: 14px; border: 2px solid var(--caja-borde); background: #fff; color: var(--caja-tinta); padding: 10px 12px; display: flex;
        flex-direction: column; justify-content: space-between; cursor: pointer; gap: 4px; position: relative; }
.mesa .num { font-size: 22px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.mesa .est { font-size: 14px; color: #4a4f48; overflow-wrap: anywhere; }
.mesa.ocupada { background: var(--caja-ocupada); border-color: var(--caja-ocupada); }
.mesa.ocupada .est { color: var(--caja-tinta); font-weight: 600; }
.mesa.nuevo { border: 3px solid var(--caja-tinta); padding: 9px 11px; }
.mesa.nuevo .est { font-weight: 700; }
.mesa.alerta { background: var(--caja-alerta); border-color: var(--caja-alerta); color: #fff; }
.mesa.alerta .est { color: #fff; font-weight: 700; }
.mesa.cuenta { background: #16181a; border-color: #16181a; color: #fff; }
.mesa.cuenta .est { color: #fff; font-weight: 700; }
.mesa svg { width: 20px; height: 20px; }
.ahora { background: #fff; border-radius: 18px; border: 2px solid #d5d9d2; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.ahora h2 { margin: 0; font-size: 22px; font-weight: 800; }
.tarj { border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.tarj .linea { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tarj .tit { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.tarj .hora { font-size: 14px; font-weight: 600; }
.tarj .it { font-size: 16px; }
.tarj .nota { font-size: 14px; color: #3b3f3a; }
.tarj.roja { background: var(--caja-alerta); color: #fff; padding: 14px; gap: 10px; }
.tarj.roja .nota { color: #fff; font-size: 15px; }
.tarj.pedido { border: 3px solid #16181a; }
.tarj.cuenta { background: #f4f5f2; gap: 10px; }
.btn { font: inherit; font-size: 18px; font-weight: 800; min-height: 52px; border-radius: 12px; border: 0; cursor: pointer; padding: 0 16px; background: #16181a; color: #fff; transition: background var(--t-fast); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.blanco { background: #fff; color: var(--caja-alerta); }
.btn.contorno { background: #fff; color: #16181a; border: 2px solid #16181a; }
.btn.verde { background: var(--caja-listo); color: #fff; }
.btn.chico { font-size: 16px; min-height: 48px; }
.btn.fantasma { background: transparent; color: #16181a; border: 2px solid #c9cdc6; }
.vacio-caja { color: #3b3f3a; font-size: 16px; padding: 8px 0; }
/* Cocina */
.franja-miel { display: flex; align-items: center; gap: 14px; background: #fbe7c2; border-radius: 14px; padding: 12px 16px; color: #3d2a00; flex-wrap: wrap; }
.franja-miel svg { width: 26px; height: 26px; flex: none; }
.franja-miel .txt { flex: 1; min-width: 200px; font-size: 16px; }
.franja-miel .btn { background: transparent; color: #3d2a00; border: 2px solid #3d2a00; min-height: 48px; font-size: 16px; }
.columnas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.columna { background: #fff; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.columna h2 { margin: 0; font-size: 20px; font-weight: 800; display: flex; justify-content: space-between; }
.ticket { border: 2px solid var(--caja-borde); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ticket.nuevo { border: 3px solid #16181a; padding: 11px; }
.ticket.listo { border-color: var(--caja-listo); background: #e4f1e6; }
.ticket .cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ticket .cab .t { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.ticket .cab .h { font-size: 15px; font-weight: 700; white-space: nowrap; }
.ticket .linea-it { font-size: 17px; border-left: 6px solid var(--cat, #8b8078); padding-left: 8px; }
.ticket .nota-t { font-size: 15px; color: #3b3f3a; }
.ticket .listo-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; color: #1f4a2b; }
.ticket .listo-tag svg { width: 18px; height: 18px; }
.pill-alergia { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: var(--caja-alerta); color: #fff; font: inherit; font-size: 15px; font-weight: 800; padding: 5px 10px; border-radius: 8px; border: 0; min-height: 44px; cursor: pointer; }
.pill-alergia svg { width: 18px; height: 18px; }
.pill-alergia.ok { background: var(--caja-listo); cursor: default; }
/* Descuento de inventario y cancelar en el ticket de cocina */
.ticket .descuento { margin: 0; font-size: 15px; line-height: 1.4; background: #eef0ec; border-left: 6px solid var(--caja-listo); border-radius: 8px; padding: 8px 10px; color: #16181a; overflow-wrap: anywhere; }
.ticket .descuento b { font-weight: 800; }
.ticket .fila-btn { display: flex; gap: 8px; flex-wrap: wrap; }
.ticket .fila-btn .btn { flex: 1; min-width: 110px; }
.ticket .fila-btn .btn.fantasma { flex: 0 1 auto; min-width: 100px; }
.btn.rojo { background: var(--caja-alerta); color: #fff; }
.cancelar-conf { display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--caja-alerta); border-radius: 12px; padding: 10px; background: #fff; }
.cancelar-conf p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
/* Cuenta con servicio voluntario */
.cuenta-caja { display: flex; flex-direction: column; border-top: 2px solid #16181a; }
.cuenta-caja .r { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; font-size: 18px; border-bottom: 1px solid var(--caja-borde); }
.cuenta-caja .r.total { font-size: 22px; font-weight: 800; border-bottom: 0; }
.cuenta-caja .sw-der { display: inline-flex; align-items: center; gap: 8px; }
.sw-caja { width: 60px; min-height: 44px; border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sw-caja .riel { width: 52px; height: 30px; border-radius: 999px; background: #6b7068; padding: 3px; display: flex; transition: background var(--t-fast) var(--ease-out); }
.sw-caja .perilla { width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform var(--t-fast) var(--ease-out); }
.sw-caja[aria-checked="true"] .riel { background: var(--caja-listo); }
.sw-caja[aria-checked="true"] .perilla { transform: translateX(22px); }
.sw-caja:focus-visible, .ticket .btn:focus-visible { outline: 3px solid #16181a; outline-offset: 2px; }
/* Reservas, alertas, hoja */
.franja-h { display: flex; flex-direction: column; gap: 8px; }
.franja-h h2 { margin: 0; font-size: 18px; font-weight: 800; }
.fila-res { background: #fff; border-radius: 14px; padding: 12px 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border: 2px solid transparent; }
.fila-res .hora-g { font-size: 22px; font-weight: 800; min-width: 96px; }
.fila-res .datos { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.fila-res .datos .n { font-size: 18px; font-weight: 800; }
.fila-res .datos .d { font-size: 15px; color: #3b3f3a; }
.estado-pill { font-size: 14px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: #e3e6e0; color: #16181a; }
.estado-pill.Confirmada { background: #e4f1e6; color: #1f4a2b; }
.estado-pill.Reservada { background: var(--caja-miel); color: var(--caja-miel-tinta); }
.estado-pill.Cumplida { background: #e3e6e0; color: #3b3f3a; }
.hoja-fondo { position: fixed; inset: 0; background: rgba(22, 24, 26, .5); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 16px; }
.hoja { background: #fff; border-radius: 20px; padding: 22px; width: min(540px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.hoja h2 { margin: 0; font-size: 26px; font-weight: 800; }
.hoja .acciones { display: flex; gap: 10px; flex-wrap: wrap; }
.hoja .acciones .btn { flex: 1; min-width: 140px; }
.hoja label.chk { display: flex; align-items: center; gap: 10px; font-size: 17px; min-height: 44px; }
.hoja input[type=checkbox] { width: 24px; height: 24px; }
.opciones-mesa { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.opciones-mesa button { font: inherit; min-height: 64px; border-radius: 12px; border: 2px solid var(--caja-borde); background: #fff; font-size: 18px; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.opciones-mesa button small { font-size: 13px; font-weight: 600; }
.opciones-mesa button[aria-pressed="true"] { background: #16181a; color: #fff; border-color: #16181a; }
.toasts { position: fixed; top: 14px; right: 14px; z-index: 500; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 28px)); }
.toast-pedido { background: #16181a; color: #fff; border-radius: 14px; padding: 14px 16px; font-size: 18px; font-weight: 800; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); border-left: 8px solid var(--caja-ocupada); }
.alerta-card { border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fff; border: 2px solid #c9cdc6; }
.alerta-card.roja { background: var(--caja-alerta); color: #fff; border-color: var(--caja-alerta); }
.alerta-card.miel { background: var(--caja-miel); border-color: #e8c98a; color: #3d2a00; }
.alerta-card .cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 18px; font-weight: 800; flex-wrap: wrap; }
.alerta-card .hilo { background: rgba(255, 255, 255, .16); border-radius: 10px; padding: 8px 10px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.alerta-card.miel .hilo { background: rgba(255, 255, 255, .6); }
.alerta-card textarea { font: inherit; font-size: 16px; min-height: 76px; border-radius: 10px; border: 2px solid #c9cdc6; padding: 10px; width: 100%; resize: vertical; color: #16181a; }
.dos-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.lista-col { display: flex; flex-direction: column; gap: 12px; }
.lista-col h2 { margin: 0; font-size: 20px; font-weight: 800; }
/* Tarjetas (Premio) */
.k4 { display: flex; gap: 18px; align-items: flex-start; }
.k4 .izq { width: 340px; flex: none; display: flex; flex-direction: column; gap: 14px; }
.k4 .der { flex: 1; min-width: 0; }
.escaner { background: #16181a; border-radius: 18px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 22px; min-height: 200px; text-align: center; }
.escaner svg { width: 64px; height: 64px; }
.escaner .t { font-size: 18px; font-weight: 700; }
.cercanas { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.cercanas button { font: inherit; min-height: 48px; border-radius: 12px; border: 2px solid #4a4f52; background: transparent; color: #fff; font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; cursor: pointer; }
.buscar-fila { display: flex; gap: 8px; width: 100%; }
.buscar-fila input { flex: 1; min-width: 0; font: inherit; font-size: 16px; min-height: 48px; border-radius: 12px; border: 2px solid #4a4f52; background: #fff; padding: 0 12px; }
.buscar-fila .btn { min-height: 48px; font-size: 16px; background: #f2b33d; color: #16181a; }
.hoy-caja { background: #fff; border-radius: 16px; padding: 4px 14px; }
.hoy-caja div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #e3e6e0; font-size: 16px; gap: 8px; }
.hoy-caja div:last-child { border-bottom: 0; }
.hoy-caja b { font-variant-numeric: tabular-nums; }
.tarjeta-esc { background: #fff; border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.tarjeta-esc h2 { margin: 0; font-size: 32px; font-weight: 800; }
.circulos { display: grid; grid-template-columns: repeat(var(--meta, 8), minmax(0, 1fr)); gap: 12px; }
.circulos span { aspect-ratio: 1; border-radius: 50%; background: #e3e6e0; display: flex; align-items: center; justify-content: center; color: #16181a; }
.circulos span.lleno { background: #f2b33d; }
.circulos span svg { width: 60%; height: 60%; }
.sumar { display: flex; gap: 12px; flex-wrap: wrap; }
.sumar .btn { flex: 1; min-width: 90px; min-height: 64px; font-size: 24px; }
.aviso-anti { background: var(--caja-miel); color: var(--caja-miel-tinta); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 700; }
.premio-pantalla { background: #16181a; color: #fff; border-radius: 24px; padding: 40px 44px; display: flex; flex-direction: column; gap: 26px; min-height: 560px; }
.premio-pantalla .quien { font-size: 20px; font-weight: 700; color: #c9cdc6; }
.premio-pantalla .gran { font-size: 92px; line-height: .95; font-weight: 800; letter-spacing: -0.02em; }
.premio-pantalla .circulos span.lleno { background: #f2b33d; }
.premio-pantalla .circulos span:last-child.lleno { background: #fff; }
.premio-pantalla .pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-top: 2px solid #3b3f3a; padding-top: 22px; flex-wrap: wrap; }
.premio-pantalla .pie .p1 { font-size: 18px; color: #c9cdc6; }
.premio-pantalla .pie .p2 { font-size: 40px; font-weight: 800; display: block; }
.premio-pantalla .pie .p3 { font-size: 17px; color: #c9cdc6; }
.premio-pantalla .pie .p4 { font-size: 30px; font-weight: 800; }
.premio-pantalla .botones { margin-top: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.premio-pantalla .botones .btn { font-size: 24px; min-height: 76px; border-radius: 18px; flex: 1; background: #fff; color: #16181a; }
.premio-pantalla .botones .btn.desp { flex: none; font-size: 18px; padding: 0 22px; background: transparent; color: #fff; border: 2px solid #6b7068; }
.premio-pantalla .nota-p { font-size: 16px; color: #c9cdc6; }
.resultados-b { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.resultados-b button { font: inherit; min-height: 48px; border-radius: 12px; border: 2px solid #4a4f52; background: transparent; color: #fff; font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; cursor: pointer; }
.mz-estado { color: var(--caja-tinta); }
.mz-estado p { color: #3b3f3a; font-size: 18px; }
.mz-estado h2 { font-family: inherit; font-size: 24px; font-weight: 800; }
.mz-estado button { background: #16181a; font-family: inherit; font-size: 18px; }
.banner-reconectando { --banner-fondo: #fff; --banner-tinta: #16181a; --banner-borde: #c9cdc6; --banner-boton: #16181a; }

/* ===================== Movimiento de la Caja (docs/ANIMACIONES.md) =====================
   Solo transform y opacity. Sin rebotes y nada más de 240 ms. Todo ocurre por un evento; en reposo nada se mueve. */
/* Mesa: el color anterior se desvanece encima del nuevo (opacity 160 ms) para que el cambio de estado se lea sin mover nada. */
.mesa > * { position: relative; z-index: 1; }
.mesa .fundido { position: absolute; inset: -2px; z-index: 0; border: 2px solid; border-radius: 14px; pointer-events: none; animation: caja-fundido var(--t-fast) linear both; }
@keyframes caja-fundido { from { opacity: 1; } to { opacity: 0; } }
/* Tarjeta «Nuevo pedido · Mesa N», aviso superior y ticket nuevo de la cocina: entran desde donde llegan. */
.tarj.entra-nuevo { animation: caja-entra 240ms var(--ease-out) both; }
@keyframes caja-entra { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.toast-pedido { animation: caja-toast 200ms var(--ease-out) both; }
.toast-pedido.sale { animation: caja-toast-sale var(--t-fast) var(--ease-out) forwards; }
@keyframes caja-toast { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes caja-toast-sale { to { opacity: 0; transform: translateX(24px); } }
.ticket.tk-entra { animation: caja-tk-entra 200ms var(--ease-out) both; }
@keyframes caja-tk-entra { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
/* Sello que se estampa: círculo nuevo de la tarjeta, 240 ms sin rebote; con +2 y +3 se escalonan 70 ms. */
.circulos span.sello-nuevo { animation: caja-sello 240ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes caja-sello { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .toast-pedido.sale { animation-name: caja-toast-sale; }
  .mesa .fundido { animation-duration: 120ms !important; }
  .tarj.entra-nuevo, .ticket.tk-entra, .toast-pedido, .circulos span.sello-nuevo { animation-name: caja-solo-fundido; }
  @keyframes caja-solo-fundido { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 1099px) {
  .k1 { grid-template-columns: minmax(0, 1fr); }
  .ahora { position: static; order: -1; }
  .ahora .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
  .k4 { flex-direction: column; }
  .k4 .izq { width: 100%; }
  .k4 .der { width: 100%; }
  .columnas { grid-template-columns: minmax(0, 1fr); }
  .dos-col { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .columnas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .columna { padding: 10px; }
  .ticket .cab .t { font-size: 18px; }
  .ticket .linea-it { font-size: 15px; }
}
@media (max-width: 767px) {
  body > .app { flex-direction: column; }
  .principal { order: 1; padding: 12px; }
  .lateral { order: 2; width: auto; flex-direction: row; border-right: 0; border-top: 2px solid #d5d9d2; padding: 4px; gap: 2px; overflow: visible; }
  .lateral a { flex: 1; min-width: 0; padding: 6px 2px; font-size: 13px; gap: 2px; }
  .lateral svg { width: 24px; height: 24px; }
  .insignia { top: 0; right: 4px; min-width: 20px; height: 20px; font-size: 12px; }
  .encabezado h1 { font-size: 24px; }
  .encabezado .der { font-size: 15px; }
  .rejilla.c5, .rejilla.c8 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .premio-pantalla { padding: 24px 18px; }
  .premio-pantalla .gran { font-size: 64px; }
  .premio-pantalla .pie .p2 { font-size: 30px; }
  /* F-09: a 390 px «¡Ganaste!» + la mascota no caben en una fila; el texto cede y la mascota se achica para quedar dentro del panel. */
  .premio-pantalla .cab-premio { gap: 10px; }
  .premio-pantalla .cab-premio > div { min-width: 0; }
  .premio-pantalla .gran { font-size: clamp(40px, 13vw, 64px); overflow-wrap: anywhere; }
  .premio-pantalla .cab-premio .mz-cab { flex-shrink: 1; min-width: 0; max-width: 28%; max-height: 84px; }
  .hoja-fondo { align-items: flex-end; padding: 0; }
  .hoja { border-radius: 20px 20px 0 0; width: 100%; }
}
.hoja .acciones #h-pagar { flex-basis: 100%; }

/* ---------- Tiempos de espera: barra y cocina ---------- */
.barra-estacion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.selector-est { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border: 2px solid var(--caja-borde); border-radius: 14px; }
.selector-est button { font: inherit; font-size: 17px; font-weight: 800; min-height: 44px; min-width: 88px; padding: 0 16px; border-radius: 10px; border: 0; background: transparent; color: var(--caja-tinta); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background var(--t-fast), color var(--t-fast); }
.selector-est button[aria-checked="true"] { background: var(--caja-tinta); color: #fff; }
.selector-est .n-atr { background: var(--caja-alerta); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; padding: 0 6px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.r-sonido { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; font-weight: 700; }
.r-sonido .sw-caja { background: none; border: 0; padding: 0; min-width: 52px; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }

.franja-atrasados { background: var(--caja-alerta); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.franja-atrasados h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.franja-atrasados h2 svg { width: 22px; height: 22px; flex: none; }
.franja-atrasados ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.franja-atrasados li { font-size: 17px; font-weight: 700; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .45); overflow-wrap: anywhere; }
.franja-atrasados li:first-child { border-top: 0; padding-top: 0; }
.franja-atrasados .cron { font-variant-numeric: tabular-nums; }

.ticket .tiempo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 10px; background: #e4f1e6; color: #1f4a2b; font-weight: 800; transition: background var(--t-fast), color var(--t-fast); }
.ticket .tiempo.e-por_vencerse { background: var(--caja-miel); color: var(--caja-miel-tinta); }
.ticket .tiempo.e-atrasado { background: var(--caja-alerta); color: #fff; }
.ticket .tiempo.e-terminado { background: #eef0ec; color: var(--caja-tinta); }
.ticket .tiempo .t-est { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.ticket .tiempo .cron { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ticket .tiempo .est-t { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; }
.ticket .tiempo .est-t svg { width: 18px; height: 18px; flex: none; }
.ticket .tiempo .meta-t { font-size: 15px; font-weight: 700; margin-left: auto; }
.ticket.por-vencerse { border-color: #c98a00; }
.ticket.atrasado { border: 3px solid var(--caja-alerta); padding: 11px; }
.ticket .est-tag { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border: 1px solid currentColor; border-radius: 6px; padding: 0 5px; margin-left: 4px; vertical-align: middle; }
.insignia.izq { top: 6px; left: 4px; right: auto; }

@media (max-width: 1099px) {
  .ticket .tiempo .cron { font-size: 22px; }
  .ticket .tiempo .meta-t { margin-left: 0; }
  .selector-est button { min-width: 72px; padding: 0 12px; }
}
@media (max-width: 767px) { .insignia.izq { top: 0; left: 2px; right: auto; } }
@media (prefers-reduced-motion: reduce) {
  .selector-est button, .ticket .tiempo { transition: none; }
}
.ticket .estacion-lista { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-height: 44px; font-size: 17px; font-weight: 800; color: #1f4a2b; }
.ticket .estacion-lista svg { width: 20px; height: 20px; }

/* Bar real (MODO=produccion): las cifras son de verdad, sin letreros «de ejemplo». */
html.produccion .pill-demo, html.produccion .pill-ejemplo, html.produccion .d-pill { display: none !important; }

/* Turnos: teclado de PIN y quién está en turno (tableta). */
.turnos-grid { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
.turno-pin, .turno-ahora { background: var(--caja-superficie); border: 1px solid var(--caja-borde); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.turno-pin h2, .turno-ahora h2 { margin: 0; font-size: 24px; }
.puntos { display: flex; gap: 14px; justify-content: center; padding: 6px 0; }
.puntos .punto { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--caja-tinta); box-sizing: border-box; }
.puntos .punto.lleno { background: var(--caja-tinta); }
.teclado { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.teclado .tecla { min-height: 64px; border-radius: 16px; border: 1px solid var(--caja-borde); background: #f4f5f1; color: var(--caja-tinta); font: inherit; font-size: 28px; font-weight: 700; cursor: pointer; }
.teclado .tecla.txt, .teclado .tecla.ok { font-size: 18px; }
.teclado .tecla.ok { background: var(--caja-tinta); color: #fff; border: 0; }
.teclado .tecla[disabled] { opacity: .45; cursor: default; }
.turno-der { display: flex; flex-direction: column; gap: 18px; }
.turno-estado { background: var(--caja-tinta); color: #fff; border-radius: 24px; padding: 26px 28px; display: flex; flex-direction: column; gap: 8px; }
.turno-estado.quieto { background: var(--caja-superficie); color: var(--caja-tinta); border: 1px solid var(--caja-borde); }
.turno-estado.error { background: #fdecea; color: var(--caja-alerta); border: 2px solid var(--caja-alerta); }
.turno-estado .t-peq { font-size: 17px; font-weight: 700; opacity: .85; }
.turno-estado .t-grande { font-size: 44px; line-height: 1.05; font-weight: 800; }
.turno-estado .t-med { font-size: 20px; }
.turno-estado .t-nota { font-size: 17px; font-weight: 700; color: var(--caja-ocupada); }
.turno-ahora .fila { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--caja-borde); font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .turnos-grid { grid-template-columns: minmax(0, 1fr); } }

/* K7 Chat */
.ch-aviso { background: var(--caja-miel); color: var(--caja-miel-tinta); border-radius: 14px; padding: 12px 16px; line-height: 1.45; max-width: 760px; margin: 0 0 14px; }
.ch-tabs, .ch-como { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ch-tabs button, .ch-como button { min-height: 48px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--caja-borde); background: var(--caja-superficie); color: var(--caja-tinta); font-weight: 700; cursor: pointer; }
.ch-tabs button[aria-pressed="true"], .ch-como button[aria-pressed="true"] { background: var(--caja-tinta); color: #fff; border-color: var(--caja-tinta); }
.ch-chat { max-width: 760px; display: flex; flex-direction: column; border: 1px solid var(--caja-borde); border-radius: 20px; background: var(--caja-superficie); overflow: hidden; }
.ch-hilo { height: min(46vh, 440px); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ch-b { max-width: 78%; padding: 10px 14px; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-b.cliente { align-self: flex-end; background: var(--caja-fondo); border: 1px solid var(--caja-borde); }
.ch-b.bot, .ch-b.sistema { align-self: flex-start; background: #e6efe4; border: 1px solid #b9cfb4; }
.ch-b.humano { align-self: flex-start; background: #e3edf7; border: 1px solid #aac4de; }
.ch-b small { display: block; margin-top: 4px; font-size: 13px; color: var(--caja-tinta-2); } .ch-b .et { color: #1d4f80; font-weight: 700; margin: 0 0 4px; }
.ch-vacio { margin: auto; text-align: center; color: var(--caja-tinta-2); max-width: 380px; }
.ch-como { padding: 0 14px; margin: 8px 0; }
.ch-form { display: flex; gap: 10px; padding: 0 14px 14px; }
.ch-form input { flex: 1; min-width: 0; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--caja-borde); font: inherit; }
.ch-err { color: var(--caja-alerta); margin: 8px 0 0; min-height: 1.3em; }
