/* Hallmark · shape: Contact Sheet (/), Plate (/sets), Sitter (/about), Notice (404), app screen (/admin) · genre: editorial · theme: brand · redesign: full
 * paper: oklch(98.8% 0.003 85) · accent: oklch(21% 0.008 85) · display: Bebas Neue · body: Inter · hero: Stage (/) · nav: edge-aligned bar, a wordmark and three links, named · footer: a colophon, "Get in touch" set large over the contact rows · signature: the featured set's title set as tall as its own cover, beside it
 * axes: light/display-condensed/neutral · posture: ink as the only accent, the photographs carry the colour · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4 · weakest: P, a gallery that stays out of the photos' way is a familiar argument; sharpened it by letting the condensed display meet each cover at its own height instead of printing over it */
/* Hallmark · waive 44c · /sets and /about open on their title and the photos or the bio, with no hero · these pages are a set and a sitter, the set's photos start inside the first screen */
/* Hallmark · waive 77 · the Photo sets head, the set heading and the About text each sit over their own photos or rows · a portfolio of photos, where the sets and photos are the mass, not extra sections */
/* Hallmark · answered F15 · the admin screens use a narrower 1200px measure; no public page mixes widths */
/* Hallmark · answered F7 · chips, the menu rows and the viewer's Download are controls in this brand's pill shape; photos and panels stay square */

/* ---------- Fonts ----------
   Bebas Neue (big titles) and Inter (everything else), stored on this site so
   no outside server is asked (the security headers only allow this site).
   Both are free fonts under the SIL Open Font License; the license texts are
   next to them in /fonts/. Only Latin letters are included: Chinese and other
   text uses the device's own font, from the end of each font list below. */
@font-face {
  font-family: "Bebas Neue";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/bebas-neue-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

/* ---------- Tokens ----------
   Every color, size and font lives here, so light and dark mode only swap the
   colors. Dark mode applies when the device is set to dark (unless the visitor
   picked light with the header button), or when the visitor picked dark;
   js/theme.js sets data-theme on <html> when they pick.

   The look: warm off-white paper, near-black ink and two grays carry almost
   everything, so the photos supply the color. The photo viewer and anything
   printed over a photo use the fixed "night" colors in both modes. */
:root {
  color-scheme: light;

  /* Paper and ink */
  --color-paper: oklch(98.8% 0.003 85);    /* the page */
  --color-paper-2: oklch(96% 0.004 85);    /* behind loading photos, quiet panels, round buttons */
  --color-paper-3: oklch(92.5% 0.005 85);  /* hover on those */
  --color-ink: oklch(19% 0.006 85);        /* titles and main text */
  --color-ink-2: oklch(33% 0.006 85);      /* longer text, a little lighter */
  --color-muted: oklch(48% 0.006 85);      /* dates, counts, labels, field edges */
  --color-rule: oklch(90.5% 0.004 85);     /* quiet dividing lines */
  --color-rule-strong: oklch(80% 0.005 85);/* chip edges, the active row */
  --color-accent: oklch(21% 0.008 85);     /* the one accent: an ink just off the text, on buttons and the chosen chip */
  --color-accent-ink: var(--color-paper);  /* text on the accent */
  --color-focus: var(--color-ink);

  /* State (admin badges and messages): text on its own background */
  --color-error: oklch(51% 0.19 27);
  --color-success: oklch(48% 0.12 150);
  --color-highlight: oklch(76% 0.15 80);   /* admin: the chosen cover */
  --color-highlight-ink: oklch(22% 0.03 80);
  --color-note-bg: oklch(95% 0.06 90);     --color-note-ink: oklch(42% 0.1 60);
  --color-info-bg: oklch(93% 0.04 250);    --color-info-ink: oklch(40% 0.14 260);
  --color-good-bg: oklch(94% 0.05 150);    --color-good-ink: oklch(36% 0.09 150);
  --color-bad-bg: oklch(93% 0.04 25);      --color-bad-ink: oklch(42% 0.15 27);
  --color-violet-bg: oklch(93% 0.04 300);  --color-violet-ink: oklch(40% 0.16 295);

  /* Night: the photo viewer and text over photos, the same in both modes */
  --color-night: oklch(16% 0.004 85);
  --color-night-2: oklch(31% 0.005 85);
  --color-night-3: oklch(39% 0.005 85);
  --color-night-ink: oklch(97.5% 0.003 85);
  --color-night-ink-2: oklch(90% 0.004 85);
  --color-night-muted: oklch(70% 0.004 85);
  --color-scrim: oklch(16% 0.004 85 / 0.62);
  --color-scrim-soft: oklch(16% 0.004 85 / 0.4);
  --color-scrim-none: oklch(16% 0.004 85 / 0);
  --color-shadow: oklch(10% 0.004 85 / 0.22);
  --color-loading: oklch(97.5% 0.003 85 / 0.7);

  /* Type */
  /* Chinese: 思源黑體 (Noto Sans TC), stored on this site and loaded on Chinese
     pages only (css/noto-sans-tc.css); elsewhere the device's own font. */
  --font-display: "Bebas Neue", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  --font-body: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
  --text-title: clamp(1.625rem, 0.9vw + 1.2rem, 2.125rem);       /* a set's name on its card */
  --text-section: clamp(2.75rem, 3.4vw + 1.4rem, 4.75rem);       /* section heads */
  --text-display: clamp(3.5rem, 6.4vw + 1rem, 8.5rem);           /* page titles */
  --text-hero: clamp(4rem, 8.4vw + 0.5rem, 11rem);               /* the featured set's name */
  --text-lead: clamp(1.0625rem, 0.3vw + 1rem, 1.25rem);

  /* Space */
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
  --container: 1440px;
  --gutter: clamp(16px, 3.4vw, 48px);
  --gap-columns: var(--space-md);
  --header-height: 64px;
  --control: 48px;        /* public buttons */
  --control-app: 40px;    /* admin buttons and fields */

  /* Shape: photos and panels are square; buttons and chips are pills */
  --radius-photo: 0;
  --radius-field: 4px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-slide: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
  --dur-exit: 160ms;  /* leaving is quicker and quieter than arriving */
  /* A pressed button sinks a little. It uses the separate "scale" property,
     so it never replaces a button's own transform (the viewer's arrows are
     centred with one). Small round buttons sink a little further to show it. */
  --press: 0.97; --press-small: 0.94;

  --z-raised: 10; --z-sticky-nav: 20; --z-dropdown: 50; --z-modal: 100; --z-ghost: 1000;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-paper: oklch(17% 0.004 85);
    --color-paper-2: oklch(22% 0.004 85);
    --color-paper-3: oklch(27% 0.005 85);
    --color-ink: oklch(96.5% 0.003 85);
    --color-ink-2: oklch(87% 0.004 85);
    --color-muted: oklch(70% 0.005 85);
    --color-rule: oklch(28% 0.005 85);
    --color-rule-strong: oklch(42% 0.005 85);
    --color-accent: oklch(94% 0.004 85);
    --color-error: oklch(70% 0.16 25);
    --color-success: oklch(70% 0.14 150);
    --color-highlight: oklch(80% 0.15 85);
    --color-note-bg: oklch(30% 0.06 70);     --color-note-ink: oklch(88% 0.1 90);
    --color-info-bg: oklch(28% 0.07 262);    --color-info-ink: oklch(87% 0.06 250);
    --color-good-bg: oklch(27% 0.05 150);    --color-good-ink: oklch(89% 0.08 150);
    --color-bad-bg: oklch(28% 0.07 25);      --color-bad-ink: oklch(88% 0.06 25);
    --color-violet-bg: oklch(28% 0.08 298);  --color-violet-ink: oklch(88% 0.06 298);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: oklch(17% 0.004 85);
  --color-paper-2: oklch(22% 0.004 85);
  --color-paper-3: oklch(27% 0.005 85);
  --color-ink: oklch(96.5% 0.003 85);
  --color-ink-2: oklch(87% 0.004 85);
  --color-muted: oklch(70% 0.005 85);
  --color-rule: oklch(28% 0.005 85);
  --color-rule-strong: oklch(42% 0.005 85);
  --color-accent: oklch(94% 0.004 85);
  --color-error: oklch(70% 0.16 25);
  --color-success: oklch(70% 0.14 150);
  --color-highlight: oklch(80% 0.15 85);
  --color-note-bg: oklch(30% 0.06 70);     --color-note-ink: oklch(88% 0.1 90);
  --color-info-bg: oklch(28% 0.07 262);    --color-info-ink: oklch(87% 0.06 250);
  --color-good-bg: oklch(27% 0.05 150);    --color-good-ink: oklch(89% 0.08 150);
  --color-bad-bg: oklch(28% 0.07 25);      --color-bad-ink: oklch(88% 0.06 25);
  --color-violet-bg: oklch(28% 0.08 298);  --color-violet-ink: oklch(88% 0.06 298);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* "hidden" always wins, even over layout rules like display: flex below. */
[hidden] { display: none !important; }

/* Nothing may ever make the page scroll sideways. */
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

/* The same page edges everywhere: capped and centred, so on a wide screen the
   margins grow and the grids keep their columns. */
main,
.site-header,
.site-footer {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
main { padding-block: 0 var(--space-3xl); }

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: break-word;
  min-width: 0;
  text-wrap: balance;
}
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
::selection { background: var(--color-paper-3); color: var(--color-ink); }
html { scrollbar-color: var(--color-rule-strong) var(--color-paper); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }

/* The tall display letters: page titles, section heads, a set's name. Bebas
   Neue is capitals only, so it is never set in small sizes or on controls. */
.display,
.hero-title,
.section-head h1,
.section-head h2,
.set-heading h1,
.about h1,
.not-found h1,
.related-sets h2,
.footer-heading,
.set-card h2,
.set-card h3,
.menu-main a,
main > h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1;
  overflow-wrap: break-word;
  min-width: 0;
}
/* Chinese titles in bold 思源黑體. Bebas Neue has one weight only: Latin
   letters in a Chinese title ("11/14") stay as drawn, never a faked bold. */
:lang(zh) :is(.display, .hero-title, .section-head h1, .section-head h2, .set-heading h1, .about h1, .not-found h1,
  .related-sets h2, .footer-heading, .set-card h2, .set-card h3, .menu-main a, main > h1) {
  font-weight: 700;
  font-synthesis: none;
  line-height: 1.15; /* Chinese characters need a little more room than Bebas capitals */
}

/* A clear outline for keyboard users, so they always see where they are. It
   appears at once, never fades in. */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
/* On photos and the dark viewer the outline is light. */
.lightbox :focus-visible { outline-color: var(--color-night-ink); }
/* After a click or tap, no outline (data-pointer is set by theme.js; a key
   press removes it). Text boxes keep theirs, to show where typing goes. */
html[data-pointer] :focus-visible:not(input, textarea, select) { outline: none; }

/* Hidden on screen but still read by screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.status { color: var(--color-muted); }
.muted { color: var(--color-muted); }

/* ---------- Pills: the one button shape on public pages ---------- */
/* Solid (the main action), gray (a quieter one), and light on photos. Each is
   48 px tall, a comfortable size for fingers. A press shrinks it a little. */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--control);
  padding: 0 var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: scale var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.pill:hover { background: var(--color-ink-2); }
