/* StudioCircle — tokens and components. Source of truth: docs/design/patterns.md (Visual system).
   Components use tokens only. Contrast of every text pair is AA (measured 2026-10-21). */

/* ---------- Fonts (SIL OFL, self-hosted; CSP font-src 'self') ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/3100e775e8/vendor/fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
  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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/34b9c504ca/vendor/fonts/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
  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"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/8197bf5361/vendor/fonts/cormorant-garamond/cormorant-garamond-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/3de1b0f235/vendor/fonts/cormorant-garamond/cormorant-garamond-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("/static/4fb55a7a6d/vendor/fonts/cormorant-garamond/cormorant-garamond-latin-500-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/8048ac209b/vendor/fonts/cormorant-garamond/cormorant-garamond-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/ae062b6d5a/vendor/fonts/cormorant-garamond/cormorant-garamond-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --surface: #FAF8F4; --surface-raised: #FFFFFF; --surface-sunken: #F2EEE7;
  --ink: #1C1A17; --ink-muted: #6B655C; --hairline: #E7E2D9;
  --accent: #8A6A3D; --accent-ink: #FFFFFF; --accent-soft: #F1E9DC;
  --danger: #A23B2C; --danger-ink: #FFFFFF; --danger-soft: #F7E4E0;
  --success: #3F6B4A; --success-soft: #E3EEE5; --warning: #8A5A12; --warning-soft: #F6EBD7;
  --stage: #0B0B0B; --scrim: rgb(11 11 11 / 0.55);

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.125rem;
  --display-sm: 2rem; --display-md: 2.5rem; --display-lg: 3.25rem;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --radius-tile: 2px; --radius: 10px; --radius-pill: 999px;
  --shadow-float: 0 8px 28px rgb(28 26 23 / 0.12), 0 1px 3px rgb(28 26 23 / 0.08);
  --ease: cubic-bezier(.2, .7, .2, 1); --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #121110; --surface-raised: #1C1A18; --surface-sunken: #0D0C0B;
    --ink: #F2EFEA; --ink-muted: #A39D93; --hairline: #2C2926;
    --accent: #C9A46A; --accent-ink: #1C1A17; --accent-soft: #2A241B;
    --danger: #E07A68; --danger-ink: #1C1A17; --danger-soft: #3A1F1A;
    --success: #8BC29A; --success-soft: #1C2A20; --warning: #E2B26A; --warning-soft: #2E2416;
    --shadow-float: 0 8px 28px rgb(0 0 0 / 0.5), 0 1px 3px rgb(0 0 0 / 0.4);
  }
}
:root[data-theme="dark"] {
  --surface: #121110; --surface-raised: #1C1A18; --surface-sunken: #0D0C0B;
  --ink: #F2EFEA; --ink-muted: #A39D93; --hairline: #2C2926;
  --accent: #C9A46A; --accent-ink: #1C1A17; --accent-soft: #2A241B;
  --danger: #E07A68; --danger-ink: #1C1A17; --danger-soft: #3A1F1A;
  --success: #8BC29A; --success-soft: #1C2A20; --warning: #E2B26A; --warning-soft: #2E2416;
  --shadow-float: 0 8px 28px rgb(0 0 0 / 0.5), 0 1px 3px rgb(0 0 0 / 0.4);
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The scrollbar's space is always kept, so a short page (one album, an empty Albums) does not shift the centred
   header sideways against a long one where the browser draws a classic scrollbar. The gutter shows html's background. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; background: var(--surface); }
body { margin: 0; min-height: 100dvh; background: var(--surface); color: var(--ink);
  font: 400 var(--text-md)/1.55 var(--font-ui); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; }
/* A page kept in the back/forward cache shows nothing until it is loaded again (js/app.js). */
html.is-cached body { visibility: hidden; }
h1, h2, h3, p { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--space-4); top: -100px; padding: var(--space-2) var(--space-4); background: var(--ink); color: var(--surface); border-radius: var(--radius-pill); z-index: 100; }
.skip-link:focus { top: var(--space-4); }
main:focus { outline: none; }
.icon { width: 20px; height: 20px; flex: none; }

.display { font: 500 var(--display-sm)/1.1 var(--font-display); letter-spacing: -0.01em; }
@media (min-width: 768px) { .display { font-size: var(--display-lg); } }
.eyebrow { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.lede { color: var(--ink-muted); max-width: 60ch; }
.page--centred main { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-5); }

/* ---------- Button ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-5); border: 1px solid transparent; border-radius: var(--radius-pill);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.btn--sm { min-height: 36px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn--lg { min-height: 52px; padding: 0 var(--space-6); font-size: var(--text-lg); }
.btn--primary { background: var(--ink); color: var(--surface); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--surface)); }
.btn--secondary { background: transparent; border-color: var(--hairline); color: var(--ink); }
.btn--secondary:hover { border-color: var(--ink-muted); }
.btn--quiet { background: transparent; color: var(--ink); }
.btn--quiet:hover { background: var(--surface-sunken); }
.btn--danger { background: var(--danger); color: var(--danger-ink); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 88%, var(--ink)); }
/* Destructive actions that are not the point of the page: red text, no fill, and last in their row. */
.btn--danger-quiet { background: transparent; color: var(--danger); }
.btn--danger-quiet:hover { background: var(--danger-soft); }
@media (pointer: coarse) { .btn--sm { min-height: var(--tap); } }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
/* A button that stays focusable (and announced) but does nothing now: drawn inactive, text still legible. */
.btn[aria-disabled="true"], .btn[aria-disabled="true"]:hover { background: var(--surface-sunken); color: var(--ink-muted);
  box-shadow: inset 0 0 0 1px var(--hairline); cursor: not-allowed; }

.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.icon-btn:hover { background: var(--surface-sunken); }
.icon-btn--secondary { border-color: var(--hairline); }
.icon-btn[aria-pressed="true"] { color: var(--danger); }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Fields ---------- */
.field { display: grid; gap: var(--space-2); max-width: 28rem; }
.field__label { font-weight: 500; }
.field__optional { color: var(--ink-muted); font-weight: 400; }
.field__hint, .check__hint, .switch__hint { color: var(--ink-muted); font-size: var(--text-sm); }
.field__input { min-height: var(--tap); padding: 0 var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface-raised); transition: border-color var(--dur-1) var(--ease); }
.field__input:hover { border-color: var(--ink-muted); }
.field__input:focus-visible { border-color: var(--accent); }
.field__input:disabled { background: var(--surface-sunken); color: var(--ink-muted); cursor: not-allowed; }
.field__input[aria-invalid="true"] { border-color: var(--danger); }
.field__error { display: flex; gap: var(--space-2); align-items: center; color: var(--danger); font-size: var(--text-sm); }

.check, .switch { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); align-items: start; max-width: 32rem; }
.check__hint, .switch__hint { grid-column: 2; }
.check__input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); cursor: pointer; }
.check__label, .switch__label { cursor: pointer; }
.switch__input { appearance: none; width: 42px; height: 24px; margin: 0; border-radius: var(--radius-pill); background: var(--hairline);
  position: relative; cursor: pointer; transition: background-color var(--dur-2) var(--ease); }
.switch__input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-raised); box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform var(--dur-2) var(--ease); }
.switch__input:checked { background: var(--ink); }
.switch__input:checked::after { transform: translateX(18px); }
.check__input:disabled, .switch__input:disabled { opacity: 0.45; cursor: not-allowed; }
.check__input:disabled + .check__label, .switch__input:disabled + .switch__label { color: var(--ink-muted); cursor: not-allowed; }

/* ---------- Badge, avatar, spinner, skeleton ---------- */
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 500; background: var(--surface-sunken); color: var(--ink); }
.badge--accent { background: var(--accent-soft); color: var(--ink); }
.badge--success { background: var(--success-soft); color: var(--ink); }
.badge--danger { background: var(--danger-soft); color: var(--ink); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--ink); font-size: var(--text-sm); font-weight: 600; }
.avatar--sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar--lg { width: 48px; height: 48px; font-size: var(--text-md); }
.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--hairline); border-top-color: var(--ink); animation: spin 800ms linear infinite; }
.spinner--inline { width: 16px; height: 16px; border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: block; background: var(--surface-sunken); border-radius: var(--radius); animation: pulse 1.6s ease-in-out infinite; }
.skeleton--line { height: 14px; width: 100%; max-width: 32rem; }
.skeleton--block { height: 120px; width: 100%; }
.skeleton--tile { width: 120px; height: 90px; border-radius: var(--radius-tile); }
.skeleton--circle { width: 36px; height: 36px; border-radius: 50%; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------- Toast & alert ---------- */
.toast-region { position: fixed; z-index: 50; left: 50%; bottom: max(var(--space-4), env(safe-area-inset-bottom));
  transform: translateX(-50%); display: grid; gap: var(--space-2); width: min(92vw, 26rem); pointer-events: none; }
@media (min-width: 768px) { .toast-region { left: var(--space-5); transform: none; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--space-3); min-height: 48px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius);
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-float);
  animation: toast-in var(--dur-3) var(--ease); }
.toast__message { flex: 1; font-size: var(--text-sm); }
.toast__action { font-weight: 600; font-size: var(--text-sm); color: inherit; padding: var(--space-2); }
.toast__close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-pill); background: transparent; color: inherit; cursor: pointer; }
.toast--warning { border-left: 3px solid var(--warning); }
.toast[data-leaving] { animation: toast-out var(--dur-2) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.alert { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); max-width: 40rem; }
.alert__text { display: grid; gap: var(--space-1); justify-items: start; min-width: 0; }
.alert__title { font-weight: 600; }
.alert__action { margin-top: var(--space-2); }
.alert__body { color: var(--ink-muted); font-size: var(--text-sm); }
.alert--success { background: var(--success-soft); } .alert--success .icon { color: var(--success); }
.alert--warning { background: var(--warning-soft); } .alert--warning .icon { color: var(--warning); }
.alert--danger { background: var(--danger-soft); } .alert--danger .icon { color: var(--danger); }

