:root {
  --tinta: #16181d; --suave: #5d626b; --fondo: #f5f3ee; --tarjeta: #fff; --borde: #e3ded3; --marca: #b08428;
  --acento: #1b1d22; --sobre-acento: #fff; --ok: #1d7a4f; --alerta: #b45309; --mal: #b3261e; --radio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tinta); background: var(--fondo);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; } a { color: inherit; }
.contenedor { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.contenedor.ancho { max-width: 1040px; }
.contenedor.chico { max-width: 440px; padding-top: 40px; }
.pila { display: flex; flex-direction: column; gap: 12px; }
.pila.g { gap: 20px; }
.linea { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.linea.entre { justify-content: space-between; }
.crece { flex: 1 1 auto; min-width: 0; }
.suave { color: var(--suave); } .chica { font-size: .875rem; } .fuerte { font-weight: 650; } .centro { text-align: center; }
.oculto { display: none !important; }

.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; }
.tarjeta.toca { cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; display: block; transition: border-color .15s, box-shadow .15s; }
.tarjeta.toca:hover { border-color: var(--tinta); }
.tarjeta.elegida { border-color: var(--acento); box-shadow: 0 0 0 2px var(--acento) inset; }

.btn { appearance: none; border: 1px solid var(--acento); background: var(--acento); color: var(--sobre-acento); font: inherit; font-weight: 650;
  padding: 12px 18px; border-radius: 12px; min-height: 48px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sec { background: transparent; color: var(--tinta); border-color: var(--borde); }
.btn.sec:hover { border-color: var(--tinta); }
.btn.peligro { background: transparent; color: var(--mal); border-color: #e6c1bd; }
.btn.wa { background: #128c4a; border-color: #128c4a; color: #fff; }
.btn.chico { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn.todo { width: 100%; }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-size: .875rem; font-weight: 600; }
.campo small { color: var(--suave); font-size: .8rem; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--tinta); background: #fff; border: 1px solid #cfc9bc; border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 46px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .tarjeta.toca:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--acento); padding: 0; }
input[type=color] { padding: 4px; width: 64px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chips.envuelve { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; border: 1px solid var(--borde); background: #fff; color: var(--tinta); font: inherit; border-radius: 12px; padding: 9px 14px; min-height: 44px; cursor: pointer; text-align: center; line-height: 1.15; }
.chip small { display: block; color: var(--suave); font-size: .75rem; }
.chip.activo { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.chip.activo small { color: inherit; opacity: .85; }
.chip:disabled { opacity: .4; cursor: default; text-decoration: line-through; }
.horas { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }

.etq { display: inline-block; font-size: .75rem; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: #ece8df; color: var(--tinta); white-space: nowrap; }
.etq.ok { background: #dff3e8; color: #115c39; } .etq.alerta { background: #fdebd0; color: #8a4204; } .etq.mal { background: #fbe1df; color: #8f1d17; } .etq.info { background: #e1ebfb; color: #1c4587; }

.barra { position: sticky; top: 0; z-index: 5; background: var(--tinta); color: #fff; padding: 10px 16px; margin: 0 calc(-1 * env(safe-area-inset-right)) 0 calc(-1 * env(safe-area-inset-left)); }
.barra .linea { max-width: 1040px; margin: 0 auto; }
.barra .marca { color: #e3c27a; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.barra .btn.sec { color: #fff; border-color: #444953; }
.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 1040px; margin: 8px auto 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: none; border: 0; color: #c9ccd3; font: inherit; font-weight: 600; padding: 9px 12px; border-radius: 10px; cursor: pointer; min-height: 42px; }
.tab.activo { background: #fff; color: var(--tinta); }
.franja { padding: 10px 16px; font-size: .9rem; text-align: center; }
.franja.alerta { background: #fdebd0; color: #7a3a03; } .franja.mal { background: #fbe1df; color: #7d1914; } .franja.info { background: #e1ebfb; color: #1c4587; }

.fila { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.fila:last-child { border-bottom: 0; }
button.fila { background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hora { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 52px; }
.tachado { text-decoration: line-through; color: var(--suave); }
.numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.numero b { display: block; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.medidor { height: 8px; border-radius: 99px; background: #ece8df; overflow: hidden; }
.medidor i { display: block; height: 100%; background: var(--acento); border-radius: 99px; }
.semana { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

dialog.hoja { border: 0; padding: 0; background: var(--tarjeta); color: var(--tinta); width: min(560px, 100%); max-width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; margin: auto auto 0; }
dialog.hoja::backdrop { background: rgba(20, 22, 27, .55); }
dialog.hoja .cab { position: sticky; top: 0; background: var(--tarjeta); padding: 14px 16px; border-bottom: 1px solid var(--borde); display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 1; }
dialog.hoja .cuerpo { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { dialog.hoja { border-radius: 18px; margin: auto; } }
.cerrar { background: none; border: 0; font-size: 1.6rem; line-height: 1; width: 44px; height: 44px; cursor: pointer; color: var(--suave); border-radius: 10px; }

.pie-fijo { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--borde); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 4; }
.pie-fijo > div { max-width: 688px; margin: 0 auto; }
#avisos { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.aviso { background: var(--tinta); color: #fff; padding: 12px 16px; border-radius: 12px; max-width: 520px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); pointer-events: auto; }
.aviso.mal { background: var(--mal); } .aviso.ok { background: var(--ok); }

.cabecera-negocio { display: flex; gap: 14px; align-items: center; padding: 8px 0 4px; }
.cabecera-negocio img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: #fff; border: 1px solid var(--borde); }
.paso-n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--acento); color: var(--sobre-acento); font-size: .8rem; font-weight: 700; align-items: center; justify-content: center; margin-right: 8px; }
.resumen { background: #faf8f3; border: 1px dashed #cfc9bc; border-radius: 12px; padding: 12px 14px; }
.legal h2 { margin: 26px 0 8px; } .legal p, .legal li { margin: 8px 0; } .legal ul { padding-left: 20px; }
.pie { text-align: center; color: var(--suave); font-size: .8rem; padding: 24px 0 8px; }
pre.codigo { background: #1b1d22; color: #e9e6df; padding: 12px; border-radius: 10px; overflow-x: auto; font-size: .8rem; white-space: pre-wrap; word-break: break-all; margin: 0; }
@media (max-width: 420px) { .dos { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) { dialog.hoja[open] { animation: sube .18s ease-out; } @keyframes sube { from { transform: translateY(24px); opacity: 0; } } }
