:root {
  color-scheme: light;
  --background: #fff;
  --surface: #f6f7f4;
  --ink: #1b2521;
  --muted: #526059;
  --line: #dce2dc;
  --accent: #315a47;
  --action: #214d3e;
  --focus: #146b5c;
  --radius: .45rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); overflow-wrap: anywhere; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure, ul, dl { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(1.95rem, 1.7rem + 1.45vw, 2.75rem); }
h2 { font-size: clamp(1.2rem, 1.1rem + .6vw, 1.5rem); }
h3 { font-size: 1.1rem; }
a { color: var(--action); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; }
fieldset { min-inline-size: 0; margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding-inline: .35rem; font-weight: 650; }
label { display: block; min-width: 0; font-weight: 650; }
small, .muted { color: var(--muted); }
label small { display: block; margin-top: .35rem; font-weight: 400; }
input:where(:not([type="checkbox"], [type="radio"], [type="hidden"])), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  max-width: 100%;
  padding: .55rem .7rem;
  border: 1px solid #89978e;
  border-radius: var(--radius);
  background: var(--background);
  color: var(--ink);
  font-weight: 400;
}
label > :is(input, textarea, select) { margin-top: .3rem; }
input[type="color"] { max-width: 4rem; padding: .3rem; cursor: pointer; }
input[type="range"] { padding: 0; border: 0; accent-color: var(--action); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; margin: 0 .35rem 0 0; vertical-align: middle; accent-color: var(--action); }
textarea { resize: vertical; }
input[readonly], textarea[readonly] { background: var(--surface); }
summary { cursor: pointer; min-height: 2.75rem; padding-block: .55rem; color: var(--action); font-weight: 650; }

.button, button {
  display: inline-flex;
  min-height: 2.75rem;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: .55rem .85rem;
  border: 1px solid var(--action);
  border-radius: var(--radius);
  background: var(--action);
  color: #fff;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.secondary { border-color: var(--line); background: var(--background); color: var(--action); }
.danger { border-color: #872d2c; background: #872d2c; }
.text-link, .text-button, .public-nav a, .guest-row > a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
}
.text-button { padding-inline: .4rem; border-color: transparent; background: transparent; color: var(--action); }
:is(button, .button):hover { text-decoration: underline; text-underline-offset: .18em; }
button:disabled { opacity: .6; cursor: default; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem .85rem; }
.actions > input { flex: 1 1 14rem; }
.stack { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.stack > :is(button, a.button) { justify-self: start; }
.panel { min-width: 0; padding: .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--background); }
.notice, .field-error { padding: .65rem .8rem; border-inline-start: .2rem solid #438066; background: #edf5ef; color: #1d4a35; }
.field-error, .notice.error { border-color: #a44846; background: #fbefee; color: #772c2a; }
.cards, .gallery { display: grid; gap: 1rem; list-style: none; padding: 0; }
.cards h2, .cards h3 { font-size: 1.15rem; }
.field-row { display: grid; gap: 1rem; }
.price { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }

main:not(.admin-main, .login-wrap) {
  width: min(calc(100% - 2rem), 43rem);
  margin: clamp(1rem, 4vw, 2.5rem) auto 3rem;
}
.narrow h1 { margin-bottom: .75rem; font-size: 1.5rem; }
.public-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0 1rem; }
.public-nav a { font-size: .95rem; }
.login-wrap { display: grid; min-height: 100svh; padding: 1.5rem; place-items: center; }
.login-panel { display: grid; width: min(100%, 24rem); gap: 1.25rem; }
.login-panel h1 { font-size: 1.9rem; }
.login-panel button { justify-self: stretch; }

.admin-header { border-bottom: 1px solid var(--line); }
.admin-header-inner, .admin-main { width: min(calc(100% - 2rem), 60rem); margin-inline: auto; }
.admin-header-inner { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-block: .25rem; }
.admin-header nav { display: flex; flex-wrap: wrap; gap: 0 1.15rem; }
.admin-header nav a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink); font-weight: 650; text-decoration: none; }
.admin-header nav a:hover { text-decoration: underline; }
.admin-main { display: grid; gap: 1rem; min-width: 0; margin-block: clamp(1.35rem, 4vw, 2.75rem) 3rem; }
.admin-main > .panel { padding: 0; border: 0; border-radius: 0; }
.admin-main > .panel + .panel { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .35rem .75rem; }
.editor-form, .share-panel { width: 100%; max-width: 43rem; }
.event-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0 1rem; }
.share-panel { border-block: 1px solid var(--line); }
.share-panel[open] { padding-bottom: .75rem; }
.share-panel [role="status"] { margin-top: .5rem; }
.editor-form { gap: 1.5rem; }
.form-section + .form-section { padding-top: 1.25rem; border-top: 1px solid var(--line); }