/* ---------- Empty & error states ---------- */
.state { display: grid; justify-items: center; gap: var(--space-3); max-width: 26rem; margin-inline: auto; padding: var(--space-7) var(--space-5); text-align: center; }
.state__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-muted); }
.state__title { font: 500 var(--display-sm)/1.15 var(--font-display); }
.state__body { color: var(--ink-muted); margin-bottom: var(--space-3); }
.state--error .state__icon { color: var(--danger); background: var(--danger-soft); }

/* ---------- Dialog & sheet (native <dialog>) ---------- */
.dialog { padding: 0; border: 0; background: transparent; color: var(--ink); max-width: min(92vw, 34rem); width: 100%; }
.dialog::backdrop { background: var(--scrim); }
.dialog[open] .dialog__panel { animation: dialog-in var(--dur-3) var(--ease); }
.dialog__panel { background: var(--surface-raised); border-radius: var(--radius); box-shadow: var(--shadow-float); padding: var(--space-5); display: grid; gap: var(--space-4); }
.dialog__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dialog__title { font: 500 1.75rem/1.2 var(--font-display); }
.dialog__body { display: grid; gap: var(--space-4); }
.dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
@media (max-width: 640px) {
  .dialog--sheet { margin: auto 0 0; max-width: 100vw; }
  .dialog--sheet .dialog__panel { border-radius: var(--radius) var(--radius) 0 0; padding-bottom: max(var(--space-5), env(safe-area-inset-bottom)); }
  .dialog--sheet[open] .dialog__panel { animation: sheet-in var(--dur-3) var(--ease); }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet__grabber { justify-self: center; width: 40px; height: 4px; border-radius: var(--radius-pill); background: var(--hairline); }
@media (min-width: 641px) { .sheet__grabber { display: none; } }
.sheet__group { display: grid; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.sheet__action { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 0 var(--space-4); text-decoration: none; }
.sheet__action + .sheet__action { border-top: 1px solid var(--hairline); }
.sheet__action:hover { background: var(--surface-sunken); }
.sheet__action--danger { color: var(--danger); }

/* ---------- Auth pages ---------- */
.auth-card { width: min(100%, 28rem); display: grid; gap: var(--space-4); }
.auth-card__form { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
.auth-card__form .btn { width: 100%; }
.auth-card__status { min-height: 1.5em; color: var(--danger); font-size: var(--text-sm); }
.auth-card__note { color: var(--ink-muted); font-size: var(--text-sm); }

/* ---------- App shell ---------- */
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--hairline); }
.app-bar__brand { font: 500 1.375rem/1 var(--font-display); text-decoration: none; }
.app-bar__account { display: flex; align-items: center; gap: var(--space-3); margin: 0; }
.app-bar__who { display: inline-flex; align-items: center; gap: var(--space-2); }
@media (max-width: 480px) { .app-bar__name { display: none; } }
.page { max-width: 72rem; margin: 0 auto; padding: var(--space-7) var(--space-5); display: grid; gap: var(--space-6); }
.page > *, :where(.section, .chapters, .grid-region, .uploader, .event-create) > * { min-width: 0; }
.section { display: grid; gap: var(--space-4); }

/* ---------- Page furniture ---------- */
[hidden] { display: none !important; }
.section-title { font: 500 1.75rem/1.2 var(--font-display); }
/* The link is 44 px tall to tap; the negative margin gives the height back, so the page does not move. */
.crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); margin-block: calc((var(--tap) - 1lh) / -2);
  color: var(--ink-muted); font-size: var(--text-sm); }
.event-head { display: grid; gap: var(--space-2); }

/* ---------- Event list & create ---------- */
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.event-card { display: grid; gap: var(--space-1); padding: var(--space-5); border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface-raised); text-decoration: none; min-height: var(--tap);
  transition: border-color var(--dur-1) var(--ease); }
.event-card:hover { border-color: var(--ink-muted); }
.event-card__title { font: 500 1.5rem/1.2 var(--font-display); }
.event-card__meta { color: var(--ink-muted); font-size: var(--text-sm); }
.event-create { display: grid; gap: var(--space-4); }
.event-create__form { display: grid; gap: var(--space-4); max-width: 28rem; }
.event-create__form .btn { justify-self: start; }

/* ---------- Chapters ---------- */
.chapters { display: grid; gap: var(--space-4); }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); max-width: 36rem; }
.chapter-row { display: flex; gap: var(--space-2); align-items: center; min-width: 0; }
.chapter-row__rename { display: flex; gap: var(--space-2); flex: 1; min-width: 0; margin: 0; }
.chapter-row__input { flex: 1; min-width: 0; }
.chapter-row__delete { margin: 0; }
.chapter-add { display: grid; gap: var(--space-3); max-width: 28rem; }
.chapter-add .btn { justify-self: start; }

/* ---------- Photo tile & justified grid ---------- */
.jgrid { display: grid; gap: var(--space-1); }
.jgrid__row { display: flex; gap: 6px; }
.tile { position: relative; flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; border-radius: var(--radius-tile); background: var(--surface-sunken); }
.jgrid__row--last .tile { flex-grow: 0; }
/* The photo has no CSS width: its width attribute is the tile's natural size (so rows are right without
   JavaScript), and min/max-width make it fill the tile whatever flex does to the tile. */
.tile__photo { position: relative; display: block; height: 100%; min-width: 100%; max-width: 100%; object-fit: cover; color: transparent; }
.tile__placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px); transform: scale(1.05); }
@media (max-width: 640px) { .jgrid__row { gap: 2px; } .jgrid { gap: 2px; } }
.grid-region { display: grid; gap: var(--space-4); }
.grid-region__note { color: var(--ink-muted); font-size: var(--text-sm); }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.status-tile { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-sunken); min-width: 0; }
.status-tile--failed { background: var(--danger-soft); }
.status-tile--failed .icon { color: var(--danger); }
.status-tile__text { display: grid; min-width: 0; }
.status-tile__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-tile__state { color: var(--ink-muted); font-size: var(--text-sm); }
.status-tile--failed .status-tile__state { color: var(--ink); }

/* ---------- Uploader ---------- */
.uploader { display: grid; gap: var(--space-4); }
.uploader__drop { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-7) var(--space-5); text-align: center;
  border: 2px dashed var(--hairline); border-radius: var(--radius); transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease); }
.uploader__drop[data-dragging] { border-color: var(--accent); background: var(--accent-soft); }
.uploader__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-muted); }
.uploader__prompt { font-weight: 500; }
.uploader__limits, .uploader__note { color: var(--ink-muted); font-size: var(--text-sm); }
.uploader__pick { position: relative; }
.uploader__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.uploader__pick:focus-within .btn { box-shadow: var(--focus); }
.uploader__chapter { max-width: 20rem; }
.uploader__summary { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }
.uploader__progress { font-weight: 500; }
.uploader__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); max-height: 24rem; overflow-y: auto; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 8rem 7rem; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); border-radius: var(--radius); }
.upload-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row__bar { width: 100%; height: 6px; accent-color: var(--ink); }
.upload-row__state { color: var(--ink-muted); font-size: var(--text-sm); text-align: right; }
.upload-row--failed { background: var(--danger-soft); }
.upload-row--failed .upload-row__state { color: var(--ink); }
.upload-row--done .upload-row__state { color: var(--success); }
@media (max-width: 640px) {
  .upload-row { grid-template-columns: minmax(0, 1fr) auto; }
  .upload-row__bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Catalogue (dev only) ---------- */
.catalogue main { max-width: 64rem; margin: 0 auto; padding: var(--space-7) var(--space-5) var(--space-9); }
.catalogue__header { display: grid; gap: var(--space-3); margin-bottom: var(--space-7); }
.catalogue__tools { margin-top: var(--space-2); }
.catalogue__section { padding: var(--space-6) 0; border-top: 1px solid var(--hairline); display: grid; gap: var(--space-4); }
.catalogue__title { font: 500 1.5rem/1.2 var(--font-display); }
.catalogue__row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.catalogue__stack { display: grid; gap: var(--space-4); }
.catalogue__tile { width: 14rem; }
.catalogue__toasts .toast { animation: none; max-width: 26rem; }

/* invitations (slice 4a) */
.invite-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
/* end invitations */

/* share links (slice 7) */
.radio { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); align-items: start; max-width: 32rem; }
.radio__hint { grid-column: 2; margin: 0; color: var(--ink-muted); font-size: var(--text-sm); }
.radio__input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); cursor: pointer; }
.radio__label { cursor: pointer; }
.radio__input:disabled { opacity: 0.45; cursor: not-allowed; }
.radio__input:disabled + .radio__label { color: var(--ink-muted); cursor: not-allowed; }
.choice { display: grid; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.choice__legend { padding: 0; margin-bottom: var(--space-2); font-weight: 500; }
.reveal { display: grid; gap: var(--space-3); }
.reveal:not(:has(.switch__input:checked)) .reveal__body { display: none; }
.reveal__body { display: grid; gap: var(--space-2); }
.share-form { gap: var(--space-5); }
.share-list { display: grid; gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.share-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-start; justify-content: space-between;
  padding-bottom: var(--space-4); border-bottom: 1px solid var(--hairline); }
.share-row__main { display: grid; gap: var(--space-1); min-width: 0; }
.share-row__main p { margin: 0; }
.share-row__title { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-weight: 500; }
.confirm__summary { cursor: pointer; color: var(--danger); font-weight: 500; min-height: var(--tap); display: inline-flex; align-items: center;
  padding: 0 var(--space-4); border-radius: var(--radius-pill); font-size: var(--text-sm); }
.confirm__summary:hover { background: var(--danger-soft); }
.confirm__summary:focus-visible { box-shadow: var(--focus); }
.confirm[open] > .confirm__summary { background: var(--danger-soft); }
.confirm__body .btn { justify-self: start; }
.confirm__body { display: grid; gap: var(--space-3); padding: var(--space-3) 0; max-width: 24rem; }
.confirm__body p { margin: 0; }
.share-open { display: grid; gap: var(--space-3); justify-items: center; text-align: center; }
.app-bar__shared { color: var(--ink-muted); font-size: var(--text-sm); }
/* end share links */

/* ---------- Gallery, chapters & viewer (slice 4a) ---------- */
:root {
  --stage-ink: #F2EFEA; --stage-ink-muted: #B3ADA3; --stage-control: rgb(242 239 234 / 0.14);
  --stage-control-hover: rgb(242 239 234 / 0.26);
  --stage-focus: 0 0 0 2px var(--stage), 0 0 0 4px var(--stage-ink);
}
.event-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; }
.page--gallery { gap: var(--space-5); }
.gallery-section { display: grid; gap: var(--space-4); scroll-margin-top: calc(var(--toolbar-h) + var(--space-3)); }
.chapter-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.chapter-header__title { font: 500 1.75rem/1.2 var(--font-display); }
@media (min-width: 768px) { .chapter-header__title { font-size: 2.25rem; } }
.chapter-header__count { color: var(--ink-muted); font-size: var(--text-sm); white-space: nowrap; }
.chapter-strip { position: sticky; top: 0; z-index: 5; margin-inline: calc(var(--space-5) * -1); padding: var(--space-2) var(--space-5);
  background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(8px); }
