/* ============================================================
   Amigo Navideño — Opción A · "La mesa de regalos"
   Registro Collage: una mesa vista desde arriba, sobre papel
   cuadriculado. El campo cambia de color según la persona.
   ============================================================ */

:root {
  color-scheme: light;
  --paper: #FBF7EE;
  --paper-2: #F2EBDC;
  --ink: #17130F;
  --ink-soft: #4A4239;
  --stamp: #C3122F;
  --tape: rgba(255, 238, 176, .78);
  --twine: #F3E6C8;

  /* campo: lo sobreescribe cada persona */
  --field: #B3122E;
  --on-field: #FFFBF2;
  --grid: rgba(255, 255, 255, .15);
  --grid-strong: rgba(255, 255, 255, .27);
  --marker: #FFE14D;
  --focus: var(--on-field);

  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");

  --f-display: 'Bebas Neue', 'Anton', Impact, 'Arial Narrow', sans-serif;
  --f-mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --f-script: 'Caveat Brush', 'Comic Sans MS', cursive;
}

/* Colores de campo por persona (cada una tiene su mesa) */
body[data-field="entrada"]   { --field: #B3122E; --on-field: #FFFBF2; --marker: #FFE14D; --grid: rgba(255,255,255,.15); --grid-strong: rgba(255,255,255,.27); }
body[data-field="viviana"]   { --field: #CF3A1C; --on-field: #FFFBF2; --marker: #FFE14D; --grid: rgba(255,255,255,.16); --grid-strong: rgba(255,255,255,.28); }
body[data-field="santiago"]  { --field: #1E6B43; --on-field: #FFFBF2; --marker: #FFE14D; --grid: rgba(255,255,255,.14); --grid-strong: rgba(255,255,255,.26); }
body[data-field="wilder"]    { --field: #1D44C4; --on-field: #FFFBF2; --marker: #FFE14D; --grid: rgba(255,255,255,.15); --grid-strong: rgba(255,255,255,.27); }
body[data-field="gloria"]    { --field: #C81A5E; --on-field: #FFFBF2; --marker: #FFE14D; --grid: rgba(255,255,255,.16); --grid-strong: rgba(255,255,255,.28); }
body[data-field="cristhian"] { --field: #E0A21A; --on-field: #17130F; --marker: #FF6FA8; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 16px/1.5 var(--f-mono);
  color: var(--on-field);
  background-color: var(--field);
  /* papel cuadriculado: la retícula que ordena el desorden */
  background-image:
    repeating-linear-gradient(0deg, var(--grid-strong) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(90deg, var(--grid-strong) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 28px);
  background-position: -1px -1px;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: hidden;
}
/* grano encima de todo, fijo */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  mix-blend-mode: multiply;
  opacity: .28;
  z-index: 70;
}

img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.paper :focus-visible, .sheet :focus-visible, .tag :focus-visible { --focus: var(--ink); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 10px 14px; border-radius: 4px;
}
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* superficies de papel: nunca planas */
.paper {
  background-color: var(--paper);
  background-image: var(--grain);
  background-size: 200px;
  background-blend-mode: multiply;
  color: var(--ink);
}

/* ---------- Mobiliario de borde ---------- */
.edge {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  padding: 34px 14px 0;
  font-size: 12px;
  letter-spacing: 0;
  position: relative;
  z-index: 5;
  max-width: 1240px;
  margin: 0 auto;
}
.edge__days {
  white-space: nowrap;
  padding: 4px 10px 5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
}

/* ---------- Contenedor ---------- */
.table {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px 64px;
  outline: none;
  overflow-x: clip;
}

/* ---------- Navegación hecha de recortes ---------- */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 6px 0 18px;
}
.scrap {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  font: 500 15px/1 var(--f-mono);
  text-decoration: none;
  border: 0;
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
  clip-path: polygon(0 6%, 4% 0, 97% 3%, 100% 12%, 98% 94%, 93% 100%, 3% 97%, 0 88%);
  transition: rotate .25s var(--bounce), scale .25s var(--bounce);
}
.scrap:nth-child(odd) { rotate: -1.5deg; }
.scrap:nth-child(even) { rotate: 1.2deg; }
.scrap:hover { scale: 1.04; rotate: 0deg; }
.scrap[aria-current="page"] { background-color: var(--ink); color: var(--paper); }
.nav__me {
  margin-left: auto;
  font-size: 14px;
}

/* ---------- Tipografía display ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(4.4rem, 24vw, 10.5rem);
  line-height: .84;
  letter-spacing: -.015em;
  text-transform: uppercase;
}
.display .ln { display: block; }
.display .ln--in { padding-left: .42em; }
.display .ln--in2 { padding-left: .9em; }
.display .ln--back { margin-left: -.04em; }
.display--m { font-size: clamp(3.4rem, 17vw, 6.6rem); }

/* resaltador de marcador que se dibuja de izquierda a derecha */
.hl {
  color: var(--ink);
  background-image: linear-gradient(var(--marker), var(--marker));
  background-repeat: no-repeat;
  background-position: 0 62%;
  background-size: 100% 70%;
  padding: 0 .07em;
  margin: 0 -.07em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.enter .hl { animation: hl .7s .3s cubic-bezier(.65, .05, .25, 1) both; }
@keyframes hl { from { background-size: 0% 70%; } to { background-size: 100% 70%; } }

.lede {
  font-size: 16px;
  line-height: 1.55;
  max-width: 34ch;
}
.lede b { font-weight: 500; }
.lede .num {
  font-family: var(--f-display);
  font-size: 2.1em;
  line-height: .8;
  letter-spacing: -.01em;
  vertical-align: -.12em;
  margin-right: .06em;
}

/* ---------- Estampilla (contador global) ---------- */
.postage {
  --perf: 5px;
  display: inline-block;
  padding: 9px;
  background-color: var(--paper);
  background-image: var(--grain);
  background-blend-mode: multiply;
  color: var(--ink);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle 3.2px at 50% 50%, #0000 96%, #000) -5px -5px / 10px 10px;
  mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle 3.2px at 50% 50%, #0000 96%, #000) -5px -5px / 10px 10px;
  rotate: 6deg;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.15));
}
.postage__in {
  border: 2px solid var(--stamp);
  padding: 6px 10px 7px;
  text-align: center;
  min-width: 92px;
}
.postage__n {
  display: block;
  font-family: var(--f-display);
  font-size: 2.7rem;
  line-height: .85;
  letter-spacing: -.01em;
  color: var(--stamp);
}
.postage__t {
  display: block;
  font-size: 11.5px;
  line-height: 1.25;
  font-weight: 500;
  max-width: 11ch;
  margin: 3px auto 0;
}

/* ---------- Polaroids ---------- */
.scatter {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: flex-start;
  gap: 18px 8px;
  padding: 10px 0 6px;
}
.pol {
  --r: 0deg;
  --w: 44%;
  position: relative;
  display: block;
  width: var(--w);
  max-width: 230px;
  padding: 8px 8px 4px;
  border: 0;
  text-align: center;
  background-color: var(--paper);
  background-image: var(--grain);
  background-blend-mode: multiply;
  color: var(--ink);
  border-radius: 2px;
  rotate: var(--r);
  box-shadow: 0 1px 1px rgba(0,0,0,.18), 0 8px 18px -6px rgba(0,0,0,.4);
  transition: rotate .28s var(--bounce), scale .28s var(--bounce), translate .34s var(--bounce), box-shadow .2s ease;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pol img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #2b2520;
  pointer-events: none;
  -webkit-user-drag: none;
}
.pol__name {
  display: block;
  font-family: var(--f-script);
  font-size: clamp(1.55rem, 7vw, 2.1rem);
  line-height: 1.15;
  padding: 4px 2px 2px;
}
.pol__sub {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-soft);
  padding: 0 4px 8px;
  overflow-wrap: anywhere;
}
.pol:hover, .pol.is-lifted {
  scale: 1.06;
  rotate: calc(var(--r) * .25);
  z-index: 3;
  box-shadow: 0 2px 2px rgba(0,0,0,.15), 0 22px 36px -10px rgba(0,0,0,.5);
}
.pol.is-dragging { transition: rotate .28s var(--bounce), scale .28s var(--bounce), box-shadow .2s ease; z-index: 4; cursor: grabbing; }
.pol:active { scale: 1.08; }

/* distribución a mano: tamaños y giros distintos, nada uniforme */
.scatter .pol:nth-child(1) { --r: -4deg;  --w: 47%; margin-top: 4px; }
.scatter .pol:nth-child(2) { --r: 3.5deg; --w: 41%; margin-top: 30px; }
.scatter .pol:nth-child(3) { --r: 2deg;   --w: 40%; margin-top: -4px; }
.scatter .pol:nth-child(4) { --r: -2.5deg;--w: 45%; margin-top: 22px; }
.scatter .pol:nth-child(5) { --r: 5deg;   --w: 46%; margin-top: -6px; }


/* sello en la foto de la polaroid (persona ya resuelta) */
.pol__stamp {
  position: absolute;
  top: 18px; right: 4px;
  font: 400 1.5rem/1 var(--f-display);
  letter-spacing: .02em;
  color: var(--stamp);
  background: rgba(251, 247, 238, .86);
  border: 3px solid var(--stamp);
  padding: 4px 8px 2px;
  rotate: 11deg;
  pointer-events: none;
}
.pol__pending {
  display: inline-block;
  font-weight: 500;
  border-bottom: 2px dashed var(--stamp);
}

/* ---------- Entrada ---------- */
.entry {
  display: grid;
  gap: 8px;
}
.entry__head { position: relative; z-index: 2; }
.entry__head .postage { position: absolute; right: 0; bottom: -96px; z-index: 3; rotate: 9deg; }
.print {
  position: relative;
  width: min(90%, 470px);
  margin: -26px auto 0 6px;
  padding: 10px 10px 0;
  rotate: -3deg;
  box-shadow: 0 2px 2px rgba(0,0,0,.18), 0 18px 34px -12px rgba(0,0,0,.5);
}
.print img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 42%; }
.print figcaption {
  font: 400 14px/1.35 var(--f-mono);
  padding: 9px 4px 12px;
  color: var(--ink-soft);
}
.tape {
  position: absolute;
  width: 112px; height: 30px;
  background-color: #FBF7EE;
  background-image: var(--grain), repeating-linear-gradient(-45deg, rgba(195,18,47,.88) 0 7px, rgba(251,247,238,.9) 7px 14px);
  background-blend-mode: multiply;
  opacity: .93;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 97% 52%, 100% 78%, 96% 100%, 2% 96%, 0 70%, 3% 48%, 0 22%);
  z-index: 2;
}
.print .tape--a { top: -14px; left: 38%; rotate: 5deg; }
.print .tape--b { bottom: 42px; right: -36px; rotate: -38deg; width: 96px; }

