/* LAZO · paleta y letras de la referencia elegida por la clienta:
   fondo hueso, rojo, coral, menta, arena y negro. Rótulos en letra manuscrita (Cookie),
   todo lo demás en Montserrat. Formas planas, sin degradados ni sombras. */
/* tipografías servidas desde la propia app (sin Google Fonts) */
@font-face { font-family: "Cookie"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/cookie-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/montserrat-latin-wght-normal.woff2) format("woff2"); }

:root {
  --paper: #f5f1ec;          /* hueso */
  --card: #fbf8f4;
  --ink: #1d1d1b;            /* negro */
  --muted: #66625c;
  --line: #e5dcd1;
  --red: #c4161c;            /* rojo principal */
  --red-dark: #a01217;
  --coral: #ee8d68;
  --mint: #9fcfca;
  --sand: #e8ddd0;
  --hair: var(--coral);      /* filetes finos */
  --gold-text: #b04a29;      /* coral oscurecido para que se lea en textos pequeños */
  --wine: var(--red);
  --forest: var(--ink);
  --burgundy: var(--red);

  --accent: var(--red);
  --primary: var(--red);
  --on-primary: #ffffff;
  --soft: var(--sand);

  --radius: 6px;
  --display: "Cookie", "Brush Script MT", cursive;   /* rótulos */
  --serif: "Montserrat", system-ui, sans-serif;     /* títulos de sección */
  --sans: "Montserrat", system-ui, sans-serif;
}
/* Navidad y Reyes se ven igual: la app no depende de la temporada */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 18px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 20px 64px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0 0 .45em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.2rem, 9vw, 2.9rem); }
h2 { font-size: 1.6rem; margin-top: 2.2em; padding-top: 1.1em; border-top: 1px solid var(--line); }
h3 { font-size: 1.2rem; }
em { font-style: italic; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration-color: var(--hair); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; margin: 26px 0 12px; }
.lead { font-size: 1.05rem; color: var(--muted); }
hr.rule-short { width: 48px; border: 0; border-top: 1px solid var(--hair); margin: 26px 0 22px; }

.top { max-width: 560px; width: 100%; margin: 0 auto; padding: 22px 20px 0; }
.brand { font-family: var(--serif); font-size: 1.7rem; line-height: 1; color: var(--ink); text-decoration: none; }
.brand i { font-style: normal; color: var(--burgundy); }
.foot { max-width: 560px; width: 100%; margin: 0 auto; padding: 22px 20px 32px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.foot em { font-family: var(--serif); font-size: .95rem; }

/* ---- botones ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 58px; padding: 0 26px; border-radius: var(--radius);
  font: 700 .95rem var(--sans); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary);
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost, .btn.plain { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover, .btn.plain:hover { background: var(--ink); color: var(--paper); }
.btn.wa::before { content: ""; width: 19px; height: 19px; flex: none; background: currentColor; -webkit-mask: var(--wa-icon) center/contain no-repeat; mask: var(--wa-icon) center/contain no-repeat; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
:root { --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8s-.4-.1-.6.1-.7.8-.8 1-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.2-.4.2-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.8 11.8 0 0 0 4.5 4c1.7.7 2.3.8 3.2.6a2.7 2.7 0 0 0 1.8-1.3 2.2 2.2 0 0 0 .2-1.3c-.1-.1-.3-.2-.5-.3z'/%3E%3C/svg%3E"); }
.linkbtn { background: none; border: 0; padding: 8px 0; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 4px; cursor: pointer; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 10px; }
.btn:focus-visible, .linkbtn:focus-visible, .iconbtn:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---- formularios ---- */
label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.hint { display: block; font-weight: 500; color: var(--muted); font-size: .88rem; }
input[type=text], input[type=url], textarea, select {
  width: 100%; min-height: 56px; padding: 12px 14px;
  font: 500 1.02rem var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a29c8f; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.field { margin-bottom: 22px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  margin: 0; padding: 18px 12px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  font-family: var(--serif); font-weight: 400; font-size: 1.4rem;
}
.choice label small { display: block; font: 600 .8rem var(--sans); color: var(--muted); margin-top: 2px; letter-spacing: .02em; }
.choice input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 3px; }

.people { list-style: none; padding: 0; margin: 0 0 12px; counter-reset: p; }
.people li { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; counter-increment: p; }
.people li::before { content: counter(p); width: 1.5em; text-align: right; color: var(--gold-text); font-family: var(--serif); font-size: 1.05rem; flex: none; }
.people input { flex: 1; }
.iconbtn {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius);
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.iconbtn:hover { color: var(--ink); border-color: var(--ink); }

.rule { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 6px 0 6px 2px; margin-bottom: 4px; }
.rule span { flex: 1; }
.rule .iconbtn { width: 44px; height: 44px; font-size: 1.1rem; border-color: transparent; }
.ruleform { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 12px 0 8px; }
.ruleform .sep { color: var(--muted); font-size: .85rem; text-align: center; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; margin: 4px 0 10px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }

details { border-top: 1px solid var(--line); padding: 12px 0; }
details > summary { cursor: pointer; font-family: var(--serif); font-size: 1.35rem; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; font-family: var(--sans); font-weight: 300; color: var(--ink); font-size: 1.6rem; }
details[open] > summary::after { content: "−"; }

.error { border: 1px solid var(--burgundy); color: var(--burgundy); background: var(--card); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 600; }
.note { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 18px 0; margin: 22px 0; }
.note p:last-child { margin-bottom: 0; }
.alert { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 22px; font-weight: 700; }

/* ---- portada ---- */
.hero { padding: 18px 0 8px; }
.hero h1 { font-size: clamp(2.6rem, 12vw, 3.6rem); line-height: 1.02; margin-bottom: 0; }
.hero h1 em { color: var(--burgundy); }
.promises { color: var(--muted); font-size: .84rem; letter-spacing: .04em; margin: 14px 0 0; text-align: center; }
.steps { list-style: none; padding: 0; margin: 44px 0 0; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 38px 1fr; gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: var(--gold-text); line-height: 1.2; }
.steps strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; line-height: 1.2; margin-bottom: 2px; }
.steps span { color: var(--muted); }