.chapter-strip__list { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
/* js/app.js sets data-fade="end" while more chapters wait to the right, "start" at the far end, "both" between. */
.chapter-strip__list[data-fade="end"] { mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); }
.chapter-strip__list[data-fade="start"] { mask-image: linear-gradient(to left, #000 calc(100% - 3rem), transparent); }
.chapter-strip__list[data-fade="both"] { mask-image: linear-gradient(to right, transparent, #000 3rem, #000 calc(100% - 3rem), transparent); }
@media (min-width: 768px) { .chapter-strip { margin-inline: 0; padding-inline: 0; } }
.chapter-strip__link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding: 0 var(--space-4);
  border-radius: var(--radius-pill); text-decoration: none; white-space: nowrap; color: var(--ink); }
.chapter-strip__link:hover { background: var(--surface-sunken); }
.chapter-strip__count { color: var(--ink-muted); font-size: var(--text-xs); }
.preview-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-5); background: var(--accent-soft); font-size: var(--text-sm); }
.preview-banner p { margin: 0; }
.preview-banner__link { min-height: var(--tap); display: inline-flex; align-items: center; }
.tile__link { position: relative; display: block; height: 100%; color: inherit; text-decoration: none; cursor: zoom-in; }
/* The ring is drawn on an overlay above the photo: an inset shadow or outline on the link itself is painted over by the image. */
.tile__link:focus-visible { box-shadow: none; }
.tile__link:focus-visible::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: var(--radius-tile); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 5px var(--accent); }

.lightbox { color: var(--stage-ink); background: var(--stage); --focus: var(--stage-focus); }
dialog.lightbox { padding: 0; border: 0; margin: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; overflow: hidden; }
dialog.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: lightbox-in var(--dur-2) var(--ease); }
dialog.lightbox::backdrop { background: var(--stage); }
.lightbox--page { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 100dvh; height: 100dvh; overflow: hidden; }
.stage-page { background: var(--stage); }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: max(var(--space-2), env(safe-area-inset-top)) var(--space-3) var(--space-2); }
.lightbox__counter { margin: 0; font-size: var(--text-sm); color: var(--stage-ink-muted); font-variant-numeric: tabular-nums; }
/* The row is definite (minmax(0, 1fr)): without it a tall photo makes the implicit row as tall as the photo and runs off the screen. */
.lightbox__stage { margin: 0; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 0 var(--space-3) max(var(--space-3), env(safe-area-inset-bottom));
  touch-action: pan-y; user-select: none; position: relative; }
