/* ==========================================================================
   J.Show Studio — design system · candidate A
   "Maison — 暖调编辑风"  (warm editorial minimalism)

   Ivory paper, espresso ink, one bronze accent. Hairlines instead of boxes,
   a high-contrast serif wordmark, letter-spaced labels, numbered sections.

   --------------------------------------------------------------------------
   WEB FONT — the only external resource (Google Fonts, Cormorant Garamond):

     https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap

   The three pages carry the two preconnect tags in <head>

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

   and request the stylesheet from script without blocking the first paint
   (bootPage() in assets/js/lib/site.js → loadBrandFont() in lib/ui.js).
   A static page may link the stylesheet in <head> instead.

   Until the font has arrived, and whenever it cannot load, the wordmark uses
   a serif the device already has, scaled to Cormorant's proportions (Georgia,
   on Android Noto Serif — see @font-face "JShow Serif Fallback" below), then
   Times New Roman, serif. The masthead is sized to stay on one line in any of
   them. Chinese always uses the system sans stack in --font-body.

   --------------------------------------------------------------------------
   EXTRAS beyond the shared contract (everything else is contract-only)

   Extra tokens
     --color-line-strong     form-control borders (3:1 against the paper)
     --font-display-latin    the display stack without a generic family, so it
                             can be followed by --font-body (avatar initials)
     --gutter                page side padding (20px phones, 32px tablets+;
                             never less than the left / right safe-area inset
                             of a phone held sideways)
     --container-narrow      reading / form column (42rem)
     --ease                  shared easing curve
     --photo-ground          the plain ground behind a photo
     --photo-placeholder     that ground with a brow mark: shown behind /
                             instead of a photo
     --photo-ratio           frame shape in a 2-up / 3-up / strip (4 / 5)
     --photo-ratio-single    shape of a lone photo (1 / 1)

   Extra classes
     .container--narrow      narrow column for the form and the admin list
     .eyebrow                letter-spaced overline (same look as .hero__eyebrow,
                             without the flanking rules)
     .page-head              title block for the form / admin pages
       .page-head__title, .page-head__sub
     .field-row              two fields side by side from 600px up (each keeps
                             its own height)
     .kv                     <dl class="kv"><div><dt>…</dt><dd>…</dd></div>…</dl>
                             hairline key/value grid (admin review facts)
     .empty__icon            the icon slot of .empty (an inline SVG works too)
     .phrase                 <span class="phrase">…</span>: a clause that never
                             breaks in the middle (Chinese has no word spaces)
     .uploader.is-dragover   state hook while a file is dragged over
     .review__photo.is-whole state hook: the photo is shown whole (contain)
                             instead of filling its frame (cover); set by the
                             display page for photos the frame would cut by
                             more than a fifth
     .toast__close           the close button inside a notice that stays until
                             it is dismissed (built by toast() in ui.js)

   Element hooks (no class needed)
     .wordmark em            sets "Studio" in italic:  J.Show <em>Studio</em>
     .hero__sub > span,
     .empty__text > span     same as .phrase, without the class
     .banner strong          the small letter-spaced badge ("演示模式")

   Built-in behaviour worth knowing
     · .review__section-title and .form-section__title are numbered
       01 / 02 / 03 … automatically with CSS counters — do not type numbers.
     · A .review without .review__photos gets a serif quotation mark and keeps
       its own height in a row of taller photo cards, so a text-only card
       still looks intentional.
     · .review__entry keeps the customer's own line breaks (white-space:
       pre-line): write the text with no leading / trailing whitespace.
     · .btn--danger inside .admin-review__actions is drawn as quiet red text;
       everywhere else (e.g. the confirm dialog) it is a solid red button.
     · .btn--sm and .chip grow to the 44px tap size on touch screens (the
       chip's visible pill stays 36px; it is drawn on ::before).
     · Photo layout follows data-count on .review__photos: "1", "2", "3" are
       fitted; any other value (4, 5 … "4+") becomes a swipeable strip.
     · .review cards inside .review-list fade up once when they are inserted
       (disabled under prefers-reduced-motion).
     · .modal--wide rules off its title and actions, for long forms that scroll.
     · .form-actions is sticky at the bottom on phones, static from 768px up.
     · .hero__title is the big serif wordmark on its own; adding
       .wordmark.wordmark--lg to it changes nothing.
     · .filters__label may sit inside its .chip-group (as in the showcase) or
       directly in .filters before the group; both are laid out.
     · On iOS (and only there) an empty required date field shows the hint
       "请选择日期" and a calendar mark, because iOS Safari draws neither.
     · In a forced-colours (high-contrast) theme the chosen .segmented option
       and the active .chip use the system's selection colours.
     · No rule here needs an inline style: the site's Content-Security-Policy
       allows none (style-src 'self' plus the Google Fonts stylesheet).

   Fits the DOM that assets/js/lib/ui.js builds
     · svgIcon(): every svg[data-icon] is drawn with one even 1.5px line
       (non-scaling stroke); components size the icon (button, uploader,
       lightbox, remove buttons, empty state …).
     · setBusy(): .btn.is-loading shows a spinner before the label and keeps
       the button's own colours even though it is also [disabled].
     · mountDemoBanner(): <strong> becomes the badge, a[aria-current="page"]
       is the highlighted current page.
     · openModal() / openLightbox(): fade + slide transitions on .is-open; the
       focused dialog / viewer root shows no outline, its controls do.
       The viewer's arrows sit in the bottom band beside the counter on
       phones and beside the picture from 768px up.
     · toast(): the region and the notices are click-through (a notice never
       takes a tap meant for the control under it); only .toast__close takes
       the pointer. While an overlay is open ui.js sets data-over="modal" |
       "lightbox" on .toast-region and the notices move to the top edge.
   ========================================================================== */


/* ==========================================================================
   01 · Tokens
   ========================================================================== */

