/* ===================================================================
   Zilhouette — mobile-first stylesheet; CR-01 foundation at the end
   White ground, #F5F5F7 plates, #111 ink, platform system stack. 12px
   tiles, 16px heroes and sheets, pill controls, soft offset shadows.
   One stroke-SVG icon family; no emoji chrome; no webfont at all.
   Structure first; the design tokens (:root) live near the end, and
   zilhouette/DESIGN.md is the written contract for them.
   4/8/12/16/20/24 spacing grid, ≥44px touch targets.
   =================================================================== */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--frame-bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; color: inherit; }

/* Focus — visible, consistent, token-driven */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Phone frame on desktop, full-bleed on phone ---------- */
/* The frame is drawn only where it fits whole: 720px wide AND 700px tall.
   It stands 92vh high inside 28px of padding top and bottom, so 0.92h + 56
   has to be <= h, which is h >= 700. Width alone put a phone inside the
   phone on every iPhone turned sideways (874x402) and on a folding phone's
   open display (951x585), with the tab bar cut off below the screen. Every
   rule that belongs to the frame carries this same query: the padding, the
   frame, the centred scrim, and the sheet's four corners and lift. */
.device {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
@media (min-width: 720px) and (min-height: 700px) {
  .device { padding: 28px; }
}
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  /* A BOUNDED height, not min-height: the layout is a flex column whose
     .screens child scrolls internally and whose .tabbar is pinned to the
     bottom. With min-height the frame grew with the content instead, so
     .screens never scrolled and the tab bar was pushed below the fold —
     on the Twin form it sat ~850px down and could only be reached by
     scrolling the whole page. dvh, not vh, so iOS Safari's collapsing
     toolbar doesn't clip it. */
  height: 100vh;
  height: 100dvh;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 720px) and (min-height: 700px) {
  .app {
    min-height: auto;
    height: 880px;
    max-height: 92vh;
    border-radius: 40px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    border: 10px solid var(--ink);
  }
}

:root {
  --page-pad: 20px;   /* .screens gutter — edge-bleeding strips cancel it */
  --tab-h: 64px;
  --top-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Top bar ----------
   B's bar is the screen's own title, nothing else: no wordmark, no rule
   under it. The title comes from the active screen's h1 (see .screen-title). */
.topbar {
  height: calc(var(--top-h) + var(--safe-top));
  padding-top: var(--safe-top);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: var(--sp-5);
  padding-right: var(--sp-4);
  background: var(--ground);
  z-index: 5;
}
/* The one h1 the app exposes. go() copies the active screen's heading text
   in; that heading stays in the screen markup as the source of the copy and
   is display:none there, so nothing is announced twice. */
.screen-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The wordmark stopped being bar furniture: it introduces the product at
   onboarding step 1 and heads the help sheet, and appears nowhere else. */
.wordmark {
  font-family: var(--font-ui);
  font-weight: var(--wordmark-weight);
  font-size: 13px;
  letter-spacing: var(--wordmark-tracking);
  text-transform: var(--wordmark-case);
  color: var(--ink);
}
.ghost-btn {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: none;
  background: var(--plate);
  color: var(--ink);
  font-size: var(--fs-btn); font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ghost-btn:hover { background: #ECEDF0; }
.ghost-btn:active { background: var(--hairline); }

/* ---------- Screens ---------- */
.screens {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* 4px, not 20: the screen title lives in the bar now, so content starts
     directly under it the way the B artboards set it. */
  padding: var(--sp-1) var(--page-pad) calc(var(--tab-h) + var(--safe-bottom) + 88px);
}
/* Switching tabs is instant, the way a native tab bar is: it is navigation,
   not a moment, and the owner judged a slide between tabs too much (2026-10-18;
   R1 had already retired a 320ms fade for the same reason). The press answers
   the tap (.tab:active); the content is simply there. */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* View transitions are used for one thing, the twin handoff (Motion.handoff),
   and only the parts it names take part; the rest of the page updates in place. */
:root { view-transition-name: none; }

/* The screen heading is the SOURCE of the top-bar title, not a second one:
   go() reads its text into .screen-title and it is never drawn here.
   display:none also keeps it out of the accessibility tree, so the title is
   announced once. Later sprints change this copy here, in the screen. */
.screen-head h1 { display: none; }
.screen-head .sub {
  margin: 0 0 var(--sp-4);
  max-width: 36ch;
  color: var(--secondary);
  font-size: var(--fs-body);
  line-height: 1.4;
}

/* ---------- Fields ---------- */
.field { display: block; margin-bottom: var(--sp-5); }
.field > span {
  display: block;
  font-family: var(--label-font);
  font-style: var(--label-style);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-case);
  /* The field label names the answer: it is ink, not a quiet grey rubric. */
  color: var(--ink);
  margin-bottom: var(--sp-2);
}
.field > span em {
  font-family: var(--font-ui);
  font-weight: 400;
  color: var(--secondary);
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--fs-meta);
}
/* On the twin form and in the wizard the parenthetical is a full sentence, so
   run in it wrapped under its own label and the two read as one broken line.
   It gets its own line there: label, then what the answer is for. The short
   inline form still holds everywhere else (the add sheet, Worth It?). */
#screen-twin .field > span em:not(#heightVal),
#onboardModal .field > span em:not(#obHeightVal) { display: block; margin-top: 2px; line-height: 1.35; }
/* The height em is not a hint, it is the slider's live value — it stays on the
   label's line and reads as a number. */
#heightVal, #obHeightVal { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Inputs: a 12px plate with no hairline. The border is the fill — an outline
   AND a fill would be two edges for one control. */
input[type="text"], input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: none;
  border-radius: var(--radius-field);
  background: var(--plate);
  font-size: var(--fs-btn);
  font-family: inherit;
  color: var(--ink);
  transition: box-shadow 0.15s, background 0.15s;
}
input[type="text"]::placeholder, input[type="number"]::placeholder { color: var(--secondary-plate); }
input[type="text"]:focus, input[type="number"]:focus {
  outline: none;
  background: var(--ground);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Range — custom track + thumb */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--hairline);
  border-radius: 1px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--thumb-bg);
  border: 1.5px solid var(--ink);
  margin-top: -12px;
  transition: transform 0.15s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--hairline); border-radius: 1px; }
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--thumb-bg); border: 1.5px solid var(--ink);
}

/* ---------- Chips ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
/* A chip that fades out reads as "more this way", where one sliced flat at the
   container edge reads as broken. Not on .wrap rows, which have no overflow.
   The fade is on the edge that actually HAS hidden content, and only that one.
   A fixed trailing-only mask got this wrong in both directions: it dimmed the
   SELECTED chip whenever the selection sat at the right edge, and it sliced
   the leading chip flat the moment the row had been scrolled at all. `data-edge`
   is written by markEdges() in app.js on scroll, resize and re-render (CSS
   scroll-timelines would do it without JS, but Safari does not ship them and
   this app is mobile-first). No attribute yet = the old trailing fade, so the
   row is never worse than it was before the script runs.
   scroll-padding-inline keeps a chip scrolled into view clear of the fade. */
.chip-row:not(.wrap), .cat-filter, .style-shots { scroll-padding-inline: 24px; }
.chip-row:not(.wrap):not([data-edge]), .cat-filter:not([data-edge]),
.chip-row:not(.wrap)[data-edge="end"], .cat-filter[data-edge="end"], .style-shots[data-edge="end"] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.chip-row:not(.wrap)[data-edge="start"], .cat-filter[data-edge="start"], .style-shots[data-edge="start"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px);
  mask-image: linear-gradient(to right, transparent, #000 24px);
}
.chip-row:not(.wrap)[data-edge="both"], .cat-filter[data-edge="both"], .style-shots[data-edge="both"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.chip-row:not(.wrap)[data-edge="none"], .cat-filter[data-edge="none"], .style-shots[data-edge="none"] {
  -webkit-mask-image: none;
  mask-image: none;
}
.chip-row.wrap { flex-wrap: wrap; overflow: visible; }
/* Three options whose third label is much longer than the other two, so a
   plain wrap dropped it onto its own line looking like a mistake. Spanning it
   deliberately makes the same 2 + 1 shape read as the intended layout.
   Scoped to this row: the other .chip-row.wrap holds style tags, where an
   ordinary wrap is right. */
#obGenderChips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#obGenderChips > :last-child { grid-column: 1 / -1; }
/* A chip is a pill: plate fill, ink label, no border. Pressed fills with ink
   and the label turns white — the state is the fill, never an outline. */
.chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--plate);
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.chip:hover { background: #ECEDF0; }
.chip:active { transform: scale(0.96); }
.chip.active {
  background: var(--chip-active-bg);
  color: var(--chip-active-ink);
  font-weight: 600;
}
.chip:disabled { opacity: 0.45; cursor: default; }
.chip.sm { min-height: 38px; padding: 8px 14px; font-size: var(--fs-meta); }
.chip.big { min-height: 48px; padding: 13px 20px; font-size: var(--fs-btn); }

/* ---------- Segmented control ----------
   Two or three exclusive views of the same thing: a plate track, and the
   chosen one lifted onto a white thumb. The app's only segmented control:
   the Twin's fit pair (R3) and the Style screen's mode pair (R4) both came
   onto it from hand-drawn copies, and nothing may draw a fifth. */
.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--plate);
  border-radius: var(--radius-seg);
}
.seg-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-seg-thumb);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--secondary-plate);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg-btn.active {
  background: var(--ground);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-thumb);
}
/* A segment may carry one line of supporting detail under its label ("30 sec",
   "like a fitting"). It is the same control, one line taller — never a third
   line, and never a different weight. */
.seg-btn.two-line {
  min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: var(--sp-2);
}
.seg-btn em { display: block; font-style: normal; font-size: var(--fs-tab); font-weight: 400; color: inherit; }
.seg-btn.active em { color: var(--secondary); font-weight: 400; }

/* ---------- Tone + colour swatches ---------- */
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
/* A colour is a circle: it names a hue, not a garment, and nothing about it is
   rectangular. Pressed is the same ink ring the rest of the app uses. */
.swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s;
}
/* 40px drawn, 48px to the thumb */
.swatch::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; }
.swatch:active { transform: scale(0.92); }
.swatch.active { box-shadow: 0 0 0 2px var(--ground), 0 0 0 3.5px var(--ink); }

/* Skin tone is a continuous scale, so it is drawn as one: nine cells of a
   printed colour bar. As nine free-floating dots they wrapped 6 + 3, which
   read as an accident rather than a decision — and a ramp also lets you
   judge your tone against its neighbours, which is how you actually pick. */
.tone-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  border: none;
  border-radius: var(--radius-tile);
  overflow: hidden;
}
.tone {
  height: 46px;           /* the row is the touch target, full-height per cell */
  border: none;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s;
}
.tone:active { transform: scaleY(1.08); }
/* Inset, because an outer ring on a contiguous bar would be clipped. */
.tone.active {
  box-shadow: inset 0 0 0 2px var(--ground), inset 0 0 0 4px var(--ink);
  z-index: 1;
}

/* ---------- Twin figure ---------- */
.twin-stage {
  position: relative;
  display: flex;
  justify-content: center;
  background: var(--stage-bg);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-hero);
  /* the figure now stands to its full height, so the caption needs a floor of
     its own rather than the feet it used to sit on */
  padding: 22px 0 58px;
  margin-bottom: var(--sp-4);
}
/* Spec mode draws a value column beside the figure, so the box is wider than
   the body it holds — the empty right half IS the layout. */
.twin-figure {
  width: min(250px, 100%); height: 300px;
  position: relative;
}
.twin-figure svg { width: 100%; height: 100%; display: block; }

/* The tape, as a drawing convention: a dimension line crosses the body exactly
   where the tape would sit, and its value is set out to the right. Styled here
   rather than in the SVG so the palette stays in one file. */
.fx-rule { stroke: var(--hairline-strong); stroke-width: 1; }
.fx-rule.on { stroke: var(--ink); stroke-width: 1.6; }
.fx-rule.dash { stroke-dasharray: 5 4; stroke-linecap: round; }
/* The spec sheet's own type. The composition is untouched — same rules, same
   uppercase labels, same numbers in the same places (owner's ruling); only the
   colour and the face are B's. The labels sit on the white stage now, so they
   take --secondary rather than the plate value. */
.fx-lbl {
  font-family: var(--font-ui);
  font-size: 7px; letter-spacing: 0.14em;
  fill: var(--secondary);
}
.fx-val { font-family: var(--font-ui); font-size: 13px; font-weight: 600; fill: var(--ink); }
.fx-lbl.on, .fx-val.on { fill: var(--ink); }
/* A reading of the figure above it, printed at the foot of the sheet: a plate
   pill on the white stage. It sits on paper, not on a photograph, so it takes
   the plate fill instead of the white-circle shadow. */
.silhouette-badge {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  background: var(--plate);
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--fs-meta); font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Twin detail meter ---------- */
/* On the ground, not in a card: it is a reading of the twin above it, and a
   plate around it would make it a second object. */
.acc-meter-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0 0 var(--sp-6);
}
.acc-meter-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--fs-body); font-weight: 600; color: var(--ink);
}
.acc-meter-head em { font-style: normal; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-meter {
  height: 4px; border-radius: var(--radius-pill);
  background: var(--plate);
  margin: var(--sp-3) 0 var(--sp-2); overflow: hidden;
}
.acc-fill {
  height: 100%; border-radius: var(--radius-pill);
  /* ink: the meter reports a fact about the twin, it is not a warning and
     not the AI accent, which belongs to the render moment alone. */
  background: var(--ink);
  transition: width 0.4s cubic-bezier(.3,.9,.3,1);
}
.acc-hint { margin: 0; font-size: var(--fs-meta); color: var(--secondary); }
/* What a choice came to, said under the choice: the number in ink, the rest
   secondary. Its one button is a .btn-text on its own line, pulled back by
   the button's 14px side padding so it starts where the sentence does. */
.field-read { margin: var(--sp-2) 0 0; font-size: var(--fs-meta); line-height: 1.4; color: var(--secondary); }
.field-read b { color: var(--ink); font-weight: 600; }
.field-read .btn-text { display: block; margin: var(--sp-1) 0 0 -14px; }

/* Quick fit / Tailor fit is the plain .seg above — R3 retired the hand-drawn
   copy of it. It is the one segment that carries a second line, so the track
   sets its own rhythm on the form. */
#fitTabs { margin: var(--sp-1) 0 var(--sp-5); }

/* ---------- Photo drop ----------
   A plate that wants a photo. Dashed hairline, because "put something here"
   is worth one drawn convention. */
.photo-drop {
  display: block;
  border: 1px dashed var(--drop-line);
  border-radius: var(--radius-tile);
  background: var(--plate);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.photo-drop:hover { border-color: var(--secondary); }
.photo-drop:active { border-color: var(--ink); }
.photo-drop.big { min-height: 150px; }
.photo-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-6);
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 500;
  min-height: 96px;
  text-align: center;
}
.photo-drop-inner .plus { display: flex; color: var(--ink); }
.photo-drop-inner .plus svg { width: 26px; height: 26px; }
/* Once there is a photo it IS the drop zone: the prompt's padding would only
   frame the user's own picture in a dashed box. */
.photo-drop-inner.has-photo { padding: 0; gap: 0; }
.photo-drop-inner.has-photo .garment-progress { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.photo-drop img.preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
/* A selfie is a portrait, and the well is wider than it is tall: a full-bleed
   200px cover crops the face to a band. It shows at the 4:5 the camera framed
   it in, centred on the plate — nothing of the face is cut. */
#selfieDrop img.preview {
  width: auto; height: 260px;
  aspect-ratio: 4 / 5;
  margin: var(--sp-3) auto;
  border-radius: var(--radius-tile);
}
/* Dashed means "a photograph goes here". Once one does, the prompt goes —
   the same rule the full-body slots follow. */
#selfieDrop.has-photo { border-color: transparent; }
.drop-hint { font-size: var(--fs-meta); color: var(--secondary-plate); margin-top: 0; font-weight: 400; }

/* ---------- Buttons ----------
   Two, both pills. Primary is an ink fill; secondary is a 1.5px ink outline
   on the ground. Nothing else is a button. */
.btn-primary, .btn-secondary {
  border: none;
  border-radius: var(--radius-pill);
  min-height: 48px;
  padding: 13px 22px;
  font-family: var(--font-ui);
  font-size: var(--fs-btn);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  transition: transform 0.12s, opacity 0.15s, background 0.15s, color 0.15s;
}
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { background: #000000; }
/* Disabled is a plate with plate-safe secondary text — still 5.31:1, so a
   disabled label stays readable rather than fading to a rumour. */
.btn-primary:disabled, .btn-primary[disabled] {
  background: var(--plate); color: var(--secondary-plate); cursor: default; transform: none;
}
.btn-secondary {
  background: var(--ground); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--btn2-line);
}
.btn-secondary:hover { background: var(--plate); }
.btn-secondary:disabled, .btn-secondary[disabled] {
  box-shadow: inset 0 0 0 1.5px var(--hairline); color: var(--secondary); cursor: default; transform: none;
}
.btn-primary svg, .btn-secondary svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-primary.full, .btn-secondary.full { width: 100%; }
/* Compact size, same component — for buttons that sit inline with body text
   (the garment notice's OK). Still a 44px target. */
.btn-primary.sm, .btn-secondary.sm { min-height: 44px; padding: 10px 18px; font-size: var(--fs-body); }
/* The one control that is not a pill: a labelled action that must NOT compete
   with the pill beside it — a sheet's Cancel, or "Try another mix" next to
   "Save look". No fill, no ring — the label alone, at button weight, secondary
   ink on the ground (AA there), ink on the hover plate. Still a 44px target.
   Never the one action on a screen. */
.btn-text {
  border: none;
  background: none;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: 1.2;
  color: var(--secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
/* --secondary is AA on the ground but not on a plate, so the hover plate takes
   the label to ink rather than leaving it at 4.44:1. */
.btn-text:hover { background: var(--plate); color: var(--ink); }
.btn-text:active { transform: scale(0.98); }
.btn-text:disabled, .btn-text[disabled] { color: var(--secondary-plate); background: none; cursor: default; transform: none; }

/* ---------- Garment pack-shot conversion (PRD §14) ---------- */
/* Progress lives inside the drop zone, under the original photo: the user's own
   photo is what they recognise, so it stays on screen while the pack shot is
   made. Text + a bar, no spinner glyph — the icon family is stroke SVG only. */
.garment-progress {
  align-self: stretch; /* the drop zone centres its children; this spans it */
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.garment-progress .lbl { font-size: var(--fs-meta); font-weight: 500; color: var(--secondary-plate); }
.garment-progress .track {
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--ai-soft);
  overflow: hidden;
}
/* The one coloured thing in the shell. The AI accent marks the moment a
   machine is working on the user's photo and appears nowhere else. */
.garment-progress .track i {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: var(--radius-pill);
  background: var(--ai);
  animation: garmentBar 1.15s cubic-bezier(.65,0,.35,1) infinite;
}
/* Indeterminate: the job has no percentage to report, so the bar says "working",
   not "this far". Reduced-motion users get the segment parked at the start. */
@keyframes garmentBar {
  from { transform: translateX(-100%); }
  to   { transform: translateX(263%); }
}
/* A line in the sheet, not a panel inside it: the sheet is already the card,
   and a plate around one sentence made a card within a card. */
.garment-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: var(--sp-3) 0 var(--sp-5);
  font-size: var(--fs-meta);
  line-height: 1.4;
  color: var(--secondary);
}
/* The OK keeps its width: at 382px the sentence squeezed it to "O / K". */
.garment-notice .btn-secondary { flex: none; }
#garmentChoice { margin: var(--sp-3) 0 var(--sp-5); }
/* The add sheet's title carries the batch counter ("Add to wardrobe · 2 more
   photos queued"), which at the 22/700 sheet step ran to three lines and read
   as a headline rather than a state. 17/600 is the section step. Scoped here
   on purpose: every other sheet keeps the 22/700 title until the owner rules
   on one sheet title size for the whole app. */
#addModal .sheet h2 { font-size: var(--fs-section); font-weight: 600; letter-spacing: 0; }

/* ---------- Wardrobe ---------- */
.cat-filter { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; scrollbar-width: none; }
.cat-filter::-webkit-scrollbar { display: none; }
/* Two columns, the way the B artboard lays the closet out: at 375px that is a
   161.5px tile, big enough to recognise a garment in. 16px between rows, 12px
   between columns — the extra row gap gives the name + meta block under each
   photo room to read as part of its own tile. The FAB is cleared by .screens'
   own bottom padding; a second clearance here only added dead space. */
/* Since 2026-10-18 the grid is a shop grid (the owner's Zara reference): it
   bleeds to the screen edges, columns 2px apart, photographs square-cornered,
   so the closet reads as a catalogue of pictures rather than a set of cards.
   The words under each photo are inset to the page gutter they lost. */
.wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5) 2px;
  margin: 0 calc(-1 * var(--page-pad));
}
.wardrobe-grid .item-card .meta { padding: var(--sp-2) 10px 0; }
/* A group heading inside the grid (Outerwear's three groups): it spans both
   columns and takes back the gutter the full-bleed grid gave away. */
.wardrobe-grid .closet-group {
  grid-column: 1 / -1;
  margin: var(--sp-2) var(--page-pad) calc(-1 * var(--sp-2));
}
.wardrobe-grid .closet-group:first-child { margin-top: 0; }
.pick-card .thumb { border-radius: var(--radius-photo); }
/* ---------- Tile ----------
   No plate, no border: the photo IS the tile. 12px corners on the image,
   name 14/600 and meta 12 secondary sitting on the ground beneath it. */
.item-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  position: relative;
  /* Column + .cw-row's auto top margin bottom-aligns the wear count across a
     row whatever the meta above it holds — a brand line, one name line or two.
     Grid stretch already makes the cards themselves equal height. */
  display: flex;
  flex-direction: column;
}
/* No entrance animation: renderWardrobe() repaints the whole grid on every
   wear tap, filter and delete, so an animated tile replayed the same flourish
   across every photo on screen for actions that changed one number. */
.item-card:active { transform: none; }
.item-card .thumb {
  width: 100%; aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-photo);
  display: block;
  background: var(--shot-bg);
}
.item-card .meta { padding: var(--sp-2) 2px 0; flex: 1; display: flex; flex-direction: column; }
/* Brand over name, the way a shop tile reads it (PRD §14 step 4). One line,
   truncated; an item with no brand gets no element at all. */
