:root {
  color-scheme: light;
  --page: #f9f8fc;
  --surface: #fff;
  --ink: #24183d;
  --muted: #655c74;
  --purple: #6037c1;
  --violet: #512ca7;
  --line: #e9e4f1;
  --tint: #f1eaff;
  --mint: #e5f6ec;
  --green: #226446;
  font-family: Inter, "Aptos", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--violet); }
:focus-visible { outline: 3px solid #8860dd; outline-offset: 3px; }
[hidden] { display: none !important; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.nav, main { max-width: 1216px; margin: auto; padding-inline: 36px; }
.nav { display: flex; justify-content: space-between; align-items: center; min-height: 74px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 0; color: var(--ink); text-decoration: none; font-size: 1.26rem; font-weight: 800; letter-spacing: -.065em; white-space: nowrap; }
.brand > span:last-child { color: var(--purple); }
.brand-mark { width: 38px; height: 38px; margin-right: 10px; border-radius: 12px; background: var(--purple); display: grid; place-items: center; }
.brand-mark i { width: 16px; height: 12px; border: 1.6px solid white; border-radius: 2px; position: relative; margin-top: 4px; background: linear-gradient(to right, transparent 44%, white 44% 56%, transparent 56%); }
.brand-mark i::before { content: ""; position: absolute; width: 19px; height: 5px; border: 1.6px solid white; border-radius: 2px; top: -4px; left: -3px; }
.brand-mark i::after { content: "∞"; position: absolute; font: bold 15px/1 system-ui; top: -14px; left: 1px; color: #fff; }
.nav-actions, .tools, .card-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; white-space: nowrap; font-size: .875rem; font-weight: 700; line-height: 1.2; }
.btn.primary { background: var(--purple); color: white; box-shadow: 0 2px 3px #32147715; }
.btn.primary:hover { background: var(--violet); }
.btn.secondary { color: var(--violet); background: white; border-color: #ded3f2; }
.btn.secondary:hover, .btn.soft:hover { background: #eae0fe; }
.btn.soft { color: var(--violet); background: var(--tint); }
.btn.text { color: var(--muted); background: transparent; }
.btn.text:hover { color: var(--violet); background: var(--tint); }
.btn:disabled { opacity: .55; cursor: wait; }
main { min-height: calc(100vh - 75px); padding-block: 35px 60px; }
.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 292px; border-radius: 22px; overflow: hidden; background: #ece5ff; }
.hero::before { content: ""; position: absolute; z-index: -2; inset: 0 0 0 39%; background: url('/gift-hero.webp') center 54% / cover no-repeat; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #ece5ff 37%, #ece5ff 42%, transparent 67%); }
.hero-copy { padding: 35px 48px; width: min(640px, 66%); }
.eyebrow { margin: 0 0 13px; color: var(--violet); font-size: .75rem; font-weight: 800; letter-spacing: .14em; display: flex; align-items: center; gap: 8px; }
.eyebrow span { font-size: 1.1rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); letter-spacing: -.065em; line-height: .99; margin-bottom: 16px; overflow-wrap: anywhere; }
.hero-copy > p:not(.eyebrow) { color: #57486e; margin-bottom: 22px; line-height: 1.55; max-width: 390px; }
.hero .btn { min-height: 44px; padding-inline: 17px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 28px; margin-top: 34px; align-items: start; }
.list-heading { display: flex; align-items: baseline; gap: 11px; margin: 0 0 13px; }
.list-heading h2 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.045em; margin: 0; }
.count { font-size: .8125rem; color: var(--muted); font-weight: 650; }
.tools { margin-bottom: 15px; min-height: 37px; }
.filter { border: 1px solid transparent; background: none; border-radius: 8px; color: var(--muted); font-weight: 650; font-size: .875rem; min-height: 36px; padding: 6px 11px; }
.filter:first-child { margin-left: 0; }
.filter:hover, .filter[aria-pressed="true"] { background: #eee6fc; color: var(--violet); }
.search { margin-left: auto; position: relative; width: min(190px, 100%); }
.search span { position: absolute; left: 10px; top: 5px; font-size: 1.2rem; color: var(--muted); }
.search input { width: 100%; padding: 8px 9px 8px 30px; font-size: .875rem; min-height: 36px; }
.gift-list { display: grid; gap: 6px; }
.gift-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 50px;
  padding: 7px 10px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.gift-row:hover { background: #f5effc; border-color: #e3d6f4; }
.gift-row-summary, .gift-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.gift-row-summary strong { font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.gift-row-meta { justify-content: end; max-width: 7rem; }
.gift-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; font-size: 1rem; background: #efe7ff; }
.gift-icon.coffee { background: #f9eadc; }
.gift-icon.book { background: #e2f3e9; }
.gift-icon.music { background: #f8e4ef; }
.gift-icon.leaf { background: #e3f2e3; }
.gift-icon.camera { background: #e7edff; }
.gift-icon.gaming { background: #e6e0fa; }
.gift-icon.drinks { background: #faead4; }
.gift-icon.wellness { background: #f6e4ec; }
.gift-icon.clothing { background: #dff0f4; }
.meta { color: var(--muted); margin: 0; font-size: .8125rem; line-height: 1.45; overflow-wrap: anywhere; }
.note { font-size: .875rem; margin: 5px 0 0; color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; }
.price { font-weight: 750; font-size: .875rem; }
.card-actions { justify-content: end; gap: 6px; }
.card-actions .btn { font-size: .8125rem; min-height: 33px; padding: 6px 9px; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: .75rem; font-weight: 700; background: var(--tint); color: var(--violet); }
.badge.done { background: var(--mint); color: var(--green); }
.funding { margin-top: 8px; max-width: 340px; }
progress { accent-color: var(--purple); width: 100%; height: 7px; }
.rail { display: grid; gap: 14px; }
.panel { background: var(--surface); padding: 20px; border-radius: 15px; border: 1px solid var(--line); }
.panel h2 { margin: 0; font-size: 1.035rem; letter-spacing: -.025em; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.panel p { color: var(--muted); font-size: .875rem; line-height: 1.55; margin: 8px 0 0; }
.people { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; max-height: 290px; overflow-y: auto; }
.people li { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: .875rem; overflow-wrap: anywhere; }
.avatar { flex: 0 0 32px; display: inline-grid; place-items: center; border-radius: 50%; height: 32px; font-size: .75rem; font-weight: 800; background: #eadfff; color: #51319a; }
.avatar.peach { background: #f9e7dc; color: #8b4a29; }
.avatar.green { background: #e0f2e9; color: #23684d; }
.avatar.blue { background: #e4ebff; color: #3a54a3; }
.you { margin-left: auto; color: var(--muted); font-weight: 500; }
.empty { padding: 30px 22px; text-align: center; border: 1px dashed #dfd3f0; border-radius: 14px; background: #fff; color: var(--muted); }
.empty p { margin: 0; }
.empty .btn { margin-top: 12px; }
.alert { color: #7f2441; background: #fcebf1; padding: 12px; border-radius: 8px; margin: 0 0 14px; font-size: .875rem; }
dialog { border: 1px solid var(--line); background: #fff; color: var(--ink); width: min(510px, calc(100% - 24px)); padding: 26px; border-radius: 20px; box-shadow: 0 22px 70px #25174035; }
dialog::backdrop { background: #2c194b50; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.dialog-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
.close { width: 38px; padding: 0; font-size: 1.35rem; }
form { display: grid; gap: 13px; }
label { font-size: .875rem; font-weight: 700; }
label { display: grid; gap: 5px; }
input, textarea, select { border-radius: 8px; border: 1px solid #dfd6eb; background: #fff; color: var(--ink); padding: 9px 11px; min-height: 40px; font-size: 1rem; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 28px; background: #fff linear-gradient(45deg, transparent 50%, #695884 50%) calc(100% - 14px) center/5px 5px no-repeat; }
.option { display: flex; align-items: center; gap: 7px; font-weight: 500; min-height: 34px; }
.option input { accent-color: var(--purple); min-height: auto; }
.hint, .dialog-copy { color: var(--muted); font-size: .875rem; line-height: 1.55; margin: 0; font-weight: 400; }
.dialog-actions { justify-content: end; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row input, .form-row select { min-width: 0; width: 100%; }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 10; max-width: min(420px, calc(100% - 40px)); color: #fff; background: #2d1c48; border-radius: 11px; padding: 12px 16px; box-shadow: 0 8px 25px #22143529; font-size: .9rem; }
@media (max-width: 850px) {
  .nav, main { padding-inline: 23px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 228px; gap: 16px; }
  .hero-copy { padding-inline: 32px; }
}
@media (max-width: 680px) {
  .nav, main { padding-inline: 16px; }
  .nav { min-height: 64px; }
  main { padding-top: 19px; }
  .hero { min-height: 245px; border-radius: 16px; }
  .hero::before { left: 36%; background-position: 58% center; }
  .hero::after { background: linear-gradient(90deg, #ece5ff 24%, #ece5ff 37%, #ece5ff00 82%); }
  .hero-copy { padding: 22px; width: 76%; }
  .hero-copy > p:not(.eyebrow) { font-size: .9375rem; }
  .workspace { grid-template-columns: 1fr; margin-top: 25px; }
  .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 410px) {
  .nav { gap: 5px; }
  .nav .btn { padding-inline: 9px; }
  .brand { font-size: 1.1rem; }
  .brand-mark { width: 32px; height: 32px; margin-right: 6px; }
  .search { width: 100%; margin-left: 0; }
  .tools { gap: 5px; }
  .rail { grid-template-columns: 1fr; }
}
.guest-links { list-style: none; max-height: 260px; overflow: auto; margin: 14px 0 0; padding: 0; }
.guest-links li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 9px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.guest-links strong { font-size: .875rem; }
.share-field { margin-block: 13px 8px; }

.member-list { max-width: 870px; margin-inline: auto; }
.member-heading, .preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.member-heading h1 { font-size: clamp(1.85rem, 5vw, 2.65rem); margin: 0; line-height: 1.1; }
.member-heading p, .preview-bar p { color: var(--muted); margin: 0; font-size: .875rem; }
.preview-bar { background: var(--tint); padding: 12px 15px; border-radius: 12px; }
.preview-bar p { margin-top: 3px; }

.funding summary { color: var(--violet); cursor: pointer; font-size: .875rem; font-weight: 650; }
.funding progress { display: block; margin-block: 6px 3px; }
.funding ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 5px; }
.funding li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .875rem; color: var(--muted); }

.gift-row.gift-removed { background: #f6f3fa; border-style: dashed; color: var(--muted); }
.badge.removed-badge { background: #ebe6f2; color: #544761; }
.gift-row .recipient-tag, .gift-detail-meta .recipient-tag { margin: 0; }
.gift-details { display: grid; gap: 10px; }
.gift-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.gift-details .card-actions { justify-content: start; padding-top: 7px; }
.gift-update { border-radius: 8px; background: var(--tint); padding: 8px 10px; }
.visibility-fields { min-width: 0; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; }
.visibility-fields legend { padding-inline: 4px; font-size: .875rem; font-weight: 700; }
.visibility-modes { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.visibility-fields [data-visibility-mode] { padding-top: 5px; }
.visibility-fields [data-visibility-mode="circles"] { max-height: 13rem; overflow: auto; }

.list-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 12rem));
  gap: 10px;
  margin-bottom: 15px;
}
.list-selects select { width: 100%; min-width: 0; font-size: .875rem; }
@media (max-width: 600px) {
  .list-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-filter { grid-column: 1 / -1; }
}
.recipient-tag {
  display: inline-block;
  margin: 0 0 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--recipient-tint, #e9defa);
  color: #391c60;
  font-size: .8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.circle-links-heading { margin: 18px 0 0; font-size: .95rem; }
