/* ==========================================================================
   Zabaeh — the butcher identity layer (loaded last, after layer.css).
   Rules: theme tokens only; logical properties only (RTL and LTR); gap, not margins, between siblings; flat colour,
   no shadows; text-holding flex/grid children get min-width: 0.
   ========================================================================== */

/* ══ 1. Product card — the butcher's counter label ══════════════════════════
   The photo ends in a zigzag cut, like butcher paper torn on the counter's edge. Under it a paper label: the name, a
   perforated line, then the price in butcher red beside a square add button. A discount is a tilted ink stamp.
   Flat: a hairline frame, no shadow, no lift. */
.product-card--market {
  --bl-paper: color-mix(in srgb, var(--accent) 7%, var(--card-bg));
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "media media" "body body" "price foot";
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  background: var(--bl-paper);
  box-shadow: none;
  transform: none;
  transition: border-color var(--t-fast) var(--ease);
}
.product-card--market:hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.product-card--market .product-card__media {
  aspect-ratio: 1;
  background: var(--card-bg);
  /* the zigzag cut along the foot of the photo */
  -webkit-mask: conic-gradient(from -45deg at 50% 100%, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 0.75rem 51% repeat-x, linear-gradient(#000 0 0) 0 0 / 100% 50.5% no-repeat;
          mask: conic-gradient(from -45deg at 50% 100%, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 0.75rem 51% repeat-x, linear-gradient(#000 0 0) 0 0 / 100% 50.5% no-repeat;
}
.product-card--market:hover .product-card__img { transform: scale(1.03); }
.product-card--market .product-card__fav {
  inset-block-start: 0.375rem;
  inset-inline-start: 0.375rem;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 0.5rem;
  background: var(--card-bg);
  box-shadow: none;
}
/* badges: flat tags; the discount is an ink stamp */
.product-card--market .product-card__flags { inset-block-start: 0.375rem; inset-inline-end: 0.375rem; gap: 0.25rem; align-items: flex-end; }
.product-card--market .product-card__flags .badge { border-radius: 0.25rem; font-size: 0.6875rem; font-weight: 700; box-shadow: none; }
.product-card--market .product-card__flags .badge--discount {
  padding: 0.1875rem 0.4375rem;
  border: 1.5px solid var(--sale);
  border-radius: 0.25rem;
  background: var(--card-bg);
  color: var(--sale);
  rotate: -5deg;
  outline: 1px dashed color-mix(in srgb, var(--sale) 55%, transparent);
  outline-offset: 2px;
}
[dir="ltr"] .product-card--market .product-card__flags .badge--discount { rotate: 5deg; }
.product-card--market .product-card__bundle-tag { border-radius: 0.25rem; box-shadow: none; }

/* the label */
.product-card--market .product-card__body {
  display: contents;                     /* its children take their own grid areas */
}
.product-card--market .product-card__title {
  grid-area: body;
  min-height: 2.7em;
  padding: 0.375rem 0.625rem 0.5rem;
  border-block-end: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent);   /* the perforation */
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
}
.product-card--market .product-card__brand,
.product-card--market .product-card__rating,
.product-card--market .product-card__hint,
.product-card--market .card-swatches,
.product-card--market .bundle-peek { display: none; }
.product-card--market .product-card__prices {
  grid-area: price;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  padding: 0.4375rem 0.625rem 0.5rem;
  padding-inline-end: 0.25rem;
}
.product-card--market .product-card__prices .price { font-family: var(--font-display); font-size: 1.125rem; font-weight: 900; line-height: 1.15; color: var(--sale); }
.product-card--market .product-card__prices .price__currency { font-size: 0.6em; font-weight: 700; }
.product-card--market .product-card__from { font-size: 0.625rem; color: var(--muted); }
.product-card--market .price-was { font-size: 0.6875rem; color: var(--muted); }
.product-card--market .product-card__foot { grid-area: foot; padding: 0; padding-inline-end: 0.5rem; }
.product-card--market .product-card__foot .btn {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 0.5rem;
  background: var(--primary);
  color: var(--on-primary);
}
.product-card--market .product-card__foot .btn:hover,
.product-card--market:hover .product-card__foot .btn { background: var(--primary-deep, var(--primary)); color: var(--on-primary); }
.product-card--market .product-card__foot .btn .icon { width: 1.0625rem; height: 1.0625rem; }
.product-card--market .product-card__foot .btn[disabled] { display: none; }

/* ══ 2. Home intro — photo tile, the chalkboard of today's prices, categories ══
   Flat. The photo carries the colour; the board is the theme's dark green as a slate, with a chalk frame (a hairline
   inset), dotted leaders between name and price, and chalk-white type. Categories reuse the card's zigzag paper cut. */
.bintro { padding-block: var(--space-4) var(--space-8); }
.bintro__inner { display: flex; flex-direction: column; gap: var(--space-6); }
.bintro__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
@media (min-width: 1024px) {
  .bintro { padding-block: var(--space-6) var(--space-10); }
  .bintro__top { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: var(--space-4); }
  .bintro__top--solo { grid-template-columns: minmax(0, 1fr); }
}

/* the photo tile */
.bintro-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  min-height: 22rem;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--scheme-dark-bg);
  color: var(--on-media);
  isolation: isolate;
}
@media (min-width: 768px) { .bintro-hero { min-height: 27rem; } }
.bintro-hero__img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.bintro-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  /* solid token colour faded by a mask — color-mix(…transparent) gradient stops paint solid in some Chrome builds */
  background: var(--shadow-color);
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / 0.7) 45%, transparent 90%);
  mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / 0.7) 45%, transparent 90%);
  pointer-events: none;
}
@media (min-width: 1024px) {
  .bintro-hero::after {
    -webkit-mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / 0.5) 50%, transparent 80%);
    mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / 0.5) 50%, transparent 80%);
  }
}
/* phone: three rows on the board keep the intro short */
@media (max-width: 767px) { .board__list li:nth-child(n + 4) { display: none; } }
.bintro-hero__copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); width: 100%; max-width: 34rem; padding: var(--space-5); }
@media (min-width: 768px) { .bintro-hero__copy { padding: var(--space-8); } }
.bintro-hero__title { font-family: var(--font-display); font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.875rem); font-weight: 900; line-height: 1.2; color: var(--on-media); text-wrap: balance; overflow-wrap: anywhere; }
.bintro-hero__text { font-size: var(--text-base); line-height: 1.7; color: color-mix(in srgb, var(--on-media) 88%, transparent); }
.bintro-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-block-start: var(--space-1); }
.bintro-hero__cta,
.bintro-hero__cta:hover {
  gap: var(--space-2);
  min-height: 2.875rem;
  padding-inline: var(--space-5);
  border: 0;
  border-radius: 0.625rem;
  background: var(--on-media);
  color: var(--shadow-color);
  font-weight: 700;
  box-shadow: none;
}
.bintro-hero__cta:hover { background: color-mix(in srgb, var(--on-media) 88%, transparent); }
.bintro-hero__cta--ghost,
.bintro-hero__cta--ghost:hover { background: transparent; color: var(--on-media); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-media) 70%, transparent); }
.bintro-hero__cta--ghost:hover { background: color-mix(in srgb, var(--on-media) 12%, transparent); }

