/* ===========================================================================
   RIFARIO — Componentes
   ===========================================================================
   Todo componente sale de los tokens. Si aquí aparece un color literal, es un
   error: significa que falta un token.
   =========================================================================== */

/* ------------------------------------------------------------------ Layout */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.container--narrow { max-width: 660px; }

@media (min-width: 720px) { .container { padding: 0 var(--space-6); } }

/* ------------------------------------------------------------------- Marca */
/* Bloque de marca reutilizable: isotipo + wordmark. Se usa en acceso, landing y
   barra lateral, siempre con el mismo asset — nunca una "R" tipográfica. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  font-size: var(--text-h3);
  letter-spacing: -0.02em;
}
.brand__mark { width: 32px; height: 32px; flex: 0 0 auto; }
.brand--lg { font-size: 26px; gap: var(--space-3); }
.brand--lg .brand__mark { width: 44px; height: 44px; }
.brand--onDark { color: var(--text-onDark); }

/* ------------------------------------------------- Cabecera del talonario */
/* Barra de marca de la página pública. Fondo claro y no un bloque de color
   saturado: el protagonista es el premio, no la interfaz. */
.brandbar {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--safe-top) + var(--space-3)) var(--space-4) var(--space-3);
  display: flex; align-items: center; gap: var(--space-4);
}
.brandbar__logo {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--surface-secondary);
}
.brandbar__logo img { width: 100%; height: 100%; object-fit: cover; }
.brandbar__progress { flex: 1 1 auto; min-width: 0; }
.brandbar__percent {
  display: block; margin-top: var(--space-1);
  font-size: var(--text-caption); font-weight: var(--weight-semibold);
  color: var(--text-muted); letter-spacing: 0.02em;
}

.progress {
  height: 8px; border-radius: var(--radius-full);
  background: var(--surface-sunk);
  overflow: hidden;
}
.progress__fill {
  height: 100%; border-radius: var(--radius-full);
  background: var(--primary);
  transition: width var(--motion-base) var(--ease);
}

/* --------------------------------------------------------------- Tipografía */
.title {
  font-size: var(--text-h1); font-weight: var(--weight-bold);
  line-height: var(--leading-tight); letter-spacing: -0.025em;
  margin: var(--space-6) 0 var(--space-2);
}
@media (min-width: 720px) { .title { font-size: var(--text-display); } }

.subtitle {
  color: var(--text-muted); font-weight: var(--weight-medium);
  font-size: var(--text-small); margin: 0 0 var(--space-5);
}
.section-title {
  font-size: var(--text-h2); font-weight: var(--weight-bold);
  letter-spacing: -0.02em; margin: var(--space-8) 0 var(--space-4);
}
.lead { color: var(--text-secondary); margin: 0 0 var(--space-4); white-space: pre-line; }
.hint { color: var(--text-muted); font-size: var(--text-small); }
.label {
  font-size: var(--text-label); font-weight: var(--weight-semibold);
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted);
}

/* ------------------------------------------------------------------- Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card__body { padding: var(--space-5); }
.card--interactive { cursor: pointer; transition: border-color var(--motion-fast) var(--ease); }
.card--interactive:hover { border-color: var(--border-strong); }
.card--selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
/* Se reserva para lo que de verdad hay que destacar: un solo elemento por vista. */
.card--highlight { border-color: var(--brand-primary-border); background: var(--brand-primary-soft); }
.card--flat { background: var(--surface-secondary); border-color: transparent; }

.cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-secondary); }

/* ---------------------------------------------------------------- Callout */
.callout {
  border: 1px solid var(--brand-primary-border);
  background: var(--brand-primary-soft);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-3); flex-wrap: wrap;
  font-size: var(--text-small);
}
.callout--muted {
  border-color: var(--border); background: var(--surface);
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5); min-height: 44px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: var(--text-body); font-weight: var(--weight-semibold);
  line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--motion-fast) var(--ease),
              border-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* PRIMARY — una sola por pantalla. Si hay dos, ninguna es la principal. */
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:active { background: var(--primary-active); }

/* SECONDARY — misma importancia estructural, menos peso visual. */
.btn--secondary {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-active);
  border-color: var(--brand-primary-border);
}
.btn--secondary:hover { background: var(--brand-primary-border); }

/* TERTIARY — acción de apoyo con contorno neutro. */
.btn--tertiary, .btn--ghost {
  background: var(--surface); color: var(--text-secondary); border-color: var(--border-strong);
}
.btn--tertiary:hover, .btn--ghost:hover { background: var(--surface-secondary); color: var(--text-primary); }

