/* Mistletoss
   Direction: a letterpress holiday card on warm paper. Handmade, warm, a little cheeky.
   Evergreen ink, one cranberry accent, a whisper of gold. */

:root {
  /* color */
  --paper: #f5ede0;
  --paper-2: #efe4d2;
  --card: #fffaf2;
  --ink: #16352a;
  --ink-2: #3f5a4f;
  --muted: #5f7068;
  --line: #ddcfb9;
  --line-strong: #c9b79b;
  --pine: #1c4434;
  --pine-2: #245841;
  --berry: #c4372d;
  --berry-2: #a82c23;
  --berry-soft: #f6dcd6;
  --gold: #b88a2e;
  --gold-soft: #f1e3c3;
  --on-pine: #f8f1e4;
  --focus: #c4372d;
  --shadow-1: 0 1px 0 rgba(22, 53, 42, .06), 0 2px 6px rgba(22, 53, 42, .06);
  --shadow-2: 0 2px 0 rgba(22, 53, 42, .05), 0 12px 32px -12px rgba(22, 53, 42, .28);

  /* type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --fs-hero: clamp(2.6rem, 1.6rem + 5vw, 5.4rem);

  /* space (4-based scale) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1120px;

  /* shape */
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-pill: 999px;

  /* motion */
  --dur-fast: 150ms;
  --dur-ui: 220ms;
  --dur-panel: 340ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --rise: 10px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f231c;
    --paper-2: #132b22;
    --card: #17342a;
    --ink: #f3ead9;
    --ink-2: #d6cbb6;
    --muted: #a9b6ad;
    --line: #2a4a3d;
    --line-strong: #3a5f50;
    --pine: #e9dcc3;
    --pine-2: #fff4df;
    --berry: #f07467;
    --berry-2: #ff8174;
    --berry-soft: #43231f;
    --gold: #e2b85c;
    --gold-soft: #3a3220;
    --on-pine: #13281f;
    --focus: #ef6a5d;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, .2);
    --shadow-2: 0 18px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  /* faint paper grain */
  background-image:
    radial-gradient(rgba(120, 90, 40, .045) 1px, transparent 1.2px),
    radial-gradient(rgba(120, 90, 40, .03) 1px, transparent 1.2px);
  background-size: 22px 22px, 31px 31px;
  background-position: 0 0, 11px 7px;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--pine); color: var(--on-pine); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main, main:focus, main:focus-visible { outline: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: 0; font-variation-settings: "SOFT" 100, "opsz" 96; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); letter-spacing: -.01em; line-height: 1.2; }
