/* MANACA v3: the shared shop parts (links, arrows, the five rails and their cards, bag, toast).
   Same material as the Khar store: warm white ground, near-black ink, LED tint used only where light "comes on".
   Tokens (--ground, --panel, --well, --ink, --mute, --line, --led, --sec, --h2, fonts, --gut, --ease) and .btn live in site.css. */

.more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 650 14px/1 var(--body); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; white-space: nowrap; }
.more:hover { text-decoration-thickness: 2px; }
.arrow { width: 46px; height: 46px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 50%; color: var(--ink); background: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 28%, transparent); transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), opacity .25s var(--ease); }
.arrow:hover:not(:disabled) { background: var(--ink); color: var(--ground); box-shadow: 0 0 0 4px rgb(var(--led) / .9); }
.arrow:disabled { opacity: .3; cursor: default; }
.arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ================= 3. rails: figures on a floor line (round 3) =================
   Every product in the five rails is a cut-out of the model facing the camera (tools/prep3.cjs + tools/cutout.py), standing on
   one floor line that runs the width of the rail. Nothing sits in a box. The floor line is also the rail's position bar: its lit
   part is the stretch of the rail you are looking at. Name, price and the size buttons sit directly under each figure; one tap
   on a size adds it.
   Colours come from the shared tokens only (--ground --panel --well --ink --mute --line --led), so a rail works on the light
   ground and in the dark half without a second set of rules. Per rail: --cw card width, --ar figure height / width,
   --pt head room inside the scroller (it clips vertically), --pool the colour of the light behind a figure. */
section.rail-sec { --cw: min(82vw, 330px); --rg: 12px; --ar: 1.379; --pt: 22px; --pool: 255 255 250; --pa: 1;
  position: relative; padding: var(--sec) 0 0; max-width: 1600px; margin: 0 auto; }
@media (min-width: 700px) { section.rail-sec { --cw: 300px; --rg: 16px; } }
@media (min-width: 1280px) { section.rail-sec { --cw: clamp(300px, 22.4vw, 350px); --rg: 18px; } }

/* head: the name of the rail and its controls on one line. No index tag, no explaining sentence. */
.rhead { position: relative; z-index: 3; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 24px; padding: 0 var(--gut); }
.rhead h2 { font-family: var(--display); font-weight: 820; font-stretch: 62%; letter-spacing: -.025em; line-height: .86; text-wrap: balance; font-size: var(--h2); }
.rhead h2 span { color: var(--mute); }
.rail-ctl { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.rail-ctl .more { margin-right: 10px; }
.rail-note { font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
@media (max-width: 699px) {
  .rail-ctl .more { margin-right: 0; }
  .rail-ctl .arrow { display: none; }
}

.rail-stage { position: relative; }
/* without JS the rails have no cards: each keeps its heading, its "View all" and one plain link to the collection */
html:not(.js) .rail-ctl .arrow, html:not(.js) .rail-stage, html:not(.js) #bottom .rhead .rail-note { display: none; }
html:not(.js) .rail-sec .rail-note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 5px; }
.rail { position: relative; z-index: 1; display: flex; gap: var(--rg); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gut); padding: var(--pt) var(--gut) 10px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
@media (pointer: coarse) { .rail { scroll-snap-type: x mandatory; } }
.rail::-webkit-scrollbar { display: none; }
.rail::after { content: ""; flex: 0 0 1px; }
.rail:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 14px; }
.rail.dragging { scroll-snap-type: none; user-select: none; -webkit-user-select: none; }
.rail.dragging, .rail.dragging a { cursor: grabbing; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* the floor line: a hairline the width of the rail, with the part in view lit (js/shop.js moves .floor i as the rail scrolls) */
.rail-bar.floor { position: absolute; z-index: 2; left: 0; right: 0; top: calc(var(--pt) + var(--cw) * var(--ar) * var(--fl, 1)); height: 2px; margin-top: -1px; pointer-events: none;
  background: linear-gradient(color-mix(in srgb, var(--ink) 26%, transparent), color-mix(in srgb, var(--ink) 26%, transparent)) 0 50% / 100% 1px no-repeat; }
.rail-bar.floor i { position: absolute; left: 0; top: 0; bottom: 0; width: 30%; background: var(--ink); transform-origin: 0 0; }
.rail-bar.floor::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 12px; background: linear-gradient(color-mix(in srgb, var(--ink) 9%, transparent), transparent); }  /* the ledge's own shade on the wall under it */