.lightbox__image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-tile); }
.lightbox__caption { position: absolute; left: 0; right: 0; bottom: var(--space-2); text-align: center; color: var(--stage-ink-muted); font-size: var(--text-sm); pointer-events: none; }
.lightbox__control { color: var(--stage-ink); background: var(--stage-control); text-decoration: none; }
.lightbox__control:hover { background: var(--stage-control-hover); }
.lightbox__control:disabled { opacity: 0.35; cursor: default; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lightbox__nav--prev { left: var(--space-3); }
.lightbox__nav--next { right: var(--space-3); }
@media (max-width: 640px) {
  .lightbox__nav { top: auto; bottom: max(var(--space-3), env(safe-area-inset-bottom)); transform: none; }
  .lightbox__stage { padding-bottom: calc(var(--tap) + var(--space-5)); }
}
body:has(dialog.lightbox[open]) { overflow: hidden; }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
/* end gallery (slice 4a) */
.page-foot { display: flex; justify-content: flex-start; padding-top: var(--space-4); border-top: 1px solid var(--hairline); }

/* ---------- Downloads: header, selection mode, viewer download (slice 5) ---------- */
[hidden] { display: none !important; }
.event-head__count { font-weight: 500; }
.privacy-line { color: var(--ink-muted); font-size: var(--text-sm); max-width: 40rem; }
.privacy-line__summary { display: inline-flex; align-items: center; min-height: var(--tap); cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px; }
.privacy-line__more { margin: 0 0 var(--space-2); }
.chapter-strip__link[aria-current] { background: var(--accent-soft); font-weight: 600; }
.selection { display: grid; gap: var(--space-5); }
.chapter-header__select { display: inline-flex; gap: var(--space-1); margin-inline-start: auto; }
.chapter-header__select[hidden] { display: none; }
/* The checkbox sits over the tile's corner; the whole 44 px label is the target. */
.tile__select { display: none; position: absolute; top: 0; left: 0; z-index: 2; width: var(--tap); height: var(--tap);
  place-items: center; cursor: pointer; }
.selection.is-selecting .tile__select { display: grid; }
.tile__check { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tile__tick { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-pill);
  border: 2px solid var(--surface-raised); background: var(--scrim); color: transparent; pointer-events: none;
  transition: background-color var(--dur-1) var(--ease); }
.tile__tick .icon { width: 16px; height: 16px; }
.tile__check:checked + .tile__tick { background: var(--accent); border-color: var(--surface-raised); color: var(--accent-ink); }
.tile__check:focus-visible + .tile__tick { box-shadow: var(--focus); }
.tile:has(.tile__check:checked) .tile__photo { opacity: 0.8; }
.tile:has(.tile__check:checked) { outline: 3px solid var(--accent); outline-offset: -3px; }
.selection-bar { position: sticky; bottom: max(var(--space-3), env(safe-area-inset-bottom)); z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface-raised); box-shadow: var(--shadow-float); }
.selection-bar__count { font-weight: 600; font-variant-numeric: tabular-nums; }
.selection-bar__message { flex: 1 1 100%; order: 3; color: var(--danger); font-size: var(--text-sm); }
.selection-bar__message:empty { display: none; }
.selection-bar__actions { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.catalogue .selection-bar[hidden] { display: flex !important; position: static; }
.lightbox__chapter { flex: 1; margin: 0; text-align: center; font-size: var(--text-sm); color: var(--stage-ink); }
.lightbox__download { color: var(--stage-ink); background: var(--stage-control); border-color: transparent; }
.lightbox__download:hover { background: var(--stage-control-hover); }
/* end downloads (slice 5) */

/* ---------- Favourites: heart, views, status (slice 6) ---------- */
:root { --heart: #E07A68; }
.view-tabs { display: flex; gap: var(--space-2); min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
/* Four tabs (Pending, Added, Rejected, Hidden) must fit a 390 px phone without moving the page sideways. */
@media (max-width: 480px) { .view-tabs { gap: 0; } .view-tabs__link { padding-inline: var(--space-2); gap: var(--space-1); font-size: var(--text-sm); } }
/* The review queues: four equal columns on a phone, label over count, so Hidden (the way back and Delete) is never cut off or scrolled away. */
@media (max-width: 480px) {
  .view-tabs--four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow-x: visible; }
  .view-tabs--four .view-tabs__link { flex-direction: column; justify-content: center; gap: 0; padding-inline: var(--space-1); min-width: 0; }
}
.view-tabs__link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding: 0 var(--space-4);
  border-radius: var(--radius-pill); text-decoration: none; white-space: nowrap; color: var(--ink); }
.view-tabs__link:hover { background: var(--surface-sunken); }
.view-tabs__link[aria-current] { background: var(--accent-soft); font-weight: 600; }
.view-tabs__count { color: var(--ink-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
/* The heart sits in the tile's top right corner; the whole 44 px square is the target. On a
   pointer device it appears on hover and focus; on touch it is left to the viewer (it is still
   in the accessibility tree and shows on focus). A heart that is on always shows. */
.tile__heart { position: absolute; top: 0; right: 0; z-index: 2; display: grid; place-items: center; width: var(--tap); height: var(--tap);
  padding: 0; border: 0; background: transparent; color: var(--stage-ink); cursor: pointer; opacity: 0;
  transition: opacity var(--dur-1) var(--ease); }
.tile__heart .icon { width: 24px; height: 24px; padding: 4px; box-sizing: content-box; border-radius: var(--radius-pill); background: var(--scrim); }
.tile:hover .tile__heart, .tile:focus-within .tile__heart, .tile__heart:focus-visible, .tile__heart[aria-pressed="true"] { opacity: 1; }
@media (hover: none) {
  .tile__heart[aria-pressed="false"] { pointer-events: none; }
  .tile:focus-within .tile__heart[aria-pressed="false"] { pointer-events: auto; }
  .tile:hover .tile__heart[aria-pressed="false"] { opacity: 0; }
  .tile:focus-within .tile__heart[aria-pressed="false"] { opacity: 1; }
}
.tile__heart:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); border-radius: var(--radius-tile); }
[data-favourite][aria-pressed="true"] .icon { fill: currentColor; }
.tile__heart[aria-pressed="true"] { color: var(--heart); }
.lightbox__favourite { color: var(--stage-ink); background: var(--stage-control); border-color: transparent; }
.lightbox__favourite:hover { background: var(--stage-control-hover); }
.lightbox__favourite[aria-pressed="true"] .icon { color: var(--heart); }
.lightbox__favourite-form { margin: 0; display: contents; }
.lightbox__counter { white-space: nowrap; }
.lightbox__chapter { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* On a phone the bar is tight: the heart and the download keep their names but drop their words, as 44 px icon buttons. */
dialog.lightbox[open], .lightbox--page { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
  .lightbox__favourite, .lightbox__download { padding: 0; width: var(--tap); min-height: var(--tap); flex: none; }
  .lightbox__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.favourite-status { position: fixed; z-index: 60; left: 50%; bottom: max(var(--space-4), env(safe-area-inset-bottom)); transform: translateX(-50%);
  margin: 0; width: max-content; max-width: min(92vw, 26rem); padding: var(--space-3) var(--space-4); border-radius: var(--radius);
  background: var(--ink); color: var(--surface); font-size: var(--text-sm); box-shadow: var(--shadow-float); }
.favourite-status:empty { display: none; }
.selection-bar__message[data-tone="ok"] { color: var(--ink-muted); }
.catalogue .tile__heart { opacity: 1; pointer-events: auto; }
.catalogue .favourite-status { position: static; transform: none; }
/* end favourites (slice 6) */

/* ---------- Story (patterns "Story"): chapter openers, image rhythm, chapter pager ---------- */
.view-switch { display: inline-flex; justify-self: start; border: 1px solid var(--hairline); border-radius: var(--radius-pill); }
.view-switch__link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding: 0 var(--space-5); border-radius: var(--radius-pill);
  text-decoration: none; color: var(--ink-muted); transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.view-switch__link:hover { background: var(--surface-sunken); color: var(--ink); }
.view-switch__link[aria-current] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

.story { --gutter: var(--space-5); padding-bottom: var(--space-8); }
.story-empty, .story-note { max-width: 72rem; margin: var(--space-7) auto 0; padding-inline: var(--gutter); }

.story-chapter { display: grid; row-gap: var(--space-6); margin-top: var(--space-8); scroll-margin-top: calc(var(--toolbar-h) + var(--space-3)); }
.story-chapter > * { min-width: 0; }
.story-opener { display: grid; row-gap: var(--space-6); }
.story-opener__text { width: min(100% - 2 * var(--gutter), 44rem); margin-inline: auto; display: grid; gap: var(--space-3); text-align: center; }
.story-opener__title { font: 500 2.25rem/1.05 var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
.story-opener__title:focus { outline: none; }
.story-opener__standfirst { font: italic 500 1.25rem/1.6 var(--font-display); color: var(--ink-muted); text-wrap: balance; }
.story-opener__cover { margin: 0; }

.story-figure { position: relative; margin: 0; overflow: hidden; background: var(--surface-sunken); }
.story-figure__link { position: relative; display: block; color: inherit; text-decoration: none; cursor: zoom-in; }
.story-figure__link:focus-visible { box-shadow: none; }
.story-figure__link:focus-visible::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 5px var(--accent); }
.story-figure__photo { position: relative; display: block; width: 100%; height: auto; color: transparent; }
.story-figure__placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px); transform: scale(1.05); }
.story-opener__cover--full .story-figure__photo, .story-block--full .story-figure__photo { max-height: 96svh; object-fit: contain; }
/* When a full-bleed photo is wider than the screen allows it is letterboxed: the side bands are the
   plain page surface (the blur-up placeholder is contained to the photo's own box), never a blurred fill. */
.story-opener__cover--full .story-figure, .story-block--full .story-figure { background: var(--surface); }
.story-opener__cover--full .story-figure__placeholder, .story-block--full .story-figure__placeholder { object-fit: contain; }
/* A portrait or square cover is shown whole and centred, like an inset photo: never cropped to a wide band. */
.story-opener__cover--framed { width: calc(100% - 2 * var(--gutter)); margin-inline: auto; display: grid; justify-items: center; }
.story-opener__cover--framed .story-figure, .story-opener__cover--framed .story-figure__link { width: fit-content; max-width: 100%; }
.story-opener__cover--framed .story-figure { border-radius: var(--radius-tile); }
.story-opener__cover--framed .story-figure__photo { width: auto; max-width: 100%; max-height: 88svh; }

.story-block { margin: 0; }
.story-block--inset { width: calc(100% - 2 * var(--gutter)); margin-inline: auto; display: grid; justify-items: center; }
.story-block--inset .story-figure { width: fit-content; max-width: 100%; border-radius: var(--radius-tile); }
.story-block--inset .story-figure__link { width: fit-content; max-width: 100%; }
.story-block--inset .story-figure__photo { width: auto; max-width: 100%; max-height: 88svh; }
.story-block--pair { width: calc(100% - 2 * var(--gutter)); margin-inline: auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); align-items: center; }
.story-block--pair .story-figure { border-radius: var(--radius-tile); }

.story-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-3);
  width: calc(100% - 2 * var(--gutter)); max-width: 72rem; margin: var(--space-5) auto 0; padding-top: var(--space-3); border-top: 1px solid var(--hairline); }
.story-pager__step { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); min-width: 0; color: var(--ink); text-decoration: none; }
.story-pager__step--next { justify-self: end; text-align: right; }
a.story-pager__step:hover .story-pager__name { text-decoration: underline; text-underline-offset: 3px; }
.story-pager__label { display: grid; min-width: 0; }
.story-pager__hint { color: var(--ink-muted); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.story-pager__name { font: 500 1.125rem/1.25 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 639px) {
  .story-pager__name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.story-pager__menu { position: relative; justify-self: center; }
.story-pager__summary { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-5); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); cursor: pointer; list-style: none; }
.story-pager__summary::-webkit-details-marker { display: none; }
.story-pager__summary:hover { background: var(--surface-sunken); }
.story-pager__menu[open] .story-pager__summary { background: var(--accent-soft); }
.story-pager__list { position: absolute; z-index: 6; bottom: calc(100% + var(--space-2)); left: 50%; transform: translateX(-50%);
  min-width: 14rem; max-width: 90vw; max-height: 60svh; overflow-y: auto; margin: 0; padding: var(--space-2); list-style: none;
  background: var(--surface-raised); border-radius: var(--radius); box-shadow: var(--shadow-float); }
.story-pager__item { display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-4); border-radius: var(--radius); text-decoration: none; }
.story-pager__item:hover { background: var(--surface-sunken); }
.story-pager__item[aria-current] { background: var(--accent-soft); font-weight: 600; }

@media (min-width: 900px) {
  .story { --gutter: var(--space-7); }
  .story-chapter { row-gap: var(--space-8); margin-top: var(--space-9); }
  .story-opener { row-gap: var(--space-7); }
  .story-opener__title { font-size: 3.5rem; }
  .story-opener__standfirst { font-size: 1.375rem; }
  .story-block--inset { width: 68%; }
  .story-block--pair { width: 68%; gap: var(--space-4); }
}

/* Gentle scroll reveals: fade and a small rise. Off entirely under reduced motion, and without JS
   (js/story.js adds .story--motion only when it can observe scrolling). */
@media (prefers-reduced-motion: no-preference) {
  .story--motion [data-reveal] { transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
  .story--motion [data-reveal]:not(.is-revealed) { opacity: 0; transform: translateY(8px); }
}

/* The chapter's opener on the event page: standfirst and cover choice. */
.chapter-row { flex-wrap: wrap; }
.chapter-opener { flex: 1 0 100%; }
.chapter-opener__summary { display: inline-flex; align-items: center; min-height: var(--tap); cursor: pointer; color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; }
.chapter-opener__form { display: grid; gap: var(--space-4); padding: var(--space-2) 0 var(--space-4); }
.chapter-opener__form .btn { justify-self: start; }
.chapter-opener__covers { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; margin: 0; padding: 0; border: 0; min-width: 0; }
.chapter-opener__covers legend { padding: 0; margin-bottom: var(--space-2); }
.chapter-opener__covers .field__hint { flex: 1 0 100%; }
.cover-choice { position: relative; display: inline-flex; min-width: var(--tap); min-height: var(--tap); cursor: pointer; }
.cover-choice__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cover-choice__thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-tile); outline: 2px solid transparent; outline-offset: 2px; }
.cover-choice__input:checked + .cover-choice__thumb { outline-color: var(--accent); }
.cover-choice__input:focus-visible + .cover-choice__thumb { box-shadow: var(--focus); }
.cover-choice__auto { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius-pill); }
.cover-choice__input:checked + .cover-choice__auto { background: var(--accent-soft); font-weight: 600; }
.cover-choice__input:focus-visible + .cover-choice__auto { box-shadow: var(--focus); }
.story--catalogue { --gutter: var(--space-5); padding-bottom: 0; }

