/* ==========================================================================
   MDLF: styles.css
   Light, sober, a little bit cheeky. Every colour, space, radius and font
   is a token on :root. Pastels are decoration only; controls are plum.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fonts: self-hosted (no Google request: GDPR- and offline-friendly).
   Files live in public/fonts/ (SIL OFL, see OFL.txt). Fallbacks on :root.
   -------------------------------------------------------------------------- */
/* One file per family, variable weight range (CR-4). */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-400.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette (brief) */
  --cream: #FBF7F0;
  --peach: #F6C1A8;
  --lilac: #CDBFE8;
  --butter: #F4E3A1;
  --mint: #BFE3D0;
  --plum: #2F2C3A;
  --muted: #5A5666;          /* text on cream / butter / mint only */

  /* Glaze tones for the SVG art (decorative only, never text or controls) */
  --peach-deep: #EFA284;
  --lilac-deep: #AD9BDB;
  --butter-deep: #EBCB66;
  --mint-deep: #8FC8AC;
  --oat: #F2E7D6;
  --clay: #DCBFA3;
  --shell: #FFFDF9;

  /* Roles */
  --color-bg: var(--cream);
  --color-ink: var(--plum);
  --color-ink-muted: var(--muted);
  --color-line: rgb(47 44 58 / 0.12);
  --color-hover: var(--peach);
  --color-veil: rgb(251 247 240 / 0.78);
  --color-surface: var(--shell);   /* panels, fields, summary: plum 13.40:1, muted 6.99:1 */
  --color-tint: var(--oat);        /* info blocks, choice hover: plum 11.14:1, muted 5.81:1 */
  /* Iron-red glaze: errors only, always with an icon + text, never alone.
     7.81:1 on cream, 8.21:1 on shell (AAA). Never on pastels. */
  --alert: #8E2B22;
  /* Photo frame background everywhere: cards, gallery letterbox, thumbnails,
     basket/summary thumbs, admin tiles. Plum 11.14:1, muted 5.81:1 on it. */
  --color-frame: var(--oat);

  /* Type: swap the families here (pending client confirmation) */
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 600;

  /* Fluid type scale (min at 375px, max at ~1280px) */
  --step--1: clamp(0.8125rem, 0.78rem + 0.12vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.12vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.28vw, 1.3125rem);
  --step-2: clamp(1.3125rem, 1.16rem + 0.62vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.43rem + 1.35vw, 2.625rem);
  --step-hero: clamp(6.25rem, 2.6rem + 15.5vw, 13.5rem);
  --leading-tight: 1.15;
  --leading: 1.55;
  --tracking-display: -0.02em;
  --tracking-hero: -0.06em;

  /* Space */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;
  --space-3xl: 8rem;

  /* Layout */
  --container: 1200px;
  --gutter: 16px;
  --grid-gap: 16px;
  --header-h: 56px;
  --tap: 44px;

  /* Radii */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 18px;
  --radius-pill: 999px;

  /* Lines + focus */
  --border-w: 1.5px;
  --border: var(--border-w) solid var(--plum);
  --focus-w: 3px;
  --focus-offset: 3px;
  --field-border: 2px solid var(--plum);
  --field-h: 48px;
  /* Two-tone ring for controls over a photo: 2px cream, 3px plum, 2px cream */
  --halo-w: 2px;
  --halo: var(--cream);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.55, 1);
  --dur-fast: 160ms;
  --dur-enter: 400ms;
  --dur-wobble: 600ms;
  --stagger: 60ms;
}

@media (min-width: 600px) {
  :root { --gutter: 24px; --grid-gap: 24px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; --grid-gap: 32px; }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-s));
  scrollbar-gutter: stable;
  background: var(--color-bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip, not hidden: hidden turns body into a scroll container while the
     dialog locks <html>, and the sticky header scrolls away behind the veil */
  overflow-x: clip;
}

/* Copy and cards are filled by JS. Keep the page unpainted until boot has
   run, so the first paint is the final layout (no CLS). js/early.js reveals
   it after 2.5s even if a page script fails. Legal pages load no JS, so
   html.js is never set there and this rule never applies. */
html.js:not(.is-ready) body { visibility: hidden; }

/* paper grain: very light, over everything, never in the way */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.17 0 0 0 0 0.23 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; max-width: 100%; }

:focus-visible {
  outline: var(--focus-w) solid var(--plum);
  outline-offset: var(--focus-offset);
}
[tabindex="-1"]:focus { outline: none; }

/* Focus ring over a photo (ux-spec §10.1): a 3px plum ring with a 2px cream
   halo on both sides, so it shows on dark and light photos alike. The outline
   paints over the cream shadow, leaving cream inside and outside the plum. */
.qv__close:focus-visible,
.qv__nav:focus-visible,
.qv__thumb:focus-visible {
  outline: var(--focus-w) solid var(--plum);
  outline-offset: var(--halo-w);
  box-shadow: 0 0 0 calc(2 * var(--halo-w) + var(--focus-w)) var(--halo);
}

/* [hidden] must beat component display rules (.btn, .notice-panel, ...) */
[hidden] { display: none !important; }

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

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

/* --------------------------------------------------------------------------
   3. Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: var(--space-2xs);
  left: var(--space-2xs);
  z-index: 200;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--space-s);
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-pill);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus,
.skip-link:focus-visible { transform: none; }

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgb(251 247 240 / 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) linear;
}
.site-header.is-scrolled { border-bottom-color: var(--color-line); }

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: var(--tap);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--step-0);
  letter-spacing: -0.01em;
  text-transform: lowercase;
  text-decoration: none;
  border-radius: var(--radius-s);
}
/* tiny glaze drop before the name */
.wordmark::before {
  content: "";
  width: 0.62em;
  height: 0.62em;
  border-radius: 50% 50% 46% 54% / 56% 50% 50% 44%;
  background: var(--peach);
  box-shadow: inset 0 0 0 var(--border-w) var(--plum);
  translate: 0 0.04em;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--space-2xs);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  text-decoration-color: rgb(47 44 58 / 0.35);
  border-radius: var(--radius-s);
  transition: text-decoration-color var(--dur-fast) linear;
}
.site-nav__link:hover { text-decoration-color: var(--plum); }

/* Header, three items: wordmark | nav link + basket */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}
@media (min-width: 600px) {
  .site-header__actions { gap: var(--space-s); }
}

/* Static header (legal pages): no JS, so the hairline is always on */
.site-header--static { border-bottom-color: var(--color-line); }

/* ---- basket button: icon, label (hidden < 600px), count pill ---- */
.basket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 0.7em;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--plum);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) linear;
}
.basket-btn:hover { background: var(--color-hover); }
.basket-btn__icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.basket-btn__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4em;
  border-radius: var(--radius-pill);
  background: var(--plum);          /* cream on plum 12.75:1 */
  color: var(--cream);
  font-size: 0.75rem;
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}
.basket-btn.is-empty .basket-btn__count { display: none; }
@media (max-width: 599.98px) {
  .basket-btn { padding: 0 0.55em; }
  .basket-btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .site-nav__link { padding-inline: var(--space-3xs); }
}

/* --------------------------------------------------------------------------
   5. Hero
   Wordmark and pots stand on the same shelf; the line is the gallery label.
   -------------------------------------------------------------------------- */
.hero {
  padding-block: var(--space-m) var(--space-l);
}

.hero__stage {
  display: grid;
  gap: var(--space-2xs);
  border-bottom: var(--border);
}

.hero__title {
  font-size: var(--step-hero);
  font-weight: var(--weight-bold);
  line-height: 0.8;
  letter-spacing: var(--tracking-hero);
  isolation: isolate;
  margin-left: -0.04em;
  padding-top: 0.12em;
}
/* lowercase on screen like the old "koko" mark; the copy stays "MDLF" */
.hero__wordmark { display: inline-block; text-transform: lowercase; }

/* the "d" and "l" each get a pastel glaze blob behind them, a touch off-register */
.hero__glaze { position: relative; }
.hero__glaze::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 0.5em;
  width: 0.5em;
  height: 0.47em;
  border-radius: 52% 48% 55% 45% / 48% 55% 45% 52%;
  background: var(--peach);
  transform: translate(-44%, 52%) rotate(-8deg);
}
.hero__glaze--2::before {
  background: var(--mint);
  transform: translate(-52%, 44%) rotate(12deg);
}

