/* STUDIO_FINISH_R01 — owner-approved surface styling, 2026-09-10.
   Paint only: no dimensions, type, layout, overflow, interaction or gate changes.
   Loaded last. Every rule requires the existing /me.preview Studio cohort. */
body.hts-studio.hts-studio.hts-studio {
  --bg:#eef2f6;
  --st-raised:#fff; --st-well:#e5ebf2; --st-blue:#e6eef8;
  --st-paper:#f5efe4; --st-paper-line:#dfd4c0;
  --st-edge:#d3dfea; --st-gold:#b58a43;
  --st-shadow:0 2px 3px #102e5004,0 10px 28px -20px #102e5040;
  --st-lift:0 12px 32px -20px #102e5060,inset 0 1px 0 #ffffff80;
  --st-float:0 18px 55px -18px #081a3859,inset 0 1px 0 #ffffff80;
  --st-wash:#1f70df08;
  background-color:var(--bg);
  background-image:radial-gradient(ellipse at 100% 0%,var(--st-wash),transparent 65%);
  background-size:100% 720px;
  background-repeat:no-repeat;
}
:root[data-theme="dark"] body.hts-studio.hts-studio.hts-studio {
  --bg:#0d1928;
  --st-raised:#223a52; --st-well:#101f30; --st-blue:#1c344d;
  --st-paper:#302c26; --st-paper-line:#574e40;
  --st-edge:#38536b; --st-gold:#e6c995;
  --st-shadow:inset 0 1px 0 #d9eaff0c,0 8px 24px -20px #00000080;
  --st-lift:inset 0 1px 0 #d9eaff16,0 12px 32px -18px #00000080;
  --st-float:inset 0 1px 0 #d9eaff1c,0 24px 60px -16px #000000a6;
  --st-wash:#468ce312;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) body.hts-studio.hts-studio.hts-studio {
    --bg:#0d1928;
    --st-raised:#223a52; --st-well:#101f30; --st-blue:#1c344d;
    --st-paper:#302c26; --st-paper-line:#574e40;
    --st-edge:#38536b; --st-gold:#e6c995;
    --st-shadow:inset 0 1px 0 #d9eaff0c,0 8px 24px -20px #00000080;
    --st-lift:inset 0 1px 0 #d9eaff16,0 12px 32px -18px #00000080;
    --st-float:inset 0 1px 0 #d9eaff1c,0 24px 60px -16px #000000a6;
    --st-wash:#468ce312;
  }
}

/* A coherent frame, with no new bands consuming vertical space. */
body.hts-studio.hts-studio.hts-studio :is(.topbar,#device-dock,.ex-bar) {
  background:var(--surface); border-color:var(--st-edge);
}
body.hts-studio.hts-studio.hts-studio .sidebar {
  background:var(--surface); border-color:var(--st-edge);
}
body.hts-studio.hts-studio.hts-studio .st-page :is(.panel,.vocab-card,.reference-row,.stat-card,.category-card) {
  box-shadow:var(--st-shadow);
}
body.hts-studio.hts-studio.hts-studio .st-page :is(.category-card,.stat-card) {
  background:var(--surface); border-color:var(--st-edge);
}

/* Editorial supporting regions: warm paper, not extra nested containers. */
body.hts-studio.hts-studio.hts-studio .st-page :is(.daily-plan,.p-rhythm,.lookup-explanation,.lesson-tip,.reference-hero,.hp-form) {
  background:var(--st-paper); border-color:var(--st-paper-line); color:var(--ink);
}
body.hts-studio.hts-studio.hts-studio .st-page .reference-hero p { color:var(--muted); }
body.hts-studio.hts-studio.hts-studio .st-page :is(.reference-hero,.daily-plan,.lookup-studio,.study-sentence) {
  box-shadow:var(--st-lift);
}
body.hts-studio.hts-studio.hts-studio .st-page :is(.lookup-studio,.study-sentence) {
  background:var(--surface);
}
body.hts-studio.hts-studio.hts-studio .st-page :is(.mini-stat,.practice-mini,.week-card) {
  background:var(--st-blue); border-color:var(--st-edge);
}
body.hts-studio.hts-studio.hts-studio .st-page .chart-panel:has(.activity-grid) {
  background:var(--st-paper); border-color:var(--st-paper-line);
}
body.hts-studio.hts-studio.hts-studio .st-page .chart-panel:not(:has(.activity-grid)) {
  background:var(--st-raised); border-color:var(--st-edge); box-shadow:var(--st-lift);
}
body.hts-studio.hts-studio.hts-studio .st-page .pz {
  background:linear-gradient(180deg,var(--st-blue),transparent 180px);
}
body.hts-studio.hts-studio.hts-studio .st-page :is(.lesson-detail,.mechanics-card) {
  background:var(--surface); border-color:var(--st-edge); box-shadow:var(--st-shadow);
}
body.hts-studio.hts-studio.hts-studio .st-page :is(#lesson-inspector .lesson-detail,.sentence-note) {
  background:var(--st-paper); border-color:var(--st-paper-line);
}

/* Hear the whole / examine its parts: identical treatment for word and sentence.
   Pair all literal foregrounds in these blue regions; keep semantic tags intact. */