.pill:active { scale: var(--press); }
.pill:disabled,
.pill[aria-disabled="true"] { background: var(--color-paper-3); color: var(--color-muted); cursor: not-allowed; scale: none; }
.pill-gray { background: var(--color-paper-2); color: var(--color-ink); }
.pill-gray:hover { background: var(--color-paper-3); }
.pill-on-photo { background: var(--color-night-ink); color: var(--color-night); }
.pill-on-photo:hover { background: var(--color-night-ink-2); }
.pill svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Round icon buttons: 40 px, in the header. */
.round-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), scale var(--dur-micro) var(--ease-out);
}
/* The tap area reaches 48 px without making the circle bigger. */
.round-button::after { content: ""; position: absolute; inset: calc(-1 * var(--space-2xs)); }
.round-button:hover { background: var(--color-paper-2); }
.round-button:active { scale: var(--press-small); }
.round-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Header ---------- */
/* An edge-aligned bar: the wordmark at the left; Work, About, Contact and the
   two round buttons at the right. It stays in view while scrolling, so the
   menu is always one tap away. The shadow trick paints its background and a
   hairline the full width of the window, though the bar itself is capped. */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.site-header:not(.admin-header) {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-nav);
  height: var(--header-height);
  background: var(--color-paper);
  box-shadow: 0 0 0 100vmax var(--color-paper), 0 1px 0 100vmax var(--color-rule);
  clip-path: inset(0 -100vmax -1px);
  /* Stays in place while the rest of the page fades (see "Smooth page changes"). */
  view-transition-name: site-header;
}
/* The site's name, set in the tall display letters. */
.site-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  padding-top: 0.12em; /* the letters sit high in their box; this centres them */
  text-decoration: none;
  white-space: nowrap;
}
.header-tools { display: flex; align-items: center; gap: var(--space-xl); }
.site-nav { display: flex; align-items: center; gap: var(--space-lg); font-weight: 500; }
.site-nav a {
  padding: var(--space-xs) 0;
  text-decoration: none;
  white-space: nowrap;
  text-underline-offset: 6px;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.header-buttons { display: flex; align-items: center; gap: var(--space-2xs); }
/* 中文 / English (functions/_middleware.js puts it first among the header
   buttons). Phones and tablets find it in the menu instead. */
.lang-switch {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-pill);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.lang-switch:hover { background: var(--color-paper-2); }

/* Phones and tablets: Menu at the left, the name in the middle, light / dark
   at the right (the links are in the menu). */
@media (max-width: 960px) {
  .site-header:not(.admin-header) {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    padding-inline: var(--space-xs);
  }
  .site-header .site-name { grid-column: 2; grid-row: 1; justify-self: center; font-size: 1.75rem; }
  .site-header .menu-button { grid-column: 1; grid-row: 1; justify-self: center; }
  .header-tools { display: contents; }
  .site-nav { display: none; }
  .header-buttons { display: contents; }
  .header-buttons .theme-toggle { grid-column: 3; grid-row: 1; justify-self: center; }
  .lang-switch { display: none; }
}

/* ---------- The menu button ---------- */
/* A round icon button; the word "Menu" is still read by screen readers. */
.menu-button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.menu-close svg,
.menu-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.menu-action[data-showing="light"] .icon-sun,
.menu-action[data-showing="dark"] .icon-moon { display: none; }

/* ---------- Menu: a panel that slides in from the right ---------- */
.site-menu {
  /* <dialog> starts as a box in the middle; make it a full-height side panel. */
  position: fixed;
  inset: 0 0 0 auto;
  width: min(400px, 88vw);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--color-rule);
  background: var(--color-paper);
  color: var(--color-ink);
  /* Stays above the header while it slides out (Safari lets go of a closing
     dialog's "always on top" place at once; Chrome keeps it until the end). */
  z-index: var(--z-modal);
  transform: translateX(100%);
  /* Closing: quicker than opening (below), the visitor is already moving on. */
  transition: transform var(--dur-short) var(--ease-slide), overlay var(--dur-short) allow-discrete, display var(--dur-short) allow-discrete;
}
.site-menu[open] { transform: translateX(0); transition-duration: 0.32s; }
@starting-style { .site-menu[open] { transform: translateX(100%); } }
.site-menu::backdrop {
  background: var(--color-scrim-none);
  transition: background-color var(--dur-short) var(--ease-out), overlay var(--dur-short) allow-discrete, display var(--dur-short) allow-discrete;
}
.site-menu[open]::backdrop { background: var(--color-scrim-soft); transition-duration: 0.32s; }
@starting-style { .site-menu[open]::backdrop { background: var(--color-scrim-none); } }

.menu-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-xs) var(--space-lg) var(--space-lg);
  overflow-y: auto;
}
.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-bottom: var(--space-lg);
}
.menu-title { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; padding-top: 0.12em; }
.menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-paper-2);
  color: var(--color-ink);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), scale var(--dur-micro) var(--ease-out);
}
.menu-close:hover { background: var(--color-paper-3); }
.menu-close:active { scale: var(--press-small); }
.menu-nav ul { list-style: none; margin: 0; padding: 0; }
/* Work, About, Contact: the display letters, large, one under another. */
.menu-main a {
  display: block;
  padding: var(--space-2xs) 0;
  font-size: 3rem;
  text-decoration: none;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}
.menu-main a:hover,
.menu-list a:hover { text-decoration: underline; }
.menu-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
/* Sets and Categories: each folds open and closed under its name (a native
   <details>, lib/chrome.js). The name row is the whole width, so it is easy to tap. */
.menu-section { margin-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.menu-heading {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--control);
  color: var(--color-ink);
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.menu-heading::-webkit-details-marker { display: none; }
.menu-count { color: var(--color-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.menu-chevron {
  width: 18px;
  height: 18px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: rotate var(--dur-short) var(--ease-out);
}
.menu-section[open] .menu-chevron,
.fold[open] > .fold-head .fold-chevron { rotate: 90deg; }
.menu-section > ul { padding-bottom: var(--space-sm); }
/* The fold, for the menu's sections and the admin panels (.fold, .card-more):
   the section grows to its height and its content fades in; closing is
   quicker. Height is the one thing that can show a section opening. Browsers
   without ::details-content or interpolate-size simply open at once. */
.menu-panel,
.admin-header ~ main { interpolate-size: allow-keywords; }
:is(.menu-section, .fold, .card-more)::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size var(--dur-exit) var(--ease-out), content-visibility var(--dur-exit) allow-discrete;
}
:is(.menu-section, .fold, .card-more)[open]::details-content { block-size: auto; transition-duration: var(--dur-short); }
:is(.menu-section > ul, .fold-body) { transition: opacity var(--dur-short) var(--ease-out), translate var(--dur-short) var(--ease-out); }
:is(.menu-section:not([open]) > ul, .fold:not([open]) > .fold-body) { opacity: 0; translate: 0 -4px; }
@starting-style { :is(.menu-section[open] > ul, .fold[open] > .fold-body) { opacity: 0; translate: 0 -4px; } }
.menu-list a {
  display: block;
  padding: var(--space-xs) 0;
  color: var(--color-ink);
  text-decoration: none;
  text-underline-offset: 5px;
}
.menu-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.menu-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-pill);
  font-weight: 500;
}
/* Same look as the category buttons on the home page. */
.menu-chips a:hover { text-decoration: none; border-color: var(--color-ink); }
.menu-chips a[aria-current="page"] { text-decoration: none; background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.menu-actions { display: grid; gap: var(--space-xs); margin-top: auto; padding-top: var(--space-lg); }
.menu-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-sm);
  width: 100%;
  min-height: var(--control);
  padding: 0 var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-paper-2);
  color: var(--color-ink);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), scale var(--dur-micro) var(--ease-out);
}
.menu-action:hover { background: var(--color-paper-3); }
a.menu-action { text-decoration: none; } /* 中文 / English is a link, the others buttons */
.menu-action:active { scale: var(--press); }