.item-card .meta .brand {
  font-size: var(--fs-meta); font-weight: 500; line-height: 1.3;
  color: var(--secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 1px;
}
/* Quiet text, not a badge: the pack shot is on its way, nothing to act on. */
.item-card .meta .converting {
  font-size: var(--fs-meta); line-height: 1.35; color: var(--secondary);
  margin-top: 2px;
}
/* Capped at two lines. No reserved second line: at two columns most names fit
   on one, and holding the space open left a blank band between every name and
   its wear count. .cw-row's auto top margin still bottom-aligns the counts
   across a row when one name does wrap. */
.item-card .meta .nm {
  font-size: var(--fs-body); font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-card .cw-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 6px; margin-top: auto; padding-top: 2px;
}
/* "4 wears · $12/wear" on one line — at two columns it fits, and the count and
   what it cost to get there are one fact, not two. */
.item-card .meta .cw {
  font-size: var(--fs-meta); line-height: 1.35; color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.item-card .wear-add {
  flex: none; position: relative;
  width: 24px; height: 24px; margin: -4px -2px -2px 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--plate); border: none; border-radius: 50%;
  color: var(--ink); cursor: pointer;
}
.item-card .wear-add svg { width: 13px; height: 13px; }
.item-card .wear-add:hover { background: var(--hairline); }
/* 22px and 28px controls, sized up to a thumb-sized target without moving the art */
.item-card .wear-add::after { content: ''; position: absolute; inset: -11px; }
/* A white disc with an ink cross, the app's own ink on the app's own ground
   rather than a grey wash over the photograph. --shadow-thumb keeps its edge
   where the pack shot behind it is white too. */
.item-card .del {
  position: absolute; top: var(--sp-2); right: var(--sp-2);
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ground); color: var(--ink);
  box-shadow: var(--shadow-thumb);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.item-card .del:hover { background: var(--plate); }
.item-card .del svg { width: 14px; height: 14px; }
.item-card .del::after { content: ''; position: absolute; inset: -8px; }
/* The tile opens its piece sheet (Mix & match this). One empty button over the
   card; × and the wear + sit above it, the meta lets taps through to it. */
.item-card .item-open {
  position: absolute; inset: 0; z-index: 1;
  background: transparent; border: 0; padding: 0; cursor: pointer;
}
.item-card .del { z-index: 2; }
.item-card .meta { pointer-events: none; }
.item-card .wear-add { pointer-events: auto; z-index: 2; }
.item-card .item-open:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* The piece sheet. */
.piece-sheet .ps-row { display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-5); }
.piece-sheet .ps-face { width: 88px; flex: none; aspect-ratio: 4 / 5; background: var(--shot-bg); overflow: hidden; border-radius: var(--radius-tile); display: flex; align-items: center; justify-content: center; }
.piece-sheet .ps-face img { width: 100%; height: 100%; object-fit: cover; }
.piece-sheet h2 { margin: 0 0 4px; }
.piece-sheet .ps-cat { margin: 0; color: var(--secondary); font-size: var(--fs-meta); }
.piece-sheet .ps-lead { margin: calc(-1 * var(--sp-2)) 0 var(--sp-5); color: var(--secondary); font-size: var(--fs-body); line-height: 1.45; }
.piece-sheet .field { margin-bottom: var(--sp-5); }
.piece-sheet .btn-text { margin-top: var(--sp-2); width: 100%; justify-content: center; text-align: center; }
/* Editing a saved piece (PRD §14.1 step 7). The heading says what the sheet
   is for, in the field label's voice; the photo's one action sits under the
   name it belongs to. No new colour: Delete is a .btn-text like Close, and
   its Undo is the confirm (DESIGN.md, .priv-row). */
.piece-sheet .ps-eyebrow {
  margin: 0 0 var(--sp-3);
  font-family: var(--label-font);
  font-style: var(--label-style);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-case);
  color: var(--secondary);
}
.piece-sheet .ps-meta { min-width: 0; }
.piece-sheet .ps-conv { margin: 4px 0 0; color: var(--secondary); font-size: var(--fs-meta); }
.piece-sheet .ps-photo { display: inline-flex; align-items: center; margin-top: var(--sp-3); cursor: pointer; }
.piece-sheet .garment-notice { margin-top: 0; }

/* ---------- "No photo yet" ----------
   The plate that stands exactly where a photograph belongs, on tiles, look
   pieces, saved-look collages and Worth It? pairings. Never a drawing of a
   garment: a closet is photographs, and the cartoon standing in for one is
   what the client saw as slop (REDESIGN-B-PLAN, 2026-09-18). Same plate,
   same 12px corners. Since v106 (2026-11-17) it shows the piece's own colour
   as a swatch and its category beneath: "No photo yet" under a hanger read as
   a broken image when a look was full of them. */
.no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-photo);
  background: var(--plate);
  color: var(--secondary-plate);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  padding: 6px;
  box-sizing: border-box;
}
.no-photo svg { width: 26px; height: 26px; flex: 0 0 auto; }
.no-photo .np-lbl { display: block; }
.no-photo .np-swatch {
  width: 28px; height: 28px; flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.12);
}
.no-photo.fill .np-swatch { width: 20px; height: 20px; }
#loadDemoBtn[hidden] { display: none; }
/* A collage cell is ~60px across — no room for the words, so the hanger
   carries it alone and the cell fills its grid slot. */
.no-photo.fill {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
  gap: 0;
}
.no-photo.fill .np-lbl { display: none; }
.no-photo.fill svg { width: 22px; height: 22px; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-emoji { display: flex; justify-content: center; margin-bottom: var(--sp-4); color: var(--secondary); font-size: 34px; }
.empty-emoji svg { width: 44px; height: 44px; }
/* The wardrobe's empty state is photo-led: a tile-shaped plate standing where
   the first photograph will go, not an icon floating on the ground. */
.empty-plate {
  width: 120px;
  aspect-ratio: 4 / 5;
  margin: 0 auto var(--sp-4);
  border-radius: var(--radius-tile);
  background: var(--plate);
  color: var(--secondary-plate);
  display: flex; align-items: center; justify-content: center;
}
.empty-plate svg { width: 36px; height: 36px; }
.empty-state h2 { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-section); font-weight: 600; }
.empty-state p { color: var(--secondary); margin: var(--sp-1) 0 var(--sp-5); font-size: var(--fs-body); }
/* The empty closet's two ways in, stacked: add your own first, the sample second. */
.empty-state .empty-actions { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.empty-state .empty-actions .btn-primary, .empty-state .empty-actions .btn-secondary { min-width: 220px; }
/* Hidden while the empty state shows its own Add clothes (renderWardrobe). */
.fab.fab-off { display: none !important; }

/* ---------- Style studio ---------- */
/* Who composes the look: the plain .seg above, the last hand-drawn copy of the
   control retired (R4). It switches the whole top half of the screen, so it
   leads the screen and takes the space a section heading would. */
#styleModeTabs { margin: var(--sp-1) 0 var(--sp-5); }

.pick-panel { margin-bottom: 18px; }
.pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3) 2px;
  /* Tiles are <button>s, and a button stretched to its row's height centres
     what it holds: a tile with a one-line name sat lower than its neighbour
     with a two-line one, so the photos in a row did not line up (2026-11-16). */
  align-items: start;
}
/* The wardrobe tile, made tappable: same plate, same 4:5 art, no wear counter. */
.pick-card {
  display: block;
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
  /* A selection repaints the pressed state in place; the entrance animation
     .item-card carries would replay across the whole grid on every tap. */
  animation: none;
}
.pick-card .meta { display: block; }
/* Selected: a 2px ink ring and nothing else — no fill, no check mark. The
   garment stays the brightest thing in the tile either way. The ring is drawn
   INSIDE the photo (2026-11-16): the grid's columns are 2px apart, so a ring
   outside it (the old 4px box-shadow) lay over the next tile. An outline is
   painted above the photo, where an inset shadow would sit under it. */
.pick-card.active .thumb, .pick-card.active .no-photo {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.pick-card.active .nm { font-weight: 700; }
.pick-hint {
  margin: var(--sp-3) 0;
  font-size: var(--fs-meta);
  color: var(--secondary);
}
/* The order box: one row per torso layer, inside to outside. It appears only
   when two tops or two outer layers are picked, which is the only time there
   is an order to set. Rows are ruled, not carded; the two arrows are plain
   44px targets and a row that cannot move further shows its arrow spent. */
.pick-layers { margin: 0 0 var(--sp-4); }
.layer-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.layer-row {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 64px; padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--hairline);
}
.layer-n {
  flex: none; width: 16px; text-align: center;
  font-size: var(--fs-meta); font-weight: 600; color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.layer-face {
  flex: none; width: 40px; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--radius-photo); background: var(--shot-bg);
  display: flex; align-items: center; justify-content: center;
}
.layer-face img { width: 100%; height: 100%; object-fit: cover; }
.layer-face .no-photo { width: 100%; height: 100%; aspect-ratio: auto; padding: 0; border-radius: 0; }
.layer-face .no-photo svg { width: 16px; height: 16px; }
.layer-nm {
  flex: 1; min-width: 0;
  font-size: var(--fs-body); font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.layer-move {
  flex: none; width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--ink); cursor: pointer;
}
.layer-move + .layer-move { margin-left: calc(-1 * var(--sp-2)); }
.layer-move svg { width: 20px; height: 20px; }
.layer-move:hover:not(:disabled) { background: var(--plate); }
.layer-move:disabled { color: var(--hairline); cursor: default; }

.vibe-row { display: block; margin-bottom: 16px; }
.vibe-group-lbl {
  font-family: var(--label-font);
  font-style: var(--label-style);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-case);
  /* A section heading, 15/600 ink — not a tracked-out grey rubric. */
  color: var(--ink);
  margin: var(--sp-6) 2px var(--sp-2);
}
/* Inside the vibe row the label is not a section heading but the name of the
   group of pills under it, so it steps down to meta weight and secondary ink:
   seventeen styles in five groups, and five 15/600 headings would read as five
   sections. "Saved looks" and "Recent try-ons" keep the 15/600 heading. */
#vibeRow .vibe-group-lbl {
  font-size: var(--fs-meta); font-weight: 500;
  color: var(--secondary);
  margin-top: var(--sp-4);
}
#vibeRow .vibe-group-lbl:first-child { margin-top: var(--sp-2); }
/* The strip WRAPS; it does not scroll (R5).
   It used to bleed through the page padding and fade its trailing edge, which
   is the right treatment for a scroller — but the critique measured what the
   scroller cost: of fourteen styles, seven were fully visible at rest
   ("Everyday" showed 2 of 6, scrollWidth 881 against a 375 client; "Character"
   2 of 5). Every one of those fourteen carries a researched card with
   photographs, sources and buying advice, and half the catalogue sat behind a
   gesture whose only hint was a 24px fade. Choosing a style is this screen's
   primary decision, so the catalogue is now all on screen at once.
   Neither B artboard shows a style picker, so nothing in the comp is being
   contradicted here. The bleed, the mask, the scroll padding and the hidden
   scrollbar all left with the scrolling — they only ever made sense on a
   scroller, and a wrapped strip that bled past the page padding would push its
   pills to the physical screen edge. */
.vibe-strip {
  display: flex;
  flex-wrap: wrap;
  /* 20px between cells, 8px inside one (.style-cell). A chip and its ⓘ are a
     pair; at one 8px gap everywhere the disc sat equidistant between its own
     chip and the next one and had no visible owner. The row gap stays 8. */
  column-gap: 20px;
  row-gap: 8px;
}
/* Same pill as .chip, its own class because the strip scrolls. */
.vibe {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--plate);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.vibe:hover { background: #ECEDF0; }
.vibe:active { transform: scale(0.96); }
.vibe .emoji { display: none; }
.vibe .lbl { font-size: var(--fs-body); font-weight: 500; display: block; white-space: nowrap; }
.vibe.active { background: var(--chip-active-bg); color: var(--chip-active-ink); }
.vibe.active .lbl { font-weight: 600; }

/* ----- Style Studio, direction B (2026-10-18) -----
   The look leads like a product page; "Dress me in…" below it holds the
   mode switch, the ask field and every style in its group. */
.studio-pick { margin-top: var(--sp-6); }
.studio-pick .studio-h { margin: 0 0 var(--sp-1); font-size: 28px; line-height: 1.1; }
.studio-pick .sub { margin: 0 0 var(--sp-4); max-width: 36ch; color: var(--secondary); font-size: var(--fs-body); line-height: 1.4; }
.studio-pick #styleModeTabs { margin: 0 0 var(--sp-3); }
.studio-pick .ask-box { margin-bottom: var(--sp-2); }
.btn-text.sm { min-height: 40px; padding: 8px 14px; font-size: var(--fs-body); color: var(--ink); }

/* Every style, grouped, three photographs to a row. Group names are the
   small spaced capitals of a shop's department labels. */
.style-groups { display: flex; flex-direction: column; gap: var(--sp-6); margin-top: var(--sp-5); }
#vibeRow .vibe-group-lbl {
  margin: 0 0 var(--sp-3);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink);
}
.style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-2); }
.style-cell { position: relative; min-width: 0; }
.vibe.style-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  width: 100%;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  text-align: left;
}
.vibe.style-card:hover { background: none; }
.vibe.style-card:active { transform: none; opacity: 0.7; }
.style-card .sc-img {
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--plate);
  border-radius: var(--radius-photo);
  overflow: hidden;
}
.style-card .sc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Chosen: an ink ring around the photograph, set off by a white gap. */
.vibe.style-card.active { background: none; color: var(--ink); }
.vibe.style-card.active .sc-img { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--ink); }
.style-card .lbl {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  white-space: normal; line-height: 1.3;
}
.vibe.style-card.active .lbl { font-weight: 700; }
/* The info disc sits on the photograph's corner, frosted so it reads on any
   picture. 28px drawn, 44px to the thumb through its padding box.
   Scoped to the studio's photo grid (v101): unscoped, it also lifted the disc
   of every chip + ⓘ pair (the add sheet's and the piece sheet's "Styles it
   fits") onto the chip's own label, where it hid the name and took its taps. */
.style-grid .style-cell .ghost-btn.style-info {
  position: absolute; top: 2px; right: 2px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
}
.style-grid .style-cell .ghost-btn.style-info::before {
  content: '';
  position: absolute; inset: 6px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-edge);
}
.style-grid .style-cell .ghost-btn.style-info svg { position: relative; width: 15px; height: 15px; }
.rail-credits {
  display: block;
  margin: var(--sp-4) 0 0 auto;
  min-height: 32px; padding: 6px 0;
  background: none; border: none; cursor: pointer;
  font-size: var(--fs-meta); color: var(--secondary);
  text-decoration: underline; text-underline-offset: 3px;
}
.studio-actions { display: none; }

/* The look: the picture bleeds to the screen edges, and a glass panel laps
   over its foot (it never covers the whole figure: a render's feet sit
   above the last tenth of the frame). */
.outfit-viewport { margin: 0 calc(-1 * var(--page-pad)); }
.outfit-viewport .outfit-placeholder,
.outfit-viewport .studio-warn { margin: 0 var(--page-pad); }
.outfit-viewport .outfit-pieces-grid,
.outfit-viewport .stylist-note { margin-left: 0; margin-right: 0; }
.outfit-viewport .stylist-note { padding: 0 var(--page-pad); }
.outfit-hero .hero-plate { min-height: 460px; justify-content: center; }
.look-panel {
  position: relative;
  margin: -88px 12px 0;
  padding: var(--sp-4);
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.look-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.look-name { font-size: 30px; line-height: 1; }
.look-about {
  flex: 0 0 auto;
  min-height: 32px; padding: 4px 0;
  background: none; border: none; cursor: pointer;
  font-size: var(--fs-meta); color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.look-panel .hero-foot { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) 0; }
.look-panel .hero-foot .score,
.look-panel .hero-cap { font-size: var(--fs-meta); color: #3F4550; }
.look-panel .hero-foot .score + .hero-cap::before { content: '\00B7'; margin: 0 6px; }
.look-panel .vote-row { margin-left: auto; }
.look-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-1); }
.look-actions .packshot-btn { flex: 1 1 auto; }
/* "Remix the rest" is longer than "Another mix": neither label may wrap. */
.look-actions .packshot-btn, .look-actions #remixBtn { white-space: nowrap; }
/* With Remix the rest beside it, the two labelled buttons share the row
   equally, so "Regenerate" (after a render) still leaves room for Save at 390px. */
.look-actions:has(#remixBtn) .packshot-btn,
.look-actions #remixBtn {
  flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 12px;
  justify-content: center; overflow: hidden; text-overflow: ellipsis;
}
/* The note under Try-On (quota, refusal, risk) belongs to the button, so it
   sits inside the glass panel, not loose under it behind the tab bar. */
.look-panel .hero-quota { margin: 0; }
.look-glass { background: var(--glass-strong); border: 1px solid rgba(17, 17, 17, 0.12); }
.look-icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); cursor: pointer;
}
.look-icon svg { width: 18px; height: 18px; }
.outfit-viewport .outfit-pieces-grid { margin-top: var(--sp-3); }
.outfit-viewport .outfit-pieces-grid .piece .p-nm,
.outfit-viewport .outfit-pieces-grid .piece .p-cat { padding-left: 10px; padding-right: 10px; }

/* The look sits on the ground, not in a card: the pieces and the hero are
   the composition, and a plate around them would be a container around a
   container (R2 rebuilds the composition itself). */
.outfit-viewport {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 340px;
}
/* Nothing to show yet — no look, no warning — and the viewport would be an
   empty plate plus 340px of height between Play and "Style me" (owner,
   2026-11-17: hide it when there is nothing to show). The placeholder's
   words are already under "Style me" (#styleSub), so nothing is lost. A
   look, a "studio-warn" or the loading state replaces the placeholder, and
   the viewport comes back by itself. */
.outfit-viewport:has(> .outfit-placeholder:only-child) { display: none; }
.outfit-placeholder {
  text-align: center; color: var(--secondary-plate);
  background: var(--plate); border-radius: var(--radius-photo);
  padding: 72px var(--sp-5); font-size: var(--fs-body);
}

/* A new look fades in as one piece: the change is the look itself, so it
   is answered without making anyone wait for a choreography. */
.outfit-card { animation: fade var(--dur-state) ease-out; }
@keyframes pieceIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* The picture comes first, then the look's name and the reason for it — the
   order the B artboard reads in, and the reverse of what shipped, where five
   full-width tiles stood between the screen title and the hero. */
.outfit-caption {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.outfit-caption .title { font-family: var(--font-ui); font-weight: 600; letter-spacing: 0; font-size: var(--fs-section); }
/* The match reading, in words. A percentage claimed a precision the stylist
   has no source for, and a green pill gave a ranking the weight of a verdict:
   this is a quiet qualifier beside the look's name. */
.outfit-caption .score {
  flex: 0 0 auto;
  background: none; padding: 0; border-radius: 0;
  color: var(--secondary);
  font-size: var(--fs-meta); font-weight: 500;
}
/* The pieces are the caption to the picture, not the picture: three to a row,
   small enough that a five-piece look still reads as one block. */
.outfit-pieces-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3) 2px;
  margin-top: var(--sp-3);
}
/* The piece sits directly on the outfit plate: it used to carry its own
   surface and border inside .outfit-viewport's, around an image well with a
   third — three nested containers for one garment. */
.piece {
  background: transparent;
  border: 0;
  overflow: hidden;
  padding-bottom: 10px;
}
.piece .p-img {
  aspect-ratio: 4 / 5;
  background: var(--shot-bg);
  border-radius: var(--radius-photo);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-2);
}
.piece .p-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  padding: 0;
  box-sizing: border-box;
}
.piece .p-nm {
  font-size: 13px; font-weight: 600; line-height: 1.3; padding: 0 2px;
  /* three to a row is ~105px: two lines of a garment name, then an ellipsis,
     so one long name cannot push its row out of line with the next */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.piece .p-cat { font-size: var(--fs-meta); color: var(--secondary); padding: 0 2px; margin-top: 2px; }

/* Mix & Match (DESIGN.md, 2026-10-22): the Keep pin on a piece's photo. A
   white pill with a hairline when off; an ink fill with "Kept" when on — a
   selected chip is an ink fill. ::after takes the target to 44px. */
.piece .p-img { position: relative; }
.piece-keep {
  position: absolute; top: 6px; right: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; min-width: 28px; padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-thumb);
  font: 600 12px/1 var(--font-ui);
  cursor: pointer;
}
.piece-keep svg { width: 14px; height: 14px; flex: none; }
.piece-keep span { display: none; }
.piece-keep[aria-pressed="true"] {
  background: var(--chip-active-bg); color: var(--chip-active-ink);
  border-color: var(--chip-active-border);
}
.piece-keep[aria-pressed="true"] span { display: inline; }
.piece-keep::after { content: ''; position: absolute; inset: -8px; }

/* ---------- The look, piece by piece (DESIGN.md 2026-11-17, LOOK-TOOLS-PLAN) ---------- */
/* Swap: the same white pill as the Keep pin, bottom right of the photo, so
   the two 44px targets never meet. */
.piece-swap {
  position: absolute; right: 6px; bottom: 6px;
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-thumb);
  cursor: pointer;
}
.piece-swap svg { width: 15px; height: 15px; }
.piece-swap::after { content: ''; position: absolute; inset: -8px; }
.piece-swap[hidden], .look-tools[hidden], .lt-hint[hidden], .lt-undo[hidden],
.look-why[hidden], .look-suggest[hidden] { display: none; }
/* The swapped-in piece arrives with a small spring. */
.piece .p-img.swap-pop { animation: swapPop 0.5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes swapPop { from { transform: scale(.6); opacity: .3; } to { transform: none; opacity: 1; } }
/* A suggestion's photo on its way to the look. */
.look-fly {
  position: fixed; z-index: 60; margin: 0; pointer-events: none;
  overflow: hidden; border-radius: var(--radius-tile); box-shadow: var(--shadow-float);
}
/* The line over the pieces: what the arrows do, and Undo once there is one. */
.look-tools {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 44px; margin-top: var(--sp-3); padding: 0 var(--page-pad);
}
.lt-hint { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-meta); color: var(--secondary); }
.lt-hint svg { width: 14px; height: 14px; flex: none; }
.lt-undo {
  position: relative; margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--ink);
  background: var(--ground); color: var(--ink);
  font: 600 13px/1 var(--font-ui); cursor: pointer;
}
.lt-undo svg { width: 15px; height: 15px; }
.lt-undo::after { content: ''; position: absolute; inset: -4px; }
.look-tools + .outfit-pieces-grid { margin-top: var(--sp-2); }
/* Why it works / How it pairs, and From your closet: section heads in the
   group-label voice, rows on the ground — no card around them. */