.hero__art {
  height: clamp(170px, 32svh, 300px);
}
.hero-art {
  width: 100%;
  height: 100%;
}

.hero__label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-s);
  padding-top: var(--space-s);
}

.hero__line {
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-regular);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero__cue {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: var(--border);
  border-radius: 50%;
  color: var(--plum);
  transition: background-color var(--dur-fast) linear;
}
.hero__cue:hover { background: var(--butter); }
.hero__cue svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 900px) {
  .hero { padding-block: var(--space-l) var(--space-xl); }
  .hero__stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    align-items: end;
    gap: var(--space-l);
  }
  .hero__title {
    /* sit the letters on the shelf (fallback nudge, then exact where supported) */
    margin-bottom: -0.035em;
    padding-top: 0;
  }
  .hero__art {
    height: auto;
    aspect-ratio: 640 / 500;
    max-height: min(52svh, 480px);
    justify-self: end;
    width: 100%;
  }
  .hero__label { padding-top: var(--space-m); }
}
@supports (text-box: trim-both cap alphabetic) {
  @media (min-width: 900px) {
    .hero__title { text-box: trim-end cap alphabetic; margin-bottom: 0; }
  }
}

/* gentle life in the hero art */
@media (prefers-reduced-motion: no-preference) {
  .hero-art__sun { animation: drift 11s var(--ease-soft) infinite alternate; }
  .hero-art__pebble,
  .hero-art__cup {
    transform-box: fill-box;
    transform-origin: 50% 100%;
  }
  .hero-art__pebble { animation: teeter 9s var(--ease-soft) 2s infinite; }
  .hero-art__cup { animation: teeter 13s var(--ease-soft) 5s infinite; }
  .hero__cue svg { animation: nudge 2.8s var(--ease-soft) infinite; }
}
@keyframes drift {
  to { transform: translate(-6px, 10px); }
}
@keyframes teeter {
  0%, 88%, 100% { transform: rotate(0); }
  91% { transform: rotate(-4deg); }
  94% { transform: rotate(3deg); }
  97% { transform: rotate(-1deg); }
}
@keyframes nudge {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(3px); }
}

/* --------------------------------------------------------------------------
   6. Gallery
   -------------------------------------------------------------------------- */
.gallery {
  padding-block: var(--space-m) var(--space-2xl);
}

.gallery__head {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-bottom: var(--space-m);
}
.gallery__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-line);
}
.gallery__title {
  font-size: var(--step-1);
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--grid-gap);
  row-gap: calc(var(--grid-gap) * 1.75);
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- card ---- */
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Photo frame (ux-spec §10.2). The frame owns its size (aspect-ratio), so a
   photo arriving late never moves anything (CLS 0). Oat is the placeholder:
   no spinner, no shimmer, no blur-up. Pointer-only; never a tab stop. */
.card__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--color-frame);
  cursor: pointer;
}
.card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;               /* centre crop, visual only */
  object-position: 50% 50%;
  opacity: var(--photo-opacity, 1);
}
/* Fade in once loaded (FE sets .is-loaded on load, or at insert when
   img.complete). Reduced motion: never hidden, so nothing waits on it. */
@media (prefers-reduced-motion: no-preference) {
  .card__img {
    transition: opacity 200ms linear, transform var(--dur-wobble) var(--ease-soft);
  }
  .card__img:not(.is-loaded) { opacity: 0; }
}
/* Hover replaces the wobble: the photo leans in, the frame never moves */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .card__frame:hover .card__img { transform: scale(1.03); }
}

/* Broken photo: same frame, same size. FE adds .is-broken, sets [hidden] on
   the img and inserts span.card__fallback (gallery.photoError). The same
   look serves the gallery stage (.qv__fallback). */
.card__fallback,
.qv__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-s);
  color: var(--color-ink-muted);   /* muted on oat 5.81:1 */
  font-size: var(--step--1);
  line-height: 1.4;
  text-align: center;
}
.card__fallback::before,
.qv__fallback::before {            /* small decorative pot outline: CSS only, no text */
  content: "";
  width: 2.25rem;
  height: 1.9rem;
  border: var(--border-w) solid currentColor;
  border-top-width: 3px;
  border-radius: 18% 18% 46% 46% / 12% 12% 62% 62%;
  opacity: 0.7;
}

/* Sold / reserved: the photo dims; badge, name and button never do */
.card.is-sold { --photo-opacity: 0.55; }
.card.is-sold .card__img { filter: saturate(0.6); }
.card.is-reserved { --photo-opacity: 0.8; }

/* Loading skeleton (ux-spec §10.3): 3 rendered, CSS shows 1 / 2 / 3 per
   breakpoint. aria-hidden on the li. No shimmer. */
.card.is-skeleton { pointer-events: none; }
.card.is-skeleton .card__frame { cursor: default; }
.skeleton-bar {
  display: block;
  height: 1em;
  border-radius: var(--radius-s);
  background: var(--color-frame);
}
.skeleton-bar + .skeleton-bar { width: 60%; margin-top: var(--space-2xs); }
.skeleton-btn {
  display: block;
  width: 4.5rem;
  height: var(--tap);
  border-radius: var(--radius-pill);
  background: var(--color-frame);
}
.grid > .card.is-skeleton:nth-child(n+2) { display: none; }
@media (min-width: 600px) {
  .grid > .card.is-skeleton:nth-child(2) { display: flex; }
}
@media (min-width: 1024px) {
  .grid > .card.is-skeleton:nth-child(3) { display: flex; }
}

/* Pastel frames: hero only now (piece frames use --color-frame) */
.frame--peach { background: var(--peach); }
.frame--lilac { background: var(--lilac); }
.frame--butter { background: var(--butter); }
.frame--mint { background: var(--mint); }

.card__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-s);
  padding-top: var(--space-s);
}

.card__name {
  font-size: var(--step-1);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card__caption {
  margin-top: var(--space-3xs);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  line-height: 1.45;
}
.card__price {
  margin-top: var(--space-3xs);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

/* ---- sold / reserved badge: plum on cream, plum border, text + shape cue.
   Absolutely positioned inside the frame, so it never shifts layout. ---- */
.card__badge {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.3em 0.75em;
  border: 1px solid var(--plum);
  border-radius: var(--radius-pill);
  background: var(--cream);         /* plum on cream 12.75:1 */
  color: var(--plum);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  pointer-events: none;
}
.card__badge::before {               /* sold: solid dot */
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--plum);
}
.card__badge--reserved { border-style: dashed; }
.card__badge--reserved::before {     /* reserved: hollow dot */
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--plum);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 1.1em;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--plum);
  font-weight: var(--weight-medium);
  font-size: var(--step--1);
  line-height: 1;
  text-decoration: none;            /* a.btn (checkout, resume) looks like a button */
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) linear, transform var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--color-hover); }
.btn:active { transform: translateY(1px); }
.btn__icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-fast) var(--ease-out);
}
.btn:hover .btn__icon { transform: translateX(2px); }

.btn--primary {
  background: var(--plum);
  color: var(--cream);
}
.btn--primary:hover { background: #45405a; }

/* Disabled-looking but still focusable (aria-disabled, never [disabled]).
   Dashed plum border + cream fill: the boundary stays plum, text 12.75:1. */
.btn.is-disabled,
.btn.is-disabled:hover,
.btn[aria-disabled="true"],
.btn[aria-disabled="true"]:hover {
  background: var(--cream);
  color: var(--plum);
  border-style: dashed;
  cursor: not-allowed;
}
.btn.is-disabled:active,
.btn[aria-disabled="true"]:active { transform: none; }

/* Destructive confirm (admin only, ux-spec §10.1): alert text, 2px alert
   border, trash icon, on cream. Never alone, never on pastels: hover keeps
   cream and thickens the border instead of the peach fill. */
.btn--danger {
  border: 2px solid var(--alert);
  background: var(--cream);
  color: var(--alert);              /* 7.81:1 on cream */
}
.btn--danger:hover {
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--alert);
}
/* Text button (photo "Delete", "Remove"): underline, 44px target, no box */
.btn--text {
  border-color: transparent;
  padding-inline: 0.5em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: rgb(47 44 58 / 0.45);
}
.btn--text:hover {
  background: transparent;
  text-decoration-color: var(--plum);
}
.btn__icon--static,
.btn:hover .btn__icon--static { transform: none; }   /* trash, camera: no nudge */