/* ---- Slice 9: community intake (upload links, QR card, contributor) ---- */
.contributor { max-width: 40rem; }
.contributor__consent { max-width: 28rem; }
.contributor__as, .contributor__sent { color: var(--ink-muted); font-size: var(--text-sm); }
.contributor__sent { font-weight: 500; color: var(--ink); }
.qr { width: 100%; height: auto; border-radius: var(--radius); }
.table-card { display: grid; justify-items: center; gap: var(--space-3); width: min(100%, 24rem); margin: 0 auto;
  padding: var(--space-6) var(--space-5); text-align: center; background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-float); }
.table-card__eyebrow { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.table-card__title { font: 500 1.75rem/1.15 var(--font-display); }
.table-card__qr { width: min(100%, 16rem); }
.table-card__help { color: var(--ink-muted); font-size: var(--text-sm); }
@media print {
  /* Paper is white whatever the theme: only the table card prints, large, in black on white. */
  .no-print, .skip-link, .toast-region { display: none !important; }
  body { background: white; color: black; }
  .page { padding: 0; max-width: none; }
  .table-card { width: 100%; border: 0; box-shadow: none; background: white; color: black; padding: 2cm 0; gap: 0.8cm; }
  .table-card__eyebrow, .table-card__help { color: black; }
  .table-card__title { font-size: 2.4rem; }
  .table-card__qr { width: 12cm; }
}

/* ---- Slice 9: review queue ---- */
.btn > .view-tabs__count { margin-left: var(--space-2); }
.review { display: grid; gap: var(--space-5); }
.review__form { display: grid; gap: var(--space-5); }
.review__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.review-tile { position: relative; display: grid; gap: var(--space-1); min-width: 0; border-radius: var(--radius-tile); }
.review-tile__label { position: relative; display: block; cursor: pointer; border-radius: var(--radius-tile); overflow: hidden;
  background: var(--surface-sunken); }
.review-tile__photo { display: block; width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; transition: opacity var(--dur-1) var(--ease); }
.review-tile__check { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.review-tile__tick { position: absolute; top: var(--space-2); left: var(--space-2); display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--scrim); color: var(--accent-ink);
  border: 2px solid var(--surface-raised); }
.review-tile__tick .icon { width: 16px; height: 16px; opacity: 0; }
.review-tile:has(.review-tile__check:checked) .review-tile__photo { opacity: 0.8; }
.review-tile__check:checked ~ .review-tile__tick { background: var(--accent); }
.review-tile__check:checked ~ .review-tile__tick .icon { opacity: 1; }
.review-tile__check:focus-visible ~ .review-tile__tick { box-shadow: var(--focus); }
.review-tile:has(.review-tile__check:checked) .review-tile__label { outline: 3px solid var(--accent); outline-offset: -3px; }
.review-tile.is-current .review-tile__label { outline: 3px solid var(--accent); outline-offset: 2px; }
.review-tile.is-skipped .review-tile__photo { opacity: 0.45; }
.review-tile__caption { font-size: var(--text-xs); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decision-bar { position: sticky; bottom: max(var(--space-3), env(safe-area-inset-bottom)); z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface-raised); box-shadow: var(--shadow-float); }
.decision-bar__count { font-weight: 600; font-variant-numeric: tabular-nums; }
.review__status { margin: 0 0 var(--space-3); color: var(--ink); font-size: var(--text-sm); }
.review__status:empty { display: none; }
.decision-bar__actions { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.decision-bar__key { margin-left: var(--space-2); padding: 0 var(--space-1); border: 1px solid currentColor; border-radius: var(--radius-tile);
  font: 600 var(--text-xs)/1.4 var(--font-ui); opacity: 0.75; }
.confirm--bar { position: relative; }
.confirm--bar .confirm__body { position: absolute; right: 0; bottom: calc(100% + var(--space-2)); z-index: 7; width: min(20rem, 80vw);
  padding: var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-raised); box-shadow: var(--shadow-float); }
/* In a row of actions (handover choices): the opened body floats below the summary, so the row does
   not reflow when it opens. */
.confirm--pop { position: relative; }
.confirm--pop .confirm__body { position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 7; width: min(20rem, 80vw); margin: 0;
  padding: var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-raised); box-shadow: var(--shadow-float); }
.confirm[data-empty] > .confirm__summary { opacity: 0.55; pointer-events: none; cursor: not-allowed; }
/* On a phone the row is too narrow to float a box beside Keep: the open confirmation takes its own line in the row. */
@media (max-width: 40rem) {
  /* The bar's confirmation spans the bar (its containing block) instead of hanging off a summary that may sit near
     the right edge of a wrapped row, where it would reach past the screen. */
  .confirm--bar { position: static; }
  .confirm--bar .confirm__body { left: var(--space-3); right: var(--space-3); width: auto; }
  .confirm--pop[open] { flex-basis: 100%; }
  .confirm--pop .confirm__body { position: static; width: auto; margin-top: var(--space-2); }
}
/* Key hints only where there is a keyboard to press them on. */
@media (pointer: coarse) { .hint-fine, .decision-bar__key { display: none; } }
/* The bar appears once something is chosen: no grey, unusable block at zero. */
.review__form:not(:has([data-review-item]:checked)) .decision-bar { display: none; }
.review__counter { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-muted); text-align: center; }
.review-tile__play-link { justify-self: start; font-size: var(--text-sm); min-height: var(--tap); display: inline-flex; align-items: center; }
.review-tile.is-playing .tile__play, .review-tile.is-playing .tile__duration, .review-tile.is-playing .review-tile__play-link { display: none; }
.lede__card { display: none; }
.review-tile__player { display: block; width: 100%; height: auto; max-height: 70svh; background: var(--stage); }
.review-tile.is-playing .review-tile__label { min-height: var(--tap); background: var(--surface-sunken); }
.review-tile.is-playing .review-tile__label > .review-tile__photo { display: none; }
[data-review-card] .review-tile.is-playing .review-tile__label { display: none; }
[data-review-loading] [data-review-card-actions] button[name=decision] { opacity: 0.55; cursor: progress; }
[data-review-loading] .review-tile.is-current .review-tile__label { min-height: 40svh; }
.review-card-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--space-2);
  position: sticky; bottom: 0; z-index: 6; padding: var(--space-3) 0 max(var(--space-3), env(safe-area-inset-bottom)); background: var(--surface); }
.review-card-actions[hidden] { display: none; }
.review-card-actions .btn { width: 100%; padding-inline: var(--space-2); }
@media (max-width: 40rem) {
  .review__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-bar__actions { width: 100%; }
  /* Card mode (js/review.js sets data-review-card on the Pending queue): one photo at a time, whole. */
  [data-review-card] .review__grid { grid-template-columns: minmax(0, 1fr); }
  [data-review-card] .review-tile:not(.is-current) { display: none; }
  [data-review-card] .review-tile__select { display: none; }
  [data-review-card] .review-tile__label { cursor: default; background: var(--surface-sunken); display: grid; place-items: center; }
  [data-review-card] .review-tile__photo { aspect-ratio: auto; width: auto; max-width: 100%; height: auto; max-height: 55svh; object-fit: contain; }
  [data-review-card] .review-tile.is-current .review-tile__label { outline: 0; }
  [data-review-card] .review-tile__play-link { min-height: var(--tap); }
  [data-review-card] .review-tile__label:has(+ .review-tile__play-link) { cursor: pointer; }
  /* On a card the long note gives way to the photo, but one short line still says what Not now does. */
  .page--review:has([data-review-card]) .event-head .lede__long { display: none; }
  .page--review:has([data-review-card]) .event-head .lede__card { display: inline; }
  [data-review-card] .decision-bar { display: none; }
}
.catalogue .decision-bar { position: static; }

/* ---- Slice 10: video ---- */
/* A video is a photo tile showing its poster, with a play badge and its length. The badge never takes
   a click (the link under it opens the viewer). */
.tile__play { --play: clamp(32px, 9vw, 44px); position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; color: var(--stage-ink); }
.tile__play .icon { width: var(--play); height: var(--play); padding: calc(var(--play) / 4); box-sizing: border-box; border-radius: var(--radius-pill); background: var(--scrim); fill: currentColor; stroke: none; }
.tile__duration { position: absolute; right: var(--space-2); bottom: var(--space-2); z-index: 1; padding: 1px var(--space-2); border-radius: var(--radius-pill);
  background: var(--scrim); color: var(--stage-ink); font-size: var(--text-xs); line-height: 1.5; font-variant-numeric: tabular-nums; pointer-events: none; }
.story-figure__link .tile__play { --play: clamp(44px, 14vw, 64px); }
/* The player in the lightbox and on the item page fits the stage like a photo does. */
.lightbox__image[hidden] { display: none; }
dialog.lightbox:focus { outline: none; }
.lightbox__video { width: 100%; height: 100%; object-fit: contain; background: var(--stage); }
/* A reviewer's player keeps its own controls; only the top-left corner selects the tile. */
.review-tile__video { display: block; background: var(--stage); object-fit: cover; }
.review-tile__label:has(.review-tile__video) { cursor: default; }
.review-tile__label .tile__duration { top: var(--space-2); right: var(--space-2); bottom: auto; }