.look-why, .look-suggest { margin-top: var(--sp-5); padding: 0 var(--page-pad); }
.look-sec-h {
  margin: 0 0 var(--sp-2);
  font-family: var(--label-font); font-style: var(--label-style);
  font-size: var(--label-size); font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking); text-transform: var(--label-case);
  color: var(--ink);
}
.lw-row { display: flex; align-items: flex-start; gap: var(--sp-3); padding: 7px 0; }
.lw-check {
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  border-radius: 50%; border: 1.5px solid var(--hairline-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--on-ink); transition: background 0.3s, border-color 0.3s;
}
.lw-check svg { width: 12px; height: 12px; opacity: 0; }
.lw-row.ok .lw-check { background: var(--ink); border-color: var(--ink); }
/* The tick draws itself, one row after another (140 ms apart). Its resting
   state is drawn, so with motion off it is simply there. */
.lw-row.ok .lw-check svg { opacity: 1; stroke-dasharray: 24; stroke-dashoffset: 0; animation: lwTick 0.4s ease 0.15s backwards; }
.lw-row:nth-of-type(2).ok .lw-check svg { animation-delay: 0.29s; }
.lw-row:nth-of-type(3).ok .lw-check svg { animation-delay: 0.43s; }
@keyframes lwTick { from { stroke-dashoffset: 24; } }
.lw-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lw-lbl { font-size: var(--fs-body); font-weight: 600; color: var(--ink); line-height: 1.3; }
.lw-why { font-size: var(--fs-meta); color: var(--secondary); line-height: 1.4; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ls-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-2); }
.ls-card {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 0; border: 0; background: none; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
}
.ls-img {
  display: flex; aspect-ratio: 4 / 5; overflow: hidden; margin-bottom: var(--sp-1);
  background: var(--shot-bg); border-radius: var(--radius-photo);
}
.ls-img img { width: 100%; height: 100%; object-fit: cover; }
.ls-img .no-photo { width: 100%; height: 100%; aspect-ratio: auto; padding: 0; border-radius: 0; }
.ls-nm { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-for { font-size: var(--fs-meta); color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* WEARING: the pieces of the look open on Style, on their closet tiles. */
.pick-card { position: relative; }
.item-card.is-wearing::before, .pick-card.is-wearing::before {
  content: 'Wearing';
  position: absolute; left: 6px; top: 6px; z-index: 2;
  padding: 4px 6px 3px; border-radius: 4px;
  background: var(--ink); color: var(--on-ink);
  font: 600 10px/1 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase;
  pointer-events: none;
}
/* A worn shot sweeps in over what stood there: the old media waits in an
   underlay, a white line rides the edge. */
.hero-under { position: absolute; z-index: 0; overflow: hidden; pointer-events: none; }
.hero-under > * { width: 100%; height: 100%; }
.hero-plate > img.hero-shot.sweeping { position: relative; z-index: 1; animation: none; }
.hero-glint {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  height: 2px; margin-top: -1px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, #fff 15%, #fff 85%, transparent);
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.85);
}

/* Nothing else goes: a quiet note under the pieces, not a wall. */
.remix-note, .ba-note {
  background: var(--plate); border-radius: var(--radius-tile);
  padding: var(--sp-4); margin-top: var(--sp-3);
  color: var(--secondary-plate); font-size: var(--fs-body);
}
.outfit-viewport .remix-note { margin-left: var(--page-pad); margin-right: var(--page-pad); }
.remix-note p, .ba-note p { margin: 0 0 var(--sp-3); }
.remix-note .btn-secondary, .ba-note .btn-secondary { background: var(--ground); }

/* Choose your style, built around the fixed pieces: the strip over the grid. */
.built-around {
  margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3);
  scroll-margin-top: 72px; /* clears the top bar when a pin brings it into view */
}
/* The same small spaced capitals as the style groups under it. */
.built-around .vibe-group-lbl {
  margin: 0; font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}
.ba-chips, .ba-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ba-chip, .ba-cand {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 4px 4px 4px 4px;
  border-radius: var(--radius-pill);
  font: 600 var(--fs-meta)/1.2 var(--font-ui); color: var(--ink);
}
.ba-chip { background: var(--chip-active-bg); color: var(--chip-active-ink); padding-right: 2px; }
.ba-cand { background: var(--plate); border: 0; padding-right: 14px; cursor: pointer; }
.ba-face {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--shot-bg); display: flex; align-items: center; justify-content: center;
}
.ba-face img { width: 100%; height: 100%; object-fit: cover; }
.ba-face .no-photo { width: 100%; height: 100%; aspect-ratio: auto; padding: 0; border-radius: 0; }
.ba-face .no-photo svg { width: 16px; height: 16px; }
.ba-nm { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-x {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: transparent; color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ba-x svg { width: 14px; height: 14px; }
.ba-x::after { content: ''; position: absolute; inset: -6px; }
.ba-add {
  align-self: flex-start; min-height: 44px; padding: 0 2px;
  background: none; border: 0; cursor: pointer;
  font: 600 var(--fs-body)/1 var(--font-ui); color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.ba-note { margin-top: 0; }

/* The hero: the plate holds the picture and nothing else, so a render can fill
   it edge to edge at its own aspect. Caption, votes and Try-On sit underneath
   on the ground — anything inside the plate would either crop the photograph
   or letterbox it. */
.outfit-hero { position: relative; }
.hero-plate {
  position: relative;
  background: var(--plate);
  border-radius: var(--radius-photo);
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
}
/* The mannequin only — NOT the sparkle in the Try-On pill, the expand glyph or
   the vote icons, which a descendant selector used to reach as well. */
.hero-plate > svg { height: 340px; width: auto; margin: var(--sp-4) 0; }
/* Caption, votes and the Try-On pill on one line under the picture. It wraps
   rather than crushes: "Regenerate (29 left)" beside two vote circles is wider
   than 375px allows, and a dropped line reads better than a clipped one. */
.hero-foot {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-3);
}
.hero-cap {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: var(--fs-meta); font-weight: 500;
  color: var(--secondary);
  margin: 0 auto 0 2px;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* What the two allowances are, under the button that spends them. Meta
   weight: it is a fact to check, not a thing to act on. */
.hero-quota {
  font-family: var(--font-ui);
  font-size: var(--fs-meta);
  font-weight: 400;
  color: var(--secondary);
  margin: var(--sp-2) 2px 0;
}
/* The stylist speaks in body copy, not in a quoted callout: a coloured rule
   down one side is the thing the craft floor calls out by name. */
.stylist-note {
  margin-top: var(--sp-4);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
}
.stylist-note b { color: var(--ink); font-weight: 600; }

/* What you do with the look once you have it. Try-On is not here — it belongs
   to the picture and sits on the hero plate. */
.studio-actions { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-5); }
.studio-actions .btn-secondary, .studio-actions .btn-primary { flex: 1; }
.studio-actions .btn-secondary { display: flex; align-items: center; justify-content: center; gap: 8px; }
.studio-actions .btn-secondary svg { width: 18px; height: 18px; }

.impact-cta { margin-top: var(--sp-4); }

/* The same plate the placeholder uses: whatever the reason the hero is empty,
   the shape of the empty hero is one shape. */
.studio-warn {
  text-align: center;
  background: var(--plate); border-radius: var(--radius-hero);
  padding: 48px var(--sp-5);
  color: var(--secondary-plate); font-size: var(--fs-body);
}
.studio-warn .empty-emoji { color: var(--secondary-plate); }
.studio-warn p { margin: 0 0 var(--sp-4); }
.studio-warn .btn-secondary { background: var(--ground); }

/* ---------- Pack shot ---------- */
/* The screen's primary action, so it is the ink pill — and it carries the one
   glyph in the app that means "a machine makes this". */
.packshot-btn {
  flex: 0 0 auto;
  margin: 0; min-height: 44px; padding: 10px 18px; font-size: var(--fs-body);
  display: flex; align-items: center; gap: 7px;
  border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--btn-ink); border: none; box-shadow: none;
}
.packshot-btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.packshot-btn:disabled, .packshot-btn[disabled] {
  background: var(--plate); color: var(--secondary-plate); border: none; box-shadow: none; cursor: default;
}
/* The render at ITS OWN aspect. The provider returns 1024×1536 (2:3), the stub
   400×500 (4:5), and a future one something else again — so the width is the
   plate's and the height follows the file. No crop, no letterbox: the plate is
   exactly as tall as the picture it holds. */
.hero-plate > img.hero-shot {
  display: block;
  width: 100%; height: auto;
  border-radius: var(--radius-hero);
  animation: fade 0.3s ease;
}
/* Before a render: the look's own pieces, photographed. 2×2 from four pieces
   up, a row below that. 4:5 so the plate keeps its footprint when the render
   lands in its place. */
.hero-collage {
  display: grid;
  gap: 2px;
  width: 100%; aspect-ratio: 4 / 5;
  background: var(--ground);
}
.hero-collage.c4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.hero-collage.c3 { grid-template-columns: repeat(3, 1fr); }
.hero-collage.c2 { grid-template-columns: 1fr 1fr; }
.hero-collage.c1 { grid-template-columns: 1fr; }
.hero-collage > * { background: var(--plate); min-width: 0; min-height: 0; }
.hero-collage img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Rendering: a white veil over the plate carrying the AI accent's progress bar
   and its label — the same bar as the add sheet's conversion, and the only
   place the accent appears on this screen. */
.hero-rendering {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3);
  background: var(--rendering-veil);
  font-size: var(--fs-meta); font-weight: 600;
  letter-spacing: 0; color: var(--ai);
  text-align: center; padding: 0 var(--sp-5); /* the 20 s label runs to two lines */
  pointer-events: none;
}
.outfit-hero.rendering .hero-rendering { display: flex; }
.hero-rendering .track {
  width: min(160px, 56%); height: 4px;
  border-radius: var(--radius-pill);
  background: var(--ai-soft);
  overflow: hidden;
}
.hero-rendering .track i {
  display: block; width: 45%; height: 100%;
  border-radius: var(--radius-pill);
  background: var(--ai);
  animation: heroTrack 1.15s ease-in-out infinite;
}
.hero-rendering .lbl { animation: renderPulse 1.4s ease-in-out infinite; }
@keyframes renderPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes heroTrack { 0% { transform: translateX(-100%); } 100% { transform: translateX(222%); } }
@media (prefers-reduced-motion: reduce) {
  .hero-rendering .track i { animation: none; width: 100%; }
  .hero-rendering .lbl { animation: none; opacity: 1; }
}
.consent-copy { margin: 0 0 var(--sp-5); font-size: var(--fs-body); line-height: 1.55; color: var(--secondary); }

/* ---------- Like / dislike (vote row, in the hero foot) ---------- */
/* Small white circles beside the caption, not a second button row: the verdict
   on a picture belongs next to the picture, and the screen already has an ink
   pill. 36px drawn, 44px tappable. */
.vote-row { display: flex; gap: 6px; margin: 0; }
.vote-btn {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--ground);
  box-shadow: var(--shadow-thumb);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.vote-btn::after { content: ''; position: absolute; inset: -4px; }
.vote-btn svg { width: 18px; height: 18px; }
.vote-btn:hover { background: var(--plate); }
.vote-btn:active { transform: scale(0.94); }
.vote-btn.active { background: var(--ink); color: var(--on-ink); }

/* ---------- Lightbox (full-size pack shot, issue #12) ---------- */
.hero-plate img.hero-shot { cursor: zoom-in; }
/* A white circle with an ink glyph: it sits on the user's own photograph, so
   it is the same white-on-plate control the rest of world B uses, lifted off
   the picture by the one small shadow rather than by a dark scrim. */
.hero-expand {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 50%;
  background: var(--ground);
  box-shadow: var(--shadow-thumb);
  color: var(--ink);
  cursor: zoom-in;
}
.hero-expand::after { content: ''; position: absolute; inset: -6px; }
.hero-expand:hover { background: var(--plate); }
.hero-expand svg { width: 16px; height: 16px; }
.lightbox {
  position: fixed; inset: 0;
  z-index: 70;
  background: rgba(17, 17, 17, 0.94);
  display: flex; align-items: center; justify-content: center;
  animation: fade 0.2s ease;
}
/* The picture keeps the 16px corner it had in the hero plate — squared off
   against the dark ground it reads as a different object from the one that
   was tapped — and it clears the edges so the corner is visible. */
.lightbox img {
  max-width: calc(100% - var(--sp-6) * 2);
  max-height: calc(100% - 180px);
  -webkit-touch-callout: default; /* press and hold → Save to Photos on iPhone */
  object-fit: contain;
  border-radius: var(--radius-sheet);
  transition: transform 0.18s ease;
}
/* The same white circle as the expand control it was opened from. */
.lightbox-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 50%;
  background: var(--ground);
  box-shadow: var(--shadow-thumb);
  color: var(--ink);
  font-size: 18px; line-height: 1;
  cursor: pointer;
}
.lightbox-close svg { width: 20px; height: 20px; }
.lightbox-close:hover { background: var(--plate); }
/* Save sits under the picture, thumb-reachable, white on the dark scrim.
   Its note says what happened inside the viewer: a toast would sit behind it. */
.lightbox-actions {
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.lightbox-actions > * { pointer-events: auto; }
.lightbox-note {
  margin: 0; max-width: 32ch;
  color: #FFFFFF; text-align: center;
  font-size: var(--fs-meta); line-height: 1.4;
}
.lightbox-save {
  min-height: 48px; padding: 12px 22px;
  display: flex; align-items: center; gap: 8px;
  border: none; border-radius: var(--radius-pill);
  background: var(--ground); color: var(--ink);
  font-size: var(--fs-btn); font-weight: 600;
  box-shadow: var(--shadow-thumb);
  cursor: pointer;
}
.lightbox-save svg { width: 18px; height: 18px; }
.lightbox-save:disabled { opacity: 0.6; cursor: default; }

/* ---------- My Looks — saved-looks gallery (client step 9, FR-6) ---------- */
.looks-section { margin-top: 20px; }
.looks-filter {
  display: flex; gap: 8px; overflow-x: auto;
  margin-bottom: 12px; padding-bottom: 2px;
  scrollbar-width: none;
}
.looks-filter::-webkit-scrollbar { display: none; }
.looks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 12px;
}
/* A plain positioning box, not a second plate: the card below IS the plate,
   and the close control and caption hang off this. */
.look-cell { position: relative; }
.look-card {
  display: block;
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 0; margin: 0;
  aspect-ratio: 4 / 5;
  border: none;
  border-radius: var(--radius-tile);
  background: var(--shot-bg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.12s;
}
.look-card:active { transform: scale(0.97); }
.look-card:hover { box-shadow: 0 0 0 2px var(--hairline); }
.look-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No worn shot yet: the pieces themselves, four to a plate. The hairline grid
   says "four garments", where one bled-together image would read as a photo. */
.look-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%; height: 100%;
  background: var(--ground);
}
.look-collage > * { background: var(--plate); min-width: 0; min-height: 0; }
.look-collage img {
  width: 100%; height: 100%;
  object-fit: cover;
  padding: 0;
  box-sizing: border-box;
  display: block;
}
/* A white circle with an ink ✕, the same control as the hero's expand badge —
   28px drawn, 44px tappable through the ::after. */
