/* =====================================================================
   CESTY — Web para compartir y landing (cesty.app)
   Todo sale de los tokens de design/ (tokens.css y components.css).
   ===================================================================== */

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  position: relative;
}

a { color: inherit; text-decoration: none; }

/* ───────── Atmósfera: dos luces suaves ───────── */
.ambient-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-beam {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  pointer-events: none;
  opacity: 0.35;
}
[data-theme="oscuro"] .ambient-beam {
  opacity: 0.2;
}
.ambient-beam--hero {
  width: 720px;
  height: 520px;
  background: radial-gradient(circle, var(--brand-soft) 0%, transparent 70%);
  top: -120px;
  right: -80px;
}
.ambient-beam--tank {
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, var(--ok-soft) 0%, transparent 70%);
  bottom: 15%;
  left: -180px;
}

/* ───────── Cabecera Superior Minimalista ───────── */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(var(--gutter), calc((100vw - 1280px) / 2 + var(--gutter)));
  box-sizing: border-box;
  z-index: 100;
  pointer-events: auto;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.logo { height: 26px; width: auto; color: var(--text); display: block; }
.logo .bar { fill: var(--brand); }

.theme-btn {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--text-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring), color var(--dur-base), border-color var(--dur-base);
}
.theme-btn:hover { color: var(--text); border-color: var(--border-strong); transform: scale(1.06); }
.theme-btn:active { transform: scale(0.92); }

/* ───────── Navegación flotante en píldora ───────── */
.flow-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: auto;
}
.flow-nav-track {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius-chip) + 12px);
  box-shadow: var(--shadow-2);
}
.flow-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-chip);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
  user-select: none;
}
.flow-nav-item:hover {
  color: var(--text);
  background: var(--surface-sunken);
}
.flow-nav-item.active {
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow-1);
}
.flow-nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.flow-nav-item.active .flow-nav-dot {
  opacity: 1;
  background: var(--brand);
}

@media (max-width: 640px) {
  .flow-nav { bottom: 16px; width: calc(100% - 24px); }
  .flow-nav-track { justify-content: space-between; width: 100%; box-sizing: border-box; }
  .flow-nav-text { display: none; }
  .flow-nav-item.active .flow-nav-text { display: inline; }

  /* Hero & Act responsiveness on mobile */
  .act { padding: 84px var(--gutter) 64px; }
  .act--hero { padding-top: 88px; padding-bottom: 52px; }
  .hero-headline { font-size: clamp(28px, 7.5vw, 36px); line-height: 1.08; margin-bottom: 14px; }
  .hero-subhead { font-size: 15.5px; line-height: 1.45; }
  .hero-header { margin-bottom: 24px; }
  .hero-cue { margin-top: 28px; }

  .shelf-stage { padding: 20px 16px; }
  .shelf-cell { padding: 12px 14px; gap: 12px; }
  .tank-stage { padding: 20px 16px; }
  .receipt-stage { padding: 20px 14px; }
  .sync-join-card { padding: 20px 16px; }

  /* Shared pages (/g, /l, 404) mobile adjustments */
  body[data-page="invite"] main,
  body[data-page="list"] main,
  body[data-page="missing"] main {
    padding: 78px var(--gutter) 36px;
  }
  .card { padding: 18px 16px; }
  .soon span { font-size: 13px; padding: 7px 12px; }
}

/* ───────── Tarjetas de sección ───────── */
.shelf-stage,
.tank-monument,
.receipt-stage,
.sync-list-card,
.sync-join-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

/* ───────── Estructura de secciones ───────── */
.cinema-main {
  position: relative;
  z-index: 1;
  width: 100%;
}

.act {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 104px var(--gutter) 96px;
  box-sizing: border-box;
  position: relative;
}

.act-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.section-lead-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 44px;
}
.act-num {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: 12px;
}
.act-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--text);
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}
.act-desc {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
  text-wrap: pretty;
}