:root {
  color-scheme: light;

  /* Colour — warm paper, espresso ink, bronze */
  --color-bg: #F6F1E8;              /* ivory paper */
  --color-surface: #FDFBF7;         /* card stock, one step lighter */
  --color-surface-alt: #EFE8DC;     /* insets, placeholders, quiet fills */
  --color-ink: #2A2019;             /* espresso — 14:1 on paper */
  --color-ink-soft: #5C4F45;        /* secondary text — 7:1 */
  --color-ink-faint: #716559;       /* meta, hints — 5:1 */
  --color-line: #DCD2C3;            /* hairlines */
  --color-line-strong: #948674;     /* control borders — 3:1 */
  --color-accent: #9B6836;          /* bronze */
  --color-accent-strong: #744A22;   /* bronze for text — 6.8:1 */
  --color-accent-soft: #F0E4D3;     /* bronze tint */
  --color-on-accent: #FFFDF9;
  --color-success: #4A6741;
  --color-success-soft: #E3EADB;
  --color-warning: #8A5D0F;
  --color-warning-soft: #F4E7C6;
  --color-danger: #A03B2B;
  --color-danger-soft: #F5DFD8;
  --color-overlay: rgba(33, 25, 19, 0.58);

  /* Type */
  --font-display-latin: "Cormorant Garamond", "JShow Serif Fallback", Georgia, "Times New Roman";
  --font-display: var(--font-display-latin), serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;

  /* Shape */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* Elevation — deliberately quiet */
  --shadow-sm: 0 1px 2px rgba(42, 32, 25, 0.04);
  --shadow-md: 0 1px 2px rgba(42, 32, 25, 0.05), 0 10px 28px -14px rgba(42, 32, 25, 0.22);
  --shadow-lg: 0 2px 6px rgba(42, 32, 25, 0.06), 0 28px 64px -24px rgba(42, 32, 25, 0.42);

  /* Space */
  --space-1: 0.25rem;   /*  4px */
  --space-2: 0.5rem;    /*  8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.5rem;    /* 24px */
  --space-6: 2rem;      /* 32px */
  --space-7: 3rem;      /* 48px */
  --space-8: 4rem;      /* 64px */

  /* Layout */
  --container: 72rem;
  --container-narrow: 42rem;
  /* never narrower than the notch / Dynamic Island of a phone held sideways
     (the pages use viewport-fit=cover); both sides get the larger inset */
  --gutter: max(1.25rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --tap: 44px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --photo-ratio: 4 / 5;             /* a frame in a 2-up, 3-up or strip */
  --photo-ratio-single: 1 / 1;      /* a lone photo, already full width */
  --photo-ground: linear-gradient(160deg, #F1E9DC 0%, #E6DAC8 100%);
  --photo-placeholder:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 28'%3E%3Cpath d='M5 21C17 7 40 3 59 13' fill='none' stroke='%23B9A283' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E")
      center / 3.25rem auto no-repeat,
    var(--photo-ground);
}

@media (min-width: 48em) {
  :root { --gutter: max(2rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
}

/* A serif the device already has, scaled to Cormorant's proportions, so nothing
   jumps or overflows while the web font is loading or when it is blocked:
   Georgia (Windows, macOS, iOS), else Noto Serif (Android has no Georgia).
   Browsers without size-adjust (Safari before 17) show the fallback unscaled;
   the masthead size below is chosen so that it still fits on one line. */
@font-face {
  font-family: "JShow Serif Fallback";
  src: local("Georgia"), local("Noto Serif"), local("NotoSerif");
  font-style: normal;
  font-weight: 100 900;
  size-adjust: 82%;
}
@font-face {
  font-family: "JShow Serif Fallback";
  src: local("Georgia Italic"), local("Georgia-Italic"), local("Noto Serif Italic"), local("NotoSerif-Italic");
  font-style: italic;
  font-weight: 100 900;
  size-adjust: 82%;
}


/* ==========================================================================
   02 · Base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  text-autospace: normal;            /* thin gap between 中文 and Latin where supported */
  counter-reset: form-section;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4, h5, h6 { font-size: 1rem; }

p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding-left: 1.25em; }
ul[class], ol[class] { padding: 0; list-style: none; }

img, picture, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
svg { max-width: 100%; }

button, input, select, textarea {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled { cursor: not-allowed; }

a {
  color: var(--color-accent-strong);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(116, 74, 34, 0.4);
  text-underline-offset: 0.24em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { color: var(--color-ink); text-decoration-color: currentColor; }

hr { height: 0; margin: 0; border: 0; border-top: 1px solid var(--color-line); }

/* Keyboard focus: a bronze ring that never appears on mouse / touch. */
:focus { outline: 2px solid var(--color-accent-strong); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent-strong); outline-offset: 3px; }

::selection { background: #E4CFAF; color: var(--color-ink); }

[hidden] { display: none !important; }


/* ==========================================================================
   03 · Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }

.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--space-4)); }
.stack > * { min-width: 0; }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-2));
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.text-soft { color: var(--color-ink-soft); }
.text-center { text-align: center; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--color-accent-strong);
}


/* ==========================================================================
   04 · Brand
   ========================================================================== */

.wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;     /* keeps the serif hairlines crisp on macOS */
  -moz-osx-font-smoothing: grayscale;
}
.wordmark em { font-style: italic; font-weight: 500; }
a.wordmark { padding-block: calc((var(--tap) - 1em) / 2); }   /* a 44px-tall link */
a.wordmark:hover { color: var(--color-accent-strong); }

.wordmark--sm { font-size: 1.4375rem; }

/* 12.5vw: one line from 360px up in the web font AND in an unscaled fallback
   serif, so the masthead does not change its height when the web font arrives */
.wordmark--lg {
  display: block;
  font-size: clamp(2.75rem, 12.5vw, 8rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.012em;
  white-space: normal;            /* may break after "J.Show" on tiny screens */
  text-wrap: balance;
}
.wordmark--lg em { font-weight: 400; }


/* ==========================================================================
   05 · Page chrome
   ========================================================================== */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 3.75rem;
  padding: var(--space-2) var(--gutter);
  padding-top: calc(var(--space-2) + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--color-line);
  background-color: var(--color-bg);
}
.site-header > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--container);
  padding-inline: 0;
}

.site-footer {
  margin-top: var(--space-8);
  padding: var(--space-6) var(--gutter) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-line);
  color: var(--color-ink-faint);
  font-size: 0.75rem;
  line-height: 1.8;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}
.site-footer::before {
  content: "";
  display: block;
  width: 1px;
  height: 1.75rem;
  margin: 0 auto var(--space-4);
  background-color: var(--color-accent);
}
.site-footer a { color: inherit; }

/* Display-page masthead */
.hero {
  padding: var(--space-7) var(--gutter) var(--space-6);
  text-align: center;
}
.hero > .container { padding-inline: 0; }

.hero__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--color-accent-strong);
}
.hero__eyebrow::before,
.hero__eyebrow::after {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 1px;
  background-color: var(--color-accent);
  opacity: 0.7;
}
.hero__eyebrow::after { margin-left: -0.26em; }   /* cancels the trailing letter-space */

/* the masthead title is the big wordmark, with or without the .wordmark classes
   (same size as .wordmark--lg, for the same reason) */
