/* Verena & Tom: a rose garden, not a winter.
 *
 * One bold thing: the names, drawn by hand in Pinyon Script, and the two
 * place cards below them. Everything else stays quiet: one column, large
 * type for the grandparents, rose on bordeaux.
 *
 * Deliberately absent: green of any kind, gold, stars, snow, candles, fir.
 */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "Pinyon Script";
  src: url("/static/fonts/pinyon-script.woff2") format("woff2");
  font-display: swap;
}

/* Pinyon's ampersand is a curled "Et"; Parisienne's reads as "&". This face
   holds that one glyph and stands in front of Pinyon for it. */
@font-face {
  font-family: "Script Ampersand";
  src: url("/static/fonts/parisienne-amp.woff2") format("woff2");
  unicode-range: U+0026;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/static/fonts/atkinson-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/static/fonts/atkinson-next-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

/* ----------------------------------------------------------------- tokens */

:root {
  color-scheme: dark;

  /* The palette. Rules never use these directly, only the roles below. */
  --bordeaux: #6e1e2e;
  --bordeaux-dark: #4e1420;
  --bordeaux-deep: #561724;
  --rose: #d9a9a8;
  --rose-light: #f1dedb;
  --ivory: #fbf7f4;

  /* Roles: bordeaux page, rose ink. Every text pair is at least 4.5:1
     (checked): ivory on bordeaux 10.4, rose-light 8.6, rose 5.4, buttons 11.2. */
  --bg: var(--bordeaux);
  --text: var(--ivory);
  --text-soft: #ebd3d0;
  /* Headings, names, links, buttons. */
  --accent: var(--rose-light);
  --accent-strong: var(--ivory);
  /* Text on an accent-filled button or pill. */
  --on-accent: var(--bordeaux-dark);
  /* Hairlines, stems, dividers. Never text. */
  --deco: var(--rose);
  --surface: var(--bordeaux-deep);
  --surface-strong: var(--bordeaux-dark);
  --surface-faint: var(--bordeaux-deep);
  --leaf: #8c3f4b;
  --field: var(--bordeaux-dark);
  /* Form borders need 3:1 against the page. */
  --line: var(--rose);
  --focus: var(--ivory);
  /* Place cards that are not open: rose with the colour taken out. */
  --muted-text: #e6d8d8;
  /* Copper, for hairlines only, never for text. */
  --copper: #d9a08c;
  --error: #ffc9c4;

  --font-script: "Script Ampersand", "Pinyon Script", cursive;
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;

  /* Type scale on a 5:4 step from a 19px body. */
  --step-0: 1.1875rem;
  --step-1: 1.484rem;
  --step-2: 1.855rem;
  --step-3: 2.32rem;
  --step--1: 1.0625rem;

  --measure: 34rem;
  --gutter: 1rem;
  --touch: 3.25rem;
  --radius: 0.75rem;
}

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }
}

/* ------------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  color: var(--accent);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: var(--step-3);
}

h2 {
  font-size: var(--step-2);
  margin-top: 1.5em;
}

h3 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-strong);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 4rem;
}

.lead {
  color: var(--text-soft);
}

.aside {
  color: var(--text-soft);
  font-size: var(--step--1);
}

.back {
  display: inline-block;
  font-family: var(--font-script);
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

/* -------------------------------------------------------------- ornament */

.ornament {
  display: block;
  width: min(15rem, 70%);
  margin: 1.5rem auto;
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.ornament-stem {
  stroke: var(--deco);
}

.ornament-rose {
  stroke: var(--accent);
}

/* ------------------------------------------------------------------- hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem var(--gutter) 0;
  isolation: isolate;
  /* The painting as wide as the place cards below it (capped, so on a wide
     screen the cards still show); the gap to the names follows it. */
  --paint: min(26rem, 100vw - 2 * var(--gutter));
  --crest: min(9.25rem, 28.5vw);
}

/* The watercolor behind the card, held back so the rose ink on top stays
   readable. Measured from the top of the wreath (C high) in painting
   widths (P):

     0            wreath, over the sky
     C - 0.16P    painting starts; their hair begins 13 % down, below the wreath
     C + 0.54P    names, at the height of their knees (55 % down the painting)
     C + 1.1P     painting ends, faded out */
