:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  --slate: #555b6e;
  --deep-slate: #252935;
  --off-white: #faf9f9;
  --teal: #89b0ae;
  --mint: #bee3db;
  --peach: #ffd6ba;
  --peach-hover: #f7c7a6;
  --ink: var(--deep-slate);
  --page: var(--off-white);
  --paper: #fff;
  --link: var(--slate);
  --selection: var(--mint);
  --selection-ink: var(--deep-slate);
  --primary: var(--slate);
  --primary-ink: var(--off-white);
  --primary-hover: #434a5d;
  --muted: var(--slate);
  --line: #dadee4;
  --empty-line: #c6cbd5;
  --selected-line: #99c5bb;
  --control-line: #7a8292;
  --focus: var(--slate);
  --icon-paper: #e9ebf0;
  --error: #8e2d22;
  --shadow: #25293538;
  --backdrop: #25293585;
  --content: 72rem;
  --heading: Georgia, "Times New Roman", serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: var(--off-white);
  --page: var(--deep-slate);
  --paper: #303645;
  --link: var(--mint);
  --selection: #3a5054;
  --selection-ink: #e3f6f1;
  --primary: var(--mint);
  --primary-ink: var(--deep-slate);
  --primary-hover: #a9d2c9;
  --muted: #c9cdd7;
  --line: #50586a;
  --empty-line: #50586a;
  --selected-line: #618083;
  --control-line: #8992a4;
  --focus: var(--mint);
  --icon-paper: #41495a;
  --error: #ffad9e;
  --shadow: #0008;
  --backdrop: #111620cc;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 17.5rem; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--link); text-underline-offset: .17em; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
ul { list-style: none; padding: 0; margin: 0; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--heading);
  font-size: 1.45rem;
  font-weight: bold;
  flex-shrink: 0;
}

.gift-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .85rem;
  background: var(--peach);
  color: var(--deep-slate);
  flex: 0 0 auto;
}

.gift-icon i {
  width: .91rem;
  height: .69rem;
  border: 1.5px solid currentColor;
  border-radius: .12rem;
  position: relative;
  margin-top: .31rem;
  background: linear-gradient(90deg, transparent 44%, currentColor 44% 56%, transparent 56%);
}

.gift-icon i::before, .gift-icon i::after {
  content: "";
  width: .38rem;
  height: .3rem;
  position: absolute;
  top: -.35rem;
  border: 1.3px solid;
}
.gift-icon i::before { left: .01rem; border-radius: .25rem .25rem 0 .25rem; transform: rotate(12deg); }
.gift-icon i::after { right: .01rem; border-radius: .25rem .25rem .25rem 0; transform: rotate(-12deg); }