body.hts-studio.hts-studio.hts-studio .st-page .lookup-word,
body.hts-studio.hts-studio.hts-studio #sbdHost .sbd__whole {
  background:linear-gradient(145deg,#183e60,#102e50 70%);
  border-color:#42617e; color:#edf5fd;
}
body.hts-studio.hts-studio.hts-studio .st-page .lookup-word :is(.lookup-thai,.lookup-meaning),
body.hts-studio.hts-studio.hts-studio #sbdHost :is(.sbd__sent,.sbd__meaning) { color:#edf5fd; }
body.hts-studio.hts-studio.hts-studio .st-page .lookup-word :is(.small-label,.text-link,.save-button),
body.hts-studio.hts-studio.hts-studio #sbdHost .sbd__whole :is(.small-label,.sbd__listening-label) { color:#c3d8eb; }
body.hts-studio.hts-studio.hts-studio .st-page .lookup-word .save-button.saved { color:#acd0ff; }
body.hts-studio.hts-studio.hts-studio .st-page .lookup-tags .badge {
  background:#284862; border-color:#57738b; color:#e1edf7;
}
body.hts-studio.hts-studio.hts-studio #sbdHost .sbd__slow {
  background:#284862; border-color:#7190aa; color:#edf5fd;
}
body.hts-studio.hts-studio.hts-studio .st-page .lookup-word>.btn,
body.hts-studio.hts-studio.hts-studio #sbdHost .sbd__play {
  background:#1f70df; border-color:#80b8ff; color:#fff;
}
body.hts-studio.hts-studio.hts-studio #sbdHost .sbd__analysis,
body.hts-studio.hts-studio.hts-studio .st-page .lookup-analysis { background:var(--surface); }
body.hts-studio.hts-studio.hts-studio .st-page .syllable-table thead th {
  background:var(--st-blue); border-color:var(--st-edge);
}

/* Reference families retain every diagram, teaching heading and semantic hue. */
body.hts-studio.hts-studio.hts-studio .st-page :is(.paircard,.ccard,.ccl,.ladcard,.pat-example,.rs-stage) {
  box-shadow:var(--st-shadow);
}
body.hts-studio.hts-studio.hts-studio .st-page :is(.paircard,.ladcard) {
  background:var(--st-blue); border-color:var(--st-edge);
}
body.hts-studio.hts-studio.hts-studio .st-page .paircard .pcell {
  background:var(--surface); color:var(--ink);
}
body.hts-studio.hts-studio.hts-studio .st-page .pat-sec {
  background:linear-gradient(180deg,var(--st-paper),transparent 160px);
}

/* Stable collection art; text rows remain quiet and readable. */
body.hts-studio.hts-studio.hts-studio .st-page .playlist-card .playlist-art {
  background:color-mix(in srgb,var(--cv,#1f70df) 16%,var(--st-raised));
}
body.hts-studio.hts-studio.hts-studio .st-page .playlist-card .plsteps {
  background:var(--st-blue);
}
body.hts-studio.hts-studio.hts-studio .st-page .playlist-card .plrow {
  background:var(--surface); border-color:var(--st-edge);
}
body.hts-studio.hts-studio.hts-studio .st-page .settings-card {
  background:var(--st-blue); border-color:var(--st-edge); box-shadow:var(--st-lift);
}

/* Focused and full-shell exercises: paint only, including the measured RB02 Build. */
body.hts-studio.hts-studio.hts-studio.ex-active #view { background:var(--bg); }
body.hts-studio.hts-studio.hts-studio #view :is(.qx__stage,.lg-stage,.rv-face,.shadow__model) {
  background:var(--surface); border-color:var(--st-edge); box-shadow:var(--st-lift);
}
body.hts-studio.hts-studio.hts-studio #view :is(.qx__foot,.lg-fb):not(.is-ok):not(.is-no):not(.is-correct):not(.is-wrong) {
  background:var(--st-raised); border-color:var(--st-edge);
}
body.hts-studio.hts-studio.hts-studio.ex-build #view .rb-panel:has(>#rvLine) {
  background:var(--st-well); border-radius:14px;
}
body.hts-studio.hts-studio.hts-studio #view :is(.q2-res,.daily-res) {
  background-image:radial-gradient(ellipse at 50% 0%,var(--st-blue),transparent 75%)!important;
}

/* The graph world is excluded. Only the inspector's reading hierarchy changes. */
body.hts-studio.hts-studio.hts-studio .cmg-inspector { border-color:var(--st-edge); }
body.hts-studio.hts-studio.hts-studio .cmg-peek { background:var(--st-blue); }
body.hts-studio.hts-studio.hts-studio .cmg-detail { background:var(--surface); }