.hero-painting {
  position: absolute;
  z-index: -1;
  top: calc(var(--crest) - var(--paint) * 0.16);
  left: 50%;
  translate: -50% 0;
  width: var(--paint);
  height: auto;
  opacity: 0.3;
  -webkit-mask-image: linear-gradient(black 75%, transparent);
  mask-image: linear-gradient(black 75%, transparent);
}

.crest {
  position: relative;
  width: var(--crest);
}

/* On a phone the first place card has to show without scrolling. */
@media (max-width: 30rem) {
  .hero {
    padding-top: 1rem;
  }
}

.wreath {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.w-ring {
  fill: none;
  stroke: var(--copper);
  stroke-width: 0.8;
}

.w-stem {
  fill: none;
  stroke: var(--deco);
  stroke-width: 1.1;
  stroke-linecap: round;
}

.w-leaf {
  fill: var(--leaf);
  stroke: var(--deco);
  stroke-width: 0.8;
}

.w-rose path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: round;
}

/* The monogram sits in the ring at two thirds of its width. */
.crest-monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.monogram {
  width: 64%;
  height: auto;
  fill: var(--accent);
  overflow: visible;
}

.hero-names {
  margin: calc(var(--paint) * 0.54) auto 0;
  width: min(24rem, 86vw);
}

.names {
  display: block;
  width: 100%;
  height: auto;
  fill: var(--accent);
  overflow: visible;
}

.hero-line {
  font-family: var(--font-head);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 36;
  color: var(--accent-strong);
  margin: 0;
}

.hero-line-1 {
  margin-top: 0.25rem;
}

.hero-date {
  font-style: normal;
  font-size: var(--step-1);
  font-variation-settings: "SOFT" 100, "opsz" 72;
  margin: 0.35rem 0 0.1rem;
}

.welcome {
  font-family: var(--font-head);
  font-size: var(--step-1);
  text-align: center;
  color: var(--accent-strong);
}

/* ------------------------------------------------------------------ intro */

/* One orchestrated sequence, modelled on a printed card coming to life:
 *
 *   0.3s  the watercolor runs out from the roses (SMIL, home.html)
 *   2.4s  it sinks back behind the card; the card starts at --card:
 *  +0.0s  ring draws
 *  +0.6s  stems, leaves and roses grow, one after another (--d)
 *  +1.0s  the monogram writes itself, glyph by glyph (--i)
 *  +2.4s  "Verena & Tom" writes itself
 *  +4.2s  heiraten / am 23. Dezember / um 14:00 Uhr fade in
 *  +5.6s  the whole card slides up from the middle of the screen
 *  +6.1s  the place cards appear below it
 *
 * A tap anywhere skips to the end (intro.js).
 */
.intro-play {
  --card: 3.2s;
}

/* Nothing to scroll to while the card is still being written. */
.intro-play body {
  overflow: hidden;
}

.intro-play .hero {
  min-height: 100svh;
  animation: intro-rise 0.9s cubic-bezier(0.45, 0, 0.2, 1) calc(var(--card) + 5.6s) forwards;
}

/* Full strength while the colour runs, then back to its resting opacity. */
.intro-play .hero-painting {
  animation: intro-sink 0.8s ease 2.4s backwards;
}

.intro-play .wreath [pathLength],
.intro-play .monogram path,
.intro-play .names path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.intro-play .w-ring {
  animation: intro-draw 1s ease-in-out var(--card) forwards;
}

.intro-play .w-stem,
.intro-play .w-rose path {
  animation: intro-draw 0.6s ease-out calc(var(--card) + 0.6s + var(--d) * 0.08s) forwards;
}

.intro-play .w-leaf {
  fill-opacity: 0;
  animation:
    intro-draw 0.5s ease-out calc(var(--card) + 0.6s + var(--d) * 0.08s) forwards,
    intro-leaf 0.5s ease calc(var(--card) + 0.9s + var(--d) * 0.08s) forwards;
}