/* PLAIN — sin caja, para acciones terciarias dentro de un grupo. */
.btn--plain { background: transparent; color: var(--brand-primary); border-color: transparent; padding-inline: var(--space-2); }
.btn--plain:hover { background: var(--brand-primary-soft); }

/* DESTRUCTIVE — nunca es la principal por defecto. */
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(0.94); }
.btn--danger-quiet { background: var(--surface); color: var(--danger); border-color: var(--border-strong); }
.btn--danger-quiet:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { filter: brightness(0.94); }

.btn--sm { min-height: 36px; padding: 6px var(--space-3); font-size: var(--text-small); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.btn--loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: var(--radius-full); animation: spin 0.7s linear infinite;
  color: var(--on-primary);
}
.btn--ghost.btn--loading::after, .btn--tertiary.btn--loading::after { color: var(--text-secondary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Botón de icono: mismo sistema, área táctil garantizada. */
.iconbtn {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-secondary); cursor: pointer;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.iconbtn:hover { background: var(--surface-secondary); color: var(--text-primary); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.iconbtn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }

/* ------------------------------------------------------- Grid de números */
/* Cinco columnas en móvil (celda cómoda para el pulgar) y diez en escritorio,
   que agrupa de diez en diez: es como la gente busca "su" número. */
.numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
@media (min-width: 720px) { .numbers { grid-template-columns: repeat(10, minmax(0, 1fr)); } }

.number {
  height: 44px;
  /* 2px, no 1px: el borde es lo que da el verde de "disponible" (ver tokens.css). */
  border: 2px solid var(--num-available-border);
  border-radius: var(--radius-sm);
  background: var(--num-available-bg);
  color: var(--num-available-text);
  font-size: var(--text-small); font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  display: grid; place-items: center; cursor: pointer;
  transition: background var(--motion-fast) var(--ease),
              border-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease);
}
.number:hover:not(:disabled):not([data-selected="true"]) {
  background: var(--num-hover-bg);
  border-color: var(--num-hover-border);
  color: var(--brand-primary-active);
}

/* Ningún estado depende solo del color: cambian fondo, borde y peso a la vez. */
.number[data-selected="true"] {
  background: var(--num-selected-bg);
  border-color: var(--num-selected-bg);
  color: var(--num-selected-text);
  font-weight: var(--weight-bold);
}
/* Apartado y pago en revisión eran el mismo gris. Son cosas distintas —uno puede
   caducar y volver al pool, el otro espera que una persona apruebe un pago— y el
   participante que pregunta "¿y ese número?" merece una respuesta distinta. */
.number[data-status="reserved"] {
  background: var(--num-reserved-bg); border-color: var(--num-reserved-bg);
  color: var(--num-reserved-text); cursor: not-allowed;
}
.number[data-status="payment_pending"] {
  background: var(--num-review-bg); border-color: var(--num-review-bg);
  color: var(--num-review-text); cursor: not-allowed;
}
.number[data-status="assigned"] {
  background: var(--num-assigned-bg); border-color: var(--num-assigned-bg);
  color: var(--num-assigned-text); cursor: not-allowed;
}
/* Vendido. Además del rojo, el número va tachado: es el estado definitivo y tiene
   que distinguirse de los demás sin depender del color. */
.number[data-status="paid"] {
  background: var(--num-paid-bg); border-color: var(--num-paid-bg);
  color: var(--num-paid-text); cursor: not-allowed;
  text-decoration: line-through; text-decoration-thickness: 2px;
}
/* Borde discontinuo: "excluido" se lee aunque no se distinga el gris del resto. */
.number[data-status="blocked"] {
  background: var(--num-blocked-bg); border-style: dashed;
  border-color: var(--num-blocked-text);
  color: var(--num-blocked-text); cursor: not-allowed;
}
.number[data-status="winner"] {
  background: var(--num-winner-bg); border-color: var(--num-winner-bg);
  color: var(--num-winner-text); font-weight: var(--weight-bold);
}
/* La celda seleccionada gana a cualquier estado: es lo que el usuario acaba de
   hacer y no puede quedar por debajo del color de fondo del talonario. */
.number[data-selected="true"] { text-decoration: none; }
.number:disabled { cursor: not-allowed; }

/* Resultado de una búsqueda. Desplazar hasta la celda no basta: entre mil
   celdas idénticas, "está en pantalla" no es una respuesta. El anillo persiste
   hasta la siguiente búsqueda, y usa el cyan de marca — que es exactamente para
   lo que existe: señalar, no rellenar. */
.number[data-found="true"] {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  animation: num-found 900ms var(--ease) 2;
}
@keyframes num-found { 50% { outline-color: transparent; } }

/* Leyenda: obligatoria cuando el color codifica información. */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.legend__item { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-caption); color: var(--text-secondary); }
.legend__swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); }


