/* SC1-F9-F12: owner preview only. Shared alignment corrections retain all text. */
body.hts-studio.hts-studio .st-page .category-card.pc-card {display:flex;flex-direction:column;}
body.hts-studio.hts-studio .st-page .category-card.pc-card .sc1-rule-count {margin-top:auto!important;padding-top:12px;display:flex;align-items:center;gap:8px;}
body.hts-studio.hts-studio .st-page .category-card.pc-card .sc1-rule-count .icon {margin:0 0 0 auto;flex:none;}
body.hts-studio.hts-studio .st-page .category-card.pc-card .sc1-mastery-count {min-height:21px;margin:0;}
body.hts-studio.hts-studio .st-page .reference-row:has(>[data-master])>div {min-width:0;flex:1;}
body.hts-studio.hts-studio .st-page .reference-row>[data-master] {flex:0 0 136px;width:136px;min-height:44px;height:44px;white-space:nowrap;justify-content:center;gap:6px;font-size:13px;}
@media(min-width:320px) and (max-width:414px) and (orientation:portrait) {
 body.hts-studio.hts-studio .st-page .gx-cats {position:static;max-height:none;overflow:visible;top:auto;}
 body.hts-studio.hts-studio .st-page .gx-wrap {grid-template-columns:minmax(0,1fr);}
 body.hts-studio.hts-studio .st-page .gx-cat {min-height:44px;display:flex;align-items:center;}
 body.hts-studio.hts-studio .st-page .reference-row:has(>[data-master]) {gap:10px;padding:16px 12px;}
 body.hts-studio.hts-studio .st-page .reference-row>[data-master] {flex-basis:120px;width:120px;font-size:12px;}
 body.hts-studio.hts-studio .st-page .tabs:has(a[href="#/words/breakdown"]) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px;overflow:visible;margin-bottom:22px;}
 body.hts-studio.hts-studio .st-page .tabs:has(a[href="#/words/breakdown"]) .tab {display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 2px;font-size:max(13px,calc(14px * var(--type-k)));white-space:normal;word-break:normal;overflow-wrap:normal;text-align:center;}
}

/* SC1-F13: readable teaching colors at every size, only within the preview. */
html:not([data-theme="dark"]) body.hts-studio.hts-studio .st-page .cbadge {
 background:color-mix(in srgb,var(--c,#1f70df) 14%,#fff)!important;color:#163954!important;border-color:color-mix(in srgb,var(--c,#1f70df) 45%,#fff)!important;
}
html:not([data-theme="dark"]) body.hts-studio.hts-studio .st-page :is(.pat-hero,.pat-example,.pat-eg) {color:var(--ink)!important;background:var(--surface)!important;}
html:not([data-theme="dark"]) body.hts-studio.hts-studio .st-page :is(.pat-hero,.pat-example,.pat-eg) :is(.thai,.pat-th,.pat-en,.en,.muted,p,span,a,button) {color:var(--ink)!important;}
/* SC1-F14/F16: Medium phone purchase actions and locked Sounds entry. */
@media(min-width:320px) and (max-width:414px) and (orientation:portrait) {
 body.hts-studio .pw-r01 .pw-upgrade-header .pw-close {width:44px;height:44px;}
 body.hts-studio .pw-r01 .pw-upgrade-hero {padding:12px 18px;}
 body.hts-studio .pw-r01 .pw-upgrade-hero .pw-graph {width:80px;height:80px;flex-basis:80px;}
 body.hts-studio .pw-r01 .pw-upgrade-layout {padding:12px 12px 4px;gap:10px;}
 body.hts-studio .pw-r01 .pw-purchase {padding:14px 16px 10px;}
 body.hts-studio .pw-r01 .pw-seal {height:32px;width:38px;font-size:7px;}
 body.hts-studio .pw-r01 .pw-seal b {font-size:max(13px,calc(14px * var(--type-k)));}
 body.hts-studio .pw-r01 .pw-purchase h2 {font-size:max(14px,calc(25px * var(--type-k)));margin-top:4px;}
 body.hts-studio .pw-r01 .pw-purchase-description {font-size:max(13px,calc(14px * var(--type-k)));line-height:1.4;margin-top:6px;}
 body.hts-studio .pw-r01 .pw-price-block {padding:10px 0;margin-bottom:10px;}
 body.hts-studio .pw-r01 .pw-price-eligibility {font-size:13px;margin-bottom:6px;}
 body.hts-studio .pw-r01 .pw-price>span {font-size:36px;}
 body.hts-studio .pw-r01 .pw-price-foot {margin-top:6px;font-size:12px;}
 body.hts-studio .pw-r01 .pw-purchase .pw-slot-primary {order:1;}
 body.hts-studio .pw-r01 .pw-checkout-caption {order:2;}
 body.hts-studio .pw-r01 .pw-slot-error {order:3;}
 body.hts-studio .pw-r01 .pw-includes {order:4;margin-top:12px;margin-bottom:0;}
 body.hts-studio .pw-r01 .pw-guarantee {order:5;}
 body.hts-studio .pw-r01 .pw-slot-code {order:6;}
 body.hts-studio.hts-studio .st-page .section-heading:has([data-tl-area="snd-formula"]) {display:block;}
 body.hts-studio.hts-studio .st-page .section-heading .text-link[data-tl-area="snd-formula"] {display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;width:100%;max-width:none;text-align:left;min-height:44px;margin-top:10px;white-space:normal;word-break:normal;overflow-wrap:normal;}
 body.hts-studio.hts-studio .st-page .text-link[data-tl-area="snd-formula"] .tl-pin {flex:0 0 100%;margin:0;}
 body.hts-studio.hts-studio .st-page .reference-row[data-tl-area] {min-width:0;overflow:hidden;}
 body.hts-studio.hts-studio .st-page .reference-row[data-tl-area]>.tl-pin {box-sizing:border-box;width:auto;max-width:100%;left:0;right:0;}
 body.hts-studio.hts-studio .st-page .tl-pin:after {flex-shrink:0;}
}

/* SC2-5-E/F: narrow grammar is a document; playlist teaching labels wrap. */
@media(max-width:820px) {
 body.hts-studio.hts-studio .st-page .gx-cats {position:static;max-height:none;overflow:visible;top:auto;}
 body.hts-studio.hts-studio .st-page .gx-wrap {grid-template-columns:minmax(0,1fr);}
 body.hts-studio.hts-studio .st-page .gx-cat {min-height:44px;display:flex;align-items:center;}
}
body.hts-studio.hts-studio .st-page :is(.pl-step__l,.plrow__l) {white-space:normal!important;overflow:visible!important;text-overflow:clip!important;min-width:0;line-height:1.4;overflow-wrap:normal;}
body.hts-studio.hts-studio .st-page .pl-step {min-height:44px;height:auto;align-items:center;}
body.hts-studio.hts-studio .st-page .playlist-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));}
body.hts-studio.hts-studio .st-page .plrow {min-height:44px;height:auto;padding:12px 10px;gap:8px;}
/* Shared listening controls also stay legible in the existing desktop shell. */
body.hts-studio:not(.ex-active) #view .lg-stage {display:flex;flex-direction:column;align-items:center;gap:18px;}
/* .lg-audio is the audio BLOCK (play + slow + prompt), not the play button: studio_qx.css still paints it as the
   66px circle, and stretched to 100% that circle became a full-width blue ellipse with the prompt inside it. */