.intro-play .monogram path,
.intro-play .names path {
  fill-opacity: 0;
  stroke: var(--accent);
  stroke-width: 24;
}

.intro-play .monogram path {
  animation:
    intro-draw 1s ease-in-out calc(var(--card) + 1s + var(--i) * 0.3s) forwards,
    intro-fill 0.6s ease calc(var(--card) + 2.4s) forwards;
}

.intro-play .names path {
  animation:
    intro-draw 0.9s ease-in-out calc(var(--card) + 2.4s + var(--i) * 0.1s) forwards,
    intro-fill 0.6s ease calc(var(--card) + 3.8s) forwards;
}

.intro-play .hero-line {
  animation: intro-appear 0.7s ease both;
}

.intro-play .hero-line-1 {
  animation-delay: calc(var(--card) + 4.2s);
}

.intro-play .hero-line-2 {
  animation-delay: calc(var(--card) + 4.5s);
}

.intro-play .hero-line-3 {
  animation-delay: calc(var(--card) + 4.8s);
}

.intro-play .page {
  animation: intro-appear 0.8s ease calc(var(--card) + 6.1s) both;
}

@keyframes intro-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes intro-fill {
  to {
    fill-opacity: 1;
    stroke-width: 0;
  }
}

@keyframes intro-sink {
  from {
    opacity: 1;
  }
}

/* Leaves keep their outline once filled; only the lettering drops it. */
@keyframes intro-leaf {
  to {
    fill-opacity: 1;
  }
}

@keyframes intro-rise {
  to {
    min-height: 0;
  }
}

@keyframes intro-appear {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-play * {
    animation: none !important;
  }
}

/* ----------------------------------------------------------- place cards */

