:root {
  color-scheme: light;
  --night: #24170f;
  --night-2: #33231a;
  --night-3: #4a3427;
  --snow: #fbf5ec;
  --card: #ffffff;
  --ink: #2b211b;
  --muted: #6b5b4e;
  --mist: #ddcfc0;
  --line: #eadfd1;
  --red: #c0392b;
  --red-d: #962d22;
  --blush: #f5e1d8;
  --gold: #e3a83a;
  --gold-l: #f3d48b;
  --ice: #6f9fbf;
  --violet: #8a6cf0;
  --ice-d: #1d3557;
  --aurora: #3ddc84;
  --glass: rgba(255, 255, 255, .3);
  --title: "Alegreya", Georgia, serif;
  --body: "Figtree", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --r: 12px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .08);
  --sh-2: 0 8px 24px rgba(0, 0, 0, .08);
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --f-12: 12px;
  --f-14: 14px;
  --f-16: 16px;
  --f-18: 18px;
  --f-22: 22px;
  --f-28: 28px;
  --f-36: 36px;
  --f-48: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--snow); color: var(--ink); font: 400 var(--f-16)/1.6 var(--body); -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; }
body[data-has-cta] { padding-bottom: 0; }
h1, h2, h3 { font-family: var(--title); font-weight: 700; line-height: 1.2; margin: 0; }
h2 { font-size: var(--f-28); }
h3 { font-size: var(--f-18); }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
code, .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-5); }
.skip { position: absolute; left: var(--s-4); top: -64px; background: var(--card); color: var(--ink); padding: var(--s-2) var(--s-4); border-radius: var(--r); z-index: 50; }
.skip:focus { top: var(--s-4); }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.top { background: var(--night); color: var(--snow); border-bottom: 1px solid var(--night-3); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; font-family: var(--title); font-size: var(--f-18); font-weight: 700; }
.brand b { color: var(--gold-l); }
.top-nav { display: flex; gap: var(--s-5); font-size: var(--f-14); font-weight: 600; }
.top-nav a { text-decoration: none; padding: var(--s-3) 0; }
.top-nav a:hover { color: var(--gold-l); text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: var(--s-2) var(--s-4); border: 1px solid var(--mist); border-radius: var(--r); background: var(--card); color: var(--ink); font: 600 var(--f-14)/1.2 var(--body); text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-go { background: var(--red); border-color: var(--red); color: var(--card); font-size: var(--f-16); }
.btn-go:hover { background: var(--red-d); border-color: var(--red-d); }
.btn-wide { width: 100%; }
.btn-sm { min-height: 44px; padding: var(--s-1) var(--s-3); font-size: var(--f-14); }
.link { background: none; border: 0; padding: var(--s-2) 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.link.danger { color: var(--red); }
.small { font-size: var(--f-14); }
.hint { font-size: var(--f-14); color: var(--mist); }
.opt { font-weight: 400; color: var(--mist); font-size: var(--f-14); }



.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; left: 0; }
legend.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.stage { position: relative; background: var(--night); color: var(--snow); }
.scene {
  position: relative;
  overflow: hidden;
  background: var(--night);
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--s-4) var(--s-4) var(--s-6);
  display: grid;
  gap: var(--s-3);
}

.scene-head { text-align: center; display: grid; gap: var(--s-1); position: relative; z-index: 3; }
.scene h1 { font-size: var(--f-28); margin: 0; overflow-wrap: anywhere; letter-spacing: -.01em; }
.scene:has([data-view="setup"][hidden]) h1 { font-size: var(--f-22); }
.eyebrow { font-size: var(--f-14); font-weight: 600; color: var(--gold-l); margin: 0; }
.scene[data-paper="midnight"] .eyebrow { color: var(--snow); }
.count { font-size: var(--f-14); font-weight: 600; color: var(--gold-l); margin: 0; }

.scene-art {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  background: var(--night);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-2);
  isolation: isolate;
}
.scene-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 18%;
}
.scene-canvas::before,
.scene-canvas::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.scene-canvas::before {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--night) 16%, transparent), transparent 16%, transparent 88%, color-mix(in srgb, var(--night) 22%, transparent)),
    linear-gradient(90deg, color-mix(in srgb, var(--night) 10%, transparent), transparent 10%, transparent 90%, color-mix(in srgb, var(--night) 10%, transparent));
}
.scene[data-paper="berry"] .scene-canvas::after { background: color-mix(in srgb, var(--red) 18%, transparent); mix-blend-mode: soft-light; }
.scene[data-paper="midnight"] .scene-img { filter: saturate(.8); }
.scene[data-paper="midnight"] .scene-canvas::after { background: color-mix(in srgb, var(--ice-d) 55%, transparent); mix-blend-mode: multiply; }

.snowfall {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .28;
  background-image: radial-gradient(circle, var(--snow) 0 1px, transparent 1.5px);
  background-size: 28px 28px;
}
.scene[data-paper="midnight"] .snowfall { opacity: .55; }