/* ---- barra de pestañas (abajo, como una app) ---- */
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs-in { max-width: 560px; margin: 0 auto; display: grid; }
#tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 66px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
#tabs a .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
#tabs a.on { color: var(--ink); }
#tabs a.on::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--wine); }
#tabs a:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.badge-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--wine); color: #fff; font-size: .7rem; font-weight: 800; line-height: 1; }
#tabs .badge-dot { position: absolute; top: 7px; left: calc(50% + 7px); }
body #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }

/* ---- conmutador Mi lista / Su lista ---- */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin: 6px 0 8px; }
.seg button { min-height: 52px; padding: 6px 10px; border: 0; background: transparent; color: var(--ink); font: 700 .95rem var(--sans); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button.on .badge-dot { background: var(--paper); color: var(--ink); }
.seg button:focus-visible { outline: 2px solid var(--wine); outline-offset: -4px; }
h2.first { border-top: 0; padding-top: 0; margin-top: 1.4em; }

/* ---- tus sorteos ---- */
.mine .eyebrow { margin-top: 18px; }
.mine li a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.mine li:first-child a { border-top: 1px solid var(--line); }
.mine li a span { flex: 1; min-width: 0; }
.mine li a strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; line-height: 1.2; }
.mine li a small { color: var(--muted); font-size: .88rem; }
.mine li a i { font-style: normal; color: var(--gold-text); font-size: 1.3rem; }
.mine li a:hover strong { text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 4px; }
.mine > p.small { margin-top: 14px; }
.orgbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; margin-top: 10px; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.orgbar a { font-weight: 700; white-space: nowrap; }

/* ---- panel del organizador ---- */
.list { list-style: none; padding: 0; margin: 0; }
.person { border-bottom: 1px solid var(--line); padding: 18px 0; }
.list .person:first-child { border-top: 1px solid var(--line); }
.person .who { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.person .who strong { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.badge { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ink); }
.badge.ok::before { content: "✓ "; }
.result { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line); }
.result td { padding: 13px 4px; border-bottom: 1px solid var(--line); }
.result td:first-child, .result td:last-child { font-family: var(--serif); font-size: 1.15rem; }
.result td:nth-child(2) { color: var(--gold-text); width: 2em; text-align: center; }