/* Two wide place cards, as on the tables at the reception: a hairline frame
   inside the card and a wax seal with the rose on the left.

     +--------------------------------------+
     | +----------------------------------+ |
     | | (@)  Zusagen                     | |
     | |      Bis 1. November             | |
     | +----------------------------------+ |
     +--------------------------------------+
*/
.entries {
  display: grid;
  gap: 0.75rem;
  margin: 0.5rem 0 2.5rem;
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 1rem;
  min-height: 5.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.entry::before {
  content: "";
  position: absolute;
  inset: 0.375rem;
  border: 1px solid var(--copper);
  border-radius: calc(var(--radius) - 0.25rem);
  pointer-events: none;
}

a.entry:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.entry-seal {
  grid-row: span 2;
  width: 2.75rem;
  height: 2.75rem;
  overflow: visible;
}

/* The seal's state (partials/seal.html): filled wax with a pressed emblem,
   a check stamped on once done, only an outline while not open. */
.seal-wax {
  fill: var(--accent);
}

.entry-seal path {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-seal .seal-fill {
  fill: var(--on-accent);
}

.seal-check circle {
  fill: var(--on-accent);
  stroke: var(--accent);
  stroke-width: 1.4;
}

.entry-seal .seal-check path {
  stroke: var(--accent);
  stroke-width: 1.8;
}

.seal-off .seal-wax {
  fill: none;
  stroke: var(--muted-text);
  stroke-width: 1.4;
}

.seal-off path {
  stroke: var(--muted-text);
}

.seal-off .seal-fill {
  fill: var(--muted-text);
}

.entry-title {
  font-family: var(--font-head);
  font-size: var(--step-1);
  font-variation-settings: "SOFT" 100, "opsz" 72;
  color: var(--accent);
  line-height: 1.15;
}

a.entry:hover .entry-title {
  color: var(--accent-strong);
}

.entry-text {
  font-size: var(--step--1);
  color: var(--text-soft);
}

/* Not open (yet): no card of its own, only a dashed frame on the page. */
.entry-off {
  background: none;
  color: var(--muted-text);
}

.entry-off::before {
  inset: 0;
  border-style: dashed;
  border-color: var(--muted-text);
  border-radius: var(--radius);
  opacity: 0.5;
}

.entry-off .entry-title,
.entry-off .entry-text,
.entry-closed .entry-title {
  color: var(--muted-text);
}

/* ------------------------------------------------------------- code entry */

/* Below the place cards: collapsed, behind a hairline. */
.code-entry {
  border-top: 1px solid var(--deco);
  padding-top: 0.5rem;
}

.code-entry summary {
  cursor: pointer;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  color: var(--accent);
  font-weight: 700;
}

.code-entry summary::-webkit-details-marker {
  display: none;
}

/* A small chevron that turns down when the entry opens. */
.code-entry summary::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.code-entry[open] summary::before {
  transform: rotate(45deg);
}

/* A small gear in the corner, the way into the admin pages. */
.admin-link {
  position: fixed;
  right: max(0.5rem, env(safe-area-inset-right));
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  border-radius: 50%;
  color: var(--text-soft);
}

.admin-link:hover {
  color: var(--text);
}

.code-entry summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Without a code: the invitation, still sealed. The place cards' frame, the
   seal sitting on the top edge like on an envelope flap.

         .---(@)---.
     +--------------------+
     | Mit eurem Code ... |
     | Euer Code          |
     | [ A B C D - E F  ] |
     | Steht auf ...      |
     | (Einladung öffnen) |
     +--------------------+
*/
.code-card {
  position: relative;
  margin: 2.25rem 0 1rem;
  padding: 2.5rem 1.5rem 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.code-card::before {
  content: "";
  position: absolute;
  inset: 0.375rem;
  border: 1px solid var(--copper);
  border-radius: calc(var(--radius) - 0.25rem);
  pointer-events: none;
}

.code-card .entry-seal {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3.25rem;
  height: 3.25rem;
  transform: translate(-50%, -50%);
  /* A ring of page colour so the seal reads as sitting on the edge. */
  border-radius: 50%;
  box-shadow: 0 0 0 0.375rem var(--bg);
}

.code-card-title {
  margin: 0 auto 1.5rem;
  max-width: 18em;
  font-size: var(--step-1);
  text-align: center;
  text-wrap: balance;
}

.code-card .field {
  margin-bottom: 1.25rem;
}

.code-card .code-input {
  font-size: var(--step-1);
  text-align: center;
  padding-left: calc(0.8rem + 0.12em);
}

.code-open {
  width: 100%;
}

.code-row {
  display: flex;
  gap: 0.5rem;
}

.code-input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.code-input::placeholder {
  letter-spacing: 0.12em;
  font-weight: 400;
}

/* ----------------------------------------------------------------- forms */

input:not([type="radio"], [type="checkbox"]),
textarea,
select {
  width: 100%;
  min-height: var(--touch);
  padding: 0.6rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 0.5rem;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent-strong);
}

input[aria-invalid="true"] {
  border-color: var(--error);
}

textarea {
  resize: vertical;
}

.field {
  display: block;
  margin-bottom: 1.25rem;
}

.field-short input {
  max-width: 8rem;
}

.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.optional {
  font-weight: 400;
  color: var(--text-soft);
}

.hint {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--step--1);
  color: var(--text-soft);
}

.field-error {
  color: var(--error);
  font-weight: 700;
  margin: 0.5rem 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0.6rem 1.4rem;
  font: inherit;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.button-quiet {
  color: var(--accent);
  background: transparent;
}

.button-quiet:hover {
  color: var(--accent-strong);
  background: var(--surface);
}

.button-wide {
  width: 100%;
  margin-top: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.notice {
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 0.5rem 0.5rem 0;
}

.notice-error {
  border-left-color: var(--error);
  color: var(--error);
  font-weight: 700;
}

/* The honeypot: out of sight, out of the tab order. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ RSVP */

.person {
  margin: 0;
  padding: 1.25rem 0;
  border: 0;
  border-top: 1px solid var(--deco);
  min-width: 0;
}

.people .person:first-child {
  border-top: 0;
}

.person-invalid {
  border-left: 4px solid var(--error);
  padding-left: 0.9rem;
}

.name-row {
  display: grid;
  gap: 0 0.75rem;
}

@media (min-width: 30rem) {
  .name-row {
    grid-template-columns: 1fr 1fr;
  }
}

.name-row .field {
  margin-bottom: 0.75rem;
}

/* The details of a row appear once it has a name, the meal once the person
   is coming, the high chair once it is a baby. Browsers without :has show
   everything, which still works. */
.person:not(:has(.name:not(:placeholder-shown))) .person-details,
.person:not(:has(input[value="ja"]:checked)) .if-coming,
.person:not(:has(input[name$="_baby"]:checked)) .if-baby {
  display: none;
}

.choice {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  min-width: 0;
}

.choice legend {
  font-weight: 700;
  padding: 0;
  margin-bottom: 0.5rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  position: relative;
}

.pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.pill span {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--field);
}

.pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.pill input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.checks {
  display: grid;
  gap: 0.5rem;
}

.panel form + form {
  margin-top: 1rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--touch);
  cursor: pointer;
}

.check input {
  width: 1.6rem;
  height: 1.6rem;
  margin: 0;
  accent-color: var(--accent);
  flex: none;
}

/* ------------------------------------------------------------- summary */

.summary {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.summary li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface);
}