h3 { font-size: var(--fs-md); font-family: var(--font-body); letter-spacing: 0; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid transparent; transition: border-color var(--dur-ui) var(--ease-out); }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; font-variation-settings: "SOFT" 100, "opsz" 48; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand em { font-style: italic; color: var(--berry); font-weight: 600; }
.nav { display: flex; align-items: center; gap: var(--s2); }
.nav a.navlink { white-space: nowrap; text-decoration: none; font-weight: 600; font-size: var(--fs-sm); padding: 10px 12px; border-radius: var(--r-pill); color: var(--ink-2); transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast); min-height: 44px; display: inline-flex; align-items: center; }
.nav a.navlink:hover { background: var(--paper-2); color: var(--ink); }
.nav a.navlink[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.usermenu { position: relative; }
.avatar-btn { border: 0; background: none; padding: 4px; border-radius: var(--r-pill); cursor: pointer; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 6px; min-width: 200px; transform-origin: top right; animation: pop var(--dur-ui) var(--ease-out); }
.menu[hidden] { display: none; }
.menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who strong { display: block; }
.menu .who span { font-size: var(--fs-xs); color: var(--muted); word-break: break-all; }
.menu button, .menu a { display: flex; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; text-decoration: none; min-height: 44px; align-items: center; }
.menu button:hover, .menu a:hover { background: var(--paper-2); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 440px) { .nav a.navlink.hide-sm { display: none; } .brand { font-size: 1.2rem; } }
@media (max-width: 360px) { .topbar .wrap { gap: var(--s2); } .brand { font-size: 1.05rem; gap: 6px; } .nav a.navlink { padding: 10px 8px; } .nav .btn.small { padding: 0 12px; } }

/* ---------- buttons & fields ---------- */
.btn { --bg: var(--pine); --fg: var(--on-pine); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); border: 0; background: var(--bg); color: var(--fg); font-weight: 700; font-size: var(--fs-md); text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), box-shadow var(--dur-ui) var(--ease-out); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.btn:hover { background: var(--pine-2); transform: translateY(-1px); box-shadow: 0 4px 0 rgba(0,0,0,.1), 0 10px 20px -10px rgba(22,53,42,.5); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.12); transition-duration: 60ms; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.berry { --bg: var(--berry); --fg: #fff; }
.btn.berry:hover { background: var(--berry-2); }
@media (prefers-color-scheme: dark) { .btn.berry { --fg: var(--on-pine); } }
.btn.ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.ghost:hover { background: var(--paper-2); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish { background: none; border: 0; padding: 6px 4px; color: var(--ink-2); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.linkish:hover { color: var(--berry); text-decoration-color: currentColor; }
.linkish.danger { color: var(--berry); }

.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 600; font-size: var(--fs-sm); }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.input { width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--card); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:hover { border-color: var(--ink-2); }
.input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pine) 16%, transparent); }
.input[aria-invalid="true"] { border-color: var(--berry); }
.error-text { color: var(--berry); font-size: var(--fs-sm); font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.error-text:empty { display: none; }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; gap: var(--s4); grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- landing ---------- */
.hero { padding: clamp(32px, 7vw, 88px) 0 clamp(48px, 8vw, 104px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--berry); margin-bottom: var(--s5); }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.hero h1 { font-size: var(--fs-hero); line-height: .98; letter-spacing: -.035em; font-weight: 600; font-variation-settings: "SOFT" 100, "opsz" 144; }
.hero h1 em { font-style: italic; color: var(--berry); font-weight: 500; }
.hero .lede { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--ink-2); max-width: 34ch; margin-top: var(--s5); }
.hero .ctas { margin-top: var(--s6); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.hero .small-print { margin-top: var(--s4); font-size: var(--fs-sm); color: var(--muted); }

.tagline-art { position: relative; height: 420px; }
.tagline-art .string { position: absolute; left: -6%; right: -6%; top: 26px; height: 60px; }
.htag { position: absolute; top: 40px; width: 31%; max-width: 150px; transform-origin: 50% 0; animation: sway 6s var(--ease-in-out) infinite alternate; }
.htag .cord { width: 2px; height: var(--cord, 60px); margin: 0 auto; background: var(--gold); opacity: .8; }
.htag .card-tag { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px 10px 14px 14px; padding: 34px 16px 18px; box-shadow: var(--shadow-2); clip-path: polygon(22% 0, 78% 0, 100% 16%, 100% 100%, 0 100%, 0 16%); text-align: center; }
.htag .card-tag::before { content: ""; position: absolute; top: 12px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--line-strong); }
.htag .to { font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.htag .nm { font-family: var(--font-display); font-style: italic; font-size: 1.7rem; line-height: 1.1; margin-top: 4px; }
.htag.t1 { left: 2%; --cord: 70px; animation-delay: -1s; }
.htag.t2 { left: 35%; --cord: 130px; animation-duration: 7s; }
.htag.t2 .card-tag { background: var(--pine); color: var(--on-pine); border-color: transparent; }
.htag.t2 .to { color: color-mix(in srgb, var(--on-pine) 70%, transparent); }
.htag.t3 { left: 67%; --cord: 40px; animation-delay: -3s; animation-duration: 5.5s; }
.htag.t3 .card-tag { background: var(--berry); color: #fff; border-color: transparent; }
.htag.t3 .to { color: rgba(255,255,255,.78); }
.htag .qmark { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; font-weight: 700; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }

.steps { padding: clamp(48px, 8vw, 96px) 0; background: var(--pine); color: var(--on-pine); position: relative; }
.steps h2 { font-size: var(--fs-xl); max-width: 18ch; }
.steps .muted { color: color-mix(in srgb, var(--on-pine) 72%, transparent); }
.steps ol { list-style: none; padding: 0; margin: var(--s7) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); position: relative; counter-reset: s; }
.steps ol::before { content: ""; position: absolute; top: 22px; left: 22px; right: 22px; border-top: 2px dashed color-mix(in srgb, var(--on-pine) 35%, transparent); }
.steps li { position: relative; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--paper); color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; margin-bottom: var(--s4); position: relative; }
.steps li:nth-child(2)::before { background: var(--gold-soft); }
.steps li:nth-child(3)::before { background: var(--berry); color: #fff; }
.steps li h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; margin-bottom: 6px; }
.steps li p { color: color-mix(in srgb, var(--on-pine) 78%, transparent); max-width: 30ch; }
@media (prefers-color-scheme: dark) { .steps { background: #0a1a14; color: var(--ink); } .steps li p, .steps .muted { color: var(--muted); } .steps li::before { background: var(--card); color: var(--ink); } }

.paste { padding: clamp(56px, 9vw, 112px) 0; }
.paste .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.paste h2 { font-size: var(--fs-xl); }
.paste p { color: var(--ink-2); margin-top: var(--s4); max-width: 40ch; }
.demo-paste { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-2); transform: rotate(-1deg); }
.demo-paste .fake-input { display: flex; align-items: center; gap: 10px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; font-size: var(--fs-sm); color: var(--muted); overflow: hidden; white-space: nowrap; }
.demo-paste .fake-input svg { width: 16px; height: 16px; flex: none; color: var(--berry); }
.demo-paste .fake-input b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.demo-paste .mini-list { display: grid; gap: 10px; margin-top: var(--s4); }
.mini { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-md); background: var(--paper); }
.mini .ph { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.mini strong { display: block; font-size: var(--fs-sm); line-height: 1.3; }
.mini small { color: var(--muted); font-size: var(--fs-xs); }
.mini .price { font-weight: 700; font-size: var(--fs-sm); }

.finale { padding: 0 0 clamp(56px, 9vw, 112px); }
.finale .box { border-radius: var(--r-lg); padding: clamp(28px, 5vw, 56px); background: var(--berry); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; position: relative; overflow: hidden; }
.finale h2 { font-size: var(--fs-xl); max-width: 20ch; }
.finale .btn { --bg: #fff; --fg: var(--berry-2); }
.finale .btn:hover { background: #fff6f2; }
@media (prefers-color-scheme: dark) { .finale .box { background: #7c2119; } .finale .btn { --fg: #7c2119; } }
.footer { padding: var(--s6) 0 var(--s7); font-size: var(--fs-sm); color: var(--muted); }
.footer .wrap { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero .wrap, .paste .wrap { grid-template-columns: minmax(0, 1fr); }
  .tagline-art { height: 300px; max-width: 480px; }
  .htag .nm { font-size: 1.35rem; }
  .steps ol { grid-template-columns: 1fr; gap: var(--s5); }
  .steps ol::before { top: 22px; bottom: 22px; left: 22px; right: auto; border-top: 0; border-left: 2px dashed color-mix(in srgb, var(--on-pine) 35%, transparent); }
  .steps li { padding-left: 64px; }
  .steps li::before { position: absolute; left: 0; top: 0; margin: 0; }
}

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - 64px); display: grid; place-items: start center; padding: clamp(24px, 6vw, 72px) var(--gutter) var(--s8); }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow-2); }
.auth-card h1 { margin-bottom: 6px; }
.auth-card form { display: grid; gap: var(--s4); margin-top: var(--s5); }
.auth-card .switch { margin-top: var(--s5); text-align: center; font-size: var(--fs-sm); color: var(--muted); }
.auth-card .switch a { color: var(--ink); font-weight: 700; }
.invite-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--gold-soft); margin-bottom: var(--s5); font-size: var(--fs-sm); }