/* ───────── ACTO 0: HERO MONUMENTAL Y TERMINAL FÍSICO ───────── */
.act--hero {
  padding-top: 88px;
  padding-bottom: 96px;
}
.hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-header {
  max-width: 780px;
  margin: 0 auto 28px;
}
.hero-context {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2);
  margin-bottom: 16px;
  background: var(--surface-sunken);
  padding: 6px 14px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
}
.hero-headline {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(36px, 4.6vw, 54px);
  line-height: 0.98;
  margin: 0 0 20px;
  color: var(--text);
  text-wrap: balance;
}
.hero-subhead {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.48;
  color: var(--text-2);
  margin: 0 auto;
  max-width: 32em;
  text-wrap: pretty;
}

/* Terminal del hero */
.hero-terminal-wrap {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}
.terminal-card {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  text-align: left;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.terminal-location { display: flex; align-items: center; gap: 8px; }
.terminal-viewport {
  position: relative;
  padding: 22px;
}
.terminal-reticle {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  opacity: 0.4;
}
.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--brand);
  border-style: solid;
}
.corner--tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.corner--tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.corner--bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.corner--br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.terminal-product {
  background: var(--surface-sunken);
  border-radius: calc(var(--radius-card) - 6px);
  padding: 22px;
  border: 1px solid var(--border);
  display: grid;
  gap: 16px;
  position: relative;
}
/* Solo cuando se lee un código: el marco se enciende y vuelve */
.terminal-product.is-flashing {
  animation: read-flash var(--dur-slow) var(--ease-standard);
}
@keyframes read-flash {
  from { border-color: var(--brand); }
  to { border-color: var(--border); }
}

.product-barcode-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-3);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: var(--fs-caption);
}
.barcode-svg { height: 22px; width: auto; color: var(--text-2); }
.product-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.25;
}
.product-breakdown {
  font-size: var(--fs-label);
  color: var(--text-2);
  display: block;
  margin-top: 4px;
}
.product-pricing {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.product-price {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.terminal-tray {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.tray-cesti {
  width: 52px;
  height: 52px;
  flex: none;
}
.tray-sum { flex: 1; min-width: 0; }
.tray-sum-label {
  font-size: var(--fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  display: block;
}
.tray-sum-num {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: baseline;
  line-height: 1.1;
  margin-top: 2px;
}
.tray-sum-num .cur { font-size: var(--fs-body-lg); font-weight: 700; color: var(--text-2); }

.hero-cue {
  margin-top: 44px;
}
.cue-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--text-2);
  padding: 8px 18px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.cue-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* ───────── ACTO 1: EN EL PASILLO (La Estantería Digital) ───────── */
.shelf-stage {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.shelf-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.shelf-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.shelf-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shelf-cell {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--radius-tile);
  background: var(--surface-sunken);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
  font: inherit;
}
.shelf-cell:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}
.shelf-cell.active {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: var(--shadow-1);
}
.shelf-cell-num {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-3);
}
.shelf-cell-info strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}
.shelf-cell-info span {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}
.shelf-cell-price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.shelf-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
/* ───────── ACTO 2: EN EL DEPÓSITO (El Presupuesto Monumental) ───────── */
.tank-monument {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.tank-monument-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.tank-sub {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.tank-status-pill {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-chip);
  background: var(--ok-soft);
  color: var(--ok-ink);
  transition: background var(--dur-base), color var(--dur-base);
}
.tank-status-pill[data-state="warn"] {
  background: var(--warn-soft);
  color: var(--warn-ink);
}
.tank-status-pill[data-state="over"] {
  background: var(--over-soft);
  color: var(--over-ink);
}

.tank-core-stage {
  width: 100%;
}
.tank-core-stage .tank {
  height: 310px;
  box-shadow: none;
  border: 1px solid var(--border);
}

.tank-scrubber {
  padding: 16px 20px;
  background: var(--surface-sunken);
  border-radius: var(--radius-tile);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scrubber-legend {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--text-2);
}

.tank-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--surface);
  outline: none;
  cursor: grab;
  margin: 6px 0;
}
.tank-range-input:active { cursor: grabbing; }
.tank-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  border: 2.5px solid var(--surface);
  transition: transform var(--dur-fast) var(--ease-standard);
}
.tank-range-input::-webkit-slider-thumb:hover { transform: scale(1.1); }
.tank-range-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  border: 2.5px solid var(--surface);
}

