/* ============================================================================
   studio_p5.css — HAND-WRITTEN. Phase 5 skin: the production DOM that Review,
   Playlists, Progress, Help and Account keep, dressed in Codex r03 components.

   Spec: output/design/STUDIO_MISSING_SCREENS_SPEC_2026-09-06.md §D · §F · §G
   Every value below is the EFFECTIVE value of a rule in
   assets/css/studio/studio.css — i.e. after `desktop-revision.css`, which
   re-scales his whole type ramp (.btn 12→14px, .tab 12→14px,
   .review-options button 12→16px, .help-item summary 13→17px, .round-top
   12→13px, .reference-row h3 12→16px, .review-card min-height 365→390px).
   The p5parity run at 1440 caught the one place I had copied a pre-revision
   value. The component each block is copied FROM is named above it.
   Nothing here is new taste.

   Scope: body.hts-studio.hts-studio .st-page — the class is repeated so these
   rules outrank production's `:root[data-theme="dark"] .rv-face` (0,3,0)
   dark-mode declarations. Without the gate class this file matches nothing.
   Loaded after studio.css / studio_qx.css / studio_snd.css.
   ============================================================================ */

/* ── §D REVIEW ──────────────────────────────────────────────────────────── */

/* two real stats → his ≤700 two-column .review-summary, promoted to every width
   (his own value: devices.css `.review-summary{grid-template-columns:1fr 1fr}`). */
body.hts-studio.hts-studio .st-page .review-summary.rv-two { grid-template-columns: repeat(2, 1fr); }

/* the group host is the lock's positioning context (production gives .rv-page
   `position:relative` for exactly this; we do not take .rv-page's viewport-flex
   layout, because a studio page scrolls). */
body.hts-studio.hts-studio .st-page .rv-host { position: relative; }

/* the dark "night stage" device is replaced by his focus-room surface. */
body.hts-studio.hts-studio .st-page .rv-wrap,
body.hts-studio.hts-studio .st-page .rv-arena {
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; overflow: visible;
}
body.hts-studio.hts-studio .st-page .rv-arena::before,
body.hts-studio.hts-studio .st-page .rv-arena::after { display: none; }

/* HUD row → his .round-top (13px) */
body.hts-studio.hts-studio .st-page .rv-hud2 {
  flex: none; display: flex; flex-direction: row;
  justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted); margin-bottom: 20px; gap: 18px; flex-wrap: wrap;
}
body.hts-studio.hts-studio .st-page .rv-hud2__count { color: var(--ink); font-weight: 500; font-size: 13px; }
body.hts-studio.hts-studio .st-page .rv-hud2__count b {
  font-family: inherit; font-weight: 500; font-size: 13px; letter-spacing: normal;
  color: var(--ink); text-shadow: none;
}
body.hts-studio.hts-studio .st-page .rv-hud2__sub { color: var(--muted); font-size: 13px; font-weight: 400; }

/* the deck-source toggle and the mode switch → his .tabs / .tab / .tab.active.
   ⛔ these are PRODUCTION's own buttons — review.js binds the listeners to the
   #rvSrc / #rvSeg elements it builds inside #rv, so a copy of them anywhere else
   would be dead. Only their skin changes. */
body.hts-studio.hts-studio .st-page .rv-src,
body.hts-studio.hts-studio .st-page .rv-seg {
  display: flex; gap: 22px; margin: 0; padding: 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none;
}
body.hts-studio.hts-studio .st-page .rv-seg { margin-left: auto; }
body.hts-studio.hts-studio .st-page .rv-src button,
body.hts-studio.hts-studio .st-page .rv-seg button {
  padding: 0 0 13px; font-size:max(13px,calc(14px * var(--type-k))); color: var(--muted); background: none;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px;
  min-height: 44px; display: inline-flex; align-items: center; flex-shrink: 0;
}
body.hts-studio.hts-studio .st-page .rv-src button.is-on,
body.hts-studio.hts-studio .st-page .rv-seg button.is-on { border-color: var(--orange); color: var(--ink); background: none; }
body.hts-studio.hts-studio .st-page .rv-src button:hover,
body.hts-studio.hts-studio .st-page .rv-seg button:hover { color: var(--orange); }
body.hts-studio.hts-studio .st-page .rv-src button i,
body.hts-studio.hts-studio .st-page .rv-seg button i { font-style: normal; opacity: 1; color: var(--muted); font-weight: 400; }
body.hts-studio.hts-studio .st-page .rv-seg button[disabled] { opacity: .4; }