/* ---------- Albums and the handover (slice 11; patterns "Digital albums") ---------- */
.page--narrow { max-width: 44rem; }
.albums { display: grid; gap: var(--space-3); }
.albums__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.albums__title { font: 500 1.75rem/1.2 var(--font-display); }
.albums__empty { color: var(--ink-muted); }
/* A row to swipe on a phone, a grid from tablet width up. */
.album-list { list-style: none; margin: 0; padding: 0 0 var(--space-2); display: flex; gap: var(--space-3);
  overflow-x: auto; scroll-snap-type: x proximity; }
.album-list > li { flex: 0 0 min(14rem, 62vw); scroll-snap-align: start; min-width: 0; }
@media (min-width: 768px) {
  .album-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); overflow: visible; }
  .album-list > li { flex: initial; }
}
.album-card { display: grid; gap: var(--space-2); text-decoration: none; color: inherit; min-width: 0; }
.album-card__cover { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; color: var(--ink-muted);
  background: var(--surface-sunken); border: 1px solid var(--hairline); border-radius: var(--radius-tile);
  transition: border-color var(--dur-2) var(--ease); }
.album-card:hover .album-card__cover { border-color: var(--ink-muted); }
.album-card__img { width: 100%; height: 100%; object-fit: cover; }
.album-card__title { font: 500 1.25rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.album-card__count { color: var(--ink-muted); font-size: var(--text-sm); }

/* The chooser behind "Add to album". */
.album-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); max-width: 36rem; }
.album-choice__form { display: flex; align-items: center; gap: var(--space-3); margin: 0; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--hairline); border-radius: var(--radius); }
.album-choice__cover { flex: none; width: 3rem; height: 3rem; display: grid; place-items: center; overflow: hidden;
  background: var(--surface-sunken); border-radius: var(--radius-tile); color: var(--ink-muted); }
.album-choice__cover img { width: 100%; height: 100%; object-fit: cover; }
.album-choice__text { flex: 1; min-width: 0; display: grid; }
.album-choice__title { font-weight: 500; overflow-wrap: anywhere; }
.album-choice__count { color: var(--ink-muted); font-size: var(--text-sm); }

/* The builder's numbered strip: two columns on a phone at the photos' own ratio, the first tile (the cover
   until another is chosen) across both; a grid from tablet width up. */
.album-cover-note, .album-cover-hint { color: var(--ink-muted); margin: 0; }
.album-cover-reset { margin: 0; }
.album-strip { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.album-strip__item { min-width: 0; padding: var(--space-2); background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: var(--radius); }
.album-strip__item:first-child { grid-column: 1 / -1; }
.album-strip__item.is-dragging { opacity: 0.45; }
.album-strip__item.is-drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.album-strip__form { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); align-items: start; }
.album-strip__thumb { position: relative; display: block; width: 100%; overflow: hidden;
  background: var(--surface-sunken); border-radius: var(--radius-tile); }
.album-strip__thumb img { display: block; width: 100%; height: auto; }
.album-strip__number { position: absolute; top: 4px; left: 4px; min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface);
  font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.album-strip__badge { position: absolute; bottom: 4px; left: 4px; padding: 0 var(--space-2); border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-ink); font-size: var(--text-xs); font-weight: 600; }
.album-strip__tools { display: flex; flex-wrap: wrap; gap: var(--space-2); min-width: 0; }
.album-strip__tools .btn { min-height: var(--tap); }
@media (min-width: 640px) {
  .album-strip { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
  .album-strip__item:first-child { grid-column: auto; }
  .album-strip__item { padding: var(--space-3); }
  .album-strip__thumb { aspect-ratio: 1; }
  .album-strip__thumb img { height: 100%; object-fit: cover; }
  .album-strip__item[draggable="true"] { cursor: grab; }
}

/* The handover. */
.deliver-list { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-3); max-width: 40rem; }
.deliver-form { max-width: 40rem; }
.delivered-note { max-width: 40rem; display: grid; gap: var(--space-4); }
.delivered-note p { margin: 0; }
.delivery-ask { display: grid; gap: var(--space-2); justify-items: start; max-width: 40rem; margin: 0 0 var(--space-4); }
.delivery-ask p { margin: 0; }
.toast button.toast__action { background: transparent; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: var(--text-sm); min-height: 36px; }
@media (min-width: 640px) {
  .album-strip__tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-strip__tools .btn { justify-content: center; padding: 0 var(--space-2); }
}

/* ---- UI-2: guest entry pages (brand bar, centred card, dead-link state) ---- */
.page--guest main { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.guest-stage { display: grid; place-items: center; padding: var(--space-5); }
.state--neutral .state__icon { color: var(--ink-muted); background: var(--surface-sunken); }
.share-passcode .eyebrow { margin-bottom: calc(var(--space-2) * -1); }

/* A button inside a field's right edge: show/hide for a password, copy for a value. Hidden until JS runs. */
.field__control { position: relative; }
.field__input--trailing { width: 100%; padding-right: 7.5rem; }
.field__control:has(.field__trailing--icon) .field__input--trailing { padding-right: 3.5rem; }
.field__trailing { position: absolute; inset-block: 0; right: 0; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-width: var(--tap); padding: 0 var(--space-4); border: 0; background: transparent; color: var(--ink-muted); font-size: var(--text-sm); font-weight: 500;
  border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.field__trailing:hover { color: var(--ink); background: var(--surface-sunken); }
.field__trailing:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.field__trailing--icon { padding: 0; }
.field__eye { display: inline-flex; }
.field__eye--off, .field__trailing[aria-pressed="true"] .field__eye--on { display: none; }
.field__trailing[aria-pressed="true"] .field__eye--off { display: inline-flex; }

/* What a share link does, on the show-once screen. */
.facts { display: grid; gap: var(--space-3); margin: 0; padding: var(--space-4); max-width: 36rem; border: 1px solid var(--hairline);
  border-radius: var(--radius); background: var(--surface-raised); }
.facts__row { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--space-3); }
.facts dt { color: var(--ink-muted); font-size: var(--text-sm); padding-top: 0.1em; }
.facts dd { margin: 0; }
.facts__list { margin: 0; padding-left: 1.1em; display: grid; gap: var(--space-1); }
@media (max-width: 480px) { .facts__row { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ---- UI-2: the guest's uploader (flows.html contributor_uploader) ---- */
.contributor__head { gap: var(--space-3); }
.contributor__pill { margin: 0; }
.contributor__limits { color: var(--ink-muted); font-size: var(--text-sm); }
.uploader--contributor .uploader__drop { padding: var(--space-6) var(--space-5); }
.uploader--contributor .uploader__pick { width: 100%; max-width: 28rem; }
.uploader--contributor .uploader__choose { width: 100%; }
/* A touch screen cannot drag a file in: no drag copy, no dashed box, only the button. */
@media (pointer: coarse) {
  .uploader--contributor [data-uploader-drag-copy] { display: none; }
  .uploader--contributor .uploader__drop { border: 0; padding: 0; justify-items: stretch; }
  .uploader--contributor .uploader__pick { max-width: none; }
}
.uploader--contributor .uploader__main { display: grid; gap: var(--space-4); }
.uploader--contributor .uploader__summary { display: grid; justify-content: stretch; gap: var(--space-2); }
.uploader--contributor .uploader__summary .btn { justify-self: start; }
.uploader__total { width: 100%; height: 4px; accent-color: var(--accent); }
.uploader__list--thumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); max-height: none; overflow: visible; }

.uploader--contributor .upload-row { position: relative; display: block; width: 56px; height: 56px; padding: 0; overflow: hidden;
  border-radius: var(--radius); background: var(--surface-sunken); }
.upload-thumb { position: absolute; inset: 0; display: block; }
.upload-thumb__canvas { display: block; width: 100%; height: 100%; }
.upload-thumb__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-muted); }
.upload-thumb__video { display: none; }
.upload-row[data-kind="video"] .upload-thumb__video { display: inline-flex; }
.upload-row[data-kind="video"] .upload-thumb__photo { display: none; }
.upload-row[data-thumb="drawn"] .upload-thumb__fallback { display: none; }
.upload-thumb__bar { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 3px; accent-color: var(--accent); }
.uploader--contributor .upload-thumb__name, .uploader--contributor .upload-thumb__state {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.uploader--contributor [data-state="done"] .upload-thumb__bar { display: none; }
.uploader--contributor [data-state="done"]::after { content: "\2713"; position: absolute; right: 3px; bottom: 3px; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--success); color: var(--surface); font-size: 12px; line-height: 1; }
.uploader--contributor [data-state="queued"] .upload-thumb, .uploader--contributor [data-state="checking"] .upload-thumb { opacity: 0.6; }
/* A file that did not go: a full row with its name and what happened, never just a tile. */
.uploader--contributor [data-state="failed"], .uploader--contributor [data-state="rejected"] {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: var(--space-3); align-items: center; width: 100%; height: auto;
  min-height: 56px; padding: var(--space-2); overflow: visible; background: var(--danger-soft); }
.uploader--contributor [data-state="failed"] .upload-thumb, .uploader--contributor [data-state="rejected"] .upload-thumb {
  position: relative; inset: auto; grid-row: 1 / span 2; width: 48px; height: 48px; overflow: hidden; border-radius: var(--radius); }
