:root {
  color-scheme: light;
  --ink: #222a25;
  --muted: #58635b;
  --accent: #244d39;
  --accent-dark: #193b2b;
  --line: #dce3dd;
  --paper: #fff;
  --background: #f6f8f5;
  --mint: #e8f0e8;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.55rem, 6vw, 4.7rem); font-weight: 400; letter-spacing: -.055em; line-height: 1.02; }
h2 { font-size: 1.4rem; letter-spacing: -.035em; }
h3 { font-size: 1.13rem; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, textarea, select { font: inherit; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #aa5d39; outline-offset: 3px; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner, .shell { width: min(1140px, 100% - 3rem); margin: auto; }
.top-inner { min-height: 76px; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-family: Georgia, serif; font-size: 1.45rem; letter-spacing: -.045em; font-weight: bold; text-decoration: none; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .65rem; background: var(--accent); color: white; font: 1.3rem system-ui, sans-serif; }
.top-inner nav { display: flex; gap: 1.25rem; align-self: stretch; }
.top-inner nav a { display: grid; align-items: center; border-bottom: 2px solid transparent; text-decoration: none; font-weight: 650; font-size: .93rem; }
.top-inner nav a[aria-current] { border-color: var(--accent); }
.account { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.account-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.shell { padding: 2rem 0 4rem; }
.page-hero { min-height: 210px; padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.4rem; border-radius: 1.2rem; background: #e3ede3; color: var(--accent-dark); }
.page-hero p, .welcome p { margin-top: .85rem; line-height: 1.5; }
.primary, .secondary, .quiet { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border: 1px solid transparent; border-radius: .55rem; padding: .55rem .85rem; text-decoration: none; cursor: pointer; font-size: .9rem; font-weight: 700; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: var(--mint); color: var(--accent-dark); }
.secondary:hover, .quiet:hover { background: #dce9de; }
.quiet { color: var(--accent); background: transparent; }
.danger { color: #8b362b; }
.dashboard { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.5rem; margin-top: 1.5rem; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: .9rem; }
.members { padding: 1rem; }
.members h2 { font-size: 1rem; margin: .25rem .4rem .7rem; }
.members nav { display: grid; gap: .25rem; }
.members a { display: flex; align-items: center; gap: .65rem; border-radius: .55rem; padding: .5rem; text-decoration: none; overflow-wrap: anywhere; }
.members a:hover, .members a[aria-current] { background: var(--mint); }
.members a[aria-current] { font-weight: 700; }
.initial { background: #f3e6dc; color: #75452f; width: 2rem; height: 2rem; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; font-weight: 750; }
.section-heading { display: flex; align-items: baseline; gap: .7rem; justify-content: space-between; margin: .45rem 0 1rem; overflow-wrap: anywhere; }
.section-heading span, small, .description { color: var(--muted); }
.section-heading span { white-space: nowrap; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: .85rem; }
.gift { padding: 1.15rem; display: flex; flex-direction: column; gap: .65rem; overflow-wrap: anywhere; }
.gift-top, .gift-meta, .actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.gift-top { justify-content: space-between; }
.gift-thumbnail { width: 64px; height: 64px; object-fit: contain; background: var(--background); border-radius: .45rem; }
.gift-symbol { color: #794727; background: #f4e9df; padding: .35rem .65rem; border-radius: .45rem; }
.badge { background: var(--mint); color: var(--accent-dark); font-size: .85rem; padding: .32rem .6rem; border-radius: 1rem; }
.taken { background: #f4e9df; color: #75452f; }
.description { line-height: 1.55; white-space: pre-wrap; }
.gift-meta { margin-top: auto; justify-content: space-between; padding-top: .35rem; }
.actions { border-top: 1px solid var(--line); padding-top: .6rem; }
.empty { text-align: center; padding: 3rem 1rem; }
.empty h3 { margin: .7rem 0 .35rem; }
.editor { max-width: 580px; margin: auto; padding: clamp(1.25rem, 4vw, 2.75rem); }
.editor h1 { margin: .9rem 0 1.5rem; font-size: clamp(2.2rem, 6vw, 3.5rem); }
.fields { display: grid; gap: 1rem; }
.fields label { display: grid; gap: .35rem; align-content: start; font-weight: 650; min-width: 0; }
.fields label small { font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid #aab9ae; border-radius: .45rem; padding: .65rem .75rem; background: #fbfcfa; color: var(--ink); }
textarea { resize: vertical; }
.delete-form { margin-top: .75rem; }
.owned-form { grid-template-columns: 1fr 1fr auto; align-items: end; padding: 1rem; margin-bottom: 1rem; }
.category { padding: 1rem; margin-bottom: .85rem; overflow-wrap: anywhere; }
.move-dialog { width: min(435px, 100% - 2rem); padding: 1.4rem; color: var(--ink); }
.move-dialog::backdrop { background: rgb(24 39 30 / 48%); }
.move-dialog h2 { margin-bottom: 1rem; }
.move-dialog [hidden] { display: none; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.category summary { cursor: pointer; font-size: 1.13rem; font-weight: 700; }
.category ul { list-style: none; margin: .65rem 0 0; padding: 0; }
.category li { display: flex; gap: .5rem; justify-content: space-between; align-items: center; min-height: 50px; border-top: 1px solid var(--line); }
.notice { background: #f8e9e4; color: #792c21; border: 1px solid #e7bcaf; border-radius: .6rem; padding: .8rem 1rem; margin-bottom: 1rem; }
.auth-layout { padding-top: clamp(2rem, 10vh, 6rem); }
.auth-grid { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 940px; margin: auto; border-radius: 1.2rem; overflow: hidden; border: 1px solid var(--line); }
.welcome { background: #e3ede3; display: grid; align-content: center; justify-items: start; min-height: 465px; padding: clamp(1.5rem, 5vw, 3.5rem); color: var(--accent-dark); }
.welcome h1 { margin-top: 1.7rem; }
.auth-panel { display: grid; align-content: center; border: none; border-radius: 0; padding: clamp(1.5rem, 5vw, 3.5rem); }
.auth-panel h2 { margin-bottom: 1.35rem; font-size: 1.75rem; }
.auth-switch { margin-top: 1rem; line-height: 1.5; }
.parcel { position: relative; width: 125px; height: 113px; transform: rotate(-9deg); }
.parcel i { position: absolute; inset: 28px 8px 0; border-radius: 8px; background: linear-gradient(90deg, #ac5844 41%, #f5d393 41% 59%, #ac5844 59%); }
.parcel b { position: absolute; inset: 22px 0 auto; height: 22px; border-radius: 6px; background: linear-gradient(90deg, #c77860 42%, #f9dfa9 42% 58%, #c77860 58%); }
.parcel b::before, .parcel b::after { content: ""; position: absolute; bottom: 100%; width: 29px; height: 18px; border: 5px solid #c69348; border-radius: 80% 80% 8% 80%; left: 27px; transform: rotate(12deg); }
.parcel b::after { left: auto; right: 27px; transform: scaleX(-1) rotate(12deg); }
.parcel span { position: absolute; font-size: 1.9rem; color: #9c6233; right: -28px; top: 0; }
@media (max-width: 720px) {
  .top-inner, .shell { width: calc(100% - 2rem); }
  .top-inner { gap: .25rem .8rem; flex-wrap: wrap; padding-top: .55rem; }
  .top-inner nav { order: 1; width: 100%; min-height: 42px; }
  .account-name { display: none; }
  .dashboard, .auth-grid { grid-template-columns: minmax(0, 1fr); }
  .members nav { display: flex; flex-wrap: wrap; }
  .owned-form { grid-template-columns: 1fr; }
  .welcome { min-height: auto; }
  .welcome h1 { margin-top: 1rem; }
}