/* the progress beam → his .round-meter, on its OWN full-width line under the row */
body.hts-studio.hts-studio .st-page .rv-beam {
  flex: 0 0 100%; width: 100%; order: 9; height: 4px; background: var(--line);
  border-radius: 5px; margin: 0 0 37px; overflow: hidden; box-shadow: none;
}
body.hts-studio.hts-studio .st-page .rv-beam i { background: var(--orange); box-shadow: none; border-radius: 5px; }

/* the card faces → his .panel + .review-card. The 3D flip geometry (perspective /
   absolute faces / backface-visibility) is production's and is left alone; only the
   surface it is drawn on changes. */
body.hts-studio.hts-studio .st-page .rv-flip::before,
body.hts-studio.hts-studio .st-page .rv-flip::after { display: none; }
body.hts-studio.hts-studio .st-page .rv-face,
body.hts-studio.hts-studio .st-page .rv-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: none; color: var(--ink);
}
body.hts-studio.hts-studio .st-page .rv-face::before,
body.hts-studio.hts-studio .st-page .rv-card::before { display: none; }

/* ⛔ GEOMETRY, not taste. Production's Review page is a FIXED-HEIGHT flex shell, so
   at ≥1024 _w4_review.css turns the arena into a viewport-filling device: the arena
   becomes a ROW with the HUD as a left rail (`.rv-hud2{flex:0 0 clamp(200px,24%,290px)}`),
   the stage takes `flex:1 1 auto;min-height:0`, and the card is sized off it
   (`.rv-flip{width:100%;height:100%;max-height:520px}` · `.rv-flip__inner{height:100%}`).
   A studio page SCROLLS — there is no fixed height to divide — so those percentages
   resolved against an auto-height parent: measured live at 1440, the card collapsed to
   a 50px sliver and the progress beam ran 92px past the viewport. Take the device
   layout OFF and let his .focus-room / .round-top / .round-meter / .review-card
   sizing stand on its own. */
body.hts-studio.hts-studio .st-page .rv-wrap { display: block; }
body.hts-studio.hts-studio .st-page .rv-arena { display: block; padding-inline: 0; }
body.hts-studio.hts-studio .st-page .rv-stagezone {
  display: block; flex: none; overflow: visible; max-width: none; margin: 0 auto;
}
body.hts-studio.hts-studio .st-page .rv-flip {
  width: 100%; max-width: none; height: auto; max-height: none; margin-inline: auto;
}
body.hts-studio.hts-studio .st-page .rv-flip__inner { height: 390px; width: 100%; }   /* his .review-card */
body.hts-studio.hts-studio .st-page .rv-card {
  min-height: 390px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}

/* his .review-thai 76px · .review-gloss 23px · the card's prompt = his .eyebrow */
body.hts-studio.hts-studio .st-page .rv2-thai {
  font-family: Thai, sans-serif; font-size: 76px; font-weight: 400; line-height: 1.3;
  color: var(--ink); text-shadow: none; letter-spacing: normal; margin: 15px 0;
}
body.hts-studio.hts-studio .st-page .rv-face--back .rv2-thai { font-size:max(14px,calc(52px * var(--type-k-thai))); }
body.hts-studio.hts-studio .st-page .rv2-en {
  font-family: inherit; font-weight: 400; font-size:max(14px,calc(23px * var(--type-k))); color: var(--ink); margin-bottom: 15px;
}
body.hts-studio.hts-studio .st-page .rv2-q {
  font-size: 12px; letter-spacing: 1.8px; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
}
body.hts-studio.hts-studio .st-page .rv2-hint,
body.hts-studio.hts-studio .st-page .rv-scale,
body.hts-studio.hts-studio .st-page .rv-tie { font-size: 12px; color: var(--muted); }

/* the reveal / check action → his .btn.dark (14px, 46px, gap 10, padding 0 19px) */
body.hts-studio.hts-studio .st-page .rv2-reveal {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 19px; border-radius: 6px; font-size:max(13px,calc(14px * var(--type-k))); font-weight: 500;
  background: var(--purple); border: 1px solid var(--purple); color: #fff;
  box-shadow: none; filter: none; text-transform: none; letter-spacing: normal;
}
body.hts-studio.hts-studio .st-page .rv2-reveal[disabled] { opacity: .45; }