/* Busy (pay button): spinner next to the label; never [disabled] */
.btn__spinner {
  display: none;
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}
.btn__label { min-width: 0; }
.btn.is-busy { cursor: progress; }
.btn.is-busy .btn__spinner { display: inline-block; }
@keyframes spin {
  to { transform: rotate(1turn); }
}

/* ---- SVG art line work ---- */
.k-line {
  fill: none;
  stroke: var(--plum);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0.9;
}
.k-line--soft { stroke-opacity: 0.45; }
.k-break {
  fill: none;
  stroke: var(--plum);
  stroke-width: 2.5;
  stroke-opacity: 0.1;
}
.art__pot {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

/* ---- entrance (the hover is on .card__img, see the card section) ---- */
.card.is-entering {
  animation: card-in var(--dur-enter) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.art__flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .art__flame { animation: flicker 3.2s var(--ease-soft) infinite; }
}
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0); }
  35% { transform: scale(0.94, 1.05) rotate(-2deg); }
  70% { transform: scale(1.03, 0.97) rotate(1.5deg); }
}

/* ---- show more ---- */
.gallery__more {
  display: grid;
  justify-items: center;
  gap: var(--space-s);
  min-height: calc(var(--tap) + var(--space-2xl));
  padding-top: var(--space-xl);
}
.gallery__sentinel {
  width: 100%;
  height: 1px;
}

/* ---- gallery states (ux-spec §10.3, catalogue-spec §6.2) ---- */
/* "Fetching the pots…" under the skeleton row. It keeps its line from the
   start; FE adds .is-visible after 600ms, so its arrival shifts nothing.
   ([hidden] also works, at the cost of one line of shift.) */
.gallery__loading {
  min-height: calc(var(--leading) * 1em);
  margin-top: var(--space-m);
  color: var(--color-ink-muted);
  font-size: var(--step--1);
  text-align: center;
  visibility: hidden;
}
.gallery__loading.is-visible { visibility: visible; }

/* Empty shelf, error and offline share one centred notice slot */
.gallery__empty,
.gallery__error,
.gallery__offline {
  display: grid;
  justify-items: center;
  gap: var(--space-s);
  max-width: 34ch;
  margin-inline: auto;
  padding-block: var(--space-2xl);
  text-align: center;
}
.gallery__empty::before {          /* decorative shelf: a plum line, no SVG */
  content: "";
  width: 160px;
  height: var(--border-w);
  margin-bottom: var(--space-2xs);
  background: var(--plum);
}
.gallery__empty h3,
.gallery__empty-title {
  font-size: var(--step-2);
}
.gallery__empty p,
.gallery__empty-text {
  color: var(--color-ink-muted);   /* 6.65:1 on cream */
}
.gallery__empty p,
.gallery__error p,
.gallery__offline p { text-wrap: balance; }
.btn[aria-busy="true"] { cursor: progress; }

/* --------------------------------------------------------------------------
   7. End line: an empty shelf, one crumb, one sentence
   -------------------------------------------------------------------------- */
.end {
  padding-block: var(--space-xl) var(--space-3xl);
  text-align: center;
}
.end__inner {
  display: grid;
  justify-items: center;
  gap: var(--space-m);
}
.end__art {
  width: min(240px, 70%);
}
.end__art svg { width: 100%; height: auto; }
.end__line {
  white-space: pre-line;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-display);
  line-height: 1.15;
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   8. Footer: small, light, honest about its placeholders
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding-block: var(--space-xl) var(--space-l);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--color-ink-muted);
}
.site-footer__top {
  display: grid;
  gap: var(--space-l);
}
.site-footer__mark {
  margin-bottom: var(--space-3xs);
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: var(--weight-bold);
  text-transform: lowercase;
  color: var(--color-ink);
}
.site-footer__about p:last-child { max-width: 30ch; }
.site-footer__label {
  margin-bottom: var(--space-3xs);
  font-weight: var(--weight-medium);
  color: var(--color-ink);
}
.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__list li {
  display: flex;
  align-items: center;
  min-height: var(--tap);
}
.site-footer__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: rgb(47 44 58 / 0.35);
  border-radius: var(--radius-s);
}
.site-footer__link:hover { text-decoration-color: var(--plum); }
.site-footer__wink { margin-top: var(--space-2xs); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-m);
  margin-top: var(--space-xl);
  padding-top: var(--space-s);
  border-top: 1px solid var(--color-line);
  font-size: 0.8125rem;
}
@media (min-width: 768px) {
  .site-footer__top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  .site-footer__contact { justify-self: end; min-width: 16rem; }
}

/* legal links row (index + static footer) */
.site-footer__legal-links {
  list-style: none;
  margin: var(--space-m) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-m);
}
.site-footer__legal-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: rgb(47 44 58 / 0.35);
  border-radius: var(--radius-s);
}
.site-footer__legal-links a:hover { text-decoration-color: var(--plum); }
.site-footer__legal-links a[aria-current="page"] {
  font-weight: var(--weight-medium);
  text-decoration-color: var(--plum);
}

/* static footer (legal pages): same look, one simple stack */
.site-footer--static .site-footer__legal-links { margin-top: 0; }

/* --------------------------------------------------------------------------
   9. Quick view
   Mobile: a sheet from the bottom. Tablet+: two columns, art left.
   -------------------------------------------------------------------------- */
.qv {
  width: 100%;
  max-width: 100%;
  max-height: 100svh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-top: var(--border);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: var(--cream);
  color: var(--plum);
  overflow: auto;
  overscroll-behavior: contain;
}
.qv::backdrop {
  background: var(--color-veil);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.qv__inner {
  position: relative;
  display: grid;
  gap: var(--space-s);
  padding: var(--space-s) var(--gutter) var(--space-m);
}
/* ---- photo gallery (ux-spec §10.4, catalogue-spec §6.3) ----
   The stage has a FIXED size per piece and breakpoint, so the name, price and
   CTA never move while browsing. Photos are whole (contain), letterboxed on
   oat. FE sets .is-single on .qv__media for a 1-photo piece (taller stage,
   no prev / next / counter / strip). */
.qv__media {
  display: grid;
  justify-items: center;
  gap: var(--space-2xs);
  min-width: 0;
}
.qv__stage {
  --stage-h: min(40vh, calc((100vw - 2 * var(--gutter)) * 1.25));
  position: relative;
  width: 100%;
  height: var(--stage-h);
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--color-frame);
  touch-action: pan-y;             /* horizontal swipe is ours, vertical scroll stays */
  -webkit-user-select: none;
  user-select: none;
}
.qv__media.is-single .qv__stage { --stage-h: min(46vh, calc((100vw - 2 * var(--gutter)) * 1.25)); }
@supports (height: 1svh) {
  .qv__stage { --stage-h: min(40svh, calc((100vw - 2 * var(--gutter)) * 1.25)); }
  .qv__media.is-single .qv__stage { --stage-h: min(46svh, calc((100vw - 2 * var(--gutter)) * 1.25)); }
}
.qv__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  -webkit-user-drag: none;
}
/* Swap: FE layers the next img over the current one with .is-pending until
   img.decode() resolves, then drops the class and removes the old img. */
.qv__img.is-pending { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .qv__img { transition: opacity var(--dur-fast) linear; }
}

/* prev / next: cream fill + plum border reads on light and dark photos */
.qv__nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: var(--tap);
  height: var(--tap);
  margin-top: calc(var(--tap) / -2);
  padding: 0;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: var(--cream);
  color: var(--plum);
  cursor: pointer;
  transition: background-color var(--dur-fast) linear;
}
.qv__nav--prev { left: var(--space-2xs); }
.qv__nav--next { right: var(--space-2xs); }
.qv__nav:hover { background: var(--color-hover); }
.qv__nav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* visible "2 / 5": aria-hidden, the live region speaks */
.qv__count {
  position: absolute;
  right: var(--space-2xs);
  bottom: var(--space-2xs);
  z-index: 1;
  padding: 0.2em 0.65em;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--plum);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  pointer-events: none;
}