.access-layout {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.access-art {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 4rem);
  color: var(--off-white);
  background: radial-gradient(ellipse at 42% 65%, var(--slate), transparent 66%), #343b4c;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.access-brand { position: relative; z-index: 1; }
.access-subtitle {
  max-width: 25rem;
  margin: .75rem 0 0;
  color: #e4e6ed;
  line-height: 1.5;
}
.wrapping {
  position: absolute;
  top: 54%;
  left: 50%;
  width: min(57%, 24rem);
  aspect-ratio: 1;
  border: 1px solid #bee3db69;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.2rem #bee3db0d, 0 0 0 3rem #bee3db0d, 0 0 0 5rem #bee3db0d;
}
.parcel {
  position: absolute;
  inset: 36% 23% 23%;
  background:
    linear-gradient(90deg, transparent 43%, var(--teal) 43% 57%, transparent 57%),
    linear-gradient(180deg, var(--peach) 0 20%, var(--peach-hover) 20%);
  border-radius: .4rem;
  box-shadow: 0 .9rem 2rem #25293580;
  transform: rotate(-8deg);
}
.ribbon-loop {
  display: block;
  position: absolute;
  bottom: 63%;
  width: 21%;
  height: 14%;
  border: clamp(.33rem, 1vw, .65rem) solid var(--teal);
}
.ribbon-loop.left { left: 28%; border-radius: 60% 70% 8% 60%; transform: rotate(22deg); }
.ribbon-loop.right { left: 49%; border-radius: 70% 60% 60% 8%; transform: rotate(-39deg); }

.access-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  gap: 1.25rem;
  padding: clamp(1.5rem, 6vw, 5rem);
}
.access-panel .preferences { justify-self: end; }
.access-content { width: min(100%, 26rem); }
.description { color: var(--muted); line-height: 1.6; margin: .75rem 0 1.65rem; }
h1 {
  font: normal clamp(2.2rem, 4vw, 3.6rem)/1.07 var(--heading);
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.profile-picker { display: grid; gap: .65rem; }
.profile-picker button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .8rem;
  color: inherit;
  text-align: left;
  font-weight: 600;
}
.profile-picker button:hover { border-color: var(--control-line); }
.onboarding-choices { margin-top: 1.65rem; }
.onboarding-choices strong, .onboarding-choices small { display: block; }
.onboarding-choices small {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: normal;
  line-height: 1.4;
}
.access-content > h1 + .profile-picker { margin-top: 1.3rem; }
.onboarding-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .75rem;
  flex: 0 0 auto;
  color: var(--deep-slate);
  background: var(--mint);
}
.onboarding-icon.mail { background: var(--peach); }
.onboarding-icon.mail::before { content: "✉"; font-size: 1.35rem; line-height: 1; }
.onboarding-icon.people::before, .onboarding-icon.people::after {
  content: "";
  position: absolute;
  border: 1.4px solid currentColor;
}
.onboarding-icon.people::before {
  width: .43rem;
  height: .43rem;
  border-radius: 50%;
  top: .58rem;
  left: .77rem;
  box-shadow: .48rem .08rem 0 -.03rem currentColor;
}
.onboarding-icon.people::after {
  width: .83rem;
  height: .57rem;
  border-radius: .4rem .4rem .13rem .13rem;
  top: 1.12rem;
  left: .58rem;
  box-shadow: .46rem .07rem 0 -.06rem currentColor;
}
.onboarding-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .9rem;
  color: var(--muted);
  font-size: .93rem;
}
.access-content .description { overflow-wrap: anywhere; }
.chevron {
  width: .45rem;
  height: .45rem;
  border-top: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
  margin-left: auto;
  flex-shrink: 0;
}
.profile-back { margin-bottom: 1.4rem; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: .79rem;
  flex: 0 0 auto;
}
.tint-0 { color: var(--deep-slate); background: var(--mint); }
.tint-1 { color: var(--deep-slate); background: var(--peach); }
.tint-2 { color: var(--off-white); background: var(--slate); }
.tint-3 { color: var(--deep-slate); background: var(--teal); }

