@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ground: #eceee9;
  --ground-2: #e0e4dd;
  --surface: #ffffff;
  --plate: #ffffff;
  --ink: #1f2a24;
  --ink-2: #505c55;
  --ink-3: #5c6660;
  --line: #d8ddd4;
  --line-strong: #bfc6bc;
  --action: #b93a2a;
  --action-hover: #a1301f;
  --action-ink: #fffaf3;
  --focus: #2b4c8c;
  --ok: #2f5d4a;
  --danger: #a1301f;
  --satin: #f8f2e7;
  --satin-shade: #e6dccb;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow-1: 0 1px 2px rgb(31 42 36 / .06), 0 2px 6px rgb(31 42 36 / .05);
  --shadow-2: 0 2px 4px rgb(31 42 36 / .06), 0 10px 28px rgb(31 42 36 / .10);
  --shadow-3: 0 8px 16px rgb(31 42 36 / .08), 0 24px 60px rgb(31 42 36 / .18);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.25rem;

  color-scheme: light;
}

/* Papeles: base, tono del estampado y tinta legible encima */
[data-paper="tomate"]  { --paper: #c8402f; --paper-tone: #da634f; --paper-ink: #fffaf3; --paper-deep: #8f2a1d; }
[data-paper="botella"] { --paper: #2f5d4a; --paper-tone: #417761; --paper-ink: #f6f3ea; --paper-deep: #1d3d30; }
[data-paper="mostaza"] { --paper: #e2a92c; --paper-tone: #efc356; --paper-ink: #2a2008; --paper-deep: #8a6210; }
[data-paper="cobalto"] { --paper: #2b4c8c; --paper-tone: #3e63aa; --paper-ink: #f5f6fb; --paper-deep: #1b3263; }
[data-paper="ciruela"] { --paper: #6d2e5b; --paper-tone: #874174; --paper-ink: #fbf2f7; --paper-deep: #4a1d3d; }
[data-paper="kraft"]   { --paper: #b78a5b; --paper-tone: #a37649; --paper-ink: #21170c; --paper-deep: #6e4b26; }

[data-pattern="rayas"] { --pattern: repeating-linear-gradient(135deg, #000 0 12px, transparent 12px 26px); --pattern-size: auto; }
[data-pattern="lunares"] { --pattern: radial-gradient(circle at 25% 25%, #000 0 4.5px, transparent 5px), radial-gradient(circle at 75% 75%, #000 0 4.5px, transparent 5px); --pattern-size: 30px 30px; }
[data-pattern="cuadros"] { --pattern: linear-gradient(90deg, rgb(0 0 0 / .55) 50%, transparent 50%), linear-gradient(rgb(0 0 0 / .55) 50%, transparent 50%); --pattern-size: 26px 26px; }
[data-pattern="estrellas"] { --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M11 4l1.9 4.6 4.9.4-3.7 3.2 1.1 4.8L11 14.4 6.8 17l1.1-4.8L4.2 9l4.9-.4zM33 26l1.9 4.6 4.9.4-3.7 3.2 1.1 4.8-4.2-2.6-4.2 2.6 1.1-4.8-3.7-3.2 4.9-.4z'/%3E%3C/svg%3E"); --pattern-size: 44px 44px; }
[data-pattern="liso"] { --pattern: none; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 'Figtree', ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
}
::selection { background: #f0c5bb; color: var(--ink); }
* { scrollbar-color: var(--line-strong) transparent; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.015em; line-height: 1.15; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
input, textarea { caret-color: var(--action); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ── Papel y cinta ─────────────────────────────── */

.paper {
  position: relative;
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.paper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--paper-tone);
  -webkit-mask-image: var(--pattern);
  mask-image: var(--pattern);
  -webkit-mask-size: var(--pattern-size);
  mask-size: var(--pattern-size);
  z-index: -1;
}
.paper[data-pattern="liso"]::before { display: none; }

.ribbon-v, .ribbon-h {
  position: absolute;
  background: linear-gradient(90deg, var(--satin-shade), var(--satin) 30%, #fff 50%, var(--satin) 70%, var(--satin-shade));
  box-shadow: 0 0 0 1px rgb(0 0 0 / .06), 0 1px 3px rgb(0 0 0 / .18);
}
.ribbon-v { top: 0; bottom: 0; width: var(--ribbon-w, 18px); left: var(--ribbon-x, 70%); transform: translateX(-50%); }
.ribbon-h {
  left: 0; right: 0; height: var(--ribbon-w, 18px); top: var(--ribbon-y, 42%); transform: translateY(-50%);
  background: linear-gradient(180deg, var(--satin-shade), var(--satin) 30%, #fff 50%, var(--satin) 70%, var(--satin-shade));
}
.bow {
  position: absolute;
  left: var(--ribbon-x, 70%);
  top: var(--ribbon-y, 42%);
  width: var(--bow-w, 76px);
  transform: translate(-50%, -54%);
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / .22));
}

/* Etiqueta de cartulina: agujero con refuerzo y cordel */
.hang-tag { position: relative; }
.hang-tag::before {
  content: '';
  position: absolute;
  left: 10px; top: 50%;
  width: 9px; height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--ground);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / .35);
}

/* Cada lista tiñe sus acciones con su papel */
.list-scope[data-paper] {
  --action: var(--paper);
  --action-hover: color-mix(in srgb, var(--paper) 86%, #000);
  --action-ink: var(--paper-ink);
  --focus: var(--paper-deep);
}

/* ── Estructura ────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(236 238 233 / .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: var(--step-1);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand svg { width: 30px; height: 30px; }
.topbar .spacer { flex: 1; }

.page { max-width: 1160px; margin: 0 auto; padding: 32px 20px 96px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: var(--step-4); font-weight: 750; }
.page-head p { color: var(--ink-2); margin-top: 6px; }
.section-title { font-size: var(--step-2); font-weight: 700; margin: 56px 0 16px; }
.section-title small { font-size: var(--step-0); color: var(--ink-3); font-weight: 500; margin-left: 8px; }

/* ── Botones y campos ─────────────────────────── */

.btn {
  --b-bg: var(--surface);
  --b-ink: var(--ink);
  --b-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--b-line);
  background: var(--b-bg);
  color: var(--b-ink);
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { --b-bg: var(--ground-2); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-primary { --b-bg: var(--action); --b-ink: var(--action-ink); --b-line: transparent; box-shadow: 0 1px 2px rgb(31 42 36 / .2); }
.btn-primary:hover { --b-bg: var(--action-hover); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: rgb(31 42 36 / .06); }
.btn-danger { --b-ink: var(--danger); }
.btn-danger:hover { --b-bg: #f6e3df; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn-block { width: 100%; }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field label, .label { font-size: .875rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: var(--step--1); color: var(--ink-3); }
.input, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--plate);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: #5c6660; }
.input:hover, .textarea:hover { border-color: #a3ab9f; }
.input:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgb(43 76 140 / .16); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgb(161 48 31 / .12); }
.form-error {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: #f8e5e0; color: #7d2417; font-size: .9rem;
}
.form-error:empty { display: none; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: var(--step--1); margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── Acceso ───────────────────────────────────── */

.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-paper { --ribbon-x: 64%; --ribbon-y: 38%; --ribbon-w: 30px; --bow-w: 150px; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; color: var(--paper-ink); }
.auth-paper .brand { position: absolute; top: 32px; left: 40px; color: var(--paper-ink); font-size: var(--step-2); }
.auth-claim {
  position: relative;
  max-width: 30rem;
  padding: 22px 26px 24px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px 6px 6px 6px;
  box-shadow: var(--shadow-3);
  transform: rotate(-1.5deg);
}
.auth-claim::before {
  content: '';
  position: absolute; top: 16px; right: 18px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / .4), 0 0 0 3px #e3e7e0;
}
.auth-claim::after {
  content: '';
  position: absolute; right: 23px; bottom: calc(100% - 22px);
  width: 2px; height: 400px;
  background: linear-gradient(var(--satin), var(--satin-shade));
  transform-origin: bottom center;
  transform: rotate(-6.5deg);
  z-index: -1;
}
.auth-claim h2 { font-size: var(--step-3); font-weight: 750; padding-right: 24px; }
.auth-claim p { color: var(--ink-2); margin-top: 8px; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: var(--step-3); font-weight: 750; }
.auth-card > p { color: var(--ink-2); margin: 8px 0 24px; }
.auth-switch { margin-top: 22px; color: var(--ink-2); font-size: .9375rem; text-align: center; }
.auth-switch a { font-weight: 600; color: var(--action); }
.invite-note {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; margin-bottom: 20px;
  border-radius: 12px; background: #e6eee9; color: #1d3d30; font-size: .9375rem;
}
.btn-google { --b-bg: #fff; gap: 10px; }

/* ── Paquetes (tarjetas de lista) ─────────────── */

.parcels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.parcel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.parcel:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.parcel:focus-visible { border-radius: var(--radius); }
.parcel-cover { aspect-ratio: 4 / 3; --ribbon-x: 76%; --ribbon-y: 34%; --ribbon-w: 18px; --bow-w: 82px; }
.parcel-tag {
  position: absolute;
  left: 18px; bottom: 18px;
  max-width: calc(76% - 36px);
  padding: 10px 14px 11px 28px;
  background: var(--surface);
  border-radius: 4px;
  box-shadow: var(--shadow-2);
  transform: rotate(-1.5deg);
}
.parcel-tag::before { background: var(--paper); }
.parcel-tag h3 { font-size: var(--step-1); font-weight: 720; overflow-wrap: anywhere; }
.parcel:hover .bow { transform: translate(-50%, -54%) rotate(-4deg) scale(1.04); }
.parcel .bow { transition: transform .25s var(--ease); }
.parcel-body { padding: 12px 16px 14px; display: grid; gap: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-3); font-size: var(--step--1); font-weight: 500; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .icon { width: 15px; height: 15px; }
.parcel-owner { color: var(--ink-2); font-size: .875rem; }

.parcel-new {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 200px;
  padding: 24px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease);
}
.parcel-new:hover { border-color: var(--action); color: var(--action); background: rgb(185 58 42 / .04); }
.parcel-new .icon { width: 28px; height: 28px; }

.empty {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: center;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
}
.empty .paper { aspect-ratio: 1; border-radius: 12px; --ribbon-x: 50%; --ribbon-y: 50%; --bow-w: 90px; }
.empty h2 { font-size: var(--step-3); font-weight: 750; }
.empty p { color: var(--ink-2); margin: 10px 0 20px; max-width: 42ch; }
.empty-quiet { padding: 28px; border-radius: var(--radius); border: 1px dashed var(--line-strong); color: var(--ink-2); text-align: center; }

/* ── Cabecera de lista ────────────────────────── */

.list-hero {
  --ribbon-x: 82%; --ribbon-y: 50%; --ribbon-w: 26px; --bow-w: 132px;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
}
.list-hero-in { position: relative; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 20px; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 18px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: rgb(255 253 249 / .92); color: var(--ink);
  font-size: .875rem; font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow-1);
}
.back:hover { background: #fff; }
.label-card {
  display: inline-block;
  max-width: min(640px, 72%);
  padding: 18px 22px 20px;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: var(--shadow-2);
}
.label-card h1 { font-size: var(--step-4); font-weight: 780; line-height: 1.08; }
.label-card p { color: var(--ink-2); margin-top: 8px; }
.label-card .by { font-size: .875rem; color: var(--ink-3); margin-top: 6px; }

.toolbar {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.toolbar .spacer { flex: 1; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px; border-radius: 4px;
  font-size: .8125rem; font-weight: 650;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-1);
}
.status-chip .icon { color: var(--paper-deep, var(--ink-2)); }
.status-chip .icon { width: 15px; height: 15px; }
.status-chip.hang-tag { padding-left: 24px; }
.status-chip.hang-tag::before { left: 9px; width: 7px; height: 7px; margin-top: -3.5px; box-shadow: inset 0 1px 2px rgb(0 0 0 / .35); }
.toolbar-actions { display: flex; gap: 8px; }

/* ── Añadir deseo ─────────────────────────────── */

.composer {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 8px;
  margin-bottom: 28px;
  transition: box-shadow .2s var(--ease);
}
.composer:focus-within { box-shadow: var(--shadow-2), 0 0 0 2px rgb(43 76 140 / .25); }
.composer-row { display: flex; gap: 8px; align-items: center; }
.composer-row > .icon { color: var(--ink-3); margin-left: 10px; }
.composer-input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 48px; padding: 0 6px; font-size: var(--step-0); }
.composer-input:focus { outline: none; }
.composer-input::placeholder { color: #5c6660; }

.item-form { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 16px 12px 12px; }
.item-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.image-pick { display: grid; gap: 8px; align-content: start; }
.image-pick .plate { border-radius: 12px; border: 1px solid var(--line); }
.image-pick-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.image-url-row { display: flex; gap: 6px; }

/* ── Deseos ───────────────────────────────────── */

.wishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.wish {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: box-shadow .2s var(--ease);
}
.wish:hover { box-shadow: var(--shadow-2); }
.plate {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--plate);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.plate img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.plate.is-empty { background: #f5f7f3; }
.plate.is-empty .icon { width: 36px; height: 36px; color: var(--paper, var(--ink-3)); stroke-width: 1.5; }
.plate.is-loading { background: linear-gradient(100deg, var(--ground-2) 30%, #f3f5f1 50%, var(--ground-2) 70%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.wish-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.wish-body h3 { font-size: var(--step-0); font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wish-desc { color: var(--ink-2); font-size: .9rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.wish-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.store {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px 0 10px; border-radius: 999px;
  background: var(--ground); border: 1px solid var(--line);
  font-size: .8125rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
  max-width: 100%;
}
.store span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store:hover { border-color: var(--line-strong); color: var(--ink); }
.store .icon { width: 15px; height: 15px; }
.wish-foot .spacer { flex: 1; }
.wish-owner-actions { display: flex; gap: 2px; }

/* Reservado: la cinta cruza la placa */
.wish-ribbon {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--plate-h, 0px) * .5);
  height: 34px;
  transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.wish-ribbon .band {
  position: absolute; left: 0; right: 0; top: 50%; height: 18px; margin-top: -9px;
  background: linear-gradient(180deg, var(--satin-shade), var(--satin) 30%, #fff 50%, var(--satin) 70%, var(--satin-shade));
  box-shadow: 0 0 0 1px rgb(0 0 0 / .06), 0 1px 3px rgb(0 0 0 / .18);
  transform-origin: left center;
  animation: tie .25s var(--ease) both;
}
.wish-ribbon .knot { position: relative; width: 64px; animation: pop .22s .16s var(--ease) both; }
.wish-ribbon .knot .bow { position: static; width: 100%; transform: translateY(-4px); }
.wish-ribbon .tag {
  position: absolute; top: calc(50% + 26px); left: 50%;
  translate: -50% 0;
  padding: 5px 12px 6px; border-radius: 4px;
  background: var(--surface); color: var(--ink);
  font-size: .8125rem; font-weight: 650; white-space: nowrap;
  box-shadow: var(--shadow-2);
  rotate: -2deg;
  animation: pop .22s .22s var(--ease) both;
}
.wish-ribbon .tag::before { display: none; }
.wish-ribbon .tag::after { content: ''; position: absolute; left: 4px; top: -12px; width: 1.5px; height: 18px; transform: rotate(-30deg); background: var(--satin-shade); }
.wish.is-reserved .plate img { opacity: .5; filter: saturate(.5); }
.wish.is-reserved .wish-body h3 { color: var(--ink-2); }
@keyframes tie { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }

.reserve-form { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.reserve-form .input { flex: 1 1 140px; min-width: 0; }
.reserve-form .btn { flex: 1 0 auto; }
.reserve-form .input { min-height: 40px; padding: 8px 12px; }

/* ── Hoja lateral (compartir, editar) ─────────── */

dialog.sheet {
  margin: 0 0 0 auto;
  height: 100dvh;
  max-height: none;
  width: min(460px, 100vw);
  max-width: 100vw;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-3);
}
dialog.sheet[open] { animation: slide-in .25s var(--ease); }
dialog.sheet::backdrop { background: rgb(31 42 36 / .35); }
dialog.sheet.wide { width: min(720px, 100vw); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.sheet-in { display: flex; flex-direction: column; height: 100%; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: var(--step-2); font-weight: 720; }
.sheet-body { flex: 1; overflow: auto; padding: 22px 20px 32px; }
.sheet-section + .sheet-section { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.sheet-section h3 { font-size: var(--step-1); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sheet-section > p { color: var(--ink-2); font-size: .9375rem; margin: 6px 0 16px; }

.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }

.people { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 0; }
.avatar {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper, var(--ink)); color: var(--paper-ink, #fff);
  font-weight: 700; font-size: .875rem; text-transform: uppercase;
}
.people .who { flex: 1; min-width: 0; }
.people .who strong { display: block; font-weight: 600; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; }
.people .who span { display: block; font-size: var(--step--1); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.pending { color: #8a6210; font-weight: 600; }

.copy-box {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 6px 6px 6px 14px;
  background: var(--ground); border: 1px solid var(--line); border-radius: 12px;
}
.copy-box code { flex: 1; min-width: 0; font: 500 .8125rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fbf1d9; color: #4f3a08; font-size: .9rem; }
.notice strong { display: block; margin-bottom: 4px; }

/* Interruptor */
.switch-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--ground); cursor: pointer; }
.switch-row .txt { flex: 1; }
.switch-row .txt strong { display: block; font-weight: 650; }
.switch-row .txt span { font-size: .875rem; color: var(--ink-2); }
.switch { appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background-color .2s var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }

/* Selector de papel */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 52px; height: 52px; border-radius: 12px; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatch-label { font-size: .875rem; font-weight: 600; margin: 18px 0 10px; display: block; }
.cover-preview { aspect-ratio: 16 / 7; border-radius: 12px; margin-bottom: 20px; --ribbon-x: 76%; --ribbon-y: 50%; --ribbon-w: 16px; --bow-w: 64px; }

/* Menú de usuario */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; padding: 6px;
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-3);
  border: 1px solid var(--line);
}
.menu-pop[hidden] { display: none; }
.menu-pop .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-pop .who strong { display: block; }
.menu-pop .who span { font-size: var(--step--1); color: var(--ink-3); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; font-weight: 500; text-decoration: none; }
.menu-item:hover { background: var(--ground); }
.avatar-btn { border: 0; padding: 0; cursor: pointer; border-radius: 50%; }

/* Avisos */
#toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #f6f3ea; font-size: .9375rem; font-weight: 500; box-shadow: var(--shadow-3); animation: toast-in .25s var(--ease); }
.toast.is-error { background: #7d2417; }
.toast .icon { width: 18px; height: 18px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Esqueletos */
.sk { background: linear-gradient(100deg, var(--ground-2) 30%, #f3f5f1 50%, var(--ground-2) 70%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--radius); }
.sk-parcel { height: 248px; }
.sk-hero { height: 240px; border-radius: 0; }

.public-foot { margin-top: 64px; text-align: center; color: var(--ink-3); font-size: .875rem; }
.public-foot a { color: var(--ink-2); font-weight: 600; }

.notfound { min-height: 70dvh; display: grid; place-items: center; text-align: center; padding: 24px; }
.notfound h1 { font-size: var(--step-3); margin-bottom: 8px; }
.notfound p { color: var(--ink-2); margin-bottom: 20px; }

@media (max-width: 960px) {
  .parcels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-paper { min-height: 220px; padding: 24px 20px; --ribbon-w: 20px; --bow-w: 96px; --ribbon-x: 78%; --ribbon-y: 42%; }
  .auth-paper .brand { top: 20px; left: 20px; }
  .auth-claim { display: none; }
  .auth-main { padding: 32px 20px 48px; place-items: start center; }
  .item-form { grid-template-columns: 1fr; gap: 16px; padding: 12px 8px 8px; }
  .image-pick .plate { max-width: 320px; }
  .empty { grid-template-columns: 1fr; text-align: left; padding: 24px; gap: 20px; }
  .empty .paper { aspect-ratio: 16 / 7; }
}

@media (max-width: 600px) {
  .page { padding: 24px 16px 88px; }
  .topbar-in { padding: 8px 16px; }
  .page-head h1 { font-size: var(--step-3); }
  .page-head .btn-primary { width: 100%; }
  .parcels { grid-template-columns: 1fr; gap: 16px; }
  .wishes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .wish-body { padding: 10px 12px 12px; }
  .wish-desc { -webkit-line-clamp: 2; font-size: .875rem; }
  .plate img { padding: 8px; }
  .store { min-height: 30px; padding: 0 10px 0 8px; }
  .list-hero { min-height: 200px; --ribbon-x: 88%; --ribbon-w: 18px; --bow-w: 84px; }
  .list-hero-in { padding: 20px 16px; }
  .label-card { max-width: 82%; padding: 14px 16px 16px; }
  .label-card h1 { font-size: var(--step-3); }
  .toolbar { padding: 12px 16px 0; }
  .toolbar .status-chip { margin-bottom: 4px; }
  .toolbar .spacer { display: none; }
  .toolbar-actions { flex: 1 1 100%; }
  .toolbar-actions .btn { flex: 1; }
  .toolbar-actions .btn-primary { --b-bg: var(--surface); --b-ink: var(--ink); --b-line: var(--line-strong); box-shadow: none; }
  .toolbar-actions .btn-primary .icon { color: var(--action); }
  .composer-input { padding-left: 10px; }
  .composer-add { width: 48px; padding: 0; }
  .btn-sm, .btn-icon { min-height: 44px; }
  .btn-icon { width: 44px; }
  .store { min-height: 44px; }
  .section-title { margin-top: 40px; }
  .hide-sm { display: none !important; }
}

@media (min-width: 601px) {
  .show-sm { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.switch-row.hang-tag { margin-left: 14px; padding-left: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-1); }
.list-scope .switch:checked { background: var(--action); }
