/* rx-drawer.css — the one dialog over /styling's results: the piece drawer, the Replace view inside
   it, and the "About you" sheet (rx-drawer.js). 05 §11 is the design; 08 #1–#3 are the rules
   that each cost a shipped bug:
     · a closed overlay is never laid out (the [hidden] rule below, with !important, because an
       author `display:` rule beats the browser's own [hidden] rule — that is how a closed drawer
       swallowed every click on the look tabs);
     · it is positioned against the VIEWPORT (the JS mounts it on <body>; nothing here may give it a
       transformed ancestor);
     · it paints above the sticky top bar (z-index 1000 is leorve.css's dialog tier: above the bar's
       10, the toasts' 200 and the filter bar's 9).
   Colour is tokens and black/white alpha only (LOCKED "Palette"); the only hue that reaches this
   sheet is a garment's own, inline, after an isHex check. Every hover that moves is inside the
   (hover:hover) and (pointer:fine) gate, and every motion is finished under reduced motion
   (leorve.css lands durations at .001ms; nothing here starts in a state that hides content). */

.rx-drawer{position:fixed;inset:0;z-index:1000;display:flex;justify-content:flex-end;
  background:rgba(0,0,0,0);transition:background-color var(--rx-dx,200ms) var(--ease)}
.rx-drawer[hidden]{display:none!important}
/* EVERYTHING INSIDE THAT IS HIDDEN STAYS HIDDEN, whatever display its own class sets (08 #1, one
   level down): the ‹ › pair, the market line and the empty foot are toggled with `hidden`. */
.rx-drawer [hidden]{display:none!important}
/* A CLOSING drawer is still laid out for its 200ms slide, and in that time it must not take a
   click meant for the page it is uncovering. The page is already un-inerted when the slide starts. */
.rx-drawer:not(.is-on){pointer-events:none}
.rx-drawer.is-on{background:var(--rx-scrim,rgba(0,0,0,.42));transition-duration:var(--rx-d3,320ms)}
/* elementFromPoint on an icon button must return the BUTTON, not its <path> (the binding harness
   checks #drawerX that way); rx-core.css says so for every icon, this says it for ours as well. */
.rx-drawer svg{pointer-events:none}

/* THE SHEET. Only its transform moves; the scrim fades its background-colour; the sheet never
   animates opacity (leorve.css §7: a stalled animation must cost position, never visibility). */
/* v7: THE HOUSE'S PANEL GLASS, VELLUM (owner brief "more glass"; verify site1-18; AUTH_SPEC critic C16
   — drawers stay Vellum, the pop-ups are Crystal). The same pane the flagship's and the static pages'
   "Your month" sheet is: .92 white under a top-lit sheen, 1px hairline, lit edge, 28px blur (20 on a
   coarse pointer), saturate .7 so it can only mute what it covers. AA at .92 over the black bound:
   235, where --ink-dim (the drawer's quietest text) holds 5.47:1. Solid wherever the engine cannot
   blur or the customer asked for solid surfaces: the sheet's own --card, the token it always wore
   (this file carries no colour literal of its own; test_rx_overlays). */
.rx-sheet{position:relative;display:flex;flex-direction:column;width:min(440px,100%);height:100%;
  background:linear-gradient(180deg,rgba(255,255,255,.55) 0%,rgba(255,255,255,0) 42%),rgba(255,255,255,.92);
  background-clip:padding-box;
  -webkit-backdrop-filter:blur(28px) saturate(.7);backdrop-filter:blur(28px) saturate(.7);
  color:var(--ink);border-left:1px solid rgba(17,17,17,.08);
  box-shadow:inset 1px 0 0 rgba(255,255,255,.95),var(--shadow-2);
  transform:translateX(100%);transition:transform var(--rx-dx,200ms) var(--ease)}