/* ---- tarjeta de rascar ---- */
.ticket {
  position: relative; margin: 26px auto 18px; max-width: 440px; aspect-ratio: 7 / 4;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; touch-action: none; user-select: none;
}
.ticket::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--hair); }
.ticket .inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px; }
.ticket .inside small { color: var(--gold-text); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.ticket .inside .name { font-family: var(--serif); font-size: clamp(2.1rem, 10vw, 3rem); color: var(--accent); line-height: 1.08; overflow-wrap: anywhere; }
.ticket canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; transition: opacity .6s; }
.ticket canvas.gone { opacity: 0; pointer-events: none; }

.wish { border-bottom: 1px solid var(--line); padding: 14px 0; display: flex; gap: 10px; align-items: flex-start; }
.list .wish:first-child { border-top: 1px solid var(--line); }
.wish div { flex: 1; min-width: 0; }
.wish strong { font-weight: 700; }
.wish .meta { color: var(--muted); font-size: .9rem; }
.wish a { font-size: .9rem; font-weight: 600; }
.q { border-bottom: 1px solid var(--line); padding: 14px 0; }
.list .q:first-child { border-top: 1px solid var(--line); }
.q .a { margin-top: 8px; padding-left: 14px; border-left: 1px solid var(--hair); font-family: var(--serif); font-size: 1.1rem; }
.q .wait { color: var(--muted); font-style: italic; font-size: .9rem; margin-top: 4px; }
.empty { color: var(--muted); font-style: italic; }

#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140px);
  background: var(--ink); color: var(--paper); padding: 13px 22px; border-radius: var(--radius);
  font-size: .92rem; font-weight: 600; transition: transform .3s ease; max-width: calc(100% - 32px); z-index: 10;
}
#toast.show { transform: translate(-50%, 0); }

dialog.ask {
  width: min(440px, calc(100% - 32px)); padding: 28px 24px 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font-size: 1.05rem;
}
dialog.ask::backdrop { background: rgba(23, 23, 22, .45); }
dialog.ask p { margin: 0 0 22px; }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ask-actions .btn { padding: 0 12px; }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- estilo de la referencia: rótulos manuscritos en rojo, colores planos ---- */
h1 { font-family: var(--display); font-weight: 400; color: var(--red); font-size: clamp(3rem, 13vw, 3.8rem); line-height: .98; letter-spacing: 0; }
h2, h3, .steps strong, .mine li a strong, .person .who strong, details > summary, .choice label, .result td:first-child, .result td:last-child, .q .a { font-family: var(--sans); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; }
.choice label { font-size: 1.1rem; }
.choice input:checked + label { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); color: var(--red); }
.steps strong, .mine li a strong, .person .who strong, details > summary { font-size: 1.1rem; }
.q .a, .result td:first-child, .result td:last-child { font-weight: 600; font-size: 1rem; }
.eyebrow { font-weight: 500; letter-spacing: .32em; color: var(--red); font-size: .78rem; }
.brand { font-family: var(--display); color: var(--red); font-size: 2.4rem; }
.brand i { color: var(--coral); }
.foot em { font-family: var(--display); font-style: normal; font-size: 1.3rem; color: var(--red); }
.hero { text-align: center; }
.hero h1 { font-size: clamp(3.4rem, 16vw, 4.6rem); line-height: .95; }
.hero h1 em { font-style: normal; color: var(--red); }
hr.rule-short { width: 72px; height: 4px; border: 0; border-radius: 2px; margin: 26px auto 22px;
  background: linear-gradient(90deg, var(--coral) 0 33.3%, var(--mint) 33.3% 66.6%, var(--ink) 66.6% 100%); }
.steps b { font-family: var(--sans); font-weight: 800; font-size: 1.1rem; color: var(--coral); line-height: 1.6; }
.btn.wa { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.btn.wa:hover { background: #86c2bc; border-color: #86c2bc; }
#tabs a.on { color: var(--red); }
.seg { border-color: var(--red); }
.seg button { color: var(--red); }
.seg button + button { border-left-color: var(--red); }
.seg button.on { background: var(--red); color: #fff; }
.seg button.on .badge-dot { background: #fff; color: var(--red); }
.badge-dot { background: var(--red); }
.ticket::before { border-color: var(--coral); }
.ticket .inside .name { font-family: var(--display); font-size: clamp(3rem, 14vw, 4rem); color: var(--red); line-height: 1; }
.ticket .inside small { color: var(--gold-text); }
.alert { border-left-color: var(--red); }