/* ---------- Home: the first screen ---------- */
/* The featured set's name in the display letters on the left, as tall as the
   screen allows, with the start of its description and View set; its cover on
   the right, captioned with why it is shown. The whole hero opens the set. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap-columns);
  align-items: center;
  height: min(calc(100svh - var(--header-height)), 760px);
  min-height: 560px;
  padding-block: var(--space-xl);
}
.hero-text {
  grid-column: 1 / span 5;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
}
.hero-figure {
  grid-column: 6 / -1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  height: 100%;
  margin: 0;
  min-height: 0;
}
.hero-frame {
  position: relative;
  display: block;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--color-paper-2);
}
.hero-image {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale var(--dur-long) var(--ease-out);
}
/* "Featured" or "Latest work", a quiet caption under the cover. */
.hero-label {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.hero-title {
  margin: 0;
  font-size: var(--text-hero);
  line-height: 0.92;
  max-width: 100%;
}
.hero-tagline {
  margin: 0;
  max-width: 40ch;
  color: var(--color-ink-2);
  font-size: var(--text-lead);
  line-height: 1.45;
}
/* The light pill is for photos; beside the text it is the solid one. */
.hero-link.pill-on-photo { background: var(--color-accent); color: var(--color-accent-ink); }
.hero-link.pill-on-photo:hover { background: var(--color-ink-2); }
/* The name and the cover are links to the set too (lib/render.js), each a
   real link of its own: no layer stretched over the hero, which a pressed
   button (it shrinks a little) would pull out from under the pointer. */
.hero-title-link { color: inherit; text-decoration: none; text-decoration-thickness: 3px; text-underline-offset: 0.08em; }
/* Only with a mouse: on phones a tap leaves :hover stuck on what was tapped,
   so after Back the card or photo would still look pointed at. */
@media (hover: hover) {
  .hero-title-link:hover,
  .hero:has(.hero-frame:hover) .hero-title-link { text-decoration: underline; }
}
.hero-title-link:focus-visible { outline-offset: 4px; }
.hero-frame { cursor: pointer; }
.hero-frame:focus-visible { outline-offset: 4px; }

@media (max-width: 899px) {
  .hero { height: auto; min-height: 0; row-gap: var(--space-lg); padding-block: var(--space-md) var(--space-xl); }
  .hero-figure { grid-column: 1 / -1; grid-row: 1; height: auto; }
  .hero-frame { flex: none; aspect-ratio: 4 / 3; max-height: 70svh; }
  .hero-text { grid-column: 1 / -1; grid-row: 2; gap: var(--space-md); }
  .hero-title { font-size: clamp(3.5rem, 15vw, 6rem); }
}
@media (max-width: 599px) {
  .hero-frame { aspect-ratio: 4 / 5; }
}

/* ---------- Home: title, tagline, and category buttons ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md) var(--space-lg);
  margin: var(--space-2xl) 0 var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-ink);
}
.section-head h1,
.section-head h2 { font-size: var(--text-section); }
/* No hero (a category page, or no photos yet): the title is the page's. */
.section-head:first-child { margin-top: var(--space-xl); border-top: 0; padding-top: 0; }
.section-head:first-child h1 { font-size: var(--text-display); }
.site-tagline { margin: var(--space-xs) 0 0; color: var(--color-muted); font-size: var(--text-md); }

/* Pills, 44 px tall; the chosen one is filled in. On phones they stay in one
   row that scrolls sideways. */
.category-nav { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: 0; }
.category-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.category-nav a:hover { border-color: var(--color-ink); }
.category-nav a:active { background: var(--color-paper-2); }
.category-nav a[aria-current="page"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
@media (max-width: 639px) {
  .category-nav {
    flex-wrap: nowrap;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: var(--space-2xs) var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }
}

/* ---------- Home: the sets, as a contact sheet ---------- */
/* Twelve columns in a repeating run of five: one wide and one narrow, then
   three across. Each card in a row is cropped to the same height, so the run
   reads as a magazine spread rather than a row of equal tiles.
   cardSizes() in lib/render.js repeats these widths, so the browser can pick
   the right image file: change both together. */
.set-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap-columns);
  row-gap: var(--space-2xl);
}
.set-grid > li { grid-column: span 4; min-width: 0; }
.set-grid > li:nth-child(5n + 1) { grid-column: span 7; }
.set-grid > li:nth-child(5n + 2) { grid-column: span 5; }
.set-grid > li:nth-child(5n + 1) .set-card-image { aspect-ratio: 3 / 2; }
.set-grid > li:nth-child(5n + 2) .set-card-image { aspect-ratio: 1.063; } /* the same height as the wide card beside it */
/* A run that ends early: a lone wide card takes the full width; two left over
   in the three-across row share it. */
.set-grid > li:nth-child(5n + 1):last-child { grid-column: 1 / -1; }
.set-grid > li:nth-child(5n + 1):last-child .set-card-image { aspect-ratio: 21 / 9; }
.set-grid > li:nth-child(5n + 3):last-child { grid-column: 1 / -1; }
.set-grid > li:nth-child(5n + 3):last-child .set-card-image { aspect-ratio: 21 / 9; }
.set-grid > li:nth-child(5n + 3):nth-last-child(2),
.set-grid > li:nth-child(5n + 4):last-child { grid-column: span 6; }
.set-grid > li:nth-child(5n + 3):nth-last-child(2) .set-card-image,
.set-grid > li:nth-child(5n + 4):last-child .set-card-image { aspect-ratio: 4 / 3; }
@media (max-width: 1023px) {
  .set-grid > li,
  .set-grid > li:nth-child(n) { grid-column: span 6; }
  .set-grid > li:nth-child(n) .set-card-image { aspect-ratio: 4 / 3; }
  .set-grid > li:nth-child(odd):last-child { grid-column: 1 / -1; }
  .set-grid > li:nth-child(odd):last-child .set-card-image { aspect-ratio: 16 / 9; }
}
@media (max-width: 639px) {
  .set-grid { row-gap: var(--space-xl); }
  .set-grid > li:nth-child(n) { grid-column: 1 / -1; }
  .set-grid > li:nth-child(n) .set-card-image { aspect-ratio: 4 / 3; }
}

/* Each card: the cover, square-cornered, then the name in the display letters
   and the facts in a quiet row under it. */
.set-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  color: var(--color-ink);
  text-decoration: none;
}
.set-card-image {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-paper-2);
}
.set-card img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop to fill the box instead of stretching */
  transition: scale var(--dur-long) var(--ease-out);
}
/* Pointing at a cover zooms it in slightly, inside its frame. Mouse only:
   phones have no hover, and a tap would leave it stuck zoomed. */
@media (hover: hover) {
  .set-card:hover img,
  .hero-frame:hover .hero-image { scale: 1.03; }
}
.set-card-text { display: flex; flex-direction: column; gap: var(--space-xs); }
.set-card h2,
.set-card h3 {
  margin: 0;
  font-size: var(--text-title);
  text-underline-offset: 0.1em;
  text-decoration-thickness: 2px;
}
@media (hover: hover) { /* see .hero-title-link */
  .set-card:hover h2,
  .set-card:hover h3 { text-decoration: underline; }
}
.set-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- Set page ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 44px; /* a tall enough tap area for fingers */
  margin-top: var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}
.back-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.back-link:hover { color: var(--color-ink); }

/* The heading block, on twelve columns: the name across the first eight,
   Share at the right; the facts and the description below, the facts in a
   narrow column of their own beside the description. */
.set-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0 var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-ink);
}
.set-heading h1 {
  margin: 0;
  max-width: 14ch;
  font-size: var(--text-display);
}
.share-button { flex-shrink: 0; }
.set-location {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-lg);
  margin: 0 0 var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.set-description {
  max-width: 60ch;
  margin: 0;
  color: var(--color-ink-2);
  font-size: var(--text-lead);
  line-height: 1.5;
  white-space: pre-line; /* keep the line breaks you typed */
}
@media (min-width: 900px) {
  /* The facts sit in the first three columns, the description beside them. */
  main:has(> .set-location) { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-content: start; }
  main:has(> .set-location) > * { grid-column: 1 / -1; min-width: 0; }
  main:has(> .set-location) > .set-location { grid-column: 1 / span 3; flex-direction: column; margin: 0; }
  main:has(> .set-location) > .set-description { grid-column: 4 / span 7; grid-row: auto; }
  main:has(> .set-location) > .set-location + .set-description { margin-top: 0; }
  main:has(> .set-location) > .back-link { justify-self: start; }
}

/* Justified rows: every photo in a row gets the same height, and each keeps
   its own shape (portrait stays tall, landscape stays wide).

   The shape comes from --ratio (width / height), which the server writes from
   the database. Because the space for each photo is decided by that number
   alone, nothing moves when the images finish loading.

   How the trick works: each photo starts at a width proportional to its ratio
   (flex-basis) and grows by the same proportion (flex-grow). Growing every photo
   in a row by the same factor keeps their heights equal. */
.photo-grid {
  list-style: none;
  margin: var(--space-2xl) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  --row-height: 300px;
}
/* An invisible last item that soaks up the leftover space in the final row,
   so the last few photos are not stretched to fill the whole width. */
.photo-grid::after {
  content: "";
  flex-grow: 1000;
}
.photo-grid li {
  flex-grow: var(--ratio);
  flex-basis: calc(var(--ratio) * var(--row-height));
}
.photo-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio);
  object-fit: cover;
  border-radius: var(--radius-photo);
  background: var(--color-paper-2);
}
@media (min-width: 1400px) { .photo-grid { --row-height: 340px; } }
@media (max-width: 600px) {
  .photo-grid { --row-height: 160px; gap: var(--space-2xs); margin-top: var(--space-xl); }
}

/* ---------- Find my photos (set page, js/set.js) ---------- */
/* A pill-shaped number box with suggestions under it, "My favorites" beside it,
   and a quiet line saying what is shown. */
.photo-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-sm) var(--space-md); margin-top: var(--space-xl); }
.number-search { display: flex; flex-direction: column; gap: var(--space-2xs); }
.photo-filter-label { margin: 0; color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; }
.photo-filter-status { flex-basis: 100%; margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.photo-filter-status:empty { display: none; }
.photo-filter + .photo-grid { margin-top: var(--space-lg); }
/* The Sports page: one number search over every sports set (js/sports-search.js). */
.section-head + .photo-filter { margin-top: 0; margin-bottom: var(--space-lg); }
.number-results { display: grid; gap: var(--space-xl); }
.number-group-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-xs); margin: 0 0 var(--space-sm); font-size: var(--text-md); }
.number-group-title a { color: inherit; }
.number-group-count { color: var(--color-muted); font-size: var(--text-sm); font-weight: 400; }
.number-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-xs); margin: 0; padding: 0; list-style: none; }
.number-photos img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--color-paper-2); }
@media (max-width: 600px) { .number-photos { grid-template-columns: repeat(3, 1fr); } }
.number-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
  min-height: var(--control);
  padding: 0 var(--space-2xs) 0 var(--space-md);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  transition: border-color var(--dur-micro) var(--ease-out);
}
.number-field:focus-within { border-color: var(--color-ink); }
.number-field:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.number-field input:focus-visible { outline: none; } /* the ring is on the whole pill instead */
.number-hash { color: var(--color-muted); font-weight: 500; }
.number-field input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 var(--space-2xs);
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 1rem; /* 16px: iPhones zoom into smaller text boxes */
  font-variant-numeric: tabular-nums;
  outline: none;
}
.number-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-muted);
}
.number-clear:hover { background: var(--color-paper-2); color: var(--color-ink); }
.number-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* The suggestions: the share menu's look, dropping in from the box. */
.number-options {
  position: absolute;
  top: calc(100% + var(--space-2xs));
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  max-height: 264px;
  margin: 0;
  padding: var(--space-2xs);
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--color-rule-strong);
  background: var(--color-paper);
  transform-origin: top center;
  transition: opacity var(--dur-short) var(--ease-out), translate var(--dur-short) var(--ease-out);
}
@starting-style { .number-options { opacity: 0; translate: 0 -4px; } }
.number-options li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.number-options li[aria-selected="true"] { background: var(--color-paper-2); }
@media (hover: hover) { .number-options li:hover { background: var(--color-paper-2); } }
.number-count { color: var(--color-muted); font-size: var(--text-sm); font-weight: 400; }
/* Appears with the first heart: a short fade, like the suggestions. */
.favorites-toggle { transition: opacity var(--dur-short) var(--ease-out), scale var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
@starting-style { .favorites-toggle { opacity: 0; } }
.favorites-toggle[aria-pressed="true"] { background: var(--color-accent); color: var(--color-accent-ink); }
.favorites-toggle[aria-pressed="true"]:hover { background: var(--color-ink-2); }

/* ---------- Tappable photos ---------- */
.thumb-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-photo);
  overflow: hidden;
  background: var(--color-paper-2);
  cursor: zoom-in;
}
.thumb-button img { transition: opacity var(--dur-micro) var(--ease-out), scale var(--dur-long) var(--ease-out); }
@media (hover: hover) { .thumb-button:hover img { opacity: 0.88; scale: 1.015; } } /* see .hero-title-link */
.thumb-button:focus-visible { outline-offset: 3px; }