.rx-drawer.is-on .rx-sheet{transform:none;transition-duration:var(--rx-d3,320ms)}
@media (pointer:coarse){ .rx-sheet{-webkit-backdrop-filter:blur(20px) saturate(.7);backdrop-filter:blur(20px) saturate(.7)} }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){ .rx-sheet{background:var(--card)} }
@media (prefers-reduced-transparency:reduce){
  .rx-sheet{background:var(--card);-webkit-backdrop-filter:none;backdrop-filter:none}
}

.rx-sheet-head{display:flex;align-items:center;gap:8px;padding:14px 14px 12px 24px;
  border-bottom:1px solid var(--line)}
.rx-dr-slot{flex:1 1 auto;min-width:0;margin:0}
.rx-dr-nav{display:flex;gap:6px}
.rx-dr-x{flex:0 0 auto}
/* In the reading sheet the head's line is the sheet's NAME (aria-labelledby points at it), so it
   is set as a title rather than as a slot eyebrow. */
.rx-drawer[data-mode="reading"] .rx-dr-slot{font:600 21px/1.2 var(--display);letter-spacing:-.015em;
  text-transform:none;color:var(--ink)}

.rx-sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:20px 24px 28px}
/* The foot is part of the pane, not a white band across the glass: it does not overlap the body
   (the sheet is a flex column), so it needs no fill of its own — its hairline separates it. */
.rx-sheet-foot{display:grid;gap:10px;padding:14px 24px calc(14px + env(safe-area-inset-bottom,0px));
  border-top:1px solid rgba(17,17,17,.08);background:transparent}
.rx-sheet-foot:empty{display:none}

/* The media: the board's own face primitive (4:5, photo or colour card), at a size that reads as
   the garment and leaves the facts below it on the first screen. */
.rx-sheet-media{width:100%;max-width:300px;margin:0 auto 20px}

/* The cut, photographed in another colour, when the media is a colour card. Small and captioned:
   it shows the SHAPE, and says plainly that its colour is not the advice. */
.rx-cut{display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;align-items:center;margin:-8px 0 18px;
  padding:8px 12px 8px 8px;border:1px solid var(--line);border-radius:var(--r)}
.rx-cut img{display:block;width:44px;aspect-ratio:4/5;object-fit:cover;border-radius:8px;background:var(--paper-2)}
.rx-cut-say{display:grid;gap:2px;min-width:0}
.rx-cut-k{margin:0;font:600 13px/1.35 var(--body);color:var(--ink)}
.rx-cut .rx-dr-credit{margin:0}

.rx-dr-name{margin:0;font:600 24px/1.2 var(--display);letter-spacing:-.015em;color:var(--ink);
  text-wrap:balance}
/* A programmatic focus target (after a swap, after Back to the piece), not a control: no ring
   for a mouse, a ring for a keyboard. */
.rx-dr-name:focus{outline:none}
.rx-dr-name:focus-visible{outline:2px solid var(--ink);outline-offset:4px;border-radius:4px}

.rx-dr-status{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;margin:12px 0 0;padding:8px 8px 8px 14px;
  border-radius:var(--r);background:var(--paper-2);font:500 13.5px/1.4 var(--body);color:var(--ink)}

.rx-dr-why{display:grid;gap:6px;margin:20px 0 0}
.rx-dr-h{margin:0 0 2px;font:600 11px/1.2 var(--body);letter-spacing:.22em;text-transform:uppercase;color:var(--ink-2)}
.rx-dr-ann{margin:0;font:600 15px/1.35 var(--body);color:var(--ink)}
.rx-dr-hits{margin:0;font:600 10.5px/1.3 var(--body);letter-spacing:.14em;text-transform:uppercase;color:var(--ink-dim)}
.rx-dr-say{margin:0;font:400 14.5px/1.55 var(--body);color:var(--ink-2);max-width:56ch;text-wrap:pretty}
.rx-dr-why .rx-dr-say + .rx-dr-ann{margin-top:8px}

/* The spec rows: one hairline INSIDE the movement (05 §3.3), label left, value right. */
.rx-spec{margin:20px 0 0}
.rx-spec > div{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:10px 0;
  border-top:1px solid var(--line)}