.look-del {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  padding: 0;
  background: var(--ground); color: var(--ink);
  box-shadow: var(--shadow-thumb);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.look-del:hover { background: var(--plate); }
.look-del svg { width: 14px; height: 14px; }
.look-del::after { content: ''; position: absolute; inset: -8px; }
/* Stacked and left-aligned, not a justified row: at two columns a right-aligned
   date ends up nearer the NEXT card's label than its own. */
.look-meta { margin-top: 7px; }
.look-vibe, .look-date {
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.look-vibe { font-size: 13px; font-weight: 600; line-height: 1.3; }
.look-date {
  font-size: var(--fs-meta); line-height: 1.3; color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

/* ---------- Render history strip (FR-6) ---------- */
.history-section { margin-top: 8px; }
.history-strip {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.history-strip::-webkit-scrollbar { display: none; }
.history-thumb {
  flex: 0 0 auto;
  width: 76px; aspect-ratio: 4 / 5;
  padding: 0; margin: 0;
  border: none;
  border-radius: var(--radius-tile);
  background: var(--shot-bg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.history-thumb:active { transform: scale(0.94); }
.history-thumb:hover { box-shadow: 0 0 0 2px var(--hairline); }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Privacy actions (help modal, FR-1) ----------
   Three destructive actions read as a list, not as three outlined pills: a
   pill gives each of them the billing of the sheet's own "Got it", and three
   of them stacked made the help sheet look like a menu of things to press.
   Rules above and below the group, one between each row, label left. The
   second tap is the commitment, so the confirming row turns ink 600 —
   confirmTap already sets data-confirming, and no new colour is spent. */
.privacy-section { margin-top: var(--sp-2); margin-bottom: var(--sp-5); }
.privacy-actions {
  display: flex; flex-direction: column;
  margin-top: var(--sp-2);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.priv-row {
  display: block; width: 100%;
  min-height: 48px;
  padding: var(--sp-3) 2px;
  border: none; background: none;
  text-align: left;
  font-family: var(--font-ui);
  font-size: var(--fs-body); font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.priv-row + .priv-row { border-top: 1px solid var(--hairline); }
.priv-row:hover { color: var(--ink); background: var(--plate); }
.priv-row[data-confirming] { font-weight: 600; background: var(--plate); }

/* ---------- Worth It ---------- */
.worth-intake { display: flex; flex-direction: column; gap: var(--sp-4); }
.worth-meta { display: flex; flex-direction: column; gap: var(--sp-1); }
.worth-result { animation: fade 0.3s ease; margin-top: var(--sp-6); }

/* ---------- The verdict ----------
   One recessed plate holding the whole answer: the word, the score that
   produced it, the sentence, and the reasons. It used to be a saturated
   green / amber / red field under white text, which gave a rule-engine
   estimate the authority of a test result and put the app's loudest surface
   on its least certain number (R4). The hue survives where it means
   something — on the verdict word itself, all three ≥ 4.5:1 on the plate. */
.verdict-card {
  background: var(--plate);
  border-radius: var(--radius-hero);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.verdict-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3);
}
.verdict-label {
  font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.2;
}
.verdict-card.buy   .verdict-label { color: var(--verdict-buy); }   /* 4.61:1 */
.verdict-card.maybe .verdict-label { color: var(--verdict-maybe); } /* 4.61:1 */
.verdict-card.skip  .verdict-label { color: var(--verdict-skip); }  /* 5.94:1 */
/* The score is a reading, not a headline: an estimate from an on-device rule
   engine shown at 44px read as a measurement. It keeps its scale so the
   number is legible as one. */
.verdict-score {
  flex: 0 0 auto;
  font-size: var(--fs-meta); font-weight: 500;
  color: var(--secondary-plate);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.verdict-sub {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-body); line-height: 1.45;
  color: var(--ink);
}
/* The reasons are the argument behind the word, so they sit in the same plate
   rather than as a loose list further down the scroller. */
.verdict-card .reason-list { margin-top: var(--sp-3); }
.verdict-card .reason-list li:last-child { border-bottom: none; padding-bottom: 0; }

.worth-pairings h3 { font-size: var(--fs-section); font-weight: 600; margin: 0 0 var(--sp-3); }
.pairing-row {
  display: flex; gap: var(--sp-3); overflow-x: auto;
  padding-bottom: var(--sp-1);
  scrollbar-width: none;
  margin-inline: calc(var(--page-pad) * -1);
  padding-inline: var(--page-pad);
}
.pairing-row::-webkit-scrollbar { display: none; }
/* The same tile the Wardrobe and the look pieces use: a 4:5 photograph at
   12px with its name under it. It was a square thumb on its own plate, which
   made one piece of the closet look like a different kind of object here. */
.pairing {
  flex: 0 0 104px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  text-align: left;
}
.pairing img, .pairing .no-photo {
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: var(--radius-tile);
  object-fit: cover;
  background: var(--plate);
  display: block;
}
.pairing .pn {
  font-size: var(--fs-body); font-weight: 600;
  margin-top: var(--sp-2); line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.pair-none { color: var(--secondary); font-size: var(--fs-body); margin: 0; line-height: 1.45; }
#worthReset { margin-top: var(--sp-5); }
.reason-list { margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
.reason-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: var(--fs-body); padding: var(--sp-3) 0; border-bottom: 1px solid var(--hairline);
  color: var(--ink); line-height: 1.45;
}
.reason-list li .ic { flex: 0 0 auto; display: flex; margin-top: 2px; color: var(--secondary-plate); }
.reason-list li .ic svg { width: 16px; height: 16px; }
.reason-list li .ic.ok { color: var(--ok); }
.reason-list li .ic.warn { color: var(--warn); }

/* ---------- Impact ---------- */
/* R5, on the finish reviewer's first material fix. This was a 2×2 of identical
   plate cards, each a big number over a small label, plus two more full-width
   plates — the hero-metric template AND the same-size-card scaffold the craft
   floor refuses by name, and the one place in the app that spent a colour on
   decoration. Same four numbers, same words, no plates: the footprint is the
   screen's one figure and leads, the four stats are a hairline-ruled list on
   the ground. The `—` for "no wears yet" stops reading as a broken headline
   once it is a row's value rather than a hero metric.
   `order` moves the lead VISUALLY only. The DOM order is untouched, because
   four stats then their summary is a sound reading sequence and because two
   regression harnesses address the looks-styled card as `.impact-card[3]`. */
.impact-cards { display: flex; flex-direction: column; margin-bottom: var(--sp-5); }
.impact-card {
  background: none;
  border: none;
  border-radius: 0;
  padding: var(--sp-3) 2px;
  /* row-reverse puts the label left and the figure right without touching the
     markup: the children are emitted figure-then-label. */
  display: flex; flex-direction: row-reverse;
  align-items: baseline; justify-content: space-between; gap: var(--sp-4);
  border-bottom: 1px solid var(--hairline);
}
/* The lead figure: the one display-sized thing on the screen. */
.impact-card.wide {
  order: -1;
  display: block;
  border-bottom: none;
  padding: var(--sp-1) 2px var(--sp-5);
}
/* A figure, at the top of the app's own type scale — 28px was a step that
   exists nowhere else, and it was carrying a whole sentence in the zero
   state. Only a number is display-sized here; see .impact-zero. */
.impact-card .big {
  font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
/* --secondary, not --secondary-plate: these labels sit on the ground now. */
.impact-card .cap { font-size: var(--fs-meta); color: var(--secondary); margin-top: 0; font-weight: 500; line-height: 1.35; }
.impact-card.wide .cap { margin-top: var(--sp-1); }
/* The green is gone. OWN-WORLD allows exactly one accent, on the render
   moment, and says of the semantic pair "never a second brand colour": --ok
   belongs to the Worth It? verdict, where it means a judgement, not to two
   Impact figures where it only meant "this is the eco bit". */
.impact-card.green .big { color: var(--ink); }
/* No wears logged yet means there is no average, and "$—" at 700 read as a
   broken number. The mark for "nothing to report" is quiet. */
.impact-card .big.none { color: var(--secondary-plate); font-weight: 500; }
/* The zero state has no number to show, so it has no figure: a lead line at
   body weight and the explanation under it, both body copy. */
.impact-zero { font-size: var(--fs-body); font-weight: 600; color: var(--ink); line-height: 1.4; }
.impact-zero + .cap { font-size: var(--fs-body); font-weight: 400; line-height: 1.45; }
.impact-note {
  background: var(--plate);
  border-radius: var(--radius-tile);
  padding: var(--sp-4);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--secondary-plate);
}
.impact-note strong { color: var(--ink); font-weight: 600; }

/* ---------- FAB ----------
   A labelled black pill, centred, not a bare circle: a "+" alone makes the
   user guess, and B gives the action its words. */
.fab {
  position: absolute;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: calc(var(--tab-h) + var(--safe-bottom) + var(--sp-4));
  height: 48px;
  padding: 0 22px 0 18px;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: none;
  font-family: var(--font-ui);
  font-size: var(--fs-btn); font-weight: 600; line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  transition: transform 0.12s, background 0.15s;
}
.fab svg { width: 20px; height: 20px; flex: 0 0 auto; }
.fab:hover { background: #000000; }
.fab:active { transform: translateX(-50%) scale(0.96); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  /* Opaque white over a hairline. The blur was a glass effect standing in
     for a surface; B's bar is a surface. */
  background: var(--tabbar-bg);
  border-top: 1px solid var(--hairline);
  display: flex;
  z-index: 15;
}
.tab {
  flex: 1;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-1);
  color: var(--secondary);
  font-family: var(--font-ui);
  /* 11px floor: these five labels are the app's primary navigation, and 10px
     functional text degrades on small viewports. */
  font-size: var(--fs-tab); font-weight: 500; letter-spacing: 0;
  padding-top: 6px;
  transition: color 0.18s, transform 0.12s;
}
.tab:active { transform: scale(0.94); }
.tab .ic { display: flex; }
.tab .ic svg { width: 24px; height: 24px; }
.tab.active { color: var(--tab-active); font-weight: 600; }

/* ---------- Modals / sheets ---------- */
.modal-scrim {
  position: fixed; inset: 0;
  background: var(--scrim);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
  animation: fade var(--dur-state) ease-out;
}
@media (min-width: 720px) and (min-height: 700px) { .modal-scrim { align-items: center; } }
.sheet {
  width: 100%;
  max-width: 430px;
  background: var(--sheet-bg);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 8px 20px calc(20px + var(--safe-bottom));
  /* 90vh, but never taller than what is on screen. vh is the viewport with
     the browser's bars away; on a phone turned sideways Safari shows 292px
     of a 402px viewport, so a 90vh sheet stood 70px above the top edge with
     its handle and title out of reach. dvh is the visible height. */
  max-height: 90vh;
  max-height: min(90vh, 100dvh);
  overflow-y: auto;
  animation: slideup var(--dur-sheet) var(--ease-out);
  box-shadow: var(--shadow-sheet);
}
/* On the desktop frame the sheet is a centred card, not a drawer: rising the
   whole viewport height would cross the phone frame, so it lifts a short way. */
@media (min-width: 720px) and (min-height: 700px) {
  .sheet { border-radius: var(--radius-sheet); animation-name: liftup; }
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes liftup { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
/* The grabber: the one thing that says "this sheet drags". */
.sheet-handle {
  width: 36px; height: 5px; border-radius: var(--radius-pill);
  background: var(--hairline);
  margin: 6px auto var(--sp-4);
}
.sheet h2 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-ui);
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.sheet-actions { display: flex; align-items: center; gap: 10px; margin-top: var(--sp-3); }
.sheet-actions .btn-secondary, .sheet-actions .btn-primary { flex: 1; }
/* A text Cancel takes only its label's width; the action keeps the rest. */
.sheet-actions .btn-text { flex: 0 0 auto; margin-left: -14px; }
/* The wordmark introduces the product; it heads the help sheet and
   onboarding step 1, and lives nowhere else. */
.sheet-brand {
  display: block;
  text-align: center;
  margin: 0 0 var(--sp-2);
}

/* The five steps are what the app is FOR, so they are read at full strength:
   ink at the body step, with only the numeral in secondary. Set in grey they
   read as small print under the heading that promises to explain the app. */
.help-steps { margin: 0 0 var(--sp-5); padding-left: 18px; }
.help-steps li { margin-bottom: var(--sp-3); font-size: var(--fs-body); line-height: 1.5; color: var(--ink); }
.help-steps li::marker { color: var(--secondary); }
.help-steps b { font-weight: 600; }

/* ---------- Toast ---------- */
/* Browser surfaces the design never claimed: selection, caret and the form
   control accent all shipped as platform blue against a bone ground. */
::selection { background: var(--ink); color: var(--on-ink); }
input, textarea { caret-color: var(--ink); }
input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }

/* Undo sits beside the message, never inside its wrap: "Removed White cotton
   tee" breaks over two lines at 375px and the action was ending up mid-
   sentence. The ::after grows the target to 44px without moving the label. */
.toast-action {
  position: relative;
  flex: 0 0 auto;
  margin-left: var(--sp-4); padding: 0;
  background: none; border: none;
  color: var(--on-ink); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.toast-action::after { content: ''; position: absolute; inset: -12px -8px; }
/* A dark pill floating over the app — the one dark surface in world B. */
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tab-h) + var(--safe-bottom) + var(--sp-5));
  transform: translateX(-50%);
  /* left:50% leaves a fixed, shrink-to-fit box only the right HALF of the
     viewport to lay out in (measured 187.5px at 375), so a two-word message
     with Undo beside it broke over four lines. max-content sizes it to the
     line, and the cap is measured against the viewport, not that half. */
  width: max-content;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--on-ink);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-pill);
  font-size: var(--fs-body); font-weight: 500;
  line-height: 1.35;
  z-index: 60;
  box-shadow: var(--shadow-float);
  animation: toastIn var(--dur-view) var(--ease-out);
  max-width: calc(min(100vw, 430px) - 48px);
  text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }


/* ---------- Tailor fitting ---------- */
.tailor-intro {
  font-size: var(--fs-body); color: var(--secondary-plate);
  background: var(--plate);
  border-radius: var(--radius-tile);
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-3);
  line-height: 1.5;
}
.measure-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--plate);
  border: none;
  border-radius: var(--radius-tile);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-2);
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}
.measure-row.focus { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--ground); }
.measure-row.confirmed { background: var(--plate); }
.m-lbl { font-size: var(--fs-body); font-weight: 600; }
.m-check { color: var(--ok); font-size: var(--fs-tab); font-weight: 600; margin-left: var(--sp-1); white-space: nowrap; }
/* The tick is a drawn icon, not a ✓ character — the icon family is stroke SVG. */
.m-check svg { width: 11px; height: 11px; vertical-align: -1px; }
.m-est { color: var(--secondary-plate); font-size: 11px; font-weight: 500; margin-left: var(--sp-1); }
.m-hint { font-size: 11px; color: var(--secondary-plate); margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.step-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--ground);
  font-size: var(--fs-section); font-weight: 500; color: var(--ink);
  cursor: pointer; line-height: 1;
  transition: background 0.12s, transform 0.12s;
}
.step-btn:hover { background: var(--hairline); }
.step-btn:active { background: var(--hairline); transform: scale(0.92); }
.m-val { font-size: var(--fs-btn); font-weight: 600; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.m-val small { font-size: var(--fs-tab); color: var(--secondary-plate); font-weight: 500; margin-left: 1px; }

.silhouette-card {
  background: var(--plate);
  border-radius: var(--radius-tile);
  padding: 14px var(--sp-4);
  margin: var(--sp-4) 0 var(--sp-5);
}
.sil-head { font-size: var(--fs-body); }
.sil-head b { font-weight: 600; }
/* The provenance line sits under the reading, not beside it: run in, it wrapped
   mid-phrase ("read from your / measurements") against the reading's own wrap. */
.sil-head em {
  display: block;
  font-style: normal; font-size: var(--fs-tab);
  color: var(--secondary-plate);
  margin: 2px 0 0;
}
.sil-tip { font-size: var(--fs-body); color: var(--secondary-plate); margin-top: var(--sp-2); line-height: 1.5; }

/* ---------- Ask the stylist ---------- */
.ask-box {
  display: flex; gap: 8px;
  margin: 4px 0 12px;
}
.ask-box input {
  flex: 1;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-field);
  background: var(--plate);
  padding: 13px 18px;
  font-size: var(--fs-body);
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.15s, background 0.15s;
}
.ask-box input::placeholder { color: var(--secondary-plate); }
.ask-box input:focus { background: var(--ground); box-shadow: inset 0 0 0 1.5px var(--ink); }
/* A round send, the way a chat field sends. */
.ask-btn {
  width: 48px; height: 48px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--btn-bg);
  color: var(--btn-ink);
  cursor: pointer;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s, background 0.15s;
}
.ask-btn:hover { background: #000000; }
.ask-btn:active { transform: scale(0.94); }
.ask-btn svg { width: 20px; height: 20px; }
.ask-reply {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--plate);
  border: none;
  border-radius: var(--radius-tile);
  padding: var(--sp-3) 15px;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: var(--sp-3);
  animation: fade 0.25s ease;
}
.ask-ic { flex: 0 0 auto; display: flex; color: var(--secondary-plate); margin-top: 2px; }
.ask-ic svg { width: 17px; height: 17px; }

/* ---------- Onboarding ---------- */
.ob-sheet { text-align: left; }
/* The way forward stays on screen. A step is often taller than its sheet
   (step 1 is 972px in a 522px sheet on a short display), and its button sat
   below the fold or half under the edge. .ob-actions pins the step's buttons
   to the sheet's bottom edge while the step scrolls beneath them. It bleeds
   through the sheet's 20px side padding and carries the sheet's own bottom
   padding, cancelled by the negative margin, so pinned and at the end of the
   scroll it rests in the same place. A sticky offset is measured from the
   scroller's CONTENT edge, so `bottom` is the padding again, negated, to
   reach the sheet's real edge (the trick .ui-dialog-footer uses). Under 480px of height the pinned block
   would take half the sheet, so there it is an ordinary block again. On the
   consent step only the button is pinned, and it stays disabled: the tick
   box stays in the notice, at the end of what it agrees to, so a short
   screen still has to scroll through the notice to reach it. */
@media (min-height: 481px) {
  .ob-actions {
    position: sticky;
    bottom: calc(-1 * (20px + var(--safe-bottom)));
    z-index: 1;
    margin: var(--sp-3) -20px calc(-1 * (20px + var(--safe-bottom)));
    padding: var(--sp-3) 20px calc(20px + var(--safe-bottom));
    background: var(--sheet-bg);
  }
  /* What scrolls under the buttons fades out instead of being cut flat. */
  .ob-actions::before {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 100%;
    height: var(--sp-4);
    background: linear-gradient(to bottom, transparent, var(--sheet-bg));
    pointer-events: none;
  }
  .ob-actions > .btn-primary.full { margin-top: 0; }
}
/* The monogram that opens the app: the brand's own letter on an ink plate,
   with the wordmark beneath it. This and the help sheet are the only two
   places the wordmark appears. */
.ob-mark {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  /* Mark and wordmark are one lockup: tight to each other, with the heading's
     own space opening beneath them so the wordmark reads as the brand's
     signature and not as a label stuck on top of the heading. */
  margin: var(--sp-2) auto var(--sp-2);
  border-radius: var(--radius-tile);
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  user-select: none;
}
.ob-sheet h2 { text-align: center; }
#obStep1 .sheet-brand { margin-bottom: 0; }
#obStep1 h2 { margin-top: var(--sp-6); }
.ob-sub {
  font-size: var(--fs-body); color: var(--secondary);
  text-align: center;
  margin: var(--sp-1) 0 var(--sp-5);
  line-height: 1.5;
}
.ob-figure {
  height: 230px;
  display: flex; justify-content: center;
  margin: 6px 0;
}
.ob-figure svg { height: 100%; }
.ob-figure.sm { height: 165px; margin: 0 0 12px; }
.ob-acc {
  text-align: center;
  font-size: var(--fs-body); color: var(--secondary-plate);
  background: var(--plate);
  border-radius: var(--radius-tile);
  padding: var(--sp-3) 14px;
  margin-bottom: var(--sp-4);
}
.ob-acc b { color: var(--ink); font-weight: 600; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin: 0 0 14px; }
.ob-dots i {
  width: 6px; height: 6px; border-radius: var(--radius-pill);
  background: var(--hairline);
  transition: background 0.2s, width 0.2s;
}
.ob-dots i.on { background: var(--ink); width: 18px; }
/* The dots are rewritten on every step, so their transition never runs; the
   step just reached grows from the left instead, which is the progress. */
.ob-dots i.now { animation: dotGrow var(--dur-sheet) var(--ease-out); transform-origin: left center; }
@keyframes dotGrow { from { transform: scaleX(0.34); } to { transform: none; } }
.ob-meter {
  background: var(--plate);
  border: none;
  border-radius: var(--radius-tile);
  padding: var(--sp-3) 14px;
  margin: 2px 0 var(--sp-4);
}
.ob-meter .acc-meter { margin-bottom: 0; background: var(--ground); }
/* The upload fallback is a .btn-text (R1's label-only button); this only puts
   it on its own centred line under the action it is an alternative to.
   .ob-alt is the same rule under an honest name, for the wizard's two restore
   buttons ("I have a backup", "Start a new twin instead"), which upload nothing. */
.ob-upload, .ob-alt {
  display: block;
  margin: var(--sp-3) auto 0;
}
.ob-selfie { padding: var(--sp-1) 0 14px; }
.selfie-done { display: flex; align-items: center; gap: 14px; justify-content: center; }
.selfie-done img {
  width: 84px; height: 105px;
  object-fit: cover;
  border-radius: var(--radius-tile);
}
.selfie-done b { font-size: var(--fs-body); }
/* .btn-text carries 14px of side padding; pulled back so "Retake" starts on
   the same line as the sentence above it (the trick .sheet-actions uses). */
.selfie-done .ob-upload { margin: 6px 0 0 -14px; }