.summary li > span {
  display: block;
}

.summary-name {
  font-weight: 700;
}

.summary-note {
  color: var(--text-soft);
  font-size: var(--step--1);
}

.message {
  margin: 1rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid var(--deco);
  font-style: italic;
  white-space: pre-line;
}

/* ----------------------------------------------------------------- gifts */

/* Each gift a place card, like the two on the start page, with the bow seal
   saying where it stands:

     +--------------------------------------+
     | +----------------------------------+ |
     | | (@)  Kaffeemaschine              | |
     | |      etwa 400 €                  | |
     | |  Siebträger, gern in Creme.      | |
     | |  ●●○○  Noch 2 von 4 frei         | |
     | |  ( Einen Anteil reservieren )    | |
     | +----------------------------------+ |
     +--------------------------------------+

   Taken by others, it steps back like a place card that is not open: a
   dashed frame on the page, the seal only an outline. */
.gifts {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.gift {
  position: relative;
  padding: 1.4rem 1.5rem 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.gift::before {
  content: "";
  position: absolute;
  inset: 0.375rem;
  border: 1px solid var(--copper);
  border-radius: calc(var(--radius) - 0.25rem);
  pointer-events: none;
}

.gift-off {
  background: none;
  color: var(--muted-text);
}

.gift-off::before {
  inset: 0;
  border-style: dashed;
  border-color: var(--muted-text);
  border-radius: var(--radius);
  opacity: 0.5;
}

/* An arched window onto the gift, inside the frame. */
.gift-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 999px 999px calc(var(--radius) - 0.25rem) calc(var(--radius) - 0.25rem);
  margin-bottom: 1.25rem;
  background: var(--surface-strong);
}

.gift-off .gift-image {
  opacity: 0.6;
}

.gift-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.gift-head .entry-seal {
  flex: none;
}

.gift-title {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.15;
}

/* The price as on a menu card: the heading face, set in italic. */
.gift-price {
  margin: 0.15rem 0 0;
  font-family: var(--font-head);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 24;
  color: var(--text-soft);
}

.gift-text {
  margin-bottom: 0.75rem;
}

.gift-off .gift-title,
.gift-off .gift-price {
  color: var(--muted-text);
}

.gift-shares {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: var(--step--1);
  color: var(--text-soft);
}

/* On the guest side: the rose pips are this party's, the soft ones others'. */
.gift .share-pip-own {
  background: var(--accent);
  box-shadow: none;
}

.gift .share-pip-taken {
  background: var(--deco);
  box-shadow: none;
  opacity: 0.5;
}

.gift-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.gift-actions p {
  margin: 0;
  flex-basis: 100%;
}

.gift-own {
  color: var(--accent);
  font-weight: 700;
}

.gift-taken {
  color: var(--muted-text);
  font-style: italic;
}

/* Just reserved: the check is stamped onto the seal. */
@media (prefers-reduced-motion: no-preference) {
  .gift-stamped .seal-check {
    transform-origin: 31.5px 31.5px;
    animation: stamp 0.35s cubic-bezier(0.3, 1.5, 0.6, 1) both;
  }
}

@keyframes stamp {
  from {
    transform: scale(1.8);
    opacity: 0;
  }
}

.address {
  position: relative;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem 1.4rem;
  background: var(--surface);
  border-radius: var(--radius);
}

.address::before {
  content: "";
  position: absolute;
  inset: 0.375rem;
  border: 1px solid var(--copper);
  border-radius: calc(var(--radius) - 0.25rem);
  pointer-events: none;
}

/* No delivery address set: no empty frame either. */
.address:not(:has(*)) {
  display: none;
}

.address h2 {
  margin-top: 0;
  font-size: var(--step-1);
}

.address-text {
  white-space: pre-line;
  margin: 0;
}

.empty {
  color: var(--text-soft);
  font-style: italic;
}

.narrow {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ------------------------------------------------------------------ admin */

.admin {
  --measure: 72rem;
  font-size: 1.0625rem;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.5rem var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--deco);
}

/* Phone: monogram and account on one row, the menu below it. */
.admin-brand {
  order: 1;
  margin: 0;
  padding: 0.25rem 0;
}

.admin-brand .monogram {
  display: block;
  width: auto;
  height: 2.25rem;
}

.admin-brand .brand-name {
  display: none;
}

.admin-user {
  order: 2;
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-soft);
}