/* a figure: no well, no frame. .halo is the light behind it, the image stands on the bottom edge of .card-img (the floor line) */
.card { position: relative; flex: 0 0 var(--cw); min-width: 0; scroll-snap-align: start; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
.card-img { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 16px; overflow: hidden; background: var(--well); }   /* only a product without a cut-out lands here */
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card.fig .card-img { aspect-ratio: auto; height: calc(var(--cw) * var(--ar)); margin-bottom: 4px; border-radius: 0; overflow: visible; background: none; isolation: isolate; }
.card.fig .fig-img { object-fit: contain; object-position: 50% 100%; transform-origin: 50% 100%; transition: transform .6s var(--ease); -webkit-user-drag: none; }
.card.fig .halo { position: absolute; z-index: -1; inset: -3% -26% 0; pointer-events: none; opacity: var(--pa);
  background: radial-gradient(closest-side at 50% 48%, rgb(var(--pool)) 0%, rgb(var(--pool) / .96) 26%, rgb(var(--pool) / .8) 42%, rgb(var(--pool) / .56) 56%, rgb(var(--pool) / .3) 70%, rgb(var(--pool) / .11) 84%, rgb(var(--pool) / 0) 100%); }
@media (hover: hover) and (pointer: fine) {
  .card.fig:hover .fig-img, .card.fig:focus-within .fig-img { transform: scale(1.025); }
}
/* each figure's light comes up as its card crosses the rail's window and settles as it leaves: scroll-driven, no script */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rail .card.fig { view-timeline: --fig inline; }
    .rail .card.fig .halo { animation-name: fig-light; animation-duration: auto; animation-timing-function: linear; animation-fill-mode: both; animation-timeline: --fig; animation-range: entry 0% exit 100%; }
  }
}
@keyframes fig-light { 0%, 100% { opacity: calc(var(--pa) * .4); } 28%, 72% { opacity: var(--pa); } }
@media (prefers-reduced-motion: reduce) { .card.fig .fig-img { transition: none; } .card.fig:hover .fig-img, .card.fig:focus-within .fig-img { transform: none; } }

/* under the figure: name (two lines at most), price, then the size bar pinned to the bottom so every bar in a rail lines up */
.card-meta { display: grid; gap: 5px; align-content: start; min-width: 0; padding: 0 2px; }
.card-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font: 700 15px/1.2 var(--display); font-stretch: 88%; text-transform: uppercase; letter-spacing: .01em; text-decoration: none; }
.card-t:hover { text-decoration: underline; text-underline-offset: 4px; }
.price { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font: 650 15px/1.2 var(--body); font-variant-numeric: tabular-nums; }
.price .was { color: var(--mute); font-weight: 400; font-size: 14px; text-decoration-thickness: 1px; }
.sale-tag { align-self: center; padding: 3px 6px 2px; border-radius: 5px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 38%, transparent); font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
/* wide cards: name on the left, price on the right, one line of height saved */
#shop .card-meta, #women .card-meta, #bottom .card-meta { grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; }
#shop .price, #women .price, #bottom .price { justify-content: flex-end; text-align: right; max-width: 150px; }

/* size bar: one tap adds. Grid so 7+ sizes wrap into tidy rows; 1px gaps are the dividers. */
.sizes { min-height: 48px; display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 1px; border-radius: 12px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); background: color-mix(in srgb, var(--ink) 13%, var(--ground)); }
.size { position: relative; min-width: 0; min-height: 48px; display: grid; place-content: center; gap: 2px; background-color: var(--panel); font: 650 13px/1 var(--body); letter-spacing: .02em; font-variant-numeric: tabular-nums;
  transition: background-color .2s var(--ease), color .2s var(--ease); }