/* the 3-grade row → his .review-options, with THREE columns (his has four;
   production's SRS scale is three and a fourth is not invented). */
body.hts-studio.hts-studio .st-page .grade-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 20px auto 0; width: 100%; max-width: 420px;
  background: none; border: 0; padding: 0;
}
body.hts-studio.hts-studio .st-page .grade-row__btn {
  padding: 15px 8px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--ink); font-size:max(14px,calc(16px * var(--type-k))); font-weight: 500;
  min-width: 0; box-shadow: none;
}
body.hts-studio.hts-studio .st-page .grade-row__btn:last-child { background: var(--purple); border-color: var(--purple); color: #fff; }
/* ⛔ his `<small>` sub-labels (One more look / Still getting there / Feels familiar)
   are NOT rendered: the grade row is the answer surface of the review card, and the
   ANSWER-DIALOG law forbids adding elements to it. Production's own caption
   (.rv-scale "Again = tomorrow · Hard = soon · Good = later") already says it. */

/* deck cleared → his .game-stage */
body.hts-studio.hts-studio .st-page .rv-done { padding: 38px; }
body.hts-studio.hts-studio .st-page .rv-done > div:first-child::after { display: none; }

/* ── §G PLAYLISTS ───────────────────────────────────────────────────────── */

/* ⛔ min-width:0 down MY subtree. His .playlist-grid is repeat(3,1fr), and a grid
   item’s default min-width:auto lets its MIN-CONTENT blow the 1fr track out. The
   step rows we host inside the card carry long labels, so at 1024 the three tracks
   came back 330/323/345px and the grid ran 143px past the viewport (measured live).
   His own .word-grid already spells the remedy out as repeat(4,minmax(0,1fr)); we
   apply the same floor to the wrapper and the rows instead of touching his grid. */
body.hts-studio.hts-studio .st-page .playlist-grid .trial-host { position: relative; border-radius: 10px; min-width: 0; }
body.hts-studio.hts-studio .st-page .playlist-card,
body.hts-studio.hts-studio .st-page .playlist-body { min-width: 0; }
/* his .playlist-art palette cycles per card; the trial-host wrapper sits between
   .playlist-grid and .playlist-card, so re-key the cycle off the wrapper. */
body.hts-studio.hts-studio .st-page .playlist-grid > .trial-host:nth-child(2) .playlist-art { background: var(--soft-green); }
body.hts-studio.hts-studio .st-page .playlist-grid > .trial-host:nth-child(3) .playlist-art { background: var(--soft-orange); }
body.hts-studio.hts-studio .st-page .playlist-grid > .trial-host:nth-child(4) .playlist-art { background: var(--lilac); }
body.hts-studio.hts-studio .st-page .playlist-grid > .trial-host:nth-child(5) .playlist-art { background: var(--soft-green); }
body.hts-studio.hts-studio .st-page .playlist-grid > .trial-host:nth-child(6) .playlist-art { background: var(--soft-orange); }

/* production's step rows → his .reference-row inside his .reference-list grid */
body.hts-studio.hts-studio .st-page .plsteps { margin-top: 20px; display: grid; gap: 12px; min-width: 0; }
body.hts-studio.hts-studio .st-page .plsteps .plrow {
  display: flex; gap: 15px; align-items: center; padding: 21px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px; min-width: 0;
}
body.hts-studio.hts-studio .st-page .plsteps .plrow:hover { border-color: var(--ink); }
body.hts-studio.hts-studio .st-page .plsteps .plrow__n { font-size:max(13px,calc(14px * var(--type-k))); color: var(--muted); }
body.hts-studio.hts-studio .st-page .plsteps .plrow__l { font-size:max(14px,calc(16px * var(--type-k))); font-weight: 500; min-width: 0; }
body.hts-studio.hts-studio .st-page .plsteps .plrow__go { width: 15px; margin-left: auto; color: var(--muted); }
body.hts-studio.hts-studio .st-page .plsteps .plrow__go svg { width: 15px; height: 15px; }

/* ── §G PROGRESS ────────────────────────────────────────────────────────── */

/* his activity-grid month rail (his own inline values, lifted to a class) */
body.hts-studio.hts-studio .st-page .activity-months {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--muted);
}

