/* Hurray design system — see DESIGN.md for the class vocabulary.
   Order: tokens → themes → base → chrome components → flyer → print. */

/* ============ 1. Tokens ============ */

:root {
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* neutrals (light app chrome) */
  --paper: #F5F3FA;
  --white: #FFFFFF;
  --plum: #1F1538;        /* text */
  --plum-2: #5A5272;      /* secondary text, 6.6:1 on --paper */
  --edge: #D9D4E7;        /* hairlines */
  --edge-strong: #8D86A3; /* field borders, 3:1 on white */
  --sticker-yellow: #FFD84D;
  --danger: #B3182A;
  --danger-soft: #FDE7EA;
  --ok: #14532D;
  --ok-soft: #DDF3E4;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 40px;
  --radius-field: 12px; --radius-card: 20px; --radius-pill: 999px;
  --tap: 48px; /* default control height; never below 44px */
}

/* ============ 2. Themes ============
   A theme only sets --t-* custom properties. :root carries confetti so an
   unknown or missing theme class falls back to it. */

:root, .theme-confetti {
  --t-font: var(--font-display);
  --t-font-weight: 800;
  --t-title-adj: 1; --t-title-lh: .96; --t-title-ls: -.015em; --t-title-shadow: none;
  --t-sky: #FF7B54; --t-ground: #FF7B54; --t-floor: #FF7B54;
  --t-ink: #2A1650; --t-title: #2A1650;
  --t-card: rgb(255 255 255 / .3); --t-card-line: rgb(255 255 255 / .55);
  --t-accent: #3B1F7A;                       /* on light chrome, white text on it */
  --t-btn: #2A1650; --t-on-btn: #FFFFFF;     /* primary button on the immersive page */
  --t-sticker: #FFFFFF; --t-sticker-ink: #2A1650; --t-tape: rgb(42 22 80 / .22);
  --t-art-ink: #2A1650; --t-star: #FFE9A3; --t-outline: transparent; --t-cloud: #EFEAFF;
  --t-a1: #FFD84D; --t-a2: #FFFFFF; --t-a3: #2A1650; --t-a4: #8DEBEF; --t-a5: #C2185B; --t-a6: #FFD84D;
}
.theme-splash {
  --t-font: "Baloo 2", "Arial Rounded MT Bold", var(--font-display);
  --t-title-adj: 1.08; --t-title-lh: .92; --t-title-ls: -.01em;
  --t-sky: #BDEFFA; --t-ground: #0A5AA6; --t-floor: #0A5AA6;
  --t-ink: #FFFFFF; --t-title: #FFFFFF;
  --t-card: rgb(255 255 255 / .12); --t-card-line: rgb(255 255 255 / .32);
  --t-accent: #0A5AA6;
  --t-btn: #FFD84D; --t-on-btn: #0A2E55;
  --t-sticker: #FFD84D; --t-sticker-ink: #0A2E55; --t-tape: rgb(255 255 255 / .55);
  --t-art-ink: #0A2E55;
  --t-a1: #74D3F6; --t-a2: #1E96D8; --t-a3: #FF5B4D; --t-a4: #FFD23F; --t-a5: #FFFFFF; --t-a6: #FFD23F;
}
.theme-dino {
  --t-font: "Rammetto One", "Cooper Black", Georgia, serif;
  --t-font-weight: 400;
  --t-title-adj: .8; --t-title-lh: 1.04; --t-title-ls: 0;
  --t-sky: #E6F5B0; --t-ground: #17603A; --t-floor: #17603A;
  --t-ink: #F8FCEA; --t-title: #FFFFFF;
  --t-card: rgb(255 255 255 / .11); --t-card-line: rgb(255 255 255 / .3);
  --t-accent: #17603A;
  --t-btn: #FFB53D; --t-on-btn: #33210A;
  --t-sticker: #FFD84D; --t-sticker-ink: #1D3A16; --t-tape: rgb(255 255 255 / .5);
  --t-art-ink: #143D25;
  --t-a1: #9AD468; --t-a2: #35A85F; --t-a3: #B8562B; --t-a4: #FF8A3D; --t-a5: #1C7C45; --t-a6: #FFC53D;
}
.theme-space {
  --t-font: "Unbounded", "Arial Black", var(--font-display);
  --t-title-adj: .7; --t-title-lh: 1.06; --t-title-ls: -.02em;
  --t-sky: #14103D; --t-ground: #2A2175; --t-floor: #2A2175;
  --t-ink: #FFFFFF; --t-title: #FFFFFF;
  --t-card: rgb(255 255 255 / .11); --t-card-line: rgb(255 255 255 / .26);
  --t-accent: #4B3BD6;
  --t-btn: #FFD84D; --t-on-btn: #1B1552;
  --t-sticker: #FFD84D; --t-sticker-ink: #1B1552; --t-tape: rgb(255 255 255 / .5);
  --t-art-ink: #1B1552; --t-star: #FFE9A3;
  --t-a1: #FF7A59; --t-a2: #FFD23F; --t-a3: #7CE0D6; --t-a4: #FFFFFF; --t-a5: #1F185C; --t-a6: #E5484D;
}
.theme-rainbow {
  --t-font: "Fredoka", "Arial Rounded MT Bold", var(--font-display);
  --t-font-weight: 700;
  --t-title-adj: 1; --t-title-lh: .98; --t-title-ls: -.005em;
  --t-sky: #DCD6FF; --t-ground: #FFFFFF; --t-floor: #FFFFFF;
  --t-ink: #3B1D6E; --t-title: #6D35D9;
  --t-card: #F4F0FF; --t-card-line: #DCD3F7;
  --t-accent: #6D35D9;
  --t-btn: #6D35D9; --t-on-btn: #FFFFFF;
  --t-sticker: #FFD84D; --t-sticker-ink: #3B1D6E; --t-tape: rgb(109 53 217 / .2);
  --t-art-ink: #3B1D6E; --t-cloud: #EFEAFF;
  --t-a1: #FF4F6D; --t-a2: #FF9F1C; --t-a3: #FFD23F; --t-a4: #2EC47A; --t-a5: #3D8BFF; --t-a6: #8E5BE8;
}
.theme-superhero {
  --t-font: "Bangers", Impact, "Arial Narrow Bold", sans-serif;
  --t-font-weight: 400;
  --t-title-adj: 1.3; --t-title-lh: .98; --t-title-ls: .02em;
  --t-title-shadow: .05em .06em 0 #D8202A;
  --t-sky: #FFD60A; --t-ground: #1B2A8A; --t-floor: #1B2A8A;
  --t-ink: #FFFFFF; --t-title: #FFE14A;
  --t-card: rgb(255 255 255 / .12); --t-card-line: rgb(255 255 255 / .3);
  --t-accent: #C81E28;
  --t-btn: #FFD84D; --t-on-btn: #141E63;
  --t-sticker: #FFD84D; --t-sticker-ink: #141E63; --t-tape: rgb(255 255 255 / .5);
  --t-art-ink: #141E63;
  --t-a1: #FFB300; --t-a2: #E5262B; --t-a3: #FFFFFF; --t-a4: #FFD60A; --t-a5: #141E63; --t-a6: #E5262B;
}

/* Semantic tokens the chrome components use. Re-declared on every theme scope
   so they pick up that scope's --t-* values. */
:root, [class*="theme-"] {
  --bg: var(--paper);
  --surface: var(--white);
  --surface-line: var(--edge);
  --ink: var(--plum);
  --ink-2: var(--plum-2);
  --accent: var(--t-accent);
  --on-accent: #FFFFFF;
  --track: color-mix(in srgb, var(--t-accent) 9%, var(--white));
  --focus: var(--plum);
}