.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner {
  width: min(100% - 3rem, var(--content));
  margin: auto;
  display: flex;
  align-items: center;
  gap: clamp(.55rem, 2vw, 2rem);
  min-height: 4.65rem;
}
.main-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.main-nav button, .tabs button {
  border: 0;
  border-radius: .5rem;
  color: var(--muted);
  background: none;
  font-weight: 600;
  font-size: .94rem;
  white-space: nowrap;
  padding: .48rem .7rem;
}
.main-nav button:hover, .tabs button:hover, .text-button:hover, .manage-link:hover { color: var(--ink); }
.main-nav button[aria-current], .tabs button[aria-pressed="true"] {
  color: var(--selection-ink);
  background: var(--selection);
}
.account, .account-profile {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.preferences { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.topbar-inner > .preferences { margin-left: auto; }
.theme-switch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  width: 4.65rem;
  height: 2.5rem;
  padding: .125rem;
  border: 1px solid var(--control-line);
  border-radius: 2rem;
  color: var(--muted);
  background: var(--selection);
  font-size: 1.2rem;
  line-height: 1;
}
.theme-switch::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: .125rem auto .125rem .125rem;
  width: calc(50% - .125rem);
  border-radius: 1.5rem;
  background: var(--paper);
  box-shadow: 0 1px 3px var(--shadow);
  transition: transform .18s ease;
}
.theme-switch[aria-checked="true"]::before { transform: translateX(100%); }
.theme-switch[aria-checked="false"] .theme-sun,
.theme-switch[aria-checked="true"] .theme-moon { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .theme-switch::before { transition: none; }
}
.language-options { display: flex; gap: .15rem; }
.flag-button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: .35rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  background: transparent;
}
.flag-button img { display: block; width: 1.65rem; height: auto; }
.flag-button:not(:disabled):hover,
.flag-button[aria-pressed="true"] { background: var(--selection); }
.flag-button[aria-pressed="true"] { border-color: var(--link); }
.account-profile {
  padding: .2rem .35rem;
  border: 0;
  border-radius: .65rem;
  color: inherit;
  background: transparent;
  font-size: .9rem;
  font-weight: 600;
}
.account-profile:hover { background: var(--selection); }
.avatar-editor { position: relative; display: inline-flex; }
.avatar-edit {
  position: absolute;
  bottom: -.13rem;
  right: -.2rem;
  display: grid;
  place-items: center;
  width: .9rem;
  height: .9rem;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
  font-size: .7rem;
}
.account-profile > span:last-child {
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account .button { white-space: nowrap; padding-inline: .5rem; }

.shell {
  width: min(100% - 3rem, var(--content));
  margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 4rem) 0;
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.4rem, 5vw, 4.5rem);
}
.family-panel { padding-top: .5rem; min-width: 0; }
.family-panel h2 { font-size: .9rem; color: var(--muted); padding: 0 .72rem; margin-bottom: .7rem; overflow-wrap: anywhere; }
.family-list { display: grid; gap: .24rem; }
.invite-help { color: var(--muted); font-size: .85rem; line-height: 1.4; margin: .55rem .72rem 0; }
.family-links { display: flex; flex-direction: column; align-items: flex-start; }
.person {
  border: 1px solid transparent;
  border-radius: .7rem;
  display: flex;
  width: 100%;
  padding: .48rem .6rem;
  gap: .65rem;
  align-items: center;
  color: inherit;
  background: transparent;
  font-weight: 600;
  text-align: left;
}
.person:hover, .person.current { background: var(--selection); color: var(--selection-ink); }
.person.current { border-color: var(--selected-line); }
.person-name { overflow-wrap: anywhere; min-width: 0; }
.person .family-role { display: block; font-weight: 400; }
.self-label { margin-left: auto; color: var(--muted); font-size: .82rem; font-weight: normal; }
.manage-link, .text-button {
  color: var(--link);
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: .91rem;
  text-align: left;
  padding: .55rem 0;
}
.manage-link { margin: .55rem 0 0 .72rem; }
.manage-link[aria-current], .text-button:hover { text-decoration: underline; text-underline-offset: .2em; }
.workspace { min-width: 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.section-header .button { flex-shrink: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .45rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin-bottom: 1.25rem; }
.tabs button { min-height: 2.35rem; }
.empty {
  min-height: 15rem;
  border: 1px dashed var(--empty-line);
  border-radius: 1rem;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: var(--paper);
}
.empty .gift-icon { margin-bottom: .95rem; }
.empty h3 { font-family: var(--heading); font-size: 1.42rem; }
.empty p { margin-top: .4rem; color: var(--muted); line-height: 1.45; }
.loading { padding: 1.5rem; color: var(--muted); }

.gift-list, .family-settings { display: grid; gap: .75rem; }
.gift-card, .family-settings li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .9rem;
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem;
}
.gift-info { display: flex; align-items: flex-start; gap: .75rem; min-width: 0; }
.gift-info .gift-icon { background: var(--teal); }
.gift-detail { min-width: 0; }
.gift-detail h3 { font-family: var(--heading); font-size: 1.38rem; line-height: 1.15; overflow-wrap: anywhere; }
.gift-context { color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }
.shop-link { display: inline-block; font-size: .95rem; overflow-wrap: anywhere; margin-top: .44rem; }
.gift-notes { color: var(--muted); line-height: 1.48; margin-top: .52rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.gift-controls {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  max-width: 52%;
  gap: .65rem;
}
.gift-price { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; max-width: 12rem; }
.gift-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
.claim-status { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.family-settings li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}
.family-settings-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.family-role { color: var(--muted); font-size: .85rem; }
.invitation-settings {
  display: grid;
  gap: .75rem;
  margin-top: 1.4rem;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
}
.invitation-settings h2 { font: normal 1.5rem/1.15 var(--heading); }
.invitation-settings h3 { font-size: .98rem; }
.invitation-settings p, .invitation-list small { color: var(--muted); line-height: 1.45; }
.invitation-settings .form-error { color: var(--error); }
.invite-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: .55rem; }
.invite-field input { margin-bottom: 0; }
.pending-invitations { display: grid; gap: .55rem; margin-top: .3rem; }
.invitation-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem .7rem;
  padding-top: .55rem;
  border-top: 1px solid var(--line);
}
.invitation-list strong { overflow-wrap: anywhere; }
.invitation-list small { display: block; margin-top: .2rem; }