.scrubber-marks {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--text-2);
}
.mark--warn { color: var(--warn-ink); }
.mark--over { color: var(--over-ink); }

.tank-presets-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-chip);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.preset-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.preset-btn.active {
  border-color: var(--text);
  color: var(--text);
  box-shadow: var(--shadow-2);
}
.p-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.p-dot--ok { background: var(--ok); }
.p-dot--warn { background: var(--warn); }
.p-dot--over { background: var(--over); }

/* ───────── ACTO 3: EN LA CINTA DE CAJA (El Ticket Térmico) ───────── */
.receipt-stage {
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.thermal-tape {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
.tape-tear {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--surface) 4px, var(--surface) 8px);
}
.tape-tear--top { top: -6px; }
.tape-tear--bottom { bottom: -6px; }

.tape-content {
  position: relative;
  padding: 16px 20px;
}
.tape-header {
  text-align: center;
  padding-bottom: 6px;
}
.tape-brand {
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  display: block;
}
.tape-meta {
  font-size: var(--fs-caption);
  color: var(--text-2);
  display: block;
  margin-top: 2px;
}
.tape-dash {
  color: var(--border-strong);
  overflow: hidden;
  text-align: center;
  font-size: 12px;
  user-select: none;
  margin: 8px 0;
}

.tape-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-ui);
}
.tape-person-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-tile);
  background: var(--surface);
  border: 1px solid var(--border);
}
.person-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.person-meta strong {
  font-size: var(--fs-label);
  color: var(--text);
}
.person-debt {
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--text-2);
}

.tape-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 6px;
  font-family: var(--font-ui);
  text-align: center;
}
.tape-total-label {
  font-size: var(--fs-label);
  color: var(--text-2);
}
.tape-total-num {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: var(--lh-snug);
  color: var(--ok-ink);
}

.avatar-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: var(--fs-caption);
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--ink-900);
  box-shadow: 0 0 0 1.5px var(--surface);
}
.av-lu { background: var(--lilac-300); }
.av-ma { background: var(--basil-300); }
.av-tu { background: var(--coral-200); }

.tape-stamp-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}
.physical-stamp {
  border: 3.5px solid var(--ok);
  color: var(--ok);
  padding: 8px 24px;
  border-radius: var(--r-xs);
  transform: rotate(-14deg) scale(0.6);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform var(--dur-slow) var(--ease-spring), opacity var(--dur-base);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-2);
}
.physical-stamp.is-stamped {
  opacity: 1;
  transform: rotate(-12deg) scale(1);
}
.stamp-main {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
}
.receipt-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ───────── ACTO 4: EN CASA (La Lista Compartida) ───────── */
.home-sync-grid {
  display: grid;
  gap: 32px;
}
@media (min-width: 860px) {
  .home-sync-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
  }
}

.sync-list-card {
  border-radius: var(--radius-card);
  overflow: hidden;
}
.sync-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.sync-list-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  display: block;
}
.sync-list-sub {
  font-size: 12px;
  color: var(--text-3);
  display: block;
  margin-top: 2px;
}
.sync-faces { display: flex; gap: 4px; }

.sync-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sync-items li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast);
  user-select: none;
}
.sync-items li:hover { background: var(--surface-sunken); }
.item-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.sync-items li.done .item-check {
  background: var(--done);
  border-color: var(--done);
  transform: scale(1.08);
}
.sync-items li.done .item-check::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2.5px solid var(--on-done);
  border-bottom: 2.5px solid var(--on-done);
  transform: translateY(-1px) rotate(-45deg);
}
.item-name, .item-format { display: block; }
.item-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  line-height: 1.25;
  transition: color var(--dur-fast);
}
.item-format {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}
.sync-items li.done .item-name {
  color: var(--text-3);
  text-decoration: line-through;
}

.sync-list-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 22px;
  font-size: 13.5px;
  color: var(--text-2);
  background: var(--surface);
}
.sync-list-foot strong {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  color: var(--text);
}

.sync-join-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.join-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.join-lead {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0;
}
.join-form {
  display: flex;
  gap: 8px;
}
.join-form .btn { white-space: nowrap; flex: none; }
.join-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-sunken);
  color: var(--text);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--dur-fast);
}
.join-input:focus { border-color: var(--brand); }
.join-footnote {
  font-size: var(--fs-caption);
  color: var(--text-2);
}