/* ---------- Licensed downloads ---------- */
/* A ruled band across the page: the heading and help text at the left, the
   code box and Unlock at the right. */
.license-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg) var(--space-xl);
  margin: var(--space-3xl) 0 0;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-ink);
  border-bottom: 1px solid var(--color-rule);
}
.license-text { flex: 1 1 320px; max-width: 56ch; }
.license-panel h2 {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1;
}
.license-panel .muted { margin: 0; }
/* Unlocked: the heading says so, and a check sits before it. */
.license-panel.unlocked h2::before { content: "\2713\00a0"; color: var(--color-success); }
.license-form-area { display: flex; flex-direction: column; gap: var(--space-2xs); }
.license-panel .inline-form { max-width: none; align-items: flex-end; flex-wrap: wrap; }
.license-panel label { font-size: var(--text-sm); font-weight: 500; }
.license-field { display: flex; flex-direction: column; gap: var(--space-2xs); }
.license-panel input {
  width: 280px;
  max-width: 100%;
  height: var(--control);
  min-height: var(--control);
  padding: 0 var(--space-md);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.license-panel input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.license-panel .form-error { min-height: 0; }
.license-panel .form-error:empty { display: none; }
@media (max-width: 639px) {
  .license-field { flex: 1 1 100%; }
  .license-panel input { width: 100%; }
}
.license-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); margin-top: var(--space-sm); }

/* ---------- Related sets ---------- */
.related-sets { margin: var(--space-4xl) 0 0; }
.related-sets h2 { margin: 0 0 var(--space-xl); font-size: var(--text-section); }
/* Four across on computers, two below that, one on small phones. */
.set-grid.related-grid { row-gap: var(--space-xl); }
.set-grid.related-grid > li:nth-child(n) { grid-column: span 3; }
.set-grid.related-grid > li:nth-child(n) .set-card-image { aspect-ratio: 4 / 5; }
.related-grid .set-card h3 { font-size: var(--text-xl); }
@media (max-width: 1023px) { .set-grid.related-grid > li:nth-child(n) { grid-column: span 6; } }
@media (max-width: 479px) { .set-grid.related-grid > li:nth-child(n) { grid-column: 1 / -1; } }

/* ---------- About page ---------- */
/* The sitter: the portrait in the first five columns, staying in view; the
   name set large, the bio, then gear and contact as ruled rows. */
.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap-columns);
  align-items: start;
  padding-top: var(--space-xl);
}
.about-portrait {
  grid-column: 1 / span 5;
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
}
.about-portrait img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-paper-2);
}
.about-text { grid-column: 7 / -1; min-width: 0; }
/* The text-only layout when there is no portrait yet. */
.about:not(:has(.about-portrait)) .about-text { grid-column: 1 / span 9; }
.about h1 { margin: 0 0 var(--space-xl); font-size: var(--text-display); max-width: none; }
.about-bio { max-width: 60ch; color: var(--color-ink-2); font-size: var(--text-lead); }
.about-bio p { margin: 0 0 var(--space-md); line-height: 1.65; }
.about h2 {
  margin: var(--space-2xl) 0 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-ink);
  font-size: var(--text-md);
  font-weight: 600;
}
.about-contact,
.about-gear { list-style: none; margin: 0; padding: 0; }

/* ---------- Map (map.html, js/map.js) ---------- */
/* The map fills the measure; each set is its cover in a round frame. Sets
   shown only as a rough area get a soft ink circle instead. */
.map-page { padding-top: var(--space-2xl); }
.map-page h1 { margin: 0 0 var(--space-sm); font-size: var(--text-display); }
.map-lead { max-width: 60ch; margin: 0 0 var(--space-xl); color: var(--color-ink-2); font-size: var(--text-lead); }
.map { height: min(70svh, 640px); background: var(--color-paper-2); }
.map-list-heading { margin: var(--space-2xl) 0 var(--space-sm); font-size: var(--text-md); font-weight: 600; }
.map-list { margin: 0; padding: 0; list-style: none; }
.map-list li { padding: var(--space-xs) 0; border-top: 1px solid var(--color-rule); }
.map-pin {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid var(--color-paper);
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-paper-2);
  box-shadow: 0 2px 8px var(--color-scrim);
  transition: scale var(--dur-micro) var(--ease-out);
}
.map-pin img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) { .map-pin:hover { scale: 1.08; } }
.map-pin-area { border-style: dashed; }
/* Several sets in one place: a count on the pin, and a scrollable list.
   (".map-choices .map-choice": over Leaflet's own link colour.) */
.map-pin-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  pointer-events: none;
}
.map-choices { max-height: 264px; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.map-choices li + li { border-top: 1px solid var(--color-rule); }
.map-choices .map-choice { display: grid; grid-template-columns: 56px 1fr; column-gap: var(--space-xs); align-items: center; padding: var(--space-2xs) 0; color: inherit; text-decoration: none; }
.map-choice img { grid-row: span 2; width: 56px; height: 56px; object-fit: cover; }
.map-choice-title { font-weight: 600; }
.map-choice-facts { color: var(--color-muted); font-size: var(--text-sm); }
@media (hover: hover) { .map-choice:hover .map-choice-title { text-decoration: underline; } }
.map-area { fill: var(--color-ink); fill-opacity: 0.15; stroke: var(--color-ink); stroke-width: 1.5; }
.map-card { display: grid; gap: var(--space-2xs); }
.map-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.leaflet-popup-content .map-card p { margin: 0; } /* over Leaflet's own paragraph spacing */
.map-card-title { padding-top: var(--space-2xs); font-weight: 600; font-size: var(--text-md); }
.map-card-facts { padding-bottom: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); }
.map-card .pill { justify-self: start; min-height: 40px; color: var(--color-accent-ink); }
/* Leaflet's own popup in the site's colours. */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip { background: var(--color-paper); color: var(--color-ink); border-radius: 0; }
.leaflet-popup-content { margin: var(--space-sm); font: inherit; }
.leaflet-container { font: inherit; }
.leaflet-bar a { background: var(--color-paper); color: var(--color-ink); border-color: var(--color-rule); }
.leaflet-bar a:hover { background: var(--color-paper-2); }
.leaflet-container a.leaflet-popup-close-button { color: var(--color-muted); }
/* Dark mode: the map pictures are drawn light, so they are dimmed and turned
   round to match (the covers on the pins are left alone). */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
}

/* Admin: the Map choices under Set details. */
.map-precision { display: grid; gap: var(--space-2xs); margin-top: var(--space-xs); }

/* ---------- What's new (updates.html) ---------- */
/* A dated list, newest first, each entry ruled off like the About rows. */
.updates { padding-top: var(--space-2xl); }
.updates h1 { margin: 0 0 var(--space-sm); font-size: var(--text-display); }
.updates-lead { max-width: 60ch; margin: 0 0 var(--space-2xl); color: var(--color-ink-2); font-size: var(--text-lead); }
.updates-list { max-width: 60ch; margin: 0; padding: 0; list-style: none; }
.updates-list li { padding: var(--space-lg) 0; border-top: 1px solid var(--color-rule); }
.updates-date { margin: 0 0 var(--space-2xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; }
.updates-list h2 { margin: 0 0 var(--space-xs); font-size: var(--text-md); font-weight: 600; }
.updates-list p:last-child { margin: 0; color: var(--color-ink-2); line-height: 1.6; }
.about-contact li,
.about-gear li {
  display: grid;
  grid-template-columns: minmax(96px, 30%) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: baseline;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-rule);
  overflow-wrap: anywhere;
}
.about-gear li > span:only-child { grid-column: 1 / -1; }
.contact-label { color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; }
@media (max-width: 899px) {
  .about { padding-top: var(--space-md); row-gap: var(--space-xl); }
  .about-portrait { grid-column: 1 / -1; position: static; }
  .about-text,
  .about:not(:has(.about-portrait)) .about-text { grid-column: 1 / -1; }
}

/* ---------- Not found page ---------- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  min-height: 60svh;
  padding-top: var(--space-2xl);
}
/* Decoration only ("Page not found" says it), so it is drawn here and not
   part of the page text. The second line hides it from screen readers. */
.not-found-code {
  margin: 0;
  color: var(--color-rule-strong);
  font-family: var(--font-display);
  font-size: clamp(8rem, 20vw, 18rem);
  font-weight: 400;
  line-height: 0.85;
}
.not-found-code::before { content: "404"; content: "404" / ""; }
.not-found h1 { font-size: var(--text-section); }
.not-found p { margin: 0; }
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control);
  padding: 0 var(--space-lg);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-micro) var(--ease-out), scale var(--dur-micro) var(--ease-out);
}
.button-link:hover { background: var(--color-ink-2); }
.button-link:active { scale: var(--press); }