/* ---------- Body shape picker ---------- */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.shape-btn {
  border: none;
  background: var(--plate);
  border-radius: var(--radius-tile);
  padding: var(--sp-3) var(--sp-1) var(--sp-3);
  cursor: pointer;
  color: var(--shape-fig);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.shape-btn:hover { background: #ECEDF0; }
.shape-btn:active { transform: scale(0.96); }
.shape-btn svg { width: 30px; height: 56px; }
.shape-btn .sh-lbl { font-size: 12px; font-weight: 600; color: var(--ink); }
.shape-btn .sh-hint { font-size: var(--fs-tab); color: var(--secondary-plate); }
.shape-btn.active {
  background: var(--ground);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.shape-btn.active .sh-hint { color: var(--secondary); }

/* ---------- Guided selfie ---------- */
.face-stage {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  border-radius: var(--radius-hero);
  overflow: hidden;
  background: var(--ink);
}
.face-stage video, .face-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.face-stage video { transform: scaleX(-1); }
/* Mirror CAMERA confirm stills to match the mirrored live viewfinder — uploads
   show as-is. The STORED selfie stays unmirrored (canvas ignores CSS transforms). */
#facePreview.mirror { transform: scaleX(-1); }
.face-oval { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.face-msg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 500;
  padding: 24px; text-align: center;
}
/* The capture sheet's heading is left, so its standing instruction is too —
   only the wizard centres its copy. */
/* Consent step — the notice the twin is created behind. Left-aligned against
   the wizard's centred copy on purpose: this is read, not glanced at. */
.consent-list {
  list-style: none;
  margin: 0 0 var(--sp-4);
  padding: 0;
  text-align: left;
}
.consent-list li {
  font-size: var(--fs-body);
  color: var(--secondary);
  line-height: 1.55;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--hairline);
}
.consent-list li:first-child { border-top: 1px solid var(--hairline); }
.consent-list b { color: var(--ink); font-weight: 600; }

.consent-agree {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  text-align: left;
  font-size: var(--fs-body);
  color: var(--ink);
  line-height: 1.5;
  padding: var(--sp-3) 0;
  cursor: pointer;
}
/* 20px and a 44px tap target around it: the one control on this screen. */
.consent-agree input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.consent-note {
  font-size: var(--fs-meta);
  color: var(--secondary);
  text-align: left;
  margin: 0 0 var(--sp-4);
  line-height: 1.5;
}

.face-sheet .ob-sub { text-align: left; }
.face-sheet .sheet-actions { margin-top: 16px; }
.face-sheet .ob-upload { margin-bottom: 4px; }
/* The shutter. While the camera is armed the action is not a sentence, it is a
   button you press to take the picture, so it takes the shape every camera
   gives it: an ink disc inside a ring. It goes back to a labelled pill the
   moment it means something else ("Hold on…", "Try again", "Use photo"). */
.btn-primary.shutter {
  width: 68px; height: 68px;
  min-height: 68px;
  padding: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--ground), inset 0 0 0 5.5px var(--ink);
}
.btn-primary.shutter .lbl {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Three columns so the disc is centred on the sheet and Cancel keeps its own
   place at the edge: the empty third column is the counterweight. */
.face-sheet .sheet-actions.shot-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.face-sheet .sheet-actions.shot-row .btn-text { justify-self: start; }

/* ---------- Full-body onboarding (Mode B) ---------- */
.fb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fb-slot {
  position: relative;
  border: 1px dashed var(--drop-line);
  background: var(--plate);
  border-radius: var(--radius-tile);
  aspect-ratio: 3 / 4;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--secondary-plate);
  transition: border-color 0.15s, transform 0.12s;
}
.fb-slot:active { transform: scale(0.96); }
.fb-slot .fb-ic { display: flex; color: var(--ink); }
.fb-slot .fb-ic svg { width: 26px; height: 26px; }
.fb-slot .fb-lbl { font-size: 11px; font-weight: 600; color: var(--secondary-plate); }
.fb-slot.has-photo { border-style: solid; border-color: transparent; }
.fb-slot.has-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.fb-check {
  position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-check svg { width: 12px; height: 12px; }

/* ---------- Motion ----------
   The rules here are the transitions BETWEEN states; each component keeps its
   own press and entrance rules beside it. Tokens: --ease-*, --dur-* in :root. */

/* A sheet or toast that closes is hidden at once (the app sets [hidden] and
   moves on); Motion.leave() draws an inert copy in its place that plays the
   exit and removes itself. Exits are quicker than entrances and accelerate. */
.is-leaving { pointer-events: none; }
.modal-scrim.is-leaving { animation: fadeOut var(--dur-leave) var(--ease-in) both; }
.modal-scrim.is-leaving .sheet { animation: slidedown var(--dur-leave) var(--ease-in) both; }
@media (min-width: 720px) and (min-height: 700px) {
  .modal-scrim.is-leaving .sheet { animation-name: liftdown; }
}
.toast.is-leaving { animation: toastOut var(--dur-leave) var(--ease-in) both; }
@keyframes slidedown { to { transform: translateY(100%); } }
@keyframes liftdown { to { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 8px); } }


/* Onboarding steps: Motion.step() slides the new panel in and eases the
   sheet between the two heights, so the sheet's top edge glides instead of
   jumping when a short step follows a tall one. */
.sheet.is-resizing { overflow: hidden; }

/* ----- The twin, revealed -----
   The one authored moment. "Meet your twin" is the proof that the minute the
   guest just spent produced something, so the figure is drawn rather than
   shown: the body rises into place, the tape lines run out from it, and each
   measurement reads in, top to bottom, the way a tailor would call them. */
/* The body is the first group INSIDE the outer one: the outer <g> carries the
   figure's scale as an SVG transform attribute, which a CSS transform would
   replace. */
#obStep5 .ob-figure svg > g > g:first-of-type { animation: twinRise 420ms var(--ease-out) both; transform-box: fill-box; transform-origin: 50% 100%; }
#obStep5 .ob-figure .fx-rule { animation: tapeRun 340ms var(--ease-out) both; transform-box: fill-box; transform-origin: 0 50%; }
#obStep5 .ob-figure .fx-lbl,
#obStep5 .ob-figure .fx-val { animation: fade var(--dur-view) ease-out both; }
#obStep5 .ob-figure .fx-rule:nth-of-type(1) { animation-delay: 160ms; }
#obStep5 .ob-figure .fx-rule:nth-of-type(2) { animation-delay: 200ms; }
#obStep5 .ob-figure .fx-rule:nth-of-type(3) { animation-delay: 240ms; }
#obStep5 .ob-figure .fx-rule:nth-of-type(n+4) { animation-delay: 280ms; }
#obStep5 .ob-figure .fx-lbl:nth-of-type(1), #obStep5 .ob-figure .fx-val:nth-of-type(2) { animation-delay: 240ms; }
#obStep5 .ob-figure .fx-lbl:nth-of-type(3), #obStep5 .ob-figure .fx-val:nth-of-type(4) { animation-delay: 280ms; }
#obStep5 .ob-figure .fx-lbl:nth-of-type(5), #obStep5 .ob-figure .fx-val:nth-of-type(6) { animation-delay: 320ms; }
#obStep5 .ob-figure .fx-lbl:nth-of-type(n+7), #obStep5 .ob-figure .fx-val:nth-of-type(n+8) { animation-delay: 360ms; }
#obStep5 .ob-acc, #obStep5 #obDone { animation: pieceIn var(--dur-view) var(--ease-out) 380ms both; }
@keyframes twinRise { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes tapeRun { from { transform: scaleX(0); } to { transform: none; } }

/* ----- The twin, handed over -----
   "Start dressing" closes the wizard over the Twin tab, which draws the same
   twin. Motion.handoff() names the reveal's figure and then the tab's, so the
   twin the guest just met travels into its place in the app while the sheet
   drops away beneath it. */
::view-transition-group(twin) { animation-duration: 460ms; }
::view-transition-old(twin), ::view-transition-new(twin) { animation-duration: 460ms; height: 100%; object-fit: contain; }
::view-transition-old(ob-sheet) { animation: slidedown 300ms var(--ease-in) both; }
::view-transition-old(ob-scrim) { animation: fadeOut 300ms ease-in both; }

/* Reduced motion keeps what carries meaning (a crossfade says "this changed")
   and drops every movement. The global rule near the top of this file already
   stops CSS animations on elements; view-transition pseudos are not elements,
   so they are reduced here, and the JS layer checks the same query. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation-duration: 120ms !important; }
}

/* ---------- Porter: serif headings, frosted chrome (2026-10-18) ----------
   The owner chose direction B from the Style Studio canvas: Mr Porter's
   editorial calm (a serif for headings, small spaced capitals for section
   labels, photographs doing the work) over glass chrome. Body copy, controls
   and numbers stay in the platform sans. */
/* Headlines in Montserrat (client brief, 2026-11-16): the two weights the
   display rules use, Latin only, bundled under the OFL (fonts/OFL-Montserrat.txt).
   Thai in a headline falls back to the platform sans, as body copy does. */
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/cormorant-garamond-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
.screen-title,
.sheet h2,
.empty-state h2,
.look-name,
.studio-h {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.screen-title { font-size: 30px; line-height: 1.05; }
.sheet h2 { font-size: 28px; line-height: 1.1; }
.empty-state h2 { font-size: 26px; }
/* The add sheet's title is a working label with a batch counter in it. */
#addModal .sheet h2 { font-family: var(--font-ui); }

/* The bar floats over the content, which now scrolls under it. */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}
.screens { padding-top: calc(var(--top-h) + var(--safe-top) + var(--sp-1)); }
.topbar .ghost-btn { background: var(--glass-strong); border: 1px solid rgba(17, 17, 17, 0.08); }

/* The tab bar is a floating capsule of glass, inset from the edges. */
.tabbar {
  left: 12px; right: 12px;
  bottom: calc(10px + var(--safe-bottom));
  height: var(--tab-h);
  padding-bottom: 0;
  border-radius: 26px;
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}
.fab { bottom: calc(var(--tab-h) + var(--safe-bottom) + 10px + var(--sp-4)); }

/* Where transparency is turned down, the glass turns solid. */
@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar { background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ===================================================================
   World B — the client-mockup system
   White ground, one grey plate, near-black ink, the platform's own sans.
   Emphasis is weight and fill, never hue: the only colour in the shell is
   the AI accent on the one moment a machine is working for you.
   Values, ratios and per-primitive usage rules: zilhouette/DESIGN.md.
   =================================================================== */
:root {
  /* ---------- Ground, ink, plate ---------- */
  --ground: #FFFFFF;             /* the app ground — everything sits on white */
  --plate: #F5F5F7;              /* the one recessed surface: photo wells, tracks,
                                    inactive chips, insets. Never a second tier. */
  --ink: #111111;                /* 18.88:1 on ground, 17.34:1 on plate */
  --secondary: #6B7280;          /* secondary text ON GROUND ONLY — 4.83:1 */
  --secondary-plate: #5F6673;    /* the same role on --plate. B's own #6B7280
                                    measures 4.44:1 there and fails the floor,
                                    so plate-mounted secondary text darkens
                                    to 5.31:1. Deliberate, documented. */
  --hairline: #E5E7EB;           /* the only divider weight in the app */
  --hairline-strong: #D1D5DB;    /* dashed drop zones, dimension lines */
  --on-ink: #FFFFFF;             /* text and icons on an ink fill */

  /* The AI accent. Used ONLY where a machine is working on the user's
     behalf — the pack-shot / try-on progress bar and its veil. Never body
     text, never a second brand colour. 7.10:1 on ground, far past the 3:1
     non-text floor. */
  --ai: #6D28D9;
  --ai-soft: #F3EFFD;

  /* ---------- Legacy names, remapped role for role ----------
     ~300 var(--…) uses across this file were written against the Ink &
     Lacquer set. Each name keeps its ROLE and takes B's value, so an
     untouched rule renders in B; primitives rewritten below use the new
     names above. DESIGN.md carries the full old → new map. */
  --frame-bg: #E5E7EB;           /* desktop surround behind the phone frame */
  --bg: var(--ground);
  --surface: #FFFFFF;            /* "raised card" is just the ground in B */
  --surface-2: var(--plate);
  --ink-soft: var(--secondary);
  --ink-faint: var(--secondary);  /* B has ONE secondary; nothing lighter exists */
  --line: var(--hairline);
  --line-strong: var(--hairline-strong);
  --accent: var(--ink);          /* B has no brand hue: emphasis is the ink fill */
  --accent-deep: #000000;
  --ivory: var(--on-ink);
  --focus: var(--ink);           /* 2px ink ring, 2px offset */

  /* ---------- Semantic — retuned to B, all AA on ground and plate ---------- */
  --ok: #15803D;                 /* 5.02:1 ground · 4.61:1 plate */
  --ok-soft: var(--plate);       /* B has no tinted panel: "good" sits on plate */
  --ok-ink: var(--ink);
  --warn: #B45309;               /* 5.02:1 ground */
  --verdict-buy: #15803D;        /* white on it: 5.02:1 */
  --verdict-maybe: #B45309;      /* white on it: 5.02:1 */
  --verdict-skip: #B91C1C;       /* white on it: 6.47:1 */

  /* ---------- Shape ----------
     Four values, each with one job. A tile is 12, anything that holds a
     composition is 16, anything you tap is a pill, and the segmented
     control is its own 10/8 pair so the thumb nests inside the track. */
  --radius-tile: 12px;           /* item photos, thumbs, collage cells, inputs */
  --radius-hero: 16px;           /* hero plates, viewports, verdict, stage */
  --radius-photo: 0px;   /* photographs in shop-grid cards (Zara reference, 2026-10-18):
                           square, so the picture is the edge. Controls keep their pills. */
  --radius-sheet: 16px;          /* sheet top corners */
  --radius-pill: 999px;          /* buttons, chips, FAB, toast */
  --radius-seg: 10px;            /* segmented-control track */
  --radius-seg-thumb: 8px;       /* its thumb */
  --radius-field: 12px;          /* text inputs and steppers */
  /* legacy radius names, mapped by role */
  --radius-lg: var(--radius-hero);
  --radius-md: var(--radius-tile);
  --radius-sm: var(--radius-tile);
  --radius-btn: var(--radius-field);  /* inputs kept this name; BUTTONS take
                                         --radius-pill explicitly below */
  --radius-chip: var(--radius-pill);
  --radius-fab: var(--radius-pill);

  /* ---------- Depth — two shadows, both with offset and blur ---------- */
  --shadow-float: 0 6px 18px rgba(0, 0, 0, 0.18);  /* FAB, toast, sheets */
  --shadow-thumb: 0 1px 2px rgba(0, 0, 0, 0.08);   /* segmented thumb, badge */
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.12);
  --shadow-fab: var(--shadow-float);

  /* ---------- Components ---------- */
  --chip-active-bg: var(--ink);
  --chip-active-border: var(--ink);
  --chip-active-ink: var(--on-ink);
  --btn-bg: var(--ink);
  --btn-ink: var(--on-ink);
  --btn2-line: var(--ink);
  --tab-active: var(--ink);
  --tabbar-bg: #FFFFFF;          /* opaque: B's tab bar is white over a hairline */
  --thumb-bg: #FFFFFF;
  /* The twin stage is the app's one sheet of paper: a spec sheet is drawn on
     white with a ruled edge, and the figure's own skin tone is the only
     colour in it. `.twin-stage` is the sole consumer of both (R3). */
  --stage-bg: #FFFFFF;
  --stage-line: var(--hairline);
  --shot-bg: var(--plate);       /* every photo well */
  --drop-line: var(--hairline-strong);
  --note-bg: var(--plate);
  --shape-fig: var(--secondary); /* the body-shape drawings are information */
  --sheet-bg: #FFFFFF;
  --scrim: rgba(17, 17, 17, 0.46);
  --toast-bg: var(--ink);
  --toast-ink: var(--on-ink);
  --rendering-veil: rgba(255, 255, 255, 0.72);

  /* ---------- Type — the platform's own sans, nothing loaded ---------- */
  --font-ui: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
                                    /* headings only (2026-10-18, the owner's
                                       Mr Porter reference); body stays --font-ui */

  /* ---------- Glass (2026-10-18) ----------
     Frosted chrome over moving content: the top bar, the floating tab bar,
     the panel on a look and the small controls laid on photographs. Glass
     only where something scrolls or sits behind it; never on a plain card. */
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-blur: blur(20px) saturate(170%);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 10px 30px rgba(17, 17, 17, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --display-weight: 700;
  --display-tracking: -0.01em;
  --wordmark-weight: 700;
  --wordmark-tracking: 0.16em;
  --wordmark-case: uppercase;
  /* Section labels are body-weight headings now, not a rubric voice. */
  --label-font: var(--font-ui);
  --label-style: normal;
  --label-size: 15px;
  --label-weight: 600;
  --label-tracking: 0;
  --label-case: none;

  /* ---------- Scale ---------- */
  --fs-title: 22px;    /* screen title, 700 */
  --fs-section: 17px;  /* section heading, 600 */
  --fs-btn: 15px;      /* button and segment labels, 600 */
  --fs-body: 14px;     /* body copy */
  --fs-meta: 12px;     /* meta, captions, counts */
  --fs-tab: 11px;      /* tab labels, 500 / 600 active */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;

  /* ---------- Motion ----------
     One deceleration for everything that arrives, one acceleration for
     everything that leaves, and exits always shorter than entrances. The JS
     motion layer (Motion in app.js) reads the same values. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* arrivals: fast, then settles */
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);    /* exits: gets out of the way */
  --dur-press: 120ms;   /* press feedback */
  --dur-state: 220ms;   /* a control changing state */
  --dur-view: 300ms;    /* a screen or step arriving */
  --dur-sheet: 420ms;   /* a sheet rising */
  --dur-leave: 200ms;   /* anything leaving */
}

/* ---------- Build tag (help sheet footer — pilot diagnostics) ---------- */
.build-tag {
  margin: 14px 0 0;
  text-align: center;
  font-size: var(--fs-tab);
  color: var(--secondary);
}

/* ===================================================================
   SPRINT S2 — the style card, the Style Challenge, per-style Worth it?
   Built from world B's own tokens: no new colour, radius, shadow or type
   size. Three new primitives, all in DESIGN.md — .style-cell (a chip and
   the disc that explains it), .style-pill / .tag-pill (a pill that OPENS
   and a pill that only LABELS), and the style card's own sections.
   =================================================================== */

/* ---------- A style chip and its "what is this?" disc ---------- */
/* Siblings, never nested: the chip's tap already means "choose this style",
   and a button cannot hold a button. The pair travels together so the disc
   never scrolls away from the name it belongs to. */
/* 8px, not 2px (R5): the disc's hit area now grows on all four sides to reach
   the 44px floor, and at a 2px gap that area would have overlapped the chip and
   stolen its right edge. At 8px the two hit boxes clear each other by 2px. */
.style-cell { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ghost-btn.style-info {
  width: 32px; height: 32px;
  position: relative;
  background: none;              /* the chip beside it already carries the plate */
  color: var(--secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.ghost-btn.style-info svg { width: 19px; height: 19px; }
.ghost-btn.style-info:hover { background: var(--plate); color: var(--ink); }
.ghost-btn.style-info:active { transform: scale(0.94); }
/* 32px drawn, 44px tapped — the app's rule wherever the art is smaller than
   the target. It used to grow on three sides only (`inset: -6px -6px -6px 0`)
   so it could not steal the chip's taps, but that left it 38 wide: under the
   floor on one axis, which is the same as being under it. R5 grows it on all
   four and opens `.style-cell`'s gap to 8px instead, so the two hit boxes clear
   each other by 2px and both are 44. */
.ghost-btn.style-info::after { content: ''; position: absolute; inset: -6px; }

/* ---------- A pill that OPENS a style card ---------- */
/* Not a .chip: a chip is a choice and carries aria-pressed. This one has
   nothing to press — it opens the card — so it says so with the same info
   mark the disc uses. */
.style-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--plate);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body); font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.style-pill svg { width: 16px; height: 16px; color: var(--secondary-plate); }
.style-pill:hover { background: #ECEDF0; }
.style-pill:active { transform: scale(0.96); }
.style-pill-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ---------- A pill that only LABELS ---------- */
/* The canon pieces and the occasions on a style card. It is not tappable and
   never was, so it takes no touch target and no pressed state. */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--plate);
  color: var(--ink);
  font-size: var(--fs-meta); font-weight: 500;
}

/* ===================================================================
   THE STYLE CARD (T4)
   =================================================================== */
.style-card { font-size: var(--fs-body); line-height: 1.5; color: var(--ink); }
.style-card p { margin: 0 0 var(--sp-4); }
/* More space above a heading than below it. */
.sc-lbl {
  font-family: var(--label-font);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  color: var(--ink);
  margin: var(--sp-6) 0 var(--sp-2);
}
.sc-lead { font-size: var(--fs-btn); font-weight: 500; line-height: 1.45; }

/* The photographs. A bleeding strip like every other photo row in the app;
   each tile is 200px tall and as wide as its own picture wants within
   132–260px, so a portrait and a group shot both keep their proportions and
   the row still lines up top and bottom. */
.style-shots {
  display: flex; gap: var(--sp-3);
  overflow-x: auto;
  /* The strip now carries pictures only, so the gap to its sources list is the
     list's own top margin — this margin-bottom drops to the small step. */
  margin: 0 -20px var(--sp-3);
  padding: 0 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.style-shots::-webkit-scrollbar { display: none; }
.style-shot { flex: 0 0 auto; margin: 0; }
.style-shot img {
  width: 100%; height: 200px;
  object-fit: cover;
  border-radius: var(--radius-tile);
  display: block;
  background: var(--plate);
}
/* The sources, under the strip rather than inside it (R5). The photographs
   scroll at their own widths; their words do not, because a figure cut by the
   screen edge cut the author's surname with it — and CC BY / CC BY-SA are
   conditional on attribution, so a truncated credit is a licence problem, not
   a styling one. Full width, nothing clipped, in the strip's own order. */
.style-sources {
  list-style: none;
  margin: 0 0 var(--sp-5);
  padding: 0;
}
.style-source + .style-source { margin-top: var(--sp-3); }
.shot-shows {
  display: block;
  font-size: var(--fs-meta); font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}
/* 11px is the app's floor and this is the one place it is spent on running
   text — 4.83:1 on the ground. `cite` un-italicised: the world has one face
   and no italic in its scale. */
.style-credit {
  display: block;
  margin-top: 3px;
  font-size: var(--fs-tab); font-weight: 500;
  font-style: normal;
  line-height: 1.35;
  color: var(--secondary);
}

/* The palette, read as three rows rather than one legend: a reader who knows
   nothing about fashion should not have to decode dot sizes. Core is the big
   dot, accent the small one, avoid is struck through. */
.sc-palette { margin-bottom: var(--sp-4); }
.pal-group { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.pal-lbl {
  flex: 0 0 52px;
  font-size: var(--fs-meta); font-weight: 500;
  color: var(--secondary);
}
.pal-dots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pal-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  display: inline-block;
  position: relative;
}
.pal-dot.sm { width: 16px; height: 16px; }
/* Struck, not greyed: the colour still has to be recognisable to be refused.
   The rule is ink between two ground-coloured hairlines, so it stays visible
   on all fourteen swatches — an ink line vanishes on black, a white one on
   white, and the palette has both. */
.pal-dot.no::after {
  content: '';
  position: absolute; left: -3px; right: -3px; top: 50%;
  height: 2px;
  margin-top: -2px;
  background: var(--ink);
  border-top: 1px solid var(--ground);
  border-bottom: 1px solid var(--ground);
  transform: rotate(-45deg);
}

/* The dress-code ladder — `formal` alone carries one. */
.sc-tiers { margin: 0 0 var(--sp-4); }
.sc-tiers dt {
  font-weight: 600;
  margin-top: var(--sp-3);
}
.sc-tiers dt:first-child { margin-top: 0; }
.sc-tiers dd { margin: 4px 0 0; }
.tier-who {
  font-size: var(--fs-meta); font-weight: 500;
  color: var(--secondary);
  margin-right: 5px;
}

.sc-list { margin: 0 0 var(--sp-4); padding-left: 20px; }
.sc-list li { margin-bottom: 6px; }
.sc-list li::marker { color: var(--secondary); }

.sc-sources { margin: var(--sp-5) 0 var(--sp-5); }
.sc-sources summary {
  font-size: var(--fs-body); font-weight: 500;
  color: var(--secondary);
  cursor: pointer;
  min-height: 32px;
  padding: 6px 0;
}
.sc-sources summary:hover { color: var(--ink); }
.sc-sources ul { margin: var(--sp-2) 0 0; padding-left: 20px; }
.sc-sources li { font-size: var(--fs-meta); color: var(--secondary); margin-bottom: 5px; }

/* ===================================================================
   THE STYLE CHALLENGE (T5)
   =================================================================== */
/* One plate on the Style screen, under the vibe row it acts on. It holds a
   composition — a sentence, a second sentence and two actions — so it takes
   the 16px radius, and it is the only plate there: nothing nests inside it. */
.challenge {
  background: var(--plate);
  border-radius: var(--radius-hero);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.ch-lead {
  margin: 0;
  font-size: var(--fs-body); line-height: 1.5;
  color: var(--ink);
}
.ch-sub {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-body); line-height: 1.45;
  color: var(--secondary-plate);   /* 5.31:1 — this copy sits on the plate */
}
.ch-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.ch-actions .btn-text { padding-inline: 8px; }
/* The block is a plate, and --secondary measures 4.44:1 on it — the same
   reason .btn-text's own hover goes to ink. On a plate it takes the darker
   token (5.31:1), which is DESIGN.md's rule for plate-mounted secondary text. */
.challenge .btn-text { color: var(--secondary-plate); }
.challenge .btn-text:hover { color: var(--ink); }

/* ===================================================================
   WORTH IT? — the per-style answer (T6)
   =================================================================== */
/* Outside the verdict plate, because no plate nests in that one. */
.worth-styles { margin-top: var(--sp-6); }
.worth-styles h3 {
  font-size: var(--fs-section); font-weight: 600;
  margin: 0 0 var(--sp-3);
}
.worth-hint {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-body); line-height: 1.5;
  color: var(--secondary);          /* 4.83:1 — on the ground, not on a plate */
}
.worth-hint b { color: var(--ink); font-weight: 600; }

/* ===================================================================
   Explore (PR #81) — the play space over the app
   Colour lives in the theme cards only: --t-bg / --t-ink / --t-soft are set
   inline from OCCASIONS in app.js. Everything around them stays world B.
   Owner's reference: Tinder's Explore cards (2026-10-18).
   =================================================================== */
.explore {
  position: absolute; inset: 0; z-index: 30;
  background: var(--ground);
  display: flex; flex-direction: column;
  animation: exIn var(--dur-view) var(--ease-out);
}
@keyframes exIn { from { opacity: 0; transform: translateY(12px); } }
.ex-head {
  flex: 0 0 auto;
  height: calc(var(--top-h) + var(--safe-top));
  padding: var(--safe-top) var(--sp-4) 0 var(--sp-2);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
}
.ex-close {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  border-radius: var(--radius-pill); display: grid; place-items: center;
}
.ex-close svg { width: 22px; height: 22px; }
.ex-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1; }
.credit-pill {
  min-width: 44px; height: 34px; padding: 0 var(--sp-3); cursor: pointer;
  border-radius: var(--radius-pill); border: 1px solid rgba(17, 17, 17, 0.12); background: var(--ground);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.credit-pill svg { width: 11px; height: 11px; }
.ex-body {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  padding-bottom: calc(var(--sp-6) + var(--safe-bottom));
}
.ex-intro { margin: 0 var(--sp-5) var(--sp-5); font-size: 14px; color: var(--secondary); }
.ex-sec { display: flex; flex-direction: column; gap: 10px; }
.ex-sec + .ex-sec { margin-top: 32px; }
.ex-pad { padding: 0 var(--sp-5); }
.ex-h { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
#exSecThemes .ex-h { padding: 0 var(--sp-5); }
.ex-rail {
  display: flex; gap: 10px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--sp-5);
  padding: 0 var(--sp-5); scrollbar-width: none;
}
.ex-rail::-webkit-scrollbar { display: none; }

/* Theme card: a label, a serif line, one glossy object, square corners. */
.ex-theme, .ex-cover {
  position: relative; border: 0; font: inherit; text-align: left;
  background: var(--t-bg); color: var(--t-ink);
  display: flex; flex-direction: column; gap: 6px;
}
.ex-theme {
  flex: 0 0 auto; cursor: pointer; scroll-snap-align: start;
  transition: transform var(--dur-press) var(--ease-out);
}
.ex-theme:active { transform: scale(0.98); }
.ex-theme.lg { width: 250px; height: 380px; padding: var(--sp-4); }
.ex-theme.sm { width: 150px; height: 200px; padding: var(--sp-3); gap: 4px; }
.ext-lbl { font-size: 12px; font-weight: 600; color: var(--t-soft); }
.ext-line { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1; text-wrap: balance; }
/* 18px is the most that fits "remembered" across a 150px card. */
.ex-theme.sm .ext-line { font-size: 18px; line-height: 1.04; }
.ext-obj {
  align-self: center; margin: auto 0; width: 150px; height: 150px; object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.3)); pointer-events: none;
}
.ex-theme.sm .ext-obj { position: absolute; left: 50%; bottom: 30px; width: 92px; height: 92px; margin: 0 0 0 -46px; }
.ext-sub { font-size: 13px; line-height: 1.35; color: var(--t-soft); }
.ext-cta { font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Brands: a plate per pack, a dashed "coming soon" until one signs. */
.ex-brands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ex-brand, .ex-soon {
  min-height: 200px; padding: 14px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-2);
}
.ex-brand { border: 0; font: inherit; cursor: pointer; background: var(--plate); color: var(--ink); }
.ex-soon { border: 1px dashed var(--hairline-strong); }
.exb-lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--secondary-plate); }
.exb-line { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.02; color: var(--ink); }
.exb-sub { font-size: 12px; color: var(--secondary-plate); }
.ex-soon .exb-lbl, .ex-soon .exb-sub { color: var(--secondary); }

/* Wide cards: Mix with brands, Challenges. */
.ex-wide {
  width: 100%; min-height: 160px; padding: var(--sp-4); border: 0; font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-2);
}
.ex-wide:disabled { cursor: default; opacity: 0.6; }
.ex-mix { background: #1D3B8B; color: #EEF2FF; --w-soft: #C9D5FA; }
.ex-chal { background: #1F3A2E; color: #E8F0EA; --w-soft: #BFD6C7; }
.exw-lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--w-soft); }
.exw-line { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.02; max-width: 14ch; }
.exw-sub { font-size: 13px; color: var(--w-soft); }

