:root {
  color-scheme: light;
  color: #192231;
  background: #f3f6fa;
  font: 15px/1.5 system-ui, sans-serif;
  --border: #ced8e5;
  --divider: #e0e7ef;
  --muted: #505e71;
  --primary: #155cc6;
  --blue-tint: #eaf2ff;
  --surface: #fff;
  --page-gutter: max(1rem, calc((100vw - 68rem) / 2));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: flex; flex-direction: column; min-height: 100dvh; margin: 0; }
.site-footer {
  margin-top: auto;
  padding: 1rem max(1rem, calc((100% - 68rem) / 2));
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: .875rem;
}
.footer-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem 1rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .3rem; color: inherit; }
.footer-links svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: .5rem var(--page-gutter);
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; align-items: center; gap: .55rem; color: inherit; font-size: 1.06rem; font-weight: 750; text-decoration: none; }
.account-menu, .exchange-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: .45rem; cursor: pointer; list-style: none; }
.account-name { max-width: min(13rem, 30vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.account-avatar, .exchange-menu summary {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}
.account-menu summary::-webkit-details-marker, .exchange-menu summary::-webkit-details-marker { display: none; }
.account-avatar { flex: none; background: var(--blue-tint); color: #244470; }
.account-menu summary:hover .account-avatar, .account-menu[open] .account-avatar,
.exchange-menu summary:hover, .exchange-menu[open] summary { background: #edf0f5; }
.account-options, .exchange-options {
  position: absolute;
  z-index: 1;
  inset: calc(100% + .4rem) 0 auto auto;
  min-width: 8rem;
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  box-shadow: 0 5px 14px #20252c1f;
}
.account-options, .exchange-options { width: max-content; white-space: nowrap; }
.account-options a, .account-options button, .exchange-options a, .exchange-options button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
}
.account-options a:hover, .account-options button:hover, .exchange-options a:hover, .exchange-options button:hover { background: #edf0f5; }
.exchange-menu summary { width: 32px; height: 32px; font-size: 1.25rem; border-radius: 5px; }
.account-options a, .exchange-row .exchange-options a, .exchange-options button {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 0;
  padding: .4rem .75rem;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 600;
  text-decoration: none;
}
.exchange-options button { color: #a3212b; }
.exchange-options .exchange-edit-option { color: inherit; }
.exchange-options button:disabled { cursor: default; }
.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand .brand-mark { width: 1.65rem; height: 1.65rem; }

main { width: 100%; max-width: 70rem; margin: 2rem auto; padding: 0 1rem 3rem; }
.homepage-grid {
  display: grid;
  grid-template-columns: minmax(0, min(61.5%, calc(50% + 7.8rem))) minmax(16rem, 1fr);
  flex: 1;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
}
.home-intro {
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 3vw, 2.5rem);
  padding-inline-start: var(--page-gutter);
}
.home-intro h1 { font-size: clamp(1.9rem, 4vw, 3.05rem); margin-bottom: .45rem; }
.home-lead { margin: 0 0 1.4rem; font-size: 1.05rem; }
.home-steps ol { list-style: none; padding: 0; margin: 0; }
.home-steps li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .85rem; padding: .85rem 0; margin: 0; }
.home-steps li + li { border-top: 1px solid var(--divider); }
.home-steps li:last-child { padding-bottom: 0; }
.home-steps h3 { font-size: 1rem; margin: 0; }
.home-steps li p { margin: .2rem 0 0; }
.home-features a { color: inherit; }
.home-features ul { padding-inline-start: 1.15rem; margin: 0; color: var(--muted); }
.home-features li:last-child { margin-bottom: 0; }
.step-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border: 2px solid var(--primary); border-radius: 50%; background: var(--surface); color: var(--primary); }
.step-icon svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.homepage-grid .view-column {
  min-width: 0;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 3vw, 2.5rem);
  padding-inline-end: var(--page-gutter);
  background: #e4eefc;
}
.homepage-grid .sign-in, .homepage-grid .sign-in + #notice, .home-sign-in-heading {
  max-width: 26rem;
  margin-inline: auto 0;
}
.homepage-grid .sign-in { margin-top: 0; }
.home-sign-in-heading { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; }
.home-sign-in-heading .brand-mark { flex: none; }
.homepage-grid .sign-in h2 { font-size: 1.35rem; }
.homepage-grid .sign-in form button { width: 100%; }
.home-mascot { margin: 1.4rem 0 0; }
.home-mascot img { display: block; width: 100%; height: auto; }
.sign-in-help { font-size: .875rem; }
.support-information > :first-child { margin-top: 0; }
.support-faq details { border-top: 1px solid var(--divider); padding: .75rem 0; }
.support-faq details:last-child { padding-bottom: 0; }
.support-faq summary { cursor: pointer; font-weight: 600; }
.support-faq details p { margin: .4rem 0 0; }
h1, h2 { line-height: 1.25; margin: 0 0 .85rem; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.45rem, 4vw, 1.8rem); letter-spacing: -.025em; }
h2 { font-size: 1.08rem; }
p { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
p:last-child { margin-bottom: 0; }

section, .sign-in, .exchange-list, .exclusions-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}

