/* Site theme: warm beige paper, deep brown ink, upright serif capitals for headings and a
   clean sans-serif for text. Square buttons, arched cards and white-framed pictures. */
:root {
  --bg: #faf6f2;
  --surface: #ffffff;
  --tint: #f3eee7;
  --text: #3d2c24;
  --muted: #7d6a5f;
  --border: #e2d8cc;
  --brand: #6c4e3f;
  --brand-dark: #543b2f;
  --on-brand: #ffffff;
  --danger: #a3261d;
  --heading-font: "Cormorant Upright", "Cormorant Garamond", Georgia, serif;
  --ui-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script-font: "Allison", "Great Vibes", cursive;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 var(--ui-font);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--heading-font);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--brand);
}

p {
  margin: 0;
}

a {
  color: var(--brand);
}

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

.wrap {
  width: min(72rem, 100% - 2.5rem);
  margin-inline: auto;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* 2.75rem is the smallest comfortable target for a finger. */
  min-height: 2.75rem;
  padding: 0.85rem 2rem;
  border: 1px solid var(--brand);
  border-radius: 0;
  background: var(--brand);
  color: var(--on-brand);
  font: 600 0.75rem var(--ui-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: var(--brand-dark);
}

.button.ghost {
  background: transparent;
  color: var(--brand);
}

.button.ghost:hover {
  background: var(--tint);
}

.button.light {
  border-color: var(--surface);
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 0.25rem 1rem rgb(61 44 36 / 0.15);
}

.button.light:hover {
  background: var(--tint);
}

.button.block {
  display: flex;
  width: 100%;
}

.button.small {
  padding: 0.5rem 1rem;
}

.button.danger {
  border-color: var(--danger);
  background: transparent;
  color: var(--danger);
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.home .site-header {
  position: absolute;
  inset: 0 0 auto;
  background: none;
  border-bottom: 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding-block: 0.5rem;
  flex-wrap: wrap;
}

.brand {
  font: 500 1.35rem var(--heading-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  text-decoration: none;
}

.account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.account img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.account-name {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.signin-note {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Home */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(50rem, 96vh);
  padding-bottom: 8.5rem;
  background:
    linear-gradient(180deg, rgb(250 246 242 / 0.25) 0%, rgb(108 78 63 / 0.05) 40%, rgb(84 59 47 / 0.8) 100%),
    #a98b77 url("/img/samples/hero.jpg") center 35% / cover;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
}

/* The curved lower edge of the hero. */
.hero::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -1px;
  height: 6rem;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: var(--bg);
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: #ffffff;
}

.hero .lead {
  margin-top: 0.9rem;
  opacity: 0.9;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.section.tinted {
  background: var(--tint);
}

.section h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
}

.split-title {
  font: 400 clamp(1.7rem, 3.6vw, 2.5rem) / 1.15 var(--heading-font);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand);
}

.split-title strong {
  font-weight: 700;
}

.centre {
  text-align: center;
}

.section .intro {
  margin-top: 1rem;
  color: var(--muted);
}

.intro-block .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.intro-block {
  padding-top: 0;
}

.bouquet {
  width: 7.5rem;
  height: auto;
}

.stem {
  width: 1px;
  height: 8rem;
  margin: 1rem 0 2.5rem;
  background: color-mix(in srgb, var(--brand) 45%, transparent);
}

.statement {
  max-width: 54rem;
  font-weight: 400;
}

.intro-block .intro {
  max-width: 56rem;
  margin-top: 2rem;
}

/* A picture frame: white mat, thin edge, soft shadow. */
.frame {
  padding: 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 0.5rem 2rem rgb(61 44 36 / 0.08);
}

.showcase .mini {
  display: block;
  aspect-ratio: 390 / 680;
  overflow: hidden;
  outline-offset: 0.2rem;
  color: inherit;
  text-decoration: none;
}

.showcase .mini-page {
  width: 390px;
  height: 680px;
}

.showcase .mini .invite.m-cover {
  --hero-h: 680px;
  height: 100%;
}

.showcase .inv-hero {
  min-height: 100%;
}

.showcase {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  width: 100%;
  margin-top: 3rem;
}

.signature-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  margin-top: 3rem;
  text-align: left;
}

.signature-row .split-title strong {
  display: block;
}

.signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 0.85rem;
}

