/* =============================================================================
   Componentes comunes
   ========================================================================== */

/* ---------------------------------------------------------------- botones */
.btn {
  --btn-bg: var(--bg-raised);
  max-width: 100%;
  --btn-fg: var(--text);
  --btn-border: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 1.5px solid var(--btn-border);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.btn:hover {
  color: var(--btn-fg);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  flex: none;
}

.btn-primary {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-border: var(--accent);
  box-shadow: 0 10px 22px -12px rgba(200, 64, 31, 0.75);
}

.btn-primary:hover {
  --btn-bg: var(--accent-hover);
  --btn-border: var(--accent-hover);
}

.btn-brand {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  --btn-border: var(--brand);
  box-shadow: 0 10px 22px -14px rgba(35, 61, 145, 0.8);
}

.btn-brand:hover {
  --btn-bg: var(--brand-hover);
  --btn-border: var(--brand-hover);
}

.btn-success {
  --btn-bg: var(--success);
  --btn-fg: #fff;
  --btn-border: var(--success);
}

.btn-danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff;
  --btn-border: var(--danger);
}

.btn-outline {
  --btn-bg: transparent;
  --btn-fg: var(--brand);
  --btn-border: var(--brand);
}

.btn-outline:hover {
  --btn-bg: var(--brand-soft);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: transparent;
}

.btn-ghost:hover {
  --btn-bg: rgba(31, 27, 22, 0.06);
}

.btn-light {
  --btn-bg: rgba(255, 255, 255, 0.14);
  --btn-fg: #fff;
  --btn-border: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-light:hover {
  --btn-bg: rgba(255, 255, 255, 0.24);
}

.btn-sm {
  min-height: 40px;
  padding: 0 var(--s-4);
  font-size: var(--fs-sm);
}

.btn-lg {
  min-height: 58px;
  padding: 0 var(--s-6);
  font-size: var(--fs-md);
}

.btn-xl {
  min-height: 72px;
  padding: 0 var(--s-7);
  font-size: var(--fs-lg);
  border-radius: var(--r-lg);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-square {
  border-radius: var(--r-md);
}

.btn-icon {
  min-width: 48px;
  padding: 0;
}

.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid currentColor;
  border-color: var(--btn-fg) transparent var(--btn-fg) transparent;
  animation: spin 0.8s linear infinite;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------- tarjetas */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.card-pad {
  padding: var(--s-5);
}

@media (min-width: 720px) {
  .card-pad {
    padding: var(--s-6);
  }
}

.card-paper {
  background: var(--bg-paper);
  background-image: var(--paper-grain);
  background-blend-mode: multiply;
  background-size: 160px;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

.card-link:hover {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.surface-inverse {
  background: var(--bg-inverse);
  color: var(--text-inverse);
}

/* ---------------------------------------------------------- badges y chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--bg-sunken);
  color: var(--text-muted);
  border: 1px solid var(--line);
}

.badge-success { background: var(--success-soft); color: var(--success-strong); border-color: rgba(62, 88, 56, 0.25); }
.badge-warning { background: var(--warning-soft); color: var(--warning-strong); border-color: rgba(138, 90, 0, 0.25); }
.badge-danger { background: var(--danger-soft); color: var(--danger-strong); border-color: rgba(179, 38, 30, 0.25); }
.badge-info { background: var(--info-soft); color: var(--anil-700); border-color: rgba(35, 61, 145, 0.2); }
.badge-accent { background: var(--accent-soft); color: var(--pimenton-700); border-color: rgba(200, 64, 31, 0.25); }
.badge-solid { background: var(--brand); color: #fff; border-color: var(--brand); }
.badge-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.badge-live::before {
  animation: live-pulse 1.6s var(--ease) infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.chip-row {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip-row .chip {
  flex: none;
  min-height: 40px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chip-row .chip[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: 0;
  margin: 0;
  list-style: none;
}

/* -------------------------------------------------------------- formularios */
.field {
  display: block;
}

.field + .field {
  margin-top: var(--s-5);
}

/* En una rejilla, la separación la pone la propia rejilla (si no, la segunda
   columna queda más baja que la primera). */
.grid > .field + .field {
  margin-top: 0;
}

.field-label {
  display: block;
  margin-bottom: var(--s-2);
  font-weight: 700;
  font-size: var(--fs-base);
}

.field-hint {
  display: block;
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--text-subtle);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--danger);
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 0 var(--s-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  font-size: var(--fs-md);
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.textarea {
  min-height: 120px;
  padding: var(--s-3) var(--s-4);
  resize: vertical;
  line-height: var(--lh-base);
}

.select {
  padding-right: var(--s-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23463f37' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-400);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-400);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--anil-500);
  box-shadow: 0 0 0 4px rgba(47, 79, 176, 0.18);
  outline: none;
}

.input[aria-invalid='true'],
.select[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.12);
}

.input-sm {
  min-height: 42px;
  font-size: var(--fs-base);
  border-radius: var(--r-sm);
}

.input-group {
  position: relative;
}

.input-group .input {
  padding-right: 56px;
}

.input-group .input-addon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

/* PIN y código: un solo campo accesible con aspecto de casillas */
.code-input {
  font-family: var(--font-sans);
  font-weight: 760;
  font-size: 2rem;
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em;
  min-height: 68px;
  font-variant-numeric: tabular-nums;
}

.code-input.code-6 {
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  cursor: pointer;
  font-size: var(--fs-base);
  line-height: 1.45;
}

.check input {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.choice-list {
  display: grid;
  gap: var(--s-2);
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-3) var(--s-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  cursor: pointer;
  font-weight: 650;
}

.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.choice input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--brand);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  cursor: pointer;
  font-weight: 650;
}

.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--ink-300);
  transition: background var(--t-fast) var(--ease);
  cursor: pointer;
  margin: 0;
  flex: none;
}

.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-fast) var(--ease);
}