section, .sign-in { padding: 1.15rem; }
section { margin-top: .9rem; }
.exclusions-panel { margin-top: .9rem; }
.exclusions-panel > summary { padding: .85rem 1.15rem; font-weight: 650; cursor: pointer; }
.exclusions-content { padding: 0 1.15rem 1.15rem; }
.exclusions-content li .icon-action { display: inline-grid; vertical-align: middle; }
.sign-in { max-width: 25rem; margin: clamp(1rem, 5vw, 3rem) auto 0; }
.sign-in h1 { font-size: 1.35rem; }
.sign-in > .secondary { margin-top: .75rem; }

.exchange-workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.exchange-workspace > * { margin: 0; }
.pin-sign-in { align-items: center; }
.pin-mascot { display: block; width: min(100%, 21rem); height: auto; margin-inline: auto; transform: scaleX(-1); }
.empty-roster-mascot { display: block; width: min(100%, 17rem); height: auto; margin-inline: auto; }
.empty-roster-mascot + p { text-align: center; }
.empty-exchange-mascot { display: block; width: min(100%, 22rem); height: auto; margin-inline: auto; }
.empty-exchange-mascot + p { text-align: center; }
.exchange-list { padding: 0; list-style: none; }
.exchange-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin: 0;
  padding: .8rem 1rem;
}
.exchange-row + .exchange-row { border-top: 1px solid var(--border); }
.exchange-row a { font-weight: 650; }
.exchange-row-title { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; font-size: 1.15rem; text-decoration: none; }
.exchange-row-title:hover { color: #0c438d; }
.exchange-row-title .brand-mark { width: 19px; height: 19px; flex: none; }
.exchange-row-actions { display: flex; align-items: center; gap: .35rem; flex: none; }
.status { flex: none; padding: .1rem .45rem; border-radius: 4px; background: #edf0f5; color: #364052; font-size: .8rem; }
.status.complete { background: var(--blue-tint); color: #164984; }
.status.active { background: #def3e5; color: #205c39; }
.back-link {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  margin-bottom: .75rem;
  padding: .2rem .65rem;
  border: 1px solid #d8dde5;
  border-radius: 999px;
  background: #fff;
  color: #364052;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { background: #edf0f5; }
.exchange-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 1rem; }
.exchange-heading h1 { margin-bottom: 0; }
.exchange-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-inline-start: auto; }
.exchange-description { margin: 0 0 .9rem; }
.title-editor { margin-bottom: .9rem; }
.description-editor label, .description-editor textarea { width: 100%; }
.description-editor label { font-weight: 400; }
.exchange-title { display: flex; align-items: center; gap: .55rem; }
.exchange-title .brand-mark { flex: none; }
.roster-list { padding: 0; margin: 0; list-style: none; }
.roster-list li { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; padding: .5rem 0; margin: 0; }
.roster-list li + li, .participant-roster li + li { border-top: 1px solid var(--divider); }
.participant-pin { display: inline-flex; align-items: center; gap: .2rem; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.participant-pin .icon-action { width: 28px; min-height: 28px; margin: 0; }
.participant-pin .icon-action svg { width: 16px; height: 16px; }
.roster-controls { display: flex; flex-wrap: wrap; gap: .35rem; margin-inline-start: auto; }
.roster-controls button { margin: 0; }
.icon-action {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: transparent;
  color: #364052;
}
.icon-action:hover { background: #edf0f5; }
.icon-action svg, .account-menu svg, .participant-name svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.participant-name { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; font-weight: 600; }
.participant-name svg {
  width: 29px;
  height: 29px;
  padding: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--blue-tint);
  color: #244470;
}
.roster-list form { width: 100%; margin-bottom: .5rem; }

form { display: grid; gap: .75rem; justify-items: start; }
.form-field { width: min(100%, 28rem); }
label { display: grid; width: min(100%, 28rem); gap: .3rem; font-weight: 600; }
label:has(input[type=checkbox]) { display: flex; align-items: center; }
input, select, textarea, button { font: inherit; border-radius: 6px; }
input:not([type=checkbox]), select, textarea {
  width: min(100%, 28rem);
  min-height: 38px;
  padding: .4rem .65rem;
  border: 1px solid #8e9eb4;
  background: #fff;
  color: inherit;
}

button {
  min-height: 38px;
  padding: .4rem .75rem;
  border: 1px solid transparent;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 650;
}

button:hover { background: #114fae; }
.donation-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .4rem .75rem;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  font-weight: 650;
  text-decoration: none;
}
.donation-button:hover { background: #114fae; }
button:disabled { opacity: .65; cursor: wait; }
.secondary { background: white; border-color: var(--border); color: #303946; }
.secondary:hover { background: #edf0f5; }
.small-button { min-height: 30px; padding: .2rem .55rem; font-size: .82rem; }
.danger { background: #a3212b; }
.danger:hover { background: #881923; }
.confirm-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  box-shadow: 0 12px 36px #20252c30;
}
.confirm-dialog::backdrop { background: #20252c66; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.invite-dialog { width: min(36rem, calc(100% - 2rem)); }
.invite-dialog label, .invite-dialog input, .invite-dialog textarea { width: 100%; }
a { color: #1456b3; text-underline-offset: .15em; }
.draw-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .85rem 1.25rem; }
.draw-panel h2 { margin-bottom: .25rem; }
.draw-panel p { margin: 0; }
.inline-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.wish-list-editor .form-field, .wish-list-editor textarea { width: 100%; }
.participant-details > :first-child { margin-top: 0; }
.participant-result { border-color: #a8c5ef; background: var(--blue-tint); }
.revealed-match { display: grid; grid-template-columns: minmax(4.5rem, 25%) minmax(0, 1fr); align-items: center; gap: clamp(.6rem, 2vw, 1.2rem); }
.match-mascot { display: block; width: 100%; max-width: 10rem; height: auto; margin-inline: auto; }
.match-reveal {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 12rem;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #f5f9ff, #d9e8ff);
}
.match-placeholder {
  display: grid;
  justify-items: center;
  gap: .65rem;
  width: min(100%, 19rem);
  filter: blur(5px);
}
.match-placeholder .brand-mark { width: 2.5rem; height: 2.5rem; margin-bottom: .2rem; }
.match-placeholder span { width: 100%; height: .7rem; border-radius: 999px; background: #a7c5ef; }
.match-placeholder span:nth-of-type(2) { width: 76%; }
.match-placeholder span:nth-of-type(3) { width: 89%; }
.match-reveal-controls {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #eaf2ff65;
}
.match-reveal-controls button { min-height: 44px; padding-inline: 1.1rem; }
.match-countdown {
  min-width: 4.5rem;
  margin: 0;
  padding: .25rem .65rem;
  border: 1px solid #a8c5ef;
  border-radius: 1rem;
  background: var(--surface);
  color: #163e75;
  text-align: center;
  font-size: 2rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.participant-draw { display: flex; align-items: center; gap: .5rem; margin-top: 0; color: #163e75; font-size: 1.2rem; font-weight: 400; }
.participant-draw > span { min-width: 0; overflow-wrap: anywhere; }
.participant-draw .brand-mark { flex: none; }
.participant-roster { list-style: none; padding: 0; margin: 0; }
.participant-roster li { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .45rem .6rem; margin: 0; border: 1px solid transparent; }
.participant-roster .drawn-recipient { background: var(--blue-tint); border: 1px solid #91b6ed; border-radius: 6px; color: #164984; }
.drawn-recipient .participant-name svg { background: #d9e8ff; }
.drawn-recipient .status { background: var(--primary); color: #fff; }
.current-participant .status { background: #e9edf2; font-weight: 650; }
.recipient-wishes { padding: .75rem; border: 1px solid var(--border); border-radius: 5px; background: #f6f7f9; overflow-wrap: anywhere; }
.recipient-wish-heading { margin: 0 0 .35rem; }
.recipient-wish-heading + .recipient-wishes { margin-top: 0; }
.participant-result .recipient-wishes { background: var(--surface); border-color: #c7d9f3; }
li { margin-bottom: .35rem; overflow-wrap: anywhere; }
li button { margin-inline-start: .5rem; }
output { display: block; font-weight: 700; margin-bottom: .7rem; }
#notice { color: var(--muted); }
#notice.success { color: #205c39; }
.sign-in + #notice { max-width: 25rem; margin-inline: auto; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

@media (max-width: 40rem) {
  .exchange-workspace { grid-template-columns: 1fr; }
  .pin-mascot { max-width: 16rem; }
  .revealed-match { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .match-mascot { width: min(46%, 7rem); }
  .participant-draw { justify-content: center; text-align: center; }
  .recipient-wishes { margin-bottom: 0; }
  .match-reveal-controls { padding-inline: 1rem; }
  .match-reveal-controls button { width: min(100%, 16rem); }
  .homepage-grid { grid-template-columns: 1fr; flex: 0; }
  .homepage-grid .view-column { order: -1; padding-inline: 1rem; }
  .homepage-grid .sign-in, .homepage-grid .sign-in + #notice, .home-sign-in-heading { max-width: 26rem; margin-inline: auto; }
  main { margin-top: 1.25rem; }
}
