/* ==========================================================================
   The fonts — self-hosted, all of them, and never a CDN

   Guests open this page on a venue's wifi or on 4G: rendering its own type
   must not depend on a handshake with a third party. And a font CDN receives
   every guest's IP address before any consent — the very reason the Google
   @import was stripped out on the organiser side.
   TestAucunePoliceChargeeDepuisUnTiers reddens if a third-party host comes
   back, here or in a template.

   SEVEN families are declared: Cardo, plus the six named by the catalogue's
   four pairings (internal/theme/catalog.go). ALL of them, ALWAYS, even though
   one gallery only ever uses two — and that costs a visitor nothing, because
   an @font-face is a declaration, not a download. The browser fetches a file
   only when an applied rule asks for that family, so a "Parisienne + Cardo"
   gallery downloads Parisienne and Cardo and ignores the other five. What
   does follow the theme is the <link rel="preload"> in guest_head.html.tmpl,
   and it alone (theme.PreloadHrefs).

   Declaring the full list is also what keeps this sheet STATIC: a gallery's
   theme lives in a <style> injected after it, while the sheet itself is the
   same for everyone and gets cached once.

   What is shipped, and no more: the latin and latin-ext subsets, and only the
   weights actually used. The browser downloads latin-ext only when a
   character demands it — a French guest pays for the first file alone, and a
   Polish title stays legible. Italiana has no latin-ext at its publisher, so
   it declares one file.

   Four families are VARIABLE (Cormorant Garamond, Playfair Display, Karla,
   Source Sans 3): a single file carries the whole weight range, hence the
   `font-weight: <min> <max>` descriptor on one @font-face where Cardo, being
   static, needs one per weight. The page only ever uses 400 and 700.
   Parisienne and Italiana exist in 400 alone — all their publisher offers —
   and the browser synthesises the bold.

   All are SIL Open Font License 1.1, each with its licence text in ITS OWN
   DIRECTORY. That is not tidiness:
   TestChaquePoliceEmbarqueeEstAccompagneeDeSaLicence reasons by directory,
   and laid flat the neighbour's OFL would cover the family whose licence had
   just vanished. The file-by-file audit is
   in docs/legal/fonts.md.
   ========================================================================== */