/* ------------------------------------------------------ Buscar un número */
/* El paginador contesta "qué hay en este rango". Esto contesta "quiero ESTE",
   que es como la gente llega al talonario: con un número ya en la cabeza. */
.numsearch { margin: 0 0 var(--space-4); }
.numsearch__label { display: block; margin-bottom: var(--space-2); }
.numsearch__row { display: flex; gap: var(--space-2); }
.numsearch__row .field__input {
  flex: 1 1 auto; min-width: 0;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.numsearch__row .btn { flex: 0 0 auto; }
/* Altura reservada: el mensaje aparece y desaparece, y sin esto el grid entero
   da un salto de una línea cada vez que alguien busca. */
.numsearch__msg {
  margin: var(--space-2) 0 0; min-height: 1.35em;
  font-size: var(--text-small); color: var(--text-secondary);
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
}
.numsearch__msg[data-tone="error"] { color: var(--danger); }
.numsearch__msg[data-tone="ok"]    { color: var(--success); }
.numsearch__msg .btn { min-height: 32px; padding: 4px 12px; font-size: var(--text-caption); }
/* ------------------------------------------------------------- Paginador */
.sections {
  display: flex; gap: var(--space-2); overflow-x: auto;
  padding: var(--space-1) 0 var(--space-3); scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.sections::-webkit-scrollbar { height: 4px; }
.sections::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }

.section-chip {
  flex: 0 0 auto; scroll-snap-align: start;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  font-weight: var(--weight-semibold); font-size: var(--text-small);
  cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.section-chip:hover { border-color: var(--border-strong); }
.section-chip[aria-current="true"] {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}
.section-chip[data-full="true"]:not([aria-current="true"]) { opacity: 0.55; }

/* ----------------------------------------------------- Barra inferior fija */
.bottombar {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.bottombar__stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: var(--space-3) var(--space-2); text-align: center; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat__value {
  display: block; font-weight: var(--weight-bold); font-size: var(--text-h3);
  color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1.15;
}
.stat__label { display: block; font-size: var(--text-caption); color: var(--text-muted); margin-top: 2px; }

/* Carrito: aparece solo con selección, para no robar espacio mientras se mira. */
.cart {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--brand-primary-soft);
}
.cart__info { flex: 1 1 auto; min-width: 0; }
.cart__count { font-weight: var(--weight-bold); color: var(--text-primary); display: block; }
.cart__total { color: var(--text-secondary); font-size: var(--text-small); }

/* ------------------------------------------------------------------ Modal */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: end center;
  background: rgb(15 35 80 / 45%);
  padding-top: var(--space-10);
}
@media (min-width: 640px) { .modal { place-items: center; padding: var(--space-6); } }

.modal__panel {
  background: var(--surface);
  width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-5);
  padding-bottom: calc(var(--space-5) + var(--safe-bottom));
  box-shadow: var(--shadow-md);
  animation: sheet-up var(--motion-base) var(--ease);
}
@media (min-width: 640px) { .modal__panel { border-radius: var(--radius-xl); } }
@keyframes sheet-up { from { transform: translateY(16px); opacity: 0; } }

.modal__head { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); }
.modal__title { font-size: var(--text-h2); font-weight: var(--weight-bold); margin: 0; flex: 1; }
.modal__close {
  border: 0; background: var(--surface-secondary); color: var(--text-secondary);
  width: 34px; height: 34px; border-radius: var(--radius-full);
  cursor: pointer; font-size: 20px; line-height: 1; flex: 0 0 auto;
}
.modal__close:hover { background: var(--surface-sunk); color: var(--text-primary); }

/* ------------------------------------------------------------- Formularios */
.field { margin-bottom: var(--space-4); }
.field__label {
  display: block; font-weight: var(--weight-semibold);
  font-size: var(--text-label); margin-bottom: var(--space-2); color: var(--text-primary);
}
.field__input, .field__select, .field__textarea {
  width: 100%; padding: 11px var(--space-3); min-height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-primary);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.field__input::placeholder, .field__textarea::placeholder { color: var(--text-muted); }
.field__input:hover, .field__select:hover, .field__textarea:hover { border-color: var(--text-muted); }
.field__textarea { min-height: 104px; resize: vertical; line-height: var(--leading-body); }