/* ── §F HELP ────────────────────────────────────────────────────────────── */

/* ⛔ production's FAQ rows and support form are written with INLINE styles
   (pages/help.js), which no selector can outrank — these are the only
   !important declarations in the studio layer, and each one exists solely to
   defeat a style="" attribute on a node we are forbidden to edit. */
body.hts-studio.hts-studio .st-page .hp-faq #faqSearch,
body.hts-studio.hts-studio .st-page .hp-form input,
body.hts-studio.hts-studio .st-page .hp-form select,
body.hts-studio.hts-studio .st-page .hp-form textarea {
  padding: 13px !important; border: 1px solid var(--line) !important; border-radius: 6px !important;
  width: 100% !important; background: var(--surface) !important; color: var(--ink) !important;
  font: inherit !important; font-size: 16px !important;
}
body.hts-studio.hts-studio .st-page .hp-form textarea { line-height: 1.7 !important; }
body.hts-studio.hts-studio .st-page .hp-faq #faqList { margin-top: 14px !important; }
/* his .help-item */
body.hts-studio.hts-studio .st-page .hp-faq .faq-item {
  padding: 21px 0 !important; margin: 0 !important; border: 0 !important;
  border-bottom: 1px solid var(--line) !important; border-radius: 0 !important;
  background: none !important; overflow: visible !important;
}
body.hts-studio.hts-studio .st-page .hp-faq .faq-item summary {
  padding: 0 !important; font-size:max(14px,calc(17px * var(--type-k))) !important; font-weight: 500 !important; cursor: pointer;
}
body.hts-studio.hts-studio .st-page .hp-faq .faq-item > div {
  padding: 0 !important; margin-top: 14px !important;
  font-size:max(13px,calc(15px * var(--type-k))) !important; color: var(--muted) !important; line-height: 1.9 !important;
}
/* his .field label */
body.hts-studio.hts-studio .st-page .hp-form form { max-width: none !important; gap: 20px !important; }
body.hts-studio.hts-studio .st-page .hp-form label > span { font-size:max(13px,calc(14px * var(--type-k))) !important; color: var(--muted) !important; }
/* his .btn.primary */
body.hts-studio.hts-studio .st-page .hp-form #sfSend {
  background: var(--orange); border-color: var(--orange); color: #fff;
}

/* ── §F ACCOUNT ─────────────────────────────────────────────────────────── */

/* the tri-state appearance row sits directly under its .settings-row */
body.hts-studio.hts-studio .st-page .theme-tabs { margin: -1px 0 0; border-bottom: 1px solid var(--line); }
body.hts-studio.hts-studio .st-page .settings-row:last-child { border-bottom: 0; }

/* ── phone (his ≤700 step, devices.css) ─────────────────────────────────── */
@media (max-width: 700px) {
  /* his phone .review-card */
  body.hts-studio.hts-studio .st-page .rv-face,
  body.hts-studio.hts-studio .st-page .rv-card {
    border-radius: 14px; background: linear-gradient(135deg, var(--surface), var(--soft-orange));
  }
  body.hts-studio.hts-studio .st-page .rv-flip__inner { height: 310px; }
  body.hts-studio.hts-studio .st-page .rv-card { min-height: 310px; padding: 30px 20px; }
  body.hts-studio.hts-studio .st-page .rv2-thai { font-size:max(14px,calc(52px * var(--type-k-thai))); }
  body.hts-studio.hts-studio .st-page .rv-face--back .rv2-thai { font-size:max(14px,calc(40px * var(--type-k-thai))); }
  body.hts-studio.hts-studio .st-page .rv2-en { font-size:max(14px,calc(24px * var(--type-k))); line-height: 1.5; }
  /* his phone .review-options is 2-col because HIS row has four buttons; production's
     SRS scale is three, so the column count stays 3 and only his gap/size/height move. */
  body.hts-studio.hts-studio .st-page .grade-row { gap: 10px; }
  body.hts-studio.hts-studio .st-page .grade-row__btn { font-size:max(14px,calc(16px * var(--type-k))); min-height: 73px; padding: 13px; }
  /* his phone .round-top */
  body.hts-studio.hts-studio .st-page .rv-hud2 { font-size: 10px; gap: 10px; align-items: center; margin-bottom: 16px; }
  body.hts-studio.hts-studio .st-page .rv-hud2__count,
  body.hts-studio.hts-studio .st-page .rv-hud2__count b,
  body.hts-studio.hts-studio .st-page .rv-hud2__sub { font-size: 9px; letter-spacing: .3px; }
  body.hts-studio.hts-studio .st-page .rv-seg { margin-left: 0; max-width: 100%; overflow-x: auto; }
  body.hts-studio.hts-studio .st-page .rv-beam { margin-bottom: 12px; }
  /* his phone .reference-row */
  body.hts-studio.hts-studio .st-page .plsteps .plrow { padding: 18px 0; gap: 13px; }
  body.hts-studio.hts-studio .st-page .plsteps .plrow__l { font-size:max(14px,calc(17px * var(--type-k))); }
  body.hts-studio.hts-studio .st-page .plsteps .plrow__n { font-size: 12px; }
  body.hts-studio.hts-studio .st-page .rv-done { padding: 27px 19px; }
}