@font-face {
  font-family: 'Cardo';
  src: url('/static/guest/fonts/cardo/cardo-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cardo';
  src: url('/static/guest/fonts/cardo/cardo-400-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cardo';
  src: url('/static/guest/fonts/cardo/cardo-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cardo';
  src: url('/static/guest/fonts/cardo/cardo-700-latin-ext.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/static/guest/fonts/cormorant-garamond/cormorant-garamond-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/static/guest/fonts/cormorant-garamond/cormorant-garamond-latin-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Parisienne';
  src: url('/static/guest/fonts/parisienne/parisienne-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Parisienne';
  src: url('/static/guest/fonts/parisienne/parisienne-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Italiana';
  src: url('/static/guest/fonts/italiana/italiana-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('/static/guest/fonts/playfair-display/playfair-display-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('/static/guest/fonts/playfair-display/playfair-display-latin-ext.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Karla';
  src: url('/static/guest/fonts/karla/karla-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Karla';
  src: url('/static/guest/fonts/karla/karla-latin-ext.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('/static/guest/fonts/source-sans-3/source-sans-3-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('/static/guest/fonts/source-sans-3/source-sans-3-latin-ext.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   Palette

   Two pinks, deliberately: --blossom is the decorative blush the invitation is
   built around, and --accent is the same hue pushed dark enough to clear
   4.5:1 on both the page background and the white cards (--surface).
   Anything that carries meaning as *text* uses --accent; --blossom is only
   ever a fill, a border or a rule. Guests read this outdoors in September
   daylight.

   The couple's names are text too. They were painted in --blossom as "hero
   lettering" until the 2026-10-14 audit measured 2.1 to 2.4:1 on five of the
   six palettes, under the 3:1 large text needs; the title, the ampersand and
   the lock screen's title now use --accent, like the date under them
   (TestLeTitreInviteEstLisibleSurToutLeCatalogue).
   -------------------------------------------------------------------------- */
:root {
  /* Typography. Two roles, two tokens: --font-display is the ceremonial
     voice (the couple's names in the hero, the lock screen's title — large
     type, in its own case), --font-body is everything a guest actually reads
     or taps, section eyebrows included. The split is by SIZE AND TREATMENT,
     not by importance: one of the catalog's four pairings is a connected
     script, and small uppercase letter-spaced type in a script is
     unreadable. Both resolve to Cardo today, so the page renders exactly as
     before; the point is that the theme catalogue can override one without
     touching the other, and that no rule hard-codes a family any more. Do
     not confuse --font-display with the `font-display`
     descriptor used in the @font-face blocks above: unrelated, and the
     custom property is the one with the leading dashes. */
  --font-display: 'Cardo', serif;
  --font-body: 'Cardo', serif;

  --bg: #FFF8FA;
  --surface: #FFFFFF;

  --ink: #7A2E4C;         /* 8.6:1  body copy */
  --ink-soft: #8A4A63;    /* 6.2:1  secondary copy */
  --ink-muted: #8C6274;   /* 4.9:1  hints, counters, empty states */

  --accent: #C2456F;      /* 4.6:1 on bg, 4.8:1 on surface; white on it 4.8:1 */
  --accent-strong: #B03A62;
  --blossom: #E85C96;     /* decorative: icons, progress fill, spinner */
  --blossom-soft: #F2A9C4;
  --danger: #C42A52;      /* 5.3:1 */

  --line: #F2A9C4;
  --line-soft: #F7DDE8;
  --wash: #FCE7EF;        /* hover/drag-over tint */
  --placeholder: #F5D9E4; /* media placeholder while a thumbnail loads */

  /* The dark behind a photo. Derived from --ink rather than stated, so a
     lightbox opened on a sage or navy gallery is not backed by the POC's
     plum. --overlay-base is the opaque tint; the three uses below pick their
     own opacity out of it. */
  --overlay-base: color-mix(in srgb, var(--ink) 34%, #000);
  --overlay: color-mix(in srgb, var(--overlay-base) 92%, transparent);
  --scrim: color-mix(in srgb, var(--overlay-base) 55%, transparent);

  --tap: 44px;            /* minimum comfortable touch target */
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--ink);
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }

/* A single visible focus ring for every interactive element. Individual
   controls below may restyle it, but none of them remove it. */
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Lock screen ---------------------------------------------------------- */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
.lock-card { max-width: 360px; width: 100%; text-align: center; }
.lock-card.shake { animation: shakeX 0.4s ease-in-out; }
.lock-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 11vw, 44px);
  font-weight: normal;
  line-height: 1.15;
  color: var(--accent);
  margin: 0 0 8px;
}
.lock-subtitle {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 30px;
}
/* The one refusal the lock screen explains: the access code changed since
   the visitor's cookie was minted (guest_lock.html.tmpl, CodeChanged). It
   tucks up under the subtitle and keeps the boxes' own spacing below it. */
.lock-notice {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  margin: -14px 0 22px;
  text-wrap: pretty;
}
/* --- Page de clôture ------------------------------------------------------
   Elle réutilise .lock-screen et .lock-card : c'est le même écran plein
   cadre, avec une phrase à la place des six cases. */
.closed-lede {
  font-size: 16px;
  line-height: 1.5;
  color: var(--accent);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.closed-note {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.75;
  margin: 0;
  text-wrap: pretty;
}

/* --- Page d'avant-ouverture ------------------------------------------------
   Même écran plein cadre que la clôture, classes distinctes : les deux pages
   disent le contraire l'une de l'autre et doivent pouvoir diverger sans que
   retoucher l'une repeigne l'autre (ticket B7). */
.opening-lede {
  font-size: 16px;
  line-height: 1.5;
  color: var(--accent);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.opening-note {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.75;
  margin: 0;
  text-wrap: pretty;
}

/* Six boxes at the old 52px/12px sizing came to 372px, past .lock-card's
   360px cap and off the edge of a 375px-wide phone. */
.pin-boxes { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.pin-box {
  width: 46px;
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* :focus, not :focus-visible — the PIN boxes are driven by an autofocus and by
   programmatic focus as each digit is typed, so the guest must always be able
   to see which box is live, however focus arrived there. */
.pin-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.pin-box.error { border-color: var(--danger); }
/* Under 340 px the six boxes no longer fit the card: at 320 — a first
   iPhone SE, or a later SE or mini in « Zoom d'affichage » — they ran from
   x = 2 to x = 318 and the focus halo of the first one was cut by the edge
   of the screen (contre-verif-3-2). 6 × 42 + 5 × 4 = 272 px, the card's
   width at 320. */
@media (max-width: 340px) {
  .pin-boxes { gap: 4px; }
  .pin-box { width: 42px; }
}
.pin-error { color: var(--danger); font-size: 13px; }

/* --- Le pied de page « Propulsé par … » ------------------------------------
   La seule marque du produit qu'un invité lit, sur les quatre écrans. Tout
   est peint aux jetons : les six palettes du catalogue doivent la rendre, et
   aucune règle de cette feuille ne peint une couleur du catalogue en dur.
   --ink-muted est le jeton des mentions discrètes (4,9:1), le même que les
   compteurs et les états vides. */
.guest-footer {
  text-align: center;
  padding: 28px 16px calc(20px + var(--safe-b));
}
/* « Conditions » et « Confidentialité » suivent « Propulsé par » sur la même
   ligne. Leur padding horizontal est réduit pour que les trois tiennent sur
   un téléphone de 375 px ; la hauteur de la cible tactile, elle, ne change
   pas. Si la ligne casse quand même (police agrandie), elle casse entre les
   liens, jamais au milieu d'un libellé. */
.guest-footer-legal { padding-left: 4px; padding-right: 4px; white-space: nowrap; }
.guest-footer-sep { color: var(--ink-muted); font-size: 13px; }
.guest-footer-link {
  color: var(--ink-muted);
  font-size: 13px;
  text-decoration: none;
  /* La cible tactile ne doit pas dépendre de la longueur du nom du produit :
     le lien est en ligne, donc on lui donne sa hauteur par le padding. */
  display: inline-block;
  padding: 8px 12px;
}
.guest-footer-link:hover { text-decoration: underline; }
.guest-footer-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Sur l'application, un filet sépare le pied du dernier panneau. Les trois
   écrans-cartes n'en ont pas : il n'y a rien au-dessus dont le séparer. */
.page > .guest-footer { border-top: 1px solid var(--line-soft); margin-top: 32px; }

/* Sur les trois écrans-cartes, .lock-screen est un position:fixed; inset:0.
   Le pied y est DEDANS — un frère placé après serait sous le calque et
   invisible — et calé en bas en absolu, ce qui laisse intact le centrage
   flex de la carte. Le padding-bottom du conteneur réserve sa place : sans
   lui, en paysage sur téléphone, la carte centrée passerait dessous. */
.lock-screen { padding-bottom: calc(24px + 56px + var(--safe-b)); }
.lock-screen > .guest-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px calc(12px + var(--safe-b));
}

/* --- Shared ---------------------------------------------------------------- */
.page { min-height: 100vh; }
/* The eyebrow above each section. It is set in the BODY face, not in
   --font-display, and that is deliberate: 15px, uppercase, 4px of
   letter-spacing is the same typographic role as .hero-date and
   .lock-subtitle, which have always been set in the body face. A display
   face only survives that treatment if its capitals were drawn to stand
   alone. The catalog's Parisienne is a connected script — capitalising it
   and then prising the letters apart leaves a row of ornaments, not a
   sentence. The display face keeps what it is good at: the hero names and
   the lock title, large and in their own case. Both tokens resolve to Cardo
   in the default theme, so a gallery that never chose a pairing renders
   exactly as before. */
.section-title {
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin: 0 0 8px;
  font-weight: 700;
}
.section-subtitle {
  text-align: center;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 36px;
}
/* « Vous pouvez déposer jusqu'au … inclus », pulled up under the subtitle it
   completes; the subtitle's own bottom margin then follows it. */
.deposit-until {
  width: fit-content;
  max-width: 100%;
  margin: -24px auto 36px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--wash);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.btn {
  display: inline-block;
  text-decoration: none;
  padding: 16px 34px;
  min-height: var(--tap);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--wash); color: var(--accent-strong); border-color: var(--accent-strong); }
/* A flat opacity wash made the disabled label unreadable (1.2:1), so the
   disabled state gets its own fill — mixed from the theme's own ink rather
   than stated, because a stated pink stayed pink on all six palettes. 12% of
   ink leaves --ink-soft between 5.1:1 and 7.7:1 on the fill across the whole
   catalog (TestBoutonDesactiveResteLisibleSurToutLeCatalogue). */
.btn:disabled {
  background: color-mix(in srgb, var(--ink) 12%, var(--bg));
  color: var(--ink-soft);
  border-color: transparent;
  cursor: not-allowed;
}
.btn:disabled:hover {
  background: color-mix(in srgb, var(--ink) 12%, var(--bg));
  color: var(--ink-soft);
}

/* --- Bandeau mode essai ------------------------------------------------------
   Rendu seulement sur un brouillon (guestPageData.TrialNotice), au-dessus du
   héros et donc lisible sans défiler : c'est l'endroit où un invité dépose
   une photo qui ne survivra que quelques heures. --wash/--accent, pas de
   couleur de statut à part (warning jaune, etc.) qui n'existe dans aucune
   palette du catalogue et casserait sur les cinq autres. */
.trial-banner {
  background: var(--wash);
  color: var(--ink);
  border-bottom: 1.5px solid var(--accent);
  padding: 10px 24px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* --- Hero ------------------------------------------------------------------ */
/* The names, the date+venues and the château are one composition and are sized
   off the page width alone — the hero is as tall as its content and no taller.
   Stretching it to the viewport (the previous 100svh) meant a tall phone put a
   band of dead space between the venues and the engraving, since the leftover
   height had to go somewhere; the engraving now simply follows the text. */
.hero {
  padding: max(20px, env(safe-area-inset-top, 0px)) 24px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
/* The 75svh term only binds on a short, wide viewport — a phone held in
   landscape — where sizing the lettering off width alone would fill the whole
   screen with the two names. It is inert in portrait and on desktop. */
.hero-names {
  width: min(90vw, 640px, 75svh);
  height: auto;
  overflow: visible;
  flex-shrink: 0;
}
/* The names are painted, not animated. The traced handwriting intro the POC
   shipped is gone: the title is what the guest came for, and making them wait
   1.5s to read it bought a flourish nobody asked for twice. Everything under
   the names still fades up, and their delays now start from the load rather
   than from the end of a stroke that no longer runs. */
.name-fill {
  fill: var(--accent);
}
/* No font-size here: the template sets it as an attribute, in proportion to
   the names (fitHeroTitle), and a CSS font-size would beat it. */
.hero-amp {
  font-family: var(--font-display);
  fill: var(--accent);
}
.hero-date {
  font-size: 15px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  animation: fadeUp 0.54s ease 0.24s forwards;
}
/* The ordinal of a first of the month, which guest_hero.html.tmpl (the
   hero's date) and guest_app.html.tmpl (the upload title before the opening,
   a .section-title) put in a <sup> of its own (i18n.OrdinalRuns). French
   keeps it a lower-case superscript even inside a line of capitals:
   « 1ᵉʳ AOÛT 2026 », never « 1ER AOÛT 2026 ».

   Raised by position rather than by vertical-align, with no line height of
   its own: the browser's default superscript grew the date's line by 3 to
   4px, and everything under the hero moved down on the first of a month. And
   not tracked like the capitals around it: their 4px, inherited as is, split
   two small letters apart into « 1 e r ». */
.ordinal {
  position: relative;
  top: -0.5em;
  vertical-align: baseline;
  font-size: 0.7em;
  line-height: 0;
  letter-spacing: 0.1em;
  text-transform: none;
}
.hero-venues {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.venue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  opacity: 0;
  animation: fadeUp 0.54s ease forwards;
  transition: background-color 0.2s ease;
}
.venue:hover, .venue:focus-visible { background-color: var(--wash); }
.venue-name {
  display: block;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  text-wrap: balance;
}
/* The pin is an inline glyph inside the text flow rather than a flex sibling:
   as a sibling it detached to the far left the moment a long venue name
   wrapped to two lines. */
.venue-pin {
  display: inline-block;
  vertical-align: -1px;
  margin-right: 5px;
  color: var(--blossom);
}
.venue-address {
  font-size: 13px;
  color: var(--ink-muted);
}
.venue-popover {
  position: absolute;
  transform: translateX(-50%);
  margin-top: 6px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  z-index: 20;
}
.venue-popover a {
  display: block;
  padding: 12px;
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  text-align: center;
}
.venue-popover a:hover { background: var(--wash); color: var(--accent-strong); }
/* The engraving sits directly under the venues and is sized by the page width
   only — its height falls out of the image's own 1400×651 ratio. It shares the
   640px ceiling with .hero-names so the two line up as one block on a wide
   screen; unbounded, the drawing alone was ~450px tall on a desktop and pushed
   the tab bar off the fold. The extra top margin is the one deliberate gap in
   the composition, separating the address block from the drawing. */
.hero-chateau {
  margin-top: 12px;
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 0.84s ease-out 0.42s forwards;
}
.hero-chateau img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Sticky tab bar --------------------------------------------------------
   Lives outside .hero on purpose: a sticky element can only stick within its
   own containing block, so while it sat inside the hero it scrolled away with
   it and left the page with no navigation at all. The hero is ~830px on a
   phone, and guests move between these three sections all evening.
   -------------------------------------------------------------------------- */
.tabbar-sentinel { height: 1px; }
/* The sticky strip is the row around the tablist, so that the QR button
   can end the bar without being inside role="tablist" (guest_app.html.tmpl).
   The tablist itself just fills the row. */
.tabbar-row {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  background: var(--bg);
  /* The hairline is unconditional so the strip reads as a tab bar whether or
     not it is stuck — and so the bar still looks right if .is-stuck never
     lands (no IntersectionObserver, or a page that never scrolls that far). */
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow .2s ease;
}
.tabbar-row.is-stuck { box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 9%, transparent); }
.tabbar { flex: 1; min-width: 0; display: flex; }
/* « Montrer le QR code » (share/share.js): a square at the end of the bar,
   separated from the tabs by a hairline, as tall as they are. */
.tabbar-qr {
  flex: none;
  width: calc(var(--tap) + 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  border-left: 1px solid var(--line-soft);
  color: var(--ink-soft);
  cursor: pointer;
}
.tabbar-qr:hover { color: var(--accent); }
.tabbar-qr:focus-visible { outline-offset: -3px; }
/* The labels are full phrases ("Ajouter vos photos"), so a narrow column may
   not hold them on one line. The text wraps and each button centres its own
   lines; the buttons stretch to a common height from the flex row, so a
   two-line tab and a one-line tab still share a baseline strip. */
.tab-btn {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 12px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
@media (min-width: 560px) {
  .tab-btn { padding: 14px 6px; font-size: 13px; letter-spacing: 2px; }
}
.tab-btn:hover { color: var(--accent); }
.tab-btn[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}
.tab-btn:focus-visible { outline-offset: -3px; }

/* Keeps a section's heading clear of the sticky bar when a tab scrolls it
   into view. The bar is not one fixed height: the labels wrap to two lines
   while the columns are narrow (~57px on a phone, ~66px just past the 560px
   step-up in type size) and collapse to one line once there is room (~48px),
   so the clearance follows the same breakpoints. */
.upload-section, .gallery-section, .guestbook-section { scroll-margin-top: 72px; }
@media (min-width: 560px) {
  .upload-section, .gallery-section, .guestbook-section { scroll-margin-top: 80px; }
}
@media (min-width: 900px) {
  .upload-section, .gallery-section, .guestbook-section { scroll-margin-top: 62px; }
}

/* The one place the focus ring above is dropped rather than restyled. The
   panels carry tabindex="-1" for the tabs pattern, which also makes them a
   fragment-navigation target: loading /#upload focuses the panel, and a
   keyboard reload (Cmd-R, F5) leaves the focus modality set to keyboard, so
   the ring is painted around a box taller than the viewport — two stray
   vertical lines down the page until the next click. Nothing is lost by
   removing it: a panel is a container, never in the tab sequence, and the
   heading it scrolls to is the real "you are here". */
.upload-section:focus-visible,
.gallery-section:focus-visible,
.guestbook-section:focus-visible { outline: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes pulseDot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes tileBreathe { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes revealBelow { to { opacity: 1; } }
@keyframes revealBelowNow { to { opacity: 1; } }

/* Two ways to arrive with the intro already spent: the guest asked not to see
   motion, or they deep-linked past the hero entirely. Both land the hero in its
   finished state rather than mid-animation. */
.no-hero-intro .hero-date,
.no-hero-intro .venue,
.no-hero-intro .hero-chateau {
  animation: none !important;
  opacity: 1 !important;
}

/* The hero is sized in svh — the viewport as it stands with the browser
   toolbars showing — so whenever they are collapsed (Chrome on Android after an
   earlier scroll, Safari resuming a tab) the page is 60-100px taller than the
   hero and the tab bar peeks into the surplus while the date and the engraving
   are still fading up. Sizing the hero in dvh would close the gap but reflow
   the hero as the toolbars slide away, mid-animation; so the page below it is
   held back instead, until the intro is spent.

   Deliberately inside no-preference: the hidden state then only ever exists in
   an engine that will certainly run the keyframe that clears it, so nothing
   here can strand the page at opacity 0. A deep link, which suppresses the
   intro in the head, is excluded outright. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.no-hero-intro) .below-hero {
    opacity: 0;
    /* The château finishes its fade-up at 1.26s; starting just before that
       lands the page as one movement rather than after a beat. */
    animation: revealBelow 0.5s ease 1s forwards;
  }
  /* A guest who has scrolled is done watching. This must be a *different*
     keyframe name rather than a shortened delay: an animation whose delay
     changes keeps its original start time, so zeroing it at t=0.5s would snap
     the fade to 0.5s of progress instead of fading. A new name restarts it. */
  html:not(.no-hero-intro).intro-skipped .below-hero {
    animation: revealBelowNow 0.4s ease forwards;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-date, .venue, .hero-chateau {
    animation: none !important;
    opacity: 1 !important;
  }
  /* The spinner, the per-file upload dot and a tile waiting for its preview
     are the only signal that work is in flight, so they keep animating —
     just slower. */
  .lock-card.shake { animation: none !important; }
  .pending-tile-status.uploading, .lightbox-spinner { animation-duration: 2.4s; }
  .pending-tile.is-loading::before { animation-duration: 3.2s; }
}

/* --- Upload section --------------------------------------------------------- */
.upload-section { max-width: 640px; margin: 0 auto; padding: 40px 24px 80px; }
.upload-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.name-input {
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 4px;
  min-height: var(--tap);
  font-family: var(--font-body);
  font-size: 16px;   /* 16px minimum, or iOS Safari zooms on focus */
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.name-input::placeholder { color: var(--ink-muted); }
.name-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 0 0 var(--accent);
}
.name-error { font-size: 13px; color: var(--danger); }
.selection-limit-msg { font-size: 13px; color: var(--ink-muted); }
/* White, like the publish bar: on the page's own tint the frame read as an
   empty slot rather than as the tab's one button. Hover and drag-over still
   tint it with --wash. */
.dropzone {
  border: 2px dashed var(--line);
  background: var(--surface);
  border-radius: 4px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: background .2s, border-color .2s;
}
.dropzone:hover { border-color: var(--blossom); background: var(--wash); }
.dropzone-title { display: block; font-family: var(--font-body); font-size: 16px; color: var(--accent); letter-spacing: 1px; }
.dropzone-subtitle { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 6px; }
/* A drop is taken anywhere on the upload panel (upload/state.js), so the
   panel lights up whichever way in is on screen: the frame on a first
   visit, the grid's add cell after. */
.upload-section.drag-over .dropzone,
.upload-section.drag-over .add-tile { border-color: var(--accent); background: var(--wash); }

/* One grid while the guest picks and while the batch goes, one per outcome
   once it is over, failures first (tiles/tiles.js). Four columns on a phone,
   six from a tablet up: a batch of 50 reads in a few screens, and nothing
   hides off to the right the way it did in the horizontal strips this
   replaced. */
.pending-tiles { display: flex; flex-direction: column; gap: 16px; }
.pending-group { display: flex; flex-direction: column; gap: 8px; }
.pending-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pending-group-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 768px) {
  .pending-group-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.pending-group-label {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.pending-group-label.is-uploaded { color: #2E7D53; }
.pending-group-label.is-failed { color: var(--danger); }
/* A full touch target, taken out of the line's height by the negative
   margin: the title row stays as tall as its text. */
.pending-group-retry {
  background: none; border: 0; padding: 0 2px; font: inherit;
  font-size: 14px;
  min-height: var(--tap);
  margin: -12px 0;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.pending-group-retry:hover { color: var(--accent-strong); }
.pending-tile { position: relative; min-width: 0; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--placeholder); isolation: isolate; }
/* A tile whose preview is still on its way — a photo the browser is
   decoding, a video whose poster is queued — breathes, so the empty square
   reads as "coming" rather than as broken. The browser decodes a phone photo
   whole to paint a tile under a hundred pixels wide, a tenth of a second to
   more than half a second per file, one after the other. The layer sits under
   the media (z-index -1 inside the tile's own stacking context), so a photo
   covers it the moment it paints — nothing has to know when that is
   (tiles.js, PHOTO_BREATHE_MAX_MS). Opacity only: the compositor runs it, and
   keeps it running while WebKit freezes the main thread decoding. */
.pending-tile.is-loading::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--ink) 10%, var(--placeholder));
  animation: tileBreathe 1.6s ease-in-out infinite;
}
/* A failed tile has to read as failed at a glance, next to its neighbours that
   carry a green ✓ — the corner dot alone is easy to miss on a busy thumbnail. */
.pending-tile.is-failed { outline: 2px solid var(--danger); outline-offset: -2px; }
.pending-tile.is-failed img { opacity: .55; }
/* Part of the batch on its way, waiting for its turn: paled, so the ✓ that
   land and the bar of the file that goes are what the eye finds. */
.pending-tile.is-queued { opacity: .4; }
/* No `video` here any more: a pending tile only ever holds an <img>, either the
   file itself or the poster extracted from it. */
.pending-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A video tile's stand-in while its poster is queued: nothing on it, the
   breathing background behind is the signal. */
.tile-waiting { width: 100%; height: 100%; }
/* Stands in whenever no preview could be decoded — a video whose poster
   extraction gave up, or a file the browser cannot render at all. Without it
   the tile is an empty square that reads as a bug rather than as a missing
   preview. */
.tile-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  opacity: .55;
}
/* Marks a tile whose poster is a video frame — without it a video is
   indistinguishable from a photo once its poster lands — and carries its
   length once the poster queue has read it. The scrim keeps the glyph
   readable on both a bright poster and a dark one. A round dot the size of
   the status dot when there is no length to show, a pill when there is. */
.pending-tile-video {
  position: absolute;
  right: 4px; bottom: 4px;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  background: var(--scrim);
  color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pending-tile-video.has-duration { padding: 0 6px 0 5px; }
.pending-tile-status {
  position: absolute;
  bottom: 4px; left: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  background: #8a8a8a;
}
/* A file not sent yet carries no dot: before the batch, every tile would
   wear the same grey one and say nothing. While the batch goes, a file
   waiting its turn keeps its dot for a screen reader (« En attente : … »),
   unseen — the paled tile says it to the eye. */
.pending-tile-status.pending { display: none; }
.pending-tile-status.queued { opacity: 0; }
.pending-tile-status.uploading { background: var(--accent); animation: pulseDot 1s ease-in-out infinite; }
.pending-tile-status.uploaded { background: #2E7D53; }
.pending-tile-status.failed { background: var(--danger); }
/* Per-file byte progress, on the tile's bottom edge — under the status dot
   at bottom-left and the video badge at bottom-right, clear of the remove
   button at top-right. No width transition: the progress events already
   arrive continuously, so an ease would trail the real position rather than
   smooth it. */
.pending-tile-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--scrim); }
.pending-tile-progress-bar { height: 100%; width: 0%; background: var(--blossom); }
.pending-tile-remove {
  position: absolute;
  top: 3px; right: 3px;
  width: 30px; height: 30px;      /* >= the 24px WCAG 2.5.8 target minimum */
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--scrim);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.pending-tile-remove:hover { background: color-mix(in srgb, var(--overlay-base) 78%, transparent); }
/* The grid's first cell once a file is picked: the frame above, shrunk to a
   tile. Same dashed line, same white fill, same picker. */
.add-tile {
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 2px dashed var(--line);
  border-radius: 6px;
  background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.add-tile:hover { border-color: var(--blossom); background: var(--wash); }

/* --- The publish bar -------------------------------------------------------
   Sticks to the bottom of the screen while the upload form is on it, and
   only then: sticky inside the form, not fixed on the screen, so it leaves
   with the upload tab and never floats over the viewer or the dating dialog,
   which sit far above it (z-index 1000). Bled to the section's edges, the
   24px the section pads on each side. Absent until the first pick. */
.publish-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin: 0 -24px;
  padding: 14px 24px calc(14px + var(--safe-b));
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  box-shadow: 0 -6px 18px color-mix(in srgb, var(--ink) 8%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.publish-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.publish-bar-status { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.publish-bar-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.publish-bar-title.is-sent { color: #2E7D53; }
.publish-bar-detail { font-size: 13px; color: var(--ink-muted); }
.publish-bar-detail.is-failed { color: var(--danger); }
.publish-bar-detail:empty { display: none; }
/* « Réessayer les échecs » is long for a phone's width next to the count:
   it wraps on two lines rather than squeezing the count out. */
.publish-btn { flex: 0 1 auto; max-width: 62%; border: none; padding: 14px 26px; line-height: 1.25; }
/* While the batch goes there is no button: the count sits on the title's
   line, the bar under them. */
.publish-bar[data-etape="envoi"] .publish-bar-status {
  flex: 1;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.publish-bar[data-etape="envoi"] .publish-bar-title { font-size: 15px; }
.publish-bar[data-etape="envoi"] .publish-bar-detail { font-size: 15px; color: var(--accent); }
.pending-progress-track { width: 100%; height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.pending-progress-bar { height: 100%; width: 0%; background: var(--blossom); transition: width .3s ease; }
.publish-note { margin: 0; font-size: 13px; color: var(--ink-muted); }
.publish-bar .publish-hint,
.publish-bar .undated-notice { margin: 0; text-align: left; }
/* « Vidéo lourde : en wifi… » (upload/state.js, videoHintText): advice, not
   an error, so in the secondary ink rather than the danger red. */
.publish-bar .video-hint { color: var(--ink-soft); line-height: 1.4; }
/* What the bar covers, a focused control must not end up under: a Tab onto
   a tile's × at the bottom of the screen scrolls it clear of the bar, and so
   does a field the browser brings into view. Only while the bar is on screen
   — the gallery tab has none. The toast moves up out of its way too. */
html:has(.upload-section.section-active .publish-bar:not([hidden])) {
  scroll-padding-bottom: calc(var(--safe-b) + 150px);
}
html:has(.upload-section.section-active .publish-bar:not([hidden])) .toast {
  bottom: calc(var(--safe-b) + 150px);
}

.publish-hint,
.processing-notice { text-align: center; font-size: 13px; color: var(--ink-muted); }
.gallery-processing { margin: 0 0 12px; }

/* « 2 photos n'ont pas de date de prise. Les dater » (dating/dating.js).
   A tinted card with a filled button, not a grey line with a link: dating
   is the one thing the guest can do that the server cannot, and a missed
   notice leaves the photo at the end of the day for good (Leo, 2026-11-01).
   The button is filled like .btn-primary, white on --accent. */
.undated-notice {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 0; padding: 10px 12px;
  border: 1px solid var(--blossom-soft); border-radius: 12px;
  background: var(--wash); color: var(--ink);
  font-size: 14px; line-height: 1.4; text-align: left;
}
.gallery-processing.undated-notice { margin: 0 0 12px; }
.undated-icon { flex: none; color: var(--accent); }
.undated-body { flex: 1; min-width: 0; }
.undated-why { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-soft); }
.undated-why:empty { display: none; }
.undated-action {
  flex: none; min-height: 36px; padding: 8px 14px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.undated-action:hover { background: var(--accent-strong); color: #fff; }

/* The dating dialog: a form on a white card, over the same scrim family as
   the venue popovers rather than the lightbox's near-opaque overlay — the
   page behind stays legible, nothing is being looked at full screen. */
.dating {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.dating-panel {
  background: var(--surface); color: var(--ink);
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 20px; border-radius: 12px;
}
.dating-title { margin: 0; font-size: 20px; }
.dating-subtitle { margin: 6px 0 16px; font-size: 14px; color: var(--ink-muted); }
.dating-row .dating-input { flex: 1; min-width: 0; }
/* A date typed only in part, which « Enregistrer » refused (dating/dating.js). */
.dating-input[aria-invalid="true"] { border-bottom-color: var(--danger); }
.dating-input[aria-invalid="true"]:focus { box-shadow: 0 2px 0 0 var(--danger); }
.dating-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dating-row { display: flex; align-items: center; gap: 12px; }
.dating-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; background: var(--wash); }
.dating-more { margin: 8px 0 0; font-size: 13px; color: var(--ink-muted); }
.dating-error { margin: 12px 0 0; font-size: 14px; color: var(--danger); }
/* The two buttons share the row in equal halves, with less side padding than
   the default 34 px (which made the pair 18 px wider than a phone card's
   content box); if even that does not fit they stack instead of overflowing. */
.dating-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dating-actions .btn { flex: 1 1 0; padding-inline: 16px; }
/* « Enregistrer » while a save is on its way: aria-disabled, never disabled,
   which would drop the focus out of the dialog (dating/dating.js). */
.dating-actions .btn[aria-disabled="true"] { cursor: progress; }

/* « Faites scanner ce code » (share/share.js). The code is as wide as a
   phone allows, black on white whatever the palette, on a panel that keeps
   its own quiet zone clear. */
.qr-dialog {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.qr-panel {
  background: var(--surface); color: var(--ink);
  width: 100%; max-width: 400px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 20px; border-radius: 12px;
  text-align: center;
}
.qr-title { margin: 0; font-size: 20px; }
.qr-subtitle { margin: 6px 0 12px; font-size: 14px; color: var(--ink-muted); }
/* Held sideways, the panel is short: the code shrinks with the height too,
   so that it never needs scrolling to be seen whole. */
.qr-code { display: block; width: min(100%, 300px, 55vh); width: min(100%, 300px, 55dvh); height: auto; margin: 0 auto; background: #fff; border-radius: 6px; }
.qr-reminder { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.qr-actions .btn { flex: 1 1 0; padding-inline: 16px; }

/* The welcome card (welcome/welcome.js): a sheet at the bottom of a phone,
   centred on a wider screen, on the same scrim as the other dialogs. */
.welcome {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--scrim);
  display: flex; align-items: flex-end; justify-content: center;
}
.welcome-panel {
  background: var(--surface); color: var(--ink);
  width: 100%; max-width: 480px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: 20px 20px calc(16px + var(--safe-b)); border-radius: 16px 16px 0 0;
  box-sizing: border-box;
}
@media (min-width: 560px) {
  .welcome { align-items: center; padding: 16px; }
  .welcome-panel { border-radius: 12px; padding-bottom: 20px; }
}
.welcome-title {
  margin: 0 0 4px; text-align: center;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--accent);
}
.welcome-list { list-style: none; margin: 0; padding: 0; }
.welcome-item { display: flex; gap: 12px; margin-top: 14px; font-size: 14px; line-height: 1.45; }
.welcome-item p { margin: 0; }
.welcome-ico { flex: none; width: 22px; font-size: 18px; line-height: 1.3; }
.welcome-head { font-weight: 700; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.welcome-actions .btn { flex: 1 1 0; padding-inline: 12px; font-size: 12px; }
.welcome-steps { margin-top: 8px !important; padding: 8px 10px; border-radius: 8px; background: var(--wash); color: var(--ink-soft); }
.welcome-qr { display: inline-flex; vertical-align: -5px; padding: 1px; border: 1px solid var(--line-soft); border-radius: 4px; color: var(--ink-soft); }
.welcome-qr svg { width: 18px; height: 18px; }
.welcome-ok { display: block; width: 100%; margin-top: 18px; }

/* --- Gallery ---------------------------------------------------------------
   Justified-row grid: photos keep their natural aspect ratio and rows fill
   the full width. Each tile gets its aspect ratio from the API before the
   thumbnail loads, so the grid lays out correctly before any image arrives
   and does not reflow as they decode.
   -------------------------------------------------------------------------- */
.gallery-section { max-width: 1100px; margin: 0 auto; padding: 20px 24px 110px; }
.gallery-empty { text-align: center; color: var(--ink-muted); font-size: 15px; padding: 40px 0; }
/* Justified rows. The page decides which tiles share a row
   (gallery/rows.js) and gives each row its own flex container; flex does
   the rest. Each tile is fixed at the row height and asks for flex-basis —
   its natural width at that height — and the row hands its leftover space
   out in proportion to flex-grow. Setting flex-grow to the aspect ratio is
   what makes wide photos absorb more slack than tall ones, i.e. what makes
   the result read as justified rather than uniformly stretched.

   Why the page breaks the rows rather than flex-wrap: one wrapping
   container re-broke EVERY tile each time a page was appended, which made a
   3 000-photo gallery stutter (docs/SPEC.md § 4.5). Rows of their own, in
   blocks of about a page (gallery/grid.js), only cost what they add. The
   script decides membership, never a size.

   --ratio comes from the API (see createGalleryTile) and defaults to 1, so
   photos uploaded before dimensions were recorded stay square. Because the
   ratio arrives with the JSON rather than with the image bytes, rows are
   laid out correctly before a single thumbnail loads and nothing shifts as
   they stream in.

   --row-h and --gap are read back by grid.js to break the rows: they are the
   one place these values live. Rows and blocks are spaced by the same gap
   as tiles, so a block boundary does not show. */
.gallery-grid { --row-h: 140px; --gap: 8px; }

@media (min-width: 560px) {
  .gallery-grid { --row-h: 180px; --gap: 12px; }
}
@media (min-width: 900px) {
  .gallery-grid { --row-h: 240px; --gap: 16px; }
}

.gallery-block + .gallery-block,
.gallery-row + .gallery-row { margin-top: var(--gap); }
.gallery-row { display: flex; gap: var(--gap); }

/* Without this, a last row holding two photos would have all the remaining
   width shared between them and stretch grotesquely. A zero-height
   pseudo-element with an enormous flex-grow is the row's last flex item, so
   it swallows essentially all the slack, leaving the real tiles at their
   natural width. Only the open row — the last one — carries it: every other
   row is full and must stretch. */
.gallery-row.is-open::after { content: ''; flex-grow: 999999; }

.gallery-tile {
  position: relative;
  --ratio: 1;
  height: var(--row-h);
  /* Longhand rather than the `flex` shorthand: var() substitution inside a
     shorthand has been unreliable across engines. */
  flex-grow: var(--ratio);
  flex-shrink: 1;
  flex-basis: calc(var(--ratio) * var(--row-h));
  min-width: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: var(--placeholder);
  padding: 0;
  border: none;
  display: block;
}
/* object-fit: cover, not contain — tiles are meant to crop rather than
   letterbox. The flex-grow step can widen a photo well past its natural
   width, and how much depends on how much slack its row has: densely
   packed rows crop mildly, but a wide photo landing alone on a narrow
   phone row can lose a large fraction of its height (a lone 4:3 landscape
   on a 390px phone loses roughly 45%). This is a known, accepted trade of
   the chosen --row-h values; a maintainer wanting less cropping should
   lower --row-h at the relevant breakpoint so more tiles share a row. */
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-tile-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 6px 5px;
  background: linear-gradient(to top, color-mix(in srgb, var(--overlay-base) 72%, transparent), transparent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Scaled down in step with the caption around it. Left at its own fixed
   12px it would end up *larger* than the 11px name on phones, inverting the
   hierarchy this rule exists to create. */
.gallery-tile-date {
  font-weight: 400;
  font-size: 10px;
  opacity: .85;
}
@media (min-width: 560px) {
  .gallery-tile-caption { padding: 20px 10px 8px; font-size: 13px; }
  .gallery-tile-date { font-size: 12px; }
}
.gallery-tile-play {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--scrim);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  pointer-events: none;
}
.load-more-btn { display: block; margin: 30px auto 0; }

/* « Revenir en haut de la galerie » (gallery/top.js). Meant to go unnoticed
   until wanted: a 28px white disc with a hairline and a soft shadow, the
   arrow in the gallery's accent — chosen with Leo on 2026-10-19 over a
   filled disc and a labelled pill. The touch target stays --tap wide: only
   the drawn disc is small, so it is no harder to hit than any other control.
   Under the viewer (1000) and the toast (1100). */
.gallery-top {
  position: fixed;
  right: max(10px, var(--safe-r));
  bottom: calc(var(--safe-b) + 18px);
  z-index: 50;
  width: var(--tap);
  height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
/* display: flex above would otherwise win over the hidden attribute. */
.gallery-top[hidden] { display: none; }
.gallery-top::before {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--ink) 16%, transparent);
}
.gallery-top svg {
  position: relative;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gallery-top:focus-visible { outline-offset: -6px; border-radius: 50%; }
/* The order segment. Deliberately quiet: the gallery is the page, and a
   full-width outlined button above the grid read as the primary action when
   it is a preference most guests never touch. Small type, a hairline pill,
   and only the active half tinted.

   Both halves keep a 32px height rather than the page's --tap floor: they sit
   side by side with a divider between them, so the target that matters is the
   pill's own width, and a 44px-tall pill above the grid is the prominence
   this was meant to shed. */
.gallery-order {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.gallery-order-option {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1;
  padding: 9px 16px;
  min-height: 32px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}
/* The divider belongs to the second half so it cannot double up at the
   pill's own edge. */
.gallery-order-option + .gallery-order-option { border-left: 1px solid var(--line-soft); }
.gallery-order-option:hover { color: var(--accent-strong); }
.gallery-order-option.is-active {
  background: var(--wash);
  color: var(--accent-strong);
}
/* The active half is not marked by colour alone: a guest who cannot separate
   the tint from the surface still has the weight. */
.gallery-order-option.is-active { font-weight: 700; }

/* The moments of the day: a row of buttons under the order segment, shown
   in the chronological order only (docs/SPEC.md § 4.4). It scrolls sideways
   rather than wrapping — twelve moments on a phone would push the grid below
   the fold — and the auto margins centre it when it fits without cutting
   off its start when it does not. The scrollbar stays, thin: hidden, a mouse
   user in a narrow window has nothing to drag and no wheel that goes
   sideways to reach the buttons past the edge. */
.gallery-moments {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: -10px 0 14px;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}
.gallery-moments[hidden],
.gallery-moment-range[hidden] { display: none; }
.gallery-moment:first-child { margin-left: auto; }
.gallery-moment:last-child { margin-right: auto; }
.gallery-moment {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1;
  padding: 8px 14px;
  min-height: 32px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}
.gallery-moment:hover { color: var(--accent-strong); }
/* The row clips what overflows it, on both axes (overflow-x: auto does not
   leave the other visible). The global ring sits 2px off the button and is 2px
   wide, so it would be cut flat along the top and at both ends of the row.
   Drawn inside, like the tabs' — and 4px in rather than 3, so that on the lit
   button it reads as a ring set apart from the border instead of a thicker
   border. */
.gallery-moment:focus-visible { outline-offset: -4px; }
/* Not marked by colour alone, like the order segment: the weight too. */
.gallery-moment.is-active {
  background: var(--wash);
  border-color: var(--accent-strong);
  color: var(--accent-strong);
  font-weight: 700;
}
.gallery-moment-range {
  margin: 0 0 14px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

/* --- Lightbox --------------------------------------------------------------- */
.lightbox {
  /* Hoisted so the three rules below cannot drift apart: they must agree
     exactly or the thumbnail→original swap reflows.

     76vh rather than the 82vh it once was: the lightbox gives ~40px back to
     the caption that sits below the media. Without that, media + caption +
     padding overflows viewports under roughly 490-610px tall depending on the
     safe-area inset — ~550px is a fair midpoint, and a phone in landscape
     lands in that range. Because .lightbox centres its content, that overflow
     first eats into the bottom safe-area padding rather than clipping
     anything, with the media meanwhile sliding up under the close button; the
     caption is not actually pushed off the bottom edge until well past that,
     around 400px. */
  --lb-maxh: 76vh;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: calc(var(--tap) + 8px) 8px calc(var(--safe-b) + 8px);
}
.lightbox-media { position: relative; max-width: 92vw; max-height: var(--lb-maxh); display: flex; }
.lightbox-media img, .lightbox-media video { max-width: 92vw; max-height: var(--lb-maxh); display: block; }
/* Below the media, not over it: bottom:0 of the media box is exactly where a
   <video controls> bar renders, and this element was covering it and eating
   its clicks. The gradient goes with the absolute positioning — it existed
   only to keep white text legible over arbitrary photo content, and against
   the lightbox scrim it is just a smudge. */
.lightbox-guest {
  margin-top: 10px;
  padding: 0 16px;
  max-width: 92vw;
  color: #fff;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 700;
}
.lightbox-loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.lightbox-spinner { width: 40px; height: 40px; border-radius: 50%; background: var(--blossom); animation: pulseDot 1s ease-in-out infinite; }
/* Sizes an image from the photo's aspect ratio (--ar, set in JS from the
   thumbnail's natural dimensions) instead of from its own pixel dimensions.
   min(92vw, --lb-maxh * ratio) resolves to exactly the width the full-size
   original gets under the max-width/max-height rule above, so a 400px
   thumbnail and a 4032px original occupy an identical box and the swap
   causes no reflow.
   Verified across landscape, portrait, panorama, ultra-tall and square. */
.lightbox-media img.lightbox-ratio-fit {
  width: min(92vw, calc(var(--lb-maxh) * var(--ar, 1)));
  /* aspect-ratio, not height:auto alone: until the thumbnail decodes the
     element has no intrinsic ratio, so height:auto would resolve to 0 and the
     box would collapse for a frame before springing to full size. With --ar
     coming from the gallery API the box is correct before any image data
     arrives. */
  aspect-ratio: var(--ar, 1);
  height: auto;
  max-width: none;
  max-height: none;
}
.lightbox-loading-corner {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0;
  z-index: 1;
}
.lightbox-loading-corner .lightbox-spinner { width: 20px; height: 20px; }
.lightbox-retry { color: #fff; font-family: var(--font-body); text-align: center; }
.lightbox-retry button {
  margin-left: 8px;
  min-height: var(--tap);
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  padding: 10px 18px;
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-body);
}
/* All three were 14-41px wide <div>s that keyboard users could not reach at
   all — and closing is the most-used control on the page. */
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  min-width: var(--tap);
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--scrim);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: color-mix(in srgb, var(--overlay-base) 80%, transparent); }
.lightbox-close:focus-visible, .lightbox-prev:focus-visible, .lightbox-next:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.lightbox-close {
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, var(--safe-r));
  font-size: 26px;
}
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); font-size: 30px; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
body.scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  overflow: hidden;
}

/* --- Toast ------------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: calc(var(--safe-b) + 24px);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--accent);
  color: #fff;
  padding: 14px 24px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 15px;
  text-align: center;
  white-space: pre-line;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 28%, transparent);
  z-index: 1100;
}

/* --- Tabs: only the active section is shown -------------------------------- */
.upload-section,
.gallery-section,
.guestbook-section {
  display: none;
}
.upload-section.section-active,
.gallery-section.section-active,
.guestbook-section.section-active {
  display: block;
}

/* --- « Mes envois » (mine/mine.js) ------------------------------------------ */
/* The screen is a full-screen layer over the page, like the dating dialog:
   the page under it keeps its layout and its scroll (lockBodyScroll). Under
   the dating dialog and the lightbox (1000) and the toast (1100). The button
   that opens it closes the upload section, and the reminder heads that
   section while something did not arrive. Tokens only: the gallery's theme
   recolours all of it. Every block sets a display of its own, so each says
   what [hidden] means for it. */
.mine-screen {
  position: fixed; inset: 0; z-index: 900;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); color: var(--ink);
  padding: max(16px, env(safe-area-inset-top, 0px)) calc(24px + var(--safe-r)) calc(80px + var(--safe-b)) calc(24px + var(--safe-l));
}
.mine-screen[hidden] { display: none; }
/* Focused on opening, for the screen reader; a container, never in the tab
   sequence: no ring around the whole screen (as for the tab panels). */
.mine-screen:focus-visible { outline: none; }
.mine-inner { max-width: 640px; margin: 0 auto; }
.mine-top { display: flex; align-items: center; gap: 4px; margin-left: -12px; }
.mine-back {
  min-width: var(--tap); min-height: var(--tap);
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 30px; line-height: 1;
  color: var(--accent); cursor: pointer;
}
.mine-title {
  margin: 0; font-family: var(--font-body); font-size: 15px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase; color: var(--accent);
}
.mine-subtitle { margin: 4px 0 20px; font-size: 13px; color: var(--ink-muted); }
.mine-error { margin: 0 0 12px; }
.mine-group { margin: 0 0 28px; }
.mine-group-title { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.mine-group-hint { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); }
.mine-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mine-row { display: flex; align-items: center; gap: 12px; }
.mine-row-thumb,
.mine-strip-thumb {
  width: 56px; height: 56px; flex: none;
  object-fit: cover; border-radius: 6px; background: var(--placeholder);
}
.mine-row-text { flex: 1; min-width: 0; }
.mine-row-name,
.mine-row-when,
.mine-row-reason { margin: 0; overflow-wrap: anywhere; }
.mine-row-name { font-size: 14px; color: var(--ink); }
.mine-row-when { font-size: 12px; color: var(--ink-muted); }
.mine-row-reason { font-size: 12px; color: var(--danger); }
.mine-dismiss,
.mine-reminder-link {
  min-height: var(--tap);
  background: none; border: 0; padding: 0 4px;
  font: inherit; font-size: 13px;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.mine-dismiss { flex: none; font-size: 12px; }
.mine-dismiss:hover,
.mine-reminder-link:hover { color: var(--accent-strong); }
.mine-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
@media (min-width: 768px) {
  .mine-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.mine-grid-thumb {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 6px; background: var(--placeholder);
}
.mine-grid-thumb.is-processing { opacity: .55; }
/* No preview: a plain square that says so. */
.mine-noprev {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  padding: 4px; text-align: center; font-size: 10px; color: var(--ink-muted);
}
.mine-more,
.mine-empty { margin: 8px 0 0; font-size: 13px; color: var(--ink-muted); }
.mine-repick { width: 100%; padding-inline: 16px; }

.mine-reminder {
  display: flex; flex-direction: column; gap: 10px;
  margin: 0 0 28px; padding: 14px;
  background: var(--surface); border: 1.5px solid var(--danger); border-radius: 12px;
}
.mine-reminder[hidden] { display: none; }
.mine-reminder-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--danger); }
.mine-reminder-refused { margin: 0; font-size: 13px; color: var(--ink-soft); }
.mine-reminder-link { align-self: center; }
.mine-strip { display: flex; flex-wrap: wrap; gap: 6px; }

.mine-open {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; margin-top: 32px; min-height: var(--tap); padding: 10px 18px;
  background: var(--surface); color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 22px;
  font-family: var(--font-body); font-size: 15px; font-weight: 700; cursor: pointer;
}
.mine-open:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.mine-open[hidden] { display: none; }
.mine-count { font-weight: 400; color: var(--ink-muted); }

/* --- Livre d'or (guestbook/guestbook.js) ---------------------------------------
   The feed under the third tab and the « Écrire un mot » sheet, ported from
   the approved mockup (2026-10-20) onto this sheet's own tokens: the
   gallery's theme recolours all of it. Every rule is scoped under
   .guestbook-section or .gb-sheet, so nothing that exists restyles. */
.guestbook-section { max-width: 640px; margin: 0 auto; padding: 30px 24px 80px; }
.guestbook-section .gb-actions { display: grid; gap: 12px; margin: 0 0 34px; }
.guestbook-section .gb-actions .btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px 12px;
}
.guestbook-section .gb-closed,
.guestbook-section .gb-private {
  margin: 0 0 28px; text-align: center;
  font-size: 15px; line-height: 1.5; color: var(--ink-muted);
}
.guestbook-section .gb-count {
  margin: 0 0 22px; text-align: center;
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-muted);
}
.guestbook-section .processing-notice { margin: 0 0 18px; }

/* Each entry is its own card, on the page's background: the gap between two
   cards is what tells where a word ends. A flourish drawn between them did
   not — the hairlines of « —— NAME —— » read as one too, and the eye could
   not tell which of the two closed the word (Leo, 2026-11-01). */
.guestbook-section .gb-entry {
  text-align: center; padding: 22px 18px 18px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px;
}
.guestbook-section .gb-entry + .gb-entry { margin-top: 14px; }
/* pre-line: a guest's line breaks are kept, runs of spaces are not. A word
   too long for the line (a link, a run of letters) breaks rather than
   pushing the page sideways. */
.guestbook-section .gb-msg {
  margin: 0; font-size: 16px; line-height: 1.65; color: var(--ink);
  white-space: pre-line; overflow-wrap: anywhere;
}
/* « —— NAME —— »: the dashes are two hairlines that share the row. */
.guestbook-section .gb-who { display: flex; align-items: center; gap: 12px; margin: 14px 0 2px; color: var(--accent); }
.guestbook-section .gb-who::before,
.guestbook-section .gb-who::after { content: ""; flex: 1; min-width: 24px; height: 1px; background: var(--line); }
.guestbook-section .gb-who span {
  max-width: 80%; overflow-wrap: anywhere;
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase; font-weight: 700;
}
.guestbook-section .gb-when { display: block; font-size: 13px; font-style: italic; color: var(--ink-muted); }
/* A justified row: each photo's flex-grow and aspect-ratio are its own shape
   (set by the page from the feed's width and height), so every photo of the
   row comes out the same height. That height is capped at --gb-row-h, the
   height of a row of two 3:2 landscapes across the entry's card: the row is never
   wider than the width at which it would reach it (the sum of its shapes,
   --gb-ratio, times the cap, plus its gaps), and narrows, centred, rather
   than letting a lone photo push the next word off the screen. The cap's
   percentage is the card's inner width, resolved where max-width reads it. The
   whole photo stays a tap away, in the lightbox. */
.guestbook-section .gb-row {
  --gb-row-h: calc((100% - 4px) / 3);
  display: flex; align-items: flex-start; gap: 4px;
  max-width: calc(var(--gb-ratio, 99) * var(--gb-row-h) + (var(--gb-count, 1) - 1) * 4px);
  margin: 0 auto;
}
.guestbook-section .gb-photo {
  position: relative; display: block; flex: 1 1 0; min-width: 0;
  padding: 0; border: 0; border-radius: 2px; overflow: hidden;
  background: var(--placeholder); cursor: zoom-in;
}
.guestbook-section .gb-photo img {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; object-fit: cover;
}
/* Under a word or a voice message, its photos; the name and time follow. */
.guestbook-section .gb-entry > :not(.gb-row) + .gb-row { margin-top: 16px; }

/* The voice message's player (guestbook/player.js): in the feed, where a
   written word's text would stand, and in the recording sheet's review. A pill
   with the play button, forty loudness bars (their heights are the page's,
   set inline) and the length; the bars played so far are .on. Scoped under
   both places, and under nothing else. */
:is(.guestbook-section, .gb-voice-sheet) .gb-player {
  display: flex; align-items: center; gap: 12px;
  max-width: 330px; margin: 0 auto; padding: 6px 16px 6px 6px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 999px;
}
:is(.guestbook-section, .gb-voice-sheet) .gb-play {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; cursor: pointer;
  touch-action: manipulation;
}
:is(.guestbook-section, .gb-voice-sheet) .gb-play:hover { background: var(--accent-strong); }
/* While the address of the audio is on its way. */
:is(.guestbook-section, .gb-voice-sheet) .gb-play[aria-busy='true'] { opacity: .6; cursor: progress; }
/* Both icons are in the button; aria-pressed says which one shows. */
:is(.guestbook-section, .gb-voice-sheet) .gb-play .gb-icon-pause,
:is(.guestbook-section, .gb-voice-sheet) .gb-play[aria-pressed='true'] .gb-icon-play { display: none; }
:is(.guestbook-section, .gb-voice-sheet) .gb-play[aria-pressed='true'] .gb-icon-pause { display: block; }
:is(.guestbook-section, .gb-voice-sheet) .gb-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
:is(.guestbook-section, .gb-voice-sheet) .gb-wave i { flex: 1; background: var(--blossom-soft); border-radius: 2px; }
:is(.guestbook-section, .gb-voice-sheet) .gb-wave i.on { background: var(--accent); }
:is(.guestbook-section, .gb-voice-sheet) .gb-wave i.part {
  background: linear-gradient(to right, var(--accent) calc(var(--rempli, 0) * 100%), var(--blossom-soft) 0);
}
/* A width that holds from 0:09 to 10:00, so that the bars do not shift as the
   time counts down. */
:is(.guestbook-section, .gb-voice-sheet) .gb-dur {
  min-width: 2.6em; text-align: right; white-space: nowrap;
  font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
/* The audio could not be played: « Réessayer » takes the length's place. */
:is(.guestbook-section, .gb-voice-sheet) .gb-player[data-etat='echec'] .gb-dur { color: var(--danger); }
/* The browser refused to play a file that is there: « Touchez pour écouter »
   takes the length's place, on two lines so that the bars keep their room on
   a narrow phone. */
:is(.guestbook-section, .gb-voice-sheet) .gb-player[data-etat='a-toucher'] .gb-dur {
  max-width: 6.5em; white-space: normal; line-height: 1.2; color: var(--accent);
}

/* The sheet: a panel from the bottom of the screen over the dimmed page, as
   wide as the page's column. Under the toast (1100), like the other dialogs. */
.gb-sheet { position: fixed; inset: 0; z-index: 1000; }
/* Focused on opening, for the screen reader; a container, never in the tab
   sequence: no ring around the whole screen. */
.gb-sheet:focus-visible { outline: none; }
.gb-sheet .sheet-scrim { position: absolute; inset: 0; background: var(--scrim); }
.gb-sheet .sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 640px; margin: 0 auto;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 20px calc(26px + var(--safe-b));
  background: var(--bg); color: var(--ink);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px color-mix(in srgb, var(--overlay-base) 18%, transparent);
}
.gb-sheet .sheet-title {
  margin: 0 0 18px; text-align: center;
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase; color: var(--accent);
}
.gb-sheet .field { margin-bottom: 8px; }
.gb-sheet .gb-text {
  display: block; width: 100%; min-height: 150px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  resize: none;
}
/* The message's focus, drawn on its own box: an accent edge rather than the
   page's ring around a box that already has a border. */
.gb-sheet .gb-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gb-sheet .gb-message-limit {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 2px 0 0; font-size: 13px; color: var(--ink-muted);
}
.gb-sheet .gb-message-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Past 1 200 characters: the server will refuse the word. */
.gb-sheet .gb-message-count.is-over { color: var(--danger); font-weight: 700; }
.gb-sheet .gb-photos-label { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 8px; }
.gb-sheet .gb-photos-label small { font-size: 13px; color: var(--ink-muted); }
.gb-sheet .gb-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.gb-sheet .gb-slots > * { aspect-ratio: 1; border-radius: 4px; }
.gb-sheet .gb-slot { position: relative; overflow: hidden; background: var(--placeholder); }
.gb-sheet .gb-slot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gb-sheet .gb-slot-noprev {
  display: flex; align-items: center; justify-content: center; height: 100%;
  padding: 4px; text-align: center; font-size: 11px; color: var(--ink-muted);
}
.gb-sheet .gb-slot-remove {
  position: absolute; top: 4px; right: 4px;
  width: 32px; height: 32px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--overlay); color: #fff;
  font-family: var(--font-body); font-size: 20px; line-height: 1; cursor: pointer;
}
/* A 44 px target around the 32 px disc. */
.gb-sheet .gb-slot-remove::before { content: ""; position: absolute; inset: -6px; }
.gb-sheet .gb-slot-remove:disabled { opacity: .5; cursor: not-allowed; }
.gb-sheet .gb-slot-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; padding: 0;
  border: 1.5px dashed var(--line); background: var(--surface); color: var(--accent);
  font-family: var(--font-body); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer;
}
.gb-sheet .gb-slot-add:hover { background: var(--wash); }
.gb-sheet .gb-slot-add:disabled { cursor: not-allowed; opacity: .6; }
.gb-sheet .gb-error { margin: 0 0 14px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--danger); }
/* The full guestbook (approved mockup A, 2026-10-22): a framed notice at the
   top of the sheet, while every field under it goes inert. */
.gb-sheet .gb-full {
  margin: 0 0 18px; padding: 16px 16px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); text-align: center;
}
.gb-sheet .gb-full[hidden] { display: none; }
.gb-sheet .gb-full-title {
  margin: 0 0 8px; font-family: var(--font-display); font-size: 22px; font-weight: 700;
  line-height: 1.2; color: var(--accent-strong);
}
.gb-sheet .gb-full-text { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.gb-sheet .gb-full-other { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-muted); }
/* Inert and greyed: the fields of a full guestbook, and while a word is on
   its way. Safari dims a disabled field by itself; Chrome keeps it in full
   ink. */
.gb-sheet .name-input:disabled,
.gb-sheet .gb-text:disabled { opacity: .45; cursor: not-allowed; }
.gb-sheet .gb-full-link {
  display: inline; min-height: var(--tap); padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: inherit; color: var(--accent-strong);
  text-decoration: underline; text-underline-offset: 3px;
}
.gb-sheet .gb-sheet-note { margin: 0 0 16px; text-align: center; font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.gb-sheet .btn-primary {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 16px 12px;
}
.gb-sheet .sheet-cancel {
  display: block; min-height: var(--tap); margin: 12px auto 0; padding: 0 12px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 15px; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
}
.gb-sheet .sheet-cancel:hover { color: var(--accent); }

/* « Message vocal » (guestbook/voice.js): the recording, then its review,
   ported from the approved mockup (2026-10-20). The sheet itself is a
   .gb-sheet; what is its own is scoped under .gb-voice-sheet. */
.gb-voice-sheet .wide {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px 12px;
}
.gb-voice-sheet .review { margin: 18px 0 16px; text-align: center; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.gb-voice-sheet .rec { display: grid; place-items: center; margin: 22px 0 18px; }
/* The microphone, a button in a disc (approved mockup, 2026-10-22): the
   microphone to touch, the pause sign with two rings rippling out of it
   while it records, a white disc in pause. data-etat on #gb-voice-rec. */
.gb-voice-sheet .rec-mic {
  position: relative; display: grid; place-items: center;
  width: 112px; height: 112px; padding: 0; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--line);
  -webkit-tap-highlight-color: transparent;
}
.gb-voice-sheet .rec-mic:disabled { opacity: .4; cursor: not-allowed; }
.gb-voice-sheet .rec-mic .rec-icon-pause { display: none; }
.gb-voice-sheet [data-etat='enregistre'] .rec-mic .rec-icon-mic { display: none; }
.gb-voice-sheet [data-etat='enregistre'] .rec-mic .rec-icon-pause { display: block; }
.gb-voice-sheet [data-etat='pause'] .rec-mic { background: var(--surface); color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.gb-voice-sheet [data-etat='enregistre'] .rec-mic::before,
.gb-voice-sheet [data-etat='enregistre'] .rec-mic::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--blossom);
  animation: gb-ripple 1.8s ease-out infinite;
  pointer-events: none;
}
.gb-voice-sheet [data-etat='enregistre'] .rec-mic::after { animation-delay: .9s; }
@keyframes gb-ripple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.75); opacity: 0; } }
.gb-voice-sheet .rec-state {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0;
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--accent);
}
.gb-voice-sheet .rec-state b {
  display: none; width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  animation: gb-blink 1s steps(2, start) infinite;
}
.gb-voice-sheet [data-etat='enregistre'] .rec-state b { display: block; }
@keyframes gb-blink { to { visibility: hidden; } }
.gb-voice-sheet .rec-time {
  margin: 6px 0 0; text-align: center;
  font-size: 40px; letter-spacing: 1px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.gb-voice-sheet [data-etat='pret'] .rec-time { color: var(--ink-muted); }
.gb-voice-sheet .rec-max { margin: 0 0 4px; text-align: center; font-size: 13px; color: var(--ink-muted); }
/* What the next touch does: kept one line tall when empty, so that the
   sheet does not move from one state to the next. */
.gb-voice-sheet .rec-hint { min-height: 1.45em; margin: 0 0 10px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.gb-voice-sheet [data-etat='pause'] .rec-level i { opacity: .5; }
/* The level meter: each bar's height is the loudness the page measured
   (voice.js sets it inline, 6 to 32 px), not an animation. */
.gb-voice-sheet .rec-level { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; margin: 0 0 20px; }
.gb-voice-sheet .rec-level i { display: block; width: 4px; height: 6px; border-radius: 2px; background: var(--blossom); transition: height .1s linear; }
.gb-voice-sheet .btn-pair { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
.gb-voice-sheet .hint { margin: 12px 0 0; text-align: center; font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.gb-voice-sheet #gb-voice-rec .hint { margin: 0 0 16px; }
.gb-voice-sheet .gb-error { margin: 16px 0 14px; }
.gb-voice-sheet .gb-sheet-note { margin: 16px 0 0; }
@media (prefers-reduced-motion: reduce) {
  .gb-voice-sheet [data-etat='enregistre'] .rec-mic::before,
  .gb-voice-sheet [data-etat='enregistre'] .rec-mic::after,
  .gb-voice-sheet .rec-state b { animation: none; }
  .gb-voice-sheet [data-etat='enregistre'] .rec-mic::before,
  .gb-voice-sheet [data-etat='enregistre'] .rec-mic::after { opacity: .5; }
  .gb-voice-sheet .rec-level i { transition: none; }
}
/* A voice message still on the phone, in the guestbook's panel: resumed, or
   deleted where the sheet is gone. */
.guestbook-section #gb-voice-resume,
.guestbook-section #gb-voice-drop {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 0 0 34px; padding: 16px 12px;
}
