/* GiftingShelf
   Palette: lilac mist page, plum ink, ribbon red, pine green, gold-foil tags, maple shelves.
   Type: Lilita One for headings, names and prices (used sparingly); Atkinson Hyperlegible
   for everything else, chosen so grandparents can read it easily.
   Signature: wishes standing on wooden shelves, each with a gold price tag under the photo. */

:root {
  --lilac: #F1ECFB;
  --lilac-deep: #E4DBF7;
  --plum: #2B1D3F;
  --plum-soft: #5E5277;
  --paper: #FFFFFF;
  --ribbon: #E2373F;
  --pine: #0F6B4F;
  --gold: #F3B53B;
  --gold-deep: #D99A1E;
  --maple-light: #E3B27E;
  --maple: #C68A50;
  --maple-dark: #8C5A2E;
  --line: rgba(43, 29, 63, 0.14);
  --accent: var(--ribbon);
  --accent-2: var(--pine);
  --radius: 16px;
  --shadow: 0 1px 0 rgba(43, 29, 63, 0.06), 0 8px 24px -12px rgba(43, 29, 63, 0.35);
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-theme='birthday']  { --accent: #FF4F9A; --accent-2: #7B5CFF; }
[data-theme='wedding']   { --accent: #B8892B; --accent-2: #5E6FA8; }
[data-theme='baby']      { --accent: #1E9CC0; --accent-2: #E9679A; }
[data-theme='celebrate'] { --accent: #FF7A1A; --accent-2: #0F6B4F; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--lilac);
  color: var(--plum);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  min-height: 100vh;
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0; }
.muted { color: var(--plum-soft); }
.small { font-size: 0.9rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- buttons and fields ---------- */
.btn {
  appearance: none;
  border: 2px solid var(--plum);
  background: var(--paper);
  color: var(--plum);
  font: 700 1rem/1 var(--body);
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-height: 46px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  box-shadow: 0 3px 0 var(--plum);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--plum); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--plum); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.gold { background: var(--gold); }
.btn.pine { background: var(--pine); color: #fff; }
.btn.ghost { box-shadow: none; border-color: var(--line); background: transparent; }
.btn.ghost:hover { border-color: var(--plum); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 0.92rem; }
.btn.big { font-size: 1.15rem; padding: 16px 26px; min-height: 58px; }
.btn.danger { color: var(--ribbon); border-color: var(--ribbon); box-shadow: 0 3px 0 var(--ribbon); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--plum); text-decoration: underline; cursor: pointer; }

label.field { display: block; }
label.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
label.field > small { display: block; color: var(--plum-soft); margin-top: 4px; font-size: 0.88rem; }
input[type='text'], input[type='url'], input[type='date'], input[type='number'], select, textarea {
  width: 100%;
  font: 400 1rem/1.4 var(--body);
  color: var(--plum);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--plum); outline: none; box-shadow: 0 0 0 4px rgba(243, 181, 59, 0.45); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--pine); flex: none; }

/* ---------- cards ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card.flat { box-shadow: none; border: 2px solid var(--line); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--lilac); color: var(--plum);
  border-radius: 999px; padding: 4px 11px; font-size: 0.86rem; font-weight: 700;
  white-space: nowrap;
}
.chip.ok { background: #DDF3EA; color: var(--pine); }
.chip.warn { background: #FFE7E5; color: #A3161C; }
.chip.gold { background: #FFF1D2; color: #7A5206; }

/* ---------- top bar ---------- */
.topbar { padding: 16px 0; }
.topbar .wrap { display: flex; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 1.55rem; color: var(--plum); }
.logo img { width: 36px; height: 36px; }
.logo b { color: var(--accent); font-weight: 400; }

/* Ribbon band across the top of a shelf's pages, in the shelf's theme color. */
.ribbon-band {
  background: var(--accent);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.ribbon-band::after {
  content: '';
  position: absolute; top: 0; bottom: 0; right: 12%;
  width: 34px; background: var(--gold); opacity: 0.95;
}
.ribbon-band .wrap { position: relative; z-index: 1; padding-top: 22px; padding-bottom: 22px; }
.ribbon-band h1 { font-size: clamp(1.9rem, 5vw, 3rem); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.ribbon-band .chip { background: rgba(255, 255, 255, 0.92); }
.ribbon-band a { color: #fff; }

/* ---------- landing ---------- */
.hero { padding: 22px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 span { color: var(--accent); }
.hero .lede { font-size: 1.2rem; margin: 18px 0 26px; max-width: 34ch; }
.hero .fine { margin-top: 14px; color: var(--plum-soft); font-size: 0.95rem; }

.hero-shelf { position: relative; padding: 0 6px; }
.hero-shelf .plank-row { display: flex; align-items: flex-end; justify-content: center; gap: 18px; height: 170px; position: relative; padding: 0 12px; }
.hero-shelf .plank-row + .plank-row { margin-top: 34px; }
.plank-row::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -16px; height: 16px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, var(--maple-light) 0 3px, var(--maple) 3px 11px, var(--maple-dark) 11px 16px);
  box-shadow: 0 14px 14px -10px rgba(43, 29, 63, 0.45);
}
.gbox {
  --c: var(--ribbon); --r: var(--gold);
  position: relative;
  width: var(--w, 92px); height: var(--h, 92px);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent calc(50% - 8px), var(--r) calc(50% - 8px) calc(50% + 8px), transparent calc(50% + 8px)),
    linear-gradient(180deg, transparent calc(38% - 7px), var(--r) calc(38% - 7px) calc(38% + 7px), transparent calc(38% + 7px)),
    var(--c);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12);
  animation: drop 0.9s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.gbox::before, .gbox::after {
  content: ''; position: absolute; top: -18px; width: 26px; height: 20px;
  border: 7px solid var(--r); border-radius: 50% 50% 4px 50%;
}
.gbox::before { left: calc(50% - 27px); transform: rotate(-18deg); }
.gbox::after { right: calc(50% - 27px); transform: scaleX(-1) rotate(-18deg); }
.gbox.b2 { --c: var(--pine); --r: #FFD9E2; --w: 70px; --h: 118px; animation-delay: 0.12s; }
.gbox.b3 { --c: var(--gold); --r: var(--ribbon); --w: 104px; --h: 70px; animation-delay: 0.24s; }
.gbox.b4 { --c: #7B5CFF; --r: var(--gold); --w: 78px; --h: 78px; animation-delay: 0.36s; }
.gbox.b5 { --c: #1E9CC0; --r: #fff; --w: 120px; --h: 96px; animation-delay: 0.48s; }
.gbox.b6 { --c: var(--ribbon); --r: #fff; --w: 60px; --h: 60px; animation-delay: 0.6s; }
.hero-tag { position: absolute; right: 6%; top: 92px; z-index: 2; animation: swing 3.2s ease-in-out 1.2s infinite; transform-origin: 0 0; }

@keyframes drop {
  0% { transform: translateY(-160px); opacity: 0; }
  55% { transform: translateY(0); opacity: 1; }
  72% { transform: translateY(-14px); }
  100% { transform: translateY(0); }
}
@keyframes swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(4deg); } }

/* Gold hang tag for prices. The hole and the notch make it read as a price tag. */
.tag {
  display: inline-flex; align-items: center;
  position: relative;
  background: var(--gold);
  color: var(--plum);
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1;
  padding: 7px 14px 7px 26px;
  border-radius: 3px 9px 9px 3px;
  clip-path: polygon(13px 0, 100% 0, 100% 100%, 13px 100%, 0 50%);
  transform: rotate(-3deg);
  box-shadow: inset 0 -3px 0 var(--gold-deep);
  white-space: nowrap;
}
.tag::before {
  content: ''; position: absolute; left: 11px; top: 50%;
  width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: var(--paper);
}
.tag.none { background: var(--lilac-deep); box-shadow: none; font-family: var(--body); font-weight: 700; font-size: 0.85rem; color: var(--plum-soft); }
.tag .qty { font-family: var(--body); font-size: 0.8rem; font-weight: 700; margin-left: 6px; }

.section { padding: 56px 0; }
.section-head { margin-bottom: 26px; }
.section-head p { margin-top: 10px; font-size: 1.1rem; max-width: 60ch; }

/* Format choices drawn as hang tags on a string. */
.tags-line { position: relative; padding-top: 26px; }
.tags-line::before {
  content: ''; position: absolute; left: -16px; right: -16px; top: 8px; height: 3px;
  background: repeating-linear-gradient(90deg, var(--maple-dark) 0 10px, var(--maple) 10px 16px);
  border-radius: 2px;
}
.format-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.format-tag {
  appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
  position: relative;
  background: var(--paper);
  border: 2px solid var(--plum);
  border-radius: 14px 14px 18px 18px;
  padding: 34px 16px 18px;
  box-shadow: 0 4px 0 var(--plum);
  transform-origin: 50% -18px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.format-tag:nth-child(odd) { transform: rotate(-1.6deg); }
.format-tag:nth-child(even) { transform: rotate(1.4deg); }
.format-tag:hover, .format-tag:focus-visible { transform: rotate(0) translateY(-4px); background: #FFFBF1; }
.format-tag::before {
  content: ''; position: absolute; left: 50%; top: 12px; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--lilac); border: 2px solid var(--plum);
}
.format-tag::after {
  content: ''; position: absolute; left: 50%; top: -20px; width: 2px; height: 34px; margin-left: -1px;
  background: var(--maple-dark);
}
.format-tag .em { font-size: 2.1rem; display: block; margin-bottom: 8px; }
.format-tag strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.18rem; line-height: 1.12; margin-bottom: 6px; }
.format-tag small { display: block; color: var(--plum-soft); font-size: 0.92rem; line-height: 1.35; }
.format-tag[aria-pressed='true'] { background: #FFF1D2; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding-top: 10px; }
.step .num {
  font-family: var(--display); font-size: 1.4rem; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--plum); color: #fff; margin-bottom: 12px;
}
.step h3 { margin-bottom: 6px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--paper); border-radius: var(--radius); padding: 18px 18px 20px; border: 2px solid var(--line); }
.feature .em { font-size: 1.6rem; }
.feature h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.feature p { color: var(--plum-soft); font-size: 0.98rem; }

.footer { padding: 34px 0 48px; color: var(--plum-soft); font-size: 0.95rem; }
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; border-top: 2px solid var(--line); padding-top: 22px; }

/* ---------- wizard ---------- */
.wizard { max-width: 860px; margin: 0 auto; padding: 8px 16px 64px; }
.wizard .card + .card { margin-top: 18px; }
.progress-dots { display: flex; gap: 8px; margin: 6px 0 18px; }
.progress-dots span { height: 8px; flex: 1; border-radius: 99px; background: var(--lilac-deep); }
.progress-dots span.on { background: var(--accent); }
.wizard .format-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.theme-picks { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-pick {
  appearance: none; cursor: pointer; font: inherit; color: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px 8px 8px;
}
.theme-pick i { width: 26px; height: 26px; border-radius: 50%; display: inline-block; background: linear-gradient(135deg, var(--sw1) 50%, var(--sw2) 50%); }
.theme-pick[aria-pressed='true'] { border-color: var(--plum); box-shadow: 0 3px 0 var(--plum); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.people-rows { display: grid; gap: 10px; }
.person-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
.person-row.simple { grid-template-columns: 1fr auto auto; }
.person-row .check { font-size: 0.9rem; white-space: nowrap; }
.icon-btn {
  appearance: none; border: 2px solid var(--line); background: var(--paper); border-radius: 12px;
  width: 46px; height: 46px; cursor: pointer; font-size: 1.1rem; color: var(--plum-soft);
}
.icon-btn:hover { border-color: var(--ribbon); color: var(--ribbon); }

/* ---------- organizer and member pages ---------- */
.page { padding: 22px 0 64px; }
.page .wrap > * + * { margin-top: 18px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.two-col > div > * + * { margin-top: 18px; }
.people-list { display: grid; gap: 10px; }
.person {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper);
}
.person .em { font-size: 1.9rem; width: 48px; height: 48px; display: grid; place-items: center; background: var(--lilac); border-radius: 50%; }
.person .name { font-weight: 700; font-size: 1.08rem; }
.person .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.person .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person .edit-area { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }

.callout { border-radius: var(--radius); padding: 16px 18px; background: #FFF1D2; border: 2px dashed var(--gold-deep); }
.callout.pine { background: #DDF3EA; border-color: var(--pine); }
.callout.red { background: #FFE7E5; border-color: var(--ribbon); }
.link-box { display: flex; gap: 8px; align-items: center; }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--lilac); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; }

.pairs { display: grid; gap: 8px; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.pair .arrow { font-family: var(--display); color: var(--accent); font-size: 1.3rem; }

.turns { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.turn { background: var(--paper); border: 2px solid var(--plum); border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 3px 0 var(--plum); }
.turn b { font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--accent); min-width: 34px; }

/* Who-am-I greeting */
.hello { display: flex; gap: 16px; align-items: center; }
.hello .avatar {
  appearance: none; border: 3px solid var(--plum); background: var(--paper); cursor: pointer;
  font-size: 2.6rem; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 4px 0 var(--plum);
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { font-size: 1.6rem; background: var(--lilac); border: 2px solid transparent; border-radius: 12px; cursor: pointer; height: 50px; }
.emoji-grid button:hover { border-color: var(--plum); }

/* Unwrap the person you drew */
.unwrap { text-align: center; padding: 26px 18px 30px; }
.unwrap-box {
  appearance: none; border: 0; background: none; cursor: pointer; position: relative;
  width: 190px; height: 170px; margin: 18px auto 10px; display: block;
}
.unwrap-box .box, .unwrap-box .lid {
  position: absolute; left: 50%; border-radius: 8px;
  background:
    linear-gradient(90deg, transparent calc(50% - 13px), var(--gold) calc(50% - 13px) calc(50% + 13px), transparent calc(50% + 13px)),
    var(--accent);
}
.unwrap-box .box { bottom: 0; width: 160px; height: 118px; margin-left: -80px; box-shadow: inset 0 -12px 0 rgba(0,0,0,0.14); }
.unwrap-box .lid { bottom: 112px; width: 182px; height: 38px; margin-left: -91px; box-shadow: inset 0 -6px 0 rgba(0,0,0,0.15); transition: transform 0.7s cubic-bezier(0.3, 1.5, 0.6, 1), opacity 0.7s; }
.unwrap-box .lid::before, .unwrap-box .lid::after {
  content: ''; position: absolute; top: -26px; width: 36px; height: 28px; border: 10px solid var(--gold); border-radius: 50% 50% 4px 50%;
}
.unwrap-box .lid::before { left: calc(50% - 40px); transform: rotate(-16deg); }
.unwrap-box .lid::after { right: calc(50% - 40px); transform: scaleX(-1) rotate(-16deg); }
.unwrap-box:hover .box, .unwrap-box:hover .lid { filter: brightness(1.06); }
.unwrap-box.shake { animation: shake 0.55s ease; }
.unwrap-box.open .lid { transform: translate(40px, -130px) rotate(28deg); opacity: 0; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); }
}
.reveal-name { animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.person-card {
  display: flex; gap: 16px; align-items: center;
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fff 0 60%, #FFF1D2 60%);
  border: 3px solid var(--plum); box-shadow: 0 5px 0 var(--plum);
}
.person-card .em { font-size: 3rem; }
.person-card .label { font-weight: 700; color: var(--plum-soft); font-size: 0.95rem; }
.person-card .who { font-family: var(--display); font-size: 2.1rem; line-height: 1; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.person-tile {
  appearance: none; font: inherit; color: inherit; text-align: center; cursor: pointer; text-decoration: none;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 10px 14px;
  display: grid; gap: 4px; justify-items: center; position: relative;
}
.person-tile:hover { border-color: var(--plum); transform: translateY(-2px); }
.person-tile .em { font-size: 2.4rem; }
.person-tile .name { font-weight: 700; }
.person-tile .badge { position: absolute; top: -10px; right: -6px; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; transform: rotate(4deg); }

/* Notes between a Secret Santa and their person */
.thread { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; background: var(--lilac); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { justify-self: end; background: var(--plum); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { border-bottom-left-radius: 4px; }
.compose { display: flex; gap: 8px; margin-top: 10px; }
.compose textarea { min-height: 48px; height: 48px; }

/* ---------- the shelf ---------- */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 34px 18px;
  padding: 16px 12px 14px;
  overflow: hidden; /* each card's plank runs edge to edge, clipped here, so every row is one long shelf */
}
.wish { position: relative; padding-bottom: 16px; display: flex; flex-direction: column; }
.wish::after {
  content: ''; position: absolute; left: -100vw; right: -100vw; bottom: 0; height: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, var(--maple-light) 0 3px, var(--maple) 3px 11px, var(--maple-dark) 11px 16px);
  box-shadow: 0 14px 12px -10px rgba(43, 29, 63, 0.45);
}
.wish-body {
  flex: 1;
  background: var(--paper); border-radius: 14px 14px 4px 4px;
  box-shadow: 0 1px 0 rgba(43,29,63,0.05), 0 10px 20px -16px rgba(43,29,63,0.6);
  padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.wish .photo {
  aspect-ratio: 1 / 1; border-radius: 10px; background: #fff; overflow: hidden;
  display: grid; place-items: center; border: 1px solid var(--line);
}
.wish .photo img { width: 100%; height: 100%; object-fit: contain; }
.wish .photo .placeholder { font-size: 3.4rem; opacity: 0.85; }
.wish .tag { align-self: flex-start; margin-top: -2px; }
.wish .title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wish .notes { font-size: 0.9rem; color: var(--plum-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.wish .buy { justify-content: center; }
.wish .actions { display: grid; gap: 8px; margin-top: auto; }
.wish .status { font-weight: 700; font-size: 0.92rem; text-align: center; }
.wish .most-wanted {
  position: absolute; top: -10px; left: -8px; z-index: 2;
  background: var(--accent); color: #fff; font-size: 0.78rem; font-weight: 700;
  padding: 4px 10px; border-radius: 99px; transform: rotate(-6deg); box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}
.wish.taken .photo { filter: grayscale(0.6) opacity(0.7); }
.wish.taken .wish-body::before {
  content: '🎀'; position: absolute; right: 10px; top: 10px; font-size: 2rem; z-index: 1;
}
.wish.secret .wish-body { background: repeating-linear-gradient(-45deg, #fff 0 14px, #FBF7FF 14px 28px); border: 2px dashed var(--lilac-deep); }
.meter { height: 10px; background: var(--lilac); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--pine); border-radius: 99px; }

.empty-shelf { text-align: center; padding: 34px 18px 50px; position: relative; }
.empty-shelf::after {
  content: ''; position: absolute; left: 6%; right: 6%; bottom: 18px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, var(--maple-light) 0 3px, var(--maple) 3px 11px, var(--maple-dark) 11px 16px);
}

.about-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.about-grid div b { display: block; font-size: 0.85rem; color: var(--plum-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.wish .secret-flag { left: auto; right: -8px; background: var(--plum); transform: rotate(5deg); }

/* ---------- one scrolling page: everyone's list, A to Z ---------- */
.top-stack > * + * { margin-top: 18px; }
.top-stack { margin-top: 18px; }
.jump-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; align-items: center; overflow-x: auto;
  margin: 28px -16px 0; padding: 12px 16px;
  background: rgba(241, 236, 251, 0.94); backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--line);
  scrollbar-width: thin;
}
.jump-label { font-weight: 700; color: var(--plum-soft); white-space: nowrap; }
.jump {
  appearance: none; font: 700 0.95rem/1 var(--body); color: var(--plum); cursor: pointer; white-space: nowrap;
  background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 8px 13px;
}
.jump:hover { border-color: var(--plum); }
.jump.mine { background: var(--accent); color: #fff; border-color: var(--accent); }
.jump.me { border-style: dashed; }
.list-row {
  scroll-margin-top: 76px;
  background: var(--paper); border-radius: 22px; padding: 20px 18px 8px;
  box-shadow: var(--shadow);
}
.list-row > * + * { margin-top: 14px; }
.list-row.mine { background: #FBF8FF; border: 2px dashed var(--lilac-deep); }
.list-row.my-person { border: 3px solid var(--accent); box-shadow: 0 6px 0 var(--accent), var(--shadow); }
.list-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.list-head .em { font-size: 2.2rem; width: 60px; height: 60px; display: grid; place-items: center; background: var(--lilac); border-radius: 50%; flex: none; }
.list-head .who { flex: 1 1 220px; }
.list-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 6px; }
.head-actions { flex-wrap: wrap; }
.person-chip { background: var(--accent); color: #fff; }
.small-empty { padding: 14px 18px 46px; }
.small-empty::after { left: 0; right: 0; }

/* ---------- reminder calendar ---------- */
.cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.cal { background: var(--lilac); border-radius: 16px; padding: 12px; }
.cal-title { font-family: var(--display); font-size: 1.15rem; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--plum-soft); padding: 2px 0; }
.cal-day {
  appearance: none; font: 700 0.95rem/1 var(--body); color: var(--plum); cursor: pointer;
  aspect-ratio: 1 / 1; border-radius: 10px; border: 2px solid transparent; background: var(--paper);
  min-height: 34px;
}
.cal-day:hover:not([disabled]) { border-color: var(--plum); }
.cal-day[aria-pressed='true'] { background: var(--pine); color: #fff; border-color: var(--pine); }
.cal-day[disabled] { background: transparent; color: rgba(43, 29, 63, 0.3); cursor: default; }
.cal-day.event { background: var(--gold); opacity: 1; color: var(--plum); }

/* Import a list */
.steps-list { margin: 0; padding-left: 22px; }
.steps-list li { margin-bottom: 6px; }
.import-list { display: grid; gap: 10px; }
.import-row { display: grid; grid-template-columns: auto 64px 1fr; gap: 10px; align-items: center; padding: 10px; border: 2px solid var(--line); border-radius: 14px; }
.import-row input[type='checkbox'] { width: 22px; height: 22px; accent-color: var(--pine); }
.import-pic { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 1.8rem; }

/* Shopping list */
.buy-list { display: grid; gap: 12px; }
.buy-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; background: var(--paper); border-radius: var(--radius); padding: 12px; border: 2px solid var(--line); }
.buy-row .pic { display: grid; gap: 8px; justify-items: center; }
.buy-row .pic .photo { width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; background: #fff; }
.buy-row .pic .photo img { width: 100%; height: 100%; object-fit: contain; }
.buy-row .pic .tag { font-size: 1.02rem; padding: 5px 10px 5px 22px; }
.buy-row.bought { opacity: 0.7; }
.budget-bar { height: 14px; background: var(--lilac); border-radius: 99px; overflow: hidden; }
.budget-bar i { display: block; height: 100%; background: var(--pine); }
.budget-bar.over i { background: var(--ribbon); }

/* Dialogs */
dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(620px, calc(100vw - 24px));
  box-shadow: 0 30px 80px -20px rgba(43, 29, 63, 0.6); color: var(--plum);
}
dialog::backdrop { background: rgba(43, 29, 63, 0.55); }
dialog .dlg { padding: 22px; max-height: calc(100vh - 40px); overflow-y: auto; }
dialog .dlg > * + * { margin-top: 14px; }
.preview-pic { width: 110px; height: 110px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: #fff; }

/* Toasts */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(520px, calc(100vw - 32px)); }
.toast { background: var(--plum); color: #fff; padding: 13px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.5); animation: pop 0.3s ease both; }
.toast.err { background: #A3161C; }

.loading { padding: 80px 16px; text-align: center; color: var(--plum-soft); font-size: 1.1rem; }
.loading .gbox { margin: 0 auto 18px; --w: 70px; --h: 70px; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.prose { max-width: 70ch; }
.prose h2 { margin: 26px 0 10px; font-size: 1.5rem; }
.prose p, .prose li { margin-bottom: 10px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-shelf { order: -1; transform: scale(0.84); transform-origin: 50% 0; margin-bottom: -40px; }
  .format-grid { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .format-grid, .features, .steps, .grid2 { grid-template-columns: 1fr; }
  .format-tag:nth-child(n) { transform: none; }
  .hero-shelf .plank-row { gap: 10px; height: 140px; }
  .gbox { --w: 70px; --h: 70px; }
  .gbox.b5, .gbox.b6 { display: none; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 14px; padding: 6px 6px 12px; }
  .wish .tag { font-size: 1.1rem; }
  .person { grid-template-columns: auto 1fr; }
  .person .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .person .edit-area { grid-template-columns: 1fr; }
  .person-row, .person-row.simple { grid-template-columns: 1fr auto; }
  .person-row input[name='household'] { grid-column: 1 / 2; }
  .buy-row { grid-template-columns: 80px 1fr; }
  .buy-row .pic .photo { width: 80px; height: 80px; }
  .buy-row > .row { grid-column: 1 / -1; }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .card { padding: 18px; }
}

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