.size:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; border-radius: 10px; }
.size small { font: 500 12px/1 var(--mono); color: var(--mute); letter-spacing: 0; }
@media (hover: hover) { .size:hover:not(:disabled):not(.added) { background-color: color-mix(in srgb, var(--panel) 86%, var(--ink)); } }
.size:active:not(:disabled) { background-color: rgb(var(--led)); color: #0e0e0d; }
.size:disabled { color: color-mix(in srgb, var(--mute) 78%, var(--panel)); cursor: not-allowed;
  background-image: linear-gradient(to top right, transparent calc(50% - .6px), color-mix(in srgb, var(--ink) 22%, transparent) 50%, transparent calc(50% + .6px)); }
.size:disabled small { color: inherit; }
.ck { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .18s var(--ease); pointer-events: none; }
.size.added, .size.added:hover { background-color: var(--ink); color: var(--ground); }
.size .lbl, .size small { transition: opacity .18s var(--ease); }
.size.added .lbl, .size.added small { opacity: 0; }
.size.added .ck { opacity: 1; }
.add { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font: 650 14px/1 var(--body); background: var(--panel); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
  transition: background-color .2s var(--ease), color .2s var(--ease); }
.add:focus-visible { outline-offset: 2px; border-radius: 12px; }
.add .ck { position: static; margin: 0; width: 16px; height: 16px; display: none; }
.add.added .ck { display: block; opacity: 1; }
@media (hover: hover) { .add:hover { background: var(--ink); color: var(--ground); } }
.add:active { background: rgb(var(--led)); color: #0e0e0d; }
.add.added, .add.added:hover { background: var(--ink); color: var(--ground); }

/* ---------- 3a. tees and hoodies (#shop): the lit row ----------
   Light ground. Each model stands in a pool of the store's LED white; the pools reach past the cards and meet, so the row
   reads as one lit wall with people in front of it (the pools are NO MORE's "Current pieces" technique: a closest-side radial
   eased over eight stops, wider than its tile, breathing with the rail's own scroll). */
#shop { --pt: 26px; padding-top: calc(var(--sec) - 14px); }   /* the category index above carries its own air */
#shop .rhead { margin-bottom: 2px; }
@media (max-width: 699px) { #shop .rhead h2 span { display: block; } }

/* ---------- 3b. legs (Best sellers, Bottomwear) ----------
   Bottoms are shot waist to feet. Each pair of soles stands on the floor line; the waist comes out of the shade on a smooth
   curve that is baked into the cut-out, so there is no straight cut and no dither at the top. */
.card.fig.legs .card-img::after { content: ""; position: absolute; z-index: -1; left: 10%; right: 10%; bottom: .6%; height: 6%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, #000 34%, transparent), color-mix(in srgb, #000 14%, transparent) 55%, transparent); }   /* where the shoes meet the floor */

/* ---------- 3c. Best sellers (#best): the store with the lights down ----------
   The one dark room above the chapter. The heading is the wall: it runs the full width and fades towards the floor, and the
   four pairs of legs stand in front of it, each in a pool of light (an ellipse on the floor under the shoes, a soft column
   behind the legs). --over is the share of the wall's height the legs stand in front of.
   One pair in focus at a time (js/shop.js sets .focus on the section and .on on the card; with a mouse or keyboard also
   .named, and writes the piece's name into .wall-alt): its light comes up, the others drop back, the wall reads its name.
   Below 1180px the row is a sideways scroller that snaps a pair to the middle; from 1180px the four stand side by side.
   The wall drifts a few pixels against the legs as the section crosses the screen (scroll-driven, no script).
   The tokens below turn the shared card parts to their night values. */
#best.best { --ground: #0b0b0a; --panel: #1b1b19; --well: #20201d; --ink: #f1f2ea; --mute: #a9a89f; --line: rgb(255 255 255 / .14); --ar: 1.417; --pt: 0px;
  --sw: min(100vw, 1600px); --k: 2.17; --fs: calc((var(--sw) - 2 * var(--gut)) / var(--k)); --wallh: calc(var(--fs) * 1.56); --over: .4;
  --cw: clamp(264px, 68vw, 320px); --szw: 44px;
  display: block; overflow-x: clip; color: var(--ink); background: var(--ground); box-shadow: 0 0 0 100vmax var(--ground); clip-path: inset(0 -100vmax);
  padding-bottom: var(--sec); }
#best.best .rhead { z-index: 0; display: block; }
#best.best .rhead .more { position: absolute; z-index: 2; right: var(--gut); top: 0; }
#best .wall { position: relative;
  -webkit-mask-image: linear-gradient(180deg, #000 28%, rgb(0 0 0 / .12) 94%); mask-image: linear-gradient(180deg, #000 28%, rgb(0 0 0 / .12) 94%); }
#best.best .rhead h2, #best .wall-alt { margin: 0 0 0 -.03em; font-family: var(--display); font-weight: 820; font-stretch: 62%; letter-spacing: -.025em; font-size: var(--fs); line-height: .78; white-space: nowrap; color: var(--ink); transition: opacity .28s var(--ease); }
#best.best .rhead h2 .w { display: block; width: max-content; color: inherit; }
#best .wall-alt { display: none; position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; }
#best.named .rhead h2 { opacity: 0; }
#best.named .wall-alt { opacity: 1; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    #best .wall { animation: wall-drift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  }
}
@keyframes wall-drift { from { transform: translate3d(0, -26px, 0); } to { transform: translate3d(0, 30px, 0); } }

#best.best .rail-stage { z-index: 1; margin-top: calc(var(--wallh) * var(--over) * -1); }
#best.best .rail { gap: 10px; padding: 0 calc((100% - var(--cw)) / 2) 4px; scroll-snap-type: x mandatory; scroll-padding-inline: 0; }
#best.best .rail::after { display: none; }
#best.best .card { scroll-snap-align: center; gap: 6px; grid-template-rows: auto auto auto; }
#best.best .card.fig .card-img { margin-bottom: 10px; }
#best.best .card.fig .halo { inset: 4% -20% -6%; opacity: .8; animation: none; transition: opacity .5s var(--ease), transform .7s var(--ease);
  background: radial-gradient(50% 6.5% at 50% 90.5%, rgb(var(--led) / .62) 0%, rgb(var(--led) / .34) 38%, rgb(var(--led) / .12) 70%, rgb(var(--led) / 0) 100%),
    radial-gradient(34% 50% at 50% 58%, rgb(var(--led) / .2) 0%, rgb(var(--led) / .12) 45%, rgb(var(--led) / .04) 78%, rgb(var(--led) / 0) 100%); }
#best.best .card.fig .card-img::before { content: ""; position: absolute; z-index: -1; left: -6%; right: -6%; bottom: 3.4%; height: 1px; pointer-events: none;   /* the floor, visible only where the light falls */
  background: linear-gradient(90deg, rgb(var(--led) / 0), rgb(var(--led) / .5) 30%, rgb(var(--led) / .5) 70%, rgb(var(--led) / 0)); transition: opacity .5s var(--ease); }
#best.best .card.fig.legs .card-img::after { display: none; }
#best .card .fig-img { transition: filter .5s var(--ease), transform .6s var(--ease); }
#best .card-meta, #best .sizes { transition: opacity .4s var(--ease); }
#best .card-meta { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 0; }
#best .card-t { font-size: 14px; }
#best .price { justify-content: flex-end; text-align: right; max-width: 190px; font-size: 14px; }
#best .sale-tag { padding: 0; box-shadow: none; color: var(--mute); }
/* focus: the legs are dimmed with a filter, never with opacity (the wall would show through them) */
#best.focus .card:not(.on) .fig-img { filter: brightness(.4) saturate(.6); }
#best.focus .card:not(.on) .halo, #best.focus .card:not(.on) .card-img::before { opacity: .1; }
#best.focus .card:not(.on) .card-meta, #best.focus .card:not(.on) .sizes { opacity: .45; }
#best.focus .card.on .halo { opacity: 1; transform: scale(1.12); }
#best.best .card.fig:hover .fig-img, #best.best .card.fig:focus-within .fig-img { transform: none; }
@media (min-width: 700px) {
  #best.best { --k: 3.9; --wallh: calc(var(--fs) * .78); --over: .43; }
  #best.best .rhead h2 .w { display: inline; }
  #best.best .rhead .more { top: -46px; }
  #best.best .rail { gap: var(--rg); }
}
/* the scroller: the pairs stand shoulder to shoulder (their boxes overlap), and only the one in the middle shows its name, price and sizes */
@media (max-width: 1179px) {
  #best.best .rail { gap: 0; }
  #best.best .card + .card { margin-left: calc(var(--cw) * -.2); }
  #best.best .card.on { z-index: 1; }
  #best.focus .card:not(.on) .card-meta, #best.focus .card:not(.on) .sizes { opacity: 0; pointer-events: none; }
}
@media (min-width: 1180px) {
  #best.best { --cw: calc((var(--sw) - 2 * var(--gut) - 3 * var(--rg)) / 4); }
  #best .wall-alt { display: block; }
  #best.best .rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; padding: 0 var(--gut); }
  #best.best .card { flex: none; }
}
@media (min-width: 1340px) { #best.best { --szw: 46px; } }
@media (prefers-reduced-motion: reduce) { #best.best .halo, #best .card .fig-img, #best.best .rhead h2, #best .wall-alt, #best .card-meta, #best .sizes, #best.best .card.fig .card-img::before { transition: none; } }

/* ---------- 3d. Bottomwear (#bottom): legs in front of the lettering ----------
   Light ground. One floor line; behind the legs "Cargos and denim" is pressed into the wall at the height of the knees and moves
   at a third of the rail's speed, so the legs walk past it. No slot, no panel. */
#bottom { --ar: 1.417; --pt: 4px; --fl: .962; --cw: min(74vw, 300px); --pa: 0; }
@media (min-width: 700px) { #bottom { --cw: 280px; } }
@media (min-width: 1280px) { #bottom { --cw: clamp(280px, 20vw, 316px); } }
#bottom .rhead { align-items: center; flex-wrap: wrap; }
#bottom .rhead h2 { margin-right: auto; }
#bottom .rail-note { order: 3; flex: 1 0 100%; }
@media (min-width: 900px) { #bottom .rail-note { order: 0; flex: 0 1 auto; margin-right: 18px; } }
#bottom .slot-wall { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }   /* clips the lettering to the stage */
#bottom .rail-word { position: absolute; left: var(--gut); top: calc(var(--pt) + var(--cw) * var(--ar) * .962); transform-origin: 0 100%; margin-top: -.86em; white-space: nowrap; pointer-events: none;
  font-family: var(--display); font-weight: 820; font-stretch: 62%; letter-spacing: -.025em; line-height: 1; font-size: calc(var(--cw) * .8);
  color: color-mix(in srgb, var(--ink) 4.2%, var(--ground)); will-change: transform; }
#bottom .rail-bar.floor { z-index: 0; }

/* ---------- 3e. Women (#women): one strip of light ----------
   Light ground. These photos are framed closer, so the figures are larger and end at the waist. Instead of a pool each, one
   strip of light runs along the wall behind all of them at shoulder height and stays put while they pass. */
#women { --ar: 1.5; --pt: 16px; --cw: min(76vw, 300px); --pa: 0; }
@media (min-width: 700px) { #women { --cw: 286px; } }
@media (min-width: 1280px) { #women { --cw: clamp(286px, 20.6vw, 322px); } }
#women .rail-stage::before { content: ""; position: absolute; z-index: 0; left: 0; right: 0; top: calc(var(--pt) + var(--cw) * var(--ar) * .2); height: calc(var(--cw) * var(--ar) * .5); pointer-events: none;
  background: linear-gradient(180deg, rgb(var(--pool) / 0) 0%, rgb(var(--pool) / .5) 20%, rgb(var(--pool) / .96) 42%, rgb(var(--pool) / .96) 58%, rgb(var(--pool) / .5) 80%, rgb(var(--pool) / 0) 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }

/* ---------- 3f. New in (#new): a lead and the ones that follow ----------
   Sits in the dark half. Fewer and larger than before: about three and a half to a laptop screen, one and a peek on a phone.
   From 700px the first piece is the lead, --lead times the size of the rest; all of them stand on the same floor line, so
   the followers leave air above their heads. One soft light lies on the floor behind the whole row (not a glow per person),
   and it stays put while they pass. Under each: name and price on one line, then the sizes as plain text (3g).
   --cwf is a follower's width; a card's own --cw is what the shared card rules read. */
section#new.rail-sec { --cwf: min(max(80vw, 308px), 340px); --cw: var(--cwf); --lead: 1; --rg: 16px; --pt: 10px; --pa: 0; --szw: 44px;
  --floor: calc(var(--pt) + var(--cwf) * var(--lead) * var(--ar)); }
@media (min-width: 700px) { section#new.rail-sec { --cwf: 310px; --lead: 1.2; --rg: 30px; } }
@media (min-width: 1280px) { section#new.rail-sec { --cwf: clamp(310px, 21.6vw, 344px); --rg: clamp(30px, 2.8vw, 46px); } }
#new .rhead { align-items: center; margin-bottom: 0; }
#new .rail { align-items: end; }
#new .card { gap: 6px; grid-template-rows: auto auto auto; }
#new .card.lead { --cw: calc(var(--cwf) * var(--lead)); }
#new .card.fig .card-img { margin-bottom: 12px; }
#new .card.fig .halo { display: none; }
#new .card-meta { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 0; }
#new .card-t { -webkit-line-clamp: 1; font-size: 14px; }
#new .price { justify-content: flex-end; font-size: 14px; }
#new .rail-stage::before { content: ""; position: absolute; z-index: 0; left: 0; right: 0; top: calc(var(--floor) * .34); height: calc(var(--floor) * .66); pointer-events: none;
  background: radial-gradient(56% 100% at 50% 100%, rgb(var(--led) / .2) 0%, rgb(var(--led) / .09) 42%, rgb(var(--led) / .02) 78%, rgb(var(--led) / 0) 100%); }
#new .rail-bar.floor { top: var(--floor); background: linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; }
#new .rail-bar.floor i { top: 0; bottom: 1px; background: var(--ink); }
#new .rail-bar.floor::after { display: none; }
#new .rail:focus-visible { outline-color: rgb(var(--led)); }

/* ---------- 3g. sizes as plain text (Best sellers, New in) ----------
   One line of sizes under the name, no bar and no boxes: each size is a 44px target with its label in the middle. The row is
   pulled left by half of the first target's empty space, so the first label starts on the same line as the name above it
   (the type is monospaced: --n0, written by js/shop.js, is the number of letters in the first label). Quiet until its card
   is pointed at or in focus; one tap still adds. A sold-out size is dimmer and struck through. --szw is one size's width. */
#best .sizes, #new .sizes { display: flex; min-height: 44px; gap: 0; border: 0; border-radius: 0; overflow: visible; background: none;
  font: 500 13px/1 var(--mono); letter-spacing: .04em; margin-left: calc((var(--szw, 44px) - var(--n0, 2) * (1ch + .04em)) / -2); }
#best .size, #new .size { flex: 0 0 var(--szw, 44px); min-height: 44px; padding: 0; background: none; color: var(--mute); font: inherit; letter-spacing: inherit; transition: color .2s var(--ease); }
#best .size .lbl, #new .size .lbl { text-underline-offset: 5px; text-decoration-thickness: 1px; }
#best .size small, #new .size small { font-size: 12px; letter-spacing: 0; color: color-mix(in srgb, currentColor 70%, transparent); }
#best .size:focus-visible, #new .size:focus-visible { outline: 2px solid rgb(var(--led)); outline-offset: 2px; border-radius: 6px; color: var(--ink); }
#best .card.on .size:not(:disabled) { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  #new .card:hover .size:not(:disabled), #new .card:focus-within .size:not(:disabled) { color: var(--ink); }
  #best .size:hover:not(:disabled):not(.added), #new .size:hover:not(:disabled):not(.added) { background: none; color: var(--ink); }
  #best .size:hover:not(:disabled) .lbl, #new .size:hover:not(:disabled) .lbl { text-decoration-line: underline; }
}
@media (hover: none) { #new .size:not(:disabled) { color: color-mix(in srgb, var(--ink) 82%, var(--mute)); } }   /* no hover to bring them up on a phone */
#best .size:active:not(:disabled), #new .size:active:not(:disabled) { background: none; color: rgb(var(--led)); }
#best .size:disabled, #new .size:disabled { background: none; color: color-mix(in srgb, var(--mute) 46%, var(--ground)); }
#best .size:disabled .lbl, #new .size:disabled .lbl { text-decoration: line-through; text-decoration-thickness: 1px; }
#best .size.added, #best .size.added:hover, #new .size.added, #new .size.added:hover { background: none; color: rgb(var(--led)); }
#best .size .ck, #new .size .ck { width: 18px; height: 18px; }

/* Rooms: css/rooms.css. Chapters and the dark tokens: css/chapter.css. Objects: css/objects.css. Store to footer: css/foot.css. */

/* ================= bag ================= */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgb(10 10 9 / .42); opacity: 0; transition: opacity .4s var(--ease); }
.scrim.on { opacity: 1; }
.bag { visibility: hidden; position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); height: 100dvh; background: var(--panel); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  transform: translateX(100%); transition: transform .5s var(--ease), visibility 0s .5s; box-shadow: -30px 0 70px -30px rgb(0 0 0 / .45); }
.bag.open { transform: none; visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
.bag-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 12px 22px; border-bottom: 1px solid var(--line); }
.bag-head h2 { font: 850 32px/1 var(--display); font-stretch: 64%; text-transform: uppercase; }
.bag-head h2 span { font: 500 13px/1 var(--mono); color: var(--mute); vertical-align: middle; margin-left: 6px; letter-spacing: .06em; }
.bag-list { overflow: auto; padding: 4px 22px; overscroll-behavior: contain; }
.bag-item { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.bag-item img { width: 84px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: var(--well); }
.bag-item img.cut { object-fit: contain; padding: 8px; background: #fff; }
.bag-info { display: grid; gap: 6px; align-content: start; min-width: 0; }
.bag-top { display: flex; justify-content: space-between; gap: 12px; }
.bag-top a { font: 700 15px/1.15 var(--display); font-stretch: 88%; text-transform: uppercase; text-decoration: none; }
.bag-top b { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bag-price { display: grid; justify-items: end; gap: 2px; }
.bag-price s { font-size: 13px; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bag-size { color: var(--mute); font-size: 14px; }
.bag-ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; border-radius: 12px; box-shadow: inset 0 0 0 1px rgb(14 14 13 / .18); background: #fff; }
.qty button { width: 44px; height: 44px; display: grid; place-items: center; font: 500 20px/1 var(--body); border-radius: 12px; }
.qty button:hover:not(:disabled) { background: var(--well); }
.qty button:disabled { color: #b0afa6; cursor: not-allowed; }
.qty output { min-width: 26px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.rm { min-height: 44px; padding: 0 4px; font-size: 14px; color: var(--mute); text-decoration: underline; text-underline-offset: 4px; }
.rm:hover { color: var(--ink); }
.bag-empty { padding: 34px 0; display: grid; gap: 14px; justify-items: start; color: var(--mute); }
.bag-empty b { font: 850 28px/.9 var(--display); font-stretch: 64%; text-transform: uppercase; color: var(--ink); }
.bag-foot { padding: 18px 22px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 12px; background: var(--panel); }
.bag-foot[hidden] { display: none; }
.bag-sub { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; }
.bag-sub b { font: 800 26px/1 var(--display); font-stretch: 80%; }
.bag-notes { display: grid; gap: 4px; font-size: 13px; color: #45443e; }
.bag-notes li { padding-left: 16px; position: relative; }
.bag-notes li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px rgb(var(--led)); }
.bag-demo { font-size: 13px; color: var(--mute); }
.bag-acct { font-size: 14px; color: #45443e; }
.bag-acct a { display: inline-block; padding: 12px 0; margin: -12px 0; font-weight: 650; color: var(--ink); text-underline-offset: 4px; }

/* ================= toast ================= */
.toast { position: fixed; z-index: 70; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--ink); color: #f4f5ef; font-size: 14px;
  box-shadow: 0 0 0 3px rgb(var(--led) / .9), 0 20px 40px -16px rgb(0 0 0 / .5); transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  transition: transform .45s var(--ease), visibility 0s .45s; }
.toast.on { transform: translate(-50%, 0); visibility: visible; transition: transform .45s var(--ease), visibility 0s; }
/* on phones the toast drops from under the header, so it never covers the size bar that was just tapped */
@media (max-width: 699px) {
  .toast { bottom: auto; top: calc(var(--trust) + var(--hdr) + 10px); transform: translate(-50%, calc(-100% - 130px)); }
  .toast.on { transform: translate(-50%, 0); }
}
.toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { flex: 0 0 auto; height: 44px; padding: 0 18px; border-radius: 999px; background: #f4f5ef; color: var(--ink); font: 650 14px/1 var(--body); }

/* ================= reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  .bag, .toast, .scrim, .arrow, .card-img img, .size, .ck, .size .lbl, .size small { transition: none; }
}