/* thumbnail strip: one row, 5 x 44x55 + 4 gaps = 252px (fits 320) */
.qv__thumbs {
  --thumb-w: 44px;
  --thumb-h: 55px;
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-2xs);   /* room for the selected bar */
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: var(--space-2xs);
  max-width: 100%;
}
.qv__thumbs > li { flex: none; }
.qv__thumb {
  position: relative;
  display: block;
  width: var(--thumb-w);
  height: var(--thumb-h);
  padding: 0;
  border: var(--border);
  border-radius: var(--radius-s);
  background: var(--color-frame);
  cursor: pointer;
}
.qv__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-s) - 2px);
}
/* selected: thicker border + a bar underneath (shape, not colour alone) */
.qv__thumb[aria-current="true"] { border-width: 3px; }
.qv__thumb[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -8px;
  height: 3px;
  border-radius: 2px;
  background: var(--plum);
}
.qv__close {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  z-index: 1;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: var(--cream);
  color: var(--plum);
  cursor: pointer;
  transition: background-color var(--dur-fast) linear;
}
.qv__close:hover { background: var(--color-hover); }
.qv__close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.qv__body {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--space-2xs);
}
.qv__name {
  font-size: var(--step-3);
  line-height: 1.1;
  padding-right: var(--space-l);
}
.qv__caption {
  color: var(--color-ink-muted);
  line-height: 1.45;
}
.qv__buy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-s);
  margin-top: var(--space-2xs);
}
.qv__price {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.qv__size {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.qv__cta { margin-top: var(--space-2xs); padding-inline: 1.5em; }
.qv__notice {
  min-height: 3em;
  max-width: 34ch;
  font-size: var(--step--1);
}
/* .qv__notice dot: shared with .basket__notice in section 10 */
@media (prefers-reduced-motion: no-preference) {
  .qv[open] { animation: qv-in 260ms var(--ease-out); }
  .qv[open]::backdrop { animation: veil-in 260ms linear; }
  .qv__cta.is-shrug { animation: shrug 420ms var(--ease-soft); }
}
@keyframes qv-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes veil-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shrug {
  0%, 100% { transform: none; }
  30% { transform: translateY(-3px) rotate(-1.5deg); }
  60% { transform: translateY(-1px) rotate(1.5deg); }
}

@media (min-width: 768px) {
  .qv {
    width: min(880px, calc(100% - 4rem));
    max-height: calc(100svh - 4rem);
    margin: auto;
    border: var(--border);
    border-radius: var(--radius-l);
  }
  .qv__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-l);
    padding: var(--space-l);
  }
  /* left column: a 4:5 box at column width, capped by the viewport height
     minus the dialog chrome and the strip; if the cap bites it narrows and
     centres. Same size for every photo of the piece. */
  .qv__stage {
    --strip-h: calc(var(--thumb-h, 55px) + 2 * var(--space-2xs));
    height: auto;
    aspect-ratio: 4 / 5;
    width: min(100%, calc((100vh - 4rem - 2 * var(--space-l) - var(--strip-h)) * 0.8));
  }
  @supports (height: 1svh) {
    .qv__stage { width: min(100%, calc((100svh - 4rem - 2 * var(--space-l) - var(--strip-h)) * 0.8)); }
  }
  .qv__media.is-single .qv__stage { --strip-h: 0px; }
  .qv__nav {
    width: 48px;
    height: 48px;
    margin-top: -24px;
  }
  .qv__name { padding-right: var(--space-xl); }
}
@media (min-width: 1024px) {
  .qv__media,
  .qv__thumbs { --thumb-w: 56px; --thumb-h: 70px; }
}

/* --------------------------------------------------------------------------
   10. Basket dialog: a .qv variant.
   Mobile: bottom sheet. 768px+: a full-height panel on the right.
   -------------------------------------------------------------------------- */
.qv--basket { max-height: 92svh; }

.qv__inner.basket {
  --pad: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-s);
  min-height: 100%;
  padding: var(--space-m) var(--pad) 0;
}
.basket__title {
  font-size: var(--step-2);
  padding-right: calc(var(--tap) + var(--space-xs));
}
.basket__count {
  margin-top: calc(var(--space-xs) * -1);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

.basket__empty {
  display: grid;
  justify-items: start;
  gap: var(--space-2xs);
  padding-block: var(--space-l);
}
.basket__browse,
.page__back,
.summary__edit,
.legal__back a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: var(--tap);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: rgb(47 44 58 / 0.35);
  border-radius: var(--radius-s);
}
.basket__browse:hover,
.page__back:hover,
.summary__edit:hover,
.legal__back a:hover { text-decoration-color: var(--plum); }

.basket__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-line);
}
.basket__item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) var(--tap);
  align-items: center;
  gap: var(--space-s);
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--color-line);
}
.basket__thumb,
.summary__thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-s);
}
/* small thumbnails (ux-spec §10.2.1): the main photo's 480 variant, centre
   cover crop, alt="". Missing or failed: the empty oat frame, no text. */
.basket__thumb,
.summary__thumb { background: var(--color-frame); }
.basket__thumb img,
.summary__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.basket__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.basket__name {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.basket__price {
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.basket__state {
  display: flex;
  align-items: baseline;
  gap: 0.45em;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  line-height: 1.4;
}
.basket__state:empty { display: none; }
.basket__item.is-sold .basket__state,
.basket__item.is-reserved .basket__state {
  color: var(--color-ink);
  font-weight: var(--weight-medium);
}
.basket__item.is-sold .basket__state::before,
.basket__item.is-reserved .basket__state::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--plum);
}
.basket__item.is-reserved .basket__state::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--plum);
}
.basket__item.is-sold .basket__thumb,
.basket__item.is-reserved .basket__thumb { opacity: 0.6; }

.basket__remove {
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--plum);
  cursor: pointer;
  transition: background-color var(--dur-fast) linear;
}
.basket__remove:hover { background: var(--color-hover); }
.basket__remove svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.basket__foot {
  display: grid;
  gap: var(--space-xs);
  margin: auto calc(var(--pad) * -1) 0;
  padding: var(--space-s) var(--pad) var(--space-m);
  border-top: var(--border);
  background: var(--cream);
}
/* keep Subtotal + Checkout in view, but only when there is room (200% zoom) */
@media (min-height: 540px) {
  .basket__foot { position: sticky; bottom: 0; }
}
.basket__subtotal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 var(--space-s);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.basket__note {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.basket__checkout {
  width: 100%;
  min-height: var(--field-h);
  font-size: var(--step-0);
}
.basket__notice {
  font-size: var(--step--1);
  line-height: 1.45;
}
.basket__notice:not(:empty)::before,
.qv__notice:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--peach-deep);
  box-shadow: inset 0 0 0 var(--border-w) var(--plum);
  vertical-align: 0.02em;
}

@media (min-width: 768px) {
  .qv--basket {
    width: min(460px, 100%);
    height: 100svh;
    max-height: 100svh;
    margin: 0 0 0 auto;
    border: 0;
    border-left: var(--border);
    border-radius: var(--radius-l) 0 0 var(--radius-l);
  }
  .qv__inner.basket {
    --pad: var(--space-l);
    padding-top: var(--space-l);
  }
}
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .qv--basket[open] { animation: panel-in 260ms var(--ease-out); }
}
@keyframes panel-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   11. Pages: checkout + order share the page head and notice panels
   -------------------------------------------------------------------------- */
.page {
  padding-block: var(--space-m) var(--space-2xl);
  /* Checkout and order fill in after /api calls (loading line → form, checking →
     result). Keeping main at least a viewport tall puts the footer below the
     fold, so that growth never moves anything visible (CLS). */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
}
.page__head {
  display: grid;
  justify-items: start;
  gap: var(--space-2xs);
  margin-bottom: var(--space-l);
}
.page__back { font-size: var(--step--1); }
.page__back::before {          /* drawn chevron: no text for screen readers */
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
}
.page__title {
  font-size: var(--step-3);
}