/* ---------- Footer: a colophon on every page ---------- */
/* "Get in touch" set large over the contact rows, then the © line. */
.site-footer {
  margin-top: var(--space-3xl);
  padding-block: var(--space-xl) var(--space-xl);
  border-top: 1px solid var(--color-ink);
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.site-footer:not(:empty) { display: grid; gap: var(--space-2xl); }
.footer-contact {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap-columns);
  row-gap: var(--space-lg);
  align-items: start;
}
.footer-heading {
  grid-column: 1 / span 5;
  margin: 0;
  color: var(--color-ink);
  font-size: var(--text-section);
}
.footer-links {
  grid-column: 7 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-md);
}
.footer-links li {
  display: grid;
  grid-template-columns: minmax(96px, 30%) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: baseline;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-rule);
}
.footer-links li:first-child { padding-top: 0; }
.footer-links a { color: var(--color-ink); font-weight: 500; overflow-wrap: anywhere; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links .contact-label { min-width: 0; }
@media (max-width: 899px) {
  .footer-heading,
  .footer-links { grid-column: 1 / -1; }
}
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-lg); }
.footer-copy { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); margin: 0; font-weight: 500; }
.footer-name { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; line-height: 1; color: var(--color-ink); }
.footer-top {
  display: inline-block;
  padding: var(--space-sm) 0;
  margin: calc(-1 * var(--space-sm)) 0;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.footer-top:hover { color: var(--color-ink); text-decoration: underline; }
.footer-end { display: flex; flex-wrap: wrap; gap: var(--space-lg); }

/* ---------- Full-screen viewer ---------- */
.no-scroll { overflow: hidden; }
/* The spoken "Photo 2 of 5" (set.html) stays inside the viewer, so the viewer
   never gets a few pixels to scroll. */
#lightbox-status { top: 0; left: 0; margin: 0; }

.lightbox {
  /* <dialog> has a default box; make it cover the whole screen instead. */
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  width: 100%;
  height: 100%;
  height: 100dvh; /* correct on phones, where the address bar comes and goes */
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-night);
  color: var(--color-night-ink);
  /* Let our code see horizontal swipes, but keep two-finger pinch zoom working. */
  touch-action: pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  /* Fades in and out instead of appearing at once. While it fades out, it
     keeps covering the screen, in Safari too (see .site-menu). */
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease-out), overlay var(--dur-exit) allow-discrete, display var(--dur-exit) allow-discrete;
}
.lightbox[open] { opacity: 1; transition-duration: var(--dur-short); }
@starting-style { .lightbox[open] { opacity: 0; } }
.lightbox::backdrop {
  background: var(--color-night);
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease-out), overlay var(--dur-exit) allow-discrete, display var(--dur-exit) allow-discrete;
}
.lightbox[open]::backdrop { opacity: 1; transition-duration: var(--dur-short); }
@starting-style { .lightbox[open]::backdrop { opacity: 0; } }

.lightbox-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Room for the counter at the top and the Like / Share bar and caption at
     the bottom, without covering the photo. */
  padding: var(--space-xl) 0 140px;
}
/* "contain" = as big as possible while showing the whole photo. */
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  -webkit-touch-callout: none; /* no "Save Image" pop-up on long press in iOS Safari */
  /* Its final size from the start (lightbox.js sets --ratio and --w from the
     photo), so it does not grow when the sharper file arrives. */
  aspect-ratio: var(--ratio);
  width: min(100%, var(--w), calc((100dvh - 172px) * var(--ratio)));
  height: auto;
  /* Under the photo, its tiny blurry preview, until the picture is drawn. */
  background: var(--ph, none) center / cover no-repeat;
  /* Springs back after a swipe that was too short (see lightbox.js). */
  transition: transform var(--dur-short) var(--ease-out);
}
.lightbox-counter {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: var(--space-md);
  color: var(--color-night-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
/* Under the photo: the action bar (Like, Share, Download), then the caption.
   The same place on phones and computers, centred, easy to find. */
.lightbox-bottom {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(var(--color-scrim-none), var(--color-scrim));
}
.lightbox-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs); }
.lightbox-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 44px;
  padding: 0 var(--space-md);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-night-2);
  color: var(--color-night-ink);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.lightbox-action:hover { background: var(--color-night-3); }
.lightbox-action:active { scale: var(--press); }
.lightbox-action svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Liked: the heart fills (and pops, js/set.js). */
.lightbox-heart svg { transition: fill var(--dur-micro) var(--ease-out); }
.lightbox-heart[aria-pressed="true"] svg { fill: currentColor; }
.lightbox-info p { margin: 0; }
.lightbox-camera {
  margin-top: var(--space-3xs) !important;
  color: var(--color-night-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.lightbox-button {
  position: absolute;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-night-2);
  color: var(--color-night-ink);
  line-height: 1;
  cursor: pointer;
}
.lightbox-button:hover { background: var(--color-night-3); }
.lightbox-button:active { background: var(--color-night-3); scale: var(--press-small); }
.lightbox-button svg {
  display: block;
  margin: auto;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightbox-close { top: var(--space-2xs); right: var(--space-xs); }
.lightbox-prev,
.lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: var(--space-sm); }
.lightbox-next { right: var(--space-sm); }
/* Download, once a license code is entered: the solid one in the bar. */
.lightbox-download { background: var(--color-night-ink); color: var(--color-night); }
.lightbox-download:hover { background: var(--color-night-ink-2); }
/* The viewer's buttons and words. While a finger drags the photo down to
   close it, they step aside, so only the photo moves (lightbox.js). */
.lightbox-button,
.lightbox-action,
.lightbox-counter,
.lightbox-bottom {
  transition: opacity var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), scale var(--dur-micro) var(--ease-out);
}
.lightbox[data-dragging] :is(.lightbox-button, .lightbox-counter, .lightbox-bottom) { opacity: 0; }

/* On phones, swiping replaces the arrows, so they stop covering the photo.
   They are only hidden from sight: screen readers still find them. */
@media (hover: none) and (pointer: coarse) {
  .lightbox-prev,
  .lightbox-next {
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
/* Computers and tablets: the photo gets a frame of dark space and the counter
   sits in the middle at the top. */
@media (min-width: 700px) {
  .lightbox-stage { padding: 72px 88px 148px; }
  .lightbox-stage img { width: min(100%, var(--w), calc((100dvh - 220px) * var(--ratio))); }
  .lightbox-counter { left: 50%; transform: translateX(-50%); padding: var(--space-lg) var(--space-md); }
  .lightbox-close { top: var(--space-sm); right: var(--space-lg); }
  .lightbox-prev { left: var(--space-lg); }
  .lightbox-next { right: var(--space-lg); }
  .lightbox-bottom { padding-bottom: var(--space-lg); background: none; }
}

/* A thin line along the top while the full-size photo downloads. It only
   appears after half a second, so quick loads show nothing at all. */
.lightbox::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 30%;
  height: 2px;
  background: var(--color-loading);
  opacity: 0;
  pointer-events: none;
}
.lightbox[data-state="loading"]::after { animation: viewer-loading 1.1s ease-in-out 0.5s infinite; }
@keyframes viewer-loading {
  0% { opacity: 1; transform: translateX(-100%); }
  100% { opacity: 1; transform: translateX(340%); }
}
.lightbox-problem {
  position: absolute;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  background: var(--color-scrim);
  color: var(--color-night-ink);
  font-size: var(--text-sm);
  white-space: nowrap;
}
.lightbox-problem button {
  margin-left: var(--space-xs);
  padding: var(--space-2xs) var(--space-sm);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-night-ink);
  color: var(--color-night);
  font-size: var(--text-sm);
  cursor: pointer;
}

/* ---------- Share buttons and menu (see js/share.js) ---------- */
.share-button svg,
.share-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.share-menu {
  position: absolute;
  z-index: var(--z-dropdown);
  min-width: 220px;
  padding: var(--space-xs);
  background: var(--color-paper);
  border: 1px solid var(--color-rule-strong);
  /* Arrives from its button (it opens under it, at the right): a short fade
     and drop. Closing simply removes it. */
  transform-origin: top right;
  transition: opacity var(--dur-short) var(--ease-out), translate var(--dur-short) var(--ease-out);
}
@starting-style { .share-menu { opacity: 0; translate: 0 -4px; } }
.share-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.share-item:hover,
.share-item:focus-visible { background: var(--color-paper-2); outline: none; }
.share-item:focus-visible { box-shadow: inset 0 0 0 2px var(--color-focus); }
.share-item:active { background: var(--color-paper-3); }
/* After a click or tap the first item gets focus too; no highlight for that. */
html[data-pointer] .share-item:focus-visible:not(:hover) { background: none; box-shadow: none; }

/* The Share button shows before the page is first drawn, so the photos below
   it never jump down. Without scripts it stays hidden (theme.js sets data-js). */
html:not([data-js]) [data-share] { display: none; }

/* ---------- Light / dark switch (see js/theme.js) ---------- */
/* Two of them: the round one in the header and the full row in the menu. */
.theme-toggle .icon-moon { fill: none; stroke: currentColor; }
/* Show the moon in light mode (tap for dark), the sun in dark mode. */
.theme-toggle[data-showing="light"] .icon-sun,
.theme-toggle[data-showing="dark"] .icon-moon { display: none; }
/* Switching light and dark mode changes every color at once (theme.js). */
.theme-switching * { transition: none !important; }

/* ---------- Draft preview banner (public set page) ---------- */
.draft-banner {
  margin: var(--space-md) 0 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-note-bg);
  color: var(--color-note-ink);
}

/* ---------- Photo protection (see js/protect.js) ----------
   iPhones and iPads ignore the script for long presses, so this does it:
   -webkit-touch-callout: none   no "Save to Photos / Copy / Share" pop-up
   user-select: none             a long press does not select the picture
   -webkit-user-drag: none       the picture cannot be dragged out (Safari)
   For pictures inside a link or button (grid thumbnails, cards), the picture
   also ignores touches entirely (pointer-events: none): a long press then
   lands on the button or link around it, which has no "Save Image" option. */
main img,
.lightbox img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.thumb-button img,
.set-card img,
.hero img { pointer-events: none; }
.thumb-button,
.set-card,
.hero {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- Blurry previews ---------- */
/* While a photo loads, a tiny version of it (an 8 px color grid, written into
   the page) is shown blurred in its place, so the page fills with soft color at
   once. The real photo then fades in on top (theme.js marks it "is-loaded").
   Without JavaScript, photos simply appear as they load. */
.placeholder {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.placeholder::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--space-md)); /* the blur fades at the edges; keep that outside the box */
  background: var(--ph) center / cover no-repeat;
  filter: blur(14px) saturate(1.15);
}
/* The photo sits above its preview. */
.thumb-button img { position: relative; }
.set-card-image .placeholder { z-index: 0; }
html[data-js] img.fade:not(.is-loaded) { opacity: 0; }
html[data-js] img.fade.is-loaded { animation: photo-in var(--dur-long) var(--ease-out); }
@keyframes photo-in { from { opacity: 0; } }
/* A photo that could not load: keep its preview, not a broken-image icon. */
html[data-js] img.fade.is-broken { visibility: hidden; }