.hero__title {
  margin-top: var(--space-4);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 12.5vw, 8rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.hero__title em { font-style: italic; font-weight: 400; }

.hero__sub {
  max-width: 34em;
  margin: var(--space-4) auto 0;
  color: var(--color-ink-soft);
  font-size: 0.9375rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
/* a phrase that must not break in the middle (Chinese has no word spaces) */
.hero__sub > span,
.empty__text > span,
.phrase { display: inline-block; }

.hero__stats {
  display: flex;
  justify-content: center;
  max-width: 24rem;
  margin: var(--space-6) auto 0;
  padding: 0;
  list-style: none;
}
.stat {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  padding: 0.125rem var(--space-2);
}
.stat + .stat { border-left: 1px solid var(--color-line); }
.stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.375rem;
  font-weight: 500;
  line-height: 0.9;
  font-variant-numeric: lining-nums;
  color: var(--color-ink);
}
.stat__label {
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--color-ink-soft);
}

/* Title block for the form and admin pages */
.page-head { padding-block: var(--space-6) var(--space-5); }
.page-head__title {
  margin-top: var(--space-2);
  font-size: 1.75rem;
  font-weight: 400;                /* large Chinese titles stay light and airy */
  line-height: 1.3;
  letter-spacing: 0.1em;
}
.page-head__sub {
  max-width: 36em;
  margin-top: var(--space-3);
  color: var(--color-ink-soft);
  font-size: 0.9375rem;
  line-height: 1.8;
  text-wrap: pretty;
}

@media (min-width: 48em) {
  .hero { padding-block: var(--space-8) var(--space-7); }
  .hero__eyebrow { font-size: 0.8125rem; letter-spacing: 0.3em; }
  .hero__eyebrow::before,
  .hero__eyebrow::after { width: 2.5rem; }
  .hero__eyebrow::after { margin-left: -0.3em; }
  .hero__title { margin-top: var(--space-5); }
  .hero__sub { margin-top: var(--space-5); font-size: 1rem; }
  .hero__stats { max-width: 30rem; margin-top: var(--space-7); }
  .stat__value { font-size: 3rem; }
  .stat__label { font-size: 0.8125rem; }
  .page-head { padding-block: var(--space-7) var(--space-6); }
  .page-head__title { font-size: 2.25rem; }
}


/* ==========================================================================
   06 · Buttons
   ========================================================================== */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--color-ink);
  --btn-border: transparent;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-indent: 0.12em;             /* optically centres letter-spaced labels */
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.12s ease;
}
.btn svg { flex: none; width: 1.125em; height: 1.125em; }

.btn--primary {
  --btn-bg: var(--color-ink);
  --btn-fg: var(--color-on-accent);
  --btn-border: var(--color-ink);
}
.btn--secondary {
  --btn-fg: var(--color-ink);
  --btn-border: var(--color-ink);
}
.btn--ghost {
  --btn-fg: var(--color-ink-soft);
}
.btn--danger {
  --btn-bg: var(--color-danger);
  --btn-fg: var(--color-on-accent);
  --btn-border: var(--color-danger);
}

/* <a class="btn"> keeps the button colour on hover instead of the link colour */
.btn:hover { color: var(--btn-fg); }

@media (hover: hover) {
  .btn--primary:hover {
    --btn-bg: var(--color-accent-strong);
    --btn-border: var(--color-accent-strong);
  }
  .btn--secondary:hover {
    --btn-bg: var(--color-ink);
    --btn-fg: var(--color-on-accent);
  }
  .btn--ghost:hover {
    --btn-bg: var(--color-surface-alt);
    --btn-fg: var(--color-ink);
  }
  .btn--danger:hover {
    --btn-bg: #862E20;
    --btn-border: #862E20;
  }
}

.btn:active { transform: translateY(1px); }
.btn--primary:active { --btn-bg: #1A130E; --btn-border: #1A130E; }
.btn--secondary:active { --btn-bg: var(--color-ink); --btn-fg: var(--color-on-accent); }
.btn--ghost:active { --btn-bg: var(--color-surface-alt); --btn-fg: var(--color-ink); }
.btn--danger:active { --btn-bg: #7A281B; --btn-border: #7A281B; }

.btn--sm {
  min-height: 2.25rem;
  padding: 0.25rem 0.875rem;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
}
@media (pointer: coarse) {
  .btn--sm { min-height: var(--tap); }
}

.btn--block { display: flex; width: 100%; }

/* Disabled. A busy button (.is-loading, which ui.js also disables) is not
   "unavailable", so it keeps its own colours. */
.btn[disabled]:not(.is-loading),
.btn[aria-disabled="true"]:not(.is-loading) {
  --btn-bg: var(--color-surface-alt);
  --btn-fg: #9A8D7E;
  --btn-border: var(--color-line);
  cursor: not-allowed;
  transform: none;
}
.btn--ghost[disabled]:not(.is-loading),
.btn--ghost[aria-disabled="true"]:not(.is-loading) {
  --btn-bg: transparent;
  --btn-border: transparent;
}

/* Loading: a small spinner leads the label ("提交中…"), colours stay as they are. */
.btn.is-loading {
  pointer-events: none;
  cursor: progress;
  transform: none;
}
.btn.is-loading::before {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.btn.is-loading > svg { display: none; }   /* the spinner takes the icon's place */

@keyframes spin { to { transform: rotate(360deg); } }

/* Inline icons from ui.js svgIcon(): one even hairline at any size. */
:where(svg[data-icon]) { flex: none; stroke-width: 1.5; }
:where(svg[data-icon]) * { vector-effect: non-scaling-stroke; }
.chip svg,
.tab svg,
.tag svg,
.entry-add svg,
.field__error svg { flex: none; width: 1.125em; height: 1.125em; }


/* ==========================================================================
   07 · Chips & tags
   ========================================================================== */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) 0.375rem;
  min-width: 0;
}

/* The pill is drawn on ::before, so the button itself can be a full 44px tap
   target on touch screens while the visible pill stays a slim 36px. */
.chip {
  --chip-pad: 0px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 0.8125rem;
  color: var(--color-ink-soft);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: color 0.2s ease;
}
.chip::before {
  content: "";
  position: absolute;
  inset: var(--chip-pad) 0;
  z-index: -1;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
@media (pointer: coarse) {
  .chip { --chip-pad: 4px; min-height: var(--tap); }
  .chip-group { row-gap: 0; }
}
@media (min-width: 48em) {
  .chip-group { column-gap: var(--space-2); }
  .chip { padding-inline: 1rem; font-size: 0.875rem; }
}
@media (hover: hover) {
  .chip:hover { color: var(--color-ink); }
  .chip:hover::before { border-color: var(--color-ink); }
}
.chip:active::before { background-color: var(--color-surface-alt); }
.chip.is-active,
.chip[aria-pressed="true"] { color: var(--color-on-accent); }
.chip.is-active::before,
.chip[aria-pressed="true"]::before {
  border-color: var(--color-ink);
  background-color: var(--color-ink);
}
.chip:focus-visible { outline: none; }
.chip:focus-visible::before { outline: 2px solid var(--color-accent-strong); outline-offset: 2px; }
/* a high-contrast theme replaces author colours: the active chip keeps a fill,
   in the system's own selection colours */
@media (forced-colors: active) {
  .chip.is-active,
  .chip[aria-pressed="true"] { color: HighlightText; }
  .chip.is-active::before,
  .chip[aria-pressed="true"]::before { border-color: Highlight; background-color: Highlight; }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  max-width: 100%;
  min-height: 1.5rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--color-ink-soft);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.tag--accent {
  border-color: transparent;
  background-color: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.tag--muted {
  border-color: transparent;
  background-color: var(--color-surface-alt);
  color: var(--color-ink-faint);
}
.tag--success {
  border-color: transparent;
  background-color: var(--color-success-soft);
  color: var(--color-success);
}
.tag--warning {
  border-color: transparent;
  background-color: var(--color-warning-soft);
  color: var(--color-warning);
}
.tag--danger {
  border-color: transparent;
  background-color: var(--color-danger-soft);
  color: var(--color-danger);
}


/* ==========================================================================
   08 · Forms
   ========================================================================== */

.form-section {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-line);
  counter-increment: form-section;
}
.form-section > * + * { margin-top: var(--space-5); }

.form-section__title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1em;
}
.form-section__title::before {
  content: counter(form-section, decimal-leading-zero);
  flex: none;
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: lining-nums;
  color: var(--color-accent);
}
.form-section > .form-section__desc,
.form-section__title + .form-section__desc {
  margin-top: var(--space-1);
}
.form-section__desc {
  color: var(--color-ink-soft);
  font-size: 0.875rem;
  line-height: 1.8;
}

form,
.modal__dialog { counter-reset: form-section; }

.field { display: grid; gap: var(--space-2); min-width: 0; }
/* align-items: start — a field whose neighbour is taller (an error message, a
   two-line hint) keeps its own height instead of being stretched */
.field-row { display: grid; align-items: start; gap: var(--space-5); }
@media (min-width: 37.5em) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
}