/* ───────── Entrada suave de cada sección ─────────
   Sin JS (o sin .js en <html>) el contenido se ve entero. Con movimiento
   reducido tampoco se oculta nada. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal-block {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--dur-slow) var(--ease-enter), transform var(--dur-slow) var(--ease-enter);
  }
  .js .reveal-block.is-revealed {
    opacity: 1;
    transform: none;
  }
}

/* Vuelo del precio hacia la cesta (W.fly) */
.fly-x {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
}
.fly-y { pointer-events: none; }
.fly-price {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 800;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: var(--radius-chip);
  box-shadow: var(--shadow-brand);
  white-space: nowrap;
}

/* ───────── Páginas de Compartir (/g, /l, 404) ───────── */
body[data-page="invite"] main,
body[data-page="list"] main,
body[data-page="missing"] main {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 84px var(--gutter) 48px;
  box-sizing: border-box;
  min-height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

body[data-page="invite"] #name,
body[data-page="list"] #name,
body[data-page="missing"] h1 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(26px, 6vw, 34px);
  line-height: 1.15;
  color: var(--text);
  margin: 6px 0 8px;
  text-wrap: balance;
}
body[data-page="invite"] #name,
body[data-page="missing"] h1 {
  text-align: center;
}
body[data-page="list"] #name {
  text-align: left;
}

.lead {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0 0 16px;
  text-wrap: pretty;
}
body[data-page="invite"] .lead,
body[data-page="missing"] .lead {
  text-align: center;
}

.hero {
  display: grid;
  place-items: center;
  position: relative;
  height: 160px;
  margin: 8px auto 16px;
}
.hero .blob {
  position: absolute;
  width: 150px;
  height: 150px;
  background: var(--blob);
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
}
.hero [data-cesti] {
  position: relative;
  width: 130px;
  height: 130px;
}

.kicker {
  font-weight: 800;
  font-size: var(--fs-caption);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
  margin: 0;
}
.actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.actions .btn {
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
  padding: 22px;
  margin-top: 24px;
  box-sizing: border-box;
}
.card h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(19px, 4.5vw, 22px);
  margin: 0;
  line-height: 1.2;
}
.card p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 8px 0 16px;
  text-align: left;
}
.steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
  display: grid;
  gap: 12px;
}
.steps li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
}
.steps li::before {
  content: counter(s);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
}
.steps b { color: var(--text); }
.code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text);
}
.soon {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.soon span {
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-sunken);
  border-radius: var(--radius-chip);
  padding: 8px 14px;
  text-align: center;
}
.list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}
.list li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.list .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--border-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.list .done .check {
  background: var(--done);
  box-shadow: none;
}
.list .done .check::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2.5px solid var(--on-done);
  border-bottom: 2.5px solid var(--on-done);
  transform: translateY(-1px) rotate(-45deg);
}
.list .n {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
}
.list .f {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
  word-break: break-word;
}
.list .done .n {
  color: var(--text-3);
  text-decoration: line-through;
}
.list .p {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 6px;
}
.sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  color: var(--text-2);
  font-size: 14px;
  gap: 8px;
}
.sum strong {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 26px;
  color: var(--text);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  padding: 28px var(--gutter) 48px;
  position: relative;
  z-index: 10;
  line-height: 1.6;
}
[hidden] { display: none !important; }
.foot a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.foot a:hover { color: var(--text); }

/* ───────── Páginas Legales (/privacidad y /terminos) ───────── */
.legal-container {
  max-width: 760px;
  margin: 88px auto 40px;
  padding: 0 var(--gutter);
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}
.legal-container h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
}
.legal-container .legal-updated {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 32px;
}
.legal-container h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
}
.legal-container p, .legal-container li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}
.legal-container ul {
  padding-left: 20px;
  margin: 12px 0 20px;
  display: grid;
  gap: 8px;
}
.legal-container strong {
  color: var(--text);
}
.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-1);
}

/* ───────── Accesibilidad: movimiento reducido ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