.tree-lights { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.tree-lights i {
  position: absolute; width: 1.2%; aspect-ratio: 1; margin: -.6% 0 0 -.6%;
  background: radial-gradient(closest-side, var(--card), var(--gold-l) 35%, transparent);
  mix-blend-mode: screen; animation: twinkle 2.6s ease-in-out infinite;
}
.tree-lights i:nth-child(1) { left: 43%; top: 61.6%; animation-delay: .37s; }
.tree-lights i:nth-child(2) { left: 39.6%; top: 77.3%; animation-delay: .74s; }
.tree-lights i:nth-child(3) { left: 45.9%; top: 91.1%; animation-delay: 1.11s; }
.tree-lights i:nth-child(4) { left: 50.8%; top: 41.7%; animation-delay: 1.48s; }
.tree-lights i:nth-child(5) { left: 54.7%; top: 16.5%; animation-delay: 1.85s; }
.tree-lights i:nth-child(6) { left: 67.4%; top: 13%; animation-delay: 2.22s; }
.tree-lights i:nth-child(7) { left: 78.1%; top: 26%; animation-delay: 2.59s; }
.tree-lights i:nth-child(8) { left: 82%; top: 48.6%; animation-delay: .36s; }
.tree-lights i:nth-child(9) { left: 85%; top: 74.7%; animation-delay: .73s; }
.tree-lights i:nth-child(10) { left: 92.3%; top: 85.9%; animation-delay: 1.1s; }
.tree-lights i:nth-child(11) { left: 80.1%; top: 93.8%; animation-delay: 1.47s; }
.tree-lights i:nth-child(12) { left: 58.6%; top: 97.2%; animation-delay: 1.84s; }
.tree-lights i:nth-child(13) { left: 46.9%; top: 52.1%; animation-delay: 2.21s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.doors {
  --door-rg: 10px;
  --door-cg: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 22% 6% 11%;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: var(--door-rg) var(--door-cg);
  container-type: size;
}
.doors > li {
  --col: calc((100cqw - 5 * var(--door-cg)) / 6);
  --row: calc((100cqh - 3 * var(--door-rg)) / 4);
  position: relative;
  margin: 0;
  width: min(var(--col), calc(var(--row) * 3 / 4));
  height: min(var(--row), calc(var(--col) * 4 / 3));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  justify-self: center;
  align-self: center;
  cursor: pointer;
  min-width: 0;
  min-height: 0;
}
.doors > li > .door {
  overflow: hidden;
}
/* Sprite crop coords from original tree stockings (for photo texture only; layout is grid) */
.doors > li:nth-child(1) { --px: 52.58; --py: 18.33; }
.doors > li:nth-child(2) { --px: 58.36; --py: 18.33; }
.doors > li:nth-child(3) { --px: 63.91; --py: 18.33; }

.doors > li:nth-child(4) { --px: 69.38; --py: 18.33; }
.doors > li:nth-child(5) { --px: 49.14; --py: 34.17; }
.doors > li:nth-child(6) { --px: 55.23; --py: 34.17; }
.doors > li:nth-child(7) { --px: 61.09; --py: 34.17; }
.doors > li:nth-child(8) { --px: 67.03; --py: 34.17; }
.doors > li:nth-child(9) { --px: 72.5; --py: 34.17; }
.doors > li:nth-child(10) { --px: 44.61; --py: 49.86; }
.doors > li:nth-child(11) { --px: 52.42; --py: 49.86; }
.doors > li:nth-child(12) { --px: 58.98; --py: 49.86; }
.doors > li:nth-child(13) { --px: 65.7; --py: 49.86; }
.doors > li:nth-child(14) { --px: 71.33; --py: 49.86; }
.doors > li:nth-child(15) { --px: 47.19; --py: 65.56; }
.doors > li:nth-child(16) { --px: 54.06; --py: 65.56; }
.doors > li:nth-child(17) { --px: 61.25; --py: 65.56; }
.doors > li:nth-child(18) { --px: 68.12; --py: 65.56; }
.doors > li:nth-child(19) { --px: 74.84; --py: 65.56; }
.doors > li:nth-child(20) { --px: 42.97; --py: 81.25; }
.doors > li:nth-child(21) { --px: 49.92; --py: 81.25; }
.doors > li:nth-child(22) { --px: 57.11; --py: 81.25; }
.doors > li:nth-child(23) { --px: 64.38; --py: 81.25; }
.doors > li:nth-child(24) { --px: 71.8; --py: 81.25; }

.doors > li::before {
  content: "";
  position: absolute;
  inset: -6%;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  background: url("https://img.adventwithmyfriends.dev/s_6q5f3p0p676h04/stocking-tree-scene.3e601f55e1.webp") calc(var(--px) / 94.53 * 100%) calc(var(--py) / 86.11 * 100%) / 1828.15% 719.94% no-repeat;
  filter: brightness(1.65) saturate(1.15);
  -webkit-mask-image: radial-gradient(closest-side, var(--card) 72%, transparent);
  mask-image: radial-gradient(closest-side, var(--card) 72%, transparent);
}
.doors > li:hover::before,
.doors > li:has(> .door:focus-visible)::before { opacity: .55; }
.doors > li:has(> .door[data-timing="today"])::before { animation: breathe 2.8s ease-in-out infinite; }
.doors > li[data-spark]::before { animation: lit 1.5s ease-out; }
.doors > li:hover,
.doors > li[data-spark] { z-index: 3; }

.door {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red-d);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.door:disabled { cursor: pointer; pointer-events: none; }
.door:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 12px; }

.door::before {
  content: "";
  position: absolute;
  inset: -18% -12%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gold-l) 20%, transparent) 40%, color-mix(in srgb, var(--gold-l) 60%, transparent) 62%, color-mix(in srgb, var(--gold) 25%, transparent) 80%, transparent);
  mix-blend-mode: screen;
}

.doors > li:hover > .door::before,
.door:focus-visible::before { opacity: .45; }
.door[data-timing="today"]::before { animation: breathe 2.8s ease-in-out infinite; }
.doors > li[data-spark] > .door::before { animation: flash 1.5s ease-out; }

.door::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1.5px solid color-mix(in srgb, var(--snow) 70%, var(--gold-l));
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.scene:has([data-view="setup"][hidden]) .door[data-timing="catchup"]:not([data-filled])::after {
  border: 2px dashed var(--gold-l);
  box-shadow: none;
}
.door[data-ready]::after {
  border-color: var(--gold);
  filter: drop-shadow(0 0 4px var(--gold));
  animation: ready 1.6s ease-in-out infinite;
}
.door[data-selected]::after {
  border: 2.5px solid var(--snow);
  filter: drop-shadow(0 0 4px var(--gold-l));
}