.field__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--color-ink);
}
.field__req { margin-left: 0.25em; color: var(--color-danger); font-weight: 400; }
.field__hint {
  color: var(--color-ink-faint);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.field__error {
  display: none;
  align-items: flex-start;
  gap: 0.4375rem;
  color: var(--color-danger);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.field__error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}
.field.is-invalid .field__error { display: flex; }

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: 0.6875rem 0.875rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-ink);
  font-family: inherit;
  font-size: 1rem;                 /* 16px: no zoom on iOS */
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.input::placeholder,
.textarea::placeholder { color: var(--color-ink-faint); opacity: 1; }

@media (hover: hover) {
  .input:hover,
  .textarea:hover,
  .select:hover { border-color: var(--color-ink-soft); }
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--color-ink);
  box-shadow: 0 0 0 1px var(--color-ink), 0 0 0 5px rgba(155, 104, 54, 0.2);
}
.input:disabled,
.textarea:disabled,
.select:disabled {
  border-color: var(--color-line);
  background-color: var(--color-surface-alt);
  color: var(--color-ink-faint);
  cursor: not-allowed;
}

.input[type="date"] { min-height: 3rem; }
.input[type="date"]::-webkit-date-and-time-value { min-height: 1.5em; text-align: left; }
.input::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }
/* iOS Safari draws nothing in an empty date field — no "年/月/日", no calendar
   mark — so there, and only there (this @supports test is true in iOS browsers
   only), the field carries a calendar mark and says what a tap does while it
   is empty. A required date field is :invalid exactly while it is empty (or
   outside min / max). Flex is the layout iOS itself gives a date field: the
   hint and the value stand side by side. */
@supports (-webkit-touch-callout: none) {
  .input[type="date"] {
    display: flex;
    align-items: center;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 5.5h13a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2v-11a2 2 0 0 1 2-2zM3.5 10h17M8 3.5v4M16 3.5v4' fill='none' stroke='%235C4F45' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1.125rem auto;
  }
  .input[type="date"]:invalid::before {
    content: "\8BF7\9009\62E9\65E5\671F";   /* 请选择日期 — escaped, so it does not depend on how the file is served */
    flex: none;
    margin-right: 0.5em;
    color: var(--color-ink-faint);
  }
}

.textarea {
  min-height: 6.25rem;
  line-height: 1.7;
  resize: vertical;
  field-sizing: content;           /* grows with the text where supported */
}

.select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235C4F45' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9375rem center;
  background-size: 0.6875rem auto;
  cursor: pointer;
}

.field.is-invalid .input,
.field.is-invalid .textarea,
.field.is-invalid .select { border-color: var(--color-danger); background-color: #FEF8F5; }
.field.is-invalid .input:focus,
.field.is-invalid .textarea:focus,
.field.is-invalid .select:focus {
  box-shadow: 0 0 0 1px var(--color-danger), 0 0 0 5px rgba(160, 59, 43, 0.16);
}

/* Segmented control — one ruled strip, equal cells */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
}
.segmented__option { position: relative; display: block; min-width: 0; cursor: pointer; }
.segmented__option + .segmented__option { border-left: 1px solid var(--color-line-strong); }
.segmented__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.segmented__option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.25rem 0.5rem;
  color: var(--color-ink-soft);
  font-size: 0.9375rem;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}
@media (hover: hover) {
  .segmented__option:hover input:not(:checked) + span {
    background-color: var(--color-surface-alt);
    color: var(--color-ink);
  }
}
.segmented__option input:checked + span {
  background-color: var(--color-ink);
  color: var(--color-on-accent);
}
.segmented__option input:focus-visible + span {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: -4px;
}
.segmented__option input:checked:focus-visible + span { outline-color: var(--color-on-accent); }
/* A high-contrast theme (Windows "contrast themes") replaces every author
   colour, so the ink fill that marks the chosen option would vanish: there the
   choice is drawn in the system's own selection colours. */
@media (forced-colors: active) {
  .segmented__option input:checked + span {
    background-color: Highlight;
    color: HighlightText;
  }
  .segmented__option input:checked:focus-visible + span { outline-color: HighlightText; }
}

