/* AdventForUs — winter-night hearth design system.
   Reference image: two candles on a windowsill and an open letter, December dark.
   Palette: night blue + candlelight orange + letter-cream. */

:root {
  --bg: #0d1326;
  --bg-2: #121a33;
  --card: #1a2242;
  --card-2: #222b52;
  --ink: #f4ecdc;
  --muted: #97a1bd;
  --flame: #ef8f3c;
  --flame-deep: #d9742b;
  --gold: #e9bd67;
  --holly: #c4504a;
  --line: rgba(233, 189, 103, 0.16);
  --paper: #f7f0e0;
  --paper-ink: #39301f;
  --paper-muted: #7d6f56;
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius: 14px;
  --door-hi: #2a335e;
  --door-lo: #1d2650;
  --door-hi2: #343e72;
  --door-lo2: #242e5c;
  --door-line: rgba(233, 189, 103, 0.12);
  --door-g2a: #23405c; --door-g2b: #182e46;
  --door-g3a: #32305f; --door-g3b: #24224e;
  --door-g4a: #27403a; --door-g4b: #1a2f2a;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 10px 30px rgba(3, 6, 18, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(239, 143, 60, 0.08), transparent 60%),
    radial-gradient(900px 420px at 8% 8%, rgba(233, 189, 103, 0.05), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 320px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: 22px; }
p { margin: 0 0 14px; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
em { font-style: normal; color: var(--flame); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--paper); color: var(--paper-ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 50; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); background: rgba(13, 19, 38, 0.75); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.head-row { display: flex; align-items: center; gap: 22px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 21px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.brand-name em { color: var(--flame); }
.site-nav { display: flex; gap: 20px; margin-left: auto; }
.site-nav a { color: var(--muted); font-size: 15px; font-weight: 600; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.btn-head { white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
  font: 600 16px var(--font-body); padding: 13px 22px; min-height: 48px;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--flame); color: #20130a; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--flame-deep); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn-danger { background: transparent; color: #e6a49f; border: 1px solid rgba(196, 80, 74, 0.5); }
.btn-danger:hover { background: rgba(196, 80, 74, 0.12); }
.btn[disabled] { opacity: 0.55; cursor: default; pointer-events: none; }
.btn-xl { padding: 16px 30px; font-size: 18px; min-height: 56px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 16px; }
.hero h1 { font-size: 52px; margin-bottom: 18px; }
.hero h1 .flame-word { color: var(--flame); }
.hero-sub { color: var(--muted); font-size: 19px; max-width: 46ch; margin-bottom: 26px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-fine { color: var(--muted); font-size: 14px; margin-top: 14px; }
.hero-fine span { color: var(--gold); }

/* decorative mini calendar */
.mini-cal {
  background: linear-gradient(165deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: 20px; padding: 26px;
  box-shadow: var(--shadow-2);
}
.mini-cal-title { font-family: var(--font-head); font-size: 18px; color: var(--gold); margin: 0 0 14px; display: flex; justify-content: space-between; align-items: baseline; }
.mini-cal-title small { color: var(--muted); font-family: var(--font-body); font-size: 12px; }
.door-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.door {
  aspect-ratio: 1; border-radius: 10px; position: relative; overflow: hidden;
  background: linear-gradient(170deg, var(--door-hi), var(--door-lo));
  border: 1px solid var(--door-line);
  display: flex; align-items: center; justify-content: center;
  font: 600 14px var(--font-body); color: var(--muted);
  transition: box-shadow 0.2s ease, color 0.2s ease;
}
.door .glow {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s ease;
  background: radial-gradient(60px 60px at 50% 42%, rgba(239, 143, 60, 0.35), transparent 70%);
}
.door:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.door:hover .glow { opacity: 1; }
.door.today { color: #2a1608; font-weight: 700; background: linear-gradient(170deg, var(--flame), #d9742b); border-color: transparent; }
.door.today .glow { background: radial-gradient(60px 60px at 50% 42%, rgba(255, 220, 160, 0.5), transparent 70%); }
.door.past { color: var(--ink); background: linear-gradient(170deg, var(--door-hi2), var(--door-lo2)); }
.door.opened::after { content: "✦"; position: absolute; top: 5px; right: 8px; font-size: 12px; color: var(--gold); }
.mini-cal-foot { margin: 16px 0 0; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; }

/* ---------- sections ---------- */
.section { padding: 64px 0; border-top: 1px solid rgba(233, 189, 103, 0.08); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 17px; }

/* steps: vertical numbered timeline */
.steps { display: grid; gap: 0; max-width: 720px; }
.step { display: grid; grid-template-columns: 64px 1fr; gap: 22px; padding: 22px 0; border-bottom: 1px dashed rgba(233, 189, 103, 0.14); }
.step:last-child { border-bottom: 0; }
.step-no {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(170deg, var(--card-2), var(--card));
  border: 1px solid var(--line); color: var(--gold);
  font-family: var(--font-head); font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; }
.step .step-note { color: var(--gold); font-size: 14px; margin-top: 8px; }

/* keepsake preview: letter-style card */
.keepsake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.recap-letter {
  background: var(--paper); color: var(--paper-ink);
  border-radius: 6px 18px 6px 18px; padding: 30px 30px 26px;
  box-shadow: var(--shadow-2); transform: rotate(-1deg);
}
.recap-letter .rl-kicker { color: var(--paper-muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.recap-letter h3 { font-size: 30px; color: #2e2314; margin: 6px 0 4px; }
.recap-letter .rl-names { color: var(--flame-deep); font-weight: 600; margin-bottom: 14px; }
.rl-line { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 9px 0; border-top: 1px dashed rgba(61, 47, 31, 0.18); font-size: 14.5px; }
.rl-line .rl-day { color: var(--paper-muted); font-weight: 600; }
.rl-line blockquote { margin: 0; color: var(--paper-ink); }
.rl-line .rl-voice { color: var(--flame-deep); font-size: 12.5px; }
.rl-fade { text-align: center; color: var(--paper-muted); font-size: 13px; padding-top: 12px; border-top: 1px dashed rgba(61, 47, 31, 0.18); }

/* prose */
.prose { max-width: 70ch; }
.prose h2 { font-size: 30px; margin-top: 40px; }
.prose h3 { font-size: 20px; margin-top: 28px; }
.prose p, .prose li { color: #d8d2c2; }
.prose ul { padding-left: 22px; }
.prose a { text-decoration: underline; }

/* FAQ */
.faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.faq-item h3 { font-size: 17px; font-family: var(--font-body); font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.faq-item p { color: var(--muted); font-size: 15px; margin: 0; }

/* CTA tail */
.cta-tail { text-align: center; padding: 72px 22px; border-top: 1px solid rgba(233, 189, 103, 0.08); }
.cta-tail h2 { margin-bottom: 10px; }
.cta-tail p { color: var(--muted); margin-bottom: 26px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0 44px; background: rgba(9, 13, 28, 0.6); }
.foot-row { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.foot-tag { color: var(--muted); max-width: 40ch; font-size: 15px; }
.foot-copy { color: #6d7794; font-size: 13.5px; }
.foot-nav { display: flex; gap: 22px; align-items: flex-start; }
.foot-nav a { color: var(--muted); font-size: 14.5px; }

/* ---------- cookie band ---------- */
.cookie-band { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #101730; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(3, 6, 18, 0.5); padding: 14px 0; }
.cookie-row { display: flex; gap: 22px; align-items: center; }
.cookie-text { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 88ch; }
.cookie-text strong { color: var(--ink); }
.cookie-actions { display: flex; gap: 10px; margin-left: auto; flex-shrink: 0; }

/* ---------- app pages (create / join / calendar) ---------- */
.app-page { padding: 44px 0 80px; min-height: 60vh; }
.app-shell { max-width: 760px; margin: 0 auto; }
.app-shell.wide { max-width: 980px; }
.app-loading { text-align: center; color: var(--muted); padding: 60px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--flame); animation: spin 0.9s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-card { background: linear-gradient(168deg, var(--card), var(--card-2)); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow-2); }
.app-card + .app-card { margin-top: 20px; }
.app-card h2 { font-size: 28px; }
.app-card .hint { color: var(--muted); font-size: 14.5px; }
.app-title-sm { font-family: var(--font-head); color: var(--gold); font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 6px; }

/* forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 7px; }
.field .sub { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="date"], textarea, select {
  width: 100%; background: #101731; color: var(--ink);
  border: 1px solid rgba(233, 189, 103, 0.2); border-radius: 10px;
  padding: 12px 14px; font: 400 16px var(--font-body);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(239, 143, 60, 0.18); }
textarea { min-height: 88px; resize: vertical; }
.radio-row { display: grid; gap: 10px; }
.radio-opt { display: flex; gap: 10px; align-items: flex-start; background: #101731; border: 1px solid rgba(233, 189, 103, 0.2); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.radio-opt:hover { border-color: var(--gold); }
.radio-opt input { margin-top: 4px; accent-color: var(--flame); }
.radio-opt .ro-main { font-weight: 600; font-size: 15px; }
.radio-opt .ro-sub { color: var(--muted); font-size: 13.5px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }

/* door editor */
.door-editor { display: grid; gap: 14px; margin-top: 16px; }
.door-edit { background: #101731; border: 1px solid rgba(233, 189, 103, 0.16); border-radius: 12px; padding: 14px 16px; }
.door-edit-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.door-edit-head .de-day { font-family: var(--font-head); font-weight: 700; color: var(--gold); font-size: 16px; }
.door-edit-head .de-date { color: var(--muted); font-size: 13px; }
.rec-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.rec-btn { display: inline-flex; align-items: center; gap: 7px; background: rgba(239, 143, 60, 0.12); color: var(--flame); border: 1px solid rgba(239, 143, 60, 0.4); border-radius: 999px; padding: 7px 14px; font: 600 13.5px var(--font-body); cursor: pointer; min-height: 36px; }
.rec-btn:hover { background: rgba(239, 143, 60, 0.2); }
.rec-btn.recording { background: rgba(196, 80, 74, 0.15); color: #eda09a; border-color: rgba(196, 80, 74, 0.55); }
.rec-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.rec-btn.recording .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.rec-timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13.5px; }
.rec-have { color: var(--gold); font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.rec-clear { background: none; border: none; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 0; }
.char-note { color: var(--muted); font-size: 12px; text-align: right; margin-top: 4px; }

/* progress meter */
.meter { background: #101731; border: 1px solid var(--line); border-radius: 999px; height: 10px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--flame), var(--gold)); border-radius: 999px; transition: width 0.3s ease; }
.meter-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13.5px; margin: 8px 0 18px; }

/* link cards */
.link-card { background: #101731; border: 1px solid rgba(233, 189, 103, 0.25); border-radius: 12px; padding: 16px 18px; margin-top: 16px; }
.link-card .lc-label { font-weight: 600; color: var(--gold); font-size: 14px; margin-bottom: 6px; }
.link-card .lc-note { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.link-row { display: flex; gap: 10px; align-items: center; }
.link-box { flex: 1; background: #0b1124; border: 1px solid rgba(233, 189, 103, 0.18); color: var(--ink); border-radius: 8px; padding: 10px 12px; font: 500 13px ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* calendar open view */
.cal-head { text-align: center; margin-bottom: 30px; }
.cal-head .ch-kicker { color: var(--gold); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.cal-head h1 { font-size: 40px; margin: 8px 0 6px; }
.cal-head .ch-names { color: var(--muted); font-size: 16px; }
.cal-head .ch-names b { color: var(--ink); }
.waiting-band { display: flex; gap: 12px; align-items: center; justify-content: center; background: rgba(233, 189, 103, 0.08); border: 1px dashed rgba(233, 189, 103, 0.3); color: var(--gold); border-radius: 12px; padding: 12px 18px; margin: 18px auto 0; max-width: 640px; font-size: 14.5px; }
.cal-grid-wrap { max-width: 820px; margin: 0 auto; }
.open-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.open-door {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid rgba(233, 189, 103, 0.14);
  background: linear-gradient(170deg, #2a335e, #1d2650);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; position: relative; padding: 6px; transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.open-door .od-no { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--muted); }
.open-door .od-date { font-size: 12px; color: #6d7794; }
.open-door .od-voice { position: absolute; top: 6px; right: 8px; font-size: 12px; color: var(--gold); }
.open-door:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(3, 6, 18, 0.4); }
.open-door.locked { cursor: default; opacity: 0.45; }
.open-door.locked:hover { transform: none; box-shadow: none; }
.open-door.today { background: linear-gradient(170deg, var(--flame), var(--flame-deep)); border-color: transparent; }
.open-door.today .od-no { color: #2a1608; }
.open-door.today .od-date { color: rgba(42, 22, 8, 0.75); }
.open-door.past { background: linear-gradient(170deg, var(--door-hi2), var(--door-lo2)); }
.open-door.past .od-no { color: var(--ink); }
.open-door.read::after { content: "✦"; position: absolute; top: 5px; right: 7px; font-size: 12px; color: var(--gold); }
.open-door.blank { background: repeating-linear-gradient(45deg, #1c2448, #1c2448 8px, #212a52 8px, #212a52 16px); }
.cal-tools { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* modal (open a door) */
.modal-veil { position: fixed; inset: 0; background: rgba(5, 8, 20, 0.72); backdrop-filter: blur(4px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-paper { background: var(--paper); color: var(--paper-ink); width: min(560px, 100%); max-height: 86vh; overflow: auto; border-radius: 8px 22px 8px 22px; padding: 30px 32px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); position: relative; transform: rotate(-0.5deg); }
.modal-paper .mp-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 22px; color: var(--paper-muted); cursor: pointer; line-height: 1; }
.mp-kicker { color: var(--paper-muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.mp-door-no { font-family: var(--font-head); font-size: 40px; font-weight: 700; color: #2e2314; margin: 2px 0 0; }
.mp-author { color: var(--flame-deep); font-weight: 600; margin: 2px 0 14px; }
.mp-body { font-size: 17px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.mp-body.quiet { color: var(--paper-muted); font-style: italic; }
.mp-audio { margin-top: 16px; }
.mp-audio audio { width: 100%; }
.mp-load { color: var(--paper-muted); font-size: 13.5px; }
.mp-err { color: #a4442f; font-size: 13.5px; }

/* recap */
.recap-head { text-align: center; max-width: 640px; margin: 10px auto 34px; }
.recap-head .rk { color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px; font-weight: 600; }
.recap-head h1 { font-size: 52px; margin: 10px 0 6px; }
.recap-head .rp-sub { color: var(--muted); font-size: 17px; }
.recap-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.stat-chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; font-size: 14px; color: var(--muted); }
.stat-chip b { color: var(--ink); }
.recap-list { max-width: 720px; margin: 0 auto; }
.recap-item { display: grid; grid-template-columns: 74px 1fr; gap: 16px; padding: 16px 4px; border-top: 1px dashed rgba(233, 189, 103, 0.16); }
.recap-item:first-child { border-top: 0; }
.ri-day { font-family: var(--font-head); color: var(--gold); font-weight: 700; font-size: 17px; }
.ri-day small { display: block; color: var(--muted); font-family: var(--font-body); font-weight: 400; font-size: 12px; margin-top: 2px; }
.ri-body { color: #d8d2c2; font-size: 15.5px; white-space: pre-wrap; word-break: break-word; }
.ri-meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.ri-meta .ri-author { color: var(--flame); font-weight: 600; }
.recap-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 30px 0 8px; }
.poster-preview { max-width: 420px; margin: 26px auto 0; display: none; }
.poster-preview img { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-2); display: block; width: 100%; height: auto; }
.poster-cap { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.another-pair { text-align: center; margin-top: 44px; padding: 34px 22px; border-top: 1px solid rgba(233, 189, 103, 0.08); }
.another-pair h3 { font-size: 24px; }
.another-pair p { color: var(--muted); max-width: 52ch; margin: 8px auto 20px; }

/* danger zone */
.danger-zone { max-width: 760px; margin: 40px auto 0; text-align: center; }
.danger-zone details { background: rgba(196, 80, 74, 0.06); border: 1px solid rgba(196, 80, 74, 0.25); border-radius: 12px; padding: 16px 20px; text-align: left; }
.danger-zone summary { cursor: pointer; color: #e6a49f; font-weight: 600; font-size: 14.5px; }
.danger-zone .dz-body { margin-top: 12px; color: var(--muted); font-size: 14px; }
.danger-zone .dz-actions { margin-top: 14px; display: flex; gap: 10px; }

/* generic state screens */
.state-screen { text-align: center; padding: 60px 24px; }
.state-screen .ss-icon { font-size: 44px; margin-bottom: 10px; }
.state-screen h2 { font-size: 30px; }
.state-screen p { color: var(--muted); max-width: 52ch; margin: 8px auto 22px; }

/* toast */
.toast-zone { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(480px, calc(100vw - 40px)); }
.toast { background: #1d2650; color: var(--ink); border: 1px solid rgba(233, 189, 103, 0.35); border-radius: 12px; padding: 12px 18px; font-size: 14.5px; box-shadow: var(--shadow-2); text-align: center; }
.toast.err { border-color: rgba(196, 80, 74, 0.55); background: #2b1a22; }

/* notfound */
.notfound { padding: 90px 0; }
.nf-card { text-align: center; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 44px 36px; box-shadow: var(--shadow-2); }
.nf-door { font-size: 42px; margin: 0 0 6px; }
.nf-card p { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  h1, .hero h1 { font-size: 38px; }
  h2 { font-size: 28px; }
  .hero { padding: 48px 0 44px; }
  .hero-grid, .keepsake-grid { grid-template-columns: 1fr; gap: 34px; }
  .recap-letter { transform: none; max-width: 560px; }
  .faq-list { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  h1, .hero h1 { font-size: 31px; }
  .hero h1 { font-size: 31px; }
  h2 { font-size: 24px; }
  .recap-head h1 { font-size: 34px; }
  .cal-head h1 { font-size: 27px; }
  .head-row { gap: 12px; }
  .btn-head { margin-left: auto; padding: 12px; min-width: 48px; }
  .btn-head + .btn-head { margin-left: 8px; }
  .btn-head span { display: none; }
  .btn-head::after { content: "🎁"; font-size: 17px; }
  .btn-head-find::after { content: "🗓"; font-size: 17px; }
  .btn-head-find { margin-left: 0; }
  .btn-xl { width: 100%; }
  .open-grid, .door-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .open-door .od-no { font-size: 16px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { justify-content: center; }
  .cookie-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .cookie-actions { margin-left: 0; justify-content: flex-end; }
  .step { grid-template-columns: 46px 1fr; gap: 14px; }
  .step-no { width: 42px; height: 42px; font-size: 19px; }
  .link-row { flex-direction: column; align-items: stretch; }
  .recap-item { grid-template-columns: 56px 1fr; gap: 10px; }
  .modal-paper { padding: 24px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 2s; }
  .rec-btn.recording .dot { animation: none; }
}

/* ===== playful layer: string lights, snowfall, hand-written accents, bouncy bits ===== */

:root { --font-hand: "Caveat", "Comic Sans MS", cursive; }

/* --- warmer, brighter sky --- */
body {
  background:
    radial-gradient(900px 420px at 50% -6%, rgba(239, 143, 60, 0.13), transparent 62%),
    radial-gradient(1200px 500px at 85% -10%, rgba(239, 143, 60, 0.10), transparent 60%),
    radial-gradient(900px 420px at 8% 8%, rgba(233, 189, 103, 0.07), transparent 55%),
    linear-gradient(180deg, #162040, var(--bg) 340px);
}

/* --- string lights under the header --- */
.lights { height: 46px; position: relative; z-index: 6; }
.bulb {
  filter: drop-shadow(0 0 6px currentColor);
  animation: twinkle 1.7s ease-in-out infinite alternate;
}
.bulb:nth-of-type(2n) { animation-delay: 0.45s; }
.bulb:nth-of-type(3n) { animation-delay: 0.9s; }
.bulb:nth-of-type(5n) { animation-delay: 1.25s; }
.b1 { color: #ff6b5e; }
.b2 { color: #ffce6b; }
.b3 { color: #8fd694; }
.b4 { color: #ffa14e; }
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }

/* --- snowfall (two drifting layers, seamless loops) --- */
.snow {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  background-repeat: repeat;
}
.snow-a {
  background-image:
    radial-gradient(3px 3px at 25px 35px, rgba(255, 250, 240, 0.85), transparent 65%),
    radial-gradient(2px 2px at 145px 120px, rgba(255, 250, 240, 0.55), transparent 65%),
    radial-gradient(2.5px 2.5px at 90px 190px, rgba(255, 250, 240, 0.7), transparent 65%),
    radial-gradient(2px 2px at 190px 60px, rgba(255, 250, 240, 0.45), transparent 65%);
  background-size: 220px 220px;
  animation: snowfall-a 24s linear infinite;
  opacity: 0.75;
}
.snow-b {
  background-image:
    radial-gradient(2px 2px at 60px 90px, rgba(255, 250, 240, 0.5), transparent 65%),
    radial-gradient(3px 3px at 180px 20px, rgba(255, 250, 240, 0.35), transparent 65%),
    radial-gradient(2px 2px at 130px 160px, rgba(255, 250, 240, 0.55), transparent 65%);
  background-size: 260px 260px;
  animation: snowfall-b 36s linear infinite;
  opacity: 0.65;
}
@keyframes snowfall-a { to { background-position: 0 660px, 0 660px, 0 660px, 0 660px; } }
@keyframes snowfall-b { to { background-position: 0 780px, 0 780px, 0 780px; } }

/* --- snow drift over the footer --- */
.foot-drift { display: block; width: 100%; height: 44px; }
.site-foot { padding-top: 0; }
.foot-row { padding-top: 22px; }

/* --- hand-written accents --- */
.hero-kicker { font-family: var(--font-hand); font-size: 25px; text-transform: none; letter-spacing: 0.01em; color: var(--gold); }
.mini-cal-title { font-family: var(--font-hand); font-size: 25px; }
.rl-names { font-family: var(--font-hand); font-size: 21px; }
.foot-tag { font-family: var(--font-hand); font-size: 20px; color: var(--gold); }
.another-pair h3 { font-family: var(--font-hand); font-size: 31px; }
.app-title-sm { font-family: var(--font-hand); font-size: 21px; text-transform: none; letter-spacing: 0.01em; }
.cal-head .ch-kicker { font-family: var(--font-hand); font-size: 23px; text-transform: none; letter-spacing: 0.01em; }
.recap-head .rk { font-family: var(--font-hand); font-size: 23px; text-transform: none; letter-spacing: 0.01em; }
.mp-kicker { font-family: var(--font-hand); font-size: 19px; }

/* --- washi tape on the keepsake letter --- */
.recap-letter { position: relative; }
.recap-letter::before {
  content: "";
  position: absolute; top: -13px; left: 50%;
  width: 132px; height: 30px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(239, 143, 60, 0.42);
  border-left: 2px dashed rgba(255, 255, 255, 0.35);
  border-right: 2px dashed rgba(255, 255, 255, 0.35);
  z-index: 2;
}

/* --- bouncy buttons --- */
.btn { transition: background 0.15s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease, border-color 0.15s ease; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(239, 143, 60, 0.35); }
.btn-ghost:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }

/* --- wiggly doors --- */
.door { transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, color 0.2s ease; }
.door:hover { transform: scale(1.07) rotate(-2deg); }
.open-door { transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease; }
.open-door:hover:not(.locked) { transform: translateY(-4px) rotate(-1.5deg) scale(1.05); }
.open-door.locked:hover { transform: none; }

/* star on today's door */
.open-door.today::before {
  content: "★";
  position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%);
  color: var(--gold); font-size: 14px; line-height: 1;
  text-shadow: 0 0 9px rgba(233, 189, 103, 0.9);
  animation: twinkle 1.4s ease-in-out infinite alternate;
  z-index: 2;
}

/* snowflake on blank doors */
.od-snow { position: absolute; bottom: 8px; right: 9px; font-size: 12px; opacity: 0.55; }

/* --- candy-colored locked doors --- */
.door-grid .door:nth-child(4n+2):not(.today):not(.past) { background: linear-gradient(170deg, var(--door-g2a), var(--door-g2b)); }
.door-grid .door:nth-child(4n+3):not(.today):not(.past) { background: linear-gradient(170deg, var(--door-g3a), var(--door-g3b)); }
.door-grid .door:nth-child(4n):not(.today):not(.past) { background: linear-gradient(170deg, var(--door-g4a), var(--door-g4b)); }
.open-door.locked:nth-child(4n+2) { background: linear-gradient(170deg, var(--door-g2a), var(--door-g2b)); }
.open-door.locked:nth-child(4n+3) { background: linear-gradient(170deg, var(--door-g3a), var(--door-g3b)); }
.open-door.locked:nth-child(4n) { background: linear-gradient(170deg, var(--door-g4a), var(--door-g4b)); }

/* --- modal pops in like a card --- */
.modal-paper { animation: pop-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop-in { from { transform: scale(0.85) rotate(-5deg); opacity: 0; } }

/* --- step numbers get a little tilt --- */
.step-no { transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1); }
.step:hover .step-no { transform: rotate(-6deg) scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .snow-a, .snow-b, .bulb, .open-door.today::before { animation: none; }
  .modal-paper { animation: none; }
  .btn:hover, .door:hover, .open-door:hover:not(.locked) { transform: none; }
}


/* native controls follow the dark theme */
select, input, textarea { color-scheme: dark; }
.date-row { display: flex; gap: 10px; flex-wrap: wrap; }
.date-row select { flex: 1; min-width: 90px; }


/* --- custom date picker panel --- */
.date-btn { min-width: 220px; justify-content: flex-start; font-variant-numeric: tabular-nums; }
.date-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  width: 292px; padding: 14px;
  background: var(--card-2, #222b52); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-2);
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { font-weight: 600; font-size: 15px; color: var(--gold); }
.dp-nav {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; font-size: 16px; line-height: 1;
}
.dp-nav:hover { border-color: var(--gold); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-dow { text-align: center; font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.dp-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--ink);
  font: 500 13.5px var(--font-body); cursor: pointer; padding: 0;
}
.dp-cell:hover { background: rgba(239, 143, 60, 0.18); }
.dp-blank { pointer-events: none; }
.dp-off { color: #5a6380; cursor: default; }
.dp-off:hover { background: transparent; }
.dp-today { box-shadow: inset 0 0 0 1px var(--line); color: var(--gold); }
.dp-sel { background: var(--flame); color: #2a1608; font-weight: 700; }
.dp-sel:hover { background: var(--flame-deep); }
@media (max-width: 640px) {
  .date-panel { width: min(292px, calc(100vw - 64px)); }
}


/* --- inline expanding date panel (v2: bigger, in-flow) --- */
.radio-opt { transition: border-color 0.15s ease, background 0.15s ease; }
.radio-opt:has(input:checked) { border-color: var(--flame); background: rgba(239, 143, 60, 0.09); }
.radio-opt:has(input:checked) .ro-main { color: var(--gold); }
.date-panel {
  position: static; width: 100%; max-width: 372px;
  margin: 14px auto 4px; padding: 16px;
  background: #101731; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: none;
}
.dp-head { margin-bottom: 12px; }
.dp-title { font-size: 16.5px; }
.dp-nav { width: 38px; height: 38px; font-size: 18px; }
.dp-grid { gap: 6px; max-width: 100%; }
.dp-dow { font-size: 12.5px; padding: 6px 0; }
.dp-cell {
  aspect-ratio: 1; width: 100%; max-width: 46px; margin: 0 auto;
  font-size: 15px; border-radius: 11px;
}


/* --- calendar look themes (applied on the app-shell of open pages) --- */
.app-shell.cal-th-pine {
  --door-g2a: #1d4034; --door-g2b: #153127;
  --door-g3a: #24473a; --door-g3b: #1b382d;
  --door-g4a: #2e5240; --door-g4b: #23422f;
  --bg: #0e1f16; --bg-2: #13291d;
  --card: #162e21; --card-2: #1d3a2a;
  --flame: #7cc98f; --flame-deep: #5eb274;
  --gold: #d8e8d2; --line: rgba(216, 232, 210, 0.18);
  --door-hi: #24493a; --door-lo: #1a3a2c; --door-hi2: #2d5240; --door-lo2: #214430;
}
.app-shell.cal-th-pine .today, .app-shell.cal-th-pine .open-door.today,
.app-shell.cal-th-pine .btn-primary { background: linear-gradient(170deg, #7cc98f, #5eb274); }
.app-shell.cal-th-pine .open-door.today { background: linear-gradient(170deg, #7cc98f, #5eb274); }
.app-shell.cal-th-pine .app-card { background: linear-gradient(168deg, var(--card), var(--card-2)); }
.app-shell.cal-th-ginger {
  --door-g2a: #4a2f1c; --door-g2b: #3a2514;
  --door-g3a: #563620; --door-g3b: #442a17;
  --door-g4a: #4a3320; --door-g4b: #3a2818;
  --bg: #2a1810; --bg-2: #33201496;
  --card: #3a2416; --card-2: #462c1a;
  --flame: #e86a5e; --flame-deep: #d1544a;
  --gold: #f2d3a7; --line: rgba(242, 211, 167, 0.2);
  --door-hi: #5a3820; --door-lo: #462c18; --door-hi2: #684024; --door-lo2: #523218;
}
.app-shell.cal-th-ginger .open-door.today,
.app-shell.cal-th-ginger .btn-primary { background: linear-gradient(170deg, #e86a5e, #d1544a); }
.app-shell.cal-th-ginger .open-door.today { background: linear-gradient(170deg, #e86a5e, #d1544a); }
.app-shell.cal-th-ginger .app-card { background: linear-gradient(168deg, var(--card), var(--card-2)); }

/* --- theme picker cards --- */
.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: #101731; border: 1px solid rgba(233, 189, 103, 0.2);
  border-radius: 12px; padding: 12px 12px 10px; cursor: pointer; position: relative;
}
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch { width: 100%; height: 34px; border-radius: 8px; display: block; }
.th-sw-candle { background: linear-gradient(135deg, #0d1326 55%, #ef8f3c 55%, #e9bd67); }
.th-sw-pine { background: linear-gradient(135deg, #0e1f16 55%, #7cc98f 55%, #d8e8d2); }
.th-sw-ginger { background: linear-gradient(135deg, #2a1810 55%, #e86a5e 55%, #f2d3a7); }
.theme-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.theme-hint { display: block; color: var(--muted); font-size: 12px; }
.theme-card.th-active { border-color: var(--flame); background: rgba(239, 143, 60, 0.09); }
.theme-card.th-active .theme-name { color: var(--gold); }
@media (max-width: 640px) { .theme-row { grid-template-columns: 1fr; } }


/* --- live theme preview (create step 1) --- */
.theme-preview-label { color: var(--muted); font-size: 12.5px; margin: 12px 0 8px; }
.cal-preview { background: rgba(10, 15, 32, 0.55); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cal-preview-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.cal-preview-door {
  aspect-ratio: 1; border-radius: 9px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font: 600 13px var(--font-body); color: rgba(255, 255, 255, 0.75);
}
.cp-star { position: absolute; top: 3px; right: 5px; font-size: 9px; font-style: normal; opacity: 0.8; }
.cp-today { font-weight: 700; color: #2a1608; }


/* --- DoorEditor v2: calendar-grid writing --- */
.door-grid-edit { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.door-cell-edit {
  aspect-ratio: 0.86; border-radius: 12px; border: 1px solid rgba(233, 189, 103, 0.14);
  background: linear-gradient(170deg, #2a335e, #1d2650);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; position: relative; padding: 4px; transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.door-cell-edit:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 8px 20px rgba(3, 6, 18, 0.45); border-color: var(--flame); }
.dce-no { font-family: var(--font-head); font-weight: 700; font-size: 19px; color: var(--muted); }
.dce-date { font-size: 11px; color: #6d7794; }
.dce-marks { position: absolute; top: 5px; right: 7px; display: flex; gap: 3px; }
.dce-ico { font-style: normal; font-size: 11px; color: var(--gold); }
.door-cell-edit.dce-written { border-color: rgba(239, 143, 60, 0.45); }
.door-cell-edit.dce-written .dce-no { color: var(--ink); }
.door-cell-edit.dce-voice { background: linear-gradient(170deg, #31406f, #26315c); }
.editor-paper textarea { min-height: 110px; }
.ed-rec { margin: 6px 0 4px; }
.ed-rec-row { display: flex; align-items: center; gap: 12px; }
.rec-big {
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(170deg, var(--flame), var(--flame-deep));
  color: #fff; font-size: 24px; box-shadow: 0 4px 14px rgba(239, 143, 60, 0.4);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rec-big:hover { transform: scale(1.08); }
.rec-big.rec-have2 { background: linear-gradient(170deg, #4d7a52, #3a6140); }
.ed-rec-live { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ed-rec-bar { flex: 1; height: 12px; background: rgba(255, 255, 255, 0.25); border-radius: 999px; overflow: hidden; }
.ed-rec-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--flame), var(--gold)); border-radius: 999px; width: 0; transition: width 0.25s linear; }
.ed-rec-time { font-variant-numeric: tabular-nums; font-weight: 600; color: #20130a; font-size: 15px; min-width: 70px; text-align: right; }
.ed-rec audio { width: 100%; margin-top: 10px; }
@media (max-width: 640px) {
  .door-grid-edit { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .dce-no { font-size: 15px; }
}


/* --- recorder v3: player + live waves --- */
.ed-play-row { display: flex; align-items: center; gap: 12px; }
.ed-play {
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(170deg, var(--flame), var(--flame-deep));
  color: #fff; font-size: 16px; box-shadow: 0 3px 10px rgba(239, 143, 60, 0.35);
  transition: transform 0.12s ease;
}
.ed-play:hover { transform: scale(1.08); }
.ed-play-bar { flex: 1; height: 10px; background: rgba(61, 47, 31, 0.18); border-radius: 999px; overflow: hidden; }
.ed-play-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--flame), var(--gold)); border-radius: 999px; transition: width 0.2s linear; }
.ed-play-time { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--paper-muted); min-width: 86px; text-align: right; }
.ed-rec-meta { color: var(--paper-muted); font-size: 12.5px; margin: 10px 0 6px; }
.ed-rec-acts { display: flex; gap: 10px; }
.ed-rec-hint { color: var(--paper-muted); font-size: 14px; }
.rec-pulse {
  width: 12px; height: 12px; border-radius: 50%; background: #c4504a; flex-shrink: 0;
  animation: recpulse 1s ease-in-out infinite;
}
@keyframes recpulse { 50% { opacity: 0.25; transform: scale(0.8); } }
.rec-waves { display: flex; align-items: center; gap: 3px; height: 22px; }
.rec-waves i {
  width: 3px; border-radius: 2px; background: var(--flame); display: block;
  animation: recwave 0.9s ease-in-out infinite;
}
.rec-waves i:nth-child(1) { height: 8px; animation-delay: 0s; }
.rec-waves i:nth-child(2) { height: 16px; animation-delay: 0.15s; }
.rec-waves i:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.rec-waves i:nth-child(4) { height: 18px; animation-delay: 0.45s; }
.rec-waves i:nth-child(5) { height: 12px; animation-delay: 0.6s; }
@keyframes recwave { 50% { transform: scaleY(0.4); } }
@media (prefers-reduced-motion: reduce) {
  .rec-pulse, .rec-waves i { animation: none; }
}


/* --- theme picker cards: mini-door thumbnails --- */
.theme-thumb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 100%; }
.theme-thumb-door { aspect-ratio: 1.25; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 8px; color: rgba(255,255,255,0.55); }
.theme-thumb-door::after { content: attr(data-n); }
.theme-thumb-door:nth-child(odd) { background: rgba(255,255,255,0.12); }
.theme-thumb-door:nth-child(even) { background: rgba(255,255,255,0.07); }
.theme-thumb-door.th-today { background: currentColor; }
.th-th-candle .theme-thumb-door:nth-child(3n+1) { background: #2a335e; }
.th-th-candle .theme-thumb-door:nth-child(3n+2) { background: #1d2650; }
.th-th-candle .theme-thumb-door.th-today { background: #ef8f3c; }
.th-th-pine .theme-thumb-door:nth-child(3n+1) { background: #1d4034; }
.th-th-pine .theme-thumb-door:nth-child(3n+2) { background: #153127; }
.th-th-pine .theme-thumb-door.th-today { background: #7cc98f; }
.th-th-ginger .theme-thumb-door:nth-child(3n+1) { background: #4a2f1c; }
.th-th-ginger .theme-thumb-door:nth-child(3n+2) { background: #3a2514; }
.th-th-ginger .theme-thumb-door.th-today { background: #e86a5e; }
.theme-card .theme-swatch { display: none; }

/* --- preview: ornament calendar widget --- */
.cal-preview {
  position: relative;
  background: linear-gradient(175deg, rgba(20, 27, 56, 0.85), rgba(11, 16, 32, 0.9));
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 14px;
  margin-top: 14px;
  transition: box-shadow 0.4s ease;
}
.cal-preview.cp-bounce { animation: cpbounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cpbounce { 0% { transform: scale(0.985); } 55% { transform: scale(1.012); } 100% { transform: scale(1); } }
.cp-hanger { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 20px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }
.cp-head { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-bottom: 12px; }
.cp-title { font-family: var(--font-head); font-weight: 700; font-size: 19px; color: var(--gold); }
.cp-range { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-preview-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.cal-preview-door {
  aspect-ratio: 0.88; border-radius: 11px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font: 600 15px var(--font-body); color: rgba(255, 255, 255, 0.8);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}
.cp-date { font-size: 10.5px; color: rgba(255, 255, 255, 0.5); font-variant-numeric: tabular-nums; }
.cp-star { position: absolute; top: 4px; right: 6px; font-size: 9px; font-style: normal; opacity: 0.85; }
.cp-today { color: #2a1608; font-weight: 700; }
.cp-today .cp-date { color: rgba(42, 22, 8, 0.7); }
.cp-decor { position: absolute; pointer-events: none; inset: 0; overflow: hidden; border-radius: 16px; }
.cp-decor-emoji {
  position: absolute; bottom: 10px; right: 12px; font-size: 22px; opacity: 0.35;
  transform: rotate(-8deg); filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.cp-decor-emoji.cp-decor-b { left: 12px; right: auto; top: 44%; bottom: auto; font-size: 16px; transform: rotate(12deg); opacity: 0.25; }
.cal-preview[data-theme="pine"] .cp-decor-emoji.cp-decor-b { content: none; }
@media (max-width: 640px) {
  .cal-preview-grid { gap: 6px; }
  .cal-preview-door { font-size: 12px; border-radius: 9px; }
  .cp-date { font-size: 9px; }
}


/* --- start date bar (step 2) --- */
.start-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; background: #101731; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.start-bar-label { font-weight: 600; font-size: 14px; color: var(--gold); flex-shrink: 0; }
.start-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.start-chip {
  border: 1px solid rgba(233, 189, 103, 0.25); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 7px 14px; font: 600 13.5px var(--font-body); cursor: pointer; min-height: 36px;
  transition: all 0.15s ease;
}
.start-chip:hover { border-color: var(--gold); color: var(--ink); }
.start-chip.chip-on { background: var(--flame); color: #2a1608; border-color: transparent; }
.start-custom { width: 100%; }
@media (max-width: 640px) {
  .start-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .start-chips { flex-direction: column; }
  .start-chip { text-align: left; }
}

/* --- gift-door component: each door is a drawn gift box --- */
.gift-calendar {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  background: linear-gradient(175deg, #7a1f24, #5e1418);
  border: 3px solid #4d3a20; border-radius: 16px;
  padding: 14px; box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(3, 6, 18, 0.45);
}
.gift-door {
  position: relative; aspect-ratio: 0.92; border-radius: 7px; overflow: visible;
  cursor: default; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}
.gift-door .gd-box {
  position: absolute; inset: 0; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
/* four wrapping-paper variants */
.gd-box.v1 { background: repeating-linear-gradient(45deg, #b3402f 0 6px, #c94f3c 6px 12px); }
.gd-box.v2 { background: repeating-linear-gradient(90deg, #3d6bb0 0 7px, #2f5a97 7px 14px); }
.gd-box.v3 { background: repeating-linear-gradient(135deg, #3e7d4f 0 8px, #2f6640 8px 16px); }
.gd-box.v4 { background: #6b4fa0 radial-gradient(circle at 30% 30%, rgba(255,255,255,0.28) 2px, transparent 2.5px), radial-gradient(circle at 70% 60%, rgba(255,255,255,0.22) 2px, transparent 2.5px); background-size: 14px 14px; }
.gd-box.v5 { background: repeating-linear-gradient(0deg, #d9a53c 0 5px, #c7943a 5px 10px); }
.gd-box.v6 { background: #8a3452 radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2) 2px, transparent 3px); background-size: 18px 18px; }
/* ribbons */
.gift-door .gd-ribbon-v, .gift-door .gd-ribbon-h {
  position: absolute; pointer-events: none;
  background: linear-gradient(180deg, #f4d27a, #d9a53c);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.25);
}
.gift-door .gd-ribbon-v { left: 50%; top: 0; width: 13%; height: 100%; transform: translateX(-50%); }
.gift-door .gd-ribbon-h { top: 50%; left: 0; height: 13%; width: 100%; transform: translateY(-50%); background: linear-gradient(90deg, #f4d27a, #d9a53c); }
/* bow: two loops + knot */
.gift-door .gd-bow { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 34px; height: 20px; pointer-events: none; z-index: 2; }
.gift-door .gd-bow::before, .gift-door .gd-bow::after {
  content: ""; position: absolute; top: 2px; width: 15px; height: 13px;
  background: radial-gradient(circle at 50% 30%, #f7dd8e, #d9a53c 75%);
  border-radius: 50% 50% 45% 45%;
}
.gift-door .gd-bow::before { left: 1px; transform: rotate(-22deg); }
.gift-door .gd-bow::after { right: 1px; transform: rotate(22deg); }
.gift-door .gd-bow i {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #ffe9a8, #d9a53c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); z-index: 2;
}
/* number tag */
.gift-door .gd-tag {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-4deg);
  background: linear-gradient(180deg, #fdf8ec, #f3e8cd);
  color: #8a1f1f; font-family: var(--font-head, Georgia, serif); font-weight: 700;
  font-size: 15px; padding: 2px 9px; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); z-index: 1;
}
/* filled / today states */
.gift-door.gd-open { filter: saturate(1.15) brightness(1.06); }
.gift-door.gd-open::after {
  content: "✦"; position: absolute; top: 3px; right: 6px; font-size: 11px;
  color: #ffe9a8; text-shadow: 0 0 5px rgba(255, 233, 168, 0.9); z-index: 3;
}
.gift-door.gd-today .gd-tag { background: linear-gradient(180deg, #fff, #ffe9c9); box-shadow: 0 0 0 2px #ffe9a8, 0 1px 3px rgba(0, 0, 0, 0.35); }
/* interactive variants (create page preview / open page) */
button.gift-door { cursor: pointer; transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease; }
button.gift-door:hover { transform: translateY(-3px) rotate(-1.2deg); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); }
.gift-door.gd-clickable { cursor: pointer; }
@media (max-width: 640px) {
  .gift-calendar { gap: 7px; padding: 10px; }
  .gift-door .gd-tag { font-size: 12px; padding: 1px 6px; }
  .gift-door .gd-bow { width: 26px; height: 15px; top: -6px; }
  .gift-door .gd-bow::before, .gift-door .gd-bow::after { width: 11px; height: 10px; }
  .gift-door .gd-bow i { width: 7px; height: 7px; top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  button.gift-door:hover { transform: none; }
}


/* --- ready banner + action-oriented completion card --- */
.ready-banner {
  background: linear-gradient(90deg, rgba(125, 200, 143, 0.18), rgba(233, 189, 103, 0.18));
  border: 1px solid rgba(125, 200, 143, 0.4);
  color: var(--gold); font-weight: 600; font-size: 15px;
  border-radius: 10px; padding: 10px 16px; margin-bottom: 16px;
}
.ready-actions { display: flex; gap: 12px; margin: 18px 0 8px; flex-wrap: wrap; }
.gift-mini { grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 10px; margin: 14px 0 6px; }
.gift-mini .gd-tag { font-size: 12px; padding: 1px 6px; }
.gift-mini .gd-bow { width: 24px; height: 14px; top: -6px; }
.gift-mini .gd-bow::before, .gift-mini .gd-bow::after { width: 11px; height: 9px; }
.gift-mini .gd-bow i { width: 6px; height: 6px; top: 4px; }
.cp-date-g {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  background: rgba(0, 0, 0, 0.28); border-radius: 4px; padding: 0 4px; z-index: 1;
}
.gift-door.gd-today .cp-date-g { background: rgba(0, 0, 0, 0.2); }
/* home hero gift calendar wrapper */
.mini-cal-wrap {
  background: linear-gradient(175deg, #1a2242cc, #131b38cc);
  border: 1px solid var(--line); border-radius: 20px; padding: 22px 22px 16px;
  box-shadow: var(--shadow-2);
}
.mini-cal-wrap .mini-cal-title { font-family: var(--font-hand); font-size: 24px; color: var(--gold); margin: 0 0 14px; display: flex; justify-content: space-between; align-items: baseline; }
.mini-cal-wrap .mini-cal-title small { color: var(--muted); font-family: var(--font-body); font-size: 12px; }
.mini-cal-wrap .mini-cal-foot { margin: 14px 0 0; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; }
/* theme card thumbnails */
.theme-thumb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; margin-bottom: 8px; }
.theme-thumb-door { aspect-ratio: 1.15; border-radius: 5px; display: block; }
.th-th-candle .theme-thumb-door:nth-child(1) { background: #2a335e; }
.th-th-candle .theme-thumb-door:nth-child(2) { background: #1d2650; }
.th-th-candle .theme-thumb-door:nth-child(3) { background: #32305f; }
.th-th-candle .theme-thumb-door:nth-child(4) { background: #ef8f3c; }
.th-th-candle .theme-thumb-door:nth-child(5) { background: #23405c; }
.th-th-candle .theme-thumb-door:nth-child(6) { background: #1a2f2a; }
.th-th-pine .theme-thumb-door:nth-child(1) { background: #1d4034; }
.th-th-pine .theme-thumb-door:nth-child(2) { background: #153127; }
.th-th-pine .theme-thumb-door:nth-child(3) { background: #24473a; }
.th-th-pine .theme-thumb-door:nth-child(4) { background: #7cc98f; }
.th-th-pine .theme-thumb-door:nth-child(5) { background: #1d4034; }
.th-th-pine .theme-thumb-door:nth-child(6) { background: #153127; }
.th-th-ginger .theme-thumb-door:nth-child(1) { background: #4a2f1c; }
.th-th-ginger .theme-thumb-door:nth-child(2) { background: #3a2514; }
.th-th-ginger .theme-thumb-door:nth-child(3) { background: #563620; }
.th-th-ginger .theme-thumb-door:nth-child(4) { background: #e86a5e; }
.th-th-ginger .theme-thumb-door:nth-child(5) { background: #4a2f1c; }
.th-th-ginger .theme-thumb-door:nth-child(6) { background: #3a2514; }
.theme-swatch { display: none; }


/* --- create step 1: two-column one-screen layout --- */
.create-card { display: grid; grid-template-columns: minmax(230px, 0.9fr) minmax(300px, 1.1fr); gap: 22px; align-items: start; }
.create-card .cf-left { grid-column: 1; }
.create-card .cf-right { grid-column: 2; grid-row: 1 / span 3; }
.create-card .app-title-sm { grid-column: 1 / -1; }
.create-card .cf-left .field { margin-bottom: 14px; }
/* theme cards more compact */
.cf-right .theme-row { gap: 8px; }
.cf-right .theme-card { padding: 10px 10px 8px; }
.cf-right .theme-txt { display: flex; flex-direction: column; }
.cf-right .theme-name { font-size: 13.5px; }
.cf-right .theme-hint { font-size: 11px; }
/* preview widget narrower */
.cal-preview { max-width: 360px; margin-left: auto; margin-right: auto; padding: 14px 14px 12px; }
.cal-preview-grid { gap: 7px; }
.cal-preview-door { border-radius: 9px; }
.gift-mini .gd-tag { font-size: 11px; padding: 1px 6px; }
.gift-mini .gd-bow { width: 22px; height: 13px; top: -6px; }
.gift-mini .gd-bow::before, .gift-mini .gd-bow::after { width: 10px; height: 8px; }
.gift-mini .gd-bow i { width: 6px; height: 6px; }
.gift-mini { gap: 7px; padding: 10px; }
@media (max-width: 900px) {
  .create-card { grid-template-columns: 1fr; }
  .create-card .cf-right { grid-column: 1; grid-row: auto; }
}


/* --- create step 1: two-column one-screen layout --- */
.create-card { display: grid; grid-template-columns: minmax(230px, 0.9fr) minmax(300px, 1.1fr); gap: 22px; align-items: start; }
.create-card .cf-l1 { grid-column: 1; grid-row: 2; }
.create-card .cf-l2 { grid-column: 1; grid-row: 3; }
.create-card .cf-right { grid-column: 2; grid-row: 2 / span 2; }
.create-card .app-title-sm { grid-column: 1 / -1; }
.create-card .cf-left .field { margin-bottom: 14px; }
/* theme cards more compact */
.cf-right .theme-row { gap: 8px; }
.cf-right .theme-card { padding: 10px 10px 8px; }
.cf-right .theme-txt { display: flex; flex-direction: column; }
.cf-right .theme-name { font-size: 13.5px; }
.cf-right .theme-hint { font-size: 11px; }
/* preview widget narrower */
.cal-preview { max-width: 360px; margin-left: auto; margin-right: auto; padding: 14px 14px 12px; }
.cal-preview-grid { gap: 7px; }
.cal-preview-door { border-radius: 9px; }
.gift-mini .gd-tag { font-size: 11px; padding: 1px 6px; }
.gift-mini .gd-bow { width: 22px; height: 13px; top: -6px; }
.gift-mini .gd-bow::before, .gift-mini .gd-bow::after { width: 10px; height: 8px; }
.gift-mini .gd-bow i { width: 6px; height: 6px; }
.gift-mini { gap: 7px; padding: 10px; }
@media (max-width: 900px) {
  .create-card { grid-template-columns: 1fr; }
  .create-card .cf-right { grid-column: 1; grid-row: auto; }
}

.create-card .app-title-sm { grid-column: 1 / -1; grid-row: 1; }


/* --- cream card + red button + two-col create (competitor style) --- */
.create-card { display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(280px, 0.85fr); gap: 26px; align-items: start; background: transparent; border: 0; box-shadow: none; padding: 0; }
.create-card .create-preview-col { display: flex; flex-direction: column; gap: 10px; }
.create-card .create-preview-col .hint { text-align: center; margin: 4px 0 0; }
.cream-card {
  background: linear-gradient(180deg, #fdf8ec, #f6ecd6);
  color: var(--paper-ink); border-radius: 16px; padding: 22px 22px 20px;
  box-shadow: 0 12px 34px rgba(3, 6, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.cream-hint { color: var(--paper-ink); font-size: 14.5px; line-height: 1.55; margin-bottom: 16px; }
.cream-card .field label { color: var(--paper-ink); }
.cream-card input[type="text"] { background: #ffffff; color: var(--paper-ink); border: 1px solid rgba(61, 47, 31, 0.3); }
.cream-card input[type="text"]:focus { border-color: var(--flame-deep); box-shadow: 0 0 0 3px rgba(239, 143, 60, 0.2); }
.cream-card .form-actions { margin-top: 16px; }
.cream-card .form-actions .btn-red { width: 100%; }
/* red primary button on cream/neutral surfaces */
.btn-red { background: linear-gradient(180deg, #e04138, #c22e26); color: #fff; box-shadow: 0 3px 10px rgba(194, 46, 38, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-red:hover { background: linear-gradient(180deg, #d1362e, #a82820); }
/* preview col widget sizing */
.create-preview-col .cal-preview { max-width: 420px; margin: 0 auto; }
.create-preview-col .theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.create-preview-col .theme-card { padding: 10px 10px 8px; background: #101731; }
.create-preview-col .theme-txt { display: flex; flex-direction: column; }
.create-preview-col .theme-name { font-size: 13px; }
.create-preview-col .theme-hint { font-size: 11px; }
@media (max-width: 900px) {
  .create-card { grid-template-columns: 1fr; }
  .create-preview-col { order: 2; }
  .cream-card { order: 1; }
}


/* two-col create: explicit placement */
.create-card > .app-title-sm { grid-column: 1 / -1; grid-row: 1; margin-bottom: 6px; }
.create-card > h2 { display: none; }
.create-card > .create-preview-col { grid-column: 1; grid-row: 2; }
.create-card > .cream-card { grid-column: 2; grid-row: 2; }
.create-card { align-items: start; }


/* --- step 2: two-column (left calendar, right ops card) --- */
.editor-two-col { display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(270px, 0.85fr); gap: 24px; align-items: start; }
.editor-left .door-grid-edit { grid-template-columns: repeat(4, 1fr); }
.editor-left .meter { max-width: 420px; }
.editor-right { padding: 18px 18px 16px; }
.editor-right .start-bar { flex-direction: column; align-items: stretch; gap: 10px; background: transparent; border: 0; padding: 0; }
.editor-right .start-chips { flex-direction: column; }
.editor-right .start-chip { text-align: left; }
.editor-right .form-actions { margin-top: 14px; }
.editor-right .form-actions .btn-red { width: 100%; }
.editor-right .btn { width: 100%; margin-bottom: 10px; }
.editor-right .hint { color: var(--paper-muted); }
/* locked partner doors visible in writer grid? writer grid shows own 12; keep */
@media (max-width: 900px) {
  .editor-two-col { grid-template-columns: 1fr; }
  .editor-right { order: 2; }
}


/* --- full 24-door writer calendar --- */
.door-grid-edit {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  background: linear-gradient(175deg, #7a1f24, #5e1418);
  border: 3px solid #4d3a20; border-radius: 16px;
  padding: 14px; box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(3, 6, 18, 0.45);
}
.door-cell-edit {
  aspect-ratio: 0.92; border-radius: 8px; position: relative;
  border: 1px dashed rgba(255, 233, 168, 0.35);
  background: rgba(90, 20, 25, 0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, background 0.2s ease;
  font-family: inherit;
}
.door-cell-edit:hover:not(:disabled) {
  transform: translateY(-3px) rotate(-1deg); border-color: var(--gold);
  background: rgba(120, 30, 36, 0.75); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.door-cell-edit:disabled { cursor: default; opacity: 0.55; }
.door-cell-edit:disabled .dce-no { color: rgba(255, 233, 168, 0.4); }
.dce-no { font-family: var(--font-head, Georgia, serif); font-weight: 700; font-size: 20px; color: #ffe9c9; }
.dce-date { font-size: 11px; color: rgba(255, 233, 168, 0.6); font-variant-numeric: tabular-nums; }
.dce-marks { position: absolute; top: 4px; right: 7px; display: flex; gap: 4px; }
.dce-ico { font-style: normal; font-size: 12px; color: #ffe9a8; text-shadow: 0 0 4px rgba(255, 233, 168, 0.7); }
.dce-wait { font-style: normal; font-size: 9.5px; color: rgba(255, 233, 168, 0.45); }
.door-cell-edit.dce-written { border-style: solid; border-color: var(--gold); background: rgba(140, 40, 46, 0.8); }
.door-cell-edit.dce-voice { background: rgba(160, 50, 56, 0.85); }
@media (max-width: 640px) {
  .door-grid-edit { grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 10px; }
  .dce-no { font-size: 15px; }
  .dce-date { font-size: 9.5px; }
}


/* --- full 24-door writer calendar --- */
.door-grid-edit {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  background: linear-gradient(175deg, #7a1f24, #5e1418);
  border: 3px solid #4d3a20; border-radius: 16px;
  padding: 14px; box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(3, 6, 18, 0.45);
}
.door-cell-edit {
  aspect-ratio: 0.92; border-radius: 8px; position: relative;
  border: 1px dashed rgba(255, 233, 168, 0.35);
  background: rgba(90, 20, 25, 0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, background 0.2s ease;
  font-family: inherit;
}
.door-cell-edit:hover:not(:disabled) {
  transform: translateY(-3px) rotate(-1deg); border-color: var(--gold);
  background: rgba(120, 30, 36, 0.75); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.door-cell-edit:disabled { cursor: default; opacity: 0.55; }
.door-cell-edit:disabled .dce-no { color: rgba(255, 233, 168, 0.4); }
.dce-no { font-family: var(--font-head, Georgia, serif); font-weight: 700; font-size: 20px; color: #ffe9c9; }
.dce-date { font-size: 11px; color: rgba(255, 233, 168, 0.6); font-variant-numeric: tabular-nums; }
.dce-marks { position: absolute; top: 4px; right: 7px; display: flex; gap: 4px; }
.dce-ico { font-style: normal; font-size: 12px; color: #ffe9a8; text-shadow: 0 0 4px rgba(255, 233, 168, 0.7); }
.dce-wait { font-style: normal; font-size: 9.5px; color: rgba(255, 233, 168, 0.45); }
.door-cell-edit.dce-written { border-style: solid; border-color: var(--gold); background: rgba(140, 40, 46, 0.8); }
.door-cell-edit.dce-voice { background: rgba(160, 50, 56, 0.85); }
@media (max-width: 640px) {
  .door-grid-edit { grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 10px; }
  .dce-no { font-size: 15px; }
  .dce-date { font-size: 9.5px; }
}


/* --- quick phrase chips in door editor --- */
.phrase-label { font-size: 12px; color: var(--paper-muted); margin: 10px 0 6px; }
.phrase-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.phrase-chip {
  border: 1px solid rgba(61, 47, 31, 0.3); background: rgba(255, 255, 255, 0.6);
  color: var(--paper-ink); border-radius: 999px; padding: 5px 11px;
  font: 500 12.5px var(--font-body); cursor: pointer; min-height: 30px;
  transition: all 0.15s ease;
}
.phrase-chip:hover { background: var(--flame); color: #2a1608; border-color: var(--flame-deep); font-weight: 700; }
.go-sub { font-size: 12.5px; color: var(--paper-muted); margin: 8px 0 10px; line-height: 1.5; }


/* --- delete button visible on cream surface --- */
.rec-clear {
  color: #8a5a3a !important;
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(61, 47, 31, 0.35) !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  font-weight: 600 !important;
  min-height: 34px !important;
}
.rec-clear:hover { background: #fff !important; border-color: #8a5a3a !important; }
/* --- step2 theme continuation: editor grid follows theme --- */
.editor-two-col.cal-th-pine .door-grid-edit {
  background: linear-gradient(175deg, #2e6b4f, #1d4433);
  border-color: #1a3a2c;
}
.editor-two-col.cal-th-pine .door-cell-edit { background: rgba(20, 60, 42, 0.6); border-color: rgba(216, 232, 210, 0.35); }
.editor-two-col.cal-th-pine .door-cell-edit:hover:not(:disabled) { background: rgba(46, 107, 79, 0.75); border-color: #7cc98f; }
.editor-two-col.cal-th-pine .dce-no { color: #d8e8d2; }
.editor-two-col.cal-th-pine .dce-date { color: rgba(216, 232, 210, 0.6); }
.editor-two-col.cal-th-pine .dce-ico { color: #d8e8d2; }
.editor-two-col.cal-th-pine .dce-wait { color: rgba(216, 232, 210, 0.5); }
.editor-two-col.cal-th-pine .dce-written { border-color: #7cc98f; background: rgba(46, 107, 79, 0.6); }
.editor-two-col.cal-th-ginger .door-grid-edit {
  background: linear-gradient(175deg, #5a3a22, #3a2414);
  border-color: #2a1810;
}
.editor-two-col.cal-th-ginger .door-cell-edit { background: rgba(90, 58, 34, 0.6); border-color: rgba(242, 211, 167, 0.4); }
.editor-two-col.cal-th-ginger .door-cell-edit:hover:not(:disabled) { background: rgba(169, 114, 76, 0.75); border-color: #f2d3a7; }
.editor-two-col.cal-th-ginger .dce-no { color: #f2d3a7; }
.editor-two-col.cal-th-ginger .dce-date { color: rgba(242, 211, 167, 0.65); }
.editor-two-col.cal-th-ginger .dce-ico { color: #f2d3a7; }
.editor-two-col.cal-th-ginger .dce-wait { color: rgba(242, 211, 167, 0.5); }
.editor-two-col.cal-th-ginger .dce-written { border-color: #e86a5e; background: rgba(138, 90, 58, 0.7); }
/* theme emoji ornaments on the grid frame */
.editor-two-col { position: relative; }
.editor-two-col::after {
  content: attr(data-orn);
  position: absolute; top: -12px; right: 18px; font-size: 26px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); pointer-events: none;
}

/* --- rec-clear visible on cream surface (final override) --- */
.ed-rec .rec-clear {
  color: #7a4a1f !important;
  background: #fff7ea !important;
  border: 1.5px solid #d9a53c !important;
  border-radius: 8px !important;
  padding: 7px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  min-height: 36px !important;
  cursor: pointer !important;
}
.ed-rec .rec-clear:hover { background: #ffe9c9 !important; border-color: #b8862e !important; }


/* --- claim mode: interactive gift calendar (create/join) --- */
.claim-label { font-family: var(--font-hand); font-size: 17px; color: var(--gold); margin: 0 0 10px; }
.gift-door.gd-claimable { cursor: pointer; outline: 1.5px dashed rgba(255, 233, 168, 0.5); outline-offset: 2px; }
.gift-door.gd-claimable:hover { transform: translateY(-3px) rotate(-1.2deg); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); outline-color: #ffe9a8; }
.gift-door.gd-mine { filter: saturate(1.15) brightness(1.12); cursor: default; }
.gift-door.gd-theirs { filter: brightness(0.78) saturate(0.85); cursor: default; }
.gift-door.gd-theirs .gd-tag { background: rgba(0, 0, 0, 0.45); }
.gd-marks { position: absolute; top: 3px; right: 5px; display: flex; gap: 3px; z-index: 3; }
.gd-marks i { font-style: normal; font-size: 12px; color: #ffe9a8; text-shadow: 0 0 4px rgba(255, 233, 168, 0.75); }
.gd-who {
  position: absolute; bottom: 17px; left: 50%; transform: translateX(-50%);
  max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9.5px; line-height: 1.5; background: rgba(0, 0, 0, 0.42); color: rgba(255, 255, 255, 0.92);
  border-radius: 4px; padding: 0 4px; z-index: 3; pointer-events: none;
}
.gift-door.gd-mine .gd-who { background: #2a1608; color: #ffe9c9; font-weight: 700; }

/* --- door modal: all messages of one door --- */
.mp-msgs { display: flex; flex-direction: column; gap: 0; margin: 12px 0 4px; text-align: left; }
.mp-msg { border-bottom: 1px dashed rgba(255, 255, 255, 0.14); padding: 10px 0; }
.mp-msg:last-child { border-bottom: 0; }
.mm-who { font-family: var(--font-hand); font-size: 16px; color: var(--gold); margin-bottom: 4px; }
.mm-text { font-size: 15.5px; line-height: 1.65; color: var(--ink); }
.mm-voice { margin-top: 8px; }
.mm-voice audio { width: 100%; margin-top: 6px; }

/* --- reaction strip under a door (restored + polished) --- */
.react-zone { margin-top: 14px; border-top: 1px dashed rgba(255, 255, 255, 0.18); padding-top: 12px; }
.react-title { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.react-row { display: flex; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.react-opt {
  font-size: 20px; line-height: 1; background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  cursor: pointer; min-width: 44px; min-height: 40px;
  transition: transform 0.12s ease, background 0.15s ease;
}
.react-opt:hover { background: rgba(239, 143, 60, 0.15); transform: translateY(-2px); }
.react-opt.react-on { background: var(--flame); border-color: var(--flame-deep); }
.react-note { font-size: 13.5px; color: var(--ink); margin: 6px 0; }
.react-note b { color: var(--gold); }
.react-done { color: var(--ink); }
.react-zone input[type="text"] { margin: 8px 0 6px; }
.react-send { display: block; }

/* --- cream-surface adaptations: date capsules + month panel on create card --- */
.cf-date { margin: 2px 0 4px; }
.cream-card .start-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cream-card .start-chip {
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(61, 47, 31, 0.3);
  color: var(--paper-ink); border-radius: 10px; padding: 9px 12px;
  font: 500 13px var(--font-body); cursor: pointer; min-height: 38px;
  transition: all 0.15s ease;
}
.cream-card .start-chip:hover { border-color: var(--flame-deep); }
.cream-card .start-chip.chip-on { background: var(--flame); color: #2a1608; border-color: transparent; font-weight: 700; }
.cream-card .date-panel {
  background: #fffdf6; border: 1px solid rgba(61, 47, 31, 0.25);
  border-radius: 12px; padding: 12px; margin: 10px 0 4px; box-shadow: 0 10px 26px rgba(3, 6, 18, 0.25);
}
.cream-card .dp-title { color: #8a5a3a; }
.cream-card .dp-nav {
  background: transparent; border: 1px solid rgba(61, 47, 31, 0.3);
  color: var(--paper-ink); border-radius: 8px; cursor: pointer;
}
.cream-card .dp-nav:hover { border-color: #b8862e; }
.cream-card .dp-dow { color: #8a7a5f; }
.cream-card .dp-cell { color: var(--paper-ink); }
.cream-card .dp-cell:hover { background: rgba(239, 143, 60, 0.18); }
.cream-card .dp-cell.dp-off { color: #b9ac93; }
.cream-card .dp-cell.dp-today { box-shadow: inset 0 0 0 1px rgba(61, 47, 31, 0.45); color: #8a5a3a; }
.cream-card .dp-cell.dp-sel { background: var(--flame); color: #2a1608; font-weight: 700; }

@media (max-width: 640px) {
  .gd-who { font-size: 8.5px; bottom: 15px; }
}


/* --- manage modal: two-step delete confirm on cream paper --- */
.manage-warn { color: #a3402f; font-weight: 700; }
.manage-confirm .btn-ghost {
 color: #8a5a3a !important;
 background: rgba(255, 255, 255, 0.78) !important;
 border: 1px solid rgba(61, 47, 31, 0.4) !important;
 min-height: 36px !important;
}
.manage-confirm .btn-ghost:hover { background: #fff !important; border-color: #8a5a3a !important; }


/* --- cream modal surfaces: force dark ink + solid buttons (modal-paper is cream;
 mm-text/btn styles were written for the dark page and painted cream-on-cream) --- */
.modal-paper .mm-text { color: var(--paper-ink, #2e2314); }
.modal-paper .btn-danger {
 background: linear-gradient(180deg, #e04138, #c22e26);
 color: #fff; border: 1px solid #a82820;
 box-shadow: 0 3px 10px rgba(194, 46, 38, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.modal-paper .btn-danger:hover { background: linear-gradient(180deg, #d1362e, #a82820); color: #fff; }
.modal-paper .btn-danger[disabled] { color: rgba(255, 255, 255, 0.6); }
.modal-paper .btn-ghost {
 color: #8a5a3a;
 background: rgba(255, 255, 255, 0.78);
 border: 1px solid rgba(61, 47, 31, 0.4);
}
.modal-paper .btn-ghost:hover { background: #fff; border-color: #8a5a3a; color: #6d4526; }


/* --- door modal: message letter cards + voice player (v48 redesign) --- */
.mp-msgs { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 6px; }
.mp-msg {
 background: linear-gradient(178deg, #fffdf4, #faf3df);
 border: 1px solid rgba(61, 47, 31, 0.14);
 border-left: 3px solid #d9a53c;
 border-radius: 4px 14px 14px 14px;
 padding: 12px 15px 11px;
 box-shadow: 0 3px 10px rgba(61, 47, 31, 0.07);
 position: relative;
}
.mp-msg::before {
 content: '✉';
 position: absolute; top: 10px; right: 12px;
 font-size: 13px; color: rgba(138, 90, 58, 0.4);
}
.mm-who {
 font-family: var(--font-hand, Caveat, cursive);
 font-size: 19px; color: #8a5a3a; margin: 0 0 5px;
 display: flex; align-items: baseline; gap: 7px;
}
.mm-who small { font-family: var(--font-body); font-size: 11px; color: #b9a27f; letter-spacing: 0.06em; }
.mm-text { font-size: 16px; line-height: 1.7; color: var(--paper-ink, #2e2314); white-space: pre-wrap; }
.mm-voice { margin-top: 10px; }
.mm-voice-loading {
 display: flex; align-items: center; gap: 9px;
 background: #2e2314; border-radius: 999px; padding: 9px 16px;
 color: #ffe9c9; font-size: 12.5px; min-height: 38px;
}
.mm-voice audio {
 width: 100%; height: 42px;
 border-radius: 999px;
 background: linear-gradient(180deg, #3a2d1a, #241a0d);
 box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.mp-msg .mp-err { color: #a3402f; font-size: 12.5px; }
/* manage variant keeps the letter look */
.modal-paper .manage-text { white-space: pre-wrap; }


/* --- reaction badges on door cells (visible without opening) --- */
.open-door { position: relative; }
.od-react {
 position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
 font-size: 11px; line-height: 1.5; background: rgba(0, 0, 0, 0.4);
 border-radius: 8px; padding: 0 6px; z-index: 2; pointer-events: none;
 white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}


/* --- per-message reply rows + manage box + find page lists (v54) --- */
.msg-react { margin-top: 10px; border-top: 1px dashed rgba(138, 90, 58, 0.25); padding-top: 8px; }
.msg-react-head { font-size: 11.5px; color: #b9a27f; letter-spacing: 0.08em; margin: 0 0 5px; }
.msg-react-list { margin: 0 0 4px; }
.msg-react-list .react-note { margin: 3px 0; }
.msg-react .react-row { margin: 2px 0 0; }
.msg-react .react-opt { font-size: 16px; padding: 5px 8px; min-width: 34px; min-height: 32px; border-radius: 8px; }
.msg-react .react-zone input[type="text"], .msg-react input[type="text"] { margin: 7px 0 5px; }
.manage-box {
 background: rgba(217, 165, 60, 0.1);
 border: 1px dashed rgba(138, 90, 58, 0.4);
 border-radius: 10px; padding: 10px 12px; margin: 10px 0 4px;
}
.manage-mine { font-size: 13px; font-weight: 700; color: #8a5a3a; margin: 0 0 8px; }
.manage-box .form-actions { margin-top: 4px; }
.legacy-react { margin-top: 12px; opacity: 0.85; }
.my-doors { margin: 8px 0 4px; }
.my-doors-title { font-size: 12px; color: var(--gold); margin: 0 0 6px; }
.my-door-line { font-size: 13.5px; color: var(--muted); padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); }
.my-door-line b { color: var(--ink); margin-right: 6px; }
.my-door-line a { color: var(--flame); margin-left: 8px; }
