:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --surface: #fffdf8;
  --ink: #242a23;
  --muted: #62675b;
  --line: #e1e0d4;
  --pine: #1d4939;
  --pine-deep: #14392b;
  --holly: #a23442;
  --leaf: #e7eee4;
  --gold: #e7bc71;
  --nav-inset: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding-bottom: calc(92px + var(--nav-inset)); }
.wrap { width: min(100%, 704px); padding-inline: 24px; margin-inline: auto; }
.site-head { padding-top: 16px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.brand { display: flex; align-items: baseline; gap: 6px; margin: 0; color: var(--pine-deep); font: 400 clamp(1.45rem, 5vw, 1.95rem)/1.14 Georgia, serif; letter-spacing: -.035em; }
.brand-dot { flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--holly); }
.account { font-size: .82rem; color: var(--muted); }
.account label { display: flex; align-items: center; gap: 6px; }
.account select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-height: 36px; min-width: 0; }
.profile { display: flex; align-items: center; gap: 8px; }
.profile-text { display: grid; min-width: 0; }
.profile-text span, .profile-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 144px; }
.profile-text span { font-weight: 650; color: var(--ink); }
.garland { display: flex; justify-content: space-around; align-items: flex-start; margin: 4px 0 20px; height: 12px; border-top: 1px solid #c9cab9; }
.garland span { width: 6px; height: 7px; border-radius: 2px 2px 50% 50%; background: var(--holly); transform: rotate(-12deg); }
.garland span:nth-child(2n) { background: #4a7158; transform: rotate(10deg); }
.garland span:nth-child(3n) { background: #bf8a37; }
@media (prefers-reduced-motion: no-preference) {
  .seat-enter .avatar { animation: sit .24s ease-out both; }
  @keyframes sit { from { opacity: 0; transform: translateY(4px); } }
}
h2, h3, p { margin: 0; }
h2 { font: 400 clamp(1.82rem, 6vw, 2.45rem)/1.1 Georgia, serif; color: var(--pine-deep); letter-spacing: -.035em; }
h3 { font-size: 1.13rem; line-height: 1.25; letter-spacing: -.016em; overflow-wrap: anywhere; }
p { line-height: 1.5; overflow-wrap: anywhere; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.section-head p { margin-top: 4px; color: var(--muted); font-size: .92rem; }
button, input, textarea { font: inherit; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 8px; font-size: .88rem; font-weight: 650; cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--holly); outline-offset: 3px; }
.primary { background: var(--pine); color: #fff; border: 1px solid var(--pine); }
.primary:hover:not(:disabled) { background: var(--pine-deep); }
.secondary, .room-button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.secondary:hover:not(:disabled), .room-button:hover { background: #f1f0e7; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plus { width: 12px; height: 12px; display: inline-grid; place-items: center; }
.plus::before, .plus::after { content: ""; grid-area: 1 / 1; border-radius: 1px; background: currentColor; width: 12px; height: 1.5px; }
.plus::after { transform: rotate(90deg); }
.tabs { position: fixed; z-index: 4; inset: auto 0 0; padding-bottom: var(--nav-inset); background: var(--surface); border-top: 1px solid var(--line); }
.tabs-inner { width: min(100%, 560px); margin-inline: auto; display: grid; grid-template-columns: 1fr 1fr; padding: 4px 16px; }
.tabs button { display: grid; justify-items: center; gap: 4px; align-content: center; border: 0; background: transparent; color: var(--muted); min-height: 56px; font-size: .78rem; }
.tabs button[aria-current] { color: var(--pine-deep); background: var(--leaf); }
.nav-icon { width: 20px; height: 20px; position: relative; display: block; }
.nav-gift::before { content: ""; position: absolute; inset: 7px 2px 1px; border: 1.5px solid currentColor; border-radius: 2px; }
.nav-gift::after { content: ""; position: absolute; top: 8px; bottom: 2px; border-left: 1.5px solid currentColor; left: 9px; }
.nav-gift i::before, .nav-gift i::after { content: ""; position: absolute; top: 2px; width: 5px; height: 5px; border: 1.5px solid currentColor; }
.nav-gift i::before { right: 10px; border-radius: 50% 50% 0 50%; transform: rotate(14deg); }
.nav-gift i::after { left: 10px; border-radius: 50% 50% 50% 0; transform: rotate(-14deg); }
.nav-rooms::before { content: ""; position: absolute; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 50%; inset: 5px; }
.nav-rooms i { position: absolute; inset: 0; }
.nav-rooms i::before, .nav-rooms i::after { content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%; background: currentColor; left: 9px; top: 0; box-shadow: 0 17px currentColor; }
.nav-rooms i::after { transform: rotate(90deg); transform-origin: 1px 10px; }
.panel, .empty { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }
.empty { padding: 24px 16px; grid-column: 1 / -1; }
.empty strong { font-weight: 650; }
.empty p { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.gift-grid { display: grid; gap: 8px; }
.gift { display: flex; overflow: hidden; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.gift-img { display: block; width: 112px; aspect-ratio: 1; object-fit: cover; align-self: start; background: var(--paper); margin: 12px 0 12px 12px; border-radius: 6px; }
.gift-body { min-width: 0; padding: 12px 16px; flex: 1; }
.gift-body p { margin-top: 4px; color: var(--muted); white-space: pre-wrap; font-size: .9rem; }
.gift-price { display: block; margin-top: 8px; color: var(--pine-deep); font-weight: 650; font-variant-numeric: tabular-nums; }
.gift-body .actions { margin-top: 8px; }
.gift-body button { min-height: 36px; }
a { color: var(--pine-deep); font-weight: 600; }
.gift-body a { padding: 8px 2px; font-size: .88rem; }
.invite { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; gap: 12px; margin-bottom: 12px; }
.room-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.room-list .empty { width: 100%; }
.room-button { display: block; overflow: hidden; max-width: min(100%, 224px); white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.room-button[aria-pressed="true"] { background: var(--leaf); color: var(--pine-deep); border-color: #a6b5a1; }
.room-panel { padding: 16px; }
.room-head { display: flex; gap: 8px 16px; flex-wrap: wrap; justify-content: space-between; align-items: start; }
.room-heading { flex: 1 1 120px; min-width: 0; }
.room-head h3 { font: 400 clamp(1.45rem, 5vw, 1.85rem)/1.12 Georgia, serif; color: var(--pine-deep); }
.room-head p, .muted { color: var(--muted); font-size: .86rem; }
.room-head p { margin-top: 4px; font-variant-numeric: tabular-nums; }
.budget { padding-left: 12px; border-left: 2px solid #b28746; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.budget span { color: var(--muted); font-size: .72rem; }
.budget strong { font-size: .97rem; font-weight: 650; }
.table-scene { position: relative; width: min(100%, 308px); height: auto; aspect-ratio: 1.08; margin: 8px auto 12px; isolation: isolate; }
.table-wood { position: absolute; display: grid; place-items: center; width: 63%; aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 6px solid #244d3e; border-radius: 50%; background: #235640; box-shadow: 0 0 0 1px #153c2e, 0 5px 0 #173e30; color: #fff9e9; }
.table-wood::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px dashed #8d9d71; opacity: .72; }
.table-center { display: grid; justify-items: center; gap: 10px; z-index: 1; }
.table-center span { font-size: .75rem; font-weight: 600; }
.present { position: relative; width: 36px; height: 28px; margin-top: 10px; border-radius: 3px; background: #b8424d; box-shadow: inset 0 -4px #96303d, 0 2px #153b2d; }
.present::before { content: ""; position: absolute; left: -2px; right: -2px; top: 0; height: 8px; border-radius: 2px; background: #cb6269; }
.present::after { content: ""; position: absolute; top: 0; bottom: 0; left: 15px; width: 6px; background: #efca86; }
.present i::before, .present i::after { content: ""; position: absolute; width: 9px; height: 7px; bottom: 100%; border: 2px solid #efca86; }
.present i::before { right: 50%; border-radius: 50% 50% 0 50%; transform: rotate(10deg); }
.present i::after { left: 50%; border-radius: 50% 50% 50% 0; transform: rotate(-10deg); }
.table-seats { position: absolute; inset: 0; }
.seat { position: absolute; transform: translate(-50%, -21px); left: var(--x); top: var(--y); display: grid; justify-items: center; gap: 3px; width: 66px; }
.seat-name { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .74rem; font-weight: 650; line-height: 1.35; padding-inline: 5px; border-radius: 4px; background: var(--surface); }
.avatar { position: relative; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; background: #e2e8d8; color: #254534; width: 34px; height: 34px; flex: 0 0 auto; font-size: .72rem; font-weight: 700; }
.avatar.tone-1 { background: #f1dadd; color: #762d36; }
.avatar.tone-2 { background: #f4e4c2; color: #6e4c20; }
.avatar.tone-3 { background: #dce8e8; color: #2d5252; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.avatar img.loaded { opacity: 1; }
.seat .avatar { width: 42px; height: 42px; font-size: .82rem; border: 2px solid var(--surface); box-shadow: 0 0 0 1px #c1c8b6; }
.room-invites { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.room-code { font-family: "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .075em; color: var(--muted); font-size: .78rem; }
.share-status, .share-manual { flex: 0 0 100%; color: var(--pine-deep); font-size: .82rem; }
.share-manual input { width: 100%; margin-top: 4px; }
.draw-controls { margin-top: 16px; }
#draw { margin-top: 8px; }
.room-roster { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 8px; }
.room-roster summary { cursor: pointer; width: fit-content; padding: 8px 0; color: var(--pine-deep); font-size: .88rem; font-weight: 650; }
.members { display: grid; margin: 4px 0 0; padding: 0; list-style: none; max-height: 264px; overflow: auto; }
.member { display: flex; align-items: center; min-width: 0; gap: 8px; padding: 6px 3px; }
.member > span:last-child { display: grid; min-width: 0; }
.member strong { font-weight: 650; overflow-wrap: anywhere; font-size: .88rem; }
.member small, .result small { font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }
.icon-button { width: 44px; min-width: 44px; padding: 0; }
.icon-button .plus { width: 16px; height: 16px; }
.icon-button .plus::before, .icon-button .plus::after { width: 16px; }
.result { margin: 14px 0 4px; padding: 10px 12px 12px; background: var(--leaf); border-left: 2px solid var(--pine); border-radius: 8px; scroll-margin-top: 16px; }
.result p { color: var(--pine-deep); font-size: .75rem; font-weight: 650; }
.recipient-button { display: flex; justify-content: flex-start; width: 100%; padding: 7px 0 0; border: 0; background: transparent; color: var(--ink); text-align: start; }
.recipient-text { display: grid; min-width: 0; flex: 1; }
.recipient-text strong { overflow-wrap: anywhere; font-size: .94rem; }
.recipient-text small { color: var(--muted); overflow-wrap: anywhere; }
.recipient-link { flex: 0 0 auto; color: var(--pine-deep); font-size: .76rem; }
.recipient-link span { padding-inline-start: 2px; font-size: 1.1rem; }
.back-button { background: none; border: 0; padding-inline: 0; color: var(--pine-deep); }
.back-button span { font-size: 1.4rem; }
.recipient-profile { justify-content: flex-start; flex-wrap: nowrap; }
.recipient-profile .avatar { width: 48px; height: 48px; }
.recipient-profile > div { min-width: 0; }
.recipient-profile h2 { overflow-wrap: anywhere; }
.dialog-actions { margin-top: 8px; }
.wishlist-share-body { display: grid; gap: 12px; }
.wishlist-share-body #wishlist-share-create { justify-self: start; }
.quiet-danger { padding-inline: 0; background: none; border: 0; color: #832d39; font-size: .82rem; }
.confirm-danger { background: #953645; border-color: #953645; }
.confirm-danger:hover:not(:disabled) { background: #742b35; }
.notice { margin-bottom: 12px; padding: 8px 12px; background: var(--leaf); color: var(--pine-deep); border-radius: 8px; font-size: .9rem; }
.notice.error, .form-error { background: #f6e5e7; color: #742b35; }
dialog { width: min(92vw, 432px); border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface); color: var(--ink); max-height: 90dvh; }
dialog::backdrop { background: #22261c70; }
dialog form { display: grid; gap: 12px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dialog-head h2 { font-size: 1.65rem; }
.dialog-head button { border: 0; color: var(--ink); background: transparent; font-size: 1.45rem; }
dialog label { display: grid; gap: 4px; font-size: .88rem; font-weight: 650; }
dialog label small { color: var(--muted); font-weight: 400; margin-left: 4px; }
input, textarea { width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 1rem; }
.form-error { padding: 8px; border-radius: 8px; font-size: .85rem; }
@media (max-width: 480px) {
  .wrap { padding-inline: 16px; }
  .site-head { padding-top: 8px; }
  .profile-text span, .profile-text small { max-width: min(26vw, 128px); }
  .gift-img { width: 68px; }
  .room-panel { padding: 12px; }
}
@media (max-width: 340px) {
  .seat { width: 54px; }
  .room-section-head { gap: 8px; }
  .room-section-head button { padding-inline: 8px; }
}