.signature-name {
  font: 400 3rem / 1 var(--script-font);
  color: var(--brand);
}

/* Template cards: an arch with the template inside and its name over a brown fade. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: 2.5rem 2rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

.template-card {
  position: relative;
  /* Keeps the layers of the cover and its caption inside the card, so the header and its
     floating "Buy now" stay on top of every card. */
  isolation: isolate;
  height: 100%;
  aspect-ratio: 1 / 1.25;
  border-radius: 30rem 30rem 0 0;
  background: var(--tint);
  overflow: hidden;
}

.template-card .thumb {
  position: absolute;
  inset: 0;
}

.template-card .meta {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  z-index: 10;
  padding: 6rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, transparent, rgb(108 78 63 / 0.92) 40%, var(--brand) 62%);
  color: #ffffff;
  text-align: center;
}

.template-card h3 {
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: #ffffff;
}

.template-card .meta p {
  font-size: 0.8rem;
  opacity: 0.9;
}

.template-card .card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.6rem;
}

.template-card .card-actions .button {
  padding-inline: 0.25rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* On the brown fade a brown button would vanish, so the main action is white here. */
.template-card .card-actions .button:not(.ghost) {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--brand);
}

.template-card .card-actions .button:not(.ghost):hover {
  background: var(--tint);
}

.template-card .card-actions .button.ghost {
  border-color: #ffffff;
  color: #ffffff;
}

.template-card .card-actions .button.ghost:hover {
  background: rgb(255 255 255 / 0.15);
}

.template-card .meta .price-from {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 1;
}

/* The animated walk-through, in a picture frame. */
.demo-block {
  padding-top: 0;
}

.demo {
  display: block;
  max-width: 50rem;
  margin: 3rem auto 0;
}

.demo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Prices: one tile per guest-list size, in a row on a wide screen and a list on a phone. */
.prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  max-width: 60rem;
  margin: 3rem auto 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  background: var(--surface);
}

.prices li {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.35rem;
  padding: 1.75rem 0.75rem;
  text-align: center;
}

.prices li + li {
  border-left: 1px solid var(--border);
}

.price-amount {
  font: 500 2.2rem / 1 var(--heading-font);
  color: var(--brand);
}

.price-size {
  color: var(--muted);
  font-size: 0.85rem;
}

.price-note + .price-note {
  margin-top: 0.4rem;
}

.price-note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 52rem) {
  .prices {
    grid-template-columns: 1fr;
    max-width: 26rem;
  }

  .prices li {
    flex-direction: row;
    justify-content: space-between;
    padding: 1rem 1.25rem;
  }

  .prices li + li {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .price-amount {
    font-size: 1.6rem;
  }
}

/* How it works: a list under a dome, like a menu card. */
.dome {
  max-width: 46rem;
  margin: 3rem auto 0;
  padding: clamp(5rem, 14vw, 8rem) clamp(1.25rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2.5rem);
  border-radius: 23rem 23rem 0 0;
  background: var(--bg);
}

.steps {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
  text-align: center;
}

.steps li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}