/* The guest page: the whole page takes the event's colours. Put on <body>
   together with the theme class: <body class="theme-splash immersive">. */
.immersive {
  --bg: var(--t-ground);
  --surface: var(--t-card);
  --surface-line: var(--t-card-line);
  --ink: var(--t-ink);
  --ink-2: color-mix(in srgb, var(--t-ink) 92%, var(--t-ground)); /* ≥4.5:1 on ground and on cards in every theme */
  --accent: var(--t-btn);
  --on-accent: var(--t-on-btn);
  --track: var(--t-card);
  --focus: var(--t-ink);
}

/* ============ 3. Base ============ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: .18em; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.print-only { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============ 4. Chrome components ============ */

/* --- page shell --- */
.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-6); }
.page--narrow { max-width: 560px; }
.page--flush { padding-left: 0; padding-right: 0; padding-top: 0; }

.app-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 56px; margin-bottom: var(--space-4); }
.brand {
  display: inline-block; padding: .2em .65em .25em; border-radius: var(--radius-pill);
  background: var(--sticker-yellow); color: var(--plum);
  font: 800 1.25rem/1.2 var(--font-display); letter-spacing: -.02em; text-decoration: none;
  transform: rotate(-3deg); box-shadow: 2px 3px 0 rgb(31 21 56 / .18);
}

.page__title { font: 800 clamp(1.9rem, 6vw, 2.75rem)/1.02 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.section-title { font: 700 1.3rem/1.15 var(--font-display); letter-spacing: -.015em; }
.lede { font-size: 1.0625rem; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-2); }

.stack > * + * { margin-top: var(--gap, var(--space-4)); }
.stack--lg { --gap: var(--space-5); }
.stack--sm { --gap: var(--space-2); }
.stack > .sr-only:first-child + * { margin-top: 0; } /* a hidden heading first in a stack takes no gap */

/* form beside live preview; stacks on phones */
.split { display: grid; gap: var(--space-5); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: var(--space-6); align-items: start; }
  .split__aside { position: sticky; top: var(--space-4); }
}

/* rounded window around a screen flyer (live preview, styleguide) */
.flyer-frame {
  max-width: 400px; margin-inline: auto; border-radius: 28px; overflow: hidden;
  box-shadow: 0 0 0 1px rgb(31 21 56 / .08), 0 24px 48px -24px rgb(31 21 56 / .45);
}

/* --- card --- */
.card { background: var(--surface); border: 1px solid var(--surface-line); border-radius: var(--radius-card); padding: var(--space-5) var(--space-4); }
.card__title { font: 700 1.15rem/1.2 var(--font-display); letter-spacing: -.01em; margin-bottom: var(--space-3); }
@media (min-width: 560px) { .card { padding: var(--space-5); } }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 22px; border: 2px solid transparent; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink);
  font: 700 1rem/1.1 var(--font-body); text-decoration: none; text-align: center; cursor: pointer;
  transition: transform .08s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(.94); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--secondary { border-color: currentColor; }
.btn--ghost { padding-inline: 12px; text-decoration: underline; text-underline-offset: .2em; }
.btn--danger { color: var(--danger); border-color: currentColor; background: var(--white); }
.btn--sm { min-height: 44px; padding-inline: 16px; font-size: .9375rem; }
.btn--block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn[aria-busy="true"] { cursor: progress; opacity: .75; }

/* --- fields --- */
.field { display: grid; gap: 6px; }
.field__label { font-weight: 700; font-size: .9375rem; }
.field__label .optional { font-weight: 500; color: var(--ink-2); }
.field__hint { font-size: .875rem; color: var(--ink-2); }
.field__control {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  background: var(--white); color: var(--plum);
  border: 1.5px solid var(--edge-strong); border-radius: var(--radius-field);
  font-size: 1rem; line-height: 1.35; /* 16px stops iOS zooming on focus */
  -webkit-appearance: none; appearance: none;
}
.field__control::placeholder { color: #736C8A; opacity: 1; }
.field__control:focus-visible { border-color: var(--plum); outline-offset: 1px; }
textarea.field__control { min-height: 104px; resize: vertical; }
input[type="date"].field__control, input[type="time"].field__control { display: block; min-width: 0; }
input.field__control::-webkit-date-and-time-value { text-align: left; }
select.field__control {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F1538' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.field__error {
  justify-self: start; padding: 3px 9px; border-radius: 7px;
  background: var(--danger-soft); color: var(--danger); font-size: .875rem; font-weight: 700;
}
.field--error .field__control, .field__control[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }

/* ==== photo of the birthday kid (event-form.js): a compact row in the form + the "Your party portrait" modal.
   The painting is the die-cut sticker it is on the flyer (its own white outline, flat shadow, 4° tilt); the
   photo they chose leans the other way like a snapshot. The native file input is .sr-only; the buttons open it. ==== */
.photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.photo-row .photo-sticker { margin-right: var(--space-1); }
.photo-row .btn--ghost { padding-inline: 10px; }
.photo-sticker { --size: 60px; display: grid; place-items: center; flex: none; width: var(--size); aspect-ratio: 1; }
/* the painting is a die-cut PNG with its own white outline: shown as is, with the flyer's flat shadow and tilt */
.photo-sticker img { width: 100%; height: 100%; object-fit: contain; transform: rotate(4deg); filter: drop-shadow(2px 3px 0 rgb(31 21 56 / .18)); }
.photo-sticker--empty { border: 2px dashed var(--edge-strong); border-radius: 50%; }
.photo-sticker--empty::before { /* camera glyph, in the theme's accent */
  content: ""; width: 44%; aspect-ratio: 1; background: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5A1.5 1.5 0 0 1 5 7h2.2l1.6-2.2h6.4L16.8 7H19a1.5 1.5 0 0 1 1.5 1.5v9A1.5 1.5 0 0 1 19 19H5a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3Ccircle cx='12' cy='12.8' r='3.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.photo-field:has(.sr-only:focus) .photo-sticker { outline: 3px solid var(--focus); outline-offset: 3px; } /* the input took focus (a field error) */
.photo-field__stale { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-1); }
.photo-field__stale .btn { margin-block: -8px; padding-inline: 6px; font-size: inherit; } /* text-sized in the line, 44px to tap */

.portrait-modal { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-5); align-items: center; margin-bottom: var(--space-4); }
.portrait-modal__photo {
  width: 100%; aspect-ratio: 1; object-fit: cover; border: 4px solid var(--white); border-radius: var(--radius-field);
  transform: rotate(-3deg); box-shadow: 2px 3px 0 rgb(31 21 56 / .18), 0 0 0 1px var(--edge);
}
.portrait-modal__side { display: grid; justify-items: center; align-content: center; gap: var(--space-3); min-height: 300px; text-align: center; } /* the painting + its line, so the dialog keeps its height across states */
.portrait-modal__status { color: var(--ink-2); font-size: .9375rem; max-width: 30ch; }
.portrait-modal__status:empty { display: none; }
.portrait-modal__result { justify-self: stretch; display: grid; justify-items: center; }
/* in the modal: a swatch of the theme's sky (the poster's art colour) with the sticker on it, as it will sit on the card */
.photo-sticker--lg { --size: min(260px, 100%); padding: 6%; border-radius: var(--radius-card); background: var(--t-sky, var(--track)); }
.photo-sticker--lg img { filter: drop-shadow(4px 6px 0 rgb(31 21 56 / .18)); }
.photo-sticker--painting { /* where the painting will land: a slow wash of the theme's sky */
  background: linear-gradient(110deg, color-mix(in srgb, var(--t-sky) 45%, var(--white)) 35%, var(--t-sky) 50%, color-mix(in srgb, var(--t-sky) 45%, var(--white)) 65%) 0 0 / 300% 100%;
  animation: portrait-wash 1.6s linear infinite, portrait-breathe 3.2s ease-in-out infinite;
}
.photo-sticker--done img { animation: portrait-in .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes portrait-wash { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes portrait-breathe { 50% { transform: scale(.97); } }
@keyframes portrait-in { from { opacity: 0; transform: rotate(-8deg) scale(.7); } }
@media (max-width: 559px) {
  .portrait-modal { grid-template-columns: 1fr; justify-items: center; gap: var(--space-3); }
  .portrait-modal__photo { width: 88px; }
  .portrait-modal__side { min-height: 0; justify-self: stretch; }
  .photo-sticker--lg { --size: min(240px, 70vw); }
}
/* ==== end photo ==== */

.field-row { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); align-items: start; }
/* date · starts · ends: Chrome's date input needs ~135px for "mm/dd/yyyy" + its icon, so on phones Date takes the
   row and Starts · Ends share the next; one row of three from 480px */
.field-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.field-row--3 > :first-child { grid-column: 1 / -1; }
.field-row--3 .field__control { padding-inline: 8px; }
@media (min-width: 480px) { .field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .field-row--3 > :first-child { grid-column: auto; } }

/* the form's submit row: full width on phones, natural width from 560px */
@media (min-width: 560px) { .form-actions .btn--block { display: inline-flex; width: auto; } }

/* the party form in four numbered steps; the 4th folds away in a <details> */
.form-step__legend { display: flex; align-items: center; gap: var(--space-2); padding: 0; font: 700 1.2rem/1.2 var(--font-display); letter-spacing: -.01em; }
.form-step__num {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 1rem;
}
.form-step > .form-step__legend + * { margin-top: var(--space-4); } /* even when that child is a .stack--sm with its own --gap */
.sender-row { gap: var(--space-2); }
.sender-row__address { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.form-extras { border-top: 1px solid var(--surface-line); border-bottom: 1px solid var(--surface-line); padding-block: var(--space-3); }
.form-extras__summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-2); align-items: center; min-height: 44px; cursor: pointer; list-style: none; }
.form-extras__summary::-webkit-details-marker { display: none; }
.form-extras__summary::before { /* chevron: points right closed, down open */
  content: ""; grid-row: 1; width: 10px; height: 10px; margin-inline: 10px 2px; border: solid var(--ink-2); border-width: 0 2.5px 2.5px 0;
  transform: rotate(-45deg); transition: transform .15s ease;
}
.form-extras[open] > .form-extras__summary::before { transform: rotate(45deg); }
.form-extras__summary .form-step__legend { grid-row: 1; }
.form-extras__list { grid-column: 2; font-size: .9375rem; color: var(--ink-2); }
.form-extras__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.form-extras > .form-step { margin-top: var(--space-4); }
/* edit mode: the four steps as closed rows, a settings-style list. The summary is the row: the step name, its values
   (muted, one line with an ellipsis; beneath the name on phones, right of it from 560px) and a chevron that turns */
