/* Nice List Ledger, look A "Cozy": warm paper, pine green and cranberry, gift-tag cards. */
@font-face { font-family: "Caveat"; src: url("/fonts/caveat-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root {
  --paper: #f6efe3;
  --card: #fffaf1;
  --line: #e3d5bd;
  --dash: #c9b79a;
  --pine: #24563f;
  --pine-dark: #1b4231;
  --berry: #a8322d;
  --gold: #f1c75b;
  --mint: #e4efe7;
  --ink: #2d2a24;
  --muted: #74654e;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 150px; }
h1, h2, h3 { font-family: var(--serif); color: var(--pine); line-height: 1.2; margin: 0; }
h1 { font-size: 27px; }
h2 { font-size: 21px; margin: 22px 0 10px; }
h3 { font-size: 17px; margin: 16px 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--pine); }
.muted { color: var(--muted); font-size: 14px; }
.loading { text-align: center; color: var(--muted); margin-top: 40vh; }
.hidden { display: none !important; }

/* header */
.top { text-align: center; padding-bottom: 14px; padding-top: 4px; border-bottom: 2px dashed var(--dash); margin-bottom: 12px; }
.top .meta { font-size: 14px; color: var(--muted); margin-top: 4px; }
.pill { display: inline-block; margin-top: 10px; background: var(--berry); color: #fff; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 99px; }
.pill.calm { background: var(--pine); }
.banner { background: var(--mint); border: 1px solid #c4dccb; color: var(--pine-dark); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.banner.warn { background: #fbeae6; border-color: #e7bdb5; color: #7d2420; }

/* tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.tabs button { flex: 0 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 8px; font: 600 15px var(--sans); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--pine); border-bottom-color: var(--berry); }

/* cards */
/* gift-tag cards: clipped corner and a punched hole */
.card { --cut: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; position: relative;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.card::after { content: ""; position: absolute; top: 0; left: calc(100% - var(--cut)); width: calc(var(--cut) * 1.4142); height: 1px; background: var(--line); transform-origin: 0 0; transform: rotate(45deg); }
.card::before { content: ""; position: absolute; top: 15px; right: 11px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--dash); background: var(--paper); }
.card.need { border-left: 5px solid var(--berry); }
.card.done > .head { opacity: .6; }
.card .head { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 13px 30px 13px 14px; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.card .name { flex: 1; min-width: 0; font-family: var(--sans); }
.card .who { display: block; font-family: var(--hand); font-weight: 600; font-size: 27px; line-height: 1; color: var(--ink); overflow-wrap: anywhere; }
.card .name small { display: block; font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--muted); }
.card .body { border-top: 1px dashed var(--line); padding: 10px 14px 14px; font-size: 15px; }
.boxes { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.boxes i { width: 17px; height: 15px; border-radius: 2px; background: var(--berry) linear-gradient(90deg, transparent 7px, var(--gold) 7px, var(--gold) 10px, transparent 10px); }
.boxes i.off { background: transparent; border: 1.5px dashed var(--dash); }
.boxes i.extra { background-color: #c77b3c; }
.count { font-weight: 700; color: var(--muted); font-size: 14px; }

.list { list-style: none; margin: 0 0 8px; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #efe4d0; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list .price { color: var(--muted); white-space: nowrap; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--mint); color: var(--pine); white-space: nowrap; }
.tag.berry { background: #fbeae6; color: var(--berry); }
.tag.gray { background: #eee7da; color: var(--muted); }
.label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 8px 0 2px; }

/* buttons */
button, .btn { font: 600 15px var(--sans); border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1px solid transparent; }
.btn-main { background: var(--pine); color: #fff; }
.btn-main:hover { background: var(--pine-dark); }
.btn-soft { background: var(--card); color: var(--pine); border-color: var(--line); }
.btn-soft:hover { border-color: var(--dash); }
.btn-danger { background: #fff; color: var(--berry); border-color: #e7bdb5; }
.btn-link { background: none; border: 0; padding: 4px 6px; color: var(--pine); text-decoration: underline; font-weight: 600; font-size: 14px; }
.btn-link.danger { color: var(--berry); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: min(528px, calc(100% - 32px)); padding: 15px; font-family: var(--serif); font-size: 18px; box-shadow: 0 6px 18px rgba(36, 86, 63, .35); z-index: 5; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* forms */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
label.field { display: block; margin-bottom: 12px; font-weight: 600; font-size: 15px; }
label.field span.hint { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=url], input[type=tel], select {
  display: block; width: 100%; margin-top: 4px; font: 16px var(--sans); padding: 10px 12px; border: 1px solid var(--dash); border-radius: 9px; background: #fff; color: var(--ink);
}
input:disabled, select:disabled { background: #f1ebe0; color: var(--muted); }
.pin { letter-spacing: .5em; font-size: 22px !important; text-align: center; max-width: 200px; }
label.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 15px; }
label.check input { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--pine); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.err { color: var(--berry); font-size: 14px; font-weight: 600; min-height: 1em; margin: 4px 0 8px; }
.warnline { color: #8a4b12; background: #fdf1df; border-radius: 8px; padding: 6px 10px; font-size: 14px; margin-bottom: 10px; }

/* sign in names */
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 12px 0; }
.names button { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-family: var(--hand); font-weight: 600; font-size: 24px; line-height: 1; color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); }
.names.groups button { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.names button:hover { border-color: var(--pine); }

/* recovery code */
.code { font: 700 24px ui-monospace, Consolas, monospace; letter-spacing: .08em; text-align: center; background: #fff; border: 2px dashed var(--berry); border-radius: 10px; padding: 14px; margin: 10px 0; user-select: all; }

/* dialog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(500px, calc(100% - 24px)); max-height: calc(100% - 40px); background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(30, 25, 15, .45); }
dialog .dbody { padding: 18px 18px 16px; }
dialog h2 { margin-top: 0; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.foot { text-align: center; margin-top: 28px; font-size: 14px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 20px 10px; }
.stat { font-family: var(--serif); font-size: 18px; margin-bottom: 8px; }

/* spending per person */
.card .money { display: block; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.card .money.over { color: var(--berry); }
.card .mbar { display: block; height: 5px; max-width: 180px; background: #efe4d0; border-radius: 99px; margin-top: 4px; overflow: hidden; }
.card .mbar i { display: block; height: 100%; background: var(--pine); border-radius: 99px; }
#toast { width: max-content; }
.two { align-items: end; }

/* ornament initials */
.orn { position: relative; flex: 0 0 auto; width: 38px; height: 38px; margin-top: 5px; border-radius: 50%; background: var(--orn, var(--pine)); color: #fff;
  display: flex; align-items: center; justify-content: center; font: 700 17px var(--serif); }
.orn::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 6px; transform: translateX(-50%); background: #c99a3a; border-radius: 2px 2px 0 0; }
.orn::after { content: ""; position: absolute; top: 6px; left: 8px; width: 9px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: rotate(-30deg); }
.names .orn { width: 32px; height: 32px; font-size: 15px; margin-top: 4px; }

/* wrapping-paper banner at the top of every page */
.paper { position: relative; height: 54px; margin: -20px -16px 18px; border-radius: 0 0 14px 14px;
  background: radial-gradient(rgba(255,255,255,.28) 1.6px, transparent 2.2px) 0 0 / 18px 18px,
              repeating-linear-gradient(135deg, #a8322d 0 12px, #b4403a 12px 24px); }
.paper::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 12px; transform: translateX(-50%); background: var(--gold); box-shadow: inset 2px 0 0 rgba(0,0,0,.08), inset -2px 0 0 rgba(0,0,0,.08); }
.paper .bow { position: absolute; left: 50%; bottom: -14px; width: 0; height: 0; z-index: 1; }
.paper .bow::before, .paper .bow::after { content: ""; position: absolute; bottom: -4px; width: 30px; height: 20px; border: 3px solid #c99a3a; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--gold); }
.paper .bow::before { right: 3px; transform: rotate(22deg); }
.paper .bow::after { left: 3px; transform: rotate(-22deg); }
.paper .knot { position: absolute; left: 50%; bottom: -16px; width: 14px; height: 14px; transform: translateX(-50%); border-radius: 4px; background: #c99a3a; z-index: 2; }
.top { margin-top: 6px; }

/* Batch 1 (Nov 2026) */
.tag.gold { background: #fbf0cf; color: #7a5a12; }
.thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); flex: 0 0 auto; vertical-align: middle; margin-right: 8px; float: left; }
.thumb.big { width: 96px; height: 96px; float: none; margin: 0 0 10px; }
.list .grow { display: flow-root; }
.lookup { min-height: 0; margin: -6px 0 8px; }
.lookup:empty { display: none; }
dl.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px 12px; margin: 2px 0 10px; }
dl.sizes dt { font-size: 12px; color: var(--muted); }
dl.sizes dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.listlink { display: inline-block; text-decoration: none; margin: 0 0 8px; font-size: 14px; padding: 8px 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; align-items: end; }
textarea { display: block; width: 100%; margin-top: 4px; font: 16px var(--sans); padding: 10px 12px; border: 1px solid var(--dash); border-radius: 9px; background: #fff; color: var(--ink); resize: vertical; }
details.panel > summary { cursor: pointer; font-weight: 600; color: var(--pine); }
details.panel[open] > summary { margin-bottom: 12px; }
.note { margin-top: -4px; }
select.status { display: inline-block; width: auto; margin: 0; padding: 5px 6px; font-size: 14px; border-radius: 8px; }
select.status.s-ordered { background: #fdf1df; }
select.status.s-arrived { background: #e8eef8; }
select.status.s-wrapped { background: var(--mint); color: var(--pine); font-weight: 600; }
.mygifts li { flex-wrap: wrap; }
.qr { width: 168px; margin: 12px auto 0; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 8px; }
dialog.full { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
dialog.full .dbody { height: 100%; }
.room { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.room h2 { font-size: 30px; }
.qr.big { width: min(78vw, 62vh, 460px); margin: 10px auto; }
.roomlink { font: 700 18px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.wrapup .wstats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.wstat { flex: 1 1 90px; background: var(--paper); border-radius: 10px; padding: 8px 10px; text-align: center; }
.wstat b { display: block; font: 700 24px var(--serif); color: var(--berry); }
.wstat span { font-size: 13px; color: var(--muted); }
/* goal reached: little gift boxes burst out of the card */
.burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 30; }
.burst i { position: absolute; left: -6px; top: -5px; width: 12px; height: 10px; border-radius: 2px; opacity: 0;
  background: var(--berry) linear-gradient(90deg, transparent 4.5px, var(--gold) 4.5px, var(--gold) 7.5px, transparent 7.5px);
  animation: pop 1s ease-out forwards; }
.burst i:nth-child(3n) { background-color: var(--pine); }
@keyframes pop {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.4); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(1) rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) { .burst { display: none; } }

/* Batch 3: the reveal. Presents unwrap one at a time. */
.presents { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; padding-top: 4px; }
.present { position: relative; min-height: 118px; border-radius: 10px; font: inherit; }
.present.wrapped { display: block; width: 100%; padding: 0; border: 0; cursor: pointer; background: none; color: #fff; }
.present .box { position: absolute; left: 8%; right: 8%; top: 30%; bottom: 0; border-radius: 6px;
  background: var(--berry) linear-gradient(90deg, transparent calc(50% - 7px), var(--gold) calc(50% - 7px), var(--gold) calc(50% + 7px), transparent calc(50% + 7px)); }
.present .lid { position: absolute; left: 2%; right: 2%; top: 18%; height: 18%; border-radius: 5px; z-index: 2; transform-origin: 20% 100%;
  background: var(--pine) linear-gradient(90deg, transparent calc(50% - 8px), var(--gold) calc(50% - 8px), var(--gold) calc(50% + 8px), transparent calc(50% + 8px)); transition: transform .5s ease, opacity .5s ease; }
.present .lid::before, .present .lid::after { content: ""; position: absolute; bottom: 100%; width: 26px; height: 18px; border: 3px solid #c99a3a; background: var(--gold); border-radius: 50% 50% 40% 40%; }
.present .lid::before { right: 50%; transform: rotate(18deg); }
.present .lid::after { left: 50%; transform: rotate(-18deg); }
.present .ptap { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 3; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.present.wrapped:hover .lid { transform: translateY(-3px) rotate(-3deg); }
.present.unwrapping .lid { transform: translateY(-40px) rotate(-28deg); opacity: 0; }
.present.unwrapping .box { transition: transform .5s ease .1s, opacity .5s ease .1s; transform: scale(.85); opacity: 0; }
.present.unwrapping .ptap { opacity: 0; }
.present.open { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 10px; text-align: center; background: var(--paper); border: 2px dashed var(--dash); }
.present.open .pnote { font-weight: 700; overflow-wrap: anywhere; }
.present.open .pfrom { font-family: var(--hand); font-weight: 600; font-size: 22px; line-height: 1.05; color: var(--berry); overflow-wrap: anywhere; }
.present.open .pprice { font-size: 13px; color: var(--muted); }
.present.just { animation: popin .45s ease-out; border-color: var(--gold); }
@keyframes popin { from { transform: scale(.85); opacity: .2; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .present .lid, .present .box { transition: none; }
  .present.just { animation: none; }
}

/* Batch 3: occasion looks. Christmas is the default above; the others swap the colors, the banner and the initials. */
body[data-occ="birthday"] {
  --paper: #fdf6ec; --card: #fffbf4; --line: #ecdcc4; --dash: #d6bf9c;
  --pine: #1f6f78; --pine-dark: #17545b; --berry: #d2456b; --gold: #f4b942; --mint: #e1f1ef; --muted: #6f6355;
}
body[data-occ="birthday"] .paper {
  background:
    radial-gradient(circle, #d2456b 2.4px, transparent 3px) 4px 6px / 34px 30px,
    radial-gradient(circle, #1f6f78 2.4px, transparent 3px) 20px 18px / 38px 26px,
    radial-gradient(circle, #f4b942 2.8px, transparent 3.4px) 12px 2px / 30px 34px,
    radial-gradient(circle, #7b5ea7 2.2px, transparent 2.8px) 26px 10px / 42px 28px,
    radial-gradient(5px 2px at 50% 50%, #f08a4b 90%, transparent 100%) 6px 20px / 46px 40px,
    radial-gradient(2px 5px at 50% 50%, #2fa39b 90%, transparent 100%) 30px 4px / 52px 36px,
    radial-gradient(4px 2px at 50% 50%, #d2456b 90%, transparent 100%) 16px 30px / 40px 44px,
    #fff3df; }
body[data-occ="birthday"] .paper::before, body[data-occ="birthday"] .paper .bow, body[data-occ="birthday"] .paper .knot { display: none; }
/* initials become balloons */
body[data-occ="birthday"] .orn { border-radius: 50% 50% 47% 47% / 56% 56% 44% 44%; margin-top: 0; margin-bottom: 6px; }
body[data-occ="birthday"] .orn::before { top: auto; bottom: -5px; width: 8px; height: 6px; background: var(--orn, var(--pine)); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

body[data-occ="wedding"] {
  --paper: #faf8f3; --card: #fffefb; --line: #e6e1d5; --dash: #cfc6b2;
  --pine: #4f6450; --pine-dark: #3d4f3e; --berry: #a8646c; --gold: #d8bf8a; --mint: #edf0e8; --muted: #6d6a5e;
  --serif: "Palatino Linotype", Palatino, Georgia, serif;
}
body[data-occ="wedding"] .paper {
  background:
    radial-gradient(circle at 50% 100%, #faf8f3 9px, transparent 9.5px) 0 100% / 22px 11px repeat-x,
    radial-gradient(circle, rgba(255,255,255,.55) 1.4px, transparent 2px) 0 0 / 14px 14px,
    repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 2px, transparent 2px 14px),
    #8fa38d; }
body[data-occ="wedding"] .paper::before { width: 6px; background: var(--gold); }
body[data-occ="wedding"] .orn { box-shadow: inset 0 0 0 3px var(--gold); }
body[data-occ="wedding"] .orn::before { display: none; }

body[data-occ="baby"] {
  --paper: #f6f8fa; --card: #fdfeff; --line: #dfe6ec; --dash: #bfcbd6;
  --pine: #3d6b88; --pine-dark: #2e5670; --berry: #d77d8f; --gold: #f2cf63; --mint: #e5f2f5; --muted: #5f6a74;
}
body[data-occ="baby"] .paper {
  background:
    radial-gradient(circle, rgba(255,255,255,.75) 1.6px, transparent 2.2px) 0 0 / 16px 16px,
    repeating-linear-gradient(90deg, #a9d3e6 0 18px, #f6c9d2 18px 36px, #fbe3a1 36px 54px, #bfe3d0 54px 72px); }
body[data-occ="baby"] .paper::before { background: #fff; width: 10px; }
body[data-occ="baby"] .paper .bow::before, body[data-occ="baby"] .paper .bow::after { background: #fff; border-color: #d9e4ec; }
body[data-occ="baby"] .paper .knot { background: #d9e4ec; }
body[data-occ="baby"] .orn::before { display: none; }

/* "Hide what others bought" switch on the board */
.hideswitch { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.hiddenline { margin: 2px 0 8px; }

/* Batch 2: whose list (parents managing a kid's list) */
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.seg button { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 7px 14px; border-radius: 99px; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
