/* KUADRA · estilos. Colores medidos en marca/IDENTIDAD-DE-MARCA.md:
   tinta sobre blanco; el degradado cian→menta vive SOLO en el símbolo; el semáforo no sale de esta paleta.
   Principios de la decisión 87: botones grandes, pocos números por pantalla, siempre poder volver. */
:root {
  --tinta: #111827; --apoyo: #42586A; --fondo: #FFFFFF; --superficie: #F4F6F8; --linea: #D9DEE3;
  --acento: #0E7C86;           /* cian oscurecido para que pase 4.5:1 sobre blanco; el cian puro es del símbolo */
  --rojo: #B42318; --ambar: #8A5A00; --verde: #1F7A3D;   /* semáforo: información, no marca */
  --radio: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --tinta: #EEF1F4; --apoyo: #A7B4C0; --fondo: #0D1117; --superficie: #161B22; --linea: #2B333C; --acento: #3FD4D4;
          --rojo: #FF8A80; --ambar: #F5C26B; --verde: #7BD99A; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta);
  font: 400 1.0625rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; padding-bottom: 6rem; }
.num, .cifra dd, .credencial dd.num { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
a { color: var(--acento); }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

.encabezado { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--linea); position: sticky; top: 0; background: var(--fondo); z-index: 2; }
.marca { display: flex; align-items: center; gap: .6rem; color: var(--tinta); text-decoration: none; min-width: 0; }
.simbolo { width: 32px; height: 32px; flex: none; }
.negocio { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.encabezado-derecha { display: flex; gap: .5rem; flex: none; }
.boton-encabezado { min-height: 44px; display: inline-flex; align-items: center; padding: 0 .8rem; border: 1px solid var(--linea);
  border-radius: var(--radio); color: var(--tinta); text-decoration: none; font-weight: 600; }
.boton-encabezado.persona { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 42px; }

.contenido { max-width: 36rem; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em; margin: .25rem 0 .75rem; }
h1:focus { outline: none; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.lema { font-size: 1.2rem; color: var(--apoyo); margin-top: 0; }
.nota { color: var(--apoyo); font-size: .95rem; margin: .25rem 0 1rem; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.volver { display: inline-block; min-height: 44px; line-height: 44px; text-decoration: none; font-weight: 600; }

.portada { padding: 2rem 0 1.5rem; border-bottom: 1px solid var(--linea); margin-bottom: 1.5rem; }
.logo-grande { width: min(18rem, 80%); height: auto; display: block; }
.bajada { color: var(--apoyo); font-size: 1.1rem; margin: .75rem 0 0; }
.solo-oscuro { display: none; }
@media (prefers-color-scheme: dark) { .solo-oscuro { display: block; } .solo-claro { display: none; } }

.forma { display: flex; flex-direction: column; }
.forma label { font-weight: 600; margin: 1rem 0 .35rem; }
input:not([type=checkbox]):not([type=radio]) { font: inherit; min-height: 52px; padding: .6rem .8rem; border: 1px solid var(--linea);
  border-radius: var(--radio); background: var(--superficie); color: var(--tinta); width: 100%; }
input:disabled { opacity: .7; }
.campo-clave { position: relative; display: flex; }
.campo-clave input { padding-right: 5.5rem !important; }
.ojo { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 44px; min-width: 4.5rem; padding: 0 .6rem;
  font: inherit; font-weight: 600; font-size: .95rem; color: var(--acento); background: none; border: 0; border-radius: var(--radio); cursor: pointer; }

.boton { font: inherit; font-weight: 650; min-height: 52px; padding: .7rem 1.1rem; margin-top: 1rem; border: 1px solid var(--linea);
  border-radius: var(--radio); background: var(--fondo); color: var(--tinta); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; text-align: center; width: 100%; }
.boton-principal { background: var(--tinta); color: var(--fondo); border-color: var(--tinta); }
.boton:disabled { opacity: .6; cursor: progress; }
.boton-texto { font: inherit; font-weight: 600; background: none; border: 0; color: var(--acento); min-height: 44px; cursor: pointer; padding: 0 .5rem; }

.elegir { border: 0; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .5rem; }
.elegir legend { font-weight: 600; margin-bottom: .35rem; }
.opcion-nivel, .opcion-ubicacion { display: grid; grid-template-columns: auto 1fr; gap: .15rem .7rem; align-items: start;
  padding: .85rem .9rem; border: 1px solid var(--linea); border-radius: var(--radio); cursor: pointer; margin: 0 !important; font-weight: 400 !important; }
.opcion-nivel input, .opcion-ubicacion input { width: 22px; height: 22px; margin: .1rem 0 0; grid-row: span 2; accent-color: var(--tinta); }
.opcion-nivel strong { font-weight: 650; }
.opcion-nivel span { color: var(--apoyo); font-size: .93rem; }
.opcion-ubicacion { align-items: center; min-height: 52px; }
.elegida { border-color: var(--tinta); box-shadow: inset 4px 0 0 var(--tinta); }
.casilla { display: flex; gap: .7rem; align-items: center; margin-top: 1.25rem; }
.casilla input { width: 24px; height: 24px; accent-color: var(--tinta); flex: none; }
.casilla label { margin: 0 !important; font-weight: 400 !important; }

.lista { display: flex; flex-direction: column; margin-top: 1rem; border-top: 1px solid var(--linea); }
.fila { display: flex; flex-direction: column; gap: .15rem; padding: .9rem .25rem; border-bottom: 1px solid var(--linea);
  color: var(--tinta); text-decoration: none; min-height: 56px; }
.fila-titulo { font-weight: 650; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.fila-detalle { color: var(--apoyo); font-size: .93rem; }
.fila-apagada { opacity: .6; }
.etiqueta { font-size: .78rem; font-weight: 650; padding: .1rem .45rem; border: 1px solid var(--linea); border-radius: 999px; margin-left: .35rem; }
.etiqueta-alerta { color: var(--ambar); border-color: currentColor; }

.opciones { display: flex; flex-direction: column; gap: .6rem; }
.opcion { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1rem; border: 1px solid var(--linea); border-radius: var(--radio);
  color: var(--tinta); text-decoration: none; }
.opcion strong { font-size: 1.15rem; }
.opcion span { color: var(--apoyo); }

/* El tablero: pocas cifras, grandes (decisión 87). La cuarta casilla del ícono de la plataforma inspira la línea de abajo. */
.tablero { margin-top: 1.5rem; padding: 1rem; border: 1px solid var(--linea); border-radius: var(--radio); }
.tablero h2 { margin-top: 0; }
.cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0; }
.cifra { border-top: 3px solid var(--tinta); padding-top: .5rem; }
.cifra dt { color: var(--apoyo); font-size: .85rem; }
.cifra dd { margin: 0; font-size: 1.6rem; font-weight: 650; }
.cifra .de { font-size: .9rem; color: var(--apoyo); font-weight: 400; }
.proximamente { margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--linea); color: var(--apoyo); }

.alerta { border-left: 4px solid var(--ambar); padding: .6rem .8rem; background: var(--superficie); border-radius: 0 var(--radio) var(--radio) 0; }
.acciones { margin-top: 2rem; padding-top: .5rem; border-top: 1px solid var(--linea); }
.credencial { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; padding: 1rem; background: var(--superficie); border-radius: var(--radio); }
.credencial dt { color: var(--apoyo); }
.credencial dd { margin: 0; font-weight: 650; word-break: break-all; }
.credencial dd.num { font-size: 1.35rem; letter-spacing: .04em; }
.copiar { display: flex; flex-direction: column; gap: .25rem; }
.copiar code { padding: .7rem .8rem; background: var(--superficie); border-radius: var(--radio); word-break: break-word; }
.ayuda { margin-top: 1.5rem; }
.ayuda summary { cursor: pointer; min-height: 44px; line-height: 44px; font-weight: 600; color: var(--acento); }

.bitacora { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--linea); }
.bitacora li { padding: .75rem .25rem; border-bottom: 1px solid var(--linea); display: flex; flex-direction: column; gap: .15rem; }
.bitacora-que { font-weight: 600; }
.bitacora-quien { color: var(--apoyo); font-size: .88rem; }

.aviso { position: fixed; left: 1rem; right: 1rem; bottom: 4.5rem; max-width: 34rem; margin: 0 auto; z-index: 5;
  display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-radius: var(--radio);
  background: var(--tinta); color: var(--fondo); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.aviso .boton-texto { color: var(--fondo); text-decoration: underline; }
.aviso-error { background: var(--rojo); color: #fff; }
.aviso-alerta { background: var(--ambar); color: #fff; }

.soporte { position: fixed; right: 1rem; bottom: 1rem; z-index: 4; min-height: 48px; display: inline-flex; align-items: center;
  padding: 0 1rem; border-radius: 999px; background: var(--fondo); color: var(--tinta); border: 1px solid var(--tinta);
  font-weight: 650; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pie { text-align: center; color: var(--apoyo); font-size: .8rem; padding: 2rem 1rem 1rem; }

@media (min-width: 40rem) { .boton { width: auto; } .forma .boton { align-self: flex-start; } }
@media (prefers-reduced-motion: no-preference) { .aviso { animation: entra .18s ease-out; } @keyframes entra { from { transform: translateY(8px); opacity: 0; } } }
/* En celular el nombre del negocio no cabía junto a los dos botones (prueba del 15 oct 2026):
   el encabezado se parte en dos renglones —negocio arriba, botones abajo— y deja de quedarse pegado arriba. */
@media (max-width: 30rem) {
  .encabezado { flex-wrap: wrap; position: static; padding: .6rem .75rem; gap: .5rem; }
  .marca { flex: 1 1 100%; }
  .encabezado-derecha { flex: 1 1 100%; justify-content: flex-end; }
  .encabezado-derecha:empty { display: none; }
  .boton-encabezado.persona { max-width: 12rem; }
}