.switch input:checked {
  background: var(--success);
}

.switch input:checked::after {
  transform: translateX(20px);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-7);
}

@media (min-width: 720px) {
  .form-actions.inline {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.form-alert {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: var(--danger-strong);
  font-weight: 600;
}

.form-alert.info { background: var(--info-soft); color: var(--anil-800); }
.form-alert.warning { background: var(--warning-soft); color: var(--warning-strong); }
.form-alert.success { background: var(--success-soft); color: var(--success-strong); }
.form-alert svg { flex: none; margin-top: 2px; }
.form-alert p { margin: 0; }
.form-alert p + p { margin-top: var(--s-2); }

/* ---------------------------------------------------------------- stepper */
.stepper {
  display: grid;
  grid-template-columns: 76px 1fr 76px;
  align-items: center;
  border: 2px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  overflow: hidden;
}

.stepper button {
  height: 76px;
  border: 0;
  background: var(--bg-sunken);
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.stepper button:active {
  background: var(--cal-200);
}

.stepper button[disabled] {
  color: var(--ink-300);
  cursor: not-allowed;
}

.stepper output {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- toasts */
.toast-region {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: calc(var(--s-4) + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  pointer-events: none;
}

.has-bottom-nav .toast-region {
  bottom: calc(var(--nav-h) + var(--s-3) + var(--safe-bottom));
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--ink-900);
  color: #fff;
  box-shadow: var(--shadow-3);
  font-weight: 600;
  line-height: 1.4;
  animation: toast-in var(--t-base) var(--ease-spring);
}

.toast .toast-icon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
}

.toast-success .toast-icon { background: var(--encina-500); }
.toast-warning .toast-icon { background: var(--ocre-500); }
.toast-error .toast-icon { background: var(--danger); }
.toast-info .toast-icon { background: var(--anil-500); }
.toast .toast-body { flex: 1; padding-top: 2px; }
.toast .toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* ----------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  /* Con el teclado abierto, la hoja se apoya encima del teclado. */
  bottom: var(--kb-inset, 0px);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(12, 22, 56, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in var(--t-base) var(--ease);
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  max-height: calc(var(--vvh, 100dvh) - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg-raised);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s-6) var(--gutter) calc(var(--s-6) + var(--safe-bottom));
  box-shadow: var(--shadow-3);
  animation: sheet-in var(--t-slow) var(--ease);
}

.modal-wide {
  max-width: 820px;
}

@media (min-width: 720px) {
  .modal-backdrop {
    align-items: center;
    padding: var(--s-6);
  }
  .modal {
    border-radius: var(--r-xl);
    padding: var(--s-7);
    animation: pop-in var(--t-base) var(--ease-spring);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}

.modal-header h2 {
  margin: 0;
  font-size: var(--fs-lg);
}

.modal-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

@media (min-width: 720px) {
  .modal-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.modal-grabber {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--ink-200);
  margin: -8px auto var(--s-4);
}

@media (min-width: 720px) {
  .modal-grabber { display: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes sheet-in {
  from { transform: translateY(40px); opacity: 0; }
}

@keyframes pop-in {
  from { transform: scale(0.96); opacity: 0; }
}

body.modal-open {
  overflow: hidden;
}

/* --------------------------------------------------------------- sellos */
.stamp {
  --stamp-color: var(--stamp-ink);
  width: 128px;
  height: 128px;
  color: var(--stamp-color);
  transform: rotate(-12deg);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.stamp-anim {
  animation: stamp-in 520ms var(--ease-spring) both;
}

@keyframes stamp-in {
  0% { opacity: 0; transform: rotate(-12deg) scale(1.9); }
  60% { opacity: 1; transform: rotate(-12deg) scale(0.94); }
  100% { opacity: 1; transform: rotate(-12deg) scale(1); }
}

/* ------------------------------------------- zócalo añil (franja de las casas) */
.zocalo {
  position: relative;
  height: 28px;
  color: var(--brand);
}

.zocalo svg {
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------- imágenes */
.media {
  position: relative;
  overflow: hidden;
  background: var(--cal-200);
  background-image: linear-gradient(135deg, var(--cal-200), var(--cal-100));
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

.media img.is-loading {
  opacity: 0;
}

.media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tierra-400);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.5), transparent 55%),
    linear-gradient(135deg, var(--ocre-100), var(--cal-200));
}

.media-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: rgba(12, 22, 56, 0.55);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-1 { aspect-ratio: 1 / 1; }
.ratio-3-4 { aspect-ratio: 3 / 4; }

/* ------------------------------------------------------------- esqueletos */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--cal-200);
  border-radius: var(--r-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.skeleton-text { height: 1em; margin-bottom: 0.6em; }
.skeleton-title { height: 1.6em; width: 60%; margin-bottom: 0.8em; }

/* --------------------------------------------------------- estados vacíos */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-5);
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--bg-sunken);
}

.state-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-raised);
  color: var(--brand);
  box-shadow: var(--shadow-1);
}