/* ---------- app pages ---------- */
.page { padding: clamp(24px, 5vw, 56px) 0 var(--s9); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.page-head p { margin-top: 6px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s4); min-height: 44px; }
.back:hover { color: var(--ink); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3.5vw, 32px); box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: var(--s5); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.panel-head p { color: var(--muted); font-size: var(--fs-sm); }

.exchanges { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s5); }
.xcard { position: relative; display: flex; flex-direction: column; gap: var(--s4); text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-1); transition: transform var(--dur-ui) var(--ease-out), box-shadow var(--dur-ui) var(--ease-out), border-color var(--dur-ui); min-height: 180px; }
.xcard:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.xcard h2 { font-size: 1.5rem; }
.xcard .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; background: var(--paper-2); color: var(--ink-2); }
.chip.berry { background: var(--berry-soft); color: var(--berry-2); }
.chip.gold { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 50%, var(--ink)); }
.chip.pine { background: var(--pine); color: var(--on-pine); }
.chip svg { width: 14px; height: 14px; }
.xcard .status { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.dot.go { background: var(--berry); box-shadow: 0 0 0 4px var(--berry-soft); }
.dot.done { background: var(--pine-2); }
.xcard.new { border: 2px dashed var(--line-strong); background: transparent; box-shadow: none; align-items: flex-start; justify-content: center; color: var(--ink-2); }
.xcard.new:hover { border-color: var(--berry); color: var(--berry); transform: none; }
.xcard.new .plus { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font-size: 1.6rem; font-weight: 400; line-height: 1; }

.empty { text-align: center; padding: clamp(32px, 6vw, 64px) var(--s5); border: 2px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty h2 { margin: var(--s4) 0 var(--s2); }
.empty p { color: var(--muted); max-width: 42ch; margin: 0 auto var(--s5); }
.empty .art { width: 88px; margin: 0 auto; }

/* group page */
.group-hero { display: grid; grid-template-columns: 1fr auto; gap: var(--s5); align-items: end; margin-bottom: var(--s6); }
.group-hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -.03em; }
.facts { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }
.countdown { text-align: right; }
.countdown .n { font-family: var(--font-display); font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem); line-height: 1; font-weight: 700; color: var(--berry); font-variant-numeric: tabular-nums; }
.countdown .l { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
.note-quote { margin-top: var(--s4); padding-left: var(--s4); border-left: 3px solid var(--gold); color: var(--ink-2); max-width: 60ch; font-style: italic; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (max-width: 900px) { .layout-2 { grid-template-columns: minmax(0, 1fr); } .group-hero { grid-template-columns: 1fr; } .countdown { text-align: left; } }

.invite-box { display: flex; gap: 8px; align-items: stretch; background: var(--paper); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 6px 6px 6px 14px; }
.invite-box code { flex: 1; min-width: 0; align-self: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row { display: flex; gap: 8px; margin-top: var(--s3); flex-wrap: wrap; }

.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.people li:last-child { border-bottom: 0; }
.people .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .you { font-weight: 500; color: var(--muted); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; flex: none; letter-spacing: .02em; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: background var(--dur-fast), color var(--dur-fast); }
.icon-btn:hover { background: var(--berry-soft); color: var(--berry); }
.icon-btn svg { width: 18px; height: 18px; }

.rules { display: grid; gap: 8px; margin-top: var(--s3); }
.rule { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: var(--r-md); background: var(--paper); font-size: var(--fs-sm); font-weight: 600; }
.rule .x { color: var(--berry); font-weight: 800; }
.rule span.t { flex: 1; }
.rule-form { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: var(--s3); }
.rule-form .btn { grid-column: 1 / -1; justify-self: start; }
.rule-form .amp { font-family: var(--font-display); font-style: italic; color: var(--muted); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f7068' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; min-width: 0; }
@media (max-width: 520px) { .rule-form { grid-template-columns: 1fr; } .rule-form .amp { text-align: center; } }

.draw-cta { display: grid; gap: var(--s3); padding: var(--s5); border-radius: var(--r-lg); background: var(--pine); color: var(--on-pine); margin-bottom: var(--s5); }
.draw-cta h2 { font-size: 1.6rem; }
.draw-cta p { color: color-mix(in srgb, var(--on-pine) 78%, transparent); }
.draw-cta .btn { --bg: var(--berry); --fg: #fff; justify-self: start; }
.draw-cta .btn:hover { background: var(--berry-2); }
.waiting { display: flex; gap: 12px; align-items: center; padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--gold-soft); margin-bottom: var(--s5); font-weight: 600; }

/* ---------- the reveal ---------- */
.reveal-stage { position: relative; display: grid; place-items: center; padding: var(--s6) var(--s4) var(--s5); perspective: 1200px; min-height: 420px; }
.reveal-stage .cord { width: 2px; height: 56px; background: var(--gold); margin: 0 auto -2px; }
.gift-tag { position: relative; width: min(340px, 86vw); height: 300px; transform-style: preserve-3d; transition: transform 900ms var(--ease-spring); transform-origin: 50% 0; }
.gift-tag.swing { animation: tagSway 4s var(--ease-in-out) infinite alternate; }
.gift-tag.flipped { transform: rotateY(180deg); animation: none; }
.tag-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px 16px 22px 22px; clip-path: polygon(24% 0, 76% 0, 100% 14%, 100% 100%, 0 100%, 0 14%); display: grid; place-items: center; text-align: center; padding: 56px 28px 28px; box-shadow: var(--shadow-2); }
.tag-face::before { content: ""; position: absolute; top: 18px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
.tag-front { background: var(--berry); color: #fff; }
.tag-front .seal { font-family: var(--font-display); font-style: italic; font-size: 1.9rem; line-height: 1.1; font-weight: 500; }
.tag-front .sub { margin-top: 10px; opacity: .85; font-size: var(--fs-sm); }
.tag-front .stripes { position: absolute; inset: auto 0 0 0; height: 18px; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 8px, transparent 8px 16px); }
.tag-back { background: var(--gold-soft); color: var(--ink); transform: rotateY(180deg); }
.tag-back::after { content: ""; position: absolute; inset: 10px; border: 1.5px dashed color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 10px 10px 14px 14px; clip-path: inherit; pointer-events: none; }
.tag-back .to { font-size: var(--fs-xs); letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); }
.tag-back .who { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: clamp(2.2rem, 1.6rem + 3vw, 3.2rem); line-height: 1.02; margin: 8px 0 10px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tag-back .shh { font-size: var(--fs-sm); color: var(--ink-2); }
.reveal-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: var(--s5); }
.reveal-actions .hint { font-size: var(--fs-sm); color: var(--muted); }
@keyframes tagSway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; opacity: 0; animation: fall var(--d, 1800ms) var(--ease-out) var(--delay, 0ms) forwards; }
@keyframes fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
  100% { opacity: 0; transform: translate3d(var(--x, 0), 90vh, 0) rotate(var(--r, 360deg)); }
}

/* ---------- wishes ---------- */
.paste-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.paste-form .input { min-height: 56px; font-size: var(--fs-md); }
.paste-form .btn { min-height: 56px; }
@media (max-width: 560px) { .paste-form { grid-template-columns: 1fr; } }
.wishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.wish { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); transition: transform var(--dur-ui) var(--ease-out), box-shadow var(--dur-ui) var(--ease-out); animation: rise var(--dur-panel) var(--ease-out) both; }
.wish:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.wish .img { aspect-ratio: 4 / 3; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; }
.wish .img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.wish .img .mono { font-family: var(--font-display); font-weight: 700; font-size: 3rem; font-style: italic; }
.wish .body { padding: 14px 16px 16px; display: grid; gap: 6px; flex: 1; align-content: start; }
.wish .site { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.wish .site .price { color: var(--ink); letter-spacing: 0; }
.wish .title { font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.wish .note { font-size: var(--fs-sm); color: var(--ink-2); font-style: italic; }
.wish .actions > span { display: inline-flex; }
.wish .actions { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px 16px; gap: 8px; }
.wish .open { font-weight: 700; font-size: var(--fs-sm); color: var(--berry); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.wish .open:hover { text-decoration: underline; text-underline-offset: 3px; }
.wish.pending { opacity: .7; }
.wish.pending .img { background: linear-gradient(100deg, var(--paper-2) 30%, var(--paper) 50%, var(--paper-2) 70%); background-size: 300% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise)); } to { opacity: 1; transform: none; } }