.rx-spec dt{font:400 12.5px/1.4 var(--body);color:var(--ink-dim)}
.rx-spec dd{margin:0;font:500 13.5px/1.4 var(--body);color:var(--ink);text-align:right}
/* The advised colour as a dot beside its word. Colour is never the only signal: the word is there. */
.rx-dr-dot{display:inline-block;width:12px;height:12px;margin:0 8px -1px 0;border-radius:50%;
  box-shadow:inset 0 0 0 1px rgba(127,127,127,.35)}

.rx-dr-note{margin:16px 0 0;font:400 13px/1.5 var(--body);color:var(--ink-dim);max-width:60ch}
.rx-dr-credit{margin:6px 0 0;font:400 12px/1.45 var(--body);color:var(--ink-dim)}
.rx-dr-fine{margin:12px 0 0;font:400 12.5px/1.5 var(--body);color:var(--ink-dim)}
.rx-est{margin:16px 0 0;font:400 13px/1.5 var(--body);color:var(--ink-dim)}

.rx-dr-acts{display:flex;flex-wrap:wrap;gap:10px}
.rx-dr-acts > .rx-btn{flex:1 1 auto}
.rx-sheet-body .rx-dr-acts{margin:16px 0 0}
.rx-dr-help{margin:0;font:400 12.5px/1.5 var(--body);color:var(--ink-dim)}

/* ── Replace: the alternatives, one row each ──────────────────────────────────────────────── */
.rx-sheet-body .rx-dr-name + .rx-dr-say{margin-top:8px}
/* The group headings ("From our library") are direct children of the body; the "Why it's here"
   heading sits inside .rx-dr-why, which already carries its own top margin. */
.rx-sheet-body > .rx-dr-h{margin-top:22px}
.rx-alts{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:8px}
.rx-alt{position:relative;display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:12px;
  width:100%;margin:0;padding:8px 14px 8px 8px;border:1px solid var(--line-2);border-radius:var(--r);
  background:var(--card);color:var(--ink);font:inherit;text-align:left;cursor:pointer;overflow:hidden;
  transition:border-color var(--rx-d1,180ms) var(--ease),transform var(--rx-d1,180ms) var(--ease),
    box-shadow var(--rx-d1,180ms) var(--ease),opacity var(--rx-d1,180ms) var(--ease)}
.rx-alt-face{position:relative;display:block;width:56px;border-radius:10px;overflow:hidden}
/* The row names the piece beside its thumbnail, so the card's own name (printed on a neutral card,
   A4) would be the same words again, crushed into 56px. The thumb keeps its colour or its photo.
   The NEUTRAL selector is spelled out on purpose: rx-core.css re-shows a neutral card's name inside
   its small-container query (0,3,0 — so a detail tile is never an empty grey box), which beat the
   plain rule and printed "My olive kurta in Olive" in 11px across a 56px swatch. Here A4 is already
   met: the name is the row's own bold first line, 12px to the right of the dashed card. */
.rx-alt-face .rx-fill-name,
.rx-alt-face .rx-fill.is-neutral .rx-fill-name{display:none}
.rx-alt-own{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.rx-alt-t{display:grid;gap:2px;min-width:0}
.rx-alt-t b{font:600 14px/1.3 var(--body);color:var(--ink);overflow-wrap:anywhere}
.rx-alt-v{font:400 13px/1.4 var(--body);color:var(--ink-2)}
.rx-alt-b{font:400 12px/1.4 var(--body);color:var(--ink-dim)}
.rx-alt-tag{justify-self:start;margin:0 0 2px;padding:2px 8px;border:1px solid var(--line-2);border-radius:var(--r-pill);
  font:600 10px/1.4 var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--ink-2)}
.rx-alt-go{font:600 13px/1 var(--body);color:var(--ink);text-decoration:underline;text-underline-offset:3px;
  white-space:nowrap}