.state.danger .state-icon { color: var(--danger); }
.state.warning .state-icon { color: var(--warning); }
.state h3 { margin: 0; font-size: var(--fs-md); }
.state p { margin: 0; max-width: 46ch; color: var(--text-muted); }
.state .btn { margin-top: var(--s-2); }

/* --------------------------------------------------------- banda de estado */
.net-banner {
  position: sticky;
  top: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 8px var(--gutter);
  background: var(--warning-soft);
  color: var(--warning-strong);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid rgba(138, 90, 0, 0.2);
}

.net-banner.danger {
  background: var(--danger-soft);
  color: var(--danger-strong);
}

/* ------------------------------------------------------- anillo de progreso */
.ring {
  position: relative;
  width: 132px;
  height: 132px;
  flex: none;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring .ring-track {
  stroke: var(--cal-200);
}

.ring .ring-bar {
  stroke: var(--accent);
  transition: stroke-dashoffset 900ms var(--ease);
}

.ring.done .ring-bar {
  stroke: var(--success);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1;
}

.ring-label strong {
  font-size: 2.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ring-label span {
  margin-top: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------- cuenta atrás */
.countdown {
  display: flex;
  gap: var(--s-2);
}

.countdown-unit {
  flex: 1;
  min-width: 0;
  padding: var(--s-3) var(--s-2);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  text-align: center;
}

.countdown-unit strong {
  display: block;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.countdown-unit span {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-2xs);
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.countdown.dark .countdown-unit {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.countdown.dark .countdown-unit span {
  color: var(--text-inverse-muted);
}

/* -------------------------------------------------------------- acordeón */
.accordion {
  border-top: 1px solid var(--line);
}

.accordion details {
  border-bottom: 1px solid var(--line);
}

.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) 0;
  font-size: var(--fs-md);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary .acc-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-sunken);
  transition: transform var(--t-base) var(--ease), background var(--t-base);
}

.accordion details[open] summary .acc-icon {
  transform: rotate(45deg);
  background: var(--accent-soft);
  color: var(--accent);
}

.accordion .acc-body {
  padding: 0 0 var(--s-5);
  color: var(--text-muted);
  max-width: 70ch;
}

/* ----------------------------------------------------------------- tabs */
.tabs {
  display: flex;
  gap: var(--s-1);
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 0 auto;
  min-height: 42px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.tab[aria-selected='true'] {
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

/* ------------------------------------------------------- lista de filas */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-link {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 64px;
  padding: var(--s-3) var(--s-4);
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}

.list-link:hover { background: var(--bg-sunken); color: inherit; }
.list-link .list-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.list-link .list-main { flex: 1; min-width: 0; }
.list-link .list-title { font-weight: 700; display: block; }
.list-link .list-sub { display: block; font-size: var(--fs-sm); color: var(--text-subtle); }

/* -------------------------------------------- tabla que se vuelve tarjetas */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  font-size: var(--fs-sm);
}

.table th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr.is-clickable {
  cursor: pointer;
}

.table tbody tr.is-clickable:hover {
  background: var(--bg-sunken);
}

.table td.nowrap {
  white-space: nowrap;
}

.table td .cell-sub {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  font-weight: 500;
}

.table td.num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .table.responsive thead {
    display: none;
  }
  .table.responsive tr {
    display: block;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
  }
  .table.responsive tbody tr:last-child {
    border-bottom: 0;
  }
  .table.responsive td {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    padding: 4px 0;
    border: 0;
    text-align: right;
  }
  .table.responsive td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-subtle);
    text-align: left;
    flex: none;
  }
  .table.responsive td.cell-primary {
    font-size: var(--fs-base);
    font-weight: 750;
    text-align: left;
    justify-content: flex-start;
  }
  .table.responsive td.cell-primary::before {
    display: none;
  }
}