/* The deck. */
.ex-progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 0 var(--sp-5); }
.ex-progress span { height: 3px; border-radius: 2px; background: rgba(17, 17, 17, 0.14); }
.ex-progress span.done { background: var(--ink); }
.ex-stack { position: relative; flex: 1 1 auto; min-height: 420px; margin: var(--sp-4) var(--sp-5) 0; }
.ex-card, .ex-top { position: absolute; inset: 0; }
.ex-card { overflow: hidden; display: flex; flex-direction: column; background: var(--plate); }
.ex-top {
  z-index: 2; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
  transition: transform var(--dur-state) var(--ease-out);
}
.ex-top.dragging { transition: none; cursor: grabbing; }
.ex-top.flying { transition: transform 220ms var(--ease-in); }
.ex-top > .ex-card { box-shadow: 0 16px 40px rgba(17, 17, 17, 0.18); }
.ex-behind { pointer-events: none; }
.ex-behind.b1 { transform: translateY(10px) scale(0.96); }
.ex-behind.b2 { transform: translateY(20px) scale(0.92); }
.ex-stamp {
  position: absolute; top: var(--sp-4); z-index: 3; pointer-events: none;
  height: 32px; padding: 0 14px; display: flex; align-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.ex-stamp.keep { right: var(--sp-4); background: var(--ink); color: var(--on-ink); opacity: var(--keep, 0); }
.ex-stamp.skip { left: var(--sp-4); background: var(--ground); color: var(--ink); border: 1px solid var(--ink); opacity: var(--skip, 0); }
.ex-card.ex-cover { padding: var(--sp-5); gap: var(--sp-2); cursor: pointer; background: var(--t-bg); }
.ex-cover .ext-line { font-size: 40px; max-width: 8em; }
.ex-cover .ext-obj { width: 200px; height: 200px; }

/* A card is the outfit laid out: the lead piece large, the rest beside it. */
.exc-collage { flex: 1 1 auto; min-height: 0; display: grid; gap: 2px; background: var(--ground);
  grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.exc-collage.n3 .lead { grid-row: span 2; }
.exc-collage.n5 { grid-template-columns: 1.3fr repeat(2, minmax(0, 1fr)); }
.exc-collage.n5 .lead { grid-row: span 2; }
.exc-cell { position: relative; min-height: 0; overflow: hidden; display: flex; background: var(--plate); }
.exc-cell > img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-photo); }
.exc-cell .no-photo { flex: 1; border-radius: 0; }
.exc-cell .no-photo .np-lbl { display: none; }
/* No photograph yet: the plate says which piece it stands for. */
.exc-cap { position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: var(--sp-2); font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--secondary-plate); }
.exc-foot { flex: 0 0 auto; padding: var(--sp-3) 14px 14px; background: var(--ground); display: flex; flex-direction: column; gap: var(--sp-2); }
.exc-name { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1; }
.ex-controls { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 22px; padding: 18px 0 var(--sp-2); }
.ex-btn {
  width: 64px; height: 64px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid rgba(17, 17, 17, 0.14); background: var(--ground); color: var(--ink);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(17, 17, 17, 0.10);
  transition: transform var(--dur-press) var(--ease-out);
}
.ex-btn svg { width: 24px; height: 24px; }
.ex-btn.sm { width: 48px; height: 48px; box-shadow: none; }
.ex-btn.sm svg { width: 18px; height: 18px; }
.ex-btn.ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ex-btn:active { transform: scale(0.94); }
.ex-btn:disabled { opacity: 0.35; cursor: default; }

/* The end of a round. */
.ex-edit-head {
  position: relative; min-height: 190px; padding: var(--sp-5);
  background: var(--t-bg); color: var(--t-ink);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
}
.ex-edit-head .ext-obj { position: absolute; right: 18px; top: 18px; width: 96px; height: 96px; margin: 0; }
.ex-edit-title { margin: 0; max-width: 9em; font-family: var(--font-display); font-weight: 600; font-size: 36px; line-height: 1; }
.ex-kept { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; margin-top: 2px; }
.ex-kept-cell { position: relative; height: 230px; display: flex; flex-direction: column; background: var(--plate); }
.ex-kept-lbl {
  position: absolute; left: var(--sp-2); bottom: var(--sp-2); height: 28px; padding: 0 10px;
  border-radius: var(--radius-pill); display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
}
.ex-note { margin: var(--sp-3) var(--sp-5) 0; font-size: 13px; color: var(--secondary); }
.ex-edit-actions { margin-top: auto; padding: var(--sp-5) var(--sp-5) 0; display: flex; gap: 10px; }
.ex-edit-actions > * { flex: 1; }

/* Credits sheet (a mock: placeholder numbers, nothing is charged). */
/* The count stays in the UI face: Cormorant's old-style figures read "10" as "IO". */
.cr-n { margin: var(--sp-2) 0 0; display: flex; align-items: baseline; gap: var(--sp-2); font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.cr-n span:last-child { font-family: var(--font-ui); font-size: 15px; font-weight: 500; color: var(--secondary); }
.cr-n .cp-dia svg { width: 18px; height: 18px; }
.cr-copy { margin: var(--sp-3) 0 var(--sp-4); color: var(--secondary); }
.cr-fine { margin: var(--sp-2) 0 var(--sp-4); font-size: 12px; color: var(--secondary); text-align: center; }
#creditsModal .btn-primary, #creditsModal .btn-secondary { width: 100%; }

/* The way into Explore from the twin. */
.play-link {
  width: 100%; margin: var(--sp-4) 0 var(--sp-6); padding: 14px var(--sp-4); cursor: pointer;
  border: 0; font: inherit; text-align: left; background: #4A1015; color: #F6E9E6;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  transition: transform var(--dur-press) var(--ease-out);
}
.play-link:active { transform: scale(0.98); }
.play-link > span { display: flex; flex-direction: column; gap: 2px; }
.pl-lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: #E3B3AB; }
.pl-line { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.05; }
.play-link svg { width: 20px; height: 20px; flex: 0 0 auto; }
@media (prefers-reduced-transparency: reduce) {
  .ex-kept-lbl { background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Style's Play row (owner's pick B): short theme cards above a shorter look.
   The row bleeds to the screen edges like the look under it. */
.play-row { margin: 0 calc(-1 * var(--page-pad)) var(--sp-4); display: flex; flex-direction: column; gap: 10px; }
.play-row-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--page-pad); }
.play-row .ex-rail { padding: 0 var(--page-pad); scroll-padding: 0 var(--page-pad); gap: var(--sp-2); }
.play-all {
  min-height: 44px; margin: -14px -8px -14px 0; padding: 0 8px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--ink);
}
.ext-go {
  position: absolute; right: 10px; bottom: 10px; width: 28px; height: 28px;
  border-radius: var(--radius-pill); border: 1px solid var(--t-soft); color: var(--t-ink);
  display: grid; place-items: center;
}
.ext-go svg { width: 14px; height: 14px; }
.outfit-hero .hero-plate { min-height: 420px; }

/* The look swipes like a deck card. */
.hero-plate.swipeable {
  position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transition: transform var(--dur-state) var(--ease-out);
}
.hero-plate.swipeable.dragging { transition: none; }
.hero-plate.swipeable.flying { transition: transform 200ms var(--ease-in); }
.hero-plate .ex-stamp { top: var(--sp-3); }
.swipe-hint {
  position: absolute; top: var(--sp-3); left: var(--sp-3); z-index: 2; height: 28px; padding: 0 10px;
  border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; pointer-events: none;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
}
.swipe-hint svg { width: 13px; height: 13px; }
.hero-plate.swipeable:has(.swipe-hint) { animation: swipeNudge 900ms var(--ease-out) 700ms 1; }
@keyframes swipeNudge { 0%, 100% { transform: none; } 35% { transform: translateX(-14px) rotate(-1deg); } 70% { transform: translateX(8px) rotate(0.5deg); } }