.guest-count { display: flex; flex-wrap: wrap; gap: .4rem .95rem; color: var(--muted); font-size: .925rem; }
.guest-count > div { display: flex; align-items: baseline; gap: .3rem; }
.guest-count dd { margin: 0; color: var(--ink); font-weight: 700; }
.guest-list { padding: 0; border-top: 1px solid var(--line); list-style: none; }
.guest-row { display: flex; justify-content: space-between; align-items: center; column-gap: .75rem; min-height: 3rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.guest-row > * { min-width: 0; }
.guest-row > a { flex-shrink: 0; }
.guest-row h2, .guest-row h3 { font-size: 1rem; letter-spacing: 0; }
.guest-row p { color: var(--muted); font-size: .925rem; }
.guest-search { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; }
.guest-search > label:first-child { flex: 2 1 10rem; }
.guest-search > label:nth-child(2) { flex: 1 1 7rem; }
.guest-search .actions { align-items: stretch; }

.choice { display: flex; align-items: center; gap: .3rem; }
.choice label { display: flex; align-items: center; min-height: 2.75rem; cursor: pointer; }
.response-form:has(input[name="going"]):not(:has(input[name="going"][value="sim"]:checked)) .additional-guests { display: none; }
.response-form fieldset, .response-form.panel { border: 0; padding: 0; }
.additional-guests { margin-block: .15rem; padding-block-start: .75rem; border-top: 1px solid var(--line); }
.add-guest { justify-self: start; }
.named-guest-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem .6rem; }
.named-guest-field label { grid-column: 1 / -1; font-size: .95rem; }
.named-guest-field button { padding-inline: .3rem; border: 0; background: transparent; font-weight: 550; text-decoration: underline; }
.response-form legend { padding: 0; }

[style*="--accent"] { --action: color-mix(in srgb, var(--accent) 35%, #17251d); }
.invitation { width: min(calc(100% - 2rem), 64rem); margin: clamp(1rem, 4vw, 3rem) auto 3rem; gap: 2rem; }
.invitation-hero { display: grid; gap: 1.35rem; }
.invitation-cover { width: 100%; height: auto; aspect-ratio: 1; align-self: start; border-radius: var(--radius); }
.invitation-copy { align-self: center; }
.invitation-copy h1 { font: 700 clamp(2.5rem, 1.75rem + 3.75vw, 4.5rem)/1 Georgia, serif; letter-spacing: -.04em; }
.invitation-title { margin-bottom: .35rem; }
.invitation-title, .invitation-age { color: var(--action); font-weight: 650; }
.invitation-age { margin-top: .5rem; }
.invitation-message { max-width: 55ch; white-space: pre-wrap; }
.invitation-details { border-inline-start: .15rem solid color-mix(in srgb, var(--accent) 45%, white); padding-inline-start: .8rem; }
.invitation-details p + p { margin-top: .2rem; }
.invitation-copy .button.secondary { padding-inline: .25rem; border-color: transparent; background: transparent; text-decoration: underline; }
.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.gallery-item, .gift-image { display: block; border-radius: var(--radius); overflow: hidden; }
.gallery img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.gift-image { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.pix-recipient dt { font-size: .875rem; color: var(--muted); }
.pix-recipient dd { margin: 0 0 .35rem; }
.pix-qr { display: grid; justify-items: start; }
.pix-qr svg, .pix-qr img { display: block; width: min(100%, 15rem); height: auto; }
#pix-code { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }

@media (min-width: 34rem) {
  .field-row, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 1.15rem; }
}
@media (min-width: 48rem) {
  .invitation-hero:has(.invitation-cover) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 3rem); }
  .invitation-copy h1 { max-width: 15ch; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}