/* ------------------------------------------------------- kpi / estadística */
.stat {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--line);
}

.stat-label {
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.stat-value {
  margin-top: 4px;
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-note {
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

/* ---------------------------------------------------------- alérgenos */
.allergen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  background: var(--warning-soft);
  color: var(--warning-strong);
  font-size: var(--fs-sm);
  font-weight: 700;
  border: 1px solid rgba(138, 90, 0, 0.18);
}

.allergen .allergen-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ocre-700);
}

/* ------------------------------------------------------------- loader */
.page-loader {
  display: grid;
  place-items: center;
  min-height: 50vh;
  color: var(--text-subtle);
  gap: var(--s-3);
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid var(--cal-200);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

/* --------------------------------------------------------- separadores */
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-subtle);
  font-size: var(--fs-sm);
  font-weight: 650;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Número de la Ruta «Nº 01» */
.route-no {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1;
}

.route-no small {
  font-size: 0.55em;
  font-style: normal;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* --------------------------------------------- marca tipográfica de la Ruta */
.route-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
  line-height: 1;
}

.route-mark.inverse,
.route-mark.inverse .route-mark-text {
  color: #fff;
}

.route-mark-text {
  display: flex;
  flex-direction: column;
  color: var(--text);
}

.route-mark-text strong {
  font-size: 1.16rem;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.route-mark-text span {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
}

.muni-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.muni-mark.inverse {
  color: var(--text-inverse-muted);
}

/* ------------------------------------------- piezas comunes de tarjetas de tapa */
.tapa-card-no {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: baseline;
  padding: 7px 14px 6px 12px;
  border-radius: var(--r-pill);
  background: var(--cal-50);
  color: var(--ink-900);
  font-size: 1.5rem;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.45);
}

.tapa-card-flag {
  position: absolute;
  right: 12px;
  top: 14px;
}

.tapa-card-venue {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}


/* ------------------------------------------------ filas de datos y consejos */
.profile-rows {
  margin: 0;
}

.profile-rows div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
}

.profile-rows div:last-child {
  border-bottom: 0;
}

.profile-rows dt {
  color: var(--text-subtle);
  font-weight: 650;
}