/* Choice cards (artist, brow type) */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.625rem;
}
.choice-card { position: relative; display: block; min-width: 0; cursor: pointer; }
.choice-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: 5.5rem;
  padding: 2.125rem 0.75rem 0.75rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
/* the selection mark: an open ring that fills with ink and a tick */
.choice-card__body::before {
  content: "";
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid var(--color-line-strong);
  border-radius: 50%;
  background-color: var(--color-surface);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.choice-card__body::after {
  content: "";
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 0.3125rem;
  height: 0.5625rem;
  border: solid var(--color-on-accent);
  border-width: 0 1.5px 1.5px 0;
  opacity: 0;
  transform: rotate(45deg) scale(0.6);
  transition: opacity 0.15s ease, transform 0.2s var(--ease);
}
.choice-card__title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}
.choice-card__sub {
  display: block;
  margin-top: 0.125rem;
  color: var(--color-ink-soft);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
}
@media (hover: hover) {
  .choice-card:hover .choice-card__body { border-color: var(--color-ink-soft); }
}
.choice-card input:checked + .choice-card__body {
  border-color: var(--color-ink);
  background-color: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-ink);
}
.choice-card input:checked + .choice-card__body::before {
  border-color: var(--color-ink);
  background-color: var(--color-ink);
}
.choice-card input:checked + .choice-card__body::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}
.choice-card input:focus-visible + .choice-card__body {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 3px;
}

/* Checkbox */
.checkbox {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: var(--tap);
  padding-block: 0.5625rem;
  cursor: pointer;
}
.checkbox input {
  position: absolute;
  top: 0.5625rem;
  left: 0;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.checkbox span {
  position: relative;
  display: block;
  padding-left: 2.125rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}
.checkbox span::before {
  content: "";
  position: absolute;
  top: 0.0625rem;
  left: 0;
  width: 1.375rem;
  height: 1.375rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.checkbox span::after {
  content: "";
  position: absolute;
  top: 0.3125rem;
  left: 0.5rem;
  width: 0.375rem;
  height: 0.6875rem;
  border: solid var(--color-on-accent);
  border-width: 0 1.5px 1.5px 0;
  opacity: 0;
  transform: rotate(45deg) scale(0.6);
  transition: opacity 0.15s ease, transform 0.2s var(--ease);
}
@media (hover: hover) {
  .checkbox:hover span::before { border-color: var(--color-ink); }
}
.checkbox input:checked + span::before {
  border-color: var(--color-ink);
  background-color: var(--color-ink);
}
.checkbox input:checked + span::after { opacity: 1; transform: rotate(45deg) scale(1); }
.checkbox input:focus-visible + span::before {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 3px;
}
.field.is-invalid .checkbox span::before { border-color: var(--color-danger); }

/* Photo uploader */
.uploader {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.75rem var(--space-4);
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.uploader input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  clip: rect(0 0 0 0);
}
.uploader svg {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.375rem;
  color: var(--color-accent);
}
.uploader__title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
}
.uploader__hint {
  color: var(--color-ink-faint);
  font-size: 0.8125rem;
  line-height: 1.6;
}
@media (hover: hover) {
  .uploader:hover { border-color: var(--color-ink); background-color: #FBF6EE; }
}
.uploader.is-dragover {
  border-style: solid;
  border-color: var(--color-accent);
  background-color: var(--color-accent-soft);
}
.uploader:focus-within { outline: 2px solid var(--color-accent-strong); outline-offset: 3px; }
@supports selector(:has(*)) {
  .uploader:focus-within { outline: none; }
  .uploader:has(input:focus-visible) { outline: 2px solid var(--color-accent-strong); outline-offset: 3px; }
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
  gap: var(--space-2);
}
.thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--photo-placeholder);
  box-shadow: inset 0 0 0 1px rgba(42, 32, 25, 0.08);
}
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
  font-size: 0;
}
/* a 44px button whose visible part is a 24px disc in the corner */
.thumb__remove {
  position: absolute;
  top: 0;
  right: 0;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.3125rem 0.3125rem 0.9375rem 0.9375rem;
  color: #FFFDF9;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1;
}
.thumb__remove::before {
  content: "";
  position: absolute;
  top: 0.3125rem;
  right: 0.3125rem;
  z-index: -1;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background-color: rgba(33, 25, 19, 0.68);
  transition: background-color 0.2s ease;
}
.thumb__remove svg { width: 0.625rem; height: 0.625rem; stroke-width: 1.25; }
@media (hover: hover) {
  .thumb__remove:hover::before { background-color: var(--color-danger); }
}
.thumb__remove:active::before { background-color: var(--color-danger); }
.thumb__remove:focus-visible { outline: none; }
.thumb__remove:focus-visible::before {
  background-color: var(--color-ink);
  outline: 2px solid var(--color-on-accent);
  outline-offset: 1px;
  box-shadow: 0 0 0 5px var(--color-ink);
}
button.thumb { cursor: zoom-in; }
button.thumb:focus-visible { outline-offset: 2px; }
.thumb--add {
  display: grid;
  place-items: center;
  width: 100%;
  border: 1px dashed var(--color-line-strong);
  background: transparent;
  box-shadow: none;
  color: var(--color-ink-soft);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.thumb--add svg { width: 1.5rem; height: 1.5rem; }
@media (hover: hover) {
  .thumb--add:hover { border-color: var(--color-ink); background-color: var(--color-surface); color: var(--color-ink); }
}

/* Multi-entry sections */
.entry-list { display: grid; gap: var(--space-3); }
.entry { position: relative; min-width: 0; }
.entry .textarea { padding-right: 2.875rem; }
.entry__remove {
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-ink-faint);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  transition: color 0.2s ease;
}
.entry__remove::before {
  content: "";
  position: absolute;
  inset: 0.375rem;
  z-index: -1;
  border-radius: 50%;
  background-color: transparent;
  transition: background-color 0.2s ease;
}
.entry__remove svg { width: 0.75rem; height: 0.75rem; }
@media (hover: hover) {
  .entry__remove:hover { color: var(--color-danger); }
  .entry__remove:hover::before { background-color: var(--color-danger-soft); }
}
.entry__remove:active { color: var(--color-danger); }
.entry__remove:active::before { background-color: var(--color-danger-soft); }
.entry__remove:focus-visible { outline: none; color: var(--color-ink); }
.entry__remove:focus-visible::before { outline: 2px solid var(--color-accent-strong); outline-offset: 0; }