/* ---------- Smooth page changes ---------- */
/* Browsers that support it fade from one page to the next instead of flashing
   white, while the header stays still. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out var(--dur-exit) var(--ease-out) both; }
::view-transition-new(root) { animation: page-in var(--dur-short) var(--ease-out) both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

/* Links to a place on the same page ("Contact", "Back to top") glide there. */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* ---------- Grow and shrink between grid and viewer ---------- */
/* js/lightbox.js names the two pictures "photo" for a moment; the browser
   moves and resizes one into the other. Meanwhile the page and the dark viewer
   simply cross-fade, and the viewer's own fade is switched off. */
::view-transition-group(photo) {
  animation-duration: 0.36s;
  animation-timing-function: var(--ease-slide);
}
::view-transition-old(photo),
::view-transition-new(photo) {
  animation-duration: 0.36s;
  height: 100%; /* both pictures have the photo's own shape: no squashing */
}
html.photo-transition::view-transition-old(root) { animation: viewer-fade-out 0.3s var(--ease-out) both; }
html.photo-transition::view-transition-new(root) { animation: viewer-fade-in 0.3s var(--ease-out) both; }
@keyframes viewer-fade-out { to { opacity: 0; } }
@keyframes viewer-fade-in { from { opacity: 0; } }
html.photo-transition .lightbox,
html.photo-transition .lightbox::backdrop { transition: none; }
/* The header keeps its own name for page changes; not during this one. */
html.photo-transition .site-header { view-transition-name: none; }

/* "Skip to content": the first thing a keyboard user reaches; hidden until then. */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: var(--space-xs);
  z-index: var(--z-modal);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

/* Visitors who ask their device for less motion get none of this movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root), ::view-transition-new(root),
  ::view-transition-group(photo), ::view-transition-old(photo), ::view-transition-new(photo) { animation: none; }
  .site-menu, .site-menu::backdrop, .lightbox, .lightbox::backdrop, .lightbox-stage img,
  .pill, .round-button, .button-link, .thumb-button img, .set-card img, .hero-image, .menu-close, .menu-action, .share-menu, .lang-switch,
  .lightbox-button, .lightbox-action, .lightbox-counter, .lightbox-bottom, button, .icon-button,
  .menu-section::details-content, .menu-section > ul, .menu-chevron, .number-options, .favorites-toggle,
  .fold::details-content, .card-more::details-content, .fold-body, .fold-chevron,
  .lightbox-heart svg, .map-pin { transition: none; }
  .map-pin:hover { scale: none; }
  :is(.pill, .round-button, .button-link, .menu-close, .menu-action, .lightbox-button, .lightbox-action, button):active,
  .set-card:hover img, .hero-frame:hover .hero-image, .thumb-button:hover img { scale: none; }
  html[data-js] img.fade.is-loaded,
  .lightbox[data-state="loading"]::after { animation: none; }
}


/* ==========================================================================
   Admin
   A tool, not a page: one family (Inter) for everything but the page title,
   controls 40 px tall, ruled panels, tables before cards. The ink marks the
   main action; the state colors mark drafts, schedules and the chosen cover.
   ========================================================================== */

/* The bar at the top of every admin screen: the name at the left, the
   screens and Log out at the right, wrapping under it on a phone. */
.admin-header {
  flex-wrap: wrap;
  max-width: 1200px;
  padding-block: var(--space-md);
}
.admin-header .site-name { font-size: 1.75rem; }
.admin-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-lg);
  font-size: var(--text-sm);
  font-weight: 500;
}
.admin-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-app);
  text-decoration: none;
  white-space: nowrap;
  text-underline-offset: 6px;
}
.admin-header nav a:hover { text-decoration: underline; }
.admin-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.admin-header .round-button { background: var(--color-paper-2); }
.admin-header .round-button:hover { background: var(--color-paper-3); }

/* Admin screens share one narrower measure than the public pages. */
.admin-header + main,
.admin-header ~ main { max-width: 1200px; padding-top: var(--space-xl); }
.admin-header ~ main > h1,
main.login > h1 { margin: 0 0 var(--space-xl); font-size: var(--text-3xl); line-height: 1; }
.admin-header ~ main h1#set-title { font-size: var(--text-3xl); }
.admin-header ~ main > section,
.admin-header ~ main > form { margin: 0 0 var(--space-xl); }
.admin-header ~ main h2 { margin: 0 0 var(--space-sm); font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
.admin-header ~ main p { max-width: 70ch; }

/* ---------- Admin controls ---------- */
/* Buttons: solid ink by default, 40 px tall, pill-shaped like the public
   ones. Secondary is an outline; danger is red text that fills on hover. */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--control-app);
  padding: 0 var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), scale var(--dur-micro) var(--ease-out);
}
button:hover { background: var(--color-ink-2); }
button:active { scale: var(--press); }
/* Three channels: a gray fill, gray text, and the "not allowed" pointer, on
   top of the disabled attribute itself. */
button:disabled,
button:disabled:hover {
  background: var(--color-paper-3);
  border-color: transparent;
  color: var(--color-muted);
  cursor: not-allowed;
  scale: none;
}
.button-secondary {
  background: transparent;
  border-color: var(--color-rule-strong);
  color: var(--color-ink);
}
.button-secondary:hover { background: var(--color-paper-2); border-color: var(--color-ink); }
a.button-link.button-secondary { min-height: var(--control-app); padding: 0 var(--space-md); border: 1px solid var(--color-rule-strong); }
a.button-link.button-secondary:hover { border-color: var(--color-ink); }
.button-danger {
  min-height: 32px;
  padding: 0 var(--space-sm);
  background: transparent;
  border-color: currentColor;
  color: var(--color-error);
  font-size: var(--text-sm);
}
.button-danger:hover { background: var(--color-error); border-color: var(--color-error); color: var(--color-paper); }
.icon-button {
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border-color: var(--color-rule-strong);
  color: var(--color-ink);
  line-height: 1;
}
.icon-button:hover { background: var(--color-paper-2); border-color: var(--color-ink); }
.icon-button.active { color: var(--color-highlight-ink); background: var(--color-highlight); border-color: var(--color-highlight); }
.icon-button.danger { color: var(--color-error); }
.icon-button.danger:hover { background: var(--color-error); border-color: var(--color-error); color: var(--color-paper); }
/* A label that opens a file picker, styled as the main button. */
.button-like {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-app);
  padding: 0 var(--space-md);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.button-like:hover { background: var(--color-ink-2); }
.button-like:has(+ input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* Fields: 40 px, a constant 1 px edge in the muted gray (dark enough to see),
   and the focus outline outside it, so nothing shifts between states. */
input,
textarea,
select {
  min-height: var(--control-app);
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius-field);
  background: var(--color-paper);
  color: var(--color-ink);
  font: inherit;
}
textarea {
  width: 100%;
  max-width: 600px;
  padding: var(--space-xs) var(--space-sm);
  line-height: 1.5;
}
input:hover,
textarea:hover,
select:hover { border-color: var(--color-ink); }
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
input:disabled,
textarea:disabled,
select:disabled { background: var(--color-paper-2); color: var(--color-muted); border-color: var(--color-rule-strong); cursor: not-allowed; }
input[aria-invalid="true"] { border-color: var(--color-error); }
input[type="checkbox"],
input[type="radio"] { min-height: 0; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--color-accent); flex-shrink: 0; }
input[type="file"] { min-height: 0; padding: 0; border: 0; }
progress { width: 100%; height: 6px; accent-color: var(--color-accent); }

.form-error { margin: var(--space-2xs) 0 0; min-height: 1.5em; color: var(--color-error); font-size: var(--text-sm); }
.save-status { font-size: var(--text-sm); color: var(--color-success); }
.save-status[data-state="error"] { color: var(--color-error); }
.small { margin: var(--space-2xs) 0 var(--space-sm); font-size: var(--text-sm); }

/* ---------- Admin: layout pieces ---------- */
/* A panel: a ruled box on the paper. Never one inside another. */
/* Folding panels (js/admin-chrome.js): the heading row opens and closes the
   panel; the chevron turns. */
.fold-head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
  cursor: pointer;
}
.fold-head::-webkit-details-marker { display: none; }
.admin-header ~ main .fold-head h2 { margin: 0; }
.fold-head:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.fold-chevron {
  width: 20px;
  height: 20px;
  margin-left: auto;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--color-muted);
  transition: rotate var(--dur-short) var(--ease-out);
}
.fold-body { padding-top: var(--space-md); }
/* A photo card's caption, camera and alt text, folded under "More". */
.card-more > summary { color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; cursor: pointer; }
.card-more > summary:hover { color: var(--color-ink); }
.card-more[open] > summary { margin-bottom: var(--space-xs); }
.card-more .photo-card-field { margin-top: var(--space-xs); }
.panel {
  margin: 0 0 var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-paper);
  border: 1px solid var(--color-rule);
}
:is(.panel, .panel > .fold > .fold-body) > label:not(.drop-zone):not(.checkbox) { display: block; margin-bottom: var(--space-2xs); font-size: var(--text-sm); font-weight: 500; }
:is(.panel, .panel > .fold > .fold-body) > label.checkbox,
.checkbox { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-sm); }
.panel input[type="text"],
.panel input[type="email"],
.panel input[type="url"],
.panel input[type="tel"] { display: block; width: 100%; max-width: 420px; margin-bottom: var(--space-md); }
.panel textarea { margin-bottom: var(--space-md); }
.panel select { display: block; width: 100%; max-width: 420px; margin-bottom: var(--space-md); }
.panel input[type="date"],
.panel input[type="number"] { display: block; max-width: 220px; margin-bottom: var(--space-md); }
.panel input[type="datetime-local"] { margin-bottom: var(--space-sm); }
.panel h2 + label { margin-top: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin: var(--space-md) 0; }
.actions .save-status { align-self: center; }
.inline-form { display: flex; gap: var(--space-xs); max-width: 520px; }
.inline-form input { flex: 1; min-width: 0; }

