:root {
    color-scheme: dark;
    --paper: #0b110f;
    --surface: #151e19;
    --ink: #f6ead6;
    --muted: #c6bda9;
    --line: #b8a27f35;
    --pine: #d6c3a0;
    --pine-light: #233128;
    --berry: #8c303e;
    --berry-dark: #aa4352;
    --rose: #412529;
    --rose-ink: #ffd5cc;
    --cream: #fff5e2;
    --serif: Georgia, "Times New Roman", serif;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; }
a { color: var(--pine); }
form, h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1, h2 { font: 400 2rem/1.1 var(--serif); letter-spacing: -.032em; }
h3 { font-size: 1rem; line-height: 1.35; }
section[id], div[id] { scroll-margin-top: 1rem; }
:focus-visible { outline: 2px solid #e5b878; outline-offset: 4px; }

.shell { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.masthead { background: #0b110fd9; border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 4.55rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font: 700 1.2rem/1.12 var(--serif); text-decoration: none; overflow-wrap: anywhere; }
.brand-mark { width: 2.45rem; height: 2.45rem; flex: 0 0 2.45rem; display: grid; place-items: center; border: 1px solid var(--line); color: #edc58e; border-radius: .65rem; }
.navigation { flex-shrink: 0; }
.navigation a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .35rem .73rem; border-radius: .55rem; text-decoration: none; color: var(--pine); font-size: .9rem; font-weight: 650; white-space: nowrap; }
.navigation a:hover { background: var(--pine-light); }
.skip { position: absolute; top: .3rem; left: .4rem; transform: translateY(-200%); background: var(--surface); padding: .6rem; z-index: 1; }
.skip:focus { transform: translateY(0); }
.main { padding-block: clamp(1.2rem, 3.3vw, 2.75rem) 3rem; }

.eyebrow { color: var(--pine); font-size: .875rem; line-height: 1.35; letter-spacing: .105em; text-transform: uppercase; font-weight: 700; }
.eyebrow span { margin-right: .28em; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.content-panel { padding: clamp(1.15rem, 3vw, 1.8rem); }
.content-panel h2 { margin-block: .6rem .55rem; }
.content-panel > p { color: var(--muted); max-width: 42ch; }
.card-mark { display: inline-grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: .7rem; }
.card-mark.rose { color: var(--rose-ink); background: var(--rose); }
.card-mark.pine { color: var(--pine); background: var(--pine-light); }
.footer { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .2rem 1rem; border-top: 1px solid var(--line); padding-block: .9rem 1.3rem; color: var(--muted); font-size: .875rem; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 0 .9rem; }

.button, .text-button, input, textarea, select { font: inherit; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .55rem; min-height: 2.8rem; width: fit-content; padding: .63rem 1rem; text-align: center; font-size: .925rem; font-weight: 680; text-decoration: none; border: 1px solid transparent; border-radius: .55rem; cursor: pointer; }
.button.primary { background: var(--berry); color: #fffdfa; }
.button.primary:hover { background: var(--berry-dark); }
.button.secondary { background: var(--surface); color: var(--pine); border-color: var(--line); }
.button.secondary:hover { background: var(--pine-light); }
.button:disabled { opacity: .58; cursor: default; }
.button.compact { padding-inline: .75rem; min-height: 2.65rem; }
.text-button { display: inline-flex; align-items: center; min-height: 2.55rem; border: 0; background: transparent; padding: 0; color: var(--pine); font-weight: 600; font-size: .875rem; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.text-button:hover { text-decoration-thickness: 2px; }
.text-button.danger { color: var(--rose-ink); }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.muted { color: var(--muted); }
small { font-size: .875rem; }
.notice { border-radius: .65rem; padding: .65rem .9rem; margin-bottom: 1rem; background: var(--pine-light); color: var(--pine); }
.notice.error { color: var(--rose-ink); background: var(--rose); }

.page-heading { margin-bottom: 1.55rem; }
.page-heading h1, .entry h1 { font-size: clamp(2.65rem, 7vw, 4.5rem); margin-block: .27rem .5rem; }
.page-heading > p:last-child, .entry > p { color: var(--muted); font-size: 1.05rem; }
.entry { max-width: 32rem; margin: clamp(0rem, 4vw, 2rem) auto 1rem; padding: clamp(1.3rem, 5vw, 2.35rem); }
.entry h1 { font-size: clamp(2.3rem, 5.5vw, 3.1rem); margin-top: .7rem; }
.entry form, .entry > .button { margin-top: 1.15rem; }
.stack { display: flex; flex-direction: column; gap: .36rem; min-width: 0; }
.stack > label:not(:first-child) { margin-top: .52rem; }
.stack > .button, .stack > .button-row { margin-top: .58rem; }
label:not(.check) { font-size: .925rem; font-weight: 650; }
label small { color: var(--muted); font-weight: 400; margin-left: .25rem; }
input:not([type=checkbox]), textarea, select { color: var(--ink); min-width: 0; width: 100%; min-height: 2.8rem; border: 1px solid #9f8c6b76; border-radius: .5rem; background: var(--paper); padding: .57rem .66rem; }
input::placeholder, textarea::placeholder { color: #b3aa95; }
input[readonly] { background: var(--paper); }
textarea { resize: vertical; }
select {
    appearance: none;
    padding-right: 1.75rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--pine) 50%), linear-gradient(135deg, var(--pine) 50%, transparent 50%);
    background-position: right .95rem center, right .64rem center;
    background-size: .32rem .32rem;
    background-repeat: no-repeat;
}
.check { display: flex; align-items: center; gap: .58rem; min-height: 2.75rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin: 0; flex: 0 0 auto; accent-color: var(--pine); }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.inline-fields input:not([type=checkbox]) { width: auto; flex: 1 1 10rem; }
.fine-details, .person-details { margin-top: .45rem; }
summary { color: var(--pine); font-size: .925rem; font-weight: 650; cursor: pointer; }
.fine-details summary { padding: .6rem 0 .42rem; }
.person-details summary { padding: .35rem 0 .47rem; }

.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem; margin-bottom: .7rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; border-radius: 1.25rem; padding: .23rem .62rem; background: var(--pine-light); color: var(--pine); font-size: .82rem; font-weight: 650; }
.pill-live { background: var(--pine); color: var(--paper); }
.favourite { color: #f1cd95; background: #392d20; margin-bottom: .3rem; }
.wishlist-layout { display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1.3fr); gap: 1rem; align-items: start; }
.gift-list { display: grid; gap: .7rem; }
.gift-card { display: grid; grid-template-columns: clamp(4rem, 9vw, 7rem) minmax(0, 1fr); align-items: start; gap: .8rem; padding: .75rem; }
.gift-image { display: grid; place-content: center; width: 100%; height: auto; aspect-ratio: 1; border-radius: .55rem; object-fit: cover; }
.gift-image.placeholder { background: var(--rose); color: var(--rose-ink); }
.gift-text { overflow-wrap: anywhere; }
.gift-text p { margin-top: .25rem; color: var(--muted); }
.gift-text .price { font-weight: 700; color: var(--pine); }
.price small { font-weight: 400; color: var(--muted); }
.gift-description { line-height: 1.5; }
.gift-description.is-collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 3em;
    overflow: hidden;
}
.gift-text .gift-note { color: var(--ink); }
.shop-link { display: inline-flex; align-items: center; min-height: 2.5rem; font-size: .925rem; font-weight: 650; text-underline-offset: .2em; }
.gift-card .text-button { min-height: 2.75rem; }
.remove-gift { margin-top: .55rem; }
.empty { padding: 1.2rem; color: var(--muted); }

.admin-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.summary-card { display: grid; gap: .2rem; padding: .75rem clamp(.55rem, 3vw, 1.35rem); color: var(--muted); font-size: .9rem; }
.summary-card strong { font: 400 clamp(1.7rem, 3.7vw, 2.45rem)/1.1 var(--serif); color: var(--pine); }
.admin-grid > section > p, .draw-panel > form, .draw-panel > button, .draw-panel > small { margin-top: .65rem; }
.invite-panel { background: var(--pine-light); }
.invite-panel .inline-fields { margin-top: .7rem; }
.copy-status:empty { display: none; }
.people { list-style: none; padding: 0; margin: .65rem 0 0; }
.people > li { border-top: 1px solid var(--line); padding: .6rem 0; }
.people > li:last-child { padding-bottom: 0; }
.person-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem .7rem; align-items: center; overflow-wrap: anywhere; }
.person-details form { margin-top: .35rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.exclusion-list > li { padding: .25rem 0; }

.icon { display: inline-block; position: relative; width: 1.12rem; height: 1.12rem; flex: 0 0 1.12rem; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon-gift { margin-top: .2rem; border: 1.5px solid currentColor; height: .8rem; background: linear-gradient(90deg, transparent calc(50% - .7px), currentColor calc(50% - .7px), currentColor calc(50% + .7px), transparent calc(50% + .7px)); }
.icon-gift::before, .icon-gift::after { width: .36rem; height: .32rem; top: -.37rem; border: 1.5px solid currentColor; }
.icon-gift::before { right: 50%; border-radius: 65% 80% 0 55%; }
.icon-gift::after { left: 50%; border-radius: 80% 65% 55% 0; }
.icon-calendar { height: .95rem; border: 1.5px solid currentColor; border-radius: .14rem; }
.icon-calendar::before { inset: .23rem 0 auto; border-top: 1.5px solid currentColor; }
.icon-calendar::after { inset: -.23rem .19rem auto; height: .37rem; border-inline: 1.5px solid currentColor; }
.icon-lock { width: .95rem; height: .71rem; margin-top: .31rem; border: 1.5px solid currentColor; border-radius: .17rem; }
.icon-lock::before { inset: -.42rem .15rem auto; height: .4rem; border: 1.5px solid currentColor; border-bottom: 0; border-radius: .35rem .35rem 0 0; }
.icon-lock::after { inset: 40% auto auto 45%; width: .15rem; height: .18rem; background: currentColor; }
.icon-list { width: .92rem; height: 1.08rem; border: 1.5px solid currentColor; border-radius: .15rem; }
.icon-list::before { inset: .24rem .14rem auto; height: .36rem; border-block: 1.5px solid currentColor; }

@media (max-width: 760px) {
    .shell { width: min(100% - 2rem, 72rem); }
}

@media (max-width: 560px) {
    .masthead-inner { min-height: 4rem; padding-block: .6rem; gap: .5rem; }
    .navigation a { padding-inline: .52rem; }
    .admin-grid, .wishlist-layout { grid-template-columns: minmax(0, 1fr); }
    .admin-grid { gap: .7rem; margin-top: .7rem; }
}