.entry-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 3rem;
  margin-top: var(--space-3);
  padding: 0.5rem var(--space-4);
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-sm);
  color: var(--color-ink-soft);
  font-size: 0.9375rem;
  line-height: 1.3;
  letter-spacing: 0.1em;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.form-section > .entry-add { margin-top: var(--space-3); }
@media (hover: hover) {
  .entry-add:hover { border-color: var(--color-ink); background-color: var(--color-surface); color: var(--color-ink); }
}
.entry-add:active { background-color: var(--color-surface-alt); }
.entry-add[disabled] { border-color: var(--color-line); color: #9A8D7E; }

/* Bottom action bar */
.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0 calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-line);
  background-color: rgba(246, 241, 232, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.form-actions > .btn { flex: 1 1 auto; }
@media (min-width: 48em) {
  .form-actions {
    position: static;
    padding: var(--space-5) 0 0;
    background-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .form-actions > .btn { flex: 0 0 auto; min-width: 12rem; }
}


/* ==========================================================================
   09 · Cards
   ========================================================================== */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card__body { padding: var(--space-5) 1.25rem; }
.card__footer {
  padding: var(--space-3) 1.25rem;
  border-top: 1px solid var(--color-line);
}
@media (min-width: 48em) {
  .card__body { padding: var(--space-6) var(--space-6); }
  .card__footer { padding: var(--space-4) var(--space-6); }
}


/* ==========================================================================
   10 · Display page
   ========================================================================== */

.filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-block: var(--space-4) var(--space-3);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}
.filters__label {
  display: block;
  color: var(--color-ink-faint);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.22em;
}
.chip-group > .filters__label { flex: 0 0 100%; }
.filters > .filters__label { margin-bottom: calc(0.375rem - var(--space-3)); }
@media (pointer: coarse) {
  .chip-group > .filters__label { margin-bottom: 0.125rem; }
}

@media (min-width: 48em) {
  .filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3) var(--space-7);
    margin-bottom: var(--space-6);
    padding-block: var(--space-4);
  }
  /* groups spread across the bar; each one stays left-aligned if the bar wraps */
  .filters > .chip-group:not(:last-child) { margin-right: auto; }
  .chip-group > .filters__label { flex: 0 0 auto; min-width: 5.25em; margin: 0 var(--space-1) 0 0; }
  .filters > .filters__label { margin: 0; }
  /* labels written as siblings of the chip groups: a two-column list, so a
     label can never be separated from its chips */
  .filters:has(> .filters__label) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-2) var(--space-4);
  }
  .filters:has(> .filters__label) > .chip-group { margin-right: 0; }
}

.review-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  max-width: 30rem;
  margin-inline: auto;
  padding: 0;
  list-style: none;
}
.review-list > .empty { grid-column: 1 / -1; }
@media (min-width: 44em) {
  .review-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
}
@media (min-width: 68em) {
  .review-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
}

/* The review card */
.review {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  counter-reset: review-section;
}
/* cards settle in softly, one after another (off under reduced motion) */
.review-list > .review { animation: review-in 0.5s var(--ease) both; }
.review-list > .review:nth-child(2) { animation-delay: 0.05s; }
.review-list > .review:nth-child(3) { animation-delay: 0.1s; }
.review-list > .review:nth-child(4) { animation-delay: 0.15s; }
.review-list > .review:nth-child(n + 5) { animation-delay: 0.2s; }
@keyframes review-in {
  from { opacity: 0; transform: translateY(0.625rem); }
  to { opacity: 1; transform: none; }
}

.review__photos {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--color-line);
  background-color: var(--color-surface);
}
.review__photos::-webkit-scrollbar { display: none; }

.review__photo {
  position: relative;
  flex: 0 0 42%;                   /* 4+ photos: a strip showing 2⅓ frames */
  min-width: 0;
  aspect-ratio: var(--photo-ratio);
  overflow: hidden;
  background: var(--photo-placeholder);
  scroll-snap-align: start;
  cursor: zoom-in;
}
.review__photo img {
  position: absolute;              /* fills the frame whatever the browser makes of % heights */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;              /* hides alt text if the file is missing */
  font-size: 0;
  transition: transform 0.7s var(--ease);
}
/* A photo the frame would cut by more than a fifth — a landscape close-up of
   both brows, a before / after collage — is shown whole instead, on the
   placeholder ground (without the brow mark, which could peek out beside a
   very narrow picture). assets/js/pages/index.js adds .is-whole once the photo
   has loaded; the frame keeps its size, so nothing moves. */
.review__photo.is-whole { background: var(--photo-ground); }
.review__photo.is-whole img { object-fit: contain; }
/* a missing image keeps the calm placeholder instead of a broken-image icon */
.review__photo img::after,
.thumb img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--photo-placeholder);
}
@media (hover: hover) {
  .review__photo:hover img { transform: scale(1.035); }
}
/* keyboard focus: an ink frame with an ivory inner line, drawn above the photo
   so it reads on any picture */
.review__photo:focus-visible { outline: none; }
.review__photo:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--color-ink);
  outline: 2px solid var(--color-on-accent);
  outline-offset: -5px;
  pointer-events: none;
}

/* 1 – 3 photos share the full width */
.review__photos[data-count="1"] .review__photo,
.review__photos[data-count="2"] .review__photo,
.review__photos[data-count="3"] .review__photo,
.review__photos:not([data-count]) .review__photo:only-child,
.review__photos:not([data-count]) .review__photo:first-child:nth-last-child(2),
.review__photos:not([data-count]) .review__photo:first-child:nth-last-child(2) ~ .review__photo,
.review__photos:not([data-count]) .review__photo:first-child:nth-last-child(3),
.review__photos:not([data-count]) .review__photo:first-child:nth-last-child(3) ~ .review__photo {
  flex: 1 1 0;
}
.review__photos[data-count="1"] .review__photo,
.review__photos:not([data-count]) .review__photo:only-child {
  aspect-ratio: var(--photo-ratio-single);
  max-height: 30rem;
}

.review__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.25rem 1.5rem;
}

/* text-only card: keeps its own height in a row of taller photo cards and
   opens with a serif quotation mark */