@keyframes breathe { 0%, 100% { opacity: .2; } 50% { opacity: .55; } }
@keyframes ready { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes flash { 0% { opacity: 0; transform: scale(.7); } 18% { opacity: 1; transform: scale(1); } 60% { opacity: .8; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes lit { 0% { opacity: 0; } 15% { opacity: 1; } 60% { opacity: .9; } 100% { opacity: 0; } }

/* Always-on photo stockings cropped from the original tree scene */
.door-skin {
  display: block;
  position: absolute;
  inset: -3.6% -14.63%;
  isolation: isolate;
  pointer-events: none;
  filter: var(--pop, none);
  -webkit-mask-image: radial-gradient(46% 52% at 50% 54%, var(--card) 70%, transparent);
  mask-image: radial-gradient(46% 52% at 50% 54%, var(--card) 70%, transparent);
}
.door-skin::before,
.door-skin::after { content: ""; position: absolute; inset: 0; }
.door-skin::before {
  --at: calc((var(--px) - .8) / 92.93 * 100%) calc((var(--py) - .5) / 85.11 * 100%);
  background-image: var(--sheen, linear-gradient(transparent, transparent)), url("https://img.adventwithmyfriends.dev/s_6q5f3p0p676h04/stocking-tree-scene.3e601f55e1.webp");
  background-size: 300% 100%, 1414.43% 671.59%;
  background-position: 120% 0, var(--at);
  background-repeat: no-repeat;
  filter: var(--skin, none);
  animation: var(--sheen-run, none);
}
.door-skin::after {
  background: var(--tint, none) 0 0 / 100% 300%;
  mix-blend-mode: overlay;
  animation: var(--tint-run, none);
}
.door[data-style="gold"], .sock-gold {
  --skin: grayscale(1) contrast(.55) brightness(1.4);
  --pop: saturate(1.7) contrast(1.12);
  --tint: linear-gradient(160deg, var(--gold-l), var(--gold) 40%, var(--gold) 70%, var(--gold-l));
  --sheen: linear-gradient(115deg, transparent 40%, color-mix(in srgb, var(--card) 70%, transparent) 50%, transparent 60%);
  --sheen-run: sheen 3.2s ease-in-out infinite;
}
.door[data-style="frost"], .sock-frost {

  --skin: grayscale(1) contrast(.55) brightness(1.4);
  --pop: saturate(1.7) contrast(1.12);
  --tint: linear-gradient(160deg, var(--card), var(--ice) 70%, var(--card));
  --sheen: linear-gradient(115deg, transparent 42%, color-mix(in srgb, var(--card) 60%, transparent) 50%, transparent 58%);
  --sheen-run: sheen 4.8s ease-in-out infinite;
}
.door[data-style="aurora"], .sock-aurora {
  --skin: grayscale(1) contrast(.55) brightness(1.4);
  --pop: saturate(1.7) contrast(1.12);
  --tint: linear-gradient(180deg, var(--aurora), var(--ice) 35%, var(--violet) 65%, var(--aurora));
  --tint-run: drift 6s linear infinite;
}
.doors > li:hover .door-skin,
.door:focus-visible > .door-skin { filter: var(--pop, saturate(1)) brightness(1.2); }
.doors > li[data-spark] .door-skin { animation: skin-lit 1.5s ease-out; }
@keyframes sheen { 0% { background-position: 120% 0, var(--at); } 60%, 100% { background-position: -20% 0, var(--at); } }
@keyframes drift { from { background-position: 0 0; } to { background-position: 0 150%; } }
@keyframes skin-lit { 0%, 100% { filter: var(--pop, saturate(1)); } 18% { filter: var(--pop, saturate(1)) brightness(1.7); } }

.door-num {
  position: absolute;
  left: 50%;
  top: 4%;
  transform: translateX(-50%);
  z-index: 2;
  min-width: 1.45em;
  height: 1.35em;
  padding: 0 .15em;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--snow);
  color: var(--red-d);
  border: 1.5px solid color-mix(in srgb, var(--gold) 75%, var(--snow));
  box-shadow: 0 1px 3px rgba(36, 23, 15, .45);
  font: 700 12px/1 var(--title);
}
.scene[data-paper="midnight"] .door { color: var(--snow); text-shadow: 0 1px 2px var(--night); }
.scene[data-paper="midnight"] .door-num { color: var(--red-d); text-shadow: none; }
.door[data-opened] .door-num { background: var(--gold-l); border-color: var(--gold); }
.door-badge {
  position: absolute;
  right: -8%;
  top: 34%;
  z-index: 2;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid var(--snow);
  border-radius: var(--r);
  background: var(--snow);
  font-size: 12px;
  line-height: 1;
}
.door-badge:empty { display: none; }
.door[data-style="gold"] .door-badge { border-color: var(--gold); }
.door[data-style="frost"] .door-badge { border-color: var(--ice); }
.door[data-style="aurora"] .door-badge { border-color: var(--aurora); }

.door-tag { display: none; }
.door[data-ready] .door-tag {
  display: block;
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: var(--r);
  background: var(--gold);
  color: var(--ink);
  font: 600 12px/1.2 var(--body);
  white-space: nowrap;
}
.door-name {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 2%;
  z-index: 2;

  transform: translateX(-50%);
  max-width: 140%;
  padding: 1px 5px;
  border-radius: var(--r);
  background: var(--snow);
  color: var(--ink);
  font: 600 12px/1.2 var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doors > li:hover .door-name:not(:empty),
.door:focus-visible .door-name:not(:empty),
.door[data-mine] .door-name:not(:empty) { display: block; }
.door[data-ready] .door-name { display: none !important; }

.spark { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.spark i {
  position: absolute; left: 50%; top: 42%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  background: var(--gold-l); opacity: 0; filter: drop-shadow(0 0 3px var(--gold));
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: burst 1.2s cubic-bezier(.2, .7, .3, 1) var(--t) forwards;
}
.spark i:nth-child(odd) { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--card); }
.spark b {
  position: absolute; right: -10%; top: -4%; width: 3px; height: 14px; border-radius: var(--r);
  background: var(--gold-l); transform-origin: 50% 160%; opacity: 0; filter: drop-shadow(0 0 3px var(--gold));
  animation: ray 1.1s ease-out .1s forwards;
}
.spark b:nth-of-type(1) { --ray: -25deg; }
.spark b:nth-of-type(2) { --ray: 20deg; }
.spark b:nth-of-type(3) { --ray: 65deg; }
@keyframes burst { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(.3); } 20% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(1); } }
@keyframes ray { 0% { opacity: 0; transform: rotate(var(--ray)) scaleY(.2); } 30% { opacity: 1; transform: rotate(var(--ray)) scaleY(1); } 100% { opacity: 0; transform: rotate(var(--ray)) translateY(-8px) scaleY(.6); } }

.scene-panel { width: min(100%, 420px); margin: 0 auto; display: grid; gap: var(--s-2); position: relative; z-index: 3; }
.scene-create { display: grid; gap: var(--s-2); }
.scene-after { display: grid; gap: 0; }
.stage .small a { color: var(--gold-l); }
.code-link { text-align: center; margin: 0; }
.motto {
  font: 700 var(--f-22)/1.2 var(--hand);
  color: var(--gold-l);
  margin: var(--s-4) 0 0;
  text-align: center;
}
.motto::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin: var(--s-1) auto 0;
  border-radius: var(--r);
  background: var(--red);
}
.scene[data-paper="midnight"] .motto { color: var(--snow); }
.scene[data-paper="midnight"] .motto::after { background: var(--ice); }
.lead { font-size: var(--f-14); color: var(--mist); margin: var(--s-2) 0 0; text-align: center; }