.who { margin-top: 28px; position: relative; }
.who__title { margin-bottom: 4px; }
.who .lede { margin: 6px 0 8px; }

/* ---------- Inicio ---------- */
.home__head { position: relative; }
.home__head .postage { position: absolute; right: 0; top: 0; }
.home__head .lede { margin-top: 14px; }
.home__people { margin-top: 18px; position: relative; }

.mylist-link {
  display: block;
  margin: 34px 4px 0;
  padding: 16px 18px 18px;
  text-decoration: none;
  rotate: -1.2deg;
  box-shadow: 0 2px 0 rgba(0,0,0,.18), 0 14px 24px -14px rgba(0,0,0,.5);
  border-radius: 3px 3px 14px 3px;
  position: relative;
  transition: rotate .28s var(--bounce), scale .28s var(--bounce);
}
.mylist-link:hover { rotate: 0deg; scale: 1.02; }
.mylist-link .t {
  display: block;
  font: 400 3.2rem/.85 var(--f-display);
  letter-spacing: -.01em;
}
.mylist-link .s { display: block; margin-top: 8px; font-size: 14px; color: var(--ink-soft); max-width: 36ch; }
.mylist-link .arrow {
  position: absolute; right: 16px; top: 14px;
  font: 400 2.6rem/1 var(--f-display);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 40px;
  font-size: 14px;
}
.textbtn {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  color: inherit;
  font-size: 14px;
}
.textbtn--quiet { opacity: .8; }