.steps li::before {
  content: "Step " counter(step);
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.steps h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.steps p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.features li {
  padding: 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.features h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.features p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.my-list {
  display: grid;
  gap: 0.75rem;
  max-width: 52rem;
  margin: 2rem auto 0;
  padding: 0;
  list-style: none;
}

.my-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.my-list .title {
  flex: 1 1 12rem;
  min-width: 0;
  font: 700 1.3rem var(--heading-font);
  color: var(--brand);
  overflow-wrap: anywhere;
}

.my-list .title small {
  display: block;
  color: var(--muted);
  font: 400 0.8rem var(--ui-font);
}

.my-list .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  padding: 0.15rem 0.7rem;
  background: var(--tint);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge.live {
  background: #e3efe1;
  color: #2f6b3a;
}

.empty {
  margin-top: 1.5rem;
  color: var(--muted);
  text-align: center;
}

.cta {
  background: var(--brand);
  color: #ffffff;
  text-align: center;
}

.cta h2 {
  color: #ffffff;
}

.cta .lead {
  margin-top: 0.75rem;
  opacity: 0.9;
}

.cta .button {
  margin-top: 1.75rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.75rem;
}

@media (max-width: 40rem) {
  /* On a phone the name stacks into two short lines, so the sign-in button or the account
     buttons sit beside it instead of dropping underneath. */
  .site-header .wrap {
    gap: 0.4rem;
  }

  .site-header .brand {
    width: min-content;
    font-size: 1.1rem;
    line-height: 1.15;
  }

  .site-header .account {
    gap: 0.5rem;
  }

  .site-header .account img {
    display: none;
  }

  /* No room for "Buy now" in a phone's header: it floats at the bottom corner instead,
     where a thumb reaches it on every page. */
  /* The footer on a phone: the name (and any note) on lines of their own, then the links
     together on one centred row, each tall enough to tap. */
  .site-footer .wrap {
    justify-content: center;
    gap: 0.25rem 1.25rem;
    text-align: center;
  }

  .site-footer span {
    flex-basis: 100%;
  }

  .site-footer a {
    padding-block: 0.7rem;
  }

  /* Room at the very end of every page that shows the floating link, so whatever is last on
     the page can be scrolled clear of it. */
  body:has(.buy-now:not([hidden])) {
    padding-bottom: 4.5rem;
  }

  .site-header .buy-now {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 20;
    padding-inline: 1.25rem;
    box-shadow: 0 0.4rem 1.2rem rgb(61 44 36 / 0.3);
    transition: opacity 0.2s, visibility 0.2s;
  }

  /* The link leads to the prices, so it steps aside while they are on screen instead of
     sitting over them. */
  .site-header .buy-now.at-prices {
    opacity: 0;
    visibility: hidden;
  }

  .site-header .button.small {
    padding-inline: 0.45rem;
  }

  .showcase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-card {
    aspect-ratio: 1 / 1.2;
  }
}

@media (max-width: 23rem) {
  /* Too narrow for two buttons side by side. */
  .template-card .card-actions {
    grid-template-columns: 1fr;
  }
}

/* Editor */
.wrap.editor {
  width: min(96rem, 100% - 2rem);
}

.editor {
  display: grid;
  grid-template-columns: minmax(18rem, 26rem) 1fr;
  gap: 2rem;
  align-items: start;
  padding-block: 2rem 4rem;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.editor-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  min-width: 0;
}

.editor-form legend {
  padding: 0 0.4rem;
  font: 700 1.25rem var(--heading-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.field input[type="color"] {
  width: 4rem;
  height: 2.5rem;
  padding: 0.2rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.colour-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.template-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-height: 22rem;
  overflow-y: auto;
  padding: 2px;
  gap: 0.5rem;
}

.template-picker label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 2px solid var(--border);
  border-radius: 0;
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
}

.template-picker input {
  position: absolute;
  opacity: 0;
}

.template-picker label:has(input:checked) {
  border-color: var(--brand);
  background: var(--tint);
}

.template-picker label:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.swatch {
  height: 2.5rem;
  border-radius: 0.3rem;
  border: 1px solid var(--border);
}

.swatch.s-evergreen { background: linear-gradient(90deg, #8fa55a 35%, #ffffff 35%); }
.swatch.s-midnight { background: linear-gradient(90deg, #0e1730 70%, #d9b46a 70%); }
.swatch.s-blush { background: linear-gradient(90deg, #f6dcd8 65%, #b5626b 65%); }
.swatch.s-mono { background: linear-gradient(90deg, #111111 50%, #ffffff 50% 80%, #c2452d 80%); }

.preview-pane {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.preview-frame {
  padding: 1.5rem;
  border-radius: 0;
  background: var(--tint);
}

.preview-frame .invite {
  max-width: 24rem;
  box-shadow: 0 0.75rem 2rem rgb(61 44 36 / 0.18);
}

.preview-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.preview-toggle .button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--on-brand);
}

.preview-scroll.wide {
  max-width: none;
  border-radius: 0;
}

.preview-scroll {
  max-width: 24rem;
  max-height: min(42rem, 70vh);
  margin: 0 auto;
  overflow-y: auto;
  border-radius: 1.25rem;
  box-shadow: 0 0.75rem 2rem rgb(61 44 36 / 0.18);
}

.preview-scroll .invite {
  box-shadow: none;
}

#play-opening,
#mail-resend {
  align-self: flex-start;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0;
  overflow: hidden;
  background: var(--tint);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile button {
  position: absolute;
  inset: auto 0.25rem 0.25rem auto;
  padding: 0.1rem 0.5rem;
  border: 0;
  border-radius: 0;
  background: rgb(0 0 0 / 0.7);
  color: #ffffff;
  font: 0.8rem var(--ui-font);
  cursor: pointer;
}

.photo-add {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: 0;
  background: none;
  color: var(--brand);
  font: 500 0.9rem var(--ui-font);
  cursor: pointer;
}

.photo-add:disabled {
  opacity: 0.6;
  cursor: default;
}

.person-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.row.milestone {
  grid-template-columns: 6rem 1fr auto;
}

.row {
  display: grid;
  grid-template-columns: 8.75rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.row input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.icon-button {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: none;
  color: var(--muted);
  font: 0.9rem var(--ui-font);
  cursor: pointer;
}

.palette-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.palette-item input {
  width: 2.75rem;
  height: 2.25rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
}

.reply-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 18rem;
  overflow-y: auto;
}

.reply-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow-wrap: anywhere;
}

.reply-list .reply-message {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.95rem;
}

.save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.status {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.share {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
}

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

.share input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  font: 0.9rem ui-monospace, Menlo, monospace;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.check input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.25rem;
  accent-color: var(--brand);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.signin-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px dashed var(--brand);
  border-radius: 0;
}

/* Guest view */
.guest {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.guest #invite-root {
  width: 100%;
}

.guest .invite {
  /* On a sample the banner above takes part of the first screen; the rest is the cover's. */
  --hero-h: calc(100svh - var(--demo-bar-h, 0px));
}

.guest {
  scroll-behavior: smooth;
}

.demo-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--brand-dark);
  color: var(--on-brand);
  font-size: 0.95rem;
}

.demo-bar .button {
  border-color: var(--on-brand);
  background: var(--on-brand);
  color: var(--brand-dark);
}

.guest .made-with {
  margin-block: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.guest .notice {
  max-width: 26rem;
  text-align: center;
}

/* Plain text pages */
.prose {
  max-width: 42rem;
  padding-block: 3rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prose h1 {
  font-size: 2.2rem;
}

.prose h2 {
  margin-top: 1rem;
  font-size: 1.3rem;
}

.prose ul {
  margin: 0;
  padding-left: 1.25rem;
}

@media (max-width: 52rem) {
  .editor {
    grid-template-columns: 1fr;
  }

  .preview-pane {
    position: static;
    order: -1;
  }

  .preview-frame {
    padding: 1rem;
  }

  .preview-scroll {
    max-width: 18rem;
    max-height: 26rem;
  }
}

/* If Google's button falls back to plain markup, keep its logo at icon size. */
#google-button svg {
  max-width: 1.25rem;
  max-height: 1.25rem;
}

/* My invitations and guest lists */
.manage {
  padding-block: 3rem 5rem;
}

.manage .intro {
  margin-top: 1rem;
}

.manage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.manage .my-list {
  max-width: none;
}

.manage .my-list li {
  display: grid;
  gap: 0.6rem;
}

.my-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.my-list .stats {
  color: var(--muted);
  font-size: 0.85rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--brand);
  font-size: 0.85rem;
}

.banner {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid #b7791f;
  background: #fbf1dc;
  color: #5f4310;
  font-size: 0.9rem;
}

/* A locked invitation: what unlocks it sits under the explanation. */
.banner .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.my-list .banner {
  margin-top: 0;
}

.banner p + p {
  margin-top: 0.5rem;
}

.button.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.manage .unused-note {
  margin-top: 1.25rem;
}

.manage .gift {
  max-width: 34rem;
  margin-top: 2rem;
}

.gift .field,
.close-account .field {
  width: 100%;
}

/* The admin page: plain tables that scroll sideways inside their own box on a phone. */
.admin section {
  margin-top: 3rem;
}

.admin h2 {
  margin-bottom: 0.75rem;
}

.admin .panel {
  margin-top: 1rem;
}

.admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  width: 100%;
}

.admin-row .field {
  flex: 1 1 11rem;
}

.admin-scroll {
  width: 100%;
  max-width: 100%;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table thead th {
  background: var(--tint);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-table .admin-name {
  color: var(--text);
  font-weight: 600;
}

.admin-table .admin-name small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
}

.admin-table tr.is-done {
  color: var(--muted);
}

.admin h4 {
  margin-top: 0.5rem;
}

.admin-refund {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gift-code {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Kept out of the way at the foot of the page, and opened on purpose. */
.close-account {
  max-width: 34rem;
  margin-top: 3rem;
}

.close-account summary {
  display: inline-block;
  padding-block: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

.close-account .panel {
  margin-top: 0.5rem;
}

.guest-add {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.panel h2 {
  font-size: 1.4rem;
}

.panel .field {
  width: 100%;
}

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

.panel input[type="file"]:focus-visible + .hint,
.panel label.button:has(+ input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.manage .status {
  min-height: 1.5rem;
  margin-top: 1rem;
}

.guest-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1.5rem;
  color: var(--brand);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.table-scroll {
  margin-top: 0.75rem;
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
}

.guest-table th,
.guest-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.guest-table thead th {
  background: var(--tint);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guest-table .guest-name {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.guest-table .guest-name small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
}

.guest-table .guest-name small.yes {
  color: #2f6b3a;
}

.guest-link {
  max-width: 22rem;
}

.guest-link div {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.guest-link a {
  min-width: 0;
  overflow: hidden;
  color: var(--brand);
  font: 0.8rem ui-monospace, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guest-table .button {
  white-space: nowrap;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.guest-email input {
  width: 100%;
  min-width: 11rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.guest-email small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.share-buttons {
  display: flex;
  gap: 0.4rem;
}

.guest-table .button:disabled {
  opacity: 0.45;
  cursor: default;
}

.guest-link {
  max-width: 14rem;
}

#mail-note {
  margin-top: 0.4rem;
}

/* A guest who has been sent their link: greyed out and moved to the end. */
.guest-table tr.is-done {
  background: #f1eeeb;
}

.guest-table tr.is-done .guest-name,
.guest-table tr.is-done .guest-name small,
.guest-table tr.is-done .guest-link a {
  color: #8b8480;
}

.guest-table tr.is-done .guest-name {
  font-weight: 400;
  text-decoration: line-through;
}

.guest-note {
  margin-top: 1rem;
  max-width: 46rem;
}

@media (max-width: 44rem) {
  /* Each guest becomes a small card: name and link on top, buttons underneath. */
  .guest-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .guest-table,
  .guest-table tbody {
    display: block;
  }

  .guest-table tr {
    display: grid;
    grid-template-columns: auto auto 1fr;
    min-width: 0;
    align-items: center;
    gap: 0.5rem 0.6rem;
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  .guest-table th,
  .guest-table td {
    padding: 0;
    border: 0;
  }

  .guest-table .guest-name,
  .guest-table td.guest-email,
  .guest-table td.guest-link {
    grid-column: 1 / -1;
    max-width: none;
  }

  .guest-table td:last-child {
    justify-self: end;
  }

  .account-name {
    display: none;
  }
}

/* Payment box in the editor */
.pay-box {
  border-color: var(--brand);
}

.pay-box .button {
  align-self: flex-start;
}