.form-create { gap: 6px; margin-bottom: var(--s-2); }
.form-create label { font-size: 13px; }
.form-create input[type="text"] { min-height: 42px; }
.form-create .looks { gap: 4px; margin: 0; flex-wrap: nowrap; }

.form-create .looks label { min-height: 40px; padding: 4px 6px; font-size: 12px; flex: 1 1 0; min-width: 0; justify-content: center; }
.form-create .look { width: 18px; height: 18px; flex: 0 0 auto; }
.form-create .fold { margin: 0; }
.form-create .fold summary { font-size: 13px; min-height: 36px; }
.form-create .btn-go { margin-top: 2px; min-height: 46px; }
.form-create .hint { margin: 0; font-size: 12px; }

.hero-card { display: grid; gap: var(--s-3); }
.note-card { position: relative; padding: var(--s-5) var(--s-5) var(--s-4); border-radius: var(--r); background: var(--snow); color: var(--ink); box-shadow: var(--sh-2); transform: rotate(-1deg); }
.note-card::before { content: ""; position: absolute; top: -12px; left: 50%; width: 96px; height: 24px; margin-left: -48px; background: color-mix(in srgb, var(--gold-l) 75%, transparent); transform: rotate(2deg); }
.scene[data-paper="berry"] .note-card::before { background: repeating-linear-gradient(135deg, var(--red) 0 6px, var(--snow) 6px 12px); }
.scene[data-paper="midnight"] .note-card::before { background: color-mix(in srgb, var(--ice) 75%, transparent); }
.note-card[data-style="gold"] { outline: 2px solid var(--gold); outline-offset: -8px; }
.note-card[data-style="frost"] { outline: 2px solid var(--ice); outline-offset: -8px; }
.note-card[data-style="aurora"] { outline: 2px solid var(--aurora); outline-offset: -8px; }
.note-day { font: 700 var(--f-22)/1.2 var(--hand); color: var(--red); }
.note-text { font: 700 var(--f-28)/1.25 var(--hand); margin: var(--s-2) 0; overflow-wrap: anywhere; }
.note-from { font-size: var(--f-14); color: var(--muted); }
.note-nav { display: flex; align-items: center; justify-content: center; gap: var(--s-3); }
.round { width: 44px; height: 44px; border: 1px solid var(--glass); border-radius: var(--r); background: color-mix(in srgb, var(--night) 60%, transparent); color: var(--snow); font: 700 var(--f-22)/1 var(--body); cursor: pointer; }
.round:hover:not(:disabled) { border-color: var(--gold-l); }
.round:disabled { opacity: .4; cursor: default; }
.btn-hero { min-height: 52px; font-size: var(--f-18); }
.scene-caption { margin: var(--s-1) 0 0; font-size: 12px; color: var(--mist); text-align: center; }
.scene:has([data-view="setup"]:not([hidden])) .scene-caption { display: none; }
.preview-date { margin-top: var(--s-2); font-size: var(--f-14); color: var(--gold-l); text-align: center; }
.scene .form-status { margin-top: var(--s-1); text-align: center; font-size: var(--f-14); }

/* Pricing sock previews use the same photo crop */
.sock {
  --px: 58.98; --py: 49.86;
  position: relative;
  display: block;
  aspect-ratio: 7 / 10;
  border-radius: var(--r);
  background: var(--night-2);
  overflow: hidden;
}
.sock > .door-skin { inset: 0; display: block; }

.sock-num { position: absolute; left: 0; right: 0; top: 19%; text-align: center; color: var(--red-d); font: 700 var(--f-22)/1 var(--title); z-index: 2; }

.desk { background: var(--night-2); color: var(--snow); }
.desk:has([data-view]:not([hidden])) { padding: var(--s-7) 0; border-top: 1px solid var(--night-3); }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }

.form { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.form label { font-weight: 600; font-size: var(--f-14); }
.form input[type="text"], .form input[type="password"], .form textarea, .manual input { width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3); border: 1px solid var(--mist); border-radius: var(--r); background: var(--card); color: var(--ink); font: 400 var(--f-16)/1.5 var(--body); }
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.form fieldset { border: 0; margin: 0 0 var(--s-2); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.form legend { font-weight: 600; font-size: var(--f-14); margin-bottom: var(--s-2); width: 100%; }
.looks label, .stickers label, .styles label { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: var(--s-1) var(--s-3); border: 1px solid var(--night-3); border-radius: var(--r); background: var(--night); cursor: pointer; font-weight: 600; }
.looks input, .stickers input, .styles input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.looks label:has(input:checked), .stickers label:has(input:checked), .styles label:has(input:checked) { border-color: var(--gold); background: var(--night-3); }
.looks label:has(input:focus-visible), .stickers label:has(input:focus-visible), .styles label:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.look { width: 24px; height: 24px; border-radius: var(--r); border: 2px solid var(--snow); }
.look-pine { background: var(--night-3); box-shadow: inset 0 -8px 0 var(--red-d); }
.look-berry { background: repeating-linear-gradient(135deg, var(--red) 0 4px, var(--snow) 4px 8px); }
.look-midnight { background: var(--ice-d); box-shadow: inset 0 -8px 0 var(--ice); }
.stickers label { padding: var(--s-1) var(--s-2); }
.stickers span { font-size: var(--f-22); line-height: 1; }
.stickers b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.styles label { flex-direction: column; align-items: flex-start; gap: var(--s-1); padding: var(--s-2) var(--s-3); min-width: 96px; }
.styles small { font-size: var(--f-12); color: var(--mist); }
.styles label[data-locked] { opacity: .6; }
.styles .sock { width: 36px; }

.balance { float: right; color: var(--gold-l); }
.counter { justify-self: end; font-size: var(--f-12); color: var(--mist); }
.ideas-label { font-size: var(--f-14); color: var(--mist); }
.ideas { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.chip { min-height: 44px; padding: var(--s-1) var(--s-3); border: 1px dashed var(--mist); border-radius: var(--r); background: transparent; color: var(--snow); font: 400 var(--f-14)/1.3 var(--body); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--gold); }
.check { display: flex; gap: var(--s-2); align-items: flex-start; font-weight: 400 !important; min-height: 44px; padding-top: var(--s-2); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.fold { margin: var(--s-2) 0 var(--s-4); }
.fold summary { cursor: pointer; font-weight: 600; font-size: var(--f-14); min-height: 44px; display: flex; align-items: center; color: var(--gold-l); }
.fold[open] summary { margin-bottom: var(--s-2); }
.form-status { font-size: var(--f-14); color: var(--gold-l); min-height: 0; overflow-wrap: anywhere; }
.form-status:empty { display: none; }
.compose-head { font-size: var(--f-16); margin-bottom: var(--s-4); padding: var(--s-3) var(--s-4); border-left: 4px solid var(--gold); background: var(--night); border-radius: var(--r); }

.status-card { padding: var(--s-4); border-radius: var(--r); background: var(--snow); color: var(--ink); margin-bottom: var(--s-4); }
.status-title { font-family: var(--title); font-weight: 700; font-size: var(--f-18); margin-bottom: var(--s-1); }
.bulbs { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s-1); margin-bottom: var(--s-2); }
.bulbs i { height: 16px; border-radius: var(--r); background: var(--night-3); }
.bulbs i[data-on]:nth-child(4n+1) { background: var(--red); }
.bulbs i[data-on]:nth-child(4n+2) { background: var(--gold); }
.bulbs i[data-on]:nth-child(4n+3) { background: var(--aurora); }
.bulbs i[data-on]:nth-child(4n) { background: var(--card); }
.desk-main > .small { margin-bottom: var(--s-4); color: var(--mist); }
.quick { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0; }
.quick .btn { flex: 1 1 auto; }
.share-row { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--f-14); margin-bottom: var(--s-4); }
.share-row a { color: var(--gold-l); padding: var(--s-2) 0; }
.card { padding: var(--s-4); border-radius: var(--r); border: 1px solid var(--night-3); background: var(--night); margin-bottom: var(--s-4); display: grid; gap: var(--s-2); }
.card-key { border: 2px dashed var(--gold); }
.card-sent { border-color: var(--gold); }
.card-title { font-weight: 600; font-size: var(--f-16); color: var(--gold-l); }

.secret { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.secret code { padding: var(--s-2) var(--s-3); border-radius: var(--r); background: var(--snow); color: var(--ink); font-size: var(--f-16); overflow-wrap: anywhere; }
.code { letter-spacing: .08em; }

.owner-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.links { display: flex; flex-wrap: wrap; gap: var(--s-4); color: var(--mist); }
.returning { margin-top: var(--s-5); border-top: 1px solid var(--night-3); padding-top: var(--s-4); }
.returning h2 { font-size: var(--f-22); margin-bottom: var(--s-3); }
.return-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.return-list li { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.return-list .code { color: var(--mist); }
.manual { margin-top: var(--s-3); display: grid; gap: var(--s-1); font-size: var(--f-14); }
.mobile-cta { display: none; }

.sheet { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); border: 0; border-radius: var(--r); padding: var(--s-5); background: var(--snow); color: var(--ink); box-shadow: var(--sh-2); }
.sheet::backdrop { background: color-mix(in srgb, var(--night) 70%, transparent); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.sheet-head h2 { font-size: var(--f-22); }
.sheet-body { display: grid; gap: var(--s-3); }
.sheet-body h3 { margin-top: var(--s-2); }
.sheet .form-status { color: var(--red-d); }
.sheet .small { color: var(--muted); }
.letter { padding: var(--s-3) var(--s-4) var(--s-4); border-radius: var(--r); border: 1px solid var(--line); background: var(--card); background-image: repeating-linear-gradient(transparent 0 27px, var(--line) 27px 28px); background-origin: content-box; line-height: 28px; }
.letter + .letter { margin-top: var(--s-3); }
.letter[data-style="gold"] { border: 2px solid var(--gold); }
.letter[data-style="frost"] { border: 2px solid var(--ice); }
.letter[data-style="aurora"] { border: 2px solid var(--aurora); }
.letter-from { margin: 0; font-weight: 600; color: var(--red-d); overflow-wrap: anywhere; }
.letter-text { margin: 0; font-size: var(--f-18); line-height: 28px; white-space: pre-wrap; overflow-wrap: anywhere; }
.story-body img { width: 270px; height: 480px; margin: 0 auto; border-radius: var(--r); background: var(--night); }
.door-tip { position: fixed; left: 50%; bottom: var(--s-4); transform: translateX(-50%); z-index: 39; width: min(420px, calc(100% - 32px)); padding: var(--s-4); border-radius: var(--r); background: var(--snow); color: var(--ink); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); animation: tip-in .18s ease-out; }
.door-tip[hidden] { display: none; }
.door-tip p { margin: 0 0 var(--s-3); line-height: 1.5; }
.door-tip-actions { display: grid; gap: var(--s-2); }
.door-tip-actions:empty { display: none; }
.door-tip [data-tip-close] { display: block; margin: var(--s-3) 0 0 auto; color: var(--red-d); font-size: var(--f-14); }
.door-tip:not([hidden]) ~ .toast { top: var(--s-4); bottom: auto; }
.sheet[data-door-dialog] { position: fixed; inset: auto 0 var(--s-4); z-index: 39; margin: 0 auto; width: min(440px, calc(100% - 32px)); max-height: min(72vh, 620px); overflow: auto; padding: var(--s-4); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); animation: sheet-up .18s ease-out; }
.sheet[data-door-dialog] .sheet-head { margin-bottom: var(--s-3); }
.sheet[data-door-dialog] .sheet-head h2 { font: 700 var(--f-16)/1.4 var(--body); }
.sheet[data-door-dialog] .sheet-head .btn { width: auto; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--red-d); font-size: var(--f-14); font-weight: 400; text-decoration: underline; }
@keyframes sheet-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast { position: fixed; left: 50%; bottom: var(--s-5); transform: translateX(-50%); z-index: 40; width: max-content; max-width: min(360px, calc(100% - 32px)); padding: var(--s-3) var(--s-4); border-radius: var(--r); background: var(--snow); color: var(--ink); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); line-height: 1.5; }