.notice-panel {
  display: grid;
  justify-items: start;
  gap: var(--space-xs);
  max-width: 40rem;
  margin-bottom: var(--space-l);
  padding: var(--space-m);
  border: var(--border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}
.notice-panel__title { font-size: var(--step-2); }
.notice-panel__text { max-width: 60ch; }
.notice-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-2xs);
}
.notice-panel__note {
  max-width: 60ch;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

/* ---- checkout layout: one column, then form + sticky summary at 1024 ---- */
.checkout__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
}
.checkout__form,
.checkout__summary { min-width: 0; }
@media (min-width: 1024px) {
  .checkout__layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
    gap: var(--space-2xl);
    align-items: start;
  }
  .checkout__summary {
    position: sticky;
    top: calc(var(--header-h) + var(--space-m));
    max-height: calc(100svh - var(--header-h) - 2 * var(--space-m));
    overflow: auto;
    overscroll-behavior: contain;
  }
}

/* ---- error summary ---- */
.error-summary {
  display: grid;
  gap: var(--space-xs);
  margin-bottom: var(--space-l);
  padding: var(--space-m);
  border: 3px solid var(--alert);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}
.error-summary:focus {
  outline: var(--focus-w) solid var(--plum);
  outline-offset: var(--focus-offset);
}
.error-summary__title {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step-1);
}
.error-summary__title::before {   /* icon via background: adds no text */
  content: "";
  flex: none;
  width: 1.25em;
  height: 1.25em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9' fill='%238E2B22'/%3E%3Cpath d='M10 5.5v5.5' stroke='%23FBF7F0' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.5' r='1.2' fill='%23FBF7F0'/%3E%3C/svg%3E") center / contain no-repeat;
}
.error-summary__list {
  margin: 0;
  padding-left: 1.25em;
}
.error-summary__list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--alert);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  border-radius: var(--radius-s);
}

/* ---- form ---- */
.form {
  display: grid;
  gap: var(--space-l);
}
.form__group {
  min-width: 0;
  margin: 0 0 var(--space-s);
  padding: 0;
  border: 0;
  display: grid;
  gap: var(--space-m);
}
.form__legend {
  padding: 0;
  margin-bottom: var(--space-s);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.field {
  display: grid;
  gap: var(--space-2xs);
  max-width: 36rem;
  min-width: 0;
}
.field__label {
  font-weight: var(--weight-medium);
  line-height: 1.3;
}
.field__hint {
  margin-top: calc(var(--space-3xs) * -1);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  line-height: 1.4;
}
.field__input,
.field__select {
  width: 100%;
  min-height: var(--field-h);
  margin: 0;
  padding: 0.6em 0.8em;
  border: var(--field-border);
  border-radius: var(--radius-s);
  background-color: var(--color-surface);
  color: var(--plum);
  font: inherit;
  font-size: max(1rem, 16px);       /* >= 16px: no iOS zoom on focus */
  line-height: 1.3;
}
.field__input::placeholder { color: var(--color-ink-muted); opacity: 1; }
.field__select {
  appearance: none;
  padding-right: 2.75em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 5l4.5 4.5L11.5 5' fill='none' stroke='%232F2C3A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9em center;
  background-size: 14px 14px;
  cursor: pointer;
}

/* error state: red-glaze bar + border + icon + text (never colour alone) */
.field.is-invalid {
  padding-left: var(--space-s);
  border-left: 4px solid var(--alert);
}
.field.is-invalid .field__input,
.field.is-invalid .field__select {
  border-color: var(--alert);
  box-shadow: inset 0 0 0 1px var(--alert);
}
.field__error {
  display: flex;
  align-items: flex-start;
  gap: 0.45em;
  color: var(--alert);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  line-height: 1.4;
}
.field__error-icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- delivery choice tiles (radios) ---- */
.choice-group {
  display: grid;
  gap: var(--space-xs);
  max-width: 36rem;
}
.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-s);
  row-gap: 2px;
  min-height: 56px;
  padding: var(--space-s);
  border: var(--field-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  cursor: pointer;
  transition: background-color var(--dur-fast) linear;
}
.choice:hover { background: var(--color-tint); }
.choice__input {
  grid-row: 1 / span 2;
  appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: var(--field-border);
  border-radius: 50%;
  background: var(--color-surface);
  cursor: pointer;
}
.choice__input:checked {
  background: var(--plum);
  box-shadow: inset 0 0 0 4px var(--color-surface);
}
.choice__label {
  grid-column: 2;
  font-weight: var(--weight-medium);
  line-height: 1.3;
}
.choice__meta {
  grid-column: 2;
  font-size: var(--step--1);
  color: var(--color-ink-muted);     /* 5.53:1 on butter when selected */
  line-height: 1.4;
}
@supports selector(:has(*)) {
  .choice:has(.choice__input:checked) {
    background: var(--butter);
    box-shadow: inset 0 0 0 1px var(--plum);
  }
  /* ring the whole tile, not the small dot */
  .choice:has(.choice__input:focus-visible) {
    outline: var(--focus-w) solid var(--plum);
    outline-offset: var(--focus-offset);
  }
  .choice__input:focus-visible { outline: none; }
}

.form__info {
  max-width: 36rem;
  padding: var(--space-s) var(--space-m);
  border-left: 4px solid var(--plum);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--color-tint);
}

/* ---- terms checkbox: 44px hit box, 28px drawn box ---- */
.check {
  display: grid;
  grid-template-columns: var(--tap) minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-2xs);
  max-width: 40rem;
}
.check__input {
  appearance: none;
  width: var(--tap);
  height: var(--tap);
  margin: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect x='1' y='1' width='26' height='26' rx='5' fill='%23FFFDF9' stroke='%232F2C3A' stroke-width='2'/%3E%3C/svg%3E") center / 28px 28px no-repeat;
  cursor: pointer;
}
.check__input:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect x='1' y='1' width='26' height='26' rx='5' fill='%232F2C3A' stroke='%232F2C3A' stroke-width='2'/%3E%3Cpath d='M7.5 14.5l4.5 4.5 8.5-9.5' fill='none' stroke='%23FBF7F0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check__input[aria-invalid="true"]:not(:checked) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect x='1.5' y='1.5' width='25' height='25' rx='5' fill='%23FFFDF9' stroke='%238E2B22' stroke-width='3'/%3E%3C/svg%3E");
}
.check__input:focus-visible { outline-offset: -5px; }   /* ring sits 3px off the 28px box */
.check__label {
  padding-top: 0.6em;
  min-height: var(--tap);
  cursor: pointer;
}
.check__links,
.form__privacy {
  font-size: var(--step--1);
}
.check__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-m);
  margin-top: calc(var(--space-xs) * -1);
  padding-left: calc(var(--tap) + var(--space-2xs));
}
.form__privacy { color: var(--color-ink-muted); }
.check__links a,
.form__privacy a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--color-ink);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  border-radius: var(--radius-s);
}

/* ---- Turnstile (bot check), directly above the pay button ----
   The slot always reserves the managed widget's height (65px), so the pay
   button never moves when the widget loads, passes or re-renders.
   FE: render with the default appearance ("always") and size "flexible";
   "interaction-only" would leave an empty slot and then grow, avoid it. */
.checkout__turnstile {
  min-height: 65px;
  max-width: 36rem;
  min-width: 0;
}
/* the widget is at least 300px wide: at very narrow widths let it use the gutter */
@media (max-width: 359.98px) {
  .checkout__turnstile { margin-inline: calc(var(--gutter) * -1 + 4px); }
}

/* ---- pay ---- */
.btn--pay {
  width: 100%;
  min-height: 56px;
  padding: 0.6em 1.5em;
  font-size: var(--step-0);
  line-height: 1.25;
  white-space: normal;              /* wraps at 200% zoom instead of overflowing */
  text-align: center;
}
@media (min-width: 600px) {
  .btn--pay { width: auto; min-width: 20rem; justify-self: start; }
}
.form__paynote {
  max-width: 52ch;
  margin-top: calc(var(--space-s) * -1);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

/* ---- summary (checkout aside, reused on the order page) ---- */
.summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-s);
  padding: var(--space-m);
  border: var(--border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}
.summary > * { grid-column: 1 / -1; }
.summary > .summary__title { grid-column: 1; }
.summary > .summary__edit { grid-column: 2; }
.summary__title { font-size: var(--step-2); }
.summary__edit { font-size: var(--step--1); }