/* the chalkboard */
.board {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-5);
  border-radius: 1rem;
  background: var(--scheme-dark-bg);
  color: var(--on-media);
  outline: 1px solid color-mix(in srgb, var(--on-media) 22%, transparent);   /* the chalk frame */
  outline-offset: -0.5rem;
}
@media (min-width: 1024px) { .board { padding: var(--space-6); } }
.board__title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 900; color: var(--on-media); }
.board__note { font-size: var(--text-xs); color: color-mix(in srgb, var(--on-media) 70%, transparent); }
.board__list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.board__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding-block: 0.5625rem;
  border-block-end: 1px dashed color-mix(in srgb, var(--on-media) 16%, transparent);
  color: var(--on-media);
}
.board__list li:last-child .board__row { border-block-end: 0; }
.board__row:hover { color: var(--accent); }
.board__name { min-width: 0; font-size: var(--text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__dots { flex: 1; min-width: 1rem; border-block-end: 2px dotted color-mix(in srgb, var(--on-media) 35%, transparent); translate: 0 -0.25rem; }
.board__price { flex: none; font-family: var(--font-display); font-size: var(--text-base); font-weight: 800; color: var(--accent); white-space: nowrap; }
.board__price small { font-family: var(--font-body); font-size: 0.6875rem; font-weight: 500; color: color-mix(in srgb, var(--on-media) 70%, transparent); }
.board__all { display: inline-flex; align-items: center; gap: 0.25rem; align-self: flex-start; margin-block-start: auto; font-size: var(--text-sm); font-weight: 700; color: var(--on-media); }
.board__all:hover { color: var(--accent); }

/* categories: photo tiles cut like butcher paper, the name under */
.bintro__cats { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.bintro__cats-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.bintro__cats-title { font-family: var(--font-display); font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem); font-weight: 900; }
.bintro__cats-all { display: inline-flex; align-items: center; gap: 0.25rem; flex: none; font-size: var(--text-sm); font-weight: 700; color: var(--primary); }
.bintro__cats-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 30%;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.bintro__cats-row::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .bintro__cats-row { grid-auto-columns: 20%; } }
@media (min-width: 1024px) { .bintro__cats-row { grid-auto-flow: row; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); overflow: visible; } }
.bcat { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; scroll-snap-align: start; color: var(--ink); text-align: center; }
.bcat__media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-start-start-radius: 0.75rem;
  border-start-end-radius: 0.75rem;
  background: var(--card-bg);
  -webkit-mask: conic-gradient(from -45deg at 50% 100%, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 0.625rem 51% repeat-x, linear-gradient(#000 0 0) 0 0 / 100% 50.5% no-repeat;
          mask: conic-gradient(from -45deg at 50% 100%, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 0.625rem 51% repeat-x, linear-gradient(#000 0 0) 0 0 / 100% 50.5% no-repeat;
}
.bcat__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale var(--t-slow) var(--ease-out); }
.bcat:hover .bcat__media img { scale: 1.05; }
@media (prefers-reduced-motion: reduce) { .bcat:hover .bcat__media img { scale: 1; } }
.bcat__name { font-size: var(--text-sm); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.bcat:hover .bcat__name { color: var(--primary); }

/* ══ 3. Flash deals — the dark counter band with a scale readout ═══════════
   Board green with straight edges; the countdown reads like the digital window of a meat scale, and the title is
   written in chalk (see "The chalk" below). Colours come from the settings tokens. */
.section--flash {
  background: var(--scheme-dark-bg);
  color: var(--scheme-dark-text);
}
.section--flash::before { content: none; }
.section--flash > .container { padding-block: 2rem 2.25rem; }
@media (min-width: 1024px) { .section--flash > .container { padding-block: 2.75rem 3rem; } }
.section--flash .section-head { margin-block-end: 1.25rem; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.section--flash .section-head__titles { min-width: 0; }
.section--flash .section-head__title { color: var(--scheme-dark-text); }
.section--flash .section-head__zap { color: var(--accent); }

/* the scale readout: one dark window, gold digits, small units under them */
.section--flash .countdown {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.125rem;
  padding: 0.375rem 0.625rem 0.3125rem;
  border-radius: 0.5rem;
  background: var(--shadow-color);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--scheme-dark-bg));
}
.section--flash .countdown__cell { gap: 0.125rem; min-width: 1.75rem; }
.section--flash .countdown__cell b {
  width: auto;
  height: auto;
  min-width: 1.75rem;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
}
.section--flash .countdown__cell small { color: color-mix(in srgb, var(--scheme-dark-text) 60%, var(--shadow-color)); font-size: 0.5625rem; }
.section--flash .countdown__sep { display: block; color: var(--accent); opacity: 0.6; font-size: 1.125rem; line-height: 1.15; }
.section--flash .countdown__sep[hidden] { display: none; }
@media (min-width: 768px) {
  .section--flash .countdown { padding: 0.5rem 0.875rem 0.375rem; }
  .section--flash .countdown__cell { min-width: 2.25rem; }
  .section--flash .countdown__cell b { width: auto; height: auto; font-size: 1.625rem; }
  .section--flash .countdown__sep { font-size: 1.5rem; }
}

/* arrows: flat paper buttons on the green */
.section--flash .rail-btn { background: var(--card-bg, var(--surface)); color: var(--ink-800); box-shadow: none; }
.section--flash .rail-btn:hover { background: var(--accent); color: var(--shadow-color); }
.section--flash :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the readout reads like a scale display (hours first, left to right) in both directions */
.section--flash .countdown { direction: ltr; }
/* phone: title and readout share one row when there is no "View all" link */
@media (max-width: 639px) {
  .section--flash .flash-head--end:not(:has(.section-head__link)) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "eyebrow eyebrow" "title cd"; align-items: center; }
  .section--flash .flash-head--end .countdown { margin-block-start: 0; }
  .section--flash .countdown__cell { min-width: 1.5rem; }
  .section--flash .countdown__cell b { min-width: 1.5rem; font-size: 1.0625rem; }
  .section--flash .countdown__sep { font-size: 0.9375rem; }
}
/* dark mode: the page is already board green, so lift the band a step to keep it apart from the page */
[data-mode="dark"] .section--flash { background: color-mix(in srgb, var(--scheme-dark-bg) 90%, var(--scheme-dark-text)); }

/* ══ Top of the home page: header → stories → hero ═════════════════════
   The generic home rhythm (layer.css --home-gap) is a good gap between big sections, but the stories strip is a
   small, light row, so it sits close under the header and close above the hero, like an app's story bar. */
.page--tpl-index .page__main > .section--stories:first-child { margin-block-start: 0.75rem; }
.page--tpl-index .page__main > .section--stories + * { margin-block-start: 1rem; }
.page--tpl-index .page__main > .section--stories .section-head { margin-block-end: 0.5rem; }
@media (min-width: 1024px) {
  .page--tpl-index .page__main > .section--stories:first-child { margin-block-start: 1.25rem; }
  .page--tpl-index .page__main > .section--stories + * { margin-block-start: 1.5rem; }
  .page--tpl-index .page__main > .section--stories .section-head { margin-block-end: 0.75rem; }
}

/* ══ The chalk: a stick of chalk writes the board's lines and the flash-deals title, once ═══════════════════════
   theme.js (initChalk) drives it: .is-chalk hides the writing (clipped), the script moves .chalk-stick along each line
   and uncovers the text behind its tip. Coordinates come from getBoundingClientRect, so left/top are physical here.
   The stick leans away from the writing side: it is mirrored in LTR. Boxes: .board (hero price board) and .flash-head. */
:is(.board, .flash-head) { position: relative; }
:is(.board, .flash-head).is-chalk :is(.board__title, .board__note, .board__name, .board__dots, .board__price, .board__all, .section-head__title, .chalk-line) {
  clip-path: inset(-0.3em -0.3em -0.3em 100%);
}
:is(.board, .flash-head).is-chalk:dir(ltr) :is(.board__title, .board__note, .board__name, .board__dots, .board__price, .board__all, .section-head__title, .chalk-line) {
  clip-path: inset(-0.3em 100% -0.3em -0.3em);
}
/* the titles hug their text, so the chalk tip and the underline end exactly where the letters end */
:is(.board, .flash-head).is-chalk :is(.board__title, .board__note, .section-head__title) { width: fit-content; max-inline-size: 100%; }
.board.is-chalk:not(.is-written) { outline-color: transparent; }
/* before theme.js has started the chalk (it loads deferred) the writing is already hidden, so the finished text never
   flashes first. If the script never runs, the failsafe shows it after 6s. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .board:not(.is-chalk) { outline-color: transparent; }
  .board:not(.is-chalk) :is(.board__title, .board__note, .board__name, .board__dots, .board__price, .board__all),
  .flash-head:not(.is-chalk) .section-head__title { opacity: 0; animation: chalk-failsafe 0.01s 6s forwards; }
  .board:not(.is-chalk) .board__row { border-block-end-color: transparent; }
  @keyframes chalk-failsafe { to { opacity: 1; } }
}
.board.is-chalk .board__row { border-block-end-color: transparent; transition: border-color 0.4s ease-out; }
.board.is-chalk .board__row.is-ruled { border-block-end-color: color-mix(in srgb, var(--on-media) 16%, transparent); }
.board.is-written { transition: outline-color 0.6s ease-out; }

/* the line the chalk draws under the flash-deals title */
.chalk-line {
  position: absolute;
  height: 0.25rem;
  border-radius: 1rem;
  background: var(--accent);
  rotate: -0.6deg;
  pointer-events: none;
}

.chalk-stick {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 3;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  --tilt: 40deg;            /* it trails behind the writing, so the fresh letters stay uncovered */
  --lift-y: 0rem;
  --lift-s: 1;
}
.chalk-stick:dir(ltr) { --tilt: -40deg; }
.chalk-stick.is-lifted { --lift-y: -0.7rem; --lift-s: 1.06; }   /* between two lines it leaves the board */
.chalk-stick > i { position: absolute; display: block; font-style: normal; }

/* the stick is a lit cylinder: dark edge, soft highlight, dark edge. Chalk white below, gold paper wrap above.
   Its tip (the bottom centre) is the point (0,0) the script moves. */
.chalk-stick__body {
  left: -0.45rem;
  bottom: 0;
  width: 0.9rem;
  height: 4.25rem;
  overflow: hidden;
  border-radius: 0.25rem 0.25rem 0 0 / 0.3rem 0.3rem 0 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--on-media) 74%, var(--scheme-dark-bg)) 0,
    color-mix(in srgb, var(--on-media) 96%, var(--scheme-dark-bg)) 26%,
    var(--on-media) 42%,
    color-mix(in srgb, var(--on-media) 90%, var(--scheme-dark-bg)) 64%,
    color-mix(in srgb, var(--on-media) 66%, var(--scheme-dark-bg)) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 91%, 80% 100%, 20% 100%, 0 91%);   /* worn, bevelled end */
  transform-origin: 50% 100%;
  transform: translateY(var(--lift-y)) rotate(var(--tilt)) scale(var(--lift-s));
  transition: transform 0.16s ease-out;
}
.chalk-stick__body b {
  position: absolute;
  inset: 0 0 auto 0;
  height: 48%;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 52%, var(--scheme-dark-bg)) 0,
    color-mix(in srgb, var(--accent) 88%, var(--on-media)) 28%,
    var(--accent) 44%,
    color-mix(in srgb, var(--accent) 78%, var(--scheme-dark-bg)) 66%,
    color-mix(in srgb, var(--accent) 48%, var(--scheme-dark-bg)) 100%);
  border-block-end: 1px solid color-mix(in srgb, var(--accent) 50%, var(--scheme-dark-bg));
}
.chalk-stick__body b::before {            /* the round end of the stick */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 62%, var(--on-media));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--scheme-dark-bg));
}