/* ---------- Perfil de otra persona ---------- */
.person__head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
}
.person__title { position: relative; z-index: 2; }
.person__pol {
  --r: 3deg;
  width: min(64%, 300px);
  margin: -34px 6px 0 auto;
  pointer-events: none;
  z-index: 1;
}
.person__pol .pol__name { font-size: 2rem; }
.person .lede { margin-top: 18px; }

/* ---------- Etiquetas de regalo ---------- */
.tags {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.tagw {
  position: relative;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)) drop-shadow(0 12px 14px rgba(0,0,0,.22));
  transition: rotate .28s var(--bounce);
  max-width: 560px;
}
.tagw:nth-child(3n+1) { rotate: -1.3deg; margin-right: 16px; }
.tagw:nth-child(3n+2) { rotate: 1.4deg; margin-left: 22px; }
.tagw:nth-child(3n)   { rotate: -.4deg; margin-left: 8px; margin-right: 6px; }

.tag {
  --hole-x: 25px;
  position: relative;
  padding: 16px 16px 16px 54px;
  min-height: 150px;
  border-radius: 0 4px 4px 0;
  clip-path: polygon(30px 0, 100% 0, 100% 100%, 30px 100%, 0 calc(100% - 30px), 0 30px);
  -webkit-mask: radial-gradient(circle 7px at var(--hole-x) 50%, #0000 96%, #000);
  mask: radial-gradient(circle 7px at var(--hole-x) 50%, #0000 96%, #000);
}
/* arandela del ojal */
.tag::before {
  content: '';
  position: absolute;
  left: calc(var(--hole-x) - 12px);
  top: calc(50% - 12px);
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 4px solid #D6C7A6;
}
/* borde punteado de corte */
.tag::after {
  content: '';
  position: absolute;
  inset: 0 0 0 44px;
  border-left: 1.5px dashed rgba(23,19,15,.25);
  pointer-events: none;
}
.cord {
  position: absolute;
  left: -30px;
  top: 50%;
  width: 70px;
  height: 90px;
  translate: 0 -78px;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}
.cord .rib { fill: none; stroke: #C3122F; stroke-width: 4; stroke-linecap: round; }
.cord .rib--hi { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 1; stroke-dasharray: 2 6; }
.cord .bow { fill: #C3122F; stroke: #7A0A1C; stroke-width: 1.2; stroke-linejoin: round; }
.cord .tail { fill: none; stroke: #C3122F; stroke-width: 3.4; stroke-linecap: round; }

.tag__title {
  font: 500 17px/1.3 var(--f-mono);
  overflow-wrap: anywhere;
}
.tag__price {
  margin-top: 8px;
  font: 400 2.4rem/.9 var(--f-display);
  letter-spacing: -.005em;
}
.tag__act {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tag__bag {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--stamp);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 18px;
  font: 500 15px/1.1 var(--f-mono);
  text-decoration: none;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: scale .2s var(--bounce), background-color .15s ease;
}
.btn:hover { scale: 1.04; }
.btn:active { scale: .96; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--stamp { background: var(--stamp); border-color: var(--stamp); color: #FFF8F2; }
.btn--block { width: 100%; min-height: 54px; font-size: 16px; }

/* estado: escogido por mí */
.stamp {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 5px;
  margin: 10px 0 2px;
  z-index: 3;
  font: 400 1.65rem/.9 var(--f-display);
  letter-spacing: .03em;
  color: var(--stamp);
  border: 4px double var(--stamp);
  padding: 4px 9px 3px 5px;
  border-radius: 6px;
  rotate: -8deg;
  mix-blend-mode: multiply;
  opacity: .92;
  pointer-events: none;
}
.stamp.is-new { animation: stamp .42s var(--bounce) both; }
@keyframes stamp {
  0%   { scale: 2.6; rotate: -34deg; opacity: 0; }
  55%  { scale: .9; rotate: -9deg; opacity: 1; }
  100% { scale: 1; rotate: -8deg; opacity: .92; }
}
.tagw.is-thud { animation: thud .32s .12s ease-out; }
@keyframes thud { 40% { translate: 0 3px; } }

/* estado: ya tiene dueño */
.tagw--taken { filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); }
.tag--taken { opacity: .62; }
.tag--taken .tag__title { text-decoration: line-through 2px; text-decoration-color: rgba(23,19,15,.6); }
.tape-x {
  position: absolute;
  left: 6%; right: 4%;
  top: 44%;
  z-index: 3;
  padding: 7px 10px 8px;
  text-align: center;
  font: 500 15px/1.1 var(--f-mono);
  color: var(--ink);
  background-color: var(--tape);
  background-image: var(--grain);
  background-blend-mode: multiply;
  rotate: -5deg;
  clip-path: polygon(1% 4%, 99% 0, 100% 50%, 98% 100%, 0 96%, 1% 50%);
  pointer-events: none;
}

/* estado vacío diseñado */
.empty {
  margin-top: 26px;
  max-width: 520px;
  position: relative;
}
.empty__tag {
  border: 2.5px dashed currentColor;
  border-radius: 4px;
  padding: 22px 18px 22px 54px;
  rotate: -2deg;
  position: relative;
  min-height: 140px;
}
.empty__tag::before {
  content: '';
  position: absolute;
  left: 18px; top: calc(50% - 9px);
  width: 18px; height: 18px;
  border: 2.5px dashed currentColor;
  border-radius: 50%;
}
.empty__big {
  font: 400 2.6rem/.88 var(--f-display);
  letter-spacing: -.01em;
}
.empty p + p { margin-top: 8px; }

/* ---------- Mi lista ---------- */
.mine__head .lede { margin-top: 16px; }
.secret {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 12px 9px;
  font-size: 14.5px;
  font-weight: 500;
  rotate: -1deg;
  max-width: 40ch;
}
.form {
  margin-top: 24px;
  padding: 20px 18px 22px;
  border-radius: 14px;
  max-width: 560px;
  box-shadow: 0 2px 0 rgba(0,0,0,.18), 0 18px 30px -16px rgba(0,0,0,.55);
}
.form__title {
  font: 400 2.4rem/.9 var(--f-display);
  letter-spacing: -.005em;
  margin-bottom: 14px;
}
.field { display: block; margin-top: 14px; }
.field:first-of-type { margin-top: 0; }
.field__l { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.field__l small { font-weight: 400; color: var(--ink-soft); font-size: 13.5px; }
.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: 400 16px/1.35 var(--f-mono);
  color: var(--ink);
  background: #FFFDF8;
  border: 2px solid var(--ink);
  border-radius: 8px;
}
textarea.input { min-height: 84px; resize: vertical; }
.input::placeholder { color: #8A7F72; }
.input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 7px var(--marker); }
.field__hint { display: block; margin-top: 6px; font-size: 13.5px; color: var(--ink-soft); min-height: 1em; }
.field__err { display: block; margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--stamp); }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0; }
.form .btn--block { margin-top: 20px; }

.mine__listtitle { margin-top: 40px; }
.mine__count { font: 400 1.05rem/1 var(--f-mono); display: block; margin-top: 8px; letter-spacing: 0; text-transform: none; }

/* ---------- Capa de diálogos ---------- */
.layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(23, 19, 15, .55);
  animation: fade .2s ease both;
}
.layer[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.35);
  animation: rise .34s var(--bounce) both;
}
@keyframes rise { from { translate: 0 60px; opacity: 0; } }
.sheet__title {
  font: 400 3rem/.86 var(--f-display);
  letter-spacing: -.01em;
}
.sheet__text { margin-top: 10px; font-size: 16px; line-height: 1.5; }
.sheet__text b { font-weight: 500; }
.sheet__actions { display: grid; gap: 10px; margin-top: 22px; }
.sheet__close {
  position: absolute; top: 12px; right: 12px;
  min-width: 44px; min-height: 44px;
  border: 0; background: none;
  font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}

/* PIN: flujo limpio */
.pin__who { display: flex; align-items: center; gap: 14px; padding-right: 56px; }
.pin__thumb {
  width: 62px; flex: none;
  padding: 4px 4px 10px;
  background: #fff;
  rotate: -4deg;
  box-shadow: 0 4px 10px -4px rgba(0,0,0,.4);
}
.pin__thumb img { aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.pin__name { font: 400 1.5rem/1 var(--f-script); }
.pin__step { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
.pin__dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 6px;
}
.pin__dot {
  width: 54px; height: 62px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  display: grid; place-items: center;
  font: 400 2.4rem/1 var(--f-display);
  background: #FFFDF8;
  transition: background-color .15s ease, scale .2s var(--bounce);
}
.pin__dot.is-on { background: var(--ink); scale: 1.04; }
.pin__dot.is-on::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); }
.pin__msg { min-height: 1.6em; text-align: center; font-size: 15px; font-weight: 500; margin-top: 6px; }
.pin__msg--err { color: var(--stamp); }
.pin__dots.is-shake { animation: shake .36s ease; }
@keyframes shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.key {
  min-height: 62px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #FFFDF8;
  color: var(--ink);
  font: 400 2.3rem/1 var(--f-display);
  transition: scale .16s var(--bounce), background-color .12s ease;
}
.key:active { scale: .93; background: var(--marker); }
.key--txt { font: 500 15px/1 var(--f-mono); border-style: dashed; }

/* ---------- Toasts (tira de cinta) ---------- */
.toasts {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 14px;
}
.toast {
  max-width: 420px;
  padding: 12px 18px 13px;
  font: 500 15px/1.35 var(--f-mono);
  color: var(--ink);
  background-color: #FFE98F;
  background-image: var(--grain);
  background-blend-mode: multiply;
  clip-path: polygon(1% 6%, 99% 0, 100% 50%, 99% 100%, 0 94%, 1.5% 50%);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  rotate: -1.5deg;
  animation: pop .32s var(--bounce) both;
}
.toast.is-out { animation: out .22s ease both; }
@keyframes pop { from { scale: .7; opacity: 0; translate: 0 16px; } }
@keyframes out { to { opacity: 0; translate: 0 10px; } }

/* ---------- Escritorio ---------- */
@media (min-width: 760px) {
  .edge { padding: 18px 28px 0; font-size: 14px; }
  .table { padding: 14px 28px 80px; }
  .display { font-size: clamp(6rem, 11vw, 10.5rem); }
  .display--m { font-size: clamp(4.4rem, 7vw, 6.4rem); }
  .lede { font-size: 17px; }

  .entry {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 40px;
    align-items: start;
  }
  .entry__head { grid-column: 1 / -1; }
  .entry__head .postage { right: 4%; top: 18px; bottom: auto; rotate: 8deg; }
  .print { margin: -60px 0 0 4%; width: 92%; }
  .who { margin-top: 10px; }
  .scatter { gap: 26px 14px; }
  .who .scatter .pol { --w: 30%; }
  .who .scatter .pol:nth-child(2) { --w: 27%; }
  .who .scatter .pol:nth-child(4) { --w: 33%; }

  .home {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-areas: "head people" "list people" "bag people";
    grid-template-rows: auto auto 1fr;
    gap: 0 48px;
    align-items: start;
  }
  .home__head { grid-area: head; }
  .home__people { grid-area: people; margin-top: 0; }
  .mylist-link { grid-area: list; }
  .home .bag { grid-area: bag; }
  .home .scatter .pol { --w: 43%; }

  .person {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 32px 56px;
    align-items: start;
  }
  .person__head { position: sticky; top: 16px; }
  .person__list { padding-top: 12px; }
  .tags { margin-top: 0; }

  .mine {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 24px 56px;
    align-items: start;
  }
  .mine__right { padding-top: 6px; }
  .mine__listtitle { margin-top: 0; }
  .row2 { grid-template-columns: 1fr 1.3fr; gap: 0 14px; }
  .row2 .field { margin-top: 14px; }

  .layer { align-items: center; padding: 20px; }
  .sheet { border-radius: 18px; padding-bottom: 26px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   Navidad: recortes hechos a mano (SVG propios, sin emoji)
   ============================================================ */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* guirnalda de banderines cruzando el encabezado */
.garland {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='44' viewBox='0 0 132 44'%3E%3Cpath d='M0 4Q66 26 132 4' fill='none' stroke='%23F3E6C8' stroke-width='1.6'/%3E%3Cpath d='M13.4 9.2L31.4 11.2L23.4 32.2Z' fill='%23C3122F' stroke='rgba(23,19,15,.35)' stroke-width='.8'/%3E%3Cpath d='M42.5 13.5L60.5 15.5L52.5 36.5Z' fill='%23FBF7EE' stroke='rgba(23,19,15,.35)' stroke-width='.8'/%3E%3Cpath d='M71.5 13.5L89.5 15.5L81.5 36.5Z' fill='%231E6B43' stroke='rgba(23,19,15,.35)' stroke-width='.8'/%3E%3Cpath d='M100.6 9.2L118.6 11.2L110.6 32.2Z' fill='%23F2C230' stroke='rgba(23,19,15,.35)' stroke-width='.8'/%3E%3C/svg%3E") repeat-x -20px 0 / 132px 44px;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.22));
}

/* ramitas de pino y acebo pegadas en esquinas */
.sprig {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.28));
}
.sprig svg { display: block; width: 100%; height: 100%; overflow: visible; }
.print .sprig--pine { width: 120px; height: 100px; top: -38px; left: -30px; rotate: -12deg; }
.print .sprig--holly { width: 76px; height: 54px; top: -12px; left: 34px; rotate: 10deg; }
.print .sprig--holly2 { width: 70px; height: 50px; bottom: 26px; right: -22px; top: auto; left: auto; rotate: -30deg; }
.pol__holly { width: 58px; height: 42px; top: -16px; right: -18px; rotate: 18deg; }
.pol__pine { width: 86px; height: 72px; top: -30px; left: -26px; rotate: -6deg; }
.person__pol .pol__holly { width: 84px; height: 60px; top: -22px; right: -20px; }

/* estrellas y copos recortados: pocos, reaccionan al toque */
.deco {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--s, 34px); height: var(--s, 34px);
  rotate: var(--r, 0deg);
  z-index: 2;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.22));
  transition: scale .25s var(--bounce);
}
.deco svg { width: 100%; height: 100%; display: block; }
.deco--star { color: #F4C430; }
.deco--flake { color: #FBF7EE; }
body[data-field="cristhian"] .deco--star { color: #FBF7EE; }
.deco:hover { scale: 1.12; }
.deco.is-pop { animation: spinpop .62s var(--bounce); }
@keyframes spinpop {
  0%   { scale: 1; }
  35%  { scale: 1.45; }
  100% { scale: 1; rotate: calc(var(--r, 0deg) + 360deg); }
}

/* etiqueta con foto del producto */
.tag__grid {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.tag__img {
  width: 84px;
  aspect-ratio: 1;
  padding: 4px;
  background: #fff;
  rotate: -2.5deg;
  box-shadow: 0 1px 1px rgba(0,0,0,.15), 0 5px 10px -4px rgba(0,0,0,.35);
}
.tag__img img { width: 100%; height: 100%; object-fit: cover; }
.tag--taken .tag__img { filter: grayscale(1); }
.tag__for { font-size: 13.5px; font-weight: 500; color: var(--stamp); margin-bottom: 2px; }

.gift-ph { width: 100%; height: 100%; display: block; background: var(--paper-2); }
.gift-ph rect, .gift-ph path { fill: #FBF7EE; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.gift-ph .gift-ph__rib { fill: #C3122F; }
.empty__tag .gift-ph { width: 64px; height: 64px; background: none; margin-bottom: 10px; rotate: -6deg; }

.stamp__holly { width: 26px; height: 19px; grid-row: span 2; }
.stamp small {
  font: 500 9.5px/1.1 var(--f-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* lo que voy a regalar */
.bag { margin-top: 38px; position: relative; }
.display--s { font-size: clamp(2.6rem, 12vw, 3.6rem); }
.bag__empty { margin-top: 10px; font-size: 16px; }
.tags--bag { margin-top: 18px; }

/* cargar regalos */
.back {
  display: inline-flex; align-items: center;
  min-height: 44px;
  font-size: 15px; font-weight: 500;
  color: inherit;
  text-underline-offset: 4px;
}
.photo-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 10px;
  border: 2.5px dashed var(--ink);
  border-radius: 10px;
  background: #FFFDF8;
  cursor: pointer;
  font-weight: 500;
}
.photo-drop:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 7px var(--marker); }
.photo-drop__prev {
  flex: none;
  width: 80px; height: 80px;
  padding: 3px;
  background: #fff;
  box-shadow: 0 3px 8px -3px rgba(0,0,0,.35);
  rotate: -3deg;
}
.photo-drop__prev img { width: 100%; height: 100%; object-fit: cover; }
.edit-form { margin-top: 16px; }

.admin__head { position: relative; }
.admin__people { margin-top: 10px; }
.admin .foot {
  display: grid;
  justify-items: start;
  gap: 2px;
  margin-top: 40px;
  padding: 16px 18px;
  max-width: 460px;
  rotate: -.6deg;
  border-radius: 3px 3px 12px 3px;
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
}
.foot__t { font: 400 1.8rem/.9 var(--f-display); margin-bottom: 6px; }
.textbtn--danger { color: var(--stamp); }
.foot__note { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }

/* posiciones de los recortes (estrellas y copos) por zona */
.entry__head .deco.p1 { --x: 58%; --y: 0px; --s: 30px; --r: 14deg; }
.entry__head .deco.p2 { --x: 80%; --y: -14px; --s: 26px; --r: -10deg; }
.who .deco.p1 { --x: 66%; --y: 8px; --s: 40px; --r: -8deg; }
.who .deco.p2 { --x: 86%; --y: 74px; --s: 26px; --r: 20deg; }
.home__head .deco.p1 { --x: 54%; --y: 4px; --s: 28px; --r: 12deg; }
.home__head .deco.p2 { --x: 78%; --y: 132px; --s: 30px; --r: -14deg; }
.bag .deco.p1 { --x: 86%; --y: 0px; --s: 28px; --r: 18deg; }
.person__head .deco.p1 { --x: 84%; --y: 4px; --s: 30px; --r: 10deg; }
.person__head .deco.p2 { --x: 6%; --y: 210px; --s: 32px; --r: -6deg; }
.person__head .deco.p3 { --x: 20%; --y: 300px; --s: 22px; --r: 30deg; }
.admin__head .deco.p1 { --x: 72%; --y: 2px; --s: 32px; --r: 10deg; }
.admin__head .deco.p2 { --x: 86%; --y: 96px; --s: 26px; --r: -12deg; }
.pol { overflow: visible; }
.pol .sprig { z-index: 4; }
.stamp__holly svg { display: block; width: 100%; height: 100%; }
.admin .foot .textbtn { text-align: left; }

/* Apodos largos (Hermanitoooo, Morchisss): caben en la polaroid */
.pol__name.is-long { font-size: clamp(1.15rem, 5.4vw, 1.6rem); overflow-wrap: anywhere; }
.person__pol .pol__name.is-long { font-size: 1.55rem; }
.display.is-long .ln--in { font-size: .58em; }

/* Foto del producto grande: una polaroid pegada en la etiqueta */
.tag__grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tag__img {
  width: min(100%, 300px);
  aspect-ratio: 4 / 3;
  padding: 8px 8px 22px;
  background: #fff;
  rotate: -1.8deg;
  justify-self: start;
}
.tagw:nth-child(even) .tag__img { rotate: 1.6deg; justify-self: end; }
.tag__img img { object-fit: contain; background: #fff; }
.tag__title { font-size: 17px; }