.summary__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-line);
}
.summary__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-s);
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--color-line);
}
.summary__name {
  font-weight: var(--weight-medium);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.summary__price,
.summary__row dd {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.summary__rows {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
}
.summary__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 var(--space-s);
}
.summary__row dt,
.summary__row dd { margin: 0; }
.summary__row--total {
  margin-top: var(--space-2xs);
  padding-top: var(--space-s);
  border-top: var(--border);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
}
.summary__vat {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

/* --------------------------------------------------------------------------
   12. Order page: one state block, then the details
   -------------------------------------------------------------------------- */
.order .page__title { margin-bottom: var(--space-2xs); }
.order__number {
  min-height: calc(var(--leading) * 1em);
  margin-bottom: var(--space-l);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}
/* The number starts [hidden] and appears after the status call: while it is
   hidden, the state block holds its line + gap, so nothing jumps (CLS). */
.order__number[hidden] + .order-state {
  margin-top: calc(var(--leading) * 1em + var(--space-l));
}
.order-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: var(--space-xs);
  max-width: 40rem;
  padding: var(--space-m);
  border: var(--border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}
.order-state__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: var(--border);
  border-radius: 50%;
  background: var(--cream);
  color: var(--plum);
}
.order-state__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* pastel = decoration only; the title text carries the meaning */
.order-state--checking .order-state__icon { background: var(--cream); }
.order-state--paid .order-state__icon { background: var(--mint); }
.order-state--pending .order-state__icon { background: var(--butter); }
.order-state--failed .order-state__icon,
.order-state--expired .order-state__icon { background: var(--peach); }
.order-state--canceled .order-state__icon,
.order-state--unknown .order-state__icon { background: var(--lilac); }
.order-state__title { font-size: var(--step-2); }
.order-state__text { max-width: 60ch; }
.order-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-2xs);
}
.order-state__actions:empty { display: none; }
@media (min-width: 600px) {
  .order-state {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--space-m);
  }
  .order-state > * { grid-column: 2; }
  .order-state > .order-state__icon { grid-column: 1; grid-row: 1 / span 5; }
}
.order__spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid var(--plum);
  border-right-color: transparent;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .btn.is-busy .btn__spinner { animation: spin 800ms linear infinite; }
  .order__spinner { animation: spin 1s linear infinite; }
}
.order__details {
  display: grid;
  gap: var(--space-s);
  max-width: 40rem;
  margin-top: var(--space-l);
  padding: var(--space-m);
  border: var(--border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}
.order__details h2 { font-size: var(--step-1); }
/* paid orders: the online withdrawal link (CEL art. VI.61/2) */
.order__withdraw {
  max-width: 40rem;
  margin-top: var(--space-l);
  padding: var(--space-s) var(--space-m);
  border-left: 4px solid var(--plum);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--color-tint);
}
.order__withdraw a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: var(--weight-medium);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

/* --------------------------------------------------------------------------
   12b. Online withdrawal (withdraw.html, CEL art. VI.61/2): form -> review -> done.
   One column, the checkout form look. Reuses .page, .notice-panel, .error-summary,
   .form, .field*, .checkout__turnstile, .btn--pay, .order-state.
   -------------------------------------------------------------------------- */
.withdraw__layout { max-width: 40rem; }
/* checkout: payment methods before the details step (F12) */
.checkout__methods { margin-bottom: var(--space-l); }
.withdraw__intro {
  max-width: 60ch;
  margin-bottom: var(--space-l);
}
.withdraw__step { display: grid; gap: var(--space-s); }
.withdraw__step > .form { gap: var(--space-l); }
.field__input--short { max-width: 14rem; }
.field__textarea {
  min-height: calc(4 * 1.3em + 1.2em);
  resize: vertical;
}
.withdraw__step-title { font-size: var(--step-2); }
.withdraw__subtitle {
  margin-top: var(--space-m);
  font-size: var(--step-1);
}

/* the statement exactly as sent: a quiet "letter" block */
.withdraw__statement {
  display: grid;
  gap: var(--space-s);
  padding: var(--space-m);
  border: var(--border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}
.withdraw__statement-text {
  max-width: 60ch;
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}
.withdraw__fields,
.withdraw__meta {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
}
.withdraw__field,
.withdraw__meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--space-s);
}
.withdraw__field dt,
.withdraw__meta-row dt {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.withdraw__field dd,
.withdraw__meta-row dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.withdraw__message { white-space: pre-line; }
.withdraw__note {
  max-width: 60ch;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
@media (min-width: 600px) {
  .withdraw__field,
  .withdraw__meta-row { grid-template-columns: 9rem minmax(0, 1fr); align-items: baseline; }
}
.withdraw__meta-row dd { font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }

.withdraw__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  margin-top: var(--space-xs);
}
.withdraw__actions .btn--pay { justify-self: auto; }
.withdraw__done-head { margin-bottom: var(--space-xs); }
.withdraw__done-head .withdraw__meta { width: 100%; }
.withdraw__next {
  max-width: 60ch;
  margin: 0;
  padding-left: 1.25em;
}
.withdraw__next li + li { margin-top: var(--space-2xs); }

/* --------------------------------------------------------------------------
   12c. EU harmonised notice on the legal guarantee (Reg. (EU) 2025/1960).
   The official Commission artwork, never redrawn, cropped or recoloured:
   shown whole, at its own proportions, never smaller than its box allows.
   -------------------------------------------------------------------------- */
.guarantee-notice {
  margin: var(--space-m) 0 0;
}
.guarantee-notice__img,
.guarantee__img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  background: #fff;
  border: 1px solid var(--color-line);
}
.guarantee-notice figcaption {
  margin-top: var(--space-xs);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
/* checkout: the sentence under the summary; the notice opens in a dialog */
.guarantee { margin-top: var(--space-s); }
.guarantee__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: var(--tap);
  padding: 0 0.25em;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: rgb(47 44 58 / 0.45);
  cursor: pointer;
}
.guarantee__toggle:hover { text-decoration-color: var(--plum); }
.guarantee__toggle svg {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.qv__inner.guarantee__dialog {
  grid-template-columns: minmax(0, 1fr);   /* never the quick-view two columns */
  align-items: start;
  justify-items: center;
  padding-top: var(--space-m);
}
.guarantee__dialog > * { justify-self: stretch; }
.guarantee__dialog > .guarantee__img { justify-self: center; }
.guarantee__title {
  font-size: var(--step-2);
  padding-right: calc(var(--tap) + var(--space-xs));
}
.guarantee__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-m);
  font-size: var(--step--1);
}
.guarantee__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: var(--weight-medium);
  text-underline-offset: 0.3em;
  overflow-wrap: anywhere;
}
.qv--notice { max-height: 100svh; }
@media (min-width: 768px) {
  .qv--notice {
    width: min(840px, calc(100% - 2 * var(--gutter)));
    max-height: 94svh;
    margin: auto;
    border: var(--border);
    border-radius: var(--radius-l);
  }
  .qv__inner.guarantee__dialog { padding: var(--space-l); }
}

/* --------------------------------------------------------------------------
   13. Legal pages: static, no JS, readable line length
   -------------------------------------------------------------------------- */