.profile-rows dd {
  margin: 0;
  font-weight: 750;
  text-align: right;
}

.tips {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-5) 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.tips li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.tips .icon {
  flex: none;
  color: var(--brand);
  margin-top: 1px;
}

/* ------------------------------------------------------------------ mapa */
/* Mapa interactivo (Leaflet). Marcadores grandes: tapa publicada (añil),
   próximamente (blanco con borde discontinuo), visitado (verde con ✓) y
   favorito (corazón). El seleccionado crece y queda por encima. */
.vmap {
  position: relative;
  width: 100%;
  height: var(--vmap-h, 420px);
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: #e9e3d4;
  isolation: isolate;
}

.vmap-canvas {
  position: absolute;
  inset: 0;
  background: #e9e3d4;
  font: inherit;
}

.vmap-canvas .leaflet-tile-pane {
  filter: saturate(0.75) sepia(0.1) contrast(0.98);
}

.vmap .leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  line-height: 42px;
  font-size: 22px;
  color: var(--ink-900);
}

.vmap .leaflet-control-zoom a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.vmap .leaflet-control-attribution {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--r-pill) 0 0 0;
}

.vmap-pin-wrap {
  background: transparent;
  border: 0;
}

.vmap-pin-wrap:focus-visible {
  outline: none;
}

.vmap-pin {
  position: relative;
  display: block;
  width: 44px;
  height: 52px;
  transition: transform 160ms var(--ease-out, ease);
  transform-origin: 50% 100%;
}

.vmap-pin-head {
  position: absolute;
  left: 3px;
  top: 2px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg);
  background: var(--brand);
  border: 3px solid #fff;
  box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.55);
  color: #fff;
}

.vmap-pin-head > * {
  transform: rotate(45deg);
}

.vmap-pin-num {
  font-weight: 800;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.vmap-pin.is-soon .vmap-pin-head {
  background: #fff;
  border: 3px dashed var(--ink-500);
  color: var(--ink-700);
}

.vmap-pin.is-visited .vmap-pin-head {
  background: var(--success);
  border-style: solid;
  border-color: #fff;
  color: #fff;
}

.vmap-pin-fav {
  position: absolute;
  right: -2px;
  top: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
}

.vmap-pin-fav svg {
  fill: currentColor;
}

.vmap-pin-wrap.is-selected .vmap-pin,
.vmap-pin-wrap:hover .vmap-pin,
.vmap-pin-wrap:focus-visible .vmap-pin {
  transform: scale(1.22);
}

.vmap-pin-wrap.is-selected .vmap-pin-head,
.vmap-pin-wrap:focus-visible .vmap-pin-head {
  box-shadow: 0 0 0 4px var(--ocre-400), 0 10px 18px -6px rgba(0, 0, 0, 0.6);
}

.vmap-user {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2b7de9;
  border: 4px solid #fff;
  box-shadow: 0 0 0 6px rgba(43, 125, 233, 0.25);
}

.vmap-route {
  stroke: var(--accent);
}

.vmap-explore {
  position: absolute;
  z-index: 800;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-md, 0 8px 20px -8px rgba(0, 0, 0, 0.5));
}

.vmap-empty {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: var(--s-5);
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-sunken);
}

.vmap-empty p {
  margin: 0;
  max-width: 34ch;
}

.vmap-empty[hidden],
.vmap-canvas[hidden],
.vmap-explore[hidden] {
  display: none;
}

/* Leyenda del mapa */
.vmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.vmap-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vmap-legend .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.vmap-legend .dot.soon {
  background: #fff;
  border: 2px dashed var(--ink-500);
  box-shadow: none;
}

.vmap-legend .dot.visited {
  background: var(--success);
}

.vmap-legend .dot.fav {
  background: var(--accent);
}

/* ----------------------------------------------------- bares (lista y ficha) */
.venue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.venue-row:hover,
.venue-row.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.venue-row-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  color: var(--ink-500);
}

.venue-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.venue-row-num {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 24px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  line-height: 20px;
}

.venue-row-main {
  min-width: 0;
}

.venue-row-title,
.venue-row-sub {
  display: block;
}

.venue-row-title {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 750;
  line-height: 1.25;
}

.venue-row-sub {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.venue-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.venue-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
}