.paper { background: var(--snow); padding: var(--s-8) 0; }

.paper + .paper { padding-top: 0; }
.paper-inner > h2, .split h2, .band h2 { margin-bottom: var(--s-4); }
.prose { max-width: 70ch; margin-bottom: var(--s-4); font-size: var(--f-18); }
.prose a { color: var(--red-d); font-weight: 600; }

.steps { list-style: none; counter-reset: step; margin: var(--s-6) 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); }
.steps li { counter-increment: step; position: relative; padding-top: var(--s-7); }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r); background: var(--red); color: var(--card); font: 700 var(--f-22)/1 var(--title); }
.steps h3 { margin-bottom: var(--s-2); }
.steps p { color: var(--muted); }
.band { background: var(--night-2); color: var(--snow); padding: var(--s-8) 0; }
.band-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.band .prose { color: var(--mist); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.legend li { display: flex; gap: var(--s-3); align-items: flex-start; }
.legend b { display: block; margin-bottom: var(--s-1); }
.legend p { font-size: var(--f-14); color: var(--mist); }
.mini { flex: none; position: relative; width: 36px; height: 48px; display: grid; place-items: center; border-radius: var(--r); background: var(--snow); color: var(--red-d); font: 700 var(--f-16)/1 var(--title); }
.mini-catchup { outline: 2px dashed var(--gold-l); outline-offset: 2px; }
.mini-today { background: radial-gradient(closest-side, var(--gold-l), var(--snow)); outline: 2px solid var(--gold); outline-offset: 2px; }
.mini-future::after { content: "⭐"; position: absolute; top: -8px; right: -10px; font-size: var(--f-12); }
.mini-open { background: linear-gradient(transparent 66%, var(--gold) 66% 78%, transparent 78%) center / 56% 100% no-repeat, var(--snow); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); }
.faq { padding-top: var(--s-8) !important; }
.questions { display: grid; gap: var(--s-2); max-width: 820px; margin-bottom: var(--s-6); }
.questions details { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 0 var(--s-4); box-shadow: var(--sh-1); }
.questions summary { cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center; padding: var(--s-2) 0; }
.questions details p { padding-bottom: var(--s-4); color: var(--muted); max-width: 70ch; }
.credit { font-size: var(--f-16); color: var(--muted); }

.guest { background: var(--card); border-top: 1px solid var(--line); padding: var(--s-8) 0; }
.guest-inner { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--s-7); }
.guest h2 { margin-bottom: var(--s-4); }
.guest .prose { font-size: var(--f-16); color: var(--muted); }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.tools [data-gf-liked], .tools [aria-pressed="true"] { border-color: var(--red); color: var(--red-d); }
.guest-form input[type="text"], .guest-form textarea { border-color: var(--line); }
.guest-form .opt { color: var(--muted); }
.reply-line { display: none; font-size: var(--f-14); }
[data-gf-replying] .reply-line { display: block; }
.comments { margin-top: var(--s-5); display: grid; gap: var(--s-4); }
.comments[data-gf-empty]::before { content: "No comments yet. Reviewed comments appear here."; color: var(--muted); font-size: var(--f-14); }
.comment { border-top: 1px solid var(--line); padding-top: var(--s-3); overflow-wrap: anywhere; }
.comment p { white-space: pre-wrap; }
.comment-meta { font-size: var(--f-14); color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--s-2); }
.owner-tag { display: none; }
[data-gf-owner] .owner-tag { display: inline; color: var(--red-d); font-weight: 600; }
.replies { margin-left: var(--s-5); display: grid; gap: var(--s-3); }

.foot { background: var(--night); color: var(--mist); padding: var(--s-7) 0; font-size: var(--f-14); }
.foot-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); }
.foot-about { display: grid; gap: var(--s-2); max-width: 46ch; }
.foot-name { font-family: var(--title); font-weight: 700; font-size: var(--f-18); color: var(--snow); text-decoration: none; }
.foot a { color: var(--snow); }
.foot-nav { display: grid; gap: var(--s-1); align-content: start; }
.foot-nav a { padding: var(--s-1) 0; }
.foot-label { font-weight: 600; color: var(--gold-l); }

.page { padding-top: var(--s-7); padding-bottom: var(--s-8); }
.page-head { margin-bottom: var(--s-6); max-width: 760px; }
.page-head h1 { font-size: var(--f-48); margin-bottom: var(--s-3); }
.page-lead { font-size: var(--f-18); color: var(--muted); max-width: 70ch; }
.kicker { font-size: var(--f-14); font-weight: 600; color: var(--red-d); margin-bottom: var(--s-2); }
.article-body { max-width: 70ch; font-size: var(--f-18); }
.article-body h2 { font-size: var(--f-28); margin: var(--s-6) 0 var(--s-3); }
.article-body h3 { font-size: var(--f-22); margin: var(--s-5) 0 var(--s-2); }
.article-body p, .article-body ul, .article-body ol { margin: 0 0 var(--s-4); }
.article-body li { margin-bottom: var(--s-2); }
.article-body a { color: var(--red-d); font-weight: 600; }

.cta-box { margin: var(--s-7) 0 var(--s-5); padding: var(--s-5); border-radius: var(--r); background: var(--night-2); color: var(--snow); display: grid; gap: var(--s-3); max-width: 760px; }
.cta-box p { color: var(--mist); }
.cta-box .btn { justify-self: start; }