/* The challenge, now an Explore card. */
.ex-chal { cursor: default; }
.ex-chal .exw-sub { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ex-chal-go {
  align-self: flex-start; min-height: 44px; margin: 0 0 -10px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 3px;
}

/* A Play-row card grows into Explore (the one transition kept on this path). */
.explore.grown { animation: none; }
::view-transition-group(ex-grow) { animation-duration: var(--dur-view); animation-timing-function: var(--ease-out); }
::view-transition-old(ex-grow), ::view-transition-new(ex-grow) { height: 100%; object-fit: cover; }

/* Wardrobe: Mine | Brands. */
.closet-tabs { margin-bottom: var(--sp-4); }
.brand-closet { display: flex; flex-direction: column; gap: 32px; }
.bc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.bc-name { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.05; }
.bc-sub { margin: 2px 0 0; font-size: 12px; color: var(--secondary); }
.bc-head .btn-secondary { flex: 0 0 auto; }

/* ===================================================================
   The twin's rendered body (PR #81). One grey figure cut out on
   transparency: the mask shapes a fill of the skin tone, and the same image
   multiplied on top gives it its shading. --tone and --body are set inline.
   =================================================================== */
/* Two layers (2026-10-30). The skin: its grey multiplied onto the tone inside
   its own alpha. The wear (tank, shorts, hair): drawn over it untinted, so
   only skin takes the twin's tone. */
.body-fig { position: relative; display: block; height: 100%; aspect-ratio: 478 / 720; }
.body-fig::before, .body-fig::after { content: ''; position: absolute; inset: 0; }
.body-fig::before {
  background: var(--body) center / contain no-repeat, var(--tone);
  background-blend-mode: multiply;
  -webkit-mask: var(--body) center / contain no-repeat; mask: var(--body) center / contain no-repeat;
}
.body-fig::after { background: var(--wear) center / contain no-repeat; }
/* The spec sheet: the body on the left, the tape running across it to the
   values on the right, as the drawn version laid it out. */
.body-spec { position: relative; display: block; width: 100%; height: 100%; }
.body-spec .body-fig { position: absolute; left: 4%; top: 0; }
.bf-rules { position: absolute; inset: 0; pointer-events: none; }
.bf-rule {
  position: absolute; left: 12%; right: 0; height: 0;
  border-top: 1px solid var(--hairline-strong);
}
.bf-rule.on { border-top: 1.6px solid var(--ink); }
.bf-lbl, .bf-val { position: absolute; bottom: 2px; font-family: var(--font-ui); }
.bf-lbl { right: 34px; font-size: 9px; letter-spacing: 0.14em; color: var(--secondary); }
.bf-val { right: 0; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1; }
.bf-rule.on .bf-lbl { color: var(--ink); }
.twin-figure { width: min(300px, 100%); height: 330px; }
.ob-figure .body-spec { width: min(280px, 100%); }
/* In the shape picker the body is the button, in the twin's own tone. */
.shape-btn.bodied .body-fig { height: 112px; }
/* Style: the twin waits, undressed, where a look has no photograph. */
/* Short enough to stand whole above the glass panel that overlaps the plate. */
.hero-plate > .body-fig { height: 300px; margin: var(--sp-4) 0 104px; flex: 0 0 auto; }
/* The reveal: the body rises, the tape runs out to its values. */
#obStep5 .ob-figure .body-fig { animation: twinRise 420ms var(--ease-out) both; transform-origin: 50% 100%; }
#obStep5 .ob-figure .bf-rule { animation: tapeRun 340ms var(--ease-out) both; transform-origin: 0 50%; }
#obStep5 .ob-figure .bf-rule:nth-child(1) { animation-delay: 160ms; }
#obStep5 .ob-figure .bf-rule:nth-child(2) { animation-delay: 200ms; }
#obStep5 .ob-figure .bf-rule:nth-child(3) { animation-delay: 240ms; }
#obStep5 .ob-figure .bf-rule:nth-child(4) { animation-delay: 280ms; }

/* A deck card is the whole body (owner, 2026-10-18), with Instagram-shop
   dots on each piece that a tap shows or hides. */
.exc-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; background: var(--plate); overflow: hidden; }
.exc-body { position: relative; height: 100%; aspect-ratio: 478 / 720; padding: var(--sp-3) 0; box-sizing: border-box; }
.exc-body > .body-fig { height: 100%; margin: 0 auto; }
.exc-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.exc-you {
  position: absolute; top: 14px; left: 14px; height: 28px; padding: 0 12px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.exc-tags { position: absolute; inset: var(--sp-3) 0; pointer-events: none; }
.exc-tag {
  position: absolute; width: 0; height: 0;
  opacity: 0; transform: scale(0.6); transition: opacity var(--dur-state) var(--ease-out), transform var(--dur-state) var(--ease-out);
}
.tags-on .exc-tag { opacity: 1; transform: none; }
.exc-dot {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(17, 17, 17, 0.35);
}
.exc-dot::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--ink); }
.exc-bubble {
  position: absolute; top: -18px; display: flex; flex-direction: column; gap: 1px;
  max-width: 180px; padding: 7px 10px; border-radius: 10px; white-space: nowrap;
  background: rgba(17, 17, 17, 0.84); color: #FFFFFF; font-size: 12px; line-height: 1.25;
}
.exc-bubble b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.exc-bubble span { font-size: 11px; color: rgba(255, 255, 255, 0.78); overflow: hidden; text-overflow: ellipsis; }
.exc-tag.r .exc-bubble { left: 16px; }
.exc-tag.l .exc-bubble { right: 16px; }
.exc-tag.brand .exc-bubble { background: #FFFFFF; color: var(--ink); box-shadow: 0 2px 10px rgba(17, 17, 17, 0.25); }
.exc-tag.brand .exc-bubble span { color: var(--secondary); }
/* A tag on the guest's own piece is a button (Mix & Match, PR B): it takes
   taps once the dots show, with a 44px target round the dot; the bubble's
   underlined "Keep this" is the only sign it does something. */
.exc-tag.mine { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.tags-on .exc-tag.mine { pointer-events: auto; }
.exc-tag.mine::before { content: ''; position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; }
.exc-tag.mine .exc-bubble u { text-decoration: underline; text-underline-offset: 2px; color: #FFFFFF; }
.exc-tag.mine:focus-visible .exc-dot { outline: 2px solid #FFFFFF; outline-offset: 3px; }
.exc-list { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.exc-hint { font-size: 12px; color: var(--secondary); }

/* ===================================================================
   "You" cards and the waiting moment (the launch PR after #81)
   The render moment keeps DESIGN.md's rule: the --ai bar and its label are
   the only place the accent goes, on a card exactly as on Style's hero.
   =================================================================== */
/* A worn shot arrives as one piece, over the body it replaces. */
.exc-shot, .ex-kept-shot { animation: shotIn 420ms var(--ease-out) both; }
@keyframes shotIn { from { opacity: 0; } to { opacity: 1; } }
.exc-wait {
  position: absolute; left: 50%; bottom: var(--sp-4); transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 14px;
  background: var(--rendering-veil); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--ai); font-size: 12px; font-weight: 600; white-space: nowrap;
  pointer-events: none;
}
/* The shop dots win while they are open: the shoes' tag sits where the chip does. */
.exc-wait { transition: opacity var(--dur-state) var(--ease-out); }
.tags-on .exc-wait { opacity: 0; }
.exc-wait .track { width: 96px; height: 4px; border-radius: var(--radius-pill); background: var(--ai-soft); overflow: hidden; }
.exc-wait .track i {
  display: block; width: 45%; height: 100%; border-radius: var(--radius-pill); background: var(--ai);
  animation: heroTrack 1.15s ease-in-out infinite;
}
/* The cover's one offer: a pill in the theme's own ink, never the accent. */
.ex-you-on {
  margin-top: var(--sp-2); align-self: flex-start; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--t-ink); border-radius: var(--radius-pill);
  background: transparent; color: var(--t-ink); font: 600 14px/1 var(--font-ui); cursor: pointer;
}
.ex-you-on:active { transform: scale(0.98); }
/* A kept look on the round's edit: the guest in it once the shot is in. */
.ex-kept-face { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ex-kept-face > .exc-collage { flex: 1 1 auto; }
.ex-kept-shot { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.ex-kept-face .exc-wait { bottom: 44px; padding: 8px 12px; }
.ex-kept-face .exc-wait .track { width: 72px; }
.ex-kept-try {
  position: absolute; right: var(--sp-2); bottom: var(--sp-2); height: 28px; padding: 0 10px; gap: 5px;
  border: 0; border-radius: var(--radius-pill); display: inline-flex; align-items: center;
  background: var(--btn-bg); color: var(--btn-ink); font: 600 12px/1 var(--font-ui); cursor: pointer;
}
.ex-kept-try::after { content: ''; position: absolute; inset: -8px; } /* 44px to the finger */
.ex-kept-try svg { width: 9px; height: 9px; }
/* Style's waiting moment: the veil invites play while the studio works. */
.hero-wait-play {
  pointer-events: auto; min-height: 40px; padding: 0 16px; margin-top: var(--sp-1);
  border: 1px solid var(--hairline); border-radius: var(--radius-pill);
  background: var(--ground); color: var(--ink); font: 600 13px/1 var(--font-ui); cursor: pointer;
}
.hero-wait-play:active { transform: scale(0.98); }
@media (prefers-reduced-motion: reduce) {
  .exc-shot, .ex-kept-shot { animation: none; }
  .exc-wait .track i { animation: none; width: 100%; }
}

/* ---------- Sign in (AUTH-PLAN §10, §11) ---------- */
.signin-scrim { z-index: 120; }
.signin-sheet { display: flex; flex-direction: column; gap: var(--sp-3); padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px)); }
.signin-copy { color: var(--ink); margin: 0; }
.signin-fine { color: var(--secondary); font-size: var(--fs-meta); margin: 0; }
.signin-error { color: var(--danger, #b42318); font-size: var(--fs-meta); margin: 0; }
/* LINE's own green for its login button (LINE Login button guidelines). */
.btn-line {
  min-height: 48px; border: 0; border-radius: var(--radius-pill);
  background: #06C755; color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.btn-line:hover { background: #05b34c; }
.btn-line:active { background: #048b3b; }
.btn-line:disabled { opacity: .6; cursor: progress; }
.btn-line.full { width: 100%; }
/* Google's own button (Sign in with Google branding guidelines): white,
   a 1px #747775 outline, #1F1F1F text, the four-colour G at the left. */
.btn-google {
  min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid #747775; border-radius: var(--radius-pill);
  background: #fff; color: #1F1F1F; font: inherit; font-weight: 600; cursor: pointer;
}
.btn-google:hover { background: #f8f9fa; }
.btn-google:active { background: #eceff1; }
.btn-google:disabled { opacity: .6; cursor: progress; }
.btn-google.full { width: 100%; }
.btn-google .g-logo { width: 20px; height: 20px; flex: none; }
.signin-note { color: var(--ink); font-size: var(--fs-meta); margin: 0; }
.account-who { margin: 0 0 var(--sp-2); color: var(--ink); }

/* CR-01 / IMP-02 — approved Navy / Ivory foundation (25 Oct 2026).
   Keep legacy token names and DOM hooks. Navigation and feature state belong
   to later slices; this layer only changes presentation and adds primitives. */
:root {
  --paper: #fafaf8;
  --ivory-surface: #f2f0eb;
  --navy: #0a1628;
  --muted: #576273;
  --border-control: #78818d;
  --ground: var(--paper);
  --plate: var(--ivory-surface);
  --ink: var(--navy);
  --secondary: var(--muted);
  --secondary-plate: var(--muted);
  --hairline: #d5d9dd;
  --hairline-strong: var(--border-control);
  --on-ink: var(--paper);
  --frame-bg: #ecebe7;
  --surface: var(--paper);
  --accent-deep: #172b45;
  --focus: #4775a8;
  --danger: #8d3439;
  --danger-soft: #f6e9e7;
  --ok: #28574c;
  --ok-soft: #e8efeb;
  --ok-ink: var(--ok);
  --warn: #815b22;
  --warn-soft: #f4eee2;
  --verdict-buy: var(--ok);
  --verdict-maybe: var(--warn);
  --verdict-skip: var(--danger);
  --ai: var(--navy);
  --ai-soft: #e2e6ec;
  --radius-control: 6px;
  --radius-tile: 8px;
  --radius-hero: 8px;
  --radius-sheet: 16px;
  --radius-field: var(--radius-control);
  --sheet-bg: var(--paper);
  --stage-bg: var(--ivory-surface);
  --tabbar-bg: var(--paper);
  --thumb-bg: var(--paper);
  --glass: var(--paper);
  --glass-strong: var(--paper);
  --glass-blur: none;
  --glass-edge: var(--hairline);
  --glass-shadow: none;
  --scrim: rgb(10 22 40 / 48%);
  --font-ui: -apple-system, BlinkMacSystemFont, "Thonburi", "Leelawadee UI", Tahoma, sans-serif;
  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, "Thonburi", "Leelawadee UI", Tahoma, sans-serif;
  --fs-body: .9375rem;
  --fs-meta: .8125rem;
  --fs-btn: .9375rem;
  --display-weight: 600;
  --display-tracking: -0.02em;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
}
html { font-size: 100%; }
body { font-size: var(--fs-body); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button, input, select, textarea { touch-action: manipulation; }
.screen-title, .sheet h2, .empty-state h2, .look-name, .studio-h {
  font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
}
.btn-primary, .btn-secondary {
  border-radius: var(--radius-control); white-space: normal;
  overflow-wrap: anywhere; max-width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.btn-secondary { box-shadow: inset 0 0 0 1px var(--border-control); }
.btn-secondary:hover:not(:disabled), .chip:hover:not(:disabled) { background: #e7e5df; }
.chip.active, .chip[aria-pressed="true"],
.chip.active:hover:not(:disabled), .chip[aria-pressed="true"]:hover:not(:disabled) { background: var(--ink); color: var(--on-ink); }
.chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ghost-btn:not(.style-info) { min-width: 44px; min-height: 44px; }
.field input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
.field select, .field textarea {
  width: 100%; min-height: 48px; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--border-control);
  border-radius: var(--radius-field); background: var(--paper);
  color: var(--ink); font: inherit; font-size: max(1rem, 16px);
}
.field textarea { min-height: 112px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field :is(input,select,textarea):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: none;
}
.field :is(input,select,textarea)[aria-invalid="true"] { border-color: var(--danger); }
.field :is(input,select,textarea):disabled { background: var(--plate); color: var(--muted); }
.field-help, .field-error { display: block; margin: 8px 0 0; font-size: var(--fs-meta); line-height: 1.6; }
.field-help { color: var(--muted); }
.field-error { color: var(--danger); }
.sheet h2 { overflow-wrap: anywhere; }
.sheet-actions { flex-wrap: wrap; gap: var(--sp-3); }
.sheet-actions :is(.btn-primary,.btn-secondary) { min-width: min(100%, 120px); }
.toast { border-radius: var(--radius-tile); overflow-wrap: anywhere; }

/* Reusable semantic states. Feature adapters supply their real data and copy. */
.ui-eyebrow { font: 600 .6875rem/1.6 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ui-title { overflow-wrap: anywhere; margin: 0 0 16px; font: 600 clamp(1.75rem, 5vw, 2.5rem)/1.14 var(--font-display); letter-spacing: -.025em; }
.ui-description { color: var(--muted); font-size: var(--fs-body); line-height: 1.7; }
.ui-notice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--hairline); border-radius: var(--radius-tile); padding: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.ui-notice > svg { width: 20px; height: 24px; flex: none; }
.ui-notice p { margin: 4px 0 0; font-size: var(--fs-meta); }
.ui-notice[data-tone="error"] { color: var(--danger); background: var(--danger-soft); border-color: currentColor; }
.ui-notice[data-tone="success"] { color: var(--ok); background: var(--ok-soft); border-color: currentColor; }
.ui-notice[data-tone="warning"] { color: var(--warn); background: var(--warn-soft); border-color: currentColor; }
.ui-empty { padding: 32px 20px; border-block: 1px solid var(--hairline); text-align: center; }
.ui-empty > svg { width: 32px; height: 32px; color: var(--muted); margin-bottom: 16px; }
.ui-empty h3 { margin: 0 0 8px; font: 600 1.5rem/1.2 var(--font-display); }
.ui-empty p { margin: 0 auto 20px; color: var(--muted); max-width: 32ch; line-height: 1.6; }
.ui-media { margin: 0; background: var(--plate); aspect-ratio: 3 / 4; overflow: hidden; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-tile); }
.ui-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ui-media[data-state="missing"] { flex-direction: column; gap: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: var(--fs-meta); }
.ui-media[data-state="missing"] > svg { width: 32px; height: 32px; }
.ui-loading { color: var(--muted); font-size: var(--fs-meta); line-height: 1.6; }
.ui-loading progress { display: block; width: 100%; height: 6px; accent-color: var(--ink); margin: 12px 0; }
.ui-skeleton { height: 16px; background: var(--ai-soft); border-radius: 3px; margin: 12px 0; }
.ui-dialog { width: min(430px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--hairline); border-radius: var(--radius-sheet); color: var(--ink); background: var(--paper); box-shadow: var(--shadow-sheet); }
.ui-dialog::backdrop { background: var(--scrim); }
.ui-dialog h2 { font: 600 1.75rem/1.2 var(--font-display); margin: 0 0 16px; overflow-wrap: anywhere; }
.ui-dialog-footer { position: sticky; bottom: -24px; display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 0 0; margin: 24px 0 0; background: var(--paper); }
.ui-dialog-footer > button { flex: 1; min-width: min(100%, 120px); }
@media (max-width: 360px) { .ui-dialog { padding: 16px; } .ui-dialog-footer { bottom: -16px; } }

/* ===================================================================
   IMP-03 · four-tab shell (CR-01, 25 Oct 2026)
   Wardrobe / Studio / Looks / You. The tab bar is docked and opaque, per the
   DESIGN.md inventory: the floating glass capsule sat over the look panel's
   buttons (storyboard 2026-10-22, issue 2).
   =================================================================== */
.tabbar {
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  border-radius: 0; border: 0; border-top: 1px solid var(--hairline);
  background: var(--ground);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: none;
}
.tab { min-width: 0; padding-inline: 2px; }
.tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.active { color: var(--ink); }
.fab { bottom: calc(var(--tab-h) + var(--safe-bottom) + var(--sp-4)); }
/* Anything scrolled into view (focus, scrollIntoView) stops clear of both
   bars instead of under them. */
.screens {
  scroll-padding-top: calc(var(--top-h) + var(--safe-top) + var(--sp-2));
  scroll-padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + var(--sp-4));
}

/* The bar's back control for a sub-screen (Worth It, Insights). */
.topbar-title { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.topbar-back { margin-left: -10px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; }
.topbar .ghost-btn.topbar-back { background: transparent; border: 0; }
.topbar-back svg { width: 22px; height: 22px; }

/* A list row that leads somewhere: You's menu, Wardrobe's Worth It entry. */
.you-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  width: 100%; min-height: 56px; padding: 12px 2px;
  background: none; border: 0; border-bottom: 1px solid var(--hairline);
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.you-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.you-row b { font-weight: 600; font-size: var(--fs-body); }
.you-row em { font-style: normal; color: var(--muted); font-size: var(--fs-meta); line-height: 1.45; overflow-wrap: break-word; }
.you-row svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.you-row:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.you-menu { margin-top: var(--sp-6, 32px); border-top: 1px solid var(--hairline); }
.entry-row { margin: var(--sp-2) 0 var(--sp-4); border-top: 1px solid var(--hairline); }

/* You: the twin is the first thing on the tab. */
.you-h { margin: var(--sp-2) 0 var(--sp-1); font: 600 1.5rem/1.2 var(--font-display); }
.you-sub { margin: 0 0 var(--sp-3); }
.twin-return { margin: var(--sp-2) 0 var(--sp-3); flex-wrap: wrap; justify-content: space-between; }
.twin-return b { font-weight: 600; }
.twin-return .btn-secondary { flex: none; }

/* Studio: who is being dressed, with the way to change it. */
.studio-twin {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-2) 0 var(--sp-4); padding: 10px 12px;
  border: 1px solid var(--hairline); border-radius: var(--radius-tile);
}
.studio-twin:empty { display: none; }
.st-fig { flex: none; width: 34px; height: 52px; display: flex; justify-content: center; }
/* The text takes the room; at large text sizes the button drops under it
   rather than squeezing the words one per line. */
.st-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 9rem; }
.st-text b { font-weight: 600; }
.st-text em { font-style: normal; color: var(--muted); font-size: var(--fs-meta); overflow-wrap: break-word; }
.st-edit { flex: none; min-height: 44px; padding: 8px 14px; margin-left: auto; }

/* Looks: an empty tab says so and points back to Studio. */
.looks-empty { margin-top: var(--sp-4); }
#screen-looks .looks-section { margin-top: var(--sp-2); }

/* IMP-03 review fixes (walk of 26 Oct) */
.skip-link {
  position: absolute; left: 12px; top: calc(var(--safe-top) + 8px); z-index: 30;
  padding: 10px 14px; border-radius: var(--radius-control, 999px);
  background: var(--ink); color: var(--paper); border: 0; font: inherit; font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.screen-title:focus { outline: none; }
.screen-title:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* A tap moved focus here, not a key: no ring (app.js sets data-input). */
html[data-input="pointer"] .screen-title:focus-visible { outline: none; }
/* The look's buttons wrap as whole words: at 320px "Another mix" broke into
   "Anot / her / mix" (the foundation lets button labels break anywhere). The
   row wraps instead, and a button never splits a word. */
.look-actions { flex-wrap: wrap; }
.look-actions :is(.btn-primary, .btn-secondary) { overflow-wrap: normal; word-break: normal; hyphens: none; white-space: nowrap; }
.look-actions .btn-secondary { flex: 1 1 auto; }
/* The help sheet opened from a You row shows only that row's section. */
#helpModal[data-focus] .help-steps,
#helpModal[data-focus] .sheet-brand,
#helpModal[data-focus] .ob-mark,
#helpModal[data-focus] .privacy-section { display: none; }
#helpModal[data-focus="account"] #accountSection,
#helpModal[data-focus="data"] #dataSection,
#helpModal[data-focus="privacy"] #privacySection { display: block; }
/* The Studio twin row is one line where it fits, so the look sits higher. */
.studio-twin { padding: 8px 12px; margin: var(--sp-1) 0 var(--sp-3); }
.st-fig { height: 44px; width: 28px; }

/* Item 10 (walk of 26 Oct): a toast at the bottom sat on the controls people
   had just used: "Look saved" over Regenerate and Another mix, "Sample closet
   loaded" over Add clothes, "Twin ready" over the name field. It now drops in
   under the top bar, where nothing is being pressed. */
.toast {
  top: calc(var(--top-h) + var(--safe-top) + var(--sp-2));
  bottom: auto;
  animation-name: toastInTop;
}
.toast.is-leaving { animation-name: toastOutTop; }
@keyframes toastInTop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOutTop { to { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { animation: none; } }

/* ---------- Pose picker v2 (PRD §5.2, 30 Oct 2026) ----------
   The pose row was a line of text chips; nine poses read as a list of words
   nobody could picture. Each pose is now a figure of the stance (pose-figures/,
   in the twin's gender) over its name. The row keeps .chip-row's sideways
   scroll and edge fades. Picked = a 2px ink ring, like a pressed chip is an
   ink fill: the figure stays visible. The figure is a drawing, never tinted. */
.pose-row { gap: 8px; padding: 4px 4px 6px; } /* room for the 4px ring inside the scroller */
.pose-tile {
  flex: 0 0 76px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; color: var(--ink);
  font: inherit; cursor: pointer;
}
.pose-tile img {
  display: block; width: 76px; height: 114px; object-fit: cover;
  border-radius: var(--radius-tile); background: var(--plate);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.pose-tile span {
  font-size: 12px; line-height: 1.25; text-align: center;
  color: var(--secondary); overflow-wrap: normal; hyphens: none;
}
.pose-tile.active img { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--ink); }
.pose-tile.active span { color: var(--ink); font-weight: 600; }
.pose-tile:focus-visible { outline: none; }
.pose-tile:focus-visible img { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--focus); }
.pose-tile:disabled { cursor: default; opacity: 0.5; }

/* ---------- v107: the Group Z mark, sheet close, launch and wait (DESIGN.md 2026-11-17) ---------- */
.gz-mark { display: block; width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.gz-mark path { transform-box: fill-box; transform-origin: center; }

/* Launch: a white ground with the mark assembling itself, three parts arriving
   from their own corners. app.js lifts it once boot has run (never before
   0.7 s); the 4 s animation lifts it even if app.js never does. */
.gz-splash {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: var(--ground); color: var(--ink);
  transition: opacity 0.35s ease;
  animation: gzSplashGone 0.3s ease 4s forwards;
}
.gz-splash .gz-mark { width: 72px; height: 72px; }
.gz-splash.done { opacity: 0; pointer-events: none; }
@keyframes gzSplashGone { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.gz-splash .gz-a { animation: gzFromTopLeft 0.5s cubic-bezier(.2, .7, .2, 1) both; }
.gz-splash .gz-b { animation: gzSettle 0.55s cubic-bezier(.2, .7, .2, 1) 0.08s both; }
.gz-splash .gz-c { animation: gzFromBottomRight 0.5s cubic-bezier(.2, .7, .2, 1) 0.2s both; }
@keyframes gzFromTopLeft { from { opacity: 0; transform: translate(-60%, -60%); } }
@keyframes gzFromBottomRight { from { opacity: 0; transform: translate(60%, 60%); } }
@keyframes gzSettle { from { opacity: 0; transform: scale(0.86); } }

/* Waiting on a worn shot: the mark's three parts light in turn above the
   progress bar, in ink on the veil. */
.hero-rendering .gz-loader { display: block; width: 34px; height: 34px; color: var(--ink); }
.gz-loader path { animation: gzPulse 1.5s ease-in-out infinite; }
.gz-loader .gz-b { animation-delay: 0.2s; }
.gz-loader .gz-c { animation-delay: 0.4s; }
@keyframes gzPulse { 0%, 100% { opacity: 0.18; } 40% { opacity: 1; } }

/* The welcome and sign-in lockup: the mark itself, in ink, over the wordmark
   (it was a "Z" letter on an ink tile). */
.ob-mark { width: 52px; height: 52px; background: none; color: var(--ink); border-radius: 0; }
.ob-mark .gz-mark { width: 100%; height: 100%; }

/* The help sheet signs off: Zilhouette by Group Z. */
.by-groupz {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: var(--sp-5) 0 0;
  font-size: var(--fs-meta); color: var(--secondary);
}
.by-groupz .gz-mark { width: 16px; height: 16px; color: var(--ink); flex: none; }

/* Close: a 36px plate with an ×, top right of every sheet that can be
   dismissed. Sticky, so a long sheet scrolled down still shows it; it takes
   no room of its own (the negative bottom margin). ::after makes the target
   44px. It presses the sheet's own Close/Cancel. */
.sheet-x {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  margin: 0 -8px -36px auto;
  border: 0; border-radius: 50%;
  background: var(--plate); color: var(--ink);
  cursor: pointer;
}
.sheet-x svg { width: 18px; height: 18px; }
.sheet-x::after { content: ''; position: absolute; inset: -4px; }
/* The handle now drags the sheet down to close it. */
.sheet-handle { position: relative; touch-action: none; cursor: grab; }
.sheet-handle::after { content: ''; position: absolute; inset: -14px -60px; }

/* ===================================================================
   iPhone Duo, open screen — PRESS BRANCH ONLY (feat/duo-press, v107-duo1)
   docs/DUO-PRESS-PLAN.md + the 2026-11-17 Duo amendment in DESIGN.md.
   One block, appended, so merges from main stay cheap. Every tier is gated
   on width AND height (see the comment above .device): the Duo open or half
   open is 951x537, open in portrait 669x819; an iPhone turned sideways
   (874x402) and the Duo's outer screen in landscape (594x368) match neither.
   =================================================================== */

/* ---------- Both wide tiers: the app is the window, not a phone ---------- */
@media (min-width: 900px) and (min-height: 500px),
       (min-width: 640px) and (min-height: 760px) {
  :root {
    --col-l: clamp(260px, 28%, 340px);   /* the catalogue */
    --col-r: clamp(260px, 28%, 340px);   /* the look's details (3 columns) */
    --col-gap: var(--sp-5);
    --wide-bottom: calc(var(--tab-h) + var(--safe-bottom) + var(--sp-2));
    /* What is left under the bar and over the tab bar: the look's height. */
    --col-h: calc(100dvh - var(--top-h) - var(--safe-top) - var(--sp-1) - var(--wide-bottom));
  }
  /* The 720x700 phone frame never applies here (its query also matches a
     desktop window or an iPad, which get the wide layout on this branch). */
  .device { padding: 0; }
  .app {
    max-width: 1280px;
    height: 100vh; height: 100dvh; max-height: none;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .screens { padding-left: var(--sp-4); padding-right: var(--sp-4); }

  /* Other screens: one readable column, centred. The closet fills the width
     with tiles at about the phone's size. */
  .screen:not(#screen-style):not(#screen-wardrobe) { max-width: 600px; margin-inline: auto; }
  .wardrobe-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-inline: 0; }
  #screen-wardrobe > :not(.wardrobe-grid) { max-width: 600px; }
  #screen-wardrobe > .empty-state { margin-left: 0; } /* under its controls, not mid-window */

  /* Explore's swipe deck stays a card, not a 900px banner, and gives up its
     420px floor so the keep / skip buttons stay on a 537px screen. */
  .ex-stack { width: 100%; max-width: 440px; min-height: 0; margin-inline: auto; }
  .ex-progress { width: 100%; max-width: 480px; margin-inline: auto; box-sizing: border-box; }

  /* ---------- Studio: catalogue | the look ---------- */
  #screen-style {
    --page-pad: 0px;          /* nothing bleeds out of a column */
    display: grid;
    grid-template-columns: var(--col-l) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: var(--col-gap);
    align-items: start;
    /* .screens keeps 88px under the content for the closet's FAB; the look is
       pinned 8px above the bottom. Without this the grid ends 80px above the
       look's bottom edge at the end of the catalogue, and the sticky look is
       pushed up under the bar. */
    margin-bottom: calc(var(--sp-2) - 88px);
  }
  /* Empty since the look's actions moved onto it; a stray 20px row here. */
  #screen-style > .studio-actions { display: none; }
  #screen-style > .studio-twin { grid-column: 1; grid-row: 1; margin-top: var(--sp-1); }
  #screen-style > .play-row { grid-column: 1; grid-row: 2; }
  #screen-style > .studio-pick { grid-column: 1; grid-row: 3; margin-top: var(--sp-2); }
  #screen-style .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The look: a real box (changeLook measures it, two callers scroll to it),
     pinned under the bar at the height that is left, scrolling on its own. */
  #screen-style > #outfitViewport {
    grid-column: 2; grid-row: 1 / 4;
    display: block;
    /* 0, not the bar's height: a sticky box is held inside the scroller's
       padding, and .screens' top padding already clears the bar. */
    position: sticky; top: 0;
    height: var(--col-h); min-height: 0;
    margin: 0;
    overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  #screen-style > #outfitViewport::-webkit-scrollbar { display: none; }
  /* No look yet: say so in the look's place instead of leaving it empty. */
  #outfitViewport > .outfit-placeholder:only-child,
  #outfitViewport > .studio-warn {
    min-height: 100%; margin: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3);
  }
  #outfitViewport > .outfit-placeholder p { max-width: 28ch; margin: 0; }
  /* Try-On, the second action and Save stay on one line in a 300-360px
     column: a wrapped Save costs the look a 56px row. */
  #outfitViewport .look-actions { flex-wrap: nowrap; }
  #outfitViewport .look-actions :is(.btn-primary, .btn-secondary) {
    flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 12px;
    overflow: hidden; text-overflow: ellipsis;
  }
  #outfitViewport .look-actions .packshot-btn { flex-grow: 1.4; } /* "Regenerate" */
}

/* ---------- Open screen in landscape: a rail and two panes ---------- */
/* Round 3 (the owner's concept, 2026-11-17) replaces v107-duo1's tabs in the
   bar and three-column Studio: the tabs stand in a left rail under the Group
   Z mark, and every screen is two panes. With two panes the rail's 76px no
   longer starves the picture. */
@media (min-width: 900px) and (min-height: 500px) {
  :root {
    --rail-w: 76px;
    --wide-bottom: calc(var(--safe-bottom) + var(--sp-2));
    --pane-l: minmax(0, 0.85fr);
  }
  /* No tab bar under the content, but the closet's docked Add clothes still
     sits there: the phone's 88px clearance stays. */
  .screens {
    padding-left: calc(var(--rail-w) + var(--sp-5));
    padding-right: var(--sp-5);
    padding-bottom: calc(var(--safe-bottom) + 88px);
  }
  .topbar { left: var(--rail-w); padding-left: var(--sp-5); }

  /* The rail. */
  .tabbar {
    top: 0; bottom: 0; left: 0; right: auto;
    width: var(--rail-w); height: auto;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px;
    padding: calc(var(--safe-top) + 64px) 0 var(--safe-bottom);
    border-top: 0; border-right: 1px solid var(--r3-rule);
  }
  .tabbar::before {
    content: '';
    position: absolute; top: calc(var(--safe-top) + 18px); left: 50%;
    width: 22px; height: 22px; margin-left: -11px;
    background: var(--r3-ink);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 557.126 556'%3E%3Cpath d='M.216,0H162.76c-51.374,2.032-90.5,21.081-117.385,49.023L.216,94.177Z'/%3E%3Cpath d='M0,556,282.685,273.331c26.611-28.938,42.617-68.385,42.617-110.8A162.527,162.527,0,0,0,162.76,0H557.126L284.064,273.048l0,0c-.049.041-.09.086-.14.129l-.147.149h-.01C189.153,359.99,225.989,549.3,394.366,556Z'/%3E%3Cpath d='M394.584,556a162.044,162.044,0,0,0,115.353-48.031l0,.008,47.174-47.172v-.051l.018,0V556Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 557.126 556'%3E%3Cpath d='M.216,0H162.76c-51.374,2.032-90.5,21.081-117.385,49.023L.216,94.177Z'/%3E%3Cpath d='M0,556,282.685,273.331c26.611-28.938,42.617-68.385,42.617-110.8A162.527,162.527,0,0,0,162.76,0H557.126L284.064,273.048l0,0c-.049.041-.09.086-.14.129l-.147.149h-.01C189.153,359.99,225.989,549.3,394.366,556Z'/%3E%3Cpath d='M394.584,556a162.044,162.044,0,0,0,115.353-48.031l0,.008,47.174-47.172v-.051l.018,0V556Z'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .tab { flex: none; height: 64px; padding: 0 4px; gap: 3px; font-size: 10.5px; }
  .tab > span:last-child { white-space: normal; text-align: center; line-height: 1.15; }
  /* The active tab's dot moves to the rail's edge, beside it. */
  .tab[aria-current="page"] .ic::before { display: none; }
  .tab[aria-current="page"]::before {
    content: ''; position: absolute; left: 7px; top: 22px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--r3-dot);
  }
  /* Docked primaries sit under the left pane, not across the whole window. */
  .fab, .r3-dock {
    left: calc(var(--rail-w) + var(--sp-5));
    right: auto;
    width: calc((100% - var(--rail-w) - 2 * var(--sp-5) - var(--col-gap)) * 0.46);
    bottom: calc(var(--safe-bottom) + var(--sp-3));
  }

  /* Studio: the catalogue | the look. */
  #screen-style { grid-template-columns: var(--pane-l) minmax(0, 1fr); }
  #outfitViewport .hero-plate {
    height: calc(var(--col-h) * 0.6); min-height: 0;
    justify-content: center;
  }
  #outfitViewport .hero-plate > img.hero-shot { width: auto; height: 100%; max-width: 100%; object-fit: contain; }
  #outfitViewport .hero-plate > .body-fig { height: 84%; margin: auto 0; }
  #outfitViewport .hero-plate > svg { height: 80%; }
  /* The look as the concept lays it out: the first piece large, the rest
     beside it. */
  #outfitViewport .hero-collage { width: 100%; height: 100%; aspect-ratio: auto; gap: 6px; background: var(--r3-ground); }
  #outfitViewport .hero-collage.c4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
  #outfitViewport .hero-collage.c4 > :first-child { grid-row: 1 / 3; }
  #outfitViewport .hero-collage.c4 > :nth-child(2) { grid-column: 2 / 4; }
  #outfitViewport .hero-collage.c3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
  #outfitViewport .hero-collage.c3 > :first-child { grid-row: 1 / 3; }
  #outfitViewport .hero-collage img { object-fit: contain; }
  /* The look's panel leaves the photo and sits under it, Try-On straight
     after the name; the poses and the quota line follow the actions. */
  #outfitViewport .look-panel {
    margin: var(--sp-3) 0 0; padding: 0 0 var(--sp-2);
    background: none; border: 0; border-radius: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  #outfitViewport .look-actions { order: 1; }
  #outfitViewport #poseRow { order: 2; }
  #outfitViewport .hero-quota { order: 3; }
  #outfitViewport .look-name { font-size: 28px; }
  #outfitViewport .look-tools { border-top: 1px solid var(--r3-rule); }
  #outfitViewport .outfit-pieces-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===================================================================
   ROUND 3 — the owner's polish concept, PRESS BRANCH ONLY (v107-duo2)
   docs/ROUND3-PRESS-PLAN.md. Warm chalk ground, one tile tone for every
   photo, warm ink, platform serif headings, mono labels, one butter-yellow
   empty slot. Values are provisional (sampled from the concept sheet).
   Tokens first: everything above reads them, so the sweep is mostly free.
   =================================================================== */
:root {
  --r3-ground: #F2ECE7;   /* screens, sheets, bars */
  --r3-tile: #E9E5DA;     /* the one recessed tone: photo wells, plates */
  --r3-ink: #181713;      /* 15.3:1 on ground */
  --r3-quiet: #5E5A54;    /* quiet text: 5.85 ground · 5.44 tile · 5.73 butter */
  --r3-rule: #DCD5CA;     /* hairlines */
  --r3-control: #8C857B;  /* control outlines, 3.3:1 on ground (non-text) */
  --r3-butter: #F4EBC8;   /* THE empty slot, nothing else */
  --r3-butter-line: #CDB866;
  --r3-dot: #C9962A;      /* the active tab's dot — decorative */

  --paper: var(--r3-ground);
  --ivory-surface: var(--r3-tile);
  --navy: var(--r3-ink);
  --muted: var(--r3-quiet);
  --hairline: var(--r3-rule);
  --border-control: var(--r3-control);
  --frame-bg: #DAD0C3;
  --accent-deep: #000000;
  --focus: var(--r3-ink);
  --ai-soft: #E2DCD0;
  --scrim: rgb(24 23 19 / 46%);
  --rendering-veil: rgb(242 236 231 / 80%);
  --chip-active-bg: transparent;
  --chip-active-ink: var(--r3-ink);

  --font-display: ui-serif, "New York", "Iowan Old Style", "Palatino", Georgia, "Thonburi", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --display-weight: 400;
  --display-tracking: -0.015em;
}

/* Headings: the serif at its regular weight — the concept's editorial voice.
   Every rule above that set a display face at 600 is brought back to 400. */
.screen-title, .sheet h2, .empty-state h2, .look-name, .studio-h,
.ex-title, .ext-line, .exb-line, .exw-line, .exc-name, .ex-edit-title,
.pl-line, .bc-name, .ui-title, .ui-empty h3, .ui-dialog h2, .you-h {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--display-tracking);
}
/* Section heads read as serif words ("Shoes", "Recent try-ons"), not tracked
   caps; the mono label is for counts and numbers. */
.vibe-group-lbl, .ex-h, .studio-h {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--r3-ink);
}
/* The mono label: counts, N° numbers, dates, "fills the empty slot". */
.r3-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--r3-quiet);
}

/* Filter chips (the closet's categories, Looks' styles): plain words, the
   picked one an ink OUTLINE, as the concept draws them. Only the filter rows:
   chips that make a choice in a form or sheet (gender, sizes, category) keep
   their plate and ink fill, so they still read as something to tap. */
:is(#catFilter, #looksFilter) .chip {
  background: transparent;
  color: var(--r3-ink);
  border: 0;
  box-shadow: none;
  font-weight: 500;
  min-height: 44px;
}
:is(#catFilter, #looksFilter) :is(.chip.active, .chip[aria-pressed="true"]),
:is(#catFilter, #looksFilter) :is(.chip.active, .chip[aria-pressed="true"]):hover:not(:disabled) {
  background: transparent;
  color: var(--r3-ink);
  box-shadow: inset 0 0 0 1.5px var(--r3-ink);
}
:is(#catFilter, #looksFilter) .chip:hover:not(:disabled) { background: var(--r3-tile); }

/* The segmented control (Mine | Brands, Stylist | My Items): an outlined
   track, the picked side an ink fill. */
.seg {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--r3-rule);
}
.seg-btn.active, .seg-btn[aria-pressed="true"] {
  background: var(--r3-ink);
  color: var(--on-ink);
  box-shadow: none;
}

/* Tab bar: the ground, one hairline, the active tab in ink 600 with a small
   butter-gold dot over its icon (the dot alone is not the signal). */
.tabbar { background: var(--r3-ground); border-top-color: var(--r3-rule); }
.tab { color: var(--r3-quiet); position: relative; }
.tab.active, .tab[aria-current="page"] { color: var(--r3-ink); font-weight: 600; }
.tab[aria-current="page"] .ic::before {
  content: '';
  position: absolute;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--r3-dot);
  transform: translate(9px, -6px);
}
.tab .ic { position: relative; }

/* The primary: one ink bar, a small radius, not a pill. */
.btn-primary { border-radius: 6px; }
.seg-btn.active em, .seg-btn[aria-pressed="true"] em { color: inherit; opacity: 0.85; }

/* ---------- Round 3 · My wardrobe (closed) ---------- */
/* The title says what the screen is; the sub-line goes. Worth it?, then the
   controls on one row (Mine | Brands, a rule, the category words), the count,
   then the closet three across. */
#screen-wardrobe {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}
#screen-wardrobe > * { grid-column: 1 / -1; }
#screen-wardrobe > .screen-head .sub { display: none; }
#screen-wardrobe > #closetTabs { grid-column: 1; width: auto; margin: 0; }
#screen-wardrobe > #catFilter {
  grid-column: 2;
  margin: 0 calc(-1 * var(--page-pad)) 0 0;
  padding: 0 var(--page-pad) 0 10px;
  border-left: 1px solid var(--r3-rule);
}
#closetTabs .seg-btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
#catFilter .chip { padding: 0 12px; font-size: 14px; }

/* Worth it? as one hairline row: the serif word, the reason, an arrow. */
#worthEntry { border-top: 1px solid var(--r3-rule); min-height: 52px; margin-bottom: var(--sp-3); }
#worthEntry > span { flex-direction: row; align-items: baseline; gap: 10px; }
#worthEntry b { font-family: var(--font-display); font-weight: 400; font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; }
#worthEntry em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--r3-quiet); }

/* The count: "9 pieces · newest first", in mono, across the grid. */
.r3-count {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between;
  padding: var(--sp-3) 0 var(--sp-1);
}

/* The closet: three across with gutters, every photo on the one tile tone.
   The card itself carries the tile colour and the photo multiplies onto it,
   so a pack shot's white becomes the tile and every garment sits on the same
   ground; a photo with its own background only warms by the tile's ~9%. */
#wardrobeGrid.wardrobe-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4) var(--sp-2);
  margin: 0;
}
#wardrobeGrid .item-card { background: var(--r3-tile); }
#wardrobeGrid .item-card .thumb {
  aspect-ratio: 1 / 1;
  mix-blend-mode: multiply;
  background: transparent;
}
#wardrobeGrid .item-card .meta { background: var(--r3-ground); padding: var(--sp-2) 0 0; }
#wardrobeGrid .item-card .meta .nm { font-size: 13px; font-weight: 500; line-height: 1.3; }
#wardrobeGrid .closet-group { margin: var(--sp-3) 0 calc(-1 * var(--sp-2)); }
.r3-no { display: block; font-size: 10px; margin-bottom: 2px; }
#wardrobeGrid .item-card .meta .cw {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--r3-quiet);
}
#wardrobeGrid .item-card .wear-add { background: transparent; box-shadow: inset 0 0 0 1px var(--r3-rule); }
/* Delete lives in the piece's own sheet (tap the tile); the × on the photo
   goes, as in the concept. Logging a wear has no other home, so + stays. */
