/* Keep the practice controls within reach while reading the next step. */
.prayer-stage{overflow:clip;scroll-margin-top:100px}
.prayer-stage .step-controls{position:sticky;bottom:0;z-index:4;box-shadow:0 -12px 24px #092e3214}
.prayer-stage .stage-grid{touch-action:pan-y}
.focus-head{display:none}
body.studio-focus{overflow:hidden}
body.studio-focus #main:fullscreen{box-sizing:border-box;width:100vw;height:100dvh;max-width:none;padding:0;margin:0;background:var(--paper);overflow:hidden}
body.studio-focus .prayer-stage{position:fixed;inset:0;width:100%;height:100dvh;z-index:30;border:0;border-radius:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;background:var(--white)}
body.studio-focus .focus-head{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:58px;padding:10px 24px;border-bottom:1px solid var(--line);background:var(--white);color:var(--ink)}
body.studio-focus .focus-head>div{display:flex;align-items:center;gap:16px;min-width:0}
body.studio-focus .focus-head .eyebrow{margin:0;white-space:nowrap;color:var(--accent)}
body.studio-focus .focus-head strong{font-size:14px;white-space:nowrap}
body.studio-focus .focus-hint{font-size:13px;color:var(--muted);text-align:center}
body.studio-focus .focus-head .btn{padding:9px 13px;min-height:40px;font-size:13px;white-space:nowrap}
body.studio-focus .stage-grid{display:grid;height:100%;min-height:0;grid-template-columns:minmax(0,43%) minmax(0,57%);overflow:hidden}
body.studio-focus .stage-grid>.figure-pane,
body.studio-focus .stage-grid>.step-content{box-sizing:border-box;height:100%;min-height:0;max-height:none}
body.studio-focus .stage-grid>.figure-pane{grid-template-rows:24px minmax(0,1fr) 68px;padding:16px 20px}
body.studio-focus .stage-grid .pose{margin:0 0 5px;min-height:0;align-items:flex-end}
body.studio-focus .stage-grid .pose img{height:min(49dvh,430px);max-height:100%;width:auto;max-width:100%;object-fit:contain;object-position:center bottom}
body.studio-focus .stage-grid .scene-position{height:68px;padding:7px 0 0;gap:0}
body.studio-focus .stage-grid .scene-position:before{inset:0 -20px -16px}
body.studio-focus .stage-grid .scene-arabic{font-size:21px;line-height:1.4}
body.studio-focus .stage-grid .scene-orbit{bottom:84px}
body.studio-focus .stage-grid>.step-content{display:grid;grid-template-rows:min-content min-content min-content minmax(0,1fr);gap:clamp(8px,1.6dvh,17px);padding:clamp(16px,2.5vw,32px);overflow:hidden}
body.studio-focus .stage-grid .step-content>h2{font-size:clamp(25px,2.7vw,37px);line-height:1.14;max-width:none}
body.studio-focus .stage-grid .step-content>p{font-size:clamp(14px,1.15vw,17px);line-height:1.55;margin:0}
body.studio-focus .stage-grid .words-panel{padding-top:12px;overflow:hidden}
body.studio-focus .stage-grid .words-scroll{overflow-y:auto;overscroll-behavior:contain}
body.studio-focus .stage-grid .intention-note{min-height:0;align-self:stretch}
body.studio-focus .step-controls{position:relative;bottom:auto;z-index:4;padding:10px 24px calc(10px + env(safe-area-inset-bottom));min-height:62px;box-sizing:border-box}
body.studio-focus .step-controls .btn{min-height:42px}
body.studio-focus .prayer-stage.completion{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px;overflow:auto;padding:78px 20px 20px}
body.studio-focus .completion .focus-head{position:absolute;inset:0 0 auto}
@media(max-width:760px){
 .prayer-stage{scroll-margin-top:120px}
 body.studio-focus .focus-head{min-height:48px;padding:7px 14px}
 body.studio-focus .focus-head>div{display:block}
 body.studio-focus .focus-head .eyebrow{display:none}
 body.studio-focus .focus-head strong{font-size:13px}
 body.studio-focus .focus-hint{display:none}
 body.studio-focus .focus-head .btn{min-height:36px;padding:7px 10px;font-size:12px}
 body.studio-focus .stage-grid{grid-template-columns:1fr;grid-template-rows:minmax(150px,38%) minmax(0,1fr)}
 body.studio-focus .stage-grid>.figure-pane{height:100%;min-height:0;grid-template-rows:20px minmax(0,1fr) 46px;padding:8px 14px 0}
 body.studio-focus .stage-grid .pose{margin:0 0 3px;max-width:none}
 body.studio-focus .stage-grid .pose img{height:min(25dvh,190px);max-height:100%}
 body.studio-focus .scene-step-number{top:26px;right:18px;font-size:55px}
 body.studio-focus .stage-grid .scene-position{height:46px;padding:1px 0 0;gap:0;font-size:12px}
 body.studio-focus .stage-grid .scene-position:before{inset:0 -14px 0}
 body.studio-focus .stage-grid .scene-arabic{font-size:17px;line-height:1.35}
 body.studio-focus .stage-grid .scene-orbit{bottom:50px;height:22px}
 body.studio-focus .stage-grid>.step-content{height:100%;min-height:0;padding:11px 17px;gap:6px;grid-template-rows:min-content min-content min-content minmax(0,1fr)}
 body.studio-focus .stage-grid .step-meta{font-size:10px}
 body.studio-focus .stage-grid .step-content>h2{font-size:clamp(21px,5.5vw,27px)}
 body.studio-focus .stage-grid .step-content>p{font-size:13px;line-height:1.4}
 body.studio-focus .stage-grid .words-panel{padding-top:7px}
 body.studio-focus .stage-grid .words-label{font-size:10px}
 body.studio-focus .stage-grid .language-controls{display:flex;overflow-x:auto;gap:10px;white-space:nowrap;flex:none}
 body.studio-focus .stage-grid .language-controls button{font-size:12px;padding:6px 0;margin:0;flex:none}
 body.studio-focus .workspace .recitation .arabic{font-size:clamp(22px,6vw,28px);line-height:1.6}
 body.studio-focus .stage-grid .translit,body.studio-focus .stage-grid .translation{font-size:13px;line-height:1.5}
 body.studio-focus .stage-grid .intention-note{padding:10px}
 body.studio-focus .step-controls{padding:8px 12px calc(8px + env(safe-area-inset-bottom));min-height:58px;gap:7px}
 body.studio-focus .step-controls .btn{font-size:12px;min-height:40px;padding:8px 11px;white-space:nowrap}
 body.studio-focus .step-controls .jump-label{flex:1;min-width:0}
 body.studio-focus .step-controls #jump-step{font-size:11px;max-width:100%;width:100%;overflow:hidden;text-overflow:ellipsis}
}
@media(max-height:620px){
 body.studio-focus .focus-head{min-height:42px}
 body.studio-focus .stage-grid .pose img{height:min(25dvh,170px)}
 body.studio-focus .stage-grid .step-content>p{font-size:12px;line-height:1.3}
 body.studio-focus .stage-grid .step-content>h2{font-size:21px}
}

/* Put the main practice actions together, with a clear prayer chooser. */
.practice-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) auto auto auto;align-items:center;gap:12px;margin-bottom:14px}
.practice-toolbar .prayer-choice{display:grid;gap:5px;min-width:0;margin:0;color:var(--ink)}
.prayer-choice-label{font-size:10px;font-weight:700;letter-spacing:1.25px;color:var(--accent)}
.prayer-select{position:relative;display:block;min-width:0}
.practice-toolbar .prayer-select select{appearance:none;width:100%;min-height:46px;padding:10px 96px 10px 15px;border:1px solid var(--line);border-radius:10px;background:var(--white);color:var(--ink);font-size:15px;font-weight:700;cursor:pointer}
.prayer-select:focus-within select{outline:2px solid var(--accent);outline-offset:2px}
.prayer-select-cue{position:absolute;inset:0 12px 0 auto;display:flex;align-items:center;gap:6px;pointer-events:none;color:var(--accent);font-size:10px;font-weight:700;letter-spacing:1px}
.prayer-select-cue span{font-size:19px;line-height:1;transform:translateY(-2px)}
.practice-toolbar .unit-tabs{align-items:center;gap:3px;min-width:0}
.practice-toolbar .unit-tabs button{min-height:42px;white-space:nowrap}
.unit-caption{display:none}
.practice-toolbar .progress-ring{width:44px;height:44px;flex:none}
.practice-toolbar .studio-primary{display:flex;align-items:center;justify-content:center;gap:10px;min-height:46px;padding:10px 16px;border:1px solid var(--action);border-radius:10px;background:var(--action);color:var(--on-action);box-shadow:0 8px 22px color-mix(in srgb,var(--action) 24%,transparent);font-size:13px;font-weight:700;white-space:nowrap}
.practice-toolbar .studio-primary span:first-child{font-size:20px;line-height:1}
.practice-toolbar .studio-primary span:last-child{font-size:16px;opacity:.8}
/* Center both caption lines in the full colored band, including its bleed below the frame. */
.stage-grid .scene-position{box-sizing:border-box;justify-content:center;padding:24px 0 0;gap:2px}
body.studio-focus .stage-grid .scene-position{padding:16px 0 0}
/* Keep Arabic verse breaks readable without punctuation or blank separator rows. */
.workspace .recitation .arabic{line-height:1.7;padding-block:4px}
.workspace .recitation .arabic-phrase+.arabic-phrase{margin-top:.28em}
.step-controls #jump-step{padding-left:15px;padding-right:18px}
@media(max-width:760px){
 .practice-toolbar{grid-template-columns:minmax(0,1fr) auto;gap:10px 8px;margin-bottom:14px}
 .practice-toolbar .studio-primary{grid-column:1/-1;grid-row:1;width:100%;min-height:48px;font-size:14px}
 .practice-toolbar .prayer-choice{grid-column:1/-1;grid-row:2}
 .practice-toolbar .prayer-select select{min-height:46px;font-size:15px}
 .practice-toolbar .unit-tabs{grid-column:1;grid-row:3;gap:2px;min-width:0}
 .practice-toolbar .unit-tabs button{min-height:36px;min-width:32px;padding:4px}
 .practice-toolbar .unit-tabs button b{display:none}
 .unit-caption{display:block;margin-right:4px;color:var(--accent);font-size:10px;font-weight:700;letter-spacing:1px;white-space:nowrap}
 .practice-toolbar .progress-ring{grid-column:2;grid-row:3;display:flex;width:42px;height:42px;font-size:10px}
 .stage-grid .scene-position{padding:18px 0 0}
 body.studio-focus .stage-grid .scene-position{padding:0}
 .workspace .recitation .arabic{line-height:1.65}
 .step-controls #jump-step,body.studio-focus .step-controls #jump-step{padding-left:15px;padding-right:19px}
}
@media(max-width:760px){
 body:not(.studio-focus) .step-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:9px 12px calc(9px + env(safe-area-inset-bottom))}
 body:not(.studio-focus) .step-controls .jump-label{grid-column:1/-1;grid-row:1;width:100%;min-width:0}
 body:not(.studio-focus) .step-controls #jump-step{display:block;width:100%;max-width:none;min-height:39px;text-overflow:ellipsis}
 body:not(.studio-focus) .step-controls #prev{grid-column:1;grid-row:2;width:100%}
 body:not(.studio-focus) .step-controls #next{grid-column:2;grid-row:2;width:100%}
}
@media(max-width:420px){
 .workspace-top{display:grid;grid-template-columns:1fr;gap:8px;align-items:start}
 .workspace-top .select-label{display:flex;align-items:center;justify-content:space-between;gap:12px}
 .workspace-top #school{min-width:118px}
}