/* Radio and checkbox groups. */
.wm-style,
.category-picker { border: 0; padding: 0; margin: 0 0 var(--space-md); min-width: 0; }
.wm-style legend,
.category-picker legend { margin-bottom: var(--space-xs); font-size: var(--text-sm); font-weight: 500; }
.wm-style .checkbox { margin-bottom: var(--space-xs); }
.category-picker .checkbox { display: inline-flex !important; margin: 0 var(--space-md) var(--space-xs) 0 !important; }
.month-boxes { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); }
.month-boxes .checkbox { display: inline-flex !important; margin: 0 !important; }
.set-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-2xs) var(--space-md); margin: 0 0 var(--space-sm); }
#hero-mode .checkbox,
#hero-rotate-field .checkbox { display: flex; margin-bottom: var(--space-xs); }
section.panel[aria-labelledby="hero-heading"] { max-width: 720px; }

/* ---------- Admin: dashboard ---------- */
/* Storage: the figure, a thin meter, and the counts. */
.stat-card {
  max-width: 520px;
  padding: var(--space-lg);
  border: 1px solid var(--color-rule);
}
.stat-card h2 { margin: 0 0 var(--space-2xs); }
#storage-text { margin: 0 0 var(--space-sm); font-size: var(--text-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--color-paper-3); overflow: hidden; }
.meter-fill { width: 0; height: 100%; background: var(--color-accent); }
#counts { margin: var(--space-sm) 0 0; font-variant-numeric: tabular-nums; }
.storage-details { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.storage-details summary { min-height: 32px; font-weight: 600; font-size: var(--text-sm); cursor: pointer; }
.storage-list { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; gap: var(--space-sm); }
.storage-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2xs) var(--space-sm); font-size: var(--text-sm); }
.storage-list a { overflow-wrap: anywhere; }
.storage-size { color: var(--color-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.storage-list .meter { grid-column: 1 / -1; height: 4px; }

/* The sets, in home page order: a ledger of rows with a handle, the name,
   its badges and count, and the row's tools. */
.admin-set-list {
  position: relative; /* lets sortable.js read item positions relative to the list */
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  max-width: 760px;
  border-top: 1px solid var(--color-ink);
}
.admin-set-list li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 56px;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-rule);
}
.admin-set-list a { flex: 1; min-width: 0; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.admin-set-list a:hover { text-decoration: underline; }
.admin-set-list .muted { margin-right: var(--space-xs); font-size: var(--text-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Categories: removable chips. */
.admin-tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); list-style: none; margin: var(--space-xs) 0 0; padding: 0; }
.admin-tags li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 36px;
  padding: 0 var(--space-2xs) 0 var(--space-sm);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-pill);
}
.admin-tags button { width: 28px; min-height: 28px; height: 28px; padding: 0; border-radius: 50%; }

/* Badges: a word on its own state color. */
.draft-badge,
.activity-group {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-note-bg);
  color: var(--color-note-ink);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.draft-badge.scheduled { background: var(--color-info-bg); color: var(--color-info-ink); }
.featured-badge { background: var(--color-violet-bg); color: var(--color-violet-ink); }
#set-title[data-state="draft"]::after,
#set-title[data-state="scheduled"]::after {
  margin-left: var(--space-sm);
  padding: var(--space-3xs) var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--color-note-bg);
  color: var(--color-note-ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  vertical-align: middle;
}
#set-title[data-state="draft"]::after { content: "Draft"; }
#set-title[data-state="scheduled"]::after { content: "Scheduled"; background: var(--color-info-bg); color: var(--color-info-ink); }

/* ---------- Admin: a set's page ---------- */
.publish-panel .actions { align-items: center; margin-bottom: 0; }
.schedule-form { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.schedule-form label { display: block; margin-bottom: var(--space-2xs); font-size: var(--text-sm); font-weight: 500; }
.slug-field { display: flex; align-items: baseline; gap: var(--space-2xs); max-width: 420px; }
.slug-field input { flex: 1; min-width: 0; margin-bottom: 0 !important; }

/* Dropping photos in. */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xl) var(--space-md);
  border: 1px dashed var(--color-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.drop-zone:hover,
.drop-zone.dragging { border-color: var(--color-ink); background: var(--color-paper-2); }
/* The file input itself is hidden, so show its focus ring on the box instead. */
.drop-zone:has(+ #file-input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.wm-preview { margin: var(--space-md) 0; }
.wm-preview img { display: block; max-width: 100%; max-height: 60svh; }

/* Waiting to upload. */
.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-sm);
}
.queue li { font-size: var(--text-sm); min-width: 0; }
.queue img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--color-paper-2); }
.queue p { margin: var(--space-2xs) 0 0; overflow-wrap: anywhere; }
.queue-name { font-weight: 600; }
.queue li[data-status="error"] .queue-status { color: var(--color-error); }
.queue li[data-status="done"] .queue-status { color: var(--color-success); }
#queue-summary[data-state="error"] { color: var(--color-error); font-weight: 600; }
.queue-warning {
  margin-top: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-note-bg);
  color: var(--color-note-ink);
  font-size: var(--text-xs);
}
.queue-warning[data-strength="weak"] { background: var(--color-paper-2); color: var(--color-ink); }
.queue-warning ul { margin: var(--space-2xs) 0 var(--space-xs); padding-left: var(--space-md); }
.queue-warning a { color: inherit; }
.queue-warning button { min-height: 28px; padding: 0 var(--space-sm); font-size: var(--text-xs); }

/* The photos already in the set: a grid of tiles, each the picture with its
   fields and tools under it. The chosen cover is edged in the highlight. */
/* ---------- Admin: ratings and Instagram picks ---------- */
/* Five stars on each photo card: gray until rated, ink when on. */
.photo-rating { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3xs); }
.rating-star {
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: var(--text-lg);
  line-height: 1;
}
.rating-star:hover { background: var(--color-paper-2); color: var(--color-ink); }
.rating-star.is-on { color: var(--color-ink); }
.photo-rating .save-status { margin-left: var(--space-xs); }
.rating-label { margin-right: var(--space-2xs); color: var(--color-muted); font-size: var(--text-xs); font-weight: 500; }
.instagram-toggle { align-self: flex-start; min-height: 36px; font-size: var(--text-sm); }
.instagram-toggle[aria-pressed="true"] { background: var(--color-violet-bg); border-color: var(--color-violet-bg); color: var(--color-violet-ink); }
.instagram-toggle[aria-pressed="true"]:hover { border-color: var(--color-violet-ink); }
.instagram-badge {
  position: absolute;
  right: var(--space-xs);
  bottom: var(--space-xs);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-violet-bg);
  color: var(--color-violet-ink);
  font-size: var(--text-xs);
  font-weight: 600;
}
.picks-line { margin: 0 0 var(--space-md); font-size: var(--text-sm); }
.picks-line p { margin: 0; }
/* Dashboard categories: the Chinese name box beside each one. */
.category-zh { width: 9rem; min-height: 32px; margin-inline: var(--space-xs); padding: 0 var(--space-xs); font-size: var(--text-sm); }
.hearts-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); margin: 0 0 var(--space-md); font-size: var(--text-sm); }
.hearts-line button { min-height: 32px; font-size: var(--text-sm); }
/* Nearing one post's 20 photos: a note, never a block. */
.picks-note { margin: var(--space-xs) 0 0; padding: var(--space-xs) var(--space-sm); background: var(--color-info-bg); color: var(--color-info-ink); font-size: var(--text-sm); }
.picks-note[data-level="full"],
.picks-note[data-level="over"] { background: var(--color-note-bg); color: var(--color-note-ink); }

/* The picks page: a vertical group and a horizontal one, each with up to two
   posts (a heading, the post's buttons, its photos) and the ones waiting. */