#wardrobeGrid .item-card .del { display: none; }

/* Add clothes: a docked ink bar over the tab bar, not a floating pill. */
.fab {
  left: var(--sp-4); right: var(--sp-4); width: auto;
  transform: none;
  height: 52px;
  border-radius: 6px;
  box-shadow: none;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 10px);
}
.fab:active { transform: scale(0.99); }

/* ---------- Round 3 · Looks (closed) ---------- */
#screen-looks > .screen-head .sub,
#looksSection > .vibe-group-lbl { display: none; }
#looksGrid.looks-grid { gap: var(--sp-5) var(--sp-3); }
.r3-look .look-card {
  aspect-ratio: 4 / 5;
  border-radius: 0;
  background: var(--r3-tile);
}
.r3-look .look-card > img:not(.look-shot) { mix-blend-mode: multiply; }
.r3-look .look-card .no-photo.fill,
.r3-look .look-card > img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* The pieces as a strip under the cover, on the same tile tone. */
.r3-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  margin-top: 2px;
}
.r3-strip > span { aspect-ratio: 1; background: var(--r3-tile); overflow: hidden; }
.r3-strip img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; display: block; }
/* A look too short for a strip: the house line, quietly, and Style me. */
.r3-rail-line {
  margin-top: 2px; padding: var(--sp-3);
  border: 1px dashed var(--r3-rule);
}
.r3-rail-line p {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display); font-size: 15px; line-height: 1.3; color: var(--r3-ink);
}
.r3-link {
  position: relative;
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: 600 13px/1.2 var(--font-ui); color: var(--r3-ink);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
.r3-link::after { content: ''; position: absolute; inset: -12px -8px; }
.r3-look-name {
  margin-top: var(--sp-3);
  font-family: var(--font-display); font-size: 21px; line-height: 1.1; letter-spacing: -0.01em;
}
.r3-look .r3-mono { margin-top: 4px; font-size: 10px; }
/* Recent try-ons: portrait shots on the same tile tone, four across. */
#historySection { margin-top: var(--sp-6); }
#historySection .history-thumb {
  width: calc((100% - 3 * 8px) / 4); flex: none;
  aspect-ratio: 3 / 4; height: auto;
  border-radius: 0; background: var(--r3-tile);
}

/* A docked primary for a screen that has no FAB of its own (Looks). */
.r3-dock {
  position: absolute; z-index: 20;
  left: var(--sp-4); right: var(--sp-4);
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 10px);
  height: 52px;
}
.r3-dock[hidden] { display: none; }

/* ---------- Round 3 · Studio (closed) ---------- */
/* Group heads in serif, not tracked caps, on the stylist side too. */
#vibeRow .vibe-group-lbl, .built-around .vibe-group-lbl, #pickGroups .vibe-group-lbl {
  font-family: var(--font-display); font-weight: 400; font-size: 21px;
  letter-spacing: -0.01em; text-transform: none; color: var(--r3-ink);
}
.style-card .lbl { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.08em; font-size: 10.5px; }
.style-card .sc-img { background: var(--r3-tile); }
.studio-twin { border-color: var(--r3-rule); }

/* "The look": what is picked, and one butter slot for what comes next. */
.r3-slots { margin: var(--sp-2) 0 var(--sp-5); }
.r3-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-2); }
.r3-h { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 21px; letter-spacing: -0.01em; }
.r3-slot-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 8px) / 4);
  gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.r3-slot-row::-webkit-scrollbar { display: none; }
.r3-slot {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
}
.r3-slot-face {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--r3-tile); overflow: hidden;
}
.r3-slot-face img, .r3-slot-face .no-photo { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.r3-slot .r3-mono { font-size: 10px; }
/* The one butter moment: the slot the look is waiting for. */
.r3-empty .r3-slot-face {
  background: var(--r3-butter);
  box-shadow: inset 0 0 0 1px var(--r3-butter-line);
  outline: 1px dashed var(--r3-butter-line); outline-offset: -5px;
  font-size: 13px; color: var(--r3-ink); gap: 2px;
}
.r3-plus { font-size: 22px; line-height: 1; font-weight: 300; }
.r3-empty:disabled { cursor: default; opacity: 0.6; }

/* The rails: each category runs sideways, its count (and, for the missing
   one, "fills the empty slot") on the right of its head. */
.r3-rail-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; scroll-margin-top: 72px; }
.r3-rail-h .r3-mono { font-family: var(--font-mono); font-size: 10px; flex: none; }
#pickGroups .pick-grid {
  display: grid; grid-auto-flow: column; grid-template-columns: none;
  grid-auto-columns: calc((100% - 2 * 8px) / 3.2);
  gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin-bottom: var(--sp-5);
}
#pickGroups .pick-grid::-webkit-scrollbar { display: none; }
#pickGroups .pick-card { background: var(--r3-tile); }
#pickGroups .pick-card .thumb { aspect-ratio: 1; mix-blend-mode: multiply; }
#pickGroups .pick-card .meta { background: var(--r3-ground); padding-top: 6px; }
#pickGroups .pick-card .nm { font-size: 13px; font-weight: 500; }
#pickGroups .pick-card.active .thumb { outline: 1.5px solid var(--r3-ink); outline-offset: -1.5px; }

/* Create look: docked over the tab bar while the rails scroll under it.
   .screens keeps 88px under the content, so the stick point is pulled down
   by that much to sit 10px over the tab bar. */
#createLookBtn {
  position: sticky; z-index: 4;
  bottom: calc(10px - 88px);
  height: 52px;
}
/* The look itself: the collage and the pieces on the same tile tone. */
.hero-plate { background: var(--r3-tile); }
.hero-collage { background: var(--r3-ground); }
.hero-collage > * { background: var(--r3-tile); }
.hero-collage img { mix-blend-mode: multiply; }
.outfit-pieces-grid .piece .p-img { background: var(--r3-tile); }
.outfit-pieces-grid .piece .p-img img { mix-blend-mode: multiply; }

/* ---------- Round 3 · the look pane, and open-screen overrides ----------
   Last in the file on purpose: these must win over the closed rules above. */
.r3-pane { display: none; }
@media (min-width: 900px) and (min-height: 500px),
       (min-width: 640px) and (min-height: 760px) {
  /* My Items on a wide screen: the look being picked fills the look pane. */
  #outfitViewport > .outfit-placeholder:has(.r3-pane) {
    display: block; height: 100%; min-height: 0; padding: 0; background: none; text-align: left;
  }
  #outfitViewport > .outfit-placeholder:has(.r3-pane) > :not(.r3-pane) { display: none; }
  .r3-pane { display: flex; flex-direction: column; height: 100%; }
  .r3-mosaic {
    flex: 1 1 auto; min-height: 0;
    display: grid; gap: 6px;
    grid-template-columns: 1fr; grid-template-rows: 1fr;
  }
  /* The butter slot never takes more than a third of the pane: alone it is
     one quarter, beside one piece it is the small cell. */
  .r3-mosaic.n1 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .r3-mosaic.n2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
  .r3-mosaic.n2 > :first-child { grid-row: 1 / 3; }
  .r3-mosaic.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
  .r3-mosaic.n3 > :first-child { grid-row: 1 / 3; }
  .r3-mosaic.n4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .r3-mosaic.n4 > :first-child { grid-row: 1 / 3; }
  .r3-mosaic.n4 > :nth-child(2) { grid-column: 2 / 4; }
  .r3-cell {
    position: relative; min-height: 0; overflow: hidden;
    background: var(--r3-tile);
    display: flex; align-items: center; justify-content: center;
  }
  .r3-cell img, .r3-cell .no-photo { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
  .r3-cell .r3-mono { position: absolute; left: 8px; bottom: 6px; right: 6px; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .r3-empty-cell {
    flex-direction: column; gap: 4px; border: 0; cursor: pointer;
    background: var(--r3-butter);
    box-shadow: inset 0 0 0 1px var(--r3-butter-line);
    outline: 1px dashed var(--r3-butter-line); outline-offset: -6px;
    font: 500 14px/1.2 var(--font-ui); color: var(--r3-ink);
  }
  .r3-pane-note { margin: var(--sp-3) 0 0; font-family: var(--font-display); font-size: 17px; line-height: 1.3; color: var(--r3-ink); }
  /* The strip over the rails would repeat the pane beside it — only while
     the pane is there; once a look is drawn, the strip shows the new picks. */
  #screen-style:has(.r3-pane) #r3Slots { display: none; }
}
@media (min-width: 900px) and (min-height: 500px) {
  .fab, .r3-dock {
    left: calc(var(--rail-w) + var(--sp-5)); right: auto;
    width: calc((100% - var(--rail-w) - 2 * var(--sp-5) - var(--col-gap)) * 0.46);
    bottom: calc(var(--safe-bottom) + var(--sp-3));
  }
  /* No tab bar below: Create look docks 12px over the bottom edge. */
  #createLookBtn { bottom: calc(var(--sp-3) - 88px); }
}
.r3-detail { display: none; }
@media (min-width: 900px) and (min-height: 500px) {
  /* My wardrobe: the closet | the piece. The pane spans every row of the
     screen's grid and the last row is 1fr, so its height never spreads the
     closet's rows apart. */
  #screen-wardrobe {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.12fr);
    grid-template-rows: repeat(8, auto) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    margin-bottom: calc(var(--sp-2) - 88px);
  }
  #screen-wardrobe > * { grid-column: 1 / 3; max-width: none; }
  #screen-wardrobe > #closetTabs { grid-column: 1; align-self: center; }
  #screen-wardrobe > #catFilter { grid-column: 2; align-self: center; margin-right: 0; padding-right: 0; }
  #screen-wardrobe > .r3-detail {
    grid-column: 3; grid-row: 1 / -1;
    position: sticky; top: 0;
    height: var(--col-h);
    margin-left: var(--sp-4);
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4);
  }
  #screen-wardrobe > .r3-detail[hidden],
  #screen-wardrobe:has(#brandCloset:not([hidden])) > .r3-detail { display: none; }
  #wardrobeGrid .item-card.r3-sel .thumb { outline: 1.5px solid var(--r3-ink); outline-offset: -1.5px; }
  #wardrobeGrid .item-card.r3-sel::after {
    content: ''; position: absolute; left: 7px; top: 7px; width: 9px; height: 9px;
    background: var(--r3-dot); pointer-events: none;
  }
  .r3-pd-photo { background: var(--r3-tile); overflow: hidden; display: flex; align-items: center; justify-content: center; }
  .r3-pd-photo img, .r3-pd-photo .no-photo { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
  .r3-pd-info { min-width: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; }
  .r3-pd-name { margin: 6px 0 var(--sp-3); font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05; letter-spacing: -0.015em; }
  .r3-pd-row {
    display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: baseline;
    padding: 8px 0; border-bottom: 1px solid var(--r3-rule); font-size: 14px;
  }
  .r3-pd-row .r3-mono { font-size: 10px; }
  .r3-pd-goes { margin: var(--sp-4) 0 var(--sp-2); font-size: 10px; }
  .r3-pd-mates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .r3-pd-mate { aspect-ratio: 1; padding: 0; border: 0; background: var(--r3-tile); overflow: hidden; cursor: pointer; }
  .r3-pd-mate img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; display: block; }
  .r3-pd-actions { display: flex; gap: var(--sp-5); margin-top: var(--sp-5); flex-wrap: wrap; }
  .r3-link.quiet { color: var(--r3-quiet); text-decoration-color: transparent; font-weight: 500; }
  .r3-link.quiet:hover { text-decoration-color: currentColor; }
}
.r3-look-photo, .r3-look-head { display: none; }
@media (min-width: 900px) and (min-height: 500px) {
  /* Looks: the chosen look's picture | its name, pieces, the other looks
     and the recent try-ons. */
  /* The readable-column rule above carries two IDs through :not(); this
     matches its weight and wins by coming later. */
  #screen-looks.screen:not(#screen-style):not(#screen-wardrobe) {
    max-width: none; margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    grid-template-rows: repeat(6, auto) minmax(0, 1fr);
    column-gap: var(--sp-6);
    align-items: start;
    margin-bottom: calc(var(--sp-2) - 88px);
  }
  #screen-looks > * { grid-column: 2; }
  #screen-looks > .r3-look-photo {
    grid-column: 1; grid-row: 1 / -1;
    position: sticky; top: 0;
    height: var(--col-h);
    display: flex; align-items: stretch; justify-content: center;
    background: var(--r3-tile); overflow: hidden;
  }
  #screen-looks > .r3-look-photo[hidden], #screen-looks > .r3-look-head[hidden] { display: none; }
  .r3-look-photo > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
  .r3-look-photo > .r3-mono { position: absolute; left: 14px; bottom: 12px; }
  .r3-look-photo > .r3-mosaic { flex: 1; padding: 0; }
  #screen-looks > .r3-look-head { display: block; }
  .r3-look-pieces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: var(--sp-5); }
  .r3-look-pieces > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .r3-lp-face { aspect-ratio: 1; background: var(--r3-tile); overflow: hidden; }
  .r3-lp-face img, .r3-lp-face .no-photo { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; display: block; }
  .r3-look-pieces .r3-mono { font-size: 9.5px; }
  .r3-lp-nm { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The other looks, smaller; the chosen one outlined. */
  #looksGrid.looks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-3); }
  .r3-look .r3-look-name { font-size: 17px; margin-top: var(--sp-2); }
  .r3-look .r3-rail-line p { font-size: 13px; }
  .r3-look.r3-sel .look-card { outline: 1.5px solid var(--r3-ink); outline-offset: -1.5px; }
  #looksSection { margin-top: 0; }
  /* Open in Studio belongs to the chosen look: under the right pane. */
  #r3LooksCta {
    left: auto; right: var(--sp-5);
    width: calc((100% - var(--rail-w) - 2 * var(--sp-5) - var(--sp-6)) * 0.526);
  }
}
@media (min-width: 900px) and (min-height: 500px) {
  /* On the Looks photo pane there is no slot: one piece fills it. */
  .r3-look-photo .r3-mosaic.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .r3-look-photo .r3-mosaic.n2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .r3-look-photo .r3-mosaic.n2 > :first-child { grid-row: auto; }
}
@media (min-width: 900px) and (min-height: 500px) {
  /* After a try-on the look pane holds the shot, the actions, the poses and
     the quota line at once (the worst case). Compact pose figures, and the
     shot gives up the height the pose row needs, so nothing has to scroll
     out of view on a 537px screen. */
  #outfitViewport .pose-tile { width: 56px; }
  #outfitViewport .pose-tile img { width: 56px; height: 76px; }
  #outfitViewport .pose-tile span { font-size: 10.5px; }
  #outfitViewport .outfit-card:has(#poseRow:not([hidden])) .hero-plate {
    height: max(150px, calc(var(--col-h) - 306px));
  }
}

@media (min-width: 900px) and (min-height: 500px) {
  /* The docked bar sits over the end of each pane's scroll: give the closet
     and the Looks column the room to clear it (Studio's Create look docks
     inside its own panel and needs none). */
  #wardrobeGrid { padding-bottom: 80px; }
  #screen-looks::after { content: ''; grid-column: 2; height: 80px; }
  /* The brands' closets span both panes: there is no piece pane for them. */
  #screen-wardrobe > #brandCloset { grid-column: 1 / -1; }
}