.venue-chip.is-soon {
  background: var(--ocre-50);
  color: var(--ocre-700);
}

.venue-chip.is-visited {
  background: var(--success-soft);
  color: var(--success-strong);
}

.venue-chip.is-open {
  background: var(--success-soft);
  color: var(--success-strong);
}

.venue-chip.is-closed {
  background: var(--bg-sunken);
  color: var(--text-muted);
}

.venue-chip.is-nolocation {
  background: var(--warning-soft);
  color: var(--warning-strong);
}

.venue-list-v3 {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.venue-sheet {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md, 0 12px 28px -14px rgba(0, 0, 0, 0.35));
}

.venue-sheet-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
}

.venue-sheet-photo {
  position: relative;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  color: var(--ink-500);
}

.venue-sheet-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.venue-sheet h3 {
  margin: 0;
  font-size: var(--fs-md);
}

.venue-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.coming-soon {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: var(--s-5);
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: repeating-linear-gradient(135deg, var(--cal-50), var(--cal-50) 10px, var(--cal-100) 10px, var(--cal-100) 20px);
  text-align: center;
  color: var(--text-muted);
}

.coming-soon strong {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-xl);
  color: var(--ink-900);
}

@media (prefers-reduced-motion: reduce) {
  .vmap-pin {
    transition: none;
  }
}

/* ---------------------------------------------- mapa: tamaños y ruta sugerida */
.vmap-app {
  --vmap-h: min(58vh, 520px);
}

.vmap-detail {
  --vmap-h: 240px;
}

.vmap-picker {
  --vmap-h: 320px;
  cursor: crosshair;
}

.route-options {
  display: grid;
  gap: var(--s-2);
}

.route-steps {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.route-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: var(--s-2);
  align-items: center;
}

.route-step-n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

/* ------------------------------------------- novedades de bares y avisos */
.news-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .section .news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-1);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

.news-card-media .media {
  border-radius: 0;
}

.news-card-media .ratio-poster {
  aspect-ratio: 3 / 4;
  max-height: 520px;
}

.news-card-media .ratio-poster img {
  object-fit: contain;
  background: var(--bg-sunken);
}

.news-card-body {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5) var(--s-5);
}

.news-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 750;
}

.news-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--pimenton-700);
}

.news-venue {
  color: var(--brand);
  text-decoration: none;
}

.news-venue:hover {
  text-decoration: underline;
}

.news-card-title {
  margin: 0;
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
}

.news-when {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 750;
  color: var(--anil-700);
}