.stack > .form-step--fold + .form-step--fold { margin-top: 0; }
.form-step--fold { border-bottom: 1px solid var(--surface-line); }
.form-step--fold:first-child { border-top: 1px solid var(--surface-line); }
.form-step__summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: center;
  min-height: 44px; padding-block: var(--space-2); cursor: pointer; list-style: none; border-radius: 8px;
}
.form-step__summary::-webkit-details-marker { display: none; }
.form-step__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-step__summary:hover::after { border-color: var(--ink); }
.form-step__name { font: 700 1.05rem/1.25 var(--font-display); }
.form-step__value { grid-column: 1; display: flex; min-width: 0; font-size: .9375rem; }
.form-step__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-step__unsaved { flex: none; white-space: pre; font-weight: 600; } /* muted, but reads as a state, not a value */
.form-step__unsaved::before { content: " · "; font-weight: 400; }
.form-step__text:empty + .form-step__unsaved::before { content: none; } /* no values left: no separator to lead with */
.form-step--fold[open] .form-step__unsaved { display: none; } /* the fields themselves are showing */
.form-step__summary::after { /* chevron: down closed, up open */
  content: ""; grid-column: 2; grid-row: 1 / span 2; width: 10px; height: 10px; margin-inline: 10px; border: solid var(--ink-2); border-width: 0 2.5px 2.5px 0;
  transform: translateY(-3px) rotate(45deg); transition: transform .15s ease;
}
.form-step--fold[open] > .form-step__summary::after { transform: translateY(3px) rotate(-135deg); }
.form-step--fold > fieldset { margin-block: var(--space-3) var(--space-5); }
@media (min-width: 560px) {
  .form-step__summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .form-step__value { grid-column: 2; justify-content: flex-end; }
  .form-step__summary::after { grid-column: 3; grid-row: 1; }
}

/* --- labelled checkbox (native) --- */
.check { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --- segmented control (native radios) --- */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--track); border: 1px solid var(--surface-line); border-radius: 18px; }
.segmented__option { position: relative; display: block; cursor: pointer; }
.segmented__option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented__option span {
  display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 4px;
  border-radius: 14px; font-weight: 700; text-align: center; line-height: 1.1;
  transition: background-color .12s ease, color .12s ease;
}
.segmented__option input:checked + span { background: var(--accent); color: var(--on-accent); }
.segmented__option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --- number stepper (native number input) --- */
.stepper { display: inline-flex; align-items: center; padding: 3px; background: var(--white); border: 1.5px solid var(--edge-strong); border-radius: var(--radius-pill); }
.stepper__btn {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--t-accent) 12%, var(--white)); color: var(--plum);
  font: 700 1.375rem/1 var(--font-body); cursor: pointer;
}
.stepper__btn:active { transform: scale(.94); }
.stepper__btn:disabled { opacity: .4; cursor: not-allowed; }
.stepper__input {
  width: 3.25rem; height: 44px; padding: 0; border: 0; background: none; color: var(--plum);
  font: 800 1.25rem/1 var(--font-display); text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- theme picker (native radios) --- */
.theme-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (min-width: 560px) { .theme-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.theme-swatch { position: relative; display: grid; gap: 6px; justify-items: center; cursor: pointer; font-size: .875rem; font-weight: 600; text-align: center; }
.theme-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* the chip is the theme's real scene (sceneSvg() from flyer.js), sliced to 5:4 over its ground colour */
.theme-swatch__chip {
  position: relative; display: block; width: 100%; aspect-ratio: 5 / 4; min-height: 56px; overflow: hidden;
  border-radius: 14px; background: var(--t-ground);
}
:is(.theme-swatch__chip, .party__swatch) > svg { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--t-art-ink); }
:is(.theme-swatch__chip, .party__swatch) .fa-sky { color: var(--t-sky); }
:is(.theme-swatch__chip, .party__swatch)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(31 21 56 / .14); } /* the hairline, over the art */
.theme-swatch input:checked + .theme-swatch__chip { outline: 3px solid var(--plum); outline-offset: 3px; }
.theme-swatch input:checked ~ .theme-swatch__name { font-weight: 800; }
.theme-swatch input:focus-visible + .theme-swatch__chip { outline: 3px solid var(--plum); outline-offset: 6px; }