.review:has(> .review__body:first-child) { align-self: start; }
.review > .review__body:first-child::before {
  content: "\201C";
  flex: none;
  display: block;
  height: 1.75rem;
  margin-bottom: var(--space-4);
  background:
    linear-gradient(var(--color-line), var(--color-line)) left 64% / calc(50% - 1.375rem) 1px no-repeat,
    linear-gradient(var(--color-line), var(--color-line)) right 64% / calc(50% - 1.375rem) 1px no-repeat;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.review__header { display: flex; align-items: center; gap: var(--space-3); }
.review__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-family: var(--font-display-latin), var(--font-body);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}
.review__who { flex: 1 1 auto; min-width: 0; }
.review__name {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}
.review__meta {
  margin-top: 0.125rem;
  color: var(--color-ink-faint);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.review__sample { flex: none; align-self: flex-start; }

.review__tags { margin-top: 0.875rem; }

.review__section { margin-top: 1.25rem; counter-increment: review-section; }
.review__tags + .review__section,
.review__header + .review__section { margin-top: 1.375rem; }

.review__section-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
  color: var(--color-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.16em;
}
.review__section-title::before {
  content: counter(review-section, decimal-leading-zero);
  flex: none;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: lining-nums;
  color: var(--color-accent);
}
.review__section-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background-color: var(--color-line);
}

.review__entry {
  color: var(--color-ink);
  font-size: 0.9375rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  white-space: pre-line;
  text-wrap: pretty;
}
.review__entry + .review__entry { margin-top: 0.4375rem; }

@media (min-width: 68em) {
  .review__body { padding: 1.375rem 1.5rem 1.75rem; }
}

/* Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-5);
  color: var(--color-ink-soft);
  text-align: center;
}
.empty__icon,
.empty > svg {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: var(--space-3);
  color: var(--color-accent);
}
.empty__icon svg { width: 100%; height: 100%; }
.empty__title {
  color: var(--color-ink);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
}
.empty__text {
  max-width: 24em;
  font-size: 0.875rem;
  line-height: 1.8;
  text-wrap: balance;
}

/* Skeleton */
.skeleton {
  display: block;
  min-height: 0.875rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-alt);
  background-image: linear-gradient(100deg, rgba(253, 251, 247, 0) 30%, rgba(253, 251, 247, 0.85) 50%, rgba(253, 251, 247, 0) 70%);
  background-repeat: no-repeat;
  background-size: 220% 100%;
  background-position: 130% 0;
  animation: skeleton-sweep 1.7s ease-in-out infinite;
}
@keyframes skeleton-sweep { to { background-position: -90% 0; } }


/* ==========================================================================
   11 · Admin
   ========================================================================== */

.tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  border-bottom: 1px solid var(--color-line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3.25rem;
  padding: 0.5rem 0.375rem;
  color: var(--color-ink-soft);
  font-size: 0.9375rem;
  line-height: 1.3;
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background-color: var(--color-ink);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}
@media (hover: hover) {
  .tab:hover { color: var(--color-ink); }
}
.tab.is-active,
.tab[aria-selected="true"] { color: var(--color-ink); }
.tab.is-active::after,
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab:focus-visible { outline-offset: -3px; }
.tab__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-surface-alt);
  color: var(--color-ink-soft);
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.tab.is-active .tab__count,
.tab[aria-selected="true"] .tab__count {
  background-color: var(--color-ink);
  color: var(--color-on-accent);
}
@media (min-width: 48em) {
  .tabs { gap: var(--space-6); }
  .tab { flex: 0 0 auto; padding-inline: 0.125rem; }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-4);
}
.toolbar > :first-child { margin-right: auto; }
.toolbar > .select,
.toolbar > .input { flex: 1 1 12rem; width: auto; }
@media (min-width: 48em) {
  .toolbar > .select,
  .toolbar > .input { flex: 0 1 16rem; }
}

.admin-review {
  min-width: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  counter-reset: review-section;
}
.admin-review + .admin-review { margin-top: var(--space-4); }
.admin-review .kv,
.admin-review .thumb-grid { margin-top: var(--space-4); }
.admin-review__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 1.25rem;
  border-top: 1px solid var(--color-line);
  background-color: rgba(239, 232, 220, 0.38);
}
.admin-review__actions .btn { flex: 1 1 auto; }
.admin-review__actions .btn--primary { flex-basis: 100%; }
.admin-review__actions .btn--danger {
  --btn-bg: transparent;
  --btn-fg: var(--color-danger);
  --btn-border: transparent;
}
@media (hover: hover) {
  .admin-review__actions .btn--danger:hover {
    --btn-bg: var(--color-danger-soft);
    --btn-border: transparent;
  }
}
.admin-review__actions .btn--danger:active { --btn-bg: var(--color-danger-soft); --btn-border: transparent; }
@media (min-width: 37.5em) {
  .admin-review__actions .btn,
  .admin-review__actions .btn--primary { flex: 0 0 auto; }
  .admin-review__actions .btn--danger { margin-left: auto; }
}
@media (min-width: 48em) {
  .admin-review__actions { padding: var(--space-4) var(--space-6); }
}