.button {
  min-height: 2.5rem;
  padding: .53rem .85rem;
  border: 1px solid transparent;
  border-radius: .62rem;
  font-size: .93rem;
  font-weight: 650;
  line-height: 1.25;
}
.button.primary { color: var(--primary-ink); background: var(--primary); }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { color: var(--ink); background: var(--paper); border-color: var(--control-line); }
.button.secondary:hover { background: var(--selection); color: var(--selection-ink); }
.button.peach { color: var(--deep-slate); background: var(--peach); }
.button.peach:hover { background: var(--peach-hover); }
.button.quiet { color: var(--muted); background: transparent; }
.button.quiet:hover { color: var(--selection-ink); background: var(--selection); }
.button.danger { color: white; background: #a63d30; }
.button.danger:hover { background: #8e2d22; }
.wide { width: 100%; }

dialog {
  width: min(calc(100% - 2rem), 32rem);
  max-height: calc(100svh - 2rem);
  padding: clamp(1.15rem, 4vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  color: inherit;
  background: var(--paper);
  box-shadow: 0 1.1rem 4rem var(--shadow);
}
dialog::backdrop { background: var(--backdrop); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.dialog-header h2 { font: normal 1.85rem/1.1 var(--heading); overflow-wrap: anywhere; }
.icon-button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: .55rem;
  color: var(--muted);
  background: var(--icon-paper);
  font-size: 1.3rem;
  flex: 0 0 auto;
}
.dialog-detail { color: var(--muted); line-height: 1.5; margin-bottom: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .55rem; flex-wrap: wrap; margin-top: .65rem; }
.stack { display: grid; gap: .45rem; }
.stack label { font-size: .92rem; font-weight: 650; }
.optional { font-weight: normal; color: var(--muted); }
.stack input, .stack textarea {
  width: 100%;
  min-height: 2.7rem;
  border: 1px solid var(--control-line);
  border-radius: .58rem;
  background: var(--paper);
  color: inherit;
  padding: .63rem .72rem;
  margin-bottom: .42rem;
}
.stack textarea { resize: vertical; }
.avatar-color-field { display: flex; align-items: center; gap: .85rem; margin-bottom: .42rem; }
.avatar-color-field .avatar { width: 3rem; height: 3rem; font-size: 1.05rem; }
.stack .avatar-color-field input { width: 4rem; height: 2.7rem; margin: 0; padding: .25rem; cursor: pointer; }
.form-error { color: var(--error); font-size: .94rem; line-height: 1.45; }
.form-error:empty { display: none; }

.operator-families li { padding: .8rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.operator-families h3 { font-size: 1rem; }
.operator-families p { color: var(--muted); line-height: 1.5; }
.operator-families details { margin-top: .55rem; }
.operator-families summary { cursor: pointer; color: var(--error); }
.operator-families form .button { justify-self: start; }
.operator-families .form-error { color: var(--error); margin-top: .4rem; }
.notification {
  position: fixed;
  z-index: 1;
  bottom: 1rem;
  right: 1rem;
  max-width: calc(100% - 2rem);
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: .75rem;
  padding: .78rem 1rem;
  box-shadow: 0 .4rem 1.4rem var(--shadow);
  opacity: 0;
  pointer-events: none;
}
.notification.visible { opacity: 1; }

@media (max-width: 60rem) {
  .topbar-inner { flex-wrap: wrap; min-height: auto; width: calc(100% - 2rem); column-gap: .5rem; row-gap: 0; padding-top: .65rem; }
  .main-nav { order: 3; width: 100%; padding: .35rem 0 .5rem; }
  .main-nav button { min-height: 2.65rem; }
  .account-profile > span:last-child { display: none; }
}

@media (max-width: 46rem) {
  .access-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .access-art { padding: 1.2rem 1.35rem; }
  .wrapping { display: none; }
  .topbar-inner > .brand { flex: 1 1 0; }
  .topbar-inner > .preferences { order: 2; width: 100%; margin-left: 0; padding-top: .35rem; }
  .shell { display: flex; flex-direction: column; width: calc(100% - 2rem); gap: 1.7rem; }
  .family-panel, .workspace { width: 100%; }
  .family-panel { padding: 0; }
  .family-panel h2 { padding: 0; margin-bottom: .45rem; }
  .family-list { display: flex; flex-wrap: wrap; gap: .38rem; }
  .family-list li { max-width: 100%; }
  .invite-help { margin-inline: 0; }
  .family-links { flex-direction: row; flex-wrap: wrap; gap: 0 1rem; }
  .person { padding: .4rem .58rem; gap: .45rem; background: var(--paper); border-color: var(--line); }
  .person .avatar { width: 1.7rem; height: 1.7rem; }
  .self-label { display: none; }
  .manage-link { margin-left: 0; }
}

@media (max-width: 34rem) {
  .section-header { align-items: flex-start; }
  .gift-card { flex-direction: column; gap: .8rem; padding: 1rem; }
  .gift-controls { justify-content: space-between; max-width: none; }
  .gift-actions { justify-content: flex-start; }
  .family-settings li { grid-template-columns: auto minmax(0, 1fr); padding: .8rem; gap: .6rem; }
  .family-settings-actions { grid-column: 2; }
  .invite-field { grid-template-columns: 1fr; }
  .invite-field .button { justify-self: start; }
}