/* the shadow it casts on the board: tight at the tip while it writes, far and faint when it is lifted */
.chalk-stick__shadow {
  left: -0.3rem;
  top: -0.3rem;
  width: 3.4rem;
  height: 0.8rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--shadow-color) 0%, #0000 100%);
  opacity: 0.55;
  filter: blur(1.5px);
  transform-origin: 0 50%;
  rotate: 28deg;
  transition: translate 0.16s ease-out, scale 0.16s ease-out, opacity 0.16s ease-out;
}
.chalk-stick:dir(ltr) .chalk-stick__shadow { left: auto; right: -0.3rem; transform-origin: 100% 50%; rotate: -28deg; }
.chalk-stick.is-lifted .chalk-stick__shadow { translate: 1rem 0.8rem; scale: 1.15; opacity: 0.25; }

/* chalk dust at the tip, only while it is touching the board */
.chalk-stick__dust {
  left: -0.875rem;
  top: -0.25rem;
  width: 1.75rem;
  height: 1.25rem;
  background:
    radial-gradient(circle at 18% 28%, var(--on-media) 0 1.5px, #0000 2.2px),
    radial-gradient(circle at 50% 62%, var(--on-media) 0 2px, #0000 2.8px),
    radial-gradient(circle at 82% 24%, var(--on-media) 0 1.5px, #0000 2.2px),
    radial-gradient(circle at 36% 88%, var(--on-media) 0 1.2px, #0000 1.9px),
    radial-gradient(circle at 70% 80%, var(--on-media) 0 1.4px, #0000 2px);
  opacity: 0;
}
:is(.board, .flash-head).is-writing .chalk-stick:not(.is-lifted) .chalk-stick__dust { animation: chalk-dust 0.3s ease-out infinite; }
:is(.board, .flash-head).is-writing .chalk-stick:not(.is-lifted) .chalk-stick__body { animation: chalk-scribble 0.09s ease-in-out infinite alternate; }
@keyframes chalk-dust {
  0%   { opacity: 1; transform: translateY(0) scale(0.6); }
  100% { opacity: 0; transform: translateY(1.1rem) scale(1.4); }
}
@keyframes chalk-scribble { from { rotate: -1.5deg; } to { rotate: 2deg; } }
@media (prefers-reduced-motion: reduce) { .chalk-stick { display: none; } }

/* ══ Cart page on phones ═══════════════════════════════════════════════════
   1. The one-column grid was `1fr`, whose minimum is the widest content, so a long product name, the stepper and two
      prices pushed both cards ~15px past the screen and the whole page scrolled sideways: `minmax(0, 1fr)` lets the
      column shrink to the screen and the content wraps instead.
   2. Lines: smaller photo, a price block that stacks (old price above the new one) instead of breaking mid-amount,
      and 40px+ touch targets for remove and the quantity buttons.
   3. A bar with the total and the checkout button stays above the tab bar (the summary is far below the lines). */
.checkout-layout { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .checkout-layout { grid-template-columns: minmax(0, 1fr) 22rem; } }
.checkout-layout > * { min-width: 0; }

.cart-bar { display: none; }

@media (max-width: 1023px) {
  .summary { position: static; }
}

@media (max-width: 639px) {
  .checkout-layout { gap: var(--space-4); }
  .checkout-layout .card--pad { padding: var(--space-4); }
  .checkout-layout .row-between { flex-wrap: wrap; gap: var(--space-2); }

  /* a grid, so the photo + name sit on top and the stepper and the price share one row under them */
  .cart-line { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: 0.25rem; padding-block: var(--space-3); }
  .cart-line__body { display: contents; }
  .cart-line__body > * { grid-column: 2; min-width: 0; }
  .cart-line__media { grid-column: 1; grid-row: 1 / span 2; }
  .cart-line__media img { width: 4.5rem; height: 4.5rem; }
  .cart-line__title { overflow-wrap: anywhere; }
  .cart-line__remove { grid-column: 3; grid-row: 1; }
  .cart-line__body > .cart-line__foot { grid-column: 1 / -1; margin-block-start: var(--space-2); flex-wrap: nowrap; }
  .cart-line__foot > .row { flex-direction: column-reverse; align-items: flex-end; gap: 0 !important; }
  .cart-line__foot .price, .cart-line__foot .price-was { white-space: nowrap; }
  .cart-line__foot .price-was { font-size: var(--text-2xs); }
  .cart-line__remove { display: grid; place-items: center; inline-size: 2.5rem; block-size: 2.5rem; margin-block-start: -0.5rem; margin-inline-end: -0.5rem; padding: 0; }
  .cart-line .qty__btn { width: 2.5rem; height: 2.5rem; }
  .cart-line .qty__value { min-width: 2rem; }

  .summary__row { gap: var(--space-3); }
  .summary__row span:last-child { text-align: end; }

  /* the sticky bar: it replaces nothing, the summary below still has its own button */
  .cart-bar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: calc(3.625rem + env(safe-area-inset-bottom));
    z-index: calc(var(--z-sticky) - 1);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--gutter);
    background: var(--surface);
    box-shadow: 0 -1px 0 var(--border), 0 -8px 20px color-mix(in srgb, var(--shadow-color) 8%, transparent);
  }
  .page--no-tabbar .cart-bar { inset-block-end: env(safe-area-inset-bottom); }
  .cart-bar__total { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .cart-bar__total span { font-size: var(--text-2xs); color: var(--ink-500); }
  .cart-bar__total .price { font-size: var(--text-md); white-space: nowrap; }
  .cart-bar__btn { flex: 1; min-width: 0; }
  /* room under the content so the bar never covers the last card */
  .page__main:has(.cart-bar) { padding-block-end: 8.5rem; }
  .page:has(.cart-bar) .to-top { inset-block-end: 9rem; }
}
@media (min-width: 640px) { .cart-bar { display: none; } }