/* Floating layers, including the body-mounted setup sheet. No z-index or filters. */
body.hts-studio.hts-studio.hts-studio :is(.account-menu,#device-sheet,#search-dialog,.lookup-results),
body.hts-studio.hts-studio.hts-studio #qsheet .qsheet {
  background:var(--st-raised); border-color:var(--st-edge); box-shadow:var(--st-float);
}
body.hts-studio.hts-studio.hts-studio #sbdHost .sbd__results {
  background:var(--st-raised); border-color:var(--st-edge); box-shadow:var(--st-float);
}
body.hts-studio.hts-studio.hts-studio .pw-r01 {
  --pw-canvas:var(--bg); --pw-surface:var(--surface);
  --pw-soft:var(--st-blue); --pw-line:var(--st-edge);
}
body.hts-studio.hts-studio.hts-studio .pw-r01 :is(.pw-membership,.pw-purchase) {
  box-shadow:var(--st-lift);
}
body.hts-studio.hts-studio.hts-studio .pro-page {
  --ppaper:var(--surface); --ppaper-2:var(--st-paper); --pline:var(--st-edge);
}

/* Recovery: consolidated owner fixes; maintained by the Studio editor. */
/* studio_fixes.css — owner's universal fixes, 2026-09-10 (PM hands). Loaded last; same body.hts-studio gate.
   1. sentence word chips: one surface, one height per row, no colour rotation
   2. collapsed sidebar (701-1250px): section labels never wrap
   3. scenario conversation: the whole line is the control; the selected line is unmistakable
   5. "Explore the constellation": the one button that has to feel like the killer app
   6. "Back to the arcade" pill on the Listening game when you came from the arcade
   8. scenario "Inside the sentence" = a bottom sheet on one-column layouts (opens on tap only) */