/* --- headcount stat tiles --- */
.stats { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.stat { flex: 1 1 64px; display: grid; gap: 2px; padding: 12px; background: var(--surface); border: 1px solid var(--surface-line); border-radius: 16px; }
.stat__value { font: 800 2rem/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.stat--main { flex-basis: 100%; display: flex; align-items: baseline; gap: 10px; background: var(--sticker-yellow); border-color: transparent; color: var(--plum); }
.stat--main .stat__value { font-size: 2.5rem; }
.stat--main .stat__label { color: var(--plum); }

/* --- RSVP list --- */
.rsvp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-3); align-items: center; padding: 14px 0; border-top: 1px solid var(--surface-line); }
.rsvp:first-child { border-top: 0; }
.rsvp__name { font-weight: 700; overflow-wrap: anywhere; }
.rsvp__meta { display: block; font-size: .875rem; color: var(--ink-2); }
.rsvp__note { grid-column: 1 / -1; padding: 8px 12px; border-radius: 10px; background: var(--track); font-size: .9375rem; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 4px 10px; border-radius: var(--radius-pill); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.badge--yes { background: var(--ok-soft); color: var(--ok); }
.badge--maybe { background: #FFF0BF; color: #5F4100; }
.badge--no { background: #ECE9F3; color: #4A4360; }

/* --- "Your parties" on the home page: one linked row per party --- */
.party-list { background: var(--surface); border: 1px solid var(--surface-line); border-radius: var(--radius-card); overflow: hidden; }
.party { border-top: 1px solid var(--surface-line); }
.party:first-child { border-top: 0; }
.party__link { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; min-height: 64px; padding: 10px var(--space-4); color: inherit; text-decoration: none; }
.party__link:hover { background: var(--track); }
.party__link:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.party__swatch { position: relative; display: block; width: 44px; aspect-ratio: 5 / 4; overflow: hidden; border-radius: 10px; background: var(--t-ground); }
.party__name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.party__meta { display: block; font-size: .875rem; color: var(--ink-2); overflow-wrap: anywhere; }
.party__meta > span { display: block; } /* when, then where: two short lines beat one that wraps mid-date */
.party__go { font-size: 1.5rem; line-height: 1; color: var(--ink-2); }
.party:has(.badge--no) :is(.party__swatch, .party__name) { opacity: .55; } /* past parties sit at the bottom, faded */

/* --- notices and toast --- */
.notice { padding: 12px 16px; border-radius: 14px; background: var(--track); border: 1px solid var(--surface-line); font-size: .9375rem; }
.notice--ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice--error { background: var(--danger-soft); border-color: transparent; color: #8C1220; }
.notice--sticker { background: var(--sticker-yellow); border-color: transparent; color: var(--plum); transform: rotate(-.6deg); box-shadow: 3px 4px 0 rgb(31 21 56 / .16); }
.notice strong { font-weight: 800; }
/* Manage page: the grey "Your manage link is in your inbox (…) · Resend" line that replaces the sticker. */
.manage-link-line { overflow-wrap: anywhere; }
.manage-link-line .btn { vertical-align: middle; padding-inline: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: var(--radius-pill);
  background: var(--plum); color: #FFFFFF; font-weight: 700; font-size: .9375rem; text-align: center;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / .5);
  transform: translateX(-50%); animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* --- copy-link row --- */
.copy-row { display: flex; gap: var(--space-2); align-items: center; }
.copy-row__value { flex: 1; min-width: 0; text-overflow: ellipsis; }

/* --- sticky action bar (phones) --- */
.action-bar {
  position: sticky; bottom: 0; z-index: 20; display: flex; gap: var(--space-2);
  margin-inline: calc(-1 * var(--space-4));
  padding: 12px var(--space-4) calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--surface-line);
}
.action-bar > .btn { flex: 1; }
@media (min-width: 720px) {
  .action-bar { position: static; margin-inline: 0; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; }
  .action-bar > .btn { flex: none; }
}

/* --- empty state --- */
.empty { padding: var(--space-6) var(--space-5); border: 2px dashed var(--surface-line); border-radius: var(--radius-card); text-align: center; color: var(--ink-2); }
.empty__title { font: 700 1.15rem/1.2 var(--font-display); color: var(--ink); margin-bottom: 6px; }

/* ============ 5. Flyer ============
   Built by renderFlyer(). .flyer is a size container; everything inside is in em
   (type) or cqw (art, QR), so it scales with whatever box you put it in. */

.flyer {
  container-type: inline-size;
  display: grid;
  overflow: hidden;
  background: var(--t-ground);
  color: var(--t-ink);
  font-family: var(--font-body);
  text-align: left;
}
.flyer__page { display: flex; flex-direction: column; min-width: 0; min-height: 0; font-size: calc(100cqw / 24); line-height: 1.4; }
:where(.flyer) :where(p, h1, h2, h3, h4, h5, h6) { margin: 0; }

.flyer__art { position: relative; flex: none; height: 60cqw; overflow: hidden; background: var(--t-sky); color: var(--t-art-ink); }
.flyer__art svg { position: absolute; display: block; height: auto; max-width: none; overflow: visible; fill: currentColor; }
.flyer__art .flyer__fill { inset: 0; width: 100%; height: 100%; }
.flyer__art .flyer__floor { left: 0; bottom: -1px; width: 100%; }
.flyer__art .flyer__prop { max-height: calc(96% - var(--offset, 0px)); } /* shrinks to fit when the print panel is short */
/* the portrait: a die-cut sticker (transparent PNG with its own white outline) stuck on the top-right of the
   scene, with the same flat offset shadow and tilt as the pill and the note. Height (not width) carries the
   size so a short print panel shrinks it; the 2em it leaves at the bottom is the "You're invited" pill's overlap. */
.flyer__art .flyer__portrait {
  position: absolute; top: 2cqw; right: 2cqw;
  width: auto; height: min(40cqw, 100% - 2cqw - 2em); max-width: 46%; object-fit: contain;
  transform: rotate(4deg); filter: drop-shadow(.14em .2em 0 var(--shadow, rgb(0 0 0 / .2)));
}
/* keep the theme's hero prop clear: confetti's balloons fill the right edge, space's rocket noses into the corner */
.flyer[data-theme="confetti"] .flyer__portrait { right: auto; left: 3cqw; transform: rotate(-4deg); }
.flyer[data-theme="space"] .flyer__portrait { right: 27cqw; }
.fa1 { color: var(--t-a1); } .fa2 { color: var(--t-a2); } .fa3 { color: var(--t-a3); }
.fa4 { color: var(--t-a4); } .fa5 { color: var(--t-a5); } .fa6 { color: var(--t-a6); }
.faw { color: #FFFFFF; } .fai { color: var(--t-art-ink); }
.fa-floor { color: var(--t-floor); } .fa-star { color: var(--t-star); } .fa-cloud { color: var(--t-cloud); }
.fa-outlined { stroke: var(--t-outline); stroke-width: 2.5; }
.fa-inked { stroke: var(--t-art-ink); stroke-width: 3.5; stroke-linejoin: round; }

.flyer__body { display: flex; flex-direction: column; gap: .95em; padding: 0 1.5em 1.9em; min-width: 0; }
.flyer--screen .flyer__body { position: relative; box-shadow: 0 -1px 0 var(--t-ground); } /* seals the seam under the art */

/* the "You're invited" sticker straddles the art's bottom edge */
.flyer__invite {
  position: relative; align-self: flex-start; margin: -1.15em 0 -.1em -.2em; padding: .5em .95em .55em;
  border-radius: 99em; background: var(--t-sticker); color: var(--t-sticker-ink);
  font-weight: 800; font-size: .88em; line-height: 1;
  transform: rotate(-3deg); box-shadow: .14em .2em 0 var(--shadow, rgb(0 0 0 / .2));
}

.flyer__title {
  font-family: var(--t-font); font-weight: var(--t-font-weight);
  font-size: calc(3.3em * var(--title-scale, 1) * var(--t-title-adj));
  line-height: calc(var(--t-title-lh) + (1 - var(--title-scale, 1)) * .24); /* small type needs more air */
  letter-spacing: var(--t-title-ls);
  color: var(--t-title); text-shadow: var(--t-title-shadow);
  text-wrap: balance; overflow-wrap: anywhere;
}
.flyer__host { font-weight: 700; font-size: 1.08em; line-height: 1.25; margin-top: -.35em; overflow-wrap: anywhere; }

.flyer__facts { display: grid; gap: .9em; padding: 1em 1.1em; border-radius: 1.15em; background: var(--t-card); border: 1px solid var(--t-card-line); }
.flyer__fact { display: grid; grid-template-columns: 1.5em minmax(0, 1fr); gap: .7em; align-items: start; min-width: 0; }
.flyer__icon { width: 1.5em; height: 1.5em; margin-top: .05em; }
.flyer__fact-main { font-weight: 800; font-size: 1.16em; line-height: 1.2; overflow-wrap: anywhere; }
.flyer__fact-sub { line-height: 1.3; margin-top: .15em; overflow-wrap: anywhere; }

.flyer__desc { white-space: pre-line; overflow-wrap: anywhere; text-wrap: pretty; }

/* "What to wear or bring" — a note taped onto the invitation */
.flyer__bring {
  position: relative; margin: .5em .15em .3em; padding: 1em 1.15em .95em;
  border-radius: .35em; background: var(--t-sticker); color: var(--t-sticker-ink);
  transform: rotate(-1.3deg); box-shadow: .22em .3em 0 var(--shadow, rgb(0 0 0 / .2));
}
.flyer__bring::before {
  content: ""; position: absolute; top: -.6em; left: 50%; width: 5.2em; height: 1.25em;
  background: var(--t-tape); transform: translateX(-50%) rotate(-2.5deg);
}
.flyer__bring-label { font-weight: 800; font-size: .82em; line-height: 1.2; opacity: .82; }
.flyer__bring-text { font-weight: 700; font-size: 1.12em; line-height: 1.28; margin-top: .2em; overflow-wrap: anywhere; }

.flyer__foot { font-size: .95em; line-height: 1.35; overflow-wrap: anywhere; }
.flyer__by { font-weight: 800; }
.flyer .is-placeholder { opacity: .55; }

/* --- print variant: the card's own colours, laid out for a page: framed scene, QR panel ---
   Ink saver (.sheet--ink, section 6) is the light, white-paper version. */
.flyer--print {
  aspect-ratio: 7.7 / 10.2; /* Letter minus margins; .sheet overrides */
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.flyer--print { border-radius: 2.4cqw; }
.flyer--print .flyer__page { padding: 3cqw; } /* the coloured card needs its own margin; white paper (ink saver) doesn't */

/* Base type per layout, as printed: full page 15pt, 2-up 11pt, 4-up 8pt (docs/design-consistency.md). */
.flyer--print .flyer__page { font-size: calc(100cqw / var(--print-div, 37) * var(--fit, 1)); }
.sheet--half { --print-div: 32; }
.sheet--quad { --print-div: 33; }
.flyer--print .flyer__art { flex: 1 1 0; height: auto; min-height: 20cqw; border-radius: 2.4cqw; }
.flyer--print .flyer__body { flex: none; gap: .8em; padding: 0 .3em; }
.flyer--print .flyer__title { font-size: calc(4.2em * var(--title-scale, 1) * var(--t-title-adj)); }
.flyer--print .flyer__invite { margin-left: 1em; font-size: 1.12em; } /* .88em × 4.2/3.3: the pill keeps its size relative to the title */
.flyer--print .flyer__facts { grid-template-columns: max-content minmax(0, 1fr); gap: 1.8em; }
.flyer--print .flyer__fact--when .flyer__fact-main { max-width: 14em; }
.flyer--print .flyer__bring { align-self: flex-start; min-width: 55%; max-width: calc(100% - 1.4em); padding-right: 2em; margin-bottom: .5em; }

.flyer__rsvp {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.2em; align-items: center;
  color: #1F1538; /* a light ticket on every ground, so the QR scans */
  padding: 2.2cqw 2.2cqw 2.2cqw 3cqw; border-radius: 2.4cqw;
  background: color-mix(in srgb, var(--t-accent) 9%, #FFFFFF);
}
.flyer__scan { font-family: var(--t-font); font-weight: var(--t-font-weight); font-size: calc(2em * var(--t-title-adj)); line-height: 1.05; letter-spacing: var(--t-title-ls); color: var(--t-accent); }
.flyer__scan-how { font-weight: 700; line-height: 1.3; margin-top: .3em; }
.flyer__rsvp .flyer__contact { margin-top: .3em; font-size: .92em; overflow-wrap: anywhere; }
.flyer__url { margin-top: .3em; font-size: .85em; font-weight: 700; overflow-wrap: anywhere; }
/* QR: sized in cqw so --fit never shrinks it. 24cqw ≈ 1.85in full page, 0.85in on the 4-up. */
.flyer__qr { display: block; width: 24cqw; height: 24cqw; padding: 1.3cqw; border-radius: 1.4cqw; background: #FFFFFF; image-rendering: pixelated; }
.flyer__qr--empty { border: .3cqw dashed var(--edge-strong); }

/* ============ 6. Print sheets ============
   .sheet is one US Letter page. On screen it is a paper preview with the 0.4in
   margin drawn as padding; in print the @page margin takes over. */

.sheet {
  position: relative; container-type: inline-size; display: grid;
  width: 100%; max-width: 8.5in; aspect-ratio: 8.5 / 11; margin: 0 auto var(--space-5);
  padding: 4.706%; /* 0.4in of 8.5in */
  background: #FFFFFF; box-shadow: 0 0 0 1px rgb(31 21 56 / .1), 0 20px 44px -22px rgb(31 21 56 / .4);
}
.sheet .flyer--print { aspect-ratio: auto; min-height: 0; }
.sheet--quad { grid-template: repeat(2, minmax(0, 1fr)) / repeat(2, minmax(0, 1fr)); }
/* 0.17in of white each side of a cut line; outer edges already have the page margin */
.sheet--quad > :nth-child(odd) { margin-right: 2.2cqw; }
.sheet--quad > :nth-child(even) { margin-left: 2.2cqw; }
.sheet--quad > :nth-child(-n + 2) { margin-bottom: 2.2cqw; }
.sheet--quad > :nth-child(n + 3) { margin-top: 2.2cqw; }
.sheet--quad::before, .sheet--quad::after { content: ""; position: absolute; pointer-events: none; }
.sheet--quad::before { top: 0; bottom: 0; left: 50%; border-left: 1px dashed #A9A3BC; }
.sheet--quad::after { left: 0; right: 0; top: 50%; border-top: 1px dashed #A9A3BC; }

/* 2 per page: two half-letter portrait flyers, turned on their side and stacked, one cut across the
   middle. Each .sheet__cell is a size container so the flyer can take the cell's height as its width. */
.sheet--half { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.sheet--half > :first-child { margin-bottom: 2.2cqw; }
.sheet--half > :last-child { margin-top: 2.2cqw; }
.sheet--half::after { content: ""; position: absolute; pointer-events: none; left: 0; right: 0; top: 50%; border-top: 1px dashed #A9A3BC; }
.sheet__cell { position: relative; container-type: size; min-width: 0; min-height: 0; }
.sheet__cell > .flyer--print {
  position: absolute; top: 50%; left: 50%; width: 100cqh; height: 100cqw;
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Ink saver: the same card on white paper. White ground, title in the accent, facts as accent rules
   instead of a fill, lighter skies for the dark-sky themes. */
.sheet--ink .flyer--print {
  --t-ground: #FFFFFF; --t-ink: #1F1538; --t-title: var(--t-accent); --t-title-shadow: none;
  --t-card: transparent; --t-card-line: var(--t-accent);
  --t-sticker: #FFD84D; --t-sticker-ink: #1F1538; --t-tape: rgb(31 21 56 / .14);
}
.sheet--ink .flyer--print.theme-confetti { --t-sky: #FFE3D6; --t-a2: #FF7B54; --t-floor: #FFE3D6; }
.sheet--ink .flyer--print.theme-space { --t-sky: #E7E3FF; --t-floor: #B9AFF5; --t-a5: #9D91EA; --t-star: #4B3BD6; --t-outline: #2A2175; }
.sheet--ink .flyer--print.theme-superhero { --t-sky: #FFF0A0; --t-a1: #FFD60A; --t-title-shadow: .05em .06em 0 #FFD60A; }
.sheet--ink .flyer--print.theme-rainbow { --t-title: #6D35D9; }
.sheet--ink .flyer--print .flyer__facts { padding: .8em 0; border: solid var(--t-accent); border-width: .14em 0; border-radius: 0; }
.sheet--ink .flyer--print .flyer__icon { color: var(--t-accent); }
.sheet--ink .flyer--print { border-radius: 0; }
.sheet--ink .flyer--print .flyer__page { padding: 0; }
.sheet--ink .flyer__invite, .sheet--ink .flyer__bring, .sheet--ink .flyer__portrait { --shadow: rgb(31 21 56 / .22); } /* plum-tinted on white paper */

@page { size: letter portrait; margin: 0.4in; }

@media print {
  html, body { background: #FFFFFF !important; }
  body { margin: 0; padding: 0; }
  .no-print { display: none !important; }
  .print-only { display: revert; }
  .page { max-width: none; padding: 0; }
  .sheet {
    width: 7.7in; max-width: none; height: 10.1in; aspect-ratio: auto;
    margin: 0; padding: 0; box-shadow: none; break-inside: avoid; break-after: page;
  }
  .sheet:last-child { break-after: auto; }
  .sheet, .sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* pages */
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
legend.field__label { margin-bottom: 6px; } /* a fieldset's grid gap doesn't apply after its legend */
/* Guest page: the bar is a phone affordance; once the column is narrower than the screen (592px+) the cards' own buttons are right there. */
@media (min-width: 592px) { .immersive .action-bar { display: none; } }

/* guest list — spec: docs/guest-list-ux.md. Light chrome only (manage page). No sticker yellow here. */

/* --- the two statuses .badge--yes/maybe/no don't cover --- */
.badge--unsent { padding: 2.5px 8.5px; border: 1.5px dashed var(--edge-strong); color: var(--ink-2); }
.badge--sent { background: var(--track); color: var(--ink); box-shadow: inset 0 0 0 1px var(--surface-line); }

/* --- "18 guests  12 sent  7 replied" --- */
.guest-summary { display: flex; flex-wrap: wrap; gap: 2px var(--space-4); color: var(--ink-2); font-weight: 600; }
.guest-summary b { margin-right: 5px; color: var(--ink); font: 800 1.375rem/1.2 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* --- filter chips (native radios) --- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { position: relative; display: block; cursor: pointer; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip > span {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  background: var(--surface); border: 1.5px solid var(--edge-strong); border-radius: var(--radius-pill);
  font-size: .9375rem; font-weight: 700; white-space: nowrap;
}
.chip__count { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip input:checked + span .chip__count { color: inherit; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --- add, email, filter: one toolbar that wraps; on wide screens the filter sits at the far end --- */
.guest-toolbar { gap: var(--space-2); }
@media (min-width: 720px) { .guest-toolbar__filter { margin-left: auto; } }
@media (max-width: 559px) { .guest-toolbar > .btn { flex: 1 1 auto; padding-inline: 14px; } } /* Add + Email share a line */

/* --- the list: contacts-style. A–Z groups; each guest a <button> row (avatar · child + grown-up · status)
   that opens their card in #guest-dialog (quick actions, fields, Edit / Mark as sent / Remove). --- */
.guest-list { display: grid; gap: var(--space-2); margin-inline: calc(-1 * var(--space-2)); }
.guest-letter {
  position: sticky; top: 0; z-index: 1; padding: 6px var(--space-2) 4px;
  background: var(--surface); color: var(--ink-2); font: 800 .8125rem/1.2 var(--font-display); letter-spacing: .06em;
}
.guest__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); width: 100%;
  min-height: 60px; padding: 8px var(--space-2); border: 0; border-radius: 16px; background-color: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.guest__row:hover { background: var(--track); }
.guest__row:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
/* A hairline between rows, starting after the avatar like a phone's list; none beside a hovered row. */
.guest__row + .guest__row {
  background-image: linear-gradient(var(--surface-line), var(--surface-line)); background-repeat: no-repeat;
  background-size: calc(100% - 44px - var(--space-2) - var(--space-3)) 1px; background-position: right top;
}
.guest__row:hover, .guest__row:hover + .guest__row { background-image: none; }
.guest__who { display: grid; min-width: 0; }
.guest__name { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.guest__sub { font-size: .875rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Monogram avatars: one quiet tint of the party's accent; the letters tell guests apart. */
.avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font: 800 1rem/1 var(--font-display); letter-spacing: -.01em;
  background: color-mix(in srgb, var(--accent) 12%, var(--white)); color: var(--accent);
}

/* The guest's card, in #guest-dialog: avatar + name + status as the head, then tiles, fields, actions. */
.guest-head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.guest-head__who { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.guest-head .dialog__title { overflow-wrap: anywhere; }
.guest__card { display: grid; gap: var(--space-3); }
/* Quick actions: round icon buttons with a label under each, as on a phone's contact card. */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.tile {
  display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border: 0; border-radius: 14px;
  background: var(--white); color: var(--t-accent, var(--plum)); font: inherit; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--surface-line);
}
.tile:hover { box-shadow: inset 0 0 0 1.5px var(--t-accent, var(--plum)); }
.tile:disabled { color: var(--edge-strong); cursor: default; box-shadow: inset 0 0 0 1px var(--surface-line); background: transparent; }
.tile__icon { width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.tile__label { font-size: .8125rem; font-weight: 700; }
.tile__icon--text { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3C6.5 3 2 6.8 2 11.5c0 2.4 1.2 4.6 3.1 6.1L4 21l4.3-1.9c1.2.4 2.4.6 3.7.6 5.5 0 10-3.8 10-8.5S17.5 3 12 3z'/%3E%3C/svg%3E"); }
.tile__icon--call { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25c1.1.37 2.3.57 3.6.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.3.2 2.5.57 3.6a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E"); }
.tile__icon--email { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1 2.2V17h16V7.2l-8 5.3z M5.2 7l6.8 4.5L18.8 7z'/%3E%3C/svg%3E"); }
.tile__icon--copy { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-2v-2h2V5H8v2H6V5a2 2 0 0 1 2-2zM5 8h10a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2zm0 2v9h10v-9z'/%3E%3C/svg%3E"); }
.tile__icon--link { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E"); }

/* What we know, as labelled rows on one white panel (like the grouped rows of a contact card). */
.guest__fields { display: grid; padding: 0 var(--space-3); background: var(--white); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--surface-line); }
.guest__field { display: grid; gap: 1px; padding: 10px 0; border-top: 1px solid var(--surface-line); overflow-wrap: anywhere; }
.guest__field:first-child { border-top: 0; }
.guest__label { font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.guest__value { line-height: 1.4; }
.guest__sentnote { display: flex; align-items: center; gap: var(--space-2); font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.guest__remove { color: var(--danger); margin-left: auto; }

/* --- add guests (#add-dialog) and edit (#guest-dialog): the same form --- */
.guest-form { display: grid; gap: var(--space-3); max-width: 36rem; }
.guest-form__contact { display: grid; gap: var(--space-3); align-items: start; }
@media (min-width: 560px) { .guest-form__contact { grid-template-columns: 1fr 1fr; } }

/* --- paste several: what we understood from each line --- */
.guest-preview { max-height: 22rem; overflow: auto; background: var(--white); border: 1px solid var(--surface-line); border-radius: var(--radius-field); }
.guest-preview__row { display: grid; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--surface-line); overflow-wrap: anywhere; }
.guest-preview__row:first-child { border-top: 0; }
.guest-preview__row b { font-weight: 700; }
.guest-preview__row span { font-size: .875rem; color: var(--ink-2); }
.guest-preview__row--error { box-shadow: inset 4px 0 0 var(--danger); }

/* --- "See the text message": read-only bubbles --- */
.guest-message > summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.message-previews { display: grid; gap: var(--space-4); padding-top: var(--space-2); }
@media (min-width: 720px) { .message-previews { grid-template-columns: 1fr 1fr; } }
.message-preview__label { margin-bottom: 6px; font-size: .875rem; font-weight: 700; color: var(--ink-2); }
.message-preview__body {
  padding: 12px 16px; border-radius: 18px 18px 6px 18px; background: var(--track); border: 1px solid var(--surface-line);
  font-size: .9375rem; white-space: pre-line; overflow-wrap: anywhere;
}

.guest-privacy { font-size: .875rem; color: var(--ink-2); }

/* --- modal: every flow that steps out of the page (add guests, a guest's card, the photo, sending,
   confirmations). openModal() in common.js wires it. A centred card on wide screens; a sheet that slides
   up from the bottom on phones, where the thumb is. `dialog--wide` for the two-column photo modal. --- */
.dialog {
  width: min(100% - 32px, 32rem); max-height: calc(100dvh - 32px); padding: var(--space-4) var(--space-4) var(--space-5); overflow: auto;
  background: var(--white); color: var(--plum); border: 1px solid var(--surface-line); border-radius: var(--radius-card);
  box-shadow: 0 30px 60px -24px rgb(31 21 56 / .6);
}
.dialog--wide { width: min(100% - 32px, 44rem); }
.dialog::backdrop { background: rgb(31 21 56 / .55); }
.dialog[open] { animation: dialog-in .22s ease-out; }
.dialog[open]::backdrop { animation: backdrop-in .22s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes backdrop-in { from { opacity: 0; } }
@media (min-width: 560px) { .dialog { padding: var(--space-5); } }
@media (max-width: 559px) {
  .dialog {
    width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border: 0; border-radius: 20px 20px 0 0;
    padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  }
  .dialog[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .dialog::before { content: ""; display: block; width: 40px; height: 4px; margin: -6px auto 10px; border-radius: 2px; background: var(--edge); } /* the sheet's grab handle */
}
@media (prefers-reduced-motion: reduce) { .dialog[open], .dialog[open]::backdrop { animation: none; } }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.dialog__title { margin: 0; font: 800 1.25rem/1.2 var(--font-display); color: var(--ink); }
.dialog__close {
  flex: none; width: 44px; height: 44px; margin: -10px -10px 0 0; border: 0; border-radius: 50%; background: var(--track); color: var(--ink-2);
  font: 400 1.5rem/1 var(--font-body); cursor: pointer;
}
.dialog__close:hover { background: var(--edge); color: var(--ink); }
.dialog__close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.dialog__close:disabled { opacity: .4; cursor: default; } /* a request is in flight */
/* toast() puts the toast inside an open modal (the top layer covers the page); up top, clear of a sheet's buttons */
.dialog .toast { top: calc(var(--space-4) + env(safe-area-inset-top, 0px)); bottom: auto; }
.dialog__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.dialog__actions > .btn--primary { order: -1; }
@media (max-width: 559px) { .dialog__actions > .btn { flex: 1 1 auto; } }

/* who gets the email: one native checkbox per guest */
.pick-list { max-height: 15rem; overflow: auto; border: 1px solid var(--surface-line); border-radius: var(--radius-field); }
.pick { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 var(--space-3); align-items: center; min-height: var(--tap); padding: 6px 14px; border-top: 1px solid var(--surface-line); cursor: pointer; }
li:first-child > .pick { border-top: 0; }
.pick input { grid-row: span 2; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.pick__name { font-weight: 700; overflow-wrap: anywhere; }
.pick__meta { grid-column: 2; font-size: .875rem; color: var(--ink-2); overflow-wrap: anywhere; }

.send-progress { display: block; width: 100%; height: 12px; accent-color: var(--accent); }

/* who was not emailed, and why */
.send-result { display: grid; gap: 0 var(--space-3); padding: 10px 0; border-top: 1px solid var(--surface-line); overflow-wrap: anywhere; }
.send-result:first-child { border-top: 0; }
.send-result b { font-weight: 700; }
.send-result span { font-size: .875rem; color: var(--ink-2); }
.send-result--failed span { color: var(--danger); font-weight: 700; }

/* home page hero: the invitation first, then the one button */
.hero {
  display: grid; gap: var(--space-4); justify-items: center; text-align: center;
  grid-template-areas: "copy" "flyer" "cta" "themes";
}
.hero__flyer { grid-area: flyer; width: min(100%, 400px); transition: opacity .35s ease, transform .35s ease; }
/* As tall as the tallest sample (superhero, 1.9× its width) at every width: shorter ones stretch, the card's own
   ground colour fills the bottom, and the page doesn't jump as the themes cycle. A taller draft still grows it. */
.hero__flyer { display: grid; aspect-ratio: 10 / 19; }
.hero__flyer--swap { opacity: 0; transform: translateY(6px); }
.hero__cta { grid-area: cta; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.hero__themes { grid-area: themes; width: min(100%, 400px); } /* a .theme-picker: the same swatches as the form */
.hero__copy { grid-area: copy; }
.hero .page__title { font-size: clamp(2.125rem, 6vw, 2.75rem); }
@media (max-width: 559px) {
  /* phones: the six hero swatches stay one row (as on desktop) and the CTA pair goes block-width */
  .hero__themes { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-2); }
  .hero__themes .theme-swatch { font-size: .75rem; }
  .hero__cta { flex-direction: column; align-items: stretch; width: min(100%, 400px); }
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); grid-template-rows: auto 1fr auto; /* the copy row hugs the copy, so the CTA sits right under it */
    grid-template-areas: "flyer copy" "flyer cta" "themes ."; column-gap: var(--space-6); align-items: start;
    justify-items: start; text-align: left; padding-block: var(--space-4);
  }
  .hero__flyer { width: 100%; justify-self: center; }
  .hero__themes, .hero__cta { justify-content: flex-start; }
  .hero__copy { align-self: start; padding-top: var(--space-3); }
  .hero .page__title { font-size: clamp(2rem, 4.2vw, 3.5rem); }
  .hero .lede { font-size: 1.125rem; }
  .returning .hero__copy { align-self: end; padding-top: 0; } /* the returning brand card stays as it was */
}
@media (prefers-reduced-motion: reduce) { .hero__flyer { transition: none; } }
/* returning parents (body.returning, set by create.js when the device holds parties): the hero shrinks to a
   brand card beside the copy, the list is the page, and the form waits behind "Plan a new party" */
.returning .hero { grid-template-columns: minmax(104px, 150px) minmax(0, 1fr); grid-template-areas: "flyer copy"; align-items: center; justify-items: start; text-align: left; gap: var(--space-4); padding-block: 0; }
.returning .hero__flyer { width: 100%; }
.returning .hero__cta, .returning .hero__themes { display: none; }
.returning .hero .page__title { font-size: clamp(1.35rem, 4vw, 1.9rem); }
.returning .hero .lede { font-size: .9375rem; }

/* home page "How it works": three cards whose pictures are the system's own pieces, so they follow the theme */
.how-list { display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .how-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.how { display: grid; grid-template-rows: auto auto 1fr; gap: var(--space-2); }
.how__art { display: flex; align-items: center; justify-content: center; gap: var(--space-3); height: 152px; margin-bottom: var(--space-2); overflow: hidden; border-radius: 14px; background: var(--track); }
.how__flyer { width: 84px; height: 132px; margin: 0; border-radius: 12px; } /* the fluid flyer at 84px, cropped to its top */
.how__field { width: auto; min-height: 0; padding: 6px 10px; font-size: .875rem; transform: rotate(-3deg); }
.how__qr { width: 104px; height: 104px; color: var(--accent); filter: drop-shadow(2px 3px 0 rgb(31 21 56 / .16)); transform: rotate(-4deg); }
.how__art--rsvps { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: var(--space-3) var(--space-3) 0; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); } /* the list runs on */
.how__art--rsvps .stat--main { padding: 6px 12px; }
.how__art--rsvps .stat--main .stat__value { font-size: 1.75rem; }
.how__art--rsvps .rsvp { padding: 8px 0; font-size: .875rem; }
.how__title { font: 700 1.15rem/1.2 var(--font-display); letter-spacing: -.01em; }
.returning .how-it-works { display: none; } /* returning parents see their list; the planner tour is for first visits */

/* site footer: one quiet line; guest pages carry the only "make your own" link */
.site-footer { margin-top: var(--space-6); padding: var(--space-5) 0 var(--space-6); border-top: 1px solid var(--surface-line); display: grid; gap: var(--space-4); }
.site-footer__meta { margin: 0; font-size: .8125rem; color: var(--ink-2); }

/* party page tabs: a sticky strip that jumps to each section */
:root { --tabs-h: 40px; } /* the tab strip's height: the sticky card and scroll targets clear it */
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding: var(--space-2) 0; margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-4); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab { flex: none; min-height: var(--tabs-h); display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--radius-pill); border: 2px solid var(--surface-line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9375rem; background: var(--surface); }
.tabs__tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tabs__tab { cursor: pointer; font: inherit; font-weight: 700; }
.tabs__tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tab-panel { display: grid; gap: var(--space-5); }
/* manage page Party tab: the invitation card first; ≥ 900px it's a sticky right column beside the cards (like .split).
   The 1fr last row soaks up the card's height so the cards on the left keep their own gaps. */
.party-panel > .flyer-frame { width: 100%; scroll-margin-top: calc(var(--tabs-h) + 2 * var(--space-2) + var(--space-4)); } /* clears the sticky .tabs strip */
@media (min-width: 900px) {
  .party-panel { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); grid-template-rows: auto auto auto 1fr; column-gap: var(--space-6); align-items: start; }
  .party-panel > * { grid-column: 1; }
  .party-panel > .flyer-frame { grid-column: 2; grid-row: 1 / -1; }
}
/* the card only sticks when a whole card fits under the tab strip; on a short window it scrolls with the page */
@media (min-width: 900px) and (min-height: 860px) {
  .party-panel > .flyer-frame { position: sticky; top: calc(var(--tabs-h) + 2 * var(--space-2) + var(--space-4)); }
}

/* home page: on phones the hero card doubles as the live preview, so the second card goes */
@media (max-width: 899px) { .split--hero .split__aside { display: none; } }
/* ...and a 72px strip stays stuck at the top while the form scrolls: swatch, title, "Open" (back to the hero card) */
.preview-strip {
  position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
  height: 72px; margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-4);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-line);
}
.preview-strip__title { font: 700 1.05rem/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-strip__title.is-placeholder { color: var(--ink-2); }
@media (min-width: 900px) { .preview-strip { display: none; } } /* the side preview is in view there */

/* RSVP conclusion */
.done__sticker { align-self: flex-start; display: inline-block; background: var(--sticker-yellow); color: var(--plum); font: 800 .875rem/1 var(--font-display); padding: 8px 14px; border-radius: 999px; transform: rotate(-2deg); margin: 0; }
.done__answer { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius-field); background: var(--track, rgb(255 255 255 / .12)); }
.done__who { font-weight: 700; }
.done__answer .rsvp__note { grid-column: 1 / -1; margin: 0; }
.next-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.next-steps li { display: grid; gap: 2px; padding: var(--space-3) 0; border-top: 1px solid var(--surface-line); }
.next-steps li:first-child { border-top: 0; padding-top: 0; }

/* guest page polish */
:root { color-scheme: light; } /* the app is light-only: keeps OS dark mode from restyling scrollbars and the white fields */

/* Column. Phones: the flyer and the sticky bar run edge to edge, cards keep a 16px gutter.
   From 592px the 560 column is narrower than the screen, so the gutter goes and the flyer, every
   card and the footer's inner column share the same two edges (that was the footer "poking out"). */
.guest-hero { margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-2); } /* the flyer's own bottom padding does most of the spacing */
.guest-main > * + * { margin-top: var(--space-5); }
.immersive .action-bar { margin-top: var(--space-5); }
@media (min-width: 592px) {
  .immersive .page--narrow { padding: var(--space-6) 0; }
  .guest-hero { margin: 0 0 var(--space-2); }
  .guest-hero .flyer { border-radius: 28px; } /* a poster on the ground, not a cut-out: rounds the art's corners (the body is ground-coloured) */
}
@media (min-width: 900px) { .page--narrow { max-width: 640px; } } /* a wider poster on desktop; still one reading column */

/* When & where: the flyer already says it; here only the three utility links (and the zone line for a far-away viewer) */
.guest-links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.guest-links + .field__hint { margin-top: var(--space-3); max-width: 48ch; }
.guest-about { white-space: pre-line; overflow-wrap: anywhere; max-width: 60ch; }

/* Going / Maybe / Can't come: an inset well a shade darker than the ground, not a third layer of glass
   (white labels on glass-on-glass were 4.2:1 on splash and dino; this is ≥ 7:1 everywhere) */
.immersive .segmented { background: color-mix(in srgb, var(--t-ground) 86%, black); border-color: transparent; }

/* Conclusion: one primary (calendar); maps and "change" share a row */
.done__row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.done__row > .btn { flex: 1 1 auto; padding-inline: 10px; } /* side by side from 390px; each on its own line on narrower phones */
.done__keep { font-size: .875rem; }

/* Footer: a paper band under the themed page, full viewport width at every size; its content sits in the 560 column */
.immersive .site-footer {
  display: block; margin: 0; padding: var(--space-5) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  background: var(--paper); color: var(--plum); border-top: 1px solid var(--edge); border-radius: 28px 28px 0 0;
  --ink: var(--plum); --ink-2: var(--plum-2); --surface: var(--white); --surface-line: var(--edge); --accent: var(--plum); --on-accent: #fff; --focus: var(--plum);
}
.site-footer__inner { display: grid; gap: var(--space-4); max-width: 560px; margin: 0 auto; }
@media (min-width: 900px) { .site-footer__inner { max-width: 640px; } } /* follows .page--narrow's desktop column */

/* Printing the invitation page gives the flyer as a poster plus the plain-text details; no form, no chrome */
@media print {
  .immersive { --ink: var(--plum); --ink-2: var(--plum-2); --surface: transparent; --surface-line: var(--edge); }
  .immersive .page--narrow { max-width: none; padding: 0; }
  .guest-hero { max-width: 5.2in; margin: 0 auto .3in; }
  .guest-hero .flyer { border-radius: .2in; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .guest-main > * + * { margin-top: var(--space-4); }
  .immersive .card { max-width: 5.2in; margin-inline: auto; break-inside: avoid; }
  .immersive #rsvp, .immersive #coming, .immersive #past, .guest-links, #ios-cal-hint { display: none !important; }
}