.note-edit { display: flex; gap: 6px; margin-top: 4px; }
.note-edit .input { min-height: 40px; padding: 8px 12px; font-size: var(--fs-sm); }

/* ---------- toasts ---------- */
.toast-region { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow-2); animation: toastIn var(--dur-ui) var(--ease-out); display: flex; gap: 10px; align-items: center; }
.toast.error { background: var(--berry); color: #fff; }
.toast.out { animation: toastOut var(--dur-fast) ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* dialog */
dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--card); color: var(--ink); box-shadow: var(--shadow-2); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 25, 19, .45); }
dialog[open] { animation: pop var(--dur-ui) var(--ease-out); }
dialog .dlg { padding: var(--s6); display: grid; gap: var(--s4); }
dialog .dlg .row { justify-content: flex-end; }

/* page enter */
.enter > * { animation: rise var(--dur-panel) var(--ease-out) both; }
.enter > *:nth-child(2) { animation-delay: 40ms; }
.enter > *:nth-child(3) { animation-delay: 80ms; }
.enter > *:nth-child(4) { animation-delay: 120ms; }

.loading-page { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .htag, .gift-tag.swing { animation: none !important; }
  .gift-tag { transition: opacity 200ms !important; }
  .confetti { display: none; }
}

/* ---------- shared photos ---------- */
.panel.photos { margin-top: var(--s5); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s2); margin-top: var(--s3); }
.photo { aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-ui) var(--ease-out); }
.photo:hover img { transform: scale(1.04); }
dialog.lightbox { width: min(920px, calc(100vw - 24px)); padding: var(--s3); }
.lightbox img { display: block; width: 100%; max-height: 74vh; object-fit: contain; border-radius: var(--r-md); background: var(--paper-2); }
.lightbox > .row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