.legal {
  padding-block: var(--space-l) var(--space-2xl);
}
.legal__body { max-width: 68ch; }
.legal__title { font-size: var(--step-3); }
.legal__updated {
  margin-top: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.legal__draft {
  margin-top: var(--space-m);
  padding: var(--space-s) var(--space-m);
  border: 1.5px dashed var(--plum);
  border-radius: var(--radius-m);
  background: var(--butter);         /* plum on butter 10.60:1 */
  font-weight: var(--weight-medium);
}
.legal__body h2 {
  margin-top: var(--space-xl);
  font-size: var(--step-2);
}
.legal__body h3 {
  margin-top: var(--space-m);
  font-size: var(--step-1);
}
.legal__body p,
.legal__body ul,
.legal__body ol,
.legal__body dl { margin-top: var(--space-s); }
.legal__body ul,
.legal__body ol { padding-left: 1.25em; margin-bottom: 0; }
.legal__body li + li { margin-top: var(--space-3xs); }
.legal__body dt { font-weight: var(--weight-medium); margin-top: var(--space-xs); }
.legal__body dd { margin: var(--space-3xs) 0 0; }
.legal__body a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}
.tbc {
  padding: 0 0.3em;
  border-radius: 4px;
  background: var(--butter);         /* plum on butter 10.60:1; [TBC] text, not colour, is the cue */
  color: var(--plum);
  box-shadow: inset 0 0 0 1px rgb(47 44 58 / 0.35);
  font-weight: var(--weight-medium);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* EU model withdrawal form: looks fillable on screen and on paper */
.legal__form {
  margin-top: var(--space-xl);
  padding: var(--space-m);
  border: var(--border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}
.legal__form h2 { margin-top: 0; }
.legal__form .legal__fill {
  list-style: none;
  padding: 0;
}
.legal__fill li + li { margin-top: var(--space-s); }
.legal__blank {
  display: block;
  min-height: 2.2em;
  border-bottom: 1px solid var(--plum);
}
.legal__back { margin-top: var(--space-xl); }
/* "Withdraw from contract here" (CEL art. VI.61/2): a button-like link at the top of
   "How to withdraw"; static page, no JS */
.legal__body a.btn {
  text-decoration: none;
  overflow-wrap: normal;
}
.legal__cta {
  margin-top: var(--space-s);
}
.legal__cta .btn {
  min-height: 48px;
  padding-inline: 1.4em;
  font-size: var(--step-0);
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

@media print {
  .skip-link,
  .site-header,
  .site-footer,
  .legal__back { display: none; }
  body::after { display: none; }
  html, body { background: #fff; }
  .legal__draft,
  .tbc { background: none; }
  .legal__form { break-inside: avoid; }
}

/* --------------------------------------------------------------------------
   14. Admin (/admin, ux-spec §10.5). Phone first, every target >= 44px,
   content max 40rem, field text >= 16px (no iOS zoom). Same tokens.
   Reuses: .btn, .btn--primary, .btn--danger, .btn--text, .page__back,
   .notice-panel, .error-summary, .field*, .check*, .visually-hidden.
   -------------------------------------------------------------------------- */
.admin {                            /* on <body> of the admin page */
  --step--1: 0.9375rem;             /* secondary text never below 15px here */
  font-size: max(1rem, var(--step-0));
}
html:has(.admin-savebar),
html.is-admin-edit { scroll-padding-bottom: 88px; }   /* fields never hide under the save bar */
.admin .btn {                        /* long labels wrap at 320px, never overflow */
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  padding-block: 0.45em;
}
.btn--wide { width: 100%; min-height: var(--field-h); font-size: var(--step-0); }
@media (min-width: 600px) {
  .btn--wide { width: auto; }
}
.btn--text[aria-disabled="true"] { border-color: var(--plum); text-decoration: none; }

/* ---- session bar (not sticky) ---- */
.admin-bar {
  border-bottom: 1px solid var(--color-line);
  background: var(--cream);
}
.admin-bar__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title out" "who shop";
  align-items: center;
  column-gap: var(--space-s);
  max-width: calc(40rem + 2 * var(--gutter));
  margin-inline: auto;
  padding: var(--space-3xs) var(--gutter);
}
.admin-bar__title {
  grid-area: title;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--weight-bold);
}
.admin-bar__who {
  grid-area: who;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.admin-bar__signout { grid-area: out; justify-self: end; }
.admin-bar__shop { grid-area: shop; justify-self: end; }
@media (min-width: 600px) {
  .admin-bar__inner {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "title who shop out";
  }
}
.admin-offline {                    /* role=status banner under the bar */
  padding: var(--space-xs) var(--gutter);
  border-bottom: var(--border);
  background: var(--butter);         /* plum on butter 10.60:1 */
  font-weight: var(--weight-medium);
  text-align: center;
}

.admin-link,
.admin-bar__signout,
.admin-bar__shop {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: rgb(47 44 58 / 0.35);
  border-radius: var(--radius-s);
}
.admin-link:hover,
.admin-bar__signout:hover,
.admin-bar__shop:hover { text-decoration-color: var(--plum); }

/* ---- screen frame ---- */
.admin-main {
  max-width: calc(40rem + 2 * var(--gutter));
  margin-inline: auto;
  padding: var(--space-m) var(--gutter) var(--space-2xl);
}
.admin-main:has(.admin-savebar) { padding-bottom: 0; }
.admin-main .field { max-width: none; }
.admin-head {
  display: grid;
  justify-items: start;
  gap: var(--space-xs);
  margin-bottom: var(--space-l);
}
.admin-title { font-size: var(--step-3); }
.admin-title-row {                  /* h1 + status chip */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-s);
}
.admin-hint { color: var(--color-ink-muted); }
.admin-section {                    /* h2: Details, Photos, In the shop */
  margin-top: var(--space-xl);
  margin-bottom: var(--space-s);
  font-size: var(--step-2);
}
.admin-form { display: grid; gap: var(--space-m); }

/* info banner (reserved / sold): oat block, info icon, text */
.admin-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-xs);
  padding: var(--space-s) var(--space-m);
  border: var(--border);
  border-radius: var(--radius-m);
  background: var(--color-tint);     /* plum on oat 11.14:1 */
}
.admin-banner::before,
.icon-info {
  content: "";
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  margin-top: 0.1em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.5' fill='none' stroke='%232F2C3A' stroke-width='1.6'/%3E%3Cpath d='M10 9v5' stroke='%232F2C3A' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='6.2' r='1.1' fill='%232F2C3A'/%3E%3C/svg%3E") center / contain no-repeat;
}
.icon-lock {                         /* span, aria-hidden */
  display: inline-block;
  flex: none;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='4' y='9' width='12' height='9' rx='2' fill='none' stroke='%232F2C3A' stroke-width='1.6'/%3E%3Cpath d='M6.8 9V6.6a3.2 3.2 0 0 1 6.4 0V9' fill='none' stroke='%232F2C3A' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- status chip: word always + shape cue (ux-spec §10.5.2) ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.15em 0.65em;
  border: 1px solid var(--plum);
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--plum);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  line-height: 1.3;
  white-space: nowrap;
}
.chip::before {                     /* solid dot */
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--plum);
}
.chip--live { background: var(--mint); }                       /* plum 9.80:1 */
.chip--draft { background: var(--oat); border-style: dashed; } /* no dot */
.chip--draft::before { display: none; }
.chip--hidden,
.chip--reserved,
.chip--sold-hidden { border-style: dashed; }
.chip--reserved { background: var(--butter); }                 /* plum 10.60:1 */
.chip--hidden::before,
.chip--reserved::before {           /* hollow dot */
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--plum);
}

/* ---- round icon button (move up/down, earlier/later): 44 x 44 ---- */
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: var(--border);
  border-radius: 50%;
  background: var(--cream);
  color: var(--plum);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--dur-fast) linear;
}
.icon-btn:hover { background: var(--color-hover); }
.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn[aria-disabled="true"],
.icon-btn[aria-disabled="true"]:hover {   /* end of list: dashed, still focusable */
  border-style: dashed;
  background: var(--cream);
  cursor: not-allowed;
}

/* ---- piece list (#/) ---- */
.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-line);
}
.admin-row {
  position: relative;               /* for the stretched name link */
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-s);
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--color-line);
}
.admin-row__thumb,
.photo-tile__preview {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--color-frame);    /* empty oat frame when there is no photo */
}
.admin-row__thumb { width: 56px; aspect-ratio: 4 / 5; }
.admin-row__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-row__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.admin-row__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--weight-bold);
  line-height: 1.3;
}
.admin-row__link {                 /* 44px tall box of its own, plus the stretched row */
  display: inline-block;
  max-width: 100%;
  min-height: var(--tap);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: top;
  line-height: var(--tap);
  text-decoration: none;
  border-radius: var(--radius-s);
}
.admin-row__link::after {           /* whole row clickable for pointers */
  content: "";
  position: absolute;
  inset: 0;
}
.admin-row:hover .admin-row__link { text-decoration: underline; text-underline-offset: 0.2em; }
.admin-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xs) var(--space-2xs);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.admin-row__price {
  color: var(--color-ink);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}
.admin-row__moves {
  position: relative;               /* above the stretched link */
  z-index: 1;
  display: grid;
  gap: var(--space-2xs);
}
.admin-row.is-skeleton { pointer-events: none; }
.admin-row.is-skeleton .skeleton-bar { width: 70%; }