.admin-nav {
  order: 3;
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.9rem;
  font-size: var(--step--1);
}

@media (min-width: 40rem) {
  .admin-brand {
    font-size: 1.6rem;
  }

  .admin-brand .brand-mark {
    display: none;
  }

  .admin-brand .brand-name {
    display: inline;
  }

  .admin-nav {
    font-size: 1rem;
  }
}

/* Wide: everything on one row. */
@media (min-width: 64rem) {
  .admin-nav {
    order: 2;
    flex: 1 1 auto;
  }

  .admin-user {
    order: 3;
  }
}

.admin-nav a {
  text-decoration: none;
  padding: 0.35rem 0;
}

.admin-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}

.admin .button {
  min-height: 2.5rem;
  padding: 0.35rem 1rem;
}

.admin input:not([type="radio"], [type="checkbox"]),
.admin textarea,
.admin select {
  min-height: 2.5rem;
  padding: 0.35rem 0.6rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
  padding: 0;
  list-style: none;
}

.stats li {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--deco);
}

.stat-value {
  display: block;
  font-family: var(--font-head);
  font-size: var(--step-2);
  color: var(--accent);
  line-height: 1.1;
}

/* Dashboard: the one number the couple plans with, then the list's answers. */
.headcount {
  margin: 1.5rem 0 2.5rem;
}

.headcount-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.6rem;
  margin: 0;
  font-family: var(--font-head);
  font-size: var(--step-2);
  color: var(--accent);
  line-height: 1.1;
}

.headcount-value {
  font-size: calc(var(--step-3) * 2.2);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.headcount-split {
  margin: 0.5rem 0 0;
  max-width: var(--measure);
  color: var(--text-soft);
}

.answer-bar {
  display: flex;
  gap: 3px;
  height: 1rem;
  margin: 1rem 0 0.75rem;
  max-width: 40rem;
}

.answer-bar > span {
  flex-basis: 0;
  border-radius: 0.25rem;
}

.answer-yes {
  background: var(--accent);
}

.answer-no {
  background: repeating-linear-gradient(-45deg, var(--deco) 0 2px, transparent 2px 6px);
  box-shadow: inset 0 0 0 1px var(--deco);
}

.answer-open {
  box-shadow: inset 0 0 0 1px var(--deco);
}

.answer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.answer-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.answer-legend strong {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--accent);
}

.answer-key {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
}

/* Guest list: one block per invitation, its code beside the people on it. */
.households {
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.household {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--leaf);
}

.household:last-child {
  border-bottom: 1px solid var(--leaf);
}

@media (min-width: 44rem) {
  .household {
    grid-template-columns: 9rem minmax(0, 1fr);
  }
}

