:root {
  color-scheme: light;
  --canvas: #f7f5ef;
  --paper: #fffdfa;
  --ink: #20332b;
  --muted: #53665b;
  --line: #dedfd4;
  --pine: #173c30;
  --pine-hover: #225243;
  --wine: #8b3545;
  --sage: #e8eee4;
  --gold: #d7b27c;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 12px 30px #233c2b0b;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: var(--sans); font-size: 15px; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled, button[aria-disabled=true] { cursor: wait; opacity: .7; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #a55061; outline-offset: 3px;
}
[hidden] { display: none !important; }
svg.icon { width: 19px; height: 19px; flex: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1, h2, .brand { font-family: var(--serif); }
h2 { font-size: clamp(29px, 3.6vw, 39px); font-weight: 400; letter-spacing: -.035em; line-height: 1.12; }
h3 { font-weight: 700; font-size: 17px; }
.muted { color: var(--muted); line-height: 1.55; }
.small { font-size: 13px; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 10px 15px; transform: translateY(-160%); color: white; background: var(--pine); text-decoration: none; }
.skip:focus { transform: none; }
.wrapper { width: min(1112px, calc(100% - 64px)); margin-inline: auto; }
header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 23px; font-weight: 700; letter-spacing: -.06em; white-space: nowrap; text-decoration: none; }
.brand-mark { display: grid; width: 41px; height: 41px; flex: none; place-items: center; border-radius: 12px; color: #fff7e2; background: var(--pine); }
.brand-mark .icon { width: 22px; height: 22px; }
.nav { display: flex; align-items: center; gap: 5px; margin-inline: auto; }
.nav a { display: inline-flex; gap: 8px; align-items: center; padding: 9px 13px; min-height: 42px; white-space: nowrap; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: 14px; }
.nav a[aria-current] { color: var(--pine); background: var(--sage); }
.nav a:hover { background: #eef0e9; }
.account { position: relative; margin-left: auto; }
.account summary { max-width: 185px; list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--pine); font-weight: 650; border-radius: 8px; }
.account summary::-webkit-details-marker { display: none; }
.account summary > span:nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 50%; color: var(--wine); background: #f0e2e4; font-weight: 750; font-size: 14px; }
.account-menu { position: absolute; z-index: 4; right: 0; top: 46px; min-width: 206px; padding: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.account-menu button { display: flex; gap: 9px; width: 100%; padding: 10px; align-items: center; text-align: left; border: 0; border-radius: 7px; background: transparent; color: var(--ink); }
.account-menu button:hover { background: var(--sage); }

main.wrapper { padding-block: 34px 65px; min-height: calc(100vh - 74px); }
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: grid; align-content: center;
  min-height: 276px; padding: 37px 52px; border-radius: 20px; color: #fffaf0; background-color: var(--pine);
  background-image: linear-gradient(90deg, #10271de8 0%, #142d21d9 16%, #142c20ba 35%, #132c2180 46%, #172f2300 68%), url("/assets/noel.webp");
  background-position: center, center 56%; background-size: cover;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(38px, 5.3vw, 63px); line-height: 1.03; font-weight: 400; letter-spacing: -.055em; }
.hero h1 em, .auth-art h2 em { display: block; color: #f2d3a4; font-weight: 400; }
.hero p { max-width: 390px; margin-top: 15px; line-height: 1.5; color: #f5eee4; font-size: 15px; }
.hero--compact { min-height: 205px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 36px 0 17px; }
.section-head p { margin-top: 8px; }
.section-head--tight { margin-top: 0; }
.heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.count { font: 700 12px var(--sans); padding: 5px 9px; border-radius: 80px; background: var(--sage); color: var(--pine); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.btn { min-height: 43px; padding: 10px 15px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 14px; line-height: 1.3; text-decoration: none; }
.btn .icon { width: 17px; height: 17px; }
.btn--primary { color: #fffdf6; background: var(--pine); border-color: var(--pine); }
.btn--primary:hover { background: var(--pine-hover); border-color: var(--pine-hover); }
.btn--secondary { color: var(--pine); border-color: var(--line); background: var(--paper); }
.btn--secondary:hover { background: var(--sage); }
.btn--text { background: transparent; color: var(--pine); padding-inline: 8px; }
.btn--text:hover, .icon-btn:hover { background: var(--sage); }
.btn--danger { color: #fff; background: var(--wine); }
.btn--danger:hover { background: #722936; }
.icon-btn { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--pine); background: var(--paper); }
.icon-btn--danger { color: var(--wine); }
.icon-btn--danger:hover { background: #f6e8e9; }

.empty { background: var(--paper); text-align: center; border: 1px dashed #cbd4c8; border-radius: 15px; padding: 37px 18px; }
.empty-figure { margin: 0 auto 13px; display: grid; place-items: center; width: 53px; height: 53px; border-radius: 16px; background: var(--sage); color: var(--pine); }
.empty-figure .icon { width: 26px; height: 26px; }
.empty p { margin: 7px 0 0; }
.empty .btn { margin-top: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.gift { min-width: 0; display: flex; flex-direction: column; min-height: 185px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 3px 13px #233c2b06; }
.gift.is-taken { background: #efefea; border-color: #dbdcd4; box-shadow: none; }
.gift.is-taken .priority { background: #e2e3dc; color: #454f48; }
.gift.is-taken .priority-dot { background: #7a847c; }
.gift h3 { margin-top: 11px; line-height: 1.35; }
.gift p { margin-top: 7px; overflow-wrap: anywhere; white-space: pre-wrap; }
.gift-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 16px; }
.priority {
  --p-ink: #315343; --p-bg: #e9f0e7; --p-dot: #659077;
  display: inline-flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%; padding: 5px 9px;
  color: var(--p-ink); background: var(--p-bg); border-radius: 80px; font-size: 11px; font-weight: 770;
}
.priority[data-level="2"], .wish[data-level="2"] { --p-ink: #68460e; --p-bg: #f6ebd0; --p-dot: #b68029; }
.priority[data-level="3"], .wish[data-level="3"] { --p-ink: #873e4f; --p-bg: #f7e6ea; --p-dot: #c26b82; }
.priority[data-level="4"], .wish[data-level="4"] { --p-ink: #80303e; --p-bg: #f0d7dc; --p-dot: #932d41; }
.priority-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--p-dot); }
.gift-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.gift-links a { display: inline-flex; gap: 5px; align-items: center; max-width: 100%; padding: 5px 7px; border: 1px solid #dcded5; border-radius: 6px; color: var(--pine); text-decoration: none; font-size: 12px; }
.gift-links span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-links a:hover { background: var(--sage); }
.gift-links .icon { width: 13px; height: 13px; }
.reservation { display: flex; align-items: flex-start; gap: 8px; color: #38493e; font-size: 13px; line-height: 1.4; }
.reservation time { display: block; color: #536157; }
.reservation > .icon { margin-top: 1px; }
.gift-footer .btn { min-height: 39px; font-size: 13px; }
.section-head .back-link { justify-self: start; }

.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.person-tile { display: flex; gap: 12px; align-items: center; padding: 16px; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.person-tile:hover, .person-tile[aria-current] { border-color: #7b9b8a; background: #f0f3eb; }
.person-tile > div { min-width: 0; flex: 1; }
.person-tile strong { display: block; overflow-wrap: anywhere; }
.person-tile > .icon { color: var(--muted); }
.people-grid + .person-list { margin-top: 30px; min-height: 210px; }
.person-list-head { align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 15px; }

.access-grid { display: grid; grid-template-columns: minmax(225px, .75fr) minmax(0, 1.8fr); gap: 15px; }
.panel { min-width: 0; align-self: start; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 19px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-heading h3 { font-size: 18px; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 13px 0; border-top: 1px solid var(--line); }
.access-row:first-child { border-top: 0; }
.access-person { display: flex; align-items: center; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
.access-person .muted { display: block; }
.chip { display: inline-flex; background: var(--sage); color: var(--pine); padding: 3px 7px; border-radius: 20px; margin-top: 3px; font-size: 11px; font-weight: 650; }
.chip--pending { background: #f6ebd0; color: #68460e; }
.access-row .btn { min-height: 37px; }
.access-row .actions { justify-content: end; }

.dialog { width: min(570px, calc(100% - 24px)); max-height: min(85vh, 830px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); color: var(--ink); box-shadow: 0 25px 85px #152d2454; }
.dialog::backdrop { background: #10251c82; }
.dialog-inner { padding: 23px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; column-gap: 12px; margin-bottom: 17px; }
.dialog-head h2 { font-size: 30px; margin-top: 3px; }
.dialog .actions { justify-content: end; }
.stack { display: grid; gap: 15px; }
.field { display: grid; gap: 6px; line-height: 1.3; }
.field > span, legend { font-weight: 720; font-size: 14px; }
.field input, .field textarea, .link-input, .invite-value { width: 100%; min-width: 0; border: 1px solid #cbd2c8; border-radius: 8px; padding: 10px 11px; min-height: 44px; background: #fff; color: var(--ink); }
.field input::placeholder, .field textarea::placeholder, .link-input::placeholder { color: #69766d; }
.field textarea { resize: vertical; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
fieldset > legend { padding: 0; margin-bottom: 7px; }
.link-fields { display: grid; gap: 7px; }
.link-row { display: grid; grid-template-columns: 1fr 39px; align-items: center; gap: 8px; }
.option-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.wish { --p-ink: #315343; --p-bg: #e9f0e7; --p-dot: #659077; position: relative; text-align: center; }
.wish input { position: absolute; left: 50%; bottom: 1px; opacity: 0; }
.wish span:last-child { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 45px; border-radius: 8px; border: 1px solid transparent; background: var(--p-bg); color: var(--p-ink); cursor: pointer; padding: 5px 3px; font-size: 12px; font-weight: 710; }
.wish input:checked + span { border: 2px solid var(--p-ink); }
.wish input:focus-visible + span { outline: 3px solid var(--p-dot); outline-offset: 2px; }
.checks { display: grid; gap: 3px; }
.checks label { display: flex; align-items: center; gap: 8px; min-height: 33px; overflow-wrap: anywhere; cursor: pointer; }
.checks input { width: 17px; height: 17px; accent-color: var(--pine); flex: none; }
.form-error { color: #842b3c; background: #f7e8eb; border: 1px solid #efd6db; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.45; }
.toast { z-index: 30; position: fixed; right: 22px; bottom: 20px; max-width: min(375px, calc(100% - 44px)); padding: 13px 17px; border-radius: 10px; background: var(--pine); color: #fff; box-shadow: var(--shadow); font-size: 14px; }
.toast.is-error { background: var(--wine); }

.auth { min-height: 100vh; display: grid; width: min(1054px, calc(100% - 72px)); margin: auto; align-items: center; padding-block: 40px; }
.auth-frame { display: grid; grid-template-columns: 1.08fr 1fr; min-height: 585px; border-radius: 22px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-art {
  padding: 35px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
  color: #fff9ed; background-color: var(--pine);
  background-image: linear-gradient(180deg, #142c22ad 0%, #192e2300 39%, #122a2090 65%, #10251df5 100%), url("/assets/noel.webp");
  background-position: center, 76% center; background-size: cover;
}
.auth-art .brand { color: #fff7e6; }
.auth-art .brand-mark { background: #385445; }
.auth-art h2 { font-size: clamp(42px, 5vw, 67px); line-height: 1.03; }
.auth-panel { padding: 42px clamp(27px, 5vw, 65px); align-self: center; }
.auth-panel h1 { font-size: clamp(32px, 4vw, 45px); letter-spacing: -.045em; font-weight: 400; line-height: 1.08; }
.auth-panel > p { margin-top: 10px; }
.auth-panel form { margin-top: 25px; }
.auth-panel form > .btn { margin-top: 3px; }
.auth-panel > a { display: inline-block; margin-top: 18px; color: var(--pine); }
.auth-panel .field-hint { margin-top: -7px; }
.boot { display: grid; justify-items: center; gap: 15px; align-content: center; min-height: 75vh; }

@media (max-width: 860px) {
  .wrapper { width: calc(100% - 38px); }
  .header-inner { gap: 14px; }
  .nav a { padding-inline: 9px; }
  .account summary > span:nth-child(2) { display: none; }
  .cards, .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-inline: 34px; }
  .access-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 610px) {
  .wrapper { width: calc(100% - 28px); }
  .header-inner { min-height: 0; padding-block: 12px 8px; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
  .header-inner .brand { font-size: 21px; }
  .header-inner .brand-mark { width: 36px; height: 36px; }
  .nav { order: 3; width: 100%; margin: 0; gap: 2px; }
  .nav a { justify-content: center; flex: 1; gap: 5px; padding: 7px 4px; font-size: clamp(11px, 3.3vw, 13px); }
  .nav .icon { width: 15px; height: 15px; }
  .account summary > span:nth-child(2) { display: inline; max-width: 91px; }
  main.wrapper { padding-block: 16px 40px; }
  .hero { min-height: 239px; padding: 26px 19px; border-radius: 14px; background-position: center, 62% center; background-image: linear-gradient(90deg, #10251def 0%, #132b20c2 48%, #172f2344 100%), url("/assets/noel.webp"); }
  .hero--compact { min-height: 172px; }
  .hero p { width: min(260px, 92%); margin-top: 11px; font-size: 14px; }
  .section-head { margin: 27px 0 13px; gap: 9px; }
  .section-head--tight { margin-top: 0; }
  .section-head .btn { max-width: 165px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gift { min-height: 140px; padding: 15px; }
  .person-tile { padding: 11px 9px; gap: 7px; }
  .person-tile .avatar { height: 29px; width: 29px; font-size: 12px; }
  .person-tile > .icon { width: 14px; }
  .auth { width: calc(100% - 26px); padding-block: 13px; }
  .auth-frame { grid-template-columns: 1fr; min-height: initial; border-radius: 16px; }
  .auth-art { min-height: 250px; padding: 20px; justify-content: space-between; background-position: center, 70% 59%; }
  .auth-art h2 { font-size: 39px; }
  .auth-panel { padding: 25px 20px 29px; }
  .dialog-inner { padding: 17px; }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