/* ---- edit screen: fields (BR-1 counters, BR-2 price) ---- */
.field__counter {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}
.field__counter.is-over {           /* counterOver: alert + icon + text */
  display: flex;
  align-items: flex-start;
  gap: 0.45em;
  color: var(--alert);
  font-weight: var(--weight-medium);
}
.field__counter.is-over::before {
  content: "";
  flex: none;
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.1em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9' fill='%238E2B22'/%3E%3Cpath d='M10 5.5v5.5' stroke='%23FBF7F0' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.5' r='1.2' fill='%23FBF7F0'/%3E%3C/svg%3E") center / contain no-repeat;
}
.field__input[aria-invalid="true"] {
  border-color: var(--alert);
  box-shadow: inset 0 0 0 1px var(--alert);
}
.field__box { position: relative; }  /* wraps the input for the € prefix / lock */
.field__prefix {                    /* "€", aria-hidden; the label says "in euros" */
  position: absolute;
  top: 50%;
  left: 0.85em;
  transform: translateY(-50%);
  font-weight: var(--weight-medium);
  pointer-events: none;
}
.field__box--prefix .field__input { padding-left: 2em; }
.field__box .icon-lock {
  position: absolute;
  top: 50%;
  right: 0.85em;
  transform: translateY(-50%);
  pointer-events: none;
}
.field__box--locked .field__input { padding-right: 2.75em; }
.field__input[readonly] { background-color: var(--color-tint); }   /* still focusable */
.field__preview {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

/* web address: read-only text, not an input */
.admin-slug {
  display: grid;
  gap: var(--space-3xs);
  margin: 0;
}
.admin-slug__label { font-weight: var(--weight-medium); }
.admin-slug__value {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  overflow-wrap: anywhere;
}
.admin-slug__note {
  margin: 0;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}

/* "Show in the shop": .check (44px hit box, 28px box) + aria-disabled look */
.check__input[aria-disabled="true"] {
  cursor: not-allowed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect x='1' y='1' width='26' height='26' rx='5' fill='%23FBF7F0' stroke='%232F2C3A' stroke-width='2' stroke-dasharray='4 3'/%3E%3C/svg%3E");
}
.check__input[aria-disabled="true"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect x='1' y='1' width='26' height='26' rx='5' fill='%23FBF7F0' stroke='%232F2C3A' stroke-width='2' stroke-dasharray='4 3'/%3E%3Cpath d='M7.5 14.5l4.5 4.5 8.5-9.5' fill='none' stroke='%232F2C3A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check__input[aria-disabled="true"] + .check__label { cursor: not-allowed; }
.check__hint {
  grid-column: 2;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  line-height: 1.4;
}

/* delete at the very end, after a hairline */
.admin-danger {
  display: grid;
  justify-items: start;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
  padding-top: var(--space-l);
  border-top: 1px solid var(--color-line);
}
.admin-note {                       /* blocked reason, busy, full: text + info icon */
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  font-size: var(--step--1);
  line-height: 1.4;
}

/* sticky save bar: last child of .admin-main on the edit screen */
.admin-savebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  min-height: 64px;
  margin: var(--space-xl) calc(var(--gutter) * -1) 0;
  padding: var(--space-2xs) var(--gutter);
  padding-bottom: calc(var(--space-2xs) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-line);
  background: var(--cream);
}
.admin-savebar__status {
  min-width: 0;
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.admin-savebar .btn { flex: none; min-width: 7rem; }

/* ---- photo manager ---- */
.photos__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3xs) var(--space-s);
}
.photos__head .admin-section { margin-bottom: 0; }
.photos__count {
  font-size: var(--step--1);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}
.photos__intro {                    /* note + hint */
  display: grid;
  gap: var(--space-3xs);
  margin-block: var(--space-xs) var(--space-s);
  font-size: var(--step--1);
  color: var(--color-ink-muted);
}
.photos__add-wrap {
  display: grid;
  justify-items: start;
  gap: var(--space-2xs);
}
.photo-list {
  list-style: none;
  margin: var(--space-m) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-s);
}
.photo-tile {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-s);
  padding: var(--space-s);
  border: var(--border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}
.photo-tile:focus-visible {         /* focus lands here after "Make main" */
  outline: var(--focus-w) solid var(--plum);
  outline-offset: var(--focus-offset);
}
.photo-tile__preview { width: 96px; height: 120px; }
.photo-tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;              /* other tiles: the whole photo on oat */
}
.photo-tile--main .photo-tile__img { object-fit: cover; }   /* tile 1: the shop card's 4:5 crop */
.photo-tile.is-queued .photo-tile__img,
.photo-tile.is-processing .photo-tile__img,
.photo-tile.is-uploading .photo-tile__img { opacity: 0.7; }
.photo-tile.is-failed {
  border-color: var(--alert);
  box-shadow: inset 4px 0 0 var(--alert);
}
.photo-tile__body {
  display: grid;
  align-content: start;
  gap: var(--space-2xs);
  min-width: 0;
}
.photo-tile__main {                 /* static "★ Main photo" label */
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: var(--tap);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
}
.photo-tile__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
}
.photo-tile__actions .btn--text { margin-left: auto; }
.photo-tile__status {
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.photo-tile__progress {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 10px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--plum);
  overflow: hidden;
}
.photo-tile__progress::-webkit-progress-bar { background: var(--cream); }
.photo-tile__progress::-webkit-progress-value { background: var(--plum); }
.photo-tile__progress::-moz-progress-bar { background: var(--plum); }

/* photo description disclosure */
.photo-tile__alt > summary {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-height: var(--tap);
  font-weight: var(--weight-medium);
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius-s);
}
.photo-tile__alt > summary::-webkit-details-marker { display: none; }
.photo-tile__alt > summary::before {   /* drawn chevron, no text */
  content: "";
  flex: none;
  width: 0.45em;
  height: 0.45em;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
}
.photo-tile__alt[open] > summary::before { transform: rotate(45deg); }
.photo-tile__alt .field { margin-top: var(--space-2xs); }

/* ---- confirm dialogs (native <dialog>, showModal) ---- */
.admin-dialog {
  width: min(28rem, calc(100% - 2 * var(--gutter)));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: var(--space-m);
  border: var(--border);
  border-radius: var(--radius-l);
  background: var(--cream);
  color: var(--plum);
  overflow: auto;
  overscroll-behavior: contain;
}
.admin-dialog::backdrop {
  background: var(--color-veil);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.admin-dialog__title {
  padding-right: calc(var(--tap) + var(--space-2xs));   /* room for an optional .qv__close */
  font-size: var(--step-2);
}
.admin-dialog__text { margin-top: var(--space-xs); max-width: 60ch; }
.admin-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-m);
}
.admin-dialog__actions .btn { flex: 1 1 10rem; min-height: var(--field-h); }
@media (prefers-reduced-motion: no-preference) {
  .admin-dialog[open] { animation: qv-in 200ms var(--ease-out); }
}

/* Windows High Contrast / forced colours: hand the drawn controls back to the OS */
@media (forced-colors: active) {
  .check__input,
  .choice__input,
  .field__select { appearance: auto; background-image: none; }
  .check__input { width: 24px; height: 24px; margin: 10px; }
  .basket-btn__count,
  .card__badge,
  .chip,
  .qv__count { border: 1px solid CanvasText; }
  .qv__nav,
  .qv__thumb,
  .icon-btn { border-color: ButtonText; }
  .qv__thumb[aria-current="true"] { border-color: Highlight; }
  .qv__thumb[aria-current="true"]::after,
  .gallery__empty::before { background: CanvasText; }
  .chip::before { forced-color-adjust: none; background: CanvasText; }
  .chip--hidden::before,
  .chip--reserved::before { background: transparent; box-shadow: inset 0 0 0 1.5px CanvasText; }
  .qv__close:focus-visible,
  .qv__nav:focus-visible,
  .qv__thumb:focus-visible { box-shadow: none; }
}

/* --------------------------------------------------------------------------
   15. Reduced motion: things simply appear
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    /* none, not 0.01ms: a short duration with the default transition-property
       "all" would also transition visibility (page reveal) and block clicks */
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .card.is-entering { opacity: 1; transform: none; }
}