/* ── §E TRIAL LOCK CHIPS (restyle only — the copy is production's) ───────── */
/* His system has no "locked" component, so §E maps the lock to the nearest one he
   does have: the .scene-label chip (a small uppercase label pinned to a card corner)
   over a dimmed card. ⛔ The overlay's TEXT is production's and is not touched —
   changing copy on a money surface is out of scope for a restyle. The overlay keeps
   its role="button" / data-trial-upgrade contract, so the tap still opens the paywall. */
body.hts-studio.hts-studio .st-page .is-trial-blur { filter: none; opacity: .55; }
body.hts-studio.hts-studio .st-page .trial-overlay {
  background: none; gap: 8px;
}
body.hts-studio.hts-studio .st-page .trial-overlay__ic { filter: none; opacity: 1; font-size:max(13px,calc(15px * var(--type-k))); }
/* his .scene-label */
body.hts-studio.hts-studio .st-page .trial-overlay__t {
  background: #fffefae8; color: var(--ink); padding: 5px 7px; border-radius: 3px;
  font-family: inherit; font-size: 12px; font-weight: 500; letter-spacing: .6px;
  text-transform: uppercase; backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* his .btn.primary */
body.hts-studio.hts-studio .st-page .trial-overlay__btn {
  background: var(--orange); color: #fff; box-shadow: none;
  border-radius: 6px; padding: 0 19px; min-height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size:max(13px,calc(14px * var(--type-k))); font-weight: 500; letter-spacing: normal;
}

/* ── §E CARD LOCKS (fix batch 1) ─────────────────────────────────────────────
   A card-style lock renders LOCKED and applyTrialLocks strips it (components.js
   L232-239 removes .is-trial-lock and any .tl-pin from an unlocked card). The
   studio emitters carried the data contract but no locked state, and production's
   .trial-media CSS keys off a `.card__media` sub-element his cards do not have —
   so a muted user saw nothing at all. Spec §E: his .scene-label chip at the card
   corner, content at opacity .55.
   ⛔ the fade is applied to the CHILDREN, never the host: opacity on the host
   composites the whole subtree and the chip could not climb back out of it. */
body.hts-studio.hts-studio .st-page .is-trial-lock { position: relative; }
body.hts-studio.hts-studio .st-page .is-trial-lock > :not(.tl-pin) { opacity: .55; }
/* his .scene-label, verbatim */
body.hts-studio.hts-studio .st-page .tl-pin {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: #fffefae8; color: #193a5a; padding: 5px 7px; border-radius: 3px;
  font-size: 12px; font-weight: 500; letter-spacing: .6px; text-transform: uppercase;
  line-height: 1.2; pointer-events: none;
}
/* the tone-formula entry is an inline link — its chip flows with the text */
body.hts-studio.hts-studio .st-page .text-link.is-trial-lock .tl-pin {
  position: static; margin-left: 8px; display: inline-block;
}

/* the playlist lock now wraps the steps + the CTA that enters them, so his record
   art, title and blurb stay readable and the overlay is centred on what is locked */
body.hts-studio.hts-studio .st-page .pl-locked { position: relative; border-radius: 7px; }