.more { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--f-14); border-top: 1px solid var(--line); padding-top: var(--s-4); max-width: 760px; }
.more a { color: var(--red-d); font-weight: 600; }

.style-grid { list-style: none; margin: 0 0 var(--s-6); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.style-grid li { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: var(--s-4); display: grid; gap: var(--s-2); box-shadow: var(--sh-1); }
.style-grid .sock { width: 96px; }
.style-grid b { font-size: var(--f-18); }
.style-grid p { font-size: var(--f-14); color: var(--muted); }
.shop-box { max-width: 760px; padding: var(--s-5); border-radius: var(--r); border: 2px solid var(--line); background: var(--card); display: grid; gap: var(--s-3); margin-bottom: var(--s-6); }
.shop-box h2 { font-size: var(--f-22); }
.shop-box .btn { justify-self: start; }
.price { font-family: var(--title); font-size: var(--f-28); font-weight: 700; color: var(--red-d); }
.notice { padding: var(--s-3) var(--s-4); border-left: 4px solid var(--gold); background: var(--snow); border-radius: var(--r); max-width: 760px; margin-bottom: var(--s-5); }
.notice:empty { display: none; }
.code-form { max-width: 520px; padding: var(--s-5); border-radius: var(--r); background: var(--night-2); color: var(--snow); margin-bottom: var(--s-6); }
.code-form input[type="text"] { font-size: var(--f-22); letter-spacing: .12em; text-align: center; }
.code-error { color: var(--gold-l); font-size: var(--f-14); }
.code-error:empty { display: none; }
.account-box { max-width: 640px; display: grid; gap: var(--s-3); margin-bottom: var(--s-5); }
.account-box details { border-top: 1px solid var(--line); padding-top: var(--s-3); }
.account-box summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }

@media (min-width: 900px) {
  .scene {
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    grid-template-areas:
      "head art"
      "panel art";
    align-items: start;
    gap: var(--s-5) var(--s-6);
    padding: var(--s-6) var(--s-5) var(--s-7);
  }
  .scene-head { grid-area: head; text-align: left; }
  .scene-art { grid-area: art; width: 100%; max-width: none; margin: 0; aspect-ratio: 4 / 5; min-height: 0; max-height: 680px; }
  .scene-panel { grid-area: panel; width: 100%; margin: 0; }
  .scene h1 { font-size: var(--f-36); }
  .scene:has([data-view="setup"][hidden]) h1 { font-size: var(--f-28); }

  .motto, .lead { text-align: left; }
  .motto::after { margin-left: 0; }
  .doors { --door-rg: 14px; --door-cg: 12px; inset: 18% 9% 10%; }
  .door-num { font-size: var(--f-14); min-width: 1.55em; height: 1.4em; }
  .door-badge { width: 22px; height: 22px; font-size: var(--f-12); }
  .return-list { max-height: 152px; overflow: auto; }
}
@media (max-width: 959px) {
  .desk-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band-inner, .split, .guest-inner { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .foot-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot-about { grid-column: 1 / -1; }
  .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  /* Create: tree is the first-screen backdrop; title + grid + form sit on it */
  body:has([data-calendar-app] [data-view="setup"]:not([hidden])) .top {
    position: relative;
    z-index: 30;
    background: color-mix(in srgb, var(--night) 70%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: color-mix(in srgb, var(--night-3) 40%, transparent);
  }
  body:has([data-calendar-app] [data-view="setup"]:not([hidden])) .stage {
    margin-top: -64px;
  }
  .scene:has([data-view="setup"]:not([hidden])) {
    --hero: 100svh;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    overflow-x: clip;
    overflow-y: visible;
    max-width: none;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-art {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--hero);
    width: 100%;
    max-width: none;
    margin: 0;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    z-index: 0;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-img {
    object-position: 70% 12%;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-canvas::before {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--night) 55%, transparent), color-mix(in srgb, var(--night) 18%, transparent) 12%, transparent 28%, transparent 58%, color-mix(in srgb, var(--night) 35%, transparent) 78%, color-mix(in srgb, var(--night) 62%, transparent)),
      linear-gradient(90deg, color-mix(in srgb, var(--night) 18%, transparent), transparent 12%, transparent 88%, color-mix(in srgb, var(--night) 18%, transparent));
  }
  .scene:has([data-view="setup"]:not([hidden])) .doors {
    --door-rg: 8px;
    --door-cg: 6px;
    inset: 18% 5% 34%;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-head {
    position: relative;
    z-index: 3;
    padding: 72px 14px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 18px rgba(0, 0, 0, .35);
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-panel {
    position: relative;
    z-index: 3;
    width: 100%;
    margin: 0;
    gap: 0;
    pointer-events: none;
  }
  .scene:has([data-view="setup"]:not([hidden])) [data-view="setup"] {
    display: flex;
    flex-direction: column;
    pointer-events: none;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-after {
    pointer-events: auto;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-create {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    min-height: calc(var(--hero) - 118px);
    padding: 0 14px 12px;
    box-sizing: border-box;
    pointer-events: none;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-create > * {
    pointer-events: auto;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-head {
    pointer-events: none;
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-head > * {
    pointer-events: auto;
  }
  .scene:has([data-view="setup"]:not([hidden])) .form-create label,
  .scene:has([data-view="setup"]:not([hidden])) .form-create .fold summary,
  .scene:has([data-view="setup"]:not([hidden])) .code-link {
    text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  }
  .scene:has([data-view="setup"]:not([hidden])) .form-create .looks label {
    background: color-mix(in srgb, var(--night) 72%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .scene:has([data-view="setup"]:not([hidden])) .form-create input[type="text"] {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
  }
  .scene:has([data-view="setup"]:not([hidden])) .scene-after {
    position: relative;
    z-index: 3;
    padding: var(--s-5) var(--s-4) var(--s-4);
    background: var(--night);
  }

  /* Opened calendar: keep tree-first stacking (not the create overlay) */
  .scene:has([data-view="setup"][hidden]) {
    display: flex;
    flex-direction: column;
  }
  .scene:has([data-view="setup"][hidden]) .scene-art { order: 1; }
  .scene:has([data-view="setup"][hidden]) .scene-head { order: 2; }
  .scene:has([data-view="setup"][hidden]) .scene-panel { order: 3; }
  .scene:has([data-view="setup"][hidden]) .scene-caption { order: 4; }
}
@media (max-width: 719px) {
  .scene { padding: var(--s-3) var(--s-3) var(--s-5); gap: var(--s-2); }
  .scene:has([data-view="setup"]:not([hidden])) { padding: 0; gap: 0; }
  .scene h1 { font-size: var(--f-22); }
  .scene:has([data-view="setup"][hidden]) h1 { font-size: var(--f-18); }
  .eyebrow { font-size: 12px; }
  .doors { --door-rg: 8px; --door-cg: 6px; inset: 20% 6% 10%; }
  .scene:has([data-view="setup"]:not([hidden])) .doors { --door-rg: 7px; --door-cg: 5px; inset: 16% 4% 36%; }
  .scene:has([data-view="setup"]:not([hidden])) .scene-head { padding: 68px 12px 0; }
  .scene:has([data-view="setup"]:not([hidden])) .scene-create { min-height: calc(var(--hero) - 108px); padding: 0 12px 10px; }
  .scene:has([data-view="setup"]:not([hidden])) .form-create { gap: 5px; }
  .scene:has([data-view="setup"]:not([hidden])) .form-create input[type="text"] { min-height: 40px; }
  .scene:has([data-view="setup"]:not([hidden])) .form-create .looks label { min-height: 38px; padding: 3px 4px; font-size: 12px; }
  .scene:has([data-view="setup"]:not([hidden])) .form-create .fold summary { min-height: 32px; }
  .scene:has([data-view="setup"]:not([hidden])) .form-create .btn-go { min-height: 44px; }
  .door-num { font-size: 12px; min-width: 1.4em; height: 1.3em; }
  .door-badge { width: 18px; height: 18px; font-size: 12px; }
  .note-card { padding: var(--s-4); }
  .note-text { font-size: var(--f-22); }
  .note-day, .note-from { font-size: var(--f-18); }
}
@media (max-width: 640px) {
  .wrap { padding-left: var(--s-4); padding-right: var(--s-4); }
  body:has([data-calendar-app] [data-view="setup"]:not([hidden])) .top-inner { min-height: 52px; }
  body:has([data-calendar-app] [data-view="setup"]:not([hidden])) .stage { margin-top: -52px; }
  body:has([data-calendar-app] [data-view="setup"]:not([hidden])) .scene:has([data-view="setup"]:not([hidden])) .scene-head { padding-top: 58px; }
  .top-nav { gap: var(--s-3); }
  .top-nav a[href="/#how-it-works"] { display: none; }
  .brand span { font-size: var(--f-16); }
  .page-head h1 { font-size: var(--f-36); }
  .btn { width: 100%; }
  .quick .btn, .owner-actions .btn { flex: 1 1 100%; }
  .secret .btn, .tools .btn { width: auto; }
  .steps, .legend, .style-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-inner { grid-template-columns: minmax(0, 1fr); }
  .paper, .band, .guest { padding: var(--s-7) 0; }
  .desk:has([data-view]:not([hidden])) { padding: var(--s-6) 0; }
  .prose, .article-body { font-size: var(--f-16); }
  .mobile-cta:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: var(--s-2) var(--s-4) var(--s-3); background: var(--night); border-top: 1px solid var(--night-3); }
  body[data-has-cta] { padding-bottom: var(--s-8); }
  body[data-has-cta] .toast { bottom: var(--s-8); }
  body[data-has-cta] .door-tip, body[data-has-cta] .sheet[data-door-dialog] { bottom: calc(var(--s-8) + var(--s-2)); }
}
@media (prefers-reduced-motion: reduce) {

  .snowfall, .tree-lights i, .door[data-timing="today"]::before, .door[data-ready]::after, .door-tip, .sheet[data-door-dialog] { animation: none; }
  .door[data-timing="today"]::before { opacity: .35; }
  .doors > li[data-spark] > .door::before { animation: none; opacity: .8; }
  .doors > li::before, .doors > li[data-spark]::before { animation: none; }
  .doors > li[data-spark]::before { opacity: .8; }
  .door-skin::before, .door-skin::after, .doors > li[data-spark] .door-skin { animation: none; }
  .spark { display: none; }
  html { scroll-behavior: auto; }
}

.backbar { display: flex; flex-wrap: wrap; gap: var(--s-3); font-size: var(--f-14); font-weight: 600; }
.backbar .link { color: var(--gold-l); text-decoration: none; }
.backbar [data-back-next] { margin-left: auto; }
.own-line { font-size: var(--f-14); text-align: center; color: var(--mist); }
.own-line .link { color: var(--gold-l); }
.card-intro { border-color: var(--gold); }
.fill-bar { display: grid; grid-template-columns: repeat(24, 1fr); gap: var(--s-1); }
.fill-bar i { height: 8px; border-radius: var(--r); background: var(--night-3); }
.fill-bar i[data-on] { background: var(--gold); }
.form-row { display: flex; gap: var(--s-2); }
.form-row .btn-go { flex: 1; }
.secret code.owner-link { font-size: var(--f-14); }
.letter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-2); line-height: 1.4; }
.letter-actions .link { color: var(--muted); }
.card-friends .return-list span { color: var(--mist); }

.snowfall, .tree-lights { transition: opacity .6s ease; }
.scene[data-level="0"] .snowfall,
.scene[data-level="0"] .tree-lights,
.scene[data-level="1"] .tree-lights { opacity: 0; }
.scene[data-level="1"] .snowfall,
.scene[data-level="2"] .snowfall,
.scene[data-level="3"] .snowfall { opacity: .5; animation: snow-fall 14s linear infinite; }
.scene[data-level="3"] .scene-art { outline: 3px solid var(--gold); outline-offset: -3px; }
.scene[data-level="3"] .tree-lights i { width: 1.8%; background: radial-gradient(closest-side, var(--card), var(--gold) 35%, transparent); }
@keyframes snow-fall { from { background-position: 0 0; } to { background-position: 28px 280px; } }
@media (prefers-reduced-motion: reduce) {
  .scene[data-level] .snowfall { animation: none; }
}