/* Key / value facts */
.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-4);
  margin: 0;
  border-top: 1px solid var(--color-line);
}
.kv > div {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-line);
}
.kv dt {
  color: var(--color-ink-faint);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.16em;
}
.kv dd {
  margin: 0;
  color: var(--color-ink);
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
@media (min-width: 37.5em) {
  .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* ==========================================================================
   12 · Banner
   ========================================================================== */

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.875rem;
  padding: 0.625rem var(--gutter);
  padding-top: calc(0.625rem + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--color-line);
  background-color: var(--color-surface-alt);
  color: var(--color-ink-soft);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
}
.banner strong {
  padding: 0.0625rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.banner a {
  margin: -1rem -0.25rem;            /* a 44px tap area that does not grow the strip */
  padding: 1rem 0.25rem;
  color: inherit;
  text-decoration-color: currentColor;
  white-space: nowrap;
}
.banner a[aria-current="page"] { font-weight: 600; text-decoration-line: none; cursor: default; }
.banner svg { flex: none; width: 1.125em; height: 1.125em; vertical-align: -0.2em; }

.banner--demo {
  border-bottom-color: var(--color-ink);
  background-color: var(--color-ink);
  color: #E9E1D4;
}
.banner--demo strong { border-color: #D4B08A; color: #D4B08A; }
.banner--demo a { color: #FFFDF9; text-decoration-color: rgba(255, 253, 249, 0.5); }
.banner--demo a:hover { color: #D4B08A; text-decoration-color: currentColor; }
.banner--demo a[aria-current="page"] { color: #D4B08A; }
.banner--demo :focus-visible { outline-color: #D4B08A; }


/* ==========================================================================
   13 · Overlays
   ========================================================================== */

/* Modal — a bottom sheet on phones, a centred dialog from 600px up */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background-color: var(--color-overlay);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0s;
}
.modal__dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 30rem;
  max-height: 88vh;
  max-height: 88dvh;
  padding: var(--space-5) 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s var(--ease);
}
.modal:not(.is-open) .modal__dialog { transform: translateY(1.5rem); }
.modal__dialog:focus { outline: none; }    /* the dialog itself is only a focus parking spot */
.modal--wide .modal__dialog { max-width: 46rem; }
/* a long form inside: rule off the title and the actions so the scrolling
   middle reads as its own pane */
.modal--wide .modal__title { padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-line); }
.modal--wide .modal__body { margin-top: 0; padding-block: var(--space-4); }
.modal--wide .modal__actions { margin-top: 0; padding-top: var(--space-4); border-top: 1px solid var(--color-line); }

.modal__title {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.06em;
}
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  margin: var(--space-3) -0.375rem 0;
  padding: 0 0.375rem;                   /* side room for focus rings inside the scroller */
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--color-ink-soft);
  font-size: 0.9375rem;
  line-height: 1.8;
}
.modal__body > p { text-wrap: balance; }   /* no single character left alone on the last line */
.modal__body > p + p { margin-top: 0.5em; }
.modal__actions {
  flex: none;
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.modal__actions .btn { flex: 1 1 0; }

@media (min-width: 37.5em) {
  .modal { align-items: center; padding: var(--space-5); }
  .modal__dialog {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
  }
  .modal:not(.is-open) .modal__dialog { transform: translateY(0.75rem) scale(0.985); }
  .modal__actions { justify-content: flex-end; margin-top: var(--space-6); }
  .modal__actions .btn { flex: 0 0 auto; min-width: 7rem; }
}

/* Toasts — bottom centre; on phones they float just above where the sticky
   .form-actions bar sits, so a notice never covers the submit button.
   A notice never takes a tap meant for the control beneath it: the region and
   the notices are click-through. Only the close button of a notice that stays
   until it is dismissed (.toast__close, see toast() in ui.js) takes the pointer. */
.toast-region {
  position: fixed;
  right: max(var(--space-4), env(safe-area-inset-right, 0px));
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  left: max(var(--space-4), env(safe-area-inset-left, 0px));
  z-index: 1200;
  display: flex;
  flex-direction: column;          /* the newest notice is the one nearest the screen edge */
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}
@media (min-width: 48em) {
  .toast-region { bottom: var(--space-6); }
}
/* While a dialog or the photo viewer is open (ui.js sets data-over on the
   region) the notices move to the top edge: clear of the text and buttons of
   a bottom sheet, of a tall dialog's action row and of the viewer's controls. */
.toast-region[data-over] {
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  bottom: auto;
  flex-direction: column-reverse;  /* still the newest nearest the edge */
}
.toast-region[data-over="lightbox"] {
  right: calc(4.25rem + env(safe-area-inset-right, 0px));   /* beside the viewer's close button */
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  max-width: min(100%, 26rem);
  padding: 0.75rem 1.125rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-ink);
  color: #F6F1E8;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-wrap: balance;              /* no single character left alone on the last line */
  animation: toast-in 0.35s var(--ease) both;
}
.toast::before { flex: none; }
.toast svg { flex: none; width: 1.125em; height: 1.125em; }
/* the close button of a notice that stays: a 44px tap area that does not make
   the notice any taller */
.toast__close {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin: -0.6875rem -0.875rem -0.6875rem -0.375rem;
  border-radius: 50%;
  color: inherit;
  opacity: 0.75;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
@media (hover: hover) {
  .toast__close:hover { opacity: 1; }
}
.toast__close:focus-visible { opacity: 1; outline-color: #D4B08A; outline-offset: -6px; }
.toast--success::before {
  content: "";
  width: 0.375rem;
  height: 0.6875rem;
  margin: -0.1875rem 0.25rem 0 0.25rem;
  border: solid #BFD4B4;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.toast--error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid #F0B5A6;
  border-radius: 50%;
  color: #F0B5A6;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.toast.is-leaving { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(0.5rem); }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  /* the side insets keep the picture and the controls out from under the notch
     / Dynamic Island of a phone held sideways */
  padding: calc(4rem + env(safe-area-inset-top, 0px))
    max(var(--space-3), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))
    calc(4rem + env(safe-area-inset-bottom, 0px));
  background-color: rgba(23, 17, 13, 0.97);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0s;
}
.lightbox:focus { outline: none; }
.lightbox__img {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: min(100%, 64rem);
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  -webkit-user-select: none;
  user-select: none;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(246, 241, 232, 0.28);
  border-radius: 50%;
  background-color: rgba(23, 17, 13, 0.4);
  color: #F6F1E8;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lightbox__close svg,
.lightbox__nav svg { width: 1.125rem; height: 1.125rem; }
.lightbox__close {
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: calc(0.75rem + env(safe-area-inset-right, 0px));
}
/* Phones: the arrows wait in the bottom band, either side of the counter. At
   mid-height they would lie on the picture — at brow height in a portrait. */
.lightbox__nav { bottom: calc(0.625rem + env(safe-area-inset-bottom, 0px)); }
.lightbox__nav--prev { left: calc(0.75rem + env(safe-area-inset-left, 0px)); }
.lightbox__nav--next { right: calc(0.75rem + env(safe-area-inset-right, 0px)); }
@media (hover: hover) {
  .lightbox__close:hover,
  .lightbox__nav:hover { border-color: #F6F1E8; background-color: rgba(246, 241, 232, 0.16); }
}
.lightbox__nav[disabled] { opacity: 0.3; }
.lightbox :focus-visible { outline-color: #D4B08A; }
.lightbox__counter {
  position: absolute;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(246, 241, 232, 0.88);
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-style: italic;
  line-height: 1;
  letter-spacing: 0.14em;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}
/* From 768px up the arrows stand beside the picture, at mid-height */
@media (min-width: 48em) {
  .lightbox {
    padding-inline: calc(5rem + max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));
  }
  .lightbox__close {
    top: calc(1.25rem + env(safe-area-inset-top, 0px));
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
  }
  .lightbox__nav { top: 50%; bottom: auto; margin-top: -1.375rem; }
  .lightbox__nav--prev { left: calc(1.25rem + env(safe-area-inset-left, 0px)); }
  .lightbox__nav--next { right: calc(1.25rem + env(safe-area-inset-right, 0px)); }
}


/* ==========================================================================
   14 · Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* a busy indicator still has to read as busy */
  .btn.is-loading::before {
    animation-duration: 1.4s !important;
    animation-iteration-count: infinite !important;
  }
  .skeleton { animation: none; background-image: none; }
  .review__photo:hover img { transform: none; }
}