.uploader--contributor [data-state="failed"] .upload-thumb__name, .uploader--contributor [data-state="rejected"] .upload-thumb__name,
.uploader--contributor [data-state="failed"] .upload-thumb__state, .uploader--contributor [data-state="rejected"] .upload-thumb__state {
  position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; overflow-wrap: anywhere; }
.uploader--contributor [data-state="failed"] .upload-thumb__name, .uploader--contributor [data-state="rejected"] .upload-thumb__name { font-weight: 500; }
.uploader--contributor [data-state="failed"] .upload-thumb__state, .uploader--contributor [data-state="rejected"] .upload-thumb__state { font-size: var(--text-sm); }
.uploader--contributor [data-state="failed"] .upload-thumb__bar, .uploader--contributor [data-state="rejected"] .upload-thumb__bar { display: none; }

.uploader__thanks { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-7) var(--space-5); text-align: center;
  border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-raised); }
.uploader__thanks-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.uploader__thanks-title { font: 500 var(--display-sm)/1.15 var(--font-display); }
.uploader__thanks-title:focus, .uploader__thanks-title:focus-visible { outline: none; box-shadow: none; }
.uploader__thanks-text { color: var(--ink-muted); }
.uploader__thanks-skipped { text-align: left; font-size: var(--text-sm); color: var(--ink-muted); max-width: 100%; }
.uploader__thanks-skipped-title { font-weight: 500; color: var(--ink); }
.uploader__thanks-skipped-list { margin: 0; padding-left: 1.1em; overflow-wrap: anywhere; }
.uploader__thanks-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
.uploader__thanks-actions form { margin: 0; }
/* The thank-you panel already says how many; the separate count line below it would say it twice. */
.uploader--contributor:has([data-uploader-thanks]:not([hidden])) + .contributor__sent { display: none; }

/* UI-3 A — event shell: app bar, cover, menu drawer, "Yours now" card, link cards, grouped grid, Deliver.
   Appended after the rest, so at equal specificity these rules win. Tokens only. */

/* App bar: the name is shortened on phones instead of hidden (it says who is signed in). */
.app-bar__who { min-width: 0; }
@media (max-width: 480px) {
  .app-bar { padding-inline: var(--space-4); gap: var(--space-2); }
  .app-bar__name { display: inline-block; max-width: 7ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-bar__account { gap: var(--space-2); min-width: 0; }
}

/* Gallery page: the photos come first, so the page is tighter than a form page on phones. */
@media (max-width: 767px) {
  .page--gallery { padding-block-start: var(--space-3); gap: var(--space-3); }
}

/* Cover */
.event-cover { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-sunken);
  height: min(24vh, 180px); }
.event-cover__img, .event-cover__placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) { .event-cover { height: min(40vh, 400px); } }

/* Header actions row */
.event-head__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-block-start: var(--space-2); }
.event-head__preview { gap: var(--space-2); }
/* Menu drawer: one icon button opens a panel from the right edge at every width (the views, Manage, delivery). */
.menu-drawer { position: relative; }
.menu-drawer__summary { position: relative; list-style: none; }
.menu-drawer__summary::-webkit-details-marker { display: none; }
.menu-drawer__dot { position: absolute; inset-block-start: 9px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
/* The scrim is the open summary's pseudo-element, so a tap outside the drawer closes it even without JavaScript. */
.menu-drawer[open] > .menu-drawer__summary::before { content: ""; position: fixed; inset: 0; z-index: 39; background: var(--scrim); }
.menu-drawer__panel { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 40; display: grid; align-content: start; gap: var(--space-4);
  width: min(22rem, 88vw); height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--space-4) + env(safe-area-inset-top)) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  padding-inline-end: calc(var(--space-5) + env(safe-area-inset-right));
  background: var(--surface-raised); box-shadow: var(--shadow-float); }
@keyframes menu-drawer-in { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: no-preference) {
  .menu-drawer[open] > .menu-drawer__panel { animation: menu-drawer-in var(--dur-3) var(--ease); }
  .menu-drawer[open] > .menu-drawer__panel:dir(rtl) { animation-name: menu-drawer-in-rtl; }
  @keyframes menu-drawer-in-rtl { from { transform: translateX(-100%); } }
}
.menu-drawer__panel:dir(rtl) { padding-inline-end: calc(var(--space-5) + env(safe-area-inset-left)); }
.menu-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap); }
.menu-drawer__head [data-drawer-close] { flex: none; margin-inline-end: calc(var(--space-2) * -1); }
.menu-drawer__title { margin: 0; font: 500 1.5rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.menu-drawer__heading { margin: 0; color: var(--ink-muted); font-size: var(--text-sm); font-weight: 500; }
.menu-drawer__views, .menu-drawer__links { list-style: none; margin: 0; padding: 0; display: grid; }
.menu-drawer__view, .menu-drawer__link { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap);
  padding-inline: var(--space-3); border-bottom: 1px solid var(--hairline); text-decoration: none; }
.menu-drawer__view:hover, .menu-drawer__link:hover { background: var(--surface-sunken); }
.menu-drawer__view[aria-current] { font-weight: 600; color: var(--ink); background: var(--accent-soft); border-radius: var(--radius); }
.menu-drawer__delivery { display: grid; gap: var(--space-2); padding-block-start: var(--space-3); border-block-start: 1px solid var(--hairline); }
.menu-drawer__delivery form { display: grid; gap: var(--space-2); justify-items: start; margin: 0; }
.menu-drawer__note { margin: 0; color: var(--ink-muted); font-size: var(--text-sm); }
.menu-drawer__asked { margin: 0; font-weight: 500; }
body.is-drawer-open { overflow: hidden; }

/* "Yours now" */
.moment { display: grid; gap: var(--space-3); max-width: 40rem; padding: var(--space-5); border: 1px solid var(--hairline);
  border-radius: var(--radius); background: var(--accent-soft); }
.moment__title { font: 500 var(--display-sm)/1.15 var(--font-display); }
.moment__body { color: var(--ink-muted); }
.moment__next { display: grid; gap: var(--space-1); }
.moment__line { margin: 0; }
.moment__line a { display: inline-block; padding-block: var(--space-3); }
/* Compact: a title and one running line with its link, so the photos stay in the first phone screen. The eyebrow
   stays for screen readers; the title and the line already say it. */
.moment--compact { display: block; position: relative; padding: var(--space-2) var(--space-4); line-height: 1.35; }
.moment--compact .moment__title { font: 600 var(--text-md)/1.3 var(--font-ui); margin: 0; }
.moment--compact .moment__body, .moment--compact .moment__next, .moment--compact .moment__line { display: inline; margin: 0; font-size: var(--text-sm); line-height: 1.35; }
.moment--compact .moment__line a { display: inline; padding: 0; margin-left: var(--space-1); }
.moment--compact [data-handover-summary] { display: block; }
.moment--compact [data-handover-summary] a { margin-left: 0; }

/* Handover links as cards */
.link-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); max-width: 40rem; }
.link-card { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface-raised); }
.link-card__main { display: grid; gap: var(--space-1); min-width: 0; }
.link-card__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: 500; }
.link-card__detail { color: var(--ink-muted); font-size: var(--text-sm); }
.link-card__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }
.link-card__actions form { margin: 0; }
.link-card .confirm[open] { flex-basis: 100%; }
.link-card .confirm__body { max-width: none; }

/* The photographer's grid, grouped by chapter */
.grid-group { display: grid; gap: var(--space-3); }
.grid-group + .grid-group { margin-block-start: var(--space-4); }
.grid-group__title { font: 500 1.5rem/1.2 var(--font-display); }
.grid-group__count { margin-inline-start: var(--space-2); font: 400 var(--text-sm)/1.4 var(--font-ui); color: var(--ink-muted); }

/* Deliver: who receives it */
.deliver-couple { display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-5); border: 1px solid var(--hairline);
  border-radius: var(--radius); background: var(--surface-raised); }
.deliver-couple__names { font: 500 var(--display-sm)/1.15 var(--font-display); }
.deliver-couple__event { color: var(--ink-muted); }
/* UI-3 B: albums page, album hero and inline title, the per-photo menu, story opener and close, People,
   and the one-row selection bar. Appended last, so these win at equal specificity. */

/* The selection bar: one row, fixed to the bottom of the screen. The form pads its end by the bar's height
   while selecting, so the last tile can always be scrolled clear of it. */
:root { --selection-bar-h: calc(var(--tap) + 2 * var(--space-2) + 2px + 2 * var(--space-3)); }
form.selection.is-selecting { padding-block-end: calc(var(--selection-bar-h) + env(safe-area-inset-bottom)); }
.selection-bar { position: fixed; inset-inline: var(--space-3); bottom: max(var(--space-3), env(safe-area-inset-bottom));
  max-width: 40rem; margin-inline: auto; z-index: 6;
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: var(--space-1);
  padding: var(--space-2); }
.selection-bar > * { min-width: 0; }
.selection-bar .icon-btn { flex: none; border-radius: var(--radius-pill); }
.selection-bar .icon-btn:disabled { opacity: 0.4; }
.selection-bar__count { flex: 1 1 0; margin: 0; text-align: center; font-size: var(--text-sm); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.selection-bar__download { flex: none; white-space: nowrap; padding-inline: var(--space-4); }
.selection-bar__download .icon { display: none; }
.selection-bar__message { position: absolute; inset-inline: 0; bottom: calc(100% + var(--space-2)); margin: 0; order: 0;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface-raised); box-shadow: var(--shadow-float); }
@media (min-width: 640px) {
  .selection-bar { gap: var(--space-2); padding-inline: var(--space-3); }
  .selection-bar__download .icon { display: inline-block; }
}