body.hts-studio:not(.ex-active) #view .lg-audio {display:flex;flex-direction:column;align-items:center;gap:14px;width:100%;height:auto;min-width:0;margin:0;padding:0;background:none!important;box-shadow:none!important;border:0;border-radius:0;color:inherit;}
body.hts-studio:not(.ex-active) #view .lg-prompt {font-size:max(14px,calc(22px * var(--type-k)));line-height:1.35;letter-spacing:0;text-transform:none;width:auto;max-width:100%;}
body.hts-studio:not(.ex-active) #view .lg-tools {position:static;inset:auto;transform:none;display:flex;justify-content:center;gap:10px;margin:0;}
body.hts-studio:not(.ex-active) #view .lg-grid {width:100%;grid-auto-rows:1fr;}
@media(min-width:700px) {
 body.hts-studio:not(.ex-active) #view .qx__opts--tone {grid-template-columns:repeat(5,minmax(0,1fr));}
 body.hts-studio:not(.ex-active) #view .qx__opts--tone>.qx__opt {grid-column:auto!important;min-height:82px;}
}
/* SC2-5-A: short sheets retain every sentence and their real purchase controls. */
@media(max-width:379px) and (max-height:650px) {
 body.hts-studio .pw-r01 .pw-art {flex-basis:88px;height:88px;padding:8px 14px;}
 body.hts-studio .pw-r01 .pw-art-object {inset:18px 0 4px;}
 body.hts-studio .pw-r01 .pw-copy {padding:12px 16px 0;}
 body.hts-studio .pw-r01 .pw-copy>* {flex-shrink:0;}
 body.hts-studio .pw-r01 .pw-copy h1 {font-size:max(14px,calc(25px * var(--type-k)));line-height:1.15;}
 body.hts-studio .pw-r01 .pw-lead {font-size:max(13px,calc(14px * var(--type-k)));line-height:1.4;}
 body.hts-studio .pw-r01 .pw-actions {position:static;padding:10px 0;flex-shrink:0;}
 body.hts-studio .pw-r01 .pw-button {min-height:44px;padding:10px 12px;}
 body.hts-studio .pw-r01 .pw-actions .pw-text-button {min-height:44px;}
 body.hts-studio .pw-r01 .pw-close {width:44px;height:44px;}
 body.hts-studio .pw-r01 .pw-upgrade-hero {padding:8px 14px;gap:12px;}
 body.hts-studio .pw-r01 .pw-upgrade-hero .pw-graph {width:52px;height:52px;flex-basis:52px;}
 body.hts-studio .pw-r01 .pw-upgrade-layout {padding:8px;gap:8px;}
 body.hts-studio .pw-r01 .pw-purchase {padding:10px 12px;}
 body.hts-studio .pw-r01 .pw-purchase-description {margin-top:4px;font-size:13px;line-height:1.3;}
 body.hts-studio .pw-r01 .pw-purchase h2 {font-size:max(14px,calc(23px * var(--type-k)));}
 body.hts-studio .pw-r01 .pw-price-block {padding:6px 0;margin-bottom:6px;}
 body.hts-studio .pw-r01 .pw-price-eligibility {font-size:12px;margin-bottom:4px;}
 body.hts-studio .pw-r01 .pw-price>span {font-size:30px;}
 body.hts-studio .pw-r01 .pw-seal {height:28px;}
}