.picks-set { margin: var(--space-2xl) 0 0; padding-top: var(--space-md); border-top: 1px solid var(--color-ink); }
.picks-set > h2 { margin: 0 0 var(--space-lg); font-size: var(--text-xl); }
.picks-set > h2 a { text-decoration: none; }
.picks-set > h2 a:hover { text-decoration: underline; }
.picks-group { margin: 0 0 var(--space-lg); }
.picks-group > h3 { margin: 0 0 var(--space-sm); font-size: var(--text-lg); font-weight: 600; }
.picks-group-count { margin-left: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.picks-post { margin: 0 0 var(--space-xl); padding: var(--space-lg); border: 1px solid var(--color-rule); }
.picks-post-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-md); }
.picks-post-head h4 { margin: 0; font-size: var(--text-md); font-weight: 600; }
.picks-post-head .actions { margin: 0; }
.picks-post-status { flex-basis: 100%; margin: 0; }
.picks-post-status:empty { display: none; }
.picks-waiting { padding: var(--space-lg); border: 1px dashed var(--color-rule-strong); }
.picks-waiting h4 { margin: 0 0 var(--space-2xs); font-size: var(--text-md); font-weight: 600; }
.picks-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-md); }
.picks-group[data-group="horizontal"] .picks-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.picks-item { display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0; }
.picks-item img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--color-paper-2); }
.picks-group[data-group="horizontal"] .picks-item img { aspect-ratio: 3 / 2; }
.picks-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2xs) var(--space-xs); margin: 0; font-size: var(--text-sm); }
.picks-stars { color: var(--color-ink); letter-spacing: 0.02em; }
.picks-meta a { min-width: 0; overflow-wrap: anywhere; }
/* Posts already made: a ruled list with a strip of the photos, the link and the note. */
.picks-history { margin-top: var(--space-lg); }
.picks-history > h3 { margin: 0 0 var(--space-sm); font-size: var(--text-lg); font-weight: 600; }
.ig-posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-rule); }
.ig-post { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-md) 0; border-bottom: 1px solid var(--color-rule); }
.ig-post p { margin: 0; }
.ig-post-head { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); align-items: baseline; }
.ig-post-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); }
.ig-post-strip img { display: block; width: 56px; height: 56px; object-fit: cover; background: var(--color-paper-2); }
.ig-post-more { min-width: 56px; color: var(--color-muted); font-size: var(--text-sm); font-weight: 600; text-align: center; }
.ig-post-link a { font-weight: 500; }
.ig-post-note { color: var(--color-ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.ig-post .actions { margin: 0; }
.ig-post-form { display: grid; gap: var(--space-xs); max-width: 480px; }
.ig-post-form label { display: grid; gap: var(--space-2xs); font-size: var(--text-sm); font-weight: 500; }
.ig-post-form .actions { margin: var(--space-2xs) 0 0; }
.ig-post .form-error:empty { display: none; }
/* "Mark as posted": a small dialog for the link and a note. */
.posted-dialog { width: min(480px, calc(100% - 2 * var(--space-md))); padding: var(--space-lg); border: 1px solid var(--color-rule-strong); background: var(--color-paper); color: var(--color-ink); }
.posted-dialog::backdrop { background: var(--color-scrim-soft); }
.posted-dialog form { display: grid; gap: var(--space-xs); }
.posted-dialog h2 { margin: 0; font-size: var(--text-lg); font-weight: 600; }
.posted-dialog p { margin: 0; }
.posted-title { font-weight: 600; }
.posted-dialog label { margin-top: var(--space-xs); font-size: var(--text-sm); font-weight: 500; }
.posted-dialog .actions { margin: var(--space-xs) 0 0; }
.picks-file { margin: 0; color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.picks-unpick { align-self: flex-start; min-height: 32px; padding: 0 var(--space-sm); font-size: var(--text-xs); }

/* ---------- Admin: quick look (see js/quick-look.js) ---------- */
/* The whole photo on the dark viewer ground, its details in a panel beside
   it (below it on a phone). */
.quick-look {
  width: min(1320px, calc(100% - 2 * var(--space-md)));
  height: min(860px, calc(100dvh - 2 * var(--space-md)));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: var(--color-night);
  color: var(--color-night-ink);
}
.quick-look[open] { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.quick-look::backdrop { background: var(--color-scrim); }
.ql-stage { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: var(--space-lg); }
/* The whole photo, as large as the space allows, never cropped. */
.ql-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ql-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-lg);
  overflow-y: auto;
  border-left: 1px solid var(--color-night-2);
}
.ql-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.quick-look h2 { margin: 0; color: var(--color-night-ink); }
.ql-counter { margin-left: var(--space-xs); color: var(--color-night-muted); font-size: var(--text-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.quick-look .icon-button,
.quick-look .button-secondary { border-color: var(--color-night-3); color: var(--color-night-ink); }
.quick-look .icon-button:hover,
.quick-look .button-secondary:hover { background: var(--color-night-2); border-color: var(--color-night-ink); }
.quick-look :focus-visible { outline-color: var(--color-night-ink); }
.ql-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-xs) var(--space-md); margin: 0; font-size: var(--text-sm); }
.ql-details dt { color: var(--color-night-muted); font-weight: 500; }
.ql-details dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
/* Rating and pick in the quick look, in the viewer's light-on-dark colors. */
.ql-controls { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-xs); padding-top: var(--space-md); border-top: 1px solid var(--color-night-2); }
.ql-rating { display: flex; gap: var(--space-3xs); }
.quick-look .rating-star { color: var(--color-night-muted); }
.quick-look .rating-star:hover { background: var(--color-night-2); color: var(--color-night-ink); }
.quick-look .rating-star.is-on { color: var(--color-night-ink); }
.quick-look .instagram-toggle[aria-pressed="true"] { background: var(--color-violet-bg); border-color: var(--color-violet-bg); color: var(--color-violet-ink); }
.ql-picks { margin: 0; font-size: var(--text-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.quick-look .picks-note { margin: 0; }
.ql-tags { display: flex; flex-direction: column; gap: var(--space-3xs); align-self: stretch; color: var(--color-night-muted); font-size: var(--text-sm); font-weight: 500; }
.ql-tags input { background: var(--color-night-2); border-color: var(--color-night-3); color: var(--color-night-ink); }
/* Jersey numbers are only for Sports sets (admin-set.js, showNumbers). */
[data-no-numbers] .numbers-field, [data-no-numbers] .ql-tags, [data-no-numbers] #ql-tags-status { display: none; }
.quick-look .save-status { margin: 0; }
.ql-keys { margin: 0; color: var(--color-night-muted); font-size: var(--text-xs); }
@media (hover: none) { .ql-keys { display: none; } }
.ql-nav { display: flex; gap: var(--space-xs); margin-top: auto; }
.ql-nav button { flex: 1; }
/* Phones: the whole screen, the photo on top and the details under it. */
@media (max-width: 800px) {
  .quick-look { width: 100%; height: 100dvh; margin: 0; }
  .quick-look[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .ql-stage { padding: var(--space-sm); }
  .ql-panel { max-height: 50dvh; gap: var(--space-md); padding: var(--space-md) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom)); border-left: 0; border-top: 1px solid var(--color-night-2); }
}

.alt-reminder { margin: 0 0 var(--space-md); padding: var(--space-xs) var(--space-sm); background: var(--color-note-bg); color: var(--color-note-ink); font-size: var(--text-sm); }
.order-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); margin: 0 0 var(--space-md); }
.photo-editor {
  position: relative; /* lets sortable.js read item positions relative to the list */
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}
.photo-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-rule);
}
.photo-card.is-cover .photo-card-image { outline: 3px solid var(--color-highlight); outline-offset: 2px; }
.photo-card-image { position: relative; margin: 0; }
.photo-card-image img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--color-paper-2);
  cursor: zoom-in; /* click: quick look; drag: reorder */
}
.cover-badge,
.download-badge {
  position: absolute;
  left: var(--space-xs);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
}
.cover-badge { top: var(--space-xs); background: var(--color-highlight); color: var(--color-highlight-ink); }
.download-badge { bottom: var(--space-xs); background: var(--color-good-bg); color: var(--color-good-ink); }
/* Visitors' hearts: top right, beside the drag handle. */
.hearts-badge {
  position: absolute;
  top: var(--space-xs);
  right: calc(2 * var(--space-xs) + 36px);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 600;
}
.photo-card-field { display: flex; flex-direction: column; gap: var(--space-3xs); color: var(--color-muted); font-size: var(--text-xs); font-weight: 500; }
.photo-card-field input { min-height: 36px; padding: 0 var(--space-xs); font-size: var(--text-sm); }
.photo-card-tools { display: flex; gap: var(--space-xs); }
.photo-card-tools .danger { margin-left: auto; }

.danger-zone {
  margin-top: var(--space-2xl);
  padding: var(--space-lg);
  border: 1px solid var(--color-error);
}
.danger-zone h2 { color: var(--color-error); }

/* ---------- Drag to reorder (see js/sortable.js) ---------- */
.drag-handle,
.drag-surface {
  cursor: grab;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}
/* "none": a finger on the handle drags the item instead of scrolling the page. */
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 40px;
  color: var(--color-muted);
  font-size: var(--text-lg);
  touch-action: none;
}
.drag-handle:hover { color: var(--color-ink); }
/* The empty slot that shows where the item will land. */
.drag-slot { outline: 2px dashed var(--color-focus); outline-offset: -2px; }
.drag-slot > * { visibility: hidden; }
/* The floating copy that follows the pointer. */
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-ghost);
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  display: block !important;
  list-style: none;
  pointer-events: none; /* so we can see what is underneath it */
  box-shadow: 0 var(--space-sm) var(--space-xl) var(--color-shadow);
  background: var(--color-paper);
  opacity: 0.96;
}
.drag-ghost > li { border-bottom: 0 !important; }
body.is-dragging,
body.is-dragging * { cursor: grabbing !important; user-select: none; }
.photo-grip {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  width: 36px;
  min-height: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-scrim);
  color: var(--color-night-ink);
}

/* ---------- Admin: tables (license codes, activity, receipts) ---------- */
.license-table,
.activity-table,
.receipts-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.license-table th,
.license-table td,
.activity-table th,
.activity-table td {
  padding: var(--space-sm) var(--space-xs);
  border-bottom: 1px solid var(--color-rule);
  text-align: left;
  vertical-align: top;
}
.license-table th,
.activity-table th { color: var(--color-muted); font-weight: 500; border-bottom-color: var(--color-ink); }
.license-table code { font-size: var(--text-md); font-weight: 600; letter-spacing: 0.02em; }
.license-table tr.is-off { color: var(--color-muted); }
.license-table tr.is-off code { text-decoration: line-through; }
.license-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.license-actions button { min-height: 32px; padding: 0 var(--space-sm); font-size: var(--text-sm); }
.new-code { margin: var(--space-sm) 0 0; padding: var(--space-sm) var(--space-md); background: var(--color-good-bg); color: var(--color-good-ink); }
.new-code code { font-size: var(--text-lg); font-weight: 700; letter-spacing: 0.04em; }
@media (max-width: 700px) { .license-table .hide-small { display: none; } }

.activity-filters { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: 0 0 var(--space-md); }
.activity-filters button { min-height: 36px; padding: 0 var(--space-md); font-size: var(--text-sm); }
.activity-filters button[aria-pressed="false"] { background: transparent; color: var(--color-ink); border-color: var(--color-rule-strong); }
.activity-filters button[aria-pressed="false"]:hover { border-color: var(--color-ink); }
.activity-table td:first-child { white-space: nowrap; color: var(--color-muted); }
.activity-group { background: var(--color-paper-2); color: var(--color-ink); font-weight: 500; }
.activity-group[data-group="Deletion"] { background: var(--color-bad-bg); color: var(--color-bad-ink); }
.activity-group[data-group="Download"] { background: var(--color-good-bg); color: var(--color-good-ink); }
.activity-group[data-group="License"] { background: var(--color-violet-bg); color: var(--color-violet-ink); }
.activity-group[data-group="Publishing"] { background: var(--color-info-bg); color: var(--color-info-ink); }
.activity-group[data-group="Instagram"] { background: var(--color-violet-bg); color: var(--color-violet-ink); }
@media (max-width: 600px) {
  .activity-table thead { display: none; }
  .activity-table tr { display: block; padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); }
  .activity-table td { display: block; border: 0; padding: var(--space-3xs) 0; }
}

/* ---------- Admin: About page editor ---------- */
.portrait-editor { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); }
.portrait-editor img { width: 140px; height: 140px; object-fit: cover; background: var(--color-paper-2); }
.portrait-editor .button-secondary { margin-left: var(--space-xs); }

/* ---------- Admin: watermark toolkit ---------- */
#tk-list .button-link { min-height: 32px; margin-top: var(--space-xs); padding: 0 var(--space-sm); font-size: var(--text-sm); }

/* ---------- Admin: log in ---------- */
/* One narrow column, a third of the way down the screen. */
main.login { max-width: 400px; padding-top: 18svh; }
main.login h1 { font-family: var(--font-display); font-weight: 400; }
.card-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border: 1px solid var(--color-rule);
}
.card-form label { font-size: var(--text-sm); font-weight: 500; }
.card-form input { margin-bottom: var(--space-xs); }
.card-form button { margin-top: var(--space-xs); }