/* The Albums page: a grid on every width (a swipe row is for the strip on the gallery, not a page of its own). */
.page--albums .album-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  overflow: visible; gap: var(--space-4); }
.page--albums .album-list > li { flex: initial; }
.album-card__shared { color: var(--ink-muted); font-size: var(--text-sm); }

/* The finished album: the cover wide above the name, and whose it is. */
.album-hero { display: grid; gap: var(--space-4); }
.album-hero__cover { overflow: hidden; border-radius: var(--radius); background: var(--surface-sunken); }
.album-hero__img { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: min(32svh, 15rem); object-fit: cover; }
.album-hero__text { display: grid; gap: var(--space-2); justify-items: start; }
.album-hero__meta { margin: 0; color: var(--ink-muted); font-weight: 500; }
.album-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; }
@media (min-width: 768px) {
  .album-hero__img { max-height: min(40svh, 24rem); aspect-ratio: 21 / 9; }
}

/* The builder's title, edited where it is shown. */
.page--album-edit .event-head, .album-hero { grid-template-columns: minmax(0, 1fr); }
.album-title { display: flex; align-items: center; gap: var(--space-3); margin: 0; max-width: 40rem; }
.album-title__input { flex: 1 1 auto; min-width: 0; min-height: var(--tap); padding: 0 var(--space-2); border: 0;
  border-bottom: 1px dashed var(--hairline); border-radius: 0; background: transparent; color: var(--ink);
  font: 500 1.75rem/1.2 var(--font-display); text-overflow: ellipsis; }
.album-title__input:hover { border-bottom-color: var(--ink-muted); }
.album-title__input:focus-visible { outline: none; border-bottom-style: solid; border-bottom-color: var(--accent); box-shadow: var(--focus); }
@media (min-width: 768px) { .album-title__input { font-size: 2.25rem; } }

/* The photo's "..." menu: Earlier, Later, Make cover, Remove. A native <details>; its body floats over the
   cards below it. */
.album-strip__form { position: relative; }
.item-menu { position: relative; justify-self: end; align-self: start; }
.item-menu[open] { z-index: 8; }
.item-menu__summary { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); list-style: none;
  cursor: pointer; border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink); }
.item-menu__summary::-webkit-details-marker { display: none; }
.item-menu__summary:hover { background: var(--surface-sunken); }
.item-menu__summary:focus-visible { box-shadow: var(--focus); }
.item-menu[open] > .item-menu__summary { background: var(--accent-soft); }
.item-menu__body { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 8; display: grid;
  min-width: 13rem; max-width: min(20rem, calc(100vw - 2 * var(--space-4))); padding: var(--space-1);
  border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-raised); box-shadow: var(--shadow-float); }
.item-menu__item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--tap);
  padding: 0 var(--space-3); border: 0; border-radius: var(--radius); background: transparent; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; }
.item-menu__item:hover:not(:disabled) { background: var(--surface-sunken); }
.item-menu__item:focus-visible { box-shadow: var(--focus); }
.item-menu__item:disabled { color: var(--ink-muted); cursor: default; }
.item-menu .confirm { padding-inline: var(--space-3); }
.item-menu .confirm__body { max-width: none; padding-bottom: var(--space-3); }
@media (min-width: 640px) {
  .item-menu { position: absolute; top: var(--space-2); right: var(--space-2); }
}

/* The story opens with the event, numbers its chapters and ends with a closing block. */
.story-event { display: grid; row-gap: var(--space-6); }
.story-opener__eyebrow { margin: 0; color: var(--ink-muted); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; }
.story-opener--implicit { display: block; }
.story-close { width: min(100% - 2 * var(--gutter), 44rem); margin: var(--space-8) auto var(--space-7); display: grid;
  gap: var(--space-4); justify-items: center; text-align: center; }
.story-close__title { margin: 0; font: 500 1.75rem/1.2 var(--font-display); text-wrap: balance; }
.story-close__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin: 0; }

/* People: the line on active links. */
.people-links { margin: var(--space-4) 0; color: var(--ink-muted); }

/* The view switch is inline from 768px; below that the menu drawer lists the views. */
.view-switch { max-width: 100%; }
.view-switch__link { white-space: nowrap; min-width: 0; }
@media (max-width: 767px) {
  /* A slim band (UI-7): under the shell the first tile has to stay inside the first phone screen. */
  .event-cover { height: min(12vh, 96px); }
  /* The Yours-now card is the first thing a delivered couple reads; its cover waits, so the first tile stays in view. */
  .page:has([data-delivered-note]) .event-cover { display: none; }
}

/* ---------- Slice UI-5: open a photo large, tick separately, flash with Undo ---------- */
/* The photo is a link that opens the viewer; the tick is its own 44 px control at the corner. */
.review-tile__open { color: inherit; text-decoration: none; }
.review-tile__open:focus-visible { box-shadow: var(--focus); }
.review-tile__select { position: absolute; top: 0; left: 0; z-index: 2; width: var(--tap); height: var(--tap); cursor: pointer; }
.review-tile__select .review-tile__tick { top: var(--space-1); left: var(--space-1); pointer-events: none; }
.review-tile__error { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--ink); }
.review-flash { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-raised); }
.review-flash__message { margin: 0; font-size: var(--text-sm); }
.review-flash__undo { margin: 0; }
/* The viewer's decisions sit in a row under the photo, so the arrows stay at the sides. */
dialog.lightbox:has(.lightbox__actions)[open] { grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox:has(.lightbox__actions) .lightbox__nav { top: 50%; bottom: auto; transform: translateY(-50%); }
.lightbox:has(.lightbox__actions) .lightbox__stage { padding-bottom: var(--space-3); }
.lightbox__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); padding: var(--space-3) var(--space-3) max(var(--space-3), env(safe-area-inset-bottom)); }
.lightbox__actions .btn { min-height: var(--tap); }
.lightbox__actions .btn--secondary, .lightbox__actions .confirm__summary { color: var(--stage-ink); background: var(--stage-control); border-color: transparent; }
.lightbox__actions .btn--secondary:hover, .lightbox__actions .confirm__summary:hover { background: var(--stage-control-hover); }
.lightbox__actions .confirm__summary { padding-inline: var(--space-3); border-radius: var(--radius); }
.lightbox__actions .confirm__body { color: var(--ink); bottom: calc(100% + var(--space-2)); top: auto; left: 50%; right: auto; transform: translateX(-50%); }
.toast-region--viewer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tap) + var(--space-6) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .toast-region--viewer { left: 50%; transform: translateX(-50%); } }

/* ---------- Slice UI-6: edit everywhere, final-action copy, the failed review card ---------- */
/* A card whose photo failed to load shows a neutral block and the error line, never the broken-image icon or its alt text.
   The image stays in the layout (visibility, not display) so Try again can still reload it. */
.review-tile.is-broken .review-tile__photo { visibility: hidden; }
.review-tile.is-broken .review-tile__label { min-height: calc(var(--tap) * 3); background: var(--surface-sunken); }
.event-edit { display: grid; gap: var(--space-4); max-width: 40rem; margin-bottom: var(--space-5); }
.event-edit .album-title__input { font-size: 1.75rem; }
.share-row__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }
.confirm--rename > .confirm__summary { color: var(--ink); }
.confirm--rename > .confirm__summary:hover, .confirm--rename[open] > .confirm__summary { background: var(--surface-sunken); }
.album-undo { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-raised); max-width: 40rem; }
.album-undo__text { margin: 0; font-size: var(--text-sm); }

/* Recently deleted (slice 13a): guest photos are ticked and restored together; the Undo in a toast is a form. */
.deleted-form { display: grid; gap: var(--space-4); }
.deleted-photo { align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: var(--space-3); }
.deleted-photo__select { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); flex: none; cursor: pointer; }
.deleted-photo__check { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.deleted-photo__thumb { flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-tile); background: var(--surface-sunken); }
.deleted-photo .share-row__main { flex: 1; }
.deleted-bar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }
.deleted-purge { display: contents; }
.toast__form { display: contents; }

/* The couple's "Edit name" link on a guest's photo (slice UI-7): beside the caption, along the bottom of the viewer. */
.lightbox__captions { position: absolute; left: 0; right: 0; bottom: var(--space-2); display: flex; align-items: center; justify-content: center; gap: var(--space-3); pointer-events: none; }
.lightbox__captions .lightbox__caption { position: static; flex: 0 1 auto; }
.lightbox__name-edit { pointer-events: auto; color: var(--stage-ink); font-size: var(--text-sm); text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; padding-inline: var(--space-2); }
.lightbox__name-edit[hidden] { display: none; }
.name-photo { margin: 0 0 var(--space-4); }
.name-photo__img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
.name-form .invite-actions { margin-top: var(--space-4); }

/* The event shell's toolbar height, for anchors that scroll under it (the shell itself is in shell.css). */
:root { --toolbar-h: calc(var(--tap) + 2 * var(--space-1) + 1px); --strip-h: calc(var(--tap) + 2 * var(--space-2) + 1px); }
/* The chapter strip sticks under the toolbar, not on it; where the toolbar is not shown it goes back to the top. */
.event-frame .chapter-strip { top: var(--toolbar-h); }
.event-frame:has(.event-toolbar--tips-only .event-toolbar__tips[hidden]) .chapter-strip { top: 0; }
@media (max-width: 767px) { .event-frame:has(.selection.is-selecting) .chapter-strip { top: 0; } }
.event-frame .gallery-section { scroll-margin-top: calc(var(--toolbar-h) + var(--strip-h) + var(--space-3)); }