/* Anillo de foco derivado de la marca, no el del navegador. */
.field__input:focus, .field__select:focus, .field__textarea:focus {
  border-color: var(--brand-primary); outline: none;
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}
.field__input[aria-invalid="true"], .field__textarea[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft);
}
.field__error { color: var(--danger); font-size: var(--text-caption); margin: var(--space-2) 0 0; }
.field__hint { color: var(--text-muted); font-size: var(--text-caption); margin: var(--space-2) 0 0; }

.check {
  display: inline-flex; align-items: center; gap: var(--space-2);
  cursor: pointer; font-size: var(--text-small);
}
.check input { width: 18px; height: 18px; accent-color: var(--brand-primary); cursor: pointer; }
.check input:disabled { cursor: not-allowed; }

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: var(--text-caption); font-weight: var(--weight-semibold);
  background: var(--surface-secondary); color: var(--text-secondary);
  border: 1px solid transparent; white-space: nowrap;
}
/* El punto da una segunda señal además del color: un badge que solo se distingue
   por su tono no sirve para quien no distingue esos tonos. */
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: var(--radius-full);
  background: currentColor; flex: 0 0 auto;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--info    { background: var(--info-soft);    color: var(--brand-primary-active); }
.badge--accent  { background: var(--brand-accent-soft); color: #0b7f92; }
.badge--plain::before { display: none; }

/* ---------------------------------------------------------------- Toasts */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottombar-h) + var(--safe-bottom) + var(--space-4));
  z-index: var(--z-toast); display: flex; flex-direction: column-reverse;
  gap: var(--space-2); width: min(92vw, 420px); pointer-events: none;
}
.toast {
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border); border-left: 3px solid var(--text-muted);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); font-size: var(--text-small);
  animation: toast-in var(--motion-base) var(--ease);
}
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger); }
.toast--info    { border-left-color: var(--brand-primary); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* --------------------------------------------------------- Carga y vacío */
.skeleton {
  background: linear-gradient(90deg, var(--surface-secondary) 25%, var(--surface-sunk) 37%, var(--surface-secondary) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skeleton--number { height: 44px; }

.empty {
  text-align: center; padding: var(--space-12) var(--space-4);
  color: var(--text-muted);
}
.empty__mark { width: 44px; height: 44px; margin: 0 auto var(--space-4); opacity: 0.35; }
.empty__title {
  font-weight: var(--weight-bold); color: var(--text-primary);
  font-size: var(--text-h3); margin-bottom: var(--space-2);
}
.empty p { margin: 0 auto var(--space-5); max-width: 44ch; font-size: var(--text-small); }

/* ---------------------------------------------------------------- Tablas */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
.table th, .table td {
  padding: var(--space-3) var(--space-4); text-align: left; white-space: nowrap;
}
.table th {
  background: var(--surface-secondary); color: var(--text-muted);
  font-weight: var(--weight-semibold); font-size: var(--text-caption);
  letter-spacing: 0.03em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.table td { border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-secondary); }

/* ------------------------------------------------------------ Utilidades */
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.text-center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }

.footer {
  padding: var(--space-10) var(--space-4) calc(var(--space-10) + var(--safe-bottom));
  text-align: center; color: var(--text-muted); font-size: var(--text-caption);
  border-top: 1px solid var(--border); margin-top: var(--space-10);
}
.footer a { color: var(--text-muted); margin: 0 var(--space-2); }
.footer a:hover { color: var(--brand-primary); }

/* ------------------------------------------------------ Galería del premio */
/* Tira horizontal en móvil y rejilla en pantallas anchas. En móvil una rejilla
   dejaría las fotos a un tamaño en el que no se distingue el premio, que es
   exactamente para lo que están. */
.gallery {
  display: grid; gap: var(--space-2);
  grid-auto-flow: column; grid-auto-columns: 72%;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: var(--space-2); margin-bottom: var(--space-5);
  scrollbar-width: thin;
}
/* Alto fijo y recorte: las fotos llegan con las proporciones que tuviera el
   teléfono de quien las tomó, y una vertical sin recortar empuja el talonario
   fuera de la pantalla. */
.gallery__item {
  width: 100%; height: 200px; object-fit: cover;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface-sunk); scroll-snap-align: start;
}
@media (min-width: 720px) {
  .gallery {
    grid-auto-flow: row; overflow-x: visible;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .gallery__item { height: 150px; }
}

/* Aviso que pide una acción sin ser un error: "falta este dato" no es lo mismo
   que "esto se rechazó", y pintarlo en rojo hace que se lea como lo segundo. */
.callout--warning {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--text-primary);
}
.callout--warning strong { color: var(--warning); }