/* ---- 1. word chips ------------------------------------------------------------------------ */
body.hts-studio.hts-studio.hts-studio .st-page .token-list{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch;margin:20px 0}
body.hts-studio.hts-studio.hts-studio .st-page .token,
body.hts-studio.hts-studio.hts-studio .st-page .token:nth-child(3n+1),
body.hts-studio.hts-studio.hts-studio .st-page .token:nth-child(3n+2){display:flex;flex-direction:column;align-items:flex-start;min-width:104px;min-height:112px;padding:12px 14px 10px;border-radius:10px;background:var(--surface);border:1px solid var(--line);box-shadow:0 1px 2px #0000000d}
body.hts-studio.hts-studio.hts-studio .st-page .token .thai{font-size:max(14px,calc(22px * var(--type-k-thai)));line-height:1.5;display:block}
body.hts-studio.hts-studio.hts-studio .st-page .token small{display:block;margin-top:2px;font-size:12px;line-height:1.45;color:var(--muted);max-width:170px}
body.hts-studio.hts-studio.hts-studio .st-page .token [data-fav],
body.hts-studio.hts-studio.hts-studio .st-page .token .heart{margin-top:auto;padding-top:8px}
:root[data-theme="dark"] body.hts-studio.hts-studio.hts-studio .st-page .token{background:#2f3a4d;border-color:#41506a}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) body.hts-studio.hts-studio.hts-studio .st-page .token{background:#2f3a4d;border-color:#41506a}}

/* ---- 2. collapsed sidebar labels ---------------------------------------------------------- */
@media(min-width:701px) and (max-width:1250px){
  body.hts-studio.hts-studio.hts-studio .nav-section{white-space:nowrap;overflow:hidden;letter-spacing:.35px;font-size:8.5px;padding:17px 0 6px}
}

/* ---- 3. the conversation ------------------------------------------------------------------ */
body.hts-studio.hts-studio.hts-studio .st-page .conv-hint{margin:2px 0 10px;font-size:12px;color:var(--muted)}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line{position:relative;display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:12px;align-items:start;padding:16px 14px 16px 12px;margin:0 0 8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer;transition:border-color .15s,background .15s,transform .15s}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line:hover{border-color:var(--ink)}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line:focus{outline:none}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line.selected{margin:0 0 8px;padding:16px 14px 16px 12px;border-color:var(--orange);background:var(--soft-orange);box-shadow:inset 4px 0 0 var(--orange)}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line .speaker-avatar{width:34px;height:34px;font-size:11px;font-weight:700;letter-spacing:.3px}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line .speaker-label{display:flex;align-items:center;gap:8px;font-size:11px;letter-spacing:1.1px;color:var(--muted);margin-bottom:4px}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line .speaker-label span{float:none!important;margin-left:auto;font-variant-numeric:tabular-nums}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line .line-audio{display:block;width:100%;text-align:left;padding:0;background:none;border:0;color:inherit;font:inherit;cursor:pointer}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line .thai{font-size:max(14px,calc(21px * var(--type-k-thai)));line-height:1.7}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line .translation{font-size:max(13px,calc(13px * var(--type-k)));color:var(--muted);line-height:1.6;margin-top:4px}
body.hts-studio.hts-studio.hts-studio .st-page .conversation.hide-translations .translation{display:none}
body.hts-studio.hts-studio.hts-studio .st-page .line-tools{display:flex;flex-direction:column;align-items:flex-end;gap:8px;align-self:stretch;justify-content:space-between}
body.hts-studio.hts-studio.hts-studio .st-page .line-tools .line-play{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);cursor:pointer;padding:0}
body.hts-studio.hts-studio.hts-studio .st-page .line-tools .line-play:hover{border-color:var(--orange);color:var(--orange)}
body.hts-studio.hts-studio.hts-studio .st-page .line-tools .line-play .icon{width:16px;height:16px}
body.hts-studio.hts-studio.hts-studio .st-page .line-tools .line-open{display:inline-flex;align-items:center;gap:6px;font-family:inherit;appearance:none;-webkit-appearance:none;min-height:32px;padding:0 10px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--muted);font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;white-space:nowrap;cursor:pointer}
body.hts-studio.hts-studio.hts-studio .st-page .line-tools .line-open .icon{width:13px;height:13px}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line.selected .line-open{background:var(--orange);border-color:var(--orange);color:#fff}
:root[data-theme="dark"] body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line.selected .line-open{color:#2f2433}
body.hts-studio.hts-studio.hts-studio .st-page .lesson-bottom{display:none}
body.hts-studio.hts-studio.hts-studio .st-page .lesson-aside .lesson-detail{border:1px solid var(--line);border-left:4px solid var(--orange)}
@media(max-width:700px){
  body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line{grid-template-columns:30px minmax(0,1fr);padding:14px 12px 12px 10px}
  body.hts-studio.hts-studio.hts-studio .st-page .line-tools{grid-column:1 / -1;flex-direction:row;justify-content:flex-end;align-items:center}
  body.hts-studio.hts-studio.hts-studio .st-page .line-tools .line-play{width:44px;height:44px}
  body.hts-studio.hts-studio.hts-studio .st-page .line-tools .line-open{min-height:44px;padding:0 14px}
}

/* ---- 5. explore the constellation --------------------------------------------------------- */
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst{position:relative;display:inline-flex;align-items:center;gap:16px;min-height:64px;padding:8px 22px 8px 10px;border-radius:999px;color:#fff;text-decoration:none;background:linear-gradient(135deg,#102e50 0%,#1b4f9a 55%,#1f70df 100%);box-shadow:0 12px 34px -10px #1f70dfaa,0 0 0 1px #6fa4ff33 inset;isolation:isolate;overflow:hidden;transition:transform .2s ease,box-shadow .2s ease}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst:hover{transform:translateY(-2px);box-shadow:0 18px 44px -12px #1f70dfcc,0 0 0 1px #9dceff55 inset;border-color:transparent}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst:before{content:"";position:absolute;inset:-40%;z-index:-1;background:conic-gradient(from 0deg,transparent 0 62%,#9dceffb0 72%,#ffffff 78%,#9dceffb0 84%,transparent 94%);animation:cstSweep 3.6s linear infinite;opacity:.55}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst:after{content:"";position:absolute;inset:2px;z-index:-1;border-radius:999px;background:linear-gradient(135deg,#102e50 0%,#1b4f9a 55%,#1f70df 100%)}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb{position:relative;width:48px;height:48px;flex-shrink:0;border-radius:50%;background:radial-gradient(circle at 50% 50%,#ffffff 0 4px,#7fb0fb 5px,#1f70df 9px,transparent 10px);box-shadow:0 0 0 6px #7fb0fb22,0 0 24px #7fb0fb88;animation:cstBreath 3s ease-in-out infinite}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb i{position:absolute;width:6px;height:6px;border-radius:50%;background:#fff;box-shadow:0 0 8px #fff;animation:cstTwinkle 2.4s ease-in-out infinite}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb i:nth-child(1){left:6px;top:9px}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb i:nth-child(2){right:5px;top:14px;animation-delay:.8s}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb i:nth-child(3){left:14px;bottom:5px;animation-delay:1.6s}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb svg line{stroke:#cfe3ff;stroke-width:1;opacity:.7}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__text{display:flex;flex-direction:column;align-items:flex-start;line-height:1.2;min-width:0}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__text b{font-size:max(15px,calc(17px * var(--type-k)));font-weight:700;letter-spacing:.3px}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__text small{margin-top:3px;font-size:12px;color:#cfe3ff;letter-spacing:.2px}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__arrow{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-left:4px;border-radius:50%;background:#ffffff1f;flex-shrink:0;transition:transform .2s ease,background .2s}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__arrow .icon{width:16px;height:16px;color:#fff}
body.hts-studio.hts-studio.hts-studio .st-page .btn-cst:hover .btn-cst__arrow{transform:translateX(3px);background:#ffffff33}
@keyframes cstSweep{to{transform:rotate(360deg)}}
@keyframes cstBreath{0%,100%{box-shadow:0 0 0 6px #7fb0fb22,0 0 24px #7fb0fb88}50%{box-shadow:0 0 0 9px #7fb0fb2e,0 0 36px #9dceffcc}}
@keyframes cstTwinkle{0%,100%{opacity:.35;transform:scale(.8)}50%{opacity:1;transform:scale(1.15)}}
@media(prefers-reduced-motion:reduce){body.hts-studio.hts-studio.hts-studio .st-page .btn-cst:before,body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb,body.hts-studio.hts-studio.hts-studio .st-page .btn-cst__orb i{animation:none}}
@media(max-width:700px){body.hts-studio.hts-studio.hts-studio .st-page .btn-cst{width:100%;justify-content:flex-start}}

/* ---- 6. back to the arcade ---------------------------------------------------------------- */
body.hts-studio.hts-studio.hts-studio .st-page .back-pill{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 16px 0 12px;margin:0 0 14px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--ink);font-size:max(13px,calc(13px * var(--type-k)));font-weight:600;text-decoration:none}
body.hts-studio.hts-studio.hts-studio .st-page .back-pill:hover{border-color:var(--orange);color:var(--orange)}
body.hts-studio.hts-studio.hts-studio .st-page .back-pill .icon{width:15px;height:15px}

/* ---- 7. full screen on phones ------------------------------------------------------------- */
body.hts-studio.hts-studio.hts-studio .st-page .cmg-fsfab{display:none}
@media(max-width:700px){
  body.hts-studio.hts-studio.hts-studio .st-page .cmg-stage{position:relative}
  body.hts-studio.hts-studio.hts-studio .st-page .cmg-fsfab{position:absolute;right:12px;bottom:12px;z-index:6;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;border:1px solid #7fb0fb66;background:#102e50e6;color:#fff;box-shadow:0 8px 24px -8px #000000aa;cursor:pointer;padding:0}
  body.hts-studio.hts-studio.hts-studio .st-page .cmg-fsfab .icon{width:18px;height:18px}
  body.hts-studio.hts-studio.hts-studio .st-page .cmg-fsfab:active{transform:scale(.96)}
  body.hts-studio.hts-studio.cst-fauxfs .st-page .cmg-fsfab{display:none}
}

/* ---- 8. inside the sentence: bottom sheet on one-column layouts --------------------------- */
/* wide layouts: the aside is unchanged; the sheet chrome does not exist */
body.hts-studio.hts-studio.hts-studio .st-page .sheet-head,
body.hts-studio.hts-studio.hts-studio .st-page .sheet-line,
body.hts-studio.hts-studio.hts-studio .st-page .lesson-scrim{display:none}
body.hts-studio.hts-studio.hts-studio .st-page .dialogue-line{scroll-margin-top:84px}

  body.hts-studio.st-inspector-sheet.hts-studio.hts-sheet-open{overflow:hidden}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-scrim{display:block;position:fixed;inset:0;z-index:228;background:#0b1a2e4d;opacity:0;pointer-events:none;transition:opacity .22s;touch-action:none}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-scrim.is-open{opacity:1;pointer-events:auto}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-aside{position:fixed;top:auto;left:0;right:0;bottom:0;z-index:229;display:flex;flex-direction:column;width:auto;max-width:760px;margin:0 auto;max-height:min(80vh,80dvh);padding:0;border:1px solid var(--line);border-bottom:0;border-radius:22px 22px 0 0;background:var(--surface);box-shadow:0 -20px 60px #102e5040;transform:translateY(105%);transition:transform .28s cubic-bezier(.2,.8,.2,1);outline:none;visibility:hidden}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-aside.is-open{transform:none;visibility:visible}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-head{display:block;flex:none;padding:8px 8px 0;border-bottom:1px solid var(--line)}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-grip{display:block;width:40px;height:4px;border-radius:2px;background:var(--line);margin:0 auto 6px}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-bar{display:grid;grid-template-columns:44px minmax(0,1fr) 44px 44px;align-items:center;gap:4px;padding-bottom:6px}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-title{text-align:center;font-size:11px;letter-spacing:1.4px;text-transform:uppercase;color:var(--muted);white-space:nowrap}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-title b{color:var(--ink);font-weight:700}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-step,
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-close{width:44px;height:44px;display:grid;place-items:center;border:0;background:none;color:var(--ink);border-radius:50%;padding:0;cursor:pointer}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-close{background:var(--bg)}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-step:disabled{opacity:.28;cursor:default}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-step .icon,
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-close .icon{width:18px;height:18px}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px 16px calc(18px + env(safe-area-inset-bottom))}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-line{display:flex;gap:12px;align-items:flex-start;padding:2px 0 14px;margin:0 0 6px;border-bottom:1px solid var(--line)}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-line>div{min-width:0}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-line .line-play{flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);cursor:pointer;padding:0}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-line .line-play .icon{width:16px;height:16px}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-line .speaker-label{display:block;font-size:11px;letter-spacing:1.1px;color:var(--muted);margin:2px 0 4px}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-line .thai{display:block;font-size:max(14px,calc(24px * var(--type-k-thai)));line-height:1.6}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-body .lesson-detail{padding:18px;margin:0;border-radius:12px}
  body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .sheet-body .lesson-tip{margin-top:14px}
  :root[data-theme="dark"] body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-scrim{background:#00000080}
  @media (prefers-color-scheme:dark){:root:not([data-theme="light"]) body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-scrim{background:#00000080}}
  @media (prefers-reduced-motion:reduce){
    body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-aside,
    body.hts-studio.st-inspector-sheet.hts-studio.hts-studio .st-page .lesson-scrim{transition:none}
  }


/* ---- 9. phone home card (owner 2026-09-10) ------------------------------------------------ */
/* the title block breathes at the bottom; the vertical "01 / EXPLORE" label is gone on every phone */
@media(max-width:700px){
  body.hts-studio.hts-studio.hts-studio .st-page .p-discovery-title{padding-bottom:18px}
  body.hts-studio.hts-studio.hts-studio .st-page .p-coordinate{display:none}
  /* "Pick up the thread": the finish pass made it a paper card, the phone rule left it with no side padding */
  body.hts-studio.hts-studio.hts-studio .st-page .p-rhythm{padding:22px 20px 24px;border:1px solid var(--st-paper-line,var(--line));border-radius:16px;gap:18px}
  body.hts-studio.hts-studio.hts-studio .st-page .p-rhythm>a:last-child{padding-left:18px}
  /* the three ways to explore read as buttons: border, surface, radius, arrow in its own corner */
  body.hts-studio.hts-studio.hts-studio .st-page .p-paths{gap:8px;border-bottom:0;padding-bottom:0}
  body.hts-studio.hts-studio.hts-studio .st-page .p-paths a{display:grid;grid-template-columns:minmax(0,1fr) 16px;align-items:center;gap:6px 6px;min-height:64px;padding:10px 10px 10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 1px 2px #0000000d}
  body.hts-studio.hts-studio.hts-studio .st-page .p-paths a>span{grid-column:1/-1;font-size:10px;letter-spacing:1px;color:var(--muted)}
  body.hts-studio.hts-studio.hts-studio .st-page .p-paths b{font-size:12px;font-weight:600;line-height:1.35;min-width:0}
  body.hts-studio.hts-studio.hts-studio .st-page .p-paths .icon{width:15px;color:var(--brand)}
  body.hts-studio.hts-studio.hts-studio .st-page .p-paths a:active{border-color:var(--brand);background:var(--soft-orange)}
}

/* ---- 10. word lookup header (owner 2026-09-10) ------------------------------------------- */
/* one plain label above the search on every device: WORD LOOKUP, no dash, no tagline, no guide link */
body.hts-studio.hts-studio.hts-studio .st-page .lookup-intro{display:block;padding:22px 30px 6px}
body.hts-studio.hts-studio.hts-studio .st-page .lookup-intro .eyebrow{display:flex;gap:0}
@media(max-width:700px){
  body.hts-studio.hts-studio.hts-studio .st-page .lookup-intro{padding:16px 20px 4px}
}

/* Recovery 1.3: destinations remain discoverable without shrinking hit areas. */
body.hts-studio.hts-studio.hts-studio .sidebar {overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--muted) transparent;}
body.hts-studio.hts-studio.hts-studio .sidebar>* {flex-shrink:0;}
body.hts-studio.hts-studio.hts-studio .sidebar .nav-link,
body.hts-studio.hts-studio.hts-studio .sidebar .profile {min-height:44px;min-width:44px;box-sizing:border-box;}
body.hts-studio.hts-studio.hts-studio .sidebar .nav-section {padding-top:10px;padding-bottom:4px;}
body.hts-studio.hts-studio.hts-studio .sidebar-bottom {padding-top:12px;}
body.hts-studio.hts-studio.hts-studio .sidebar-more {position:sticky;bottom:0;z-index:2;display:block;min-height:44px;width:100%;padding:8px 2px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font:inherit;font-size:11px;box-shadow:0 -14px 18px var(--surface);cursor:pointer;}
body.hts-studio.hts-studio.hts-studio .sidebar::-webkit-scrollbar {width:5px;}
body.hts-studio.hts-studio.hts-studio .sidebar::-webkit-scrollbar-thumb {background:var(--muted);border-radius:8px;}

body.hts-studio.hts-studio.hts-studio #device-sheet .sheet-utility :is(a,button) {display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:6px 10px;box-sizing:border-box;}

/* Recovery 1.4: measure content height before selecting sheet or bounded aside. */
body.hts-studio.hts-studio.hts-studio:not(.st-inspector-sheet) .lesson-aside {position:sticky;top:var(--st-inspector-top,80px);max-height:var(--st-inspector-height,calc(100dvh - 100px));overflow-y:auto;overscroll-behavior:contain;align-self:start;min-height:0;}
body.hts-studio.st-inspector-sheet .st-page:has(.lesson-layout) {transform:none!important;animation:none!important;contain:none!important;}
body.hts-studio.st-inspector-sheet .lesson-layout {grid-template-columns:minmax(0,1fr)!important;}
body.hts-studio.hts-studio.hts-studio .st-page .line-tools :is(.line-open,.line-play) {min-width:44px;min-height:44px;}
body.hts-studio.st-inspector-sheet .sheet-title:after {content:'Inside the sentence';display:block;font-size:10px;letter-spacing:.4px;}
/* Recovery 1.7: collections lead; word analysis opens by explicit choice. */
/* Recovery 2 Home: a useful first action, then the signature constellation. */
/* Recovery 2 Arcade: session first, then a clear editorial game order. */
body.hts-studio .recovery-arcade .arcade-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px;}
body.hts-studio .recovery-arcade h1 {font-size:30px;line-height:1.2;margin:6px 0 0;}
body.hts-studio .arcade-facts {display:flex;gap:16px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:13px;}
body.hts-studio .arcade-facts a {min-height:44px;display:flex;align-items:center;color:var(--brand);}
body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;}
body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card {display:flex;flex-direction:column;gap:14px;min-width:0;padding:20px;border:1px solid var(--st-edge)!important;background:var(--st-raised)!important;border-radius:16px;text-decoration:none;}
body.hts-studio .recovery-arcade .game-copy {flex:1;min-width:0;}
body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card h3 {font-size:21px;line-height:1.3;font-weight:650;margin:0 0 8px;}
body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card p {font-size:14px;line-height:1.5;min-height:0;margin:0;}
body.hts-studio .recovery-arcade .game-visual {height:100px;overflow:hidden;border-radius:12px;flex-shrink:0;}
body.hts-studio .recovery-arcade .game-visual>div {height:100%!important;min-height:0!important;margin:0!important;}
body.hts-studio .recovery-arcade .game-entry {display:block;font-size:11px;letter-spacing:.08em;color:var(--brand);margin:0 0 8px;}
body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card--daily {grid-column:1/-1;flex-direction:row;align-items:center;background:var(--st-blue)!important;border-left:4px solid var(--brand)!important;}
body.hts-studio .recovery-arcade .game-card--daily .game-visual {width:100px;height:100px;}
body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card--daily .game-foot {border:0;padding:0;margin:8px 0 0;}
body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card--listening {border-color:var(--brand)!important;}
body.hts-studio .recovery-arcade .game-card--daily .game-visual>.icon {width:48px;height:48px;margin:26px;color:var(--brand);}
body.hts-studio .recovery-arcade .game-mobile-icon {display:none;}
@media(max-width:500px){body.hts-studio .recovery-arcade .game-visual>.activity-art {display:none;}body.hts-studio .recovery-arcade .game-mobile-icon {display:grid;place-items:center;width:64px;height:64px;border-radius:16px;background:var(--st-blue);color:var(--brand);}body.hts-studio .recovery-arcade .game-mobile-icon .icon {width:30px;height:30px;}}
@media(max-width:800px){body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:500px){body.hts-studio .recovery-arcade .arcade-heading {display:block;}body.hts-studio .arcade-facts {gap:12px;font-size:12px;}body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-grid {grid-template-columns:1fr;}body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card {padding:16px;flex-direction:row;align-items:center;}body.hts-studio .recovery-arcade .game-visual {width:64px;height:80px;}body.hts-studio .recovery-arcade .game-card--daily .game-visual {display:none;}body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-card h3 {font-size:20px;}body.hts-studio.hts-studio.hts-studio .recovery-arcade .game-foot {margin-top:10px;padding-top:8px;}}
body.hts-studio .study-action {display:flex;align-items:center;gap:16px;padding:18px 22px;margin:0 0 22px;border:1px solid var(--line);border-left:4px solid var(--brand);border-radius:16px;background:var(--surface);color:var(--ink);text-decoration:none;min-height:80px;}
body.hts-studio .study-action>span:nth-child(2) {display:grid;gap:4px;min-width:0;flex:1;}
body.hts-studio .study-action small {font-size:11px;letter-spacing:.08em;color:var(--muted);}
body.hts-studio .study-action b {font-size:21px;line-height:1.3;}
body.hts-studio .study-action>span>span {font-size:14px;line-height:1.45;color:var(--muted);}
body.hts-studio .study-action-icon {display:grid;place-items:center;width:48px;height:48px;flex-shrink:0;border-radius:50%;color:var(--brand);background:var(--bg);}
body.hts-studio .study-action>.icon {flex-shrink:0;}
body.hts-studio .recovery-home .heading {margin-bottom:20px;}
body.hts-studio .recovery-home .daily-plan {align-self:start;}
body.hts-studio .recovery-home .plan-bottom {font-size:13px;line-height:1.5;}
body.hts-studio .day i {position:relative;}
body.hts-studio .day-activity {position:absolute;right:-3px;bottom:-3px;background:var(--surface);color:var(--brand);border-radius:50%;width:17px;height:17px;display:grid;place-items:center;}
body.hts-studio .day-activity .icon {width:13px;height:13px;}
@media(max-width:600px){body.hts-studio .study-action {gap:10px;padding:14px 12px;margin:16px 0;}body.hts-studio .study-action b {font-size:18px;}body.hts-studio .study-action-icon {width:44px;height:44px;}body.hts-studio .study-action>span>span {font-size:12px;}body.hts-studio .recovery-home .week-card {margin:24px 0;}}
body.hts-studio .collections-lookup {margin:12px 0 20px;border:1px solid var(--line);border-radius:14px;background:var(--surface);}
body.hts-studio .collections-lookup>summary {min-height:48px;display:flex;align-items:center;gap:12px;padding:12px 16px;cursor:pointer;font-weight:600;}
body.hts-studio .collections-lookup>summary>span {margin-left:auto;color:var(--muted);font-size:13px;font-weight:400;}
body.hts-studio .collections-lookup .lookup-studio {margin:0;border:0;}
body.hts-studio .collections-lookup:not([open])>.lookup-studio {display:none!important;}
@media(max-width:600px){body.hts-studio .collections-lookup>summary>span {display:none;}}
/* Recovery 2: collection actions and compact, content-led scenario introductions. */
body.hts-studio.hts-studio.hts-studio .st-page .vocab-foot {gap:12px;flex-wrap:wrap;}
body.hts-studio.hts-studio.hts-studio .st-page .vocab-foot .text-link,
body.hts-studio.hts-studio.hts-studio .st-page .sentence-focus .text-link {min-height:44px;min-width:44px;display:inline-flex;align-items:center;font-size:14px;}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-collection-card {display:flex;flex-direction:column;gap:16px;align-items:stretch;}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-collection-card>.thai {font-size:26px;line-height:1.7;}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-listen {min-height:44px;align-self:flex-start;white-space:normal;text-align:left;}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-focus {margin-top:auto;padding-top:16px;border-top:1px solid var(--st-edge);}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-focus>small {font-size:11px;letter-spacing:1px;color:var(--muted);}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-focus>div {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:8px 0;}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-focus b {font-family:Thai,sans-serif;font-size:22px;font-weight:400;}
body.hts-studio.hts-studio.hts-studio .st-page .sentence-focus .save-button {margin-left:auto;min-width:44px;min-height:44px;}
body.hts-studio.hts-studio.hts-studio .st-page .scene-card .scene-preview {font-size:15px;line-height:1.6;color:var(--ink);margin:8px 0;}
body.hts-studio.hts-studio.hts-studio .st-page .scene-card .scene-meta {font-size:12px;color:var(--muted);}
body.hts-studio.hts-studio.hts-studio .st-page .scenario-header {display:grid;grid-template-columns:minmax(0,1fr) 36%;gap:0;min-height:0;margin-bottom:16px;}
body.hts-studio.hts-studio.hts-studio .st-page .scenario-header .scenario-copy {padding:20px 24px;min-width:0;}
body.hts-studio.hts-studio.hts-studio .st-page .scenario-header .scene-cover {width:100%;max-width:100%;height:100%;max-height:260px;grid-row:auto;object-fit:cover;align-self:stretch;}
body.hts-studio.hts-studio.hts-studio .st-page .scenario-copy h1 {font-size:30px;line-height:1.2;margin:8px 0;}
body.hts-studio.hts-studio.hts-studio .st-page .scenario-copy p {font-size:14px;line-height:1.5;margin:8px 0;}
body.hts-studio.hts-studio.hts-studio .st-page .scenario-copy .badge {margin-top:8px;}
body.hts-studio.hts-studio.hts-studio .st-page .scene-resume {display:flex;align-items:center;min-height:44px;color:inherit;margin-top:6px;text-align:left;}
@media(max-width:600px){
 body.hts-studio.hts-studio.hts-studio .st-page .scenario-header {grid-template-columns:minmax(0,1fr) 76px;}
 body.hts-studio.hts-studio.hts-studio .st-page .scenario-header .scenario-copy {padding:16px;}
 body.hts-studio.hts-studio.hts-studio .st-page .scenario-copy h1 {font-size:24px;letter-spacing:-.5px;}
 body.hts-studio.hts-studio.hts-studio .st-page .scenario-copy>.thai {font-size:20px;line-height:1.5;}
 body.hts-studio.hts-studio.hts-studio .st-page .scenario-header .scene-cover {max-height:none;}
}

body.hts-studio.hts-studio.hts-studio .st-page .scenario-back {margin-bottom:8px;}


/* ===== Recovery 4 (PM, 2026-09-11): engine elements from Batches 3–4, in the accepted design language ===== */
/* (the answer repair block was retired 2026-09-11 — games judge, they do not teach) */
/* Rapid Fire clock next to Score and Combo */
body.hts-studio.hts-studio.hts-studio .qx__scoreline .qx__timer b { font-variant-numeric:tabular-nums; min-width:2ch; display:inline-block; text-align:right; }
/* Review HUD: eligibility line under the mode row */
body.hts-studio.hts-studio.hts-studio .rv-hud2 .rv-hud2__elig { flex-basis:100%; margin-top:6px; }
@media (max-width:560px) { body.hts-studio.hts-studio.hts-studio .rv-hud2 .rv-src { flex-wrap:wrap; } }
/* top-bar search reads as a field where there is room; no shortcut key on touch */
@media (min-width:1160px) {
  body.hts-studio.hts-studio.hts-studio .search-trigger { min-width:280px; height:40px; padding:0 14px; justify-content:flex-start; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--muted); }
  body.hts-studio.hts-studio.hts-studio .search-trigger>span { display:inline; }
  body.hts-studio.hts-studio.hts-studio .search-trigger .key { margin-left:auto; }
}
@media (hover:none) { body.hts-studio.hts-studio.hts-studio .search-trigger .key { display:none; } }

/* visited-state chip on cards and step rows (Recovery 4, PM) */
body.hts-studio.hts-studio.hts-studio .st-visited { display:inline-block; margin-left:8px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); background:var(--bg); color:var(--muted); font-size:10.5px; font-weight:600; letter-spacing:.5px; text-transform:uppercase; vertical-align:middle; white-space:nowrap; }
body.hts-studio.hts-studio.hts-studio .plrow.is-visited .plrow__n { background:var(--soft-green, #e6f4ea); color:var(--green, #1f7a3f); }
/* the fitted exercise shell has its own exit link; the page-level back pill above the card pushed the whole
   card down by its height (the 21–57 px overshoot measured on phones and portrait iPads) */
body.hts-studio.hts-studio.hts-studio.ex-active #view .back-pill { display:none!important; }
/* (the answer-foot fitting rules were retired 2026-09-11 with the answer foot itself) */