.news-card-text {
  margin: 0;
  color: var(--text-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.news-card-date {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

.news-card.is-compact .news-card-body {
  padding: var(--s-3) var(--s-4) var(--s-4);
}

.news-card.is-highlighted,
.notice-card.is-highlighted {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.notice-list {
  display: grid;
  gap: var(--s-3);
}

.notice-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

.notice-card.is-unread {
  border-left-color: var(--accent);
}

.notice-card.is-important {
  background: var(--warning-soft);
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

.notice-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notice-from {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 750;
  color: var(--text-subtle);
}

.notice-title {
  margin: 0;
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
}

.notice-text {
  margin: 0;
  color: var(--text-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.notice-media .media {
  border-radius: var(--r-sm);
}

.notice-main .btn {
  justify-self: start;
}

/* ----------------------------------------- opción con explicación (v4) */
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  cursor: pointer;
}

.radio-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.radio-card input {
  margin-top: 4px;
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

.radio-card > span {
  display: grid;
  gap: 2px;
}

.radio-card small {
  display: block;
  font-size: var(--fs-sm);
}

.radio-card small.subtle {
  color: var(--text-muted);
}

.radio-card:has(input:disabled) {
  cursor: default;
  opacity: 0.85;
}

/* ===================================================== voto popular (v4) */
.vote-panel {
  position: relative;
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding: var(--s-5);
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.vote-panel.phase-revealed {
  background: linear-gradient(160deg, var(--ocre-50), var(--bg-raised) 60%);
  border-color: rgba(195, 139, 44, 0.45);
}

.vote-head h2 {
  margin: 0;
  font-size: var(--fs-xl);
  line-height: 1.1;
}

.vote-head p {
  margin: var(--s-1) 0 0;
}

.vote-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--s-1);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.vote-participation {
  margin: 0;
  font-size: var(--fs-md);
}

.vote-participation strong {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}

.vote-stale {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--r-md);
  background: var(--warning-soft);
  color: var(--warning-strong);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.vote-winners {
  display: grid;
  gap: var(--s-4);
}

.vote-winner {
  display: grid;
  grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
  gap: var(--s-4);
  align-items: center;
  animation: vote-reveal 900ms var(--ease-spring) both;
}

.vote-winner.is-big {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.vote-winner-photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
}

.vote-winner-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vote-winner-text h3 {
  margin: 0;
  font-size: var(--fs-xl);
  line-height: 1.1;
}

.vote-winner.is-big .vote-winner-text h3 {
  font-size: clamp(2rem, 4.4vw, 4rem);
}

.vote-winner-text p {
  margin: var(--s-1) 0 0;
}

.vote-winner-award {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--ocre-700);
}

.vote-winner-votes {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.vote-ranking {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.vote-ranking li {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr) auto;
  gap: var(--s-2);
  align-items: baseline;
}

.vote-pos {
  font-weight: 800;
  color: var(--text-muted);
}

.vote-rehearsal-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  justify-self: start;
  margin: 0;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--ocre-400);
  color: var(--ink-900);
  font-weight: 850;
  letter-spacing: 0.04em;
}

@keyframes vote-reveal {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: none; }
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  overflow: hidden;
}

.confetti span {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.25, 0.6, 0.5, 1);
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(var(--spin, 360deg)); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .vote-winner {
    animation: none;
  }
  .confetti {
    display: none;
  }
}

/* ------------------------------------------------ Crear carteles (v4) */
.poster-studio {
  display: grid;
  gap: var(--s-5);
  align-items: start;
}

@media (min-width: 1000px) {
  .poster-studio {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }

  .poster-stage {
    position: sticky;
    top: var(--s-4);
  }
}

.poster-templates {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  border: 0;
}

.poster-templates legend {
  margin-bottom: var(--s-2);
  font-weight: 800;
}

.poster-formats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.poster-preview {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: var(--s-3);
  border-radius: var(--r-lg);
  background: var(--cal-200, #ece4d2);
}

.poster-canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72vh;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(12, 22, 56, 0.18);
  background: #fff;
}

.poster-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* Botones a todo el ancho y en pantallas estrechas: el texto se parte en
   varias líneas antes que salirse por la derecha. */
.btn-block,
.btn > span,
.work-alt-row .btn {
  white-space: normal;
}

@media (max-width: 420px) {
  .btn {
    white-space: normal;
    min-width: 0;
  }
}

/* ------------------------------------------ logotipo del bar en su círculo */
.venue-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.route-no.has-logo {
  display: block;
  width: 1.9em;
  height: 1.9em;
  padding: 0.14em;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
}

.tapa-card-no:has(> .has-logo) {
  padding: 4px;
  border-radius: 50%;
  font-size: 1.6rem;
}

.venue-row-thumb.is-logo {
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.12));
  padding: 6px;
}

.venue-row-num.has-logo {
  width: 30px;
  height: 30px;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.vmap-pin-num.has-logo {
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
}

/* Aviso «abrir en el navegador» dentro de Facebook, Instagram… */
.inapp-bar { position: sticky; top: 0; z-index: 60; background: var(--brand-ink, #1b3076); color: #fff; padding: 10px 16px calc(10px); font-size: 0.95rem; }
.inapp-bar p { margin: 0 0 6px; }
.inapp-bar .small { opacity: 0.85; margin: 6px 0 0; }
.inapp-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Asistencia técnica (services/support.js) */
.support-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg, 16px); border: 1px solid var(--line); background: var(--bg-raised); }
.support-card p { margin: 2px 0 0; }
.support-number { font-weight: 800; white-space: nowrap; }
.support-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.support-actions .btn { min-height: 44px; }
.support-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); margin: var(--s-4) 0; }
.site-footer .support-card { background: rgba(255, 255, 255, 0.06); border-color: var(--line-inverse); color: #fff; }
.site-footer .support-card .btn { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.site-footer .support-number { color: #fff; }