.household-code {
  margin: 0;
  padding-top: 0.6rem;
  color: var(--accent);
}

.household-guests {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guest {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  min-height: var(--touch);
}

/* The name gives way first, so answer and toggle stay on its line. */
.guest-name {
  flex: 1 1 0;
  min-width: 6rem;
  display: flex;
  align-items: center;
  min-height: var(--touch);
}

.guest-answer {
  white-space: nowrap;
  font-size: var(--step--1);
  color: var(--text-soft);
}

.guest-answer-kommt {
  color: var(--accent);
  font-weight: 700;
}

.guest-edit summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: var(--touch);
  list-style: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.guest-edit summary::-webkit-details-marker {
  display: none;
}

.guest-edit summary:focus-visible,
.csv-import summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Open, the form takes the whole row under the name, and the toggle stays
   where it was, on the name's line. */
.guest-edit[open] {
  flex-basis: 100%;
  min-width: 0;
  padding-bottom: 0.75rem;
}

.guest-edit[open] summary {
  position: absolute;
  top: 0;
  right: 0;
}

/* Room for the toggle beside the answer. */
.guest:has(.guest-edit[open]) .guest-answer {
  margin-right: 6rem;
}

.guest-edit .when-open,
.guest-edit[open] .when-closed {
  display: none;
}

.guest-edit[open] .when-open {
  display: inline;
}

.csv-import {
  margin-top: 1rem;
}

.csv-import summary {
  cursor: pointer;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Invitations: a paper card as it will print, then the print settings. The
   preview mirrors labels.py's wide layout and its print fonts. */
.print-panel {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 52rem) {
  .print-panel {
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
    align-items: start;
  }

  .print-panel h2 {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
}

.card-preview {
  margin: 0;
  container-type: inline-size;
}

.card-paper {
  display: flex;
  align-items: center;
  gap: 5%;
  aspect-ratio: 105 / 74;
  padding: 6.7%;
  background: var(--ivory);
  color: #2e1b1f;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 3.5cqi;
  line-height: 1.35;
  border-radius: 2px;
  box-shadow: 0 0.6rem 1.5rem rgb(0 0 0 / 0.35);
  transform: rotate(-1.5deg);
}

.card-qr {
  flex: 0 0 47%;
}

.card-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.card-text p {
  margin: 0;
}

.card-names {
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 1.7em;
  color: var(--bordeaux);
  line-height: 1.2;
}

.card-greeting {
  font-style: italic;
}

.card-code {
  font-weight: 700;
  font-size: 1.5em;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.card-preview figcaption {
  margin-top: 1.25rem;
  font-size: var(--step--1);
}

.print-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.print-form .button {
  margin-top: 1rem;
}

.invitation-table .inline-form {
  margin-top: 0.35rem;
}

.invitation-table strong {
  color: var(--accent);
}

/* Replies: one card each, read top to bottom. Whether they come and when,
   who with what they need, their words, and last which invitation. */
.reply-filter {
  max-width: 44rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  margin: 0 0 1.5rem;
}

.reply-filter a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--touch);
  color: var(--text-soft);
  text-decoration: none;
}

.reply-filter a[aria-current="page"] {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.reply-filter-count {
  font-family: var(--font-head);
}

.reply-filter .reply-filter-csv {
  margin-left: auto;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.reply {
  max-width: 44rem;
  margin: 0 0 1rem;
  padding: 1rem 1.25rem 0.9rem;
  background: var(--surface);
  border-radius: var(--radius);
}

.reply-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1rem;
  margin-bottom: 0.6rem;
}

.reply-status {
  font-family: var(--font-head);
  font-size: var(--step-1);
  color: var(--accent);
}

.reply-declined .reply-status {
  color: var(--text-soft);
}

.reply-time {
  font-size: var(--step--1);
  color: var(--text-soft);
}

.reply-people {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reply-person {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--leaf);
}

.reply-name {
  flex: 0 0 11rem;
  font-weight: 700;
}

.reply-person-no .reply-name,
.reply-declined .reply-name {
  font-weight: 400;
  color: var(--text-soft);
}

.reply-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 12rem;
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  font-size: var(--step--1);
  line-height: 1.6;
  background: var(--surface-strong);
  color: var(--text);
}

.tag-strong {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.tag-quiet {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--leaf);
  color: var(--text-soft);
}

a.tag-warn {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.reply-message {
  margin: 0.75rem 0 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--deco);
  font-family: var(--font-head);
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--accent-strong);
  white-space: pre-line;
}

.reply-meta {
  margin: 0.75rem 0 0;
  font-size: var(--step--1);
  color: var(--text-soft);
}

.reply-meta .code {
  color: var(--accent);
}

/* Removing people stays folded away under the reply; it is rare. */
.reply-edit {
  margin-top: 0.5rem;
}

.reply-edit summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: var(--touch);
  list-style: none;
  font-size: var(--step--1);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.reply-edit summary::-webkit-details-marker {
  display: none;
}

.reply-edit summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.reply-edit form {
  margin: 0 0 0.5rem;
}

.reply-edit-hint {
  margin: 0 0 0.5rem;
  font-size: var(--step--1);
  color: var(--text-soft);
}

/* Review: one card per open question, phrased as the question it is, with
   the answers as buttons underneath. */
.case {
  max-width: 44rem;
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
}

.case-question {
  margin: 0;
  font-family: var(--font-head);
  font-size: var(--step-1);
  line-height: 1.3;
  color: var(--accent-strong);
  text-wrap: pretty;
}

.case-source {
  margin: 0.35rem 0 0;
  font-size: var(--step--1);
  color: var(--text-soft);
}

.case-source .code {
  color: var(--accent);
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.case-actions form {
  margin: 0;
}

.case-link {
  flex: 1 1 18rem;
}

.case-other {
  margin-top: 0.5rem;
}

.case-other summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.case-other summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.case-other .case-actions {
  margin-top: 0.25rem;
}

.case-entries {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.case-entries li {
  padding: 0.6rem 0;
  border-top: 1px solid var(--leaf);
}

.case-entries form {
  margin-top: 0.25rem;
}

.case-entry-name {
  margin: 0;
  font-weight: 700;
}

.case-done {
  max-width: 44rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
}

/* Gifts, admin side: one card per gift, its shares as pips that fill as
   guests take them. */
.gift-admin-list {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.gift-admin {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
}

.gift-admin-image {
  flex: 0 0 5rem;
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: 999px 999px 0.5rem 0.5rem;
}

.gift-admin-body {
  flex: 1 1 auto;
  min-width: 0;
}

.gift-admin-title {
  margin: 0;
  font-size: var(--step-1);
}

.gift-admin-price {
  margin: 0.1rem 0 0;
  color: var(--text-soft);
}

.gift-admin-text {
  margin: 0.4rem 0 0;
  font-size: var(--step--1);
  color: var(--text-soft);
}

.gift-admin-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-top: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.share-pips {
  display: inline-flex;
  gap: 4px;
}

.share-pip {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--deco);
}

.share-pip-taken {
  background: var(--accent);
  box-shadow: none;
}

.gift-admin-givers {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
}

.gift-admin-givers li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
}

.gift-admin-edit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  margin-top: -0.6rem;
  color: var(--accent);
}

.gift-admin-done .gift-admin-state {
  color: var(--text-soft);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--surface);
}

th {
  font-weight: 700;
  color: var(--accent-strong);
  border-bottom-color: var(--deco);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.code {
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

.inline-form input:not([type="radio"], [type="checkbox"]),
.inline-form select {
  width: auto;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 10rem;
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--accent-strong);
  white-space: nowrap;
}

.badge-warn {
  background: var(--accent);
  color: var(--on-accent);
}

.muted {
  color: var(--text-soft);
}

.stack > * + * {
  margin-top: 1rem;
}

.panel {
  padding: 1rem 1.25rem;
  border: 1px solid var(--deco);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.panel h2 {
  margin-top: 0;
  font-size: var(--step-1);
}

.danger {
  border-color: var(--error);
}