@media (hover:hover) and (pointer:fine){
  .rx-alt:hover{border-color:var(--ink);transform:translateY(-1px);box-shadow:var(--rx-lift,0 10px 22px -16px rgba(0,0,0,.42))}
}
.rx-alt:active{transform:scale(.98);transition-duration:var(--rx-dp,90ms)}
.rx-alt:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
/* One pick in flight: the chosen row works (a sheen, not a spinner — 05 §5.3), the rest rest. */
.rx-alts[aria-disabled="true"] .rx-alt:not([aria-busy="true"]){opacity:.45;pointer-events:none}
.rx-alt[aria-busy="true"]{cursor:progress;border-color:var(--ink)}
.rx-alt[aria-busy="true"]::after{content:"";position:absolute;inset:0;pointer-events:none;transform:translateX(-100%);
  background:linear-gradient(100deg,transparent 30%,rgba(0,0,0,.06) 50%,transparent 70%);
  animation:rx-dr-sheen 1.2s var(--ease) infinite}
@keyframes rx-dr-sheen{to{transform:translateX(100%)}}
@media (prefers-reduced-motion:reduce){ .rx-alt[aria-busy="true"]::after{display:none} }
/* The skeleton row is the real row's geometry (05 §12), drawn with rx-core's sheen blocks. */
.rx-alt-sk{cursor:default}
.rx-alt-sk .rx-alt-face{aspect-ratio:4/5}
.rx-alt-sk .rx-alt-t{gap:8px}
.rx-alt-sk .rx-alt-t > span:last-child{width:60%}

/* ── phones: a bottom sheet with a grab bar ───────────────────────────────────────────────── */
.rx-grab{display:none}
@media (max-width:767.98px){
  .rx-drawer{align-items:flex-end;justify-content:center}
  .rx-sheet{width:100%;height:auto;max-height:88vh;max-height:88dvh;border-left:0;border-top:1px solid rgba(17,17,17,.08);
    border-radius:var(--r-lg) var(--r-lg) 0 0;transform:translateY(100%)}
  /* touch-action:none on the drag handles only: the body still scrolls with the finger. No text
     selection on them either — a drag that starts on the slot word otherwise selects it, and the
     sheet comes back with "TOP" highlighted in black. */
  .rx-sheet-head{padding:24px 12px 10px 20px;touch-action:none;-webkit-user-select:none;user-select:none}
  .rx-sheet-body{padding:18px 20px 24px}
  .rx-sheet-foot{padding:12px 20px calc(12px + env(safe-area-inset-bottom,0px))}
  /* The bar is 4px; the target around it is not. */
  .rx-grab{display:block;position:absolute;top:0;left:50%;z-index:1;width:120px;height:22px;margin-left:-60px;
    touch-action:none;cursor:grab}
  .rx-grab::before{content:"";position:absolute;top:9px;left:41px;width:38px;height:4px;border-radius:var(--r-pill);
    background:var(--line-2)}
  /* A third of the screen for the picture, so the name and the first line of why it is here are on
     the sheet's first view at 390×844 (measured: at 38dvh the name sat under the fold). */
  .rx-sheet-media{max-width:min(240px,calc(31vh * .8));max-width:min(240px,calc(31dvh * .8));margin-bottom:16px}
  .rx-dr-name{font-size:21px}
}

/* THE PAGE UNDER AN OPEN SHEET DOES NOT SCROLL. Only <html> is locked: leorve.css gives <body>
   overflow-x:hidden, which normally passes to the viewport — but once <html> is not `visible`
   that hand-off stops and <body> would become a scroll container of its own, re-anchoring every
   sticky element (the top bar, the filter bar) to it and dropping them out of view under the
   scrim. So <body> is set back to visible for exactly as long as <html> is locked. The gutter
   keeps the page from shifting sideways when the scrollbar goes. */
html.rx-locked{overflow:hidden;scrollbar-gutter:stable}
html.rx-locked body{overflow:visible}
