/* Phone/tablet overrides only. Desktop course layout and all scoring remain intact. */
.mobile-nav-toggle,.mobile-guide-toggle{display:none}
@media(max-width:900px){
 html{height:auto!important;min-height:0!important;scroll-padding-block:12px}
 body,body.curriculum-view,body.typing-course-view,.hub-embedded body{height:auto!important;min-height:0!important;overflow:visible!important;-webkit-text-size-adjust:100%;text-size-adjust:100%}
 *,*::before,*::after{box-sizing:border-box}
 [hidden]{display:none!important}
 :root.hub-embedded header,:root.hub-embedded #language-workspace,:root.hub-embedded #typing-workspace,:root.hub-embedded #candidate-hub-workspace,:root.hub-embedded #entry-screen{display:none!important}
 /* Responsive display overrides must never reveal an inactive screen/control. */
 :root #language-workspace[hidden],:root #typing-workspace[hidden],:root #candidate-hub-workspace[hidden],:root #dialogue-audio-player[hidden],:root #dialogue-controls[hidden],:root #flash-options[hidden],:root #flash-form[hidden],:root #flashcard-panel[hidden],:root #revision-dialog:not([open]),:root #unit-access-dialog:not([open]),:root dialog:not([open]),.dialogue-controls[hidden],.preview-controls[hidden],.guidance-row[hidden]{display:none!important}
 button,a.primary,a.website-link,a.goal-action,.profile-disclosure>summary,summary{touch-action:manipulation;min-height:44px}
 input,select,textarea{font-size:max(16px,1em);max-width:100%;min-width:0}
 input:not([type=checkbox]):not([type=radio]),select{min-height:44px}
 input[type=checkbox],input[type=radio]{flex-shrink:0}
 button,a,summary{-webkit-tap-highlight-color:#69c8ff33}
 .workspace,#language-workspace,body.typing-course-view .workspace{display:flex!important;flex-direction:column;gap:12px!important;padding:12px!important;margin:0!important;width:100%;max-width:none;height:auto!important;min-height:0!important}
 .workspace .layout{display:block!important;margin:0!important;width:100%;min-width:0;height:auto!important;overflow:visible!important;padding:0!important}
 .workspace .lesson-sidebar{position:static!important;align-self:stretch;width:100%;height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important;padding:12px!important;display:block!important}
 .lesson-sidebar h1,#sidebar-title{font-size:18px!important;margin:0 0 5px!important;line-height:1.4!important}
 .lesson-sidebar>.sidebar-note{display:none}
 #back-to-units,#return-to-check{margin:0 0 8px!important;padding:9px 12px!important;min-height:44px}
 .mobile-nav-toggle,.mobile-guide-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px!important;padding:10px 12px!important;font-size:14px!important;text-align:left}
 .mobile-nav-toggle::after,.mobile-guide-toggle::after{content:'+';font-size:20px;line-height:1}
 .mobile-nav-toggle[aria-expanded=true]::after,.mobile-guide-toggle[aria-expanded=true]::after{content:'−'}
 .lesson-sidebar .lesson-menu[data-mobile-open=false]{display:none!important}
 .lesson-sidebar .lesson-menu[data-mobile-open=true]{display:flex!important;flex-direction:column;max-height:55vh!important;overflow-y:auto!important;margin:10px 0 0!important;scrollbar-gutter:stable}
 .lesson-sidebar[data-mobile-navigation=closed] .lesson-brief,.lesson-sidebar[data-mobile-navigation=closed] #saved-progress,.lesson-sidebar[data-mobile-navigation=closed] #typing-introduction{display:none!important}
 .lesson-sidebar .lesson-brief{padding:8px 0 0!important;margin:10px 0 0!important}
 .lesson-sidebar .lesson-brief button{min-height:44px;margin-top:8px}
 #training-balance{margin-top:12px!important;padding-top:0!important}
 .unit-selection-view .lesson-sidebar>.unit-selection-help,.unit-selection-view .lesson-sidebar>#sidebar-title,.unit-selection-view .lesson-sidebar>.sidebar-note{display:none!important}
 .unit-selection-view .lesson-sidebar{display:flex!important;flex-direction:row!important;gap:12px;align-items:center;padding:10px!important}
 .unit-selection-view .mobile-nav-toggle{display:none!important}
 .unit-selection-view #back-to-units{flex:1;margin:0!important;width:auto;min-width:0;font-size:13px!important}
 .unit-selection-view #training-balance{flex:0 1 142px;margin:0!important;min-width:105px}
 .unit-selection-view #training-balance .sidebar-xp-note{display:none}
 .unit-access-home{width:100%;min-width:0;padding:16px!important}
 .unit-access-grid,.access-unit-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 .unit-access-card{min-width:0;padding:14px!important}
 .unit-access-card h3{font-size:17px;line-height:1.45}
 .unit-access-card .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .workspace .practice-panel{display:flex;flex-direction:column;width:100%;min-width:0;height:auto!important;min-height:0!important;padding:14px!important;overflow:visible!important;gap:12px}
 .steps,#drill-steps,#drill-steps:has(button:nth-child(6)):not(:has(button:nth-child(7))){display:flex!important;flex-wrap:nowrap!important;gap:8px!important;width:100%;max-width:100%;overflow-x:auto!important;overflow-y:hidden;padding:3px 2px 8px!important;margin:0!important;scroll-snap-type:x proximity;scrollbar-width:thin}
 .steps .drill-choice,#drill-steps button{flex:0 0 142px!important;min-width:142px!important;min-height:48px!important;max-width:none;padding:8px!important;font-size:13px!important;line-height:1.35;white-space:normal!important;scroll-snap-align:center}
 .drill-heading{display:flex!important;flex-wrap:wrap;gap:10px!important;align-items:flex-start}
 .drill-heading h2{font-size:22px!important;line-height:1.4;overflow-wrap:anywhere}
 .drill-heading .eyebrow{font-size:11px!important;margin-bottom:4px}
 .text-size-controls,.sound-option{max-width:100%;min-width:0;min-height:44px;gap:8px!important}
 .text-size-controls button{min-width:44px!important;min-height:44px!important;padding:6px!important}
 .text-size-controls{font-size:13px!important;padding:6px 8px!important}
 .sound-option{font-size:13px!important;padding:6px 8px!important}
 #description,.preview-note{font-size:14px!important;line-height:1.6}
 .preview-controls,.dialogue-controls{display:flex!important;flex-wrap:wrap!important;gap:8px!important;min-width:0}
 .preview-controls>*,.dialogue-controls>*{min-width:0;max-width:100%}
 .preview-controls .toggle-row{display:grid!important;grid-template-columns:1fr!important;width:100%;gap:8px}
 #dialogue-audio-player{display:flex!important;flex-wrap:wrap!important;gap:8px!important;width:100%;max-width:100%}
 audio{width:100%;max-width:100%;min-width:0}
 .guidance-row[data-mobile-open=false]{display:none!important}
 .guidance-row[data-mobile-open=true]{display:block!important;padding:10px 0}
 .flash-mode .mobile-guide-toggle,.audio-only .mobile-guide-toggle{display:none!important}
 .hand-guidance{display:none!important}
 .row{gap:2px!important}.key{height:38px!important;font-size:18px!important;border-radius:4px;min-width:0}
 .key small,.key-mark,.key-vowel{display:none!important}
 .key.space,.shift-key{height:30px!important;font-size:10px!important}
 .keyboard-note{font-size:12px!important}
 .practice-area{width:100%;height:auto!important;min-height:0!important;max-height:none!important;flex:none!important;overflow:visible!important;cursor:auto}
 .practice-topline{padding:10px!important;gap:8px;align-items:center;flex-wrap:wrap}
 .practice-label{font-size:13px!important;line-height:1.4!important}
 .next-letter-guide{font-size:12px!important;gap:5px}
 .next-letter-guide bdi{min-width:32px;font-size:25px}
 .practice-area .target,.practice-area .target.dialogue-target{min-height:90px!important;max-height:340px!important;height:auto!important;overflow:auto!important;padding:10px 12px!important;font-size:calc(29px * var(--typing-font-scale,1))!important;line-height:1.9!important;opacity:1!important;filter:none!important}
 .practice-area .start-overlay{display:none!important}
 .typing-capture,#input.typing-capture{position:relative!important;inset:auto!important;display:block!important;width:calc(100% - 16px)!important;height:96px;min-height:96px!important;max-height:180px!important;opacity:1!important;clip-path:none!important;overflow:auto!important;resize:vertical;margin:0 8px 8px!important;padding:10px 12px!important;border:2px solid #499bd2!important;border-radius:10px!important;background:#061b30!important;color:#f4f8ff!important;caret-color:#fff;font:calc(26px * var(--typing-font-scale,1))/1.75 Arial,sans-serif!important;scroll-margin-block:14px}
 .typing-capture::placeholder{font:16px/1.6 system-ui!important;color:#aac6df!important;direction:ltr;text-align:left}
 .typing-capture:focus{border-color:#b590f4!important;outline:2px solid #b590f444!important}
 .practice-area .target .dialogue-turn{gap:8px;align-items:baseline}
 .target .dialogue-speaker{font-size:18px!important;max-width:30%}
 .flashcard-panel,.extended-round,.revision-question{padding:14px!important;min-width:0;min-height:0!important}
 .practice-panel.flash-mode{min-height:0!important}
 .flash-prompt{font-size:23px!important;line-height:1.5!important;margin:16px 0 10px!important}
 .flash-options,#flash-options,.revision-choices{grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
 .flash-options button,.revision-choices button{min-height:64px!important;font-size:25px!important;padding:12px!important}
 #flash-options button{padding-left:44px!important}
 #flash-form{grid-template-columns:minmax(0,1fr)!important}
 .flash-actions,.revision-actions,.actions{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
 .flash-actions button,.revision-actions button,.actions button{min-height:44px!important;white-space:normal!important;max-width:100%}
 .bottom-bar{flex-wrap:wrap;width:100%;gap:12px!important;padding-top:12px!important}
 .bottom-bar .stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px 8px!important;width:100%;margin:0!important;min-width:0}
 .stat strong{font-size:20px!important}.stat span{font-size:11px!important}
 .bottom-bar .actions{display:flex!important;width:100%;margin:0!important;gap:8px}
 .bottom-bar .actions button{flex:1 1 100px!important;min-width:0!important;font-size:13px!important;padding:10px 8px!important}
 #typing-workspace,#candidate-hub-workspace{height:auto!important;min-height:0!important;max-width:100%;width:100%;margin:0!important;padding:0!important;overflow:visible!important}
 #typing-frame,#candidate-hub-frame,#hub-revision-frame{display:block;width:100%!important;min-height:0!important;max-height:none!important;border:0!important;margin:0!important;overflow:visible}
 dialog:not(.mobile-inline-dialog){position:fixed!important;inset:8px 8px auto!important;margin:0 auto!important;width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;max-height:calc(var(--mobile-screen-height,100dvh) - 16px)!important;min-height:0!important;padding:16px!important;overflow:auto!important;overscroll-behavior-y:contain;scrollbar-gutter:auto!important}
 dialog h2{font-size:22px!important;line-height:1.4}
 .dialog-head,.revision-heading,.translation-heading,.leaderboards-view-heading{display:flex;flex-wrap:wrap!important;gap:10px!important;align-items:flex-start!important}
 dialog input:not([type=checkbox]):not([type=radio]),dialog select{width:100%;min-height:46px;font-size:16px!important}
 .profile-field-grid,.revision-unit-grid,.unitgate-score-grid,.check-parts{grid-template-columns:minmax(0,1fr)!important}
 .profile-footer{position:static!important;flex-wrap:wrap}
 .profile-footer button{flex:1 1 120px}
 #revision-body,.revision-heading{padding:14px!important}
 .revision-question h3{font-size:21px!important}.revision-instruction{font-size:14px!important;line-height:1.6}
 .revision-options{gap:8px}.revision-options>label{flex-basis:100%;min-height:48px;font-size:13px}
 .revision-session-top{gap:8px}.revision-session-top button{min-height:44px}
 .revision-gap{font-size:26px!important;padding:10px!important}
 .revision-gap-input,.revision-gap-ghost{max-width:100%;min-width:3.5em;font-size:26px!important}
 .translation-columns{grid-template-columns:minmax(0,1fr)!important;gap:14px}
 .translation-columns textarea{min-height:130px!important;height:160px!important;padding:12px!important}
 .translation-toolbar{gap:8px;margin:12px 0}.translation-toolbar select{flex:1 1 160px!important}
 .translation-toolbar button{min-width:44px}
 .leaderboard-panel{padding:12px!important}.leaderboard-scroll{max-width:100%;overflow:auto}
 .leaderboard-tabs{gap:6px}.leaderboard-tabs button{flex:1;min-height:44px;font-size:12px!important;padding:8px 6px!important}
 .leaderboard-toolbar label{flex-wrap:wrap;width:100%}.leaderboard-toolbar select{width:100%;min-width:0}
 .leaderboard-table{font-size:13px;table-layout:fixed}.leaderboard-table td,.leaderboard-table th{padding:10px 5px!important;white-space:normal!important;overflow-wrap:anywhere;font-size:12px!important}
 .leaderboard-table th:first-child,.leaderboard-table td:first-child{width:36px!important;min-width:36px!important}.leaderboard-table th:nth-child(2){width:38%!important}
 .leaderboard-drill-picker{display:block}.leaderboard-drill-picker select{width:100%;margin-top:6px}
 .hub-embedded #revision-dialog,.hub-embedded #unit-access-dialog,dialog.mobile-inline-dialog{position:relative!important;inset:auto!important;display:block!important;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important;padding:0!important;overflow:visible!important;box-shadow:none!important}
 .hub-embedded .revision-unit-grid{grid-template-columns:minmax(0,1fr)!important}
 .hub-embedded dialog::backdrop{background:transparent!important;backdrop-filter:none!important}
 /* Hub is one readable column rather than several tiny nested panels. */
 body:has(.hub-tabs)>main{width:100%;max-width:100%;margin:0!important;padding:14px!important}
 .hub-tabs{display:flex;flex-wrap:nowrap!important;gap:6px!important;overflow-x:auto;margin:8px 0 18px!important;padding:3px 0 6px}
 .hub-tabs button{flex:0 0 auto!important;min-height:44px;font-size:12px!important;padding:9px 11px!important;white-space:nowrap}
 .demo-note{padding:12px!important;gap:9px!important;font-size:13px!important}
 .demo-note>span{display:none}.welcome{display:block!important;padding:22px 0!important}
 .welcome h1{font-size:32px!important;line-height:1.2;letter-spacing:-.5px!important}
 .welcome-action{width:100%;margin-top:18px}.welcome-action select,.welcome-action button{width:100%;min-height:46px}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 .stats article{min-width:0;padding:12px 10px!important}.stats strong{font-size:23px!important}.stats p{font-size:12px!important}.stats div>span{font-size:11px!important}
 .dashboard-grid,.dashboard,.main-grid,.content-grid{display:block!important;grid-template-columns:minmax(0,1fr)!important}
 .panel{max-width:100%;min-width:0}.goal{flex-wrap:wrap;gap:10px;padding:16px 0!important}.goal-copy{flex:1 1 170px;min-width:0}
 .goal .goal-action,.goal>button{margin-left:42px!important;min-height:44px;font-size:13px!important}
 .goal-icon{width:30px!important;height:30px!important;flex:0 0 30px}
 .goal-copy h3{font-size:15px!important}.goal-copy p{font-size:13px!important;line-height:1.5}
 .league .tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px!important}.league .tabs button{padding:8px 4px!important;font-size:12px!important;min-height:44px}
 .ranking li{gap:9px;padding:12px 8px!important;font-size:13px!important}.ranking .ranking-score{font-size:13px}
 .hub-revision{padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important}
 .hub-revision .section-head{padding:0 0 14px}.hub-revision iframe{margin-top:8px!important}
 #candidate-notice{font-size:11px!important;line-height:1.4;padding:6px 12px!important}
 .entry-screen{margin:0;padding:12px;max-width:100%}.entry-screen .panel{padding:16px!important}.entry-screen h1{font-size:24px!important}
}
@media(max-width:360px){
 .header-main .header-utilities{gap:4px!important}.header-utilities button,.header-utilities .profile-disclosure>summary{font-size:11px!important;padding:6px 2px!important}
 .workspace,#language-workspace,body.typing-course-view .workspace{padding:8px!important}.workspace .practice-panel{padding:10px!important}
 .unit-selection-view #training-balance{flex-basis:115px}.unit-selection-view #training-balance small{font-size:9px}
 .stats article .stat-icon{display:none}.league .tabs button{font-size:11px!important}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}

/* v5: a compact shared shell, visible native inputs and one page scroll. */
.mobile-menu-toggle,.mobile-story-toggle{display:none}
@media(max-width:900px){
 :root{--mobile-space:12px;scroll-padding-top:12px;scroll-padding-bottom:24px}
 body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);-webkit-text-size-adjust:100%}
 header{position:static!important;height:auto!important;min-height:0!important;padding:6px 10px 0!important;gap:4px!important}
 .header-main{display:flex!important;flex-wrap:wrap!important;align-items:center;gap:8px!important;width:100%;min-width:0}
 .header-main .brand.brand-logo{flex:0 1 178px!important;width:178px!important;height:48px!important;max-width:calc(100% - 88px)!important;margin:0 auto 0 0!important;overflow:hidden}
 .header-main .brand.brand-logo img{width:178px!important;height:auto!important;max-width:none!important;left:0!important;top:-12px!important}
 .mobile-menu-toggle{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;min-width:76px;padding:8px 12px;font:600 14px/1.2 Arial,sans-serif}
 .mobile-menu-toggle::after{content:'☰';font-size:18px}.mobile-menu-toggle[aria-expanded=true]::after{content:'×'}
 .header-main .header-utilities{display:none!important;order:5;width:100%;min-width:0;margin:0!important;padding:8px 0;gap:8px!important;grid-template-columns:repeat(2,minmax(0,1fr))}
 .header-main .header-utilities[data-mobile-open=true]{display:grid!important}
 .header-utilities>button,.header-utilities>.profile-disclosure{width:100%;min-width:0;max-width:100%;margin:0!important}
 .header-utilities button,.header-utilities .profile-disclosure>summary{display:flex;justify-content:center;align-items:center;min-height:46px;font-size:14px!important;line-height:1.3;padding:9px!important;white-space:normal;text-align:center}
 .profile-dropdown{position:absolute!important;right:0!important;left:auto!important;width:min(320px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px);z-index:90}
 .profile-dropdown button{width:100%;display:flex;align-items:flex-start;flex-direction:column;padding:12px!important;text-align:left;font-size:15px!important}
 .profile-dropdown button small{display:block;white-space:normal;line-height:1.5;text-align:left}
 .course-menu{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px!important;padding:4px 0 8px;margin:0!important;width:100%;min-width:0}
 .course-menu button{flex:none!important;width:100%;min-width:0!important;max-width:none!important;min-height:48px;padding:7px 3px!important;margin:0!important;line-height:1.2!important;font-size:13px!important;white-space:normal!important;letter-spacing:0}
 .course-menu .reading-status{font-size:9px!important;margin-top:3px;line-height:1.15}.course-menu .note{display:none!important}
 #story-workspace{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;min-width:0}
 #story-frame{display:block!important;width:100%!important;max-width:100%;min-height:0!important;border:0;overflow:visible}
 #story-workspace[hidden],#story-frame[hidden]{display:none!important}
 .story-embedded main{display:flex;flex-direction:column;gap:12px;max-width:100%;padding:12px;margin:0;min-width:0}
 .story-embedded aside,.story-embedded .workspace{position:static!important;width:100%;height:auto!important;min-width:0;max-height:none!important;overflow:visible!important;align-self:stretch;padding:14px!important}
 .story-embedded aside{order:0}.story-embedded .workspace{order:1;display:block!important;margin:0!important}
 .mobile-story-toggle{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;min-height:46px;padding:10px 12px;text-align:left;line-height:1.35;font-size:14px}
 .mobile-story-toggle::after{content:'+'}.mobile-story-toggle[aria-expanded=true]::after{content:'−'}
 .story-embedded aside[data-mobile-open=false]>:not(.mobile-story-toggle):not(.scene-progress):not(.back-link){display:none!important}
 .story-embedded aside[data-mobile-open=true]{max-height:65dvh!important;overflow-y:auto!important;overscroll-behavior:contain}
 .story-embedded aside .scene-progress{border:0;padding:0;margin-top:10px}.story-embedded aside .scene-progress>strong,.story-embedded aside .scene-progress .muted{display:none}
 .story-embedded aside .scene-progress p{margin:4px 0 0;font-size:12px}.story-embedded aside .scene-progress progress{margin:5px 0 0}
 .story-embedded .chapter-switch{margin-top:16px;grid-template-columns:1fr 1fr}.story-embedded .chapter-switch a{padding:10px!important;min-height:58px}
 .story-embedded .scene-list{padding:0;margin:12px 0}.story-embedded .scene-list a,.story-embedded .whole-story-link[data-full-story]{min-height:52px;padding:10px!important}
 .story-embedded .back-link{margin-top:14px}.story-embedded .whole-story-link{min-height:48px;padding:10px!important}
 .story-embedded .scene-heading{display:block}.story-embedded .scene-heading h2{font-size:23px;line-height:1.35;margin-bottom:8px}.story-embedded .scene-heading .muted{font-size:14px;line-height:1.6}.story-embedded .no-audio{display:none}
 .story-embedded .activity-tabs{display:flex;flex-wrap:nowrap;gap:7px;overflow-x:auto;scroll-snap-type:x proximity;padding:3px 1px 10px;margin:12px 0}
 .story-embedded .activity-tabs button{flex:0 0 130px;min-width:130px;min-height:48px;padding:8px;font-size:13px;line-height:1.35;scroll-snap-align:center}
 .story-embedded .display-tools{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding-bottom:12px;font-size:12px}
 .story-embedded .display-tools>label{padding:9px!important;min-height:48px;line-height:1.35;min-width:0}.story-embedded .text-size{grid-column:1/-1}
 .story-embedded .arabic{font-size:clamp(25px,var(--arabic-size),36px);line-height:2.05}.story-embedded .reading-title{font-size:25px;margin:18px 0}
 .story-embedded .sentence-pair{padding:14px 0}.story-embedded .sentence-english{font-size:15px;line-height:1.7;margin-top:10px}
 .story-embedded .continuous-story{padding:10px 14px}.story-embedded .word-gloss{font-size:12px;line-height:1.45;max-width:110px}
 .story-embedded .narration-panel{padding:12px;margin:12px 0}.story-embedded .narration-heading{gap:8px;align-items:flex-start}.story-embedded .narration-heading span{max-width:55%;font-size:11px;text-align:right}
 .story-embedded .narration-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .story-embedded .narration-controls button{min-height:44px;min-width:0;padding:8px!important;font-size:12px!important;line-height:1.3}
 .story-embedded .narration-controls label{display:flex;flex-direction:column;align-items:stretch;gap:5px;font-size:12px;min-width:0}
 .story-embedded .narration-controls select{max-width:100%;width:100%;font-size:16px;min-height:44px;padding:6px}
 .story-embedded .narration-controls label:has(#narration-voice){grid-column:span 2}
 .story-embedded .narration-controls .narration-autoplay-toggle{flex-direction:row;align-items:center;justify-content:space-between;min-height:44px;grid-column:span 2}
 .story-embedded #track-label{grid-column:span 2}.story-embedded .narration-panel .tip{font-size:12px;line-height:1.5}
 .story-embedded .story-typing-surface{overflow:visible}.story-embedded #typing-ghost{max-height:clamp(100px,calc(var(--mobile-screen-height,100svh)*.3),260px);overflow-y:auto;padding:10px 12px;overscroll-behavior:contain}
 .story-embedded #story-input.story-capture{position:relative!important;inset:auto!important;display:block!important;opacity:1!important;clip-path:none!important;width:calc(100% - 16px)!important;height:140px!important;min-height:120px!important;max-height:220px!important;padding:12px!important;margin:8px!important;border:2px solid #499bd2!important;border-radius:10px!important;color:#f0f7ff!important;caret-color:#fff;background:#061b30!important;resize:vertical;overflow:auto;font:27px/1.85 Arial,sans-serif!important;direction:rtl}
 .story-embedded #story-input:focus{outline:2px solid #bf9cf3;outline-offset:2px}
 .mobile-input-note{font:13px/1.6 system-ui;color:#b7d6ed;margin:8px 0 0}
 .story-embedded .listening-input{min-height:160px;height:200px;font-size:27px;padding:12px;line-height:1.85}
 .story-embedded .activity-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.story-embedded .activity-actions button{flex:1 1 120px;min-height:46px;font-size:14px;padding:10px!important;white-space:normal}
 .story-embedded .quiz-choices{grid-template-columns:1fr!important}.story-embedded .quiz-choices button{font-size:17px;min-height:54px;padding:12px;line-height:1.6}
 .story-embedded .gap-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px;max-width:100%}.story-embedded .gap-input{min-width:80px;max-width:100%;width:7em;font-size:26px}
 .story-embedded .card-face{padding:20px 12px;min-height:180px}.story-embedded .card-face h3{font-size:21px;line-height:1.6}
 .story-embedded .context{font-size:14px}.story-embedded .context summary{min-height:44px;display:flex;align-items:center}.story-embedded footer{font-size:12px}
 .mobile-guide-toggle{margin:8px 0}.mobile-guide-toggle[hidden]{display:none!important}
 #story-keyboard[data-mobile-open=false]{display:none!important}#story-keyboard[data-mobile-open=true]{display:block!important}
 .mobile-table-scroll{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;padding-bottom:6px}
 #leaderboards-dialog .mobile-table-scroll table{min-width:510px;width:100%;font-size:14px}.mobile-table-scroll:focus-visible{outline:2px solid #a8dfff;outline-offset:2px}
 .bottom-bar .stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}.dashboard .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 button:not(.translation-arabic),a.goal-action,a.website-link,summary{min-height:44px}
 .translation-arabic{touch-action:manipulation}textarea{scroll-margin-block:16px;resize:vertical}
 :focus-visible{outline:3px solid #bfa2fa;outline-offset:3px}
 [dir=rtl]{text-align:right}bdi{unicode-bidi:isolate}
}
@media(max-width:360px){.course-menu button{font-size:12px!important}.story-embedded .display-tools{grid-template-columns:1fr}.story-embedded .narration-controls{gap:6px}.story-embedded .workspace{padding:11px!important}.story-embedded .arabic{font-size:26px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Keep optional controls out of the learner’s way without changing their values. */
.mobile-options-toggle,.mobile-input-note{display:none}
@media(max-width:900px){
 .header-main>.mobile-menu-toggle{flex:0 0 76px!important;width:76px!important;max-width:76px!important;min-width:76px!important}
 .mobile-options-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:10px 12px;font-size:14px;text-align:left;order:3}
 .mobile-options-toggle::after{content:'+';font-size:20px}.mobile-options-toggle[aria-expanded=true]::after{content:'−'}
 .mobile-options-toggle[hidden]{display:none!important}
 .preview-controls[data-mobile-open=false],.display-tools[data-mobile-open=false]{display:none!important}
 .preview-controls .toggle-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .preview-controls .toggle-row label{min-width:0;min-height:48px;padding:8px!important;font-size:12px!important;line-height:1.4;gap:6px!important}
 .practice-panel>.mobile-guide-toggle{order:5;margin:0}
 .mobile-input-note{display:block;padding:0 12px;font-size:12px;line-height:1.5;color:#b7d6ed;margin:4px 0 8px;flex:none}
 .practice-area .target{max-height:clamp(100px,calc(var(--mobile-screen-height,100svh)*.35),300px)!important}
}
@media(max-width:900px){
 .drill-heading .practice-tools{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;width:100%;margin:0!important}
 .drill-heading .practice-font-controls{display:flex!important;gap:4px!important;padding:4px!important;min-width:0;font-size:11px!important;justify-content:space-between}
 .drill-heading .practice-sound-toggle{padding:6px!important;min-width:0;gap:5px!important;font-size:11px!important;line-height:1.3}
 .practice-sound-toggle input{flex:none}
 #dialogue-audio-player{display:block!important;padding:10px!important}
 #dialogue-audio-player .audio-player-buttons{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px!important;width:100%}
 #dialogue-audio-player .audio-player-buttons button{min-width:0!important;width:100%;min-height:44px;padding:5px!important;font-size:12px!important;white-space:normal}
 #dialogue-audio-player .audio-autoplay-toggle{grid-column:span 2;display:flex;justify-content:space-between;gap:6px;min-width:0;margin:0!important;padding:4px!important;font-size:12px!important}
 #dialogue-audio-player .audio-autoplay-toggle select{font-size:16px!important;min-width:0;max-width:82px;padding:4px!important}
 #dialogue-audio-player .audio-player-timeline{width:100%;margin-top:4px}
 input[type=range],#audio-seek,#narration-seek{appearance:auto!important;-webkit-appearance:auto!important;width:100%!important;height:44px!important;min-height:44px!important;max-height:44px!important;border:0!important;padding:0!important;margin:0!important;background:transparent!important;box-shadow:none!important;accent-color:#25b7ef}
 input[type=range]::-webkit-slider-runnable-track{height:5px!important;background:#204866!important;border:0!important}
 input[type=range]::-webkit-slider-thumb{margin-top:-5px!important}
 .audio-player-times{font-size:12px!important}
}
@media(max-width:900px){
 .header-main>.mobile-menu-toggle{padding:6px!important;gap:5px!important;font-size:13px!important;white-space:nowrap!important;overflow-wrap:normal!important}
 .story-embedded .scene-heading .muted,.story-embedded .progression-note,.story-embedded #control-note{display:none!important}
 .story-embedded .scene-heading h2{margin-bottom:0!important}
 .story-embedded .workspace{padding:12px!important}
 .story-embedded .activity-tabs{margin:10px 0}
}
@media(max-width:900px){
 body:has(>dialog[open]:not(.mobile-inline-dialog)){overflow:hidden!important}
 .translation-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
 .translation-toolbar label{flex:1 1 100%!important;min-width:0;display:flex;gap:8px;align-items:center}
 .translation-toolbar label select{flex:1;min-width:0}
 body:has(.hub-tabs) a[href='./?profile=1']{display:inline-flex;align-items:center;min-height:44px;padding:8px 12px;border:1px solid #4fa6d8;border-radius:10px;background:#123755;font-size:14px;text-decoration:none}
}

/* Final phone review: compact navigation, complete audio rows and Hub options. */
@media(max-width:900px){
 body.typing-course-view .lesson-sidebar{display:grid!important;grid-template-columns:118px minmax(0,1fr);gap:8px;align-items:start}
 body.typing-course-view .lesson-sidebar>#section-title{display:none!important}
 body.typing-course-view .lesson-sidebar>#return-to-check{grid-column:1;min-height:48px;margin:0!important;font-size:12px!important;line-height:1.3;padding:8px!important}
 body.typing-course-view .lesson-sidebar>.mobile-nav-toggle{grid-column:2;min-height:48px!important;margin:0!important;font-size:13px!important;padding:8px!important;line-height:1.35}
 body.typing-course-view .lesson-sidebar>.lesson-menu,body.typing-course-view .lesson-sidebar>#saved-progress,body.typing-course-view .lesson-sidebar>#training-balance{grid-column:1/-1}
 body.typing-course-view .lesson-sidebar>#training-balance{margin-top:4px!important}
 .story-embedded .narration-controls{grid-template-columns:repeat(4,minmax(0,1fr))}
 #narration-back{order:1}#play-narration{order:2}#narration-forward{order:3}#narration-loop{order:4}
 .story-embedded .narration-controls label:has(#narration-voice){order:5;grid-column:span 2}
 .story-embedded .narration-controls label:has(#narration-speed){order:6;grid-column:span 2}
 #restart-narration{order:7;grid-column:span 2}
 .story-embedded .narration-controls .narration-autoplay-toggle{order:8;grid-column:span 2}
 .story-embedded #track-label{order:9;grid-column:1/-1}
 .story-embedded .narration-heading span,.story-embedded .narration-panel>.tip{display:none!important}
 .story-embedded .narration-controls button{font-size:11px!important;padding:5px!important}
 .story-embedded #narration-loop{white-space:nowrap}
 .demo-note[data-mobile-open=false],.revision-options[data-mobile-open=false]{display:none!important}
 .hub-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible!important;gap:6px!important;margin:10px 0 12px!important}
 .hub-tabs button{min-width:0!important;width:100%;white-space:normal!important;line-height:1.35;min-height:52px!important;padding:8px 4px!important}
 .candidate-practice-shortcut{margin:0 0 8px!important}
 .welcome{padding:14px 0!important}.welcome h1{font-size:27px!important;line-height:1.3!important;margin:8px 0!important}
 .welcome>div>p{font-size:14px!important;line-height:1.6!important}.welcome-action{margin-top:12px!important}
}

/* Audio transport symbols apply on desktop and mobile; names remain accessible. */
#dialogue-audio-player #audio-toggle,.story-embedded .narration-controls #play-narration,#play-narration{font-family:Arial,"Segoe UI Symbol",sans-serif!important;font-size:22px!important;line-height:1!important;min-width:44px;min-height:44px;text-align:center}

/* Post-release preview polish; saved preferences and practice logic untouched. */
@media(min-width:901px){
 body.typing-course-view #drill-steps:has(button:nth-child(6)):not(:has(button:nth-child(7))){display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:6px!important}
 body.typing-course-view #drill-steps:has(button:nth-child(6)):not(:has(button:nth-child(7))) button{min-width:0!important;padding:7px!important;font-size:13px!important}
 body.typing-course-view .guidance-row .key{height:32px!important;font-size:20px!important}
 body.typing-course-view .guidance-row .key.space{height:24px!important}
 body.typing-course-view .guidance-row .keyboard-note{font-size:12px!important;margin:3px 0!important}
 body.typing-course-view .guidance-row .hands svg{height:72px!important}
 body.typing-course-view .practice-panel{gap:8px!important;padding:14px 18px!important}
 .story-embedded .workspace{padding:16px!important}
 .story-embedded .scene-heading h2{margin:4px 0!important}
 .story-embedded .scene-heading .muted,.story-embedded .progression-note,.story-embedded #control-note{display:none!important}
 .story-embedded .activity-tabs{margin:12px 0!important;gap:6px!important}
 .story-embedded .activity-tabs button{padding:8px!important;min-height:40px!important}
 .story-embedded .display-tools{gap:6px 10px!important;margin:8px 0!important}
 .story-embedded .display-tools label{padding:6px 10px!important;min-height:36px!important}
 .story-embedded .narration-panel{padding:10px 12px!important;margin:10px 0!important}
 .story-embedded .narration-panel>.tip{margin:4px 0!important}
}
@media(max-width:900px){
 .story-embedded .narration-controls .narration-autoplay-toggle{min-height:36px!important}
 .story-embedded .narration-panel{padding:10px!important;margin:10px 0!important}
 .story-embedded .story-typing-surface{min-height:0!important;margin:10px 0!important}
 .story-embedded #typing-ghost{max-height:clamp(90px,calc(var(--mobile-screen-height,100svh)*.22),180px)!important}
 .story-embedded #story-input.story-capture{height:110px!important;min-height:100px!important}
 .story-embedded #activity>h3{margin:10px 0!important}
 #leaderboards-dialog .leaderboard-table th:first-child,#leaderboards-dialog .leaderboard-table td:first-child{width:48px!important;min-width:48px!important;white-space:nowrap!important;overflow-wrap:normal!important}
}

@media(min-width:901px){
 body.typing-course-view .mobile-guide-toggle{display:flex;align-items:center;justify-content:space-between;min-height:36px;padding:6px 12px;text-align:left;font-size:13px;margin:0}
 body.typing-course-view .mobile-guide-toggle::after{content:'+'}
 body.typing-course-view .mobile-guide-toggle[aria-expanded=true]::after{content:'−'}
 body.typing-course-view .guidance-row[data-mobile-open=false]{display:none!important}
}

@media(min-width:1200px){
 .story-embedded .activity-tabs{grid-template-columns:repeat(5,minmax(0,1fr))!important}
 .story-embedded .activity-tabs [data-tab=audio]{grid-column:auto!important}
 .story-embedded .display-tools{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 .story-embedded .display-tools .text-size{grid-column:auto!important;justify-content:flex-end!important}
}

/* Embedded story canvas must use the course background, never the browser canvas. */
html.story-embedded{background:#04152a!important}
.story-embedded body{background:radial-gradient(ellipse at 50% 0,#123459 0,transparent 60%),#04152a!important}
#story-workspace,#story-frame{background:#04152a}
@media(min-width:901px){
 /* One document scroll container allows sticky navigation to follow the practice column. */
 body.typing-course-view{height:auto!important;min-height:100dvh;overflow:visible!important}
 body.typing-course-view main.workspace{height:auto!important;grid-template-rows:auto!important;align-items:start!important}
 body.typing-course-view main.workspace>.layout{height:auto!important;min-height:0;overflow:visible!important}
 body.typing-course-view main.workspace>.lesson-sidebar{position:sticky!important;top:16px!important;align-self:start!important;height:calc(100dvh - 32px)!important;max-height:calc(100dvh - 32px)!important;min-height:0;display:flex!important;flex-direction:column;overflow:hidden!important}
 body.typing-course-view .lesson-sidebar>.lesson-menu{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain}
}

/* Story options occupy the former narration badge; values remain unchanged. */
.story-embedded .story-options-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;width:auto;min-height:42px;padding:8px 12px;font-size:13px;align-self:start;flex-shrink:0}
.story-embedded .story-options-toggle::after{content:'+';font-size:19px}
.story-embedded .story-options-toggle[aria-expanded=true]::after{content:'−'}
.story-embedded .display-tools[data-mobile-open=false]{display:none!important}
.story-embedded .display-tools[data-mobile-open=true]{display:grid!important}
.story-embedded .no-audio[hidden]{display:none!important}
/* High contrast insertion marker, also present in the existing Arabic/typing models. */
#typing-ghost .current-letter,#target .current,.input-ghost .current,.input-ghost .current-letter{border-inline-start:3px solid #f3ecff!important;border-right:0;box-shadow:2px 0 #291442;opacity:1!important}
.story-typing-surface:focus-within .current-letter,.practice-area:focus-within #target .current{animation:typing-caret 1.1s steps(1,end) infinite}
textarea,input:not([type=checkbox]):not([type=radio]){caret-color:#f3ecff}
@keyframes typing-caret{50%{border-inline-start-color:transparent}}
@media(max-width:900px){.story-embedded .scene-heading{flex-wrap:wrap;gap:8px}.story-embedded .story-options-toggle{width:auto!important;margin:0 0 4px!important;font-size:12px}}
@media(prefers-reduced-motion:reduce){.story-typing-surface .current-letter,.practice-area #target .current{animation:none!important}}

/* Compact persistent Story transport; all advanced controls keep their existing handlers. */
.story-embedded #narration-panel{position:sticky!important;top:var(--narration-sticky-top,8px)!important;z-index:20;display:grid;grid-template-columns:auto minmax(120px,1fr);align-items:center;gap:12px;padding:8px 10px!important;margin:12px 0!important;background:linear-gradient(#173f65,#102e4b);box-shadow:0 5px 16px #020c1988,inset 0 1px #91c8ee55}
.story-embedded #narration-panel .narration-heading{display:none!important}
.story-embedded #narration-panel .narration-controls{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;align-items:center;min-width:0}
.story-embedded #narration-panel .narration-controls>button,.story-embedded .narration-settings>summary{order:0!important;flex:none!important;display:flex;align-items:center;justify-content:center;min-width:40px!important;width:40px!important;min-height:40px!important;height:40px;padding:4px!important;font-size:20px!important;line-height:1!important;white-space:nowrap}
.story-embedded #narration-panel #narration-back,.story-embedded #narration-panel #narration-forward{font-size:12px!important;width:46px!important}
.story-embedded .narration-settings{position:relative;order:0;flex:none}
.story-embedded .narration-settings>summary{list-style:none;cursor:pointer;border:1px solid #78c3ed;border-radius:9px;background:linear-gradient(#245e8c,#113556);box-shadow:inset 0 0 0 3px #17314a,0 3px #020b14}
.story-embedded .narration-settings>summary::-webkit-details-marker{display:none}
.story-embedded .narration-settings[open]>summary{background:linear-gradient(#8a3bcc,#532091);border-color:#c086f1}
.story-embedded .narration-settings-panel{position:absolute;top:calc(100% + 10px);inset-inline-end:0;width:250px;max-width:calc(100vw - 40px);padding:14px;border:2px solid #398fc9;border-radius:12px;background:#0b2845;box-shadow:0 8px 24px #020c19cc;display:grid;gap:12px;z-index:25}
.story-embedded #narration-panel .narration-settings-panel label{display:flex!important;flex-direction:row!important;justify-content:space-between;align-items:center;gap:10px;min-height:40px;font-size:13px;margin:0;padding:0}
.story-embedded #narration-panel .narration-settings-panel label[hidden]{display:none!important}
.story-embedded #narration-panel .narration-settings-panel select{width:135px;max-width:135px;font-size:16px;padding:6px}
.story-embedded #narration-panel .audio-player-timeline{margin:0!important;min-width:0}
.story-embedded #narration-panel .audio-player-times{font-size:11px;line-height:1.2}
.story-embedded #narration-status:not([hidden]){grid-column:1/-1;display:block!important;color:#ffd291;margin:0!important}
@media(max-width:900px){
 .story-embedded #narration-panel{grid-template-columns:minmax(0,1fr);gap:3px;padding:6px 8px!important}
 .story-embedded #narration-panel .narration-controls{justify-content:space-between}
 .story-embedded #narration-panel #narration-seek{height:26px!important;min-height:26px!important;max-height:26px!important}
 .story-embedded .narration-settings-panel{inset-inline-end:0;max-width:calc(100vw - 48px)}
}
/* Keep the browser's scroll anchoring from fighting the embedded sticky transport. */
body.story-time-view,#story-workspace,#story-frame,html.story-embedded,.story-embedded body,.story-embedded #narration-panel{overflow-anchor:none!important}

@media(max-width:900px){.story-embedded #narration-panel{position:static!important;top:auto!important;transform:none!important}}

/* The phone dock lives in the outer page, so iframe clipping cannot hide it. */
.phone-narration-dock{display:none}
@media(max-width:900px){
 .phone-narration-dock:not([hidden]){position:fixed;display:block;z-index:10000;top:calc(env(safe-area-inset-top,0px) + 8px);left:8px;right:8px;max-width:700px;margin:0 auto;padding:7px 9px;border:1px solid #4aa4dc;border-radius:12px;background:linear-gradient(#173f65,#102e4b);box-shadow:0 5px 18px #020c19aa;box-sizing:border-box;direction:ltr}
 .phone-audio-buttons{display:flex;align-items:center;justify-content:space-between;gap:4px}
 .phone-audio-buttons>button,.phone-audio-buttons summary{display:flex;align-items:center;justify-content:center;min-width:40px!important;width:40px;height:40px;min-height:40px!important;padding:4px!important;border:1px solid #78c3ed;border-radius:9px;background:linear-gradient(#245e8c,#113556);box-shadow:inset 0 0 0 3px #17314a,0 3px #020b14;color:white;font:20px/1 Arial,sans-serif;cursor:pointer;list-style:none;flex-shrink:0}
 .phone-audio-buttons>button:first-child,.phone-audio-buttons>button:nth-child(3){font-size:12px;width:44px}
 .phone-audio-buttons summary::-webkit-details-marker{display:none}
 .phone-audio-buttons [aria-pressed=true],.phone-audio-buttons details[open]>summary{background:linear-gradient(#8a3bcc,#532091);border-color:#c086f1}
 .phone-audio-buttons details{position:relative}
 .phone-audio-options{position:absolute;top:48px;right:0;width:250px;max-width:calc(100vw - 40px);padding:14px;display:grid;gap:10px;background:#0b2845;border:2px solid #398fc9;border-radius:12px;box-shadow:0 8px 24px #020c19cc}
 .phone-audio-options label{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#eef6ff;font-size:13px;min-height:40px}
 .phone-audio-options select{min-width:0;width:135px;font-size:16px;padding:6px;color:white;background:#092b49;border:1px solid #5ca8dc;border-radius:7px}
 .phone-narration-dock .phone-audio-seek{display:block!important;width:100%!important;height:26px!important;min-height:26px!important;max-height:26px!important;margin:0!important}
 .phone-audio-times{display:flex;justify-content:space-between;line-height:1.2;font-size:11px;color:#d9efff}
}
@media(max-width:360px){.phone-narration-dock:not([hidden]){left:6px;right:6px;padding:6px}.phone-audio-buttons{gap:2px}}

/* Match the established Arabic transport: visible Loop, Speed and Auto play. */
.story-embedded #narration-panel{display:flex!important;flex-wrap:wrap!important;gap:16px!important;padding:12px 16px!important;border-color:#3188ce!important;box-shadow:inset 0 1px #91c8ee55,0 5px 16px #020c1988}
.story-embedded #narration-panel .narration-controls{gap:8px!important;flex-wrap:wrap!important;flex-shrink:0}
.story-embedded #narration-panel .narration-controls>button{width:auto!important;min-width:55px!important;min-height:40px!important;padding:7px 11px!important;font:600 14px/1.4 Arial,sans-serif!important}
.story-embedded #narration-panel #play-narration{min-width:55px!important;font-size:22px!important}
.story-embedded #narration-panel #narration-loop{min-width:80px!important}
.story-embedded #narration-panel .course-audio-option,.phone-narration-dock .course-audio-option{display:flex!important;flex-direction:row!important;align-items:center;justify-content:space-between;gap:10px;min-height:40px!important;padding:6px 10px!important;border:1px solid #3188ce;border-radius:9px;background:linear-gradient(#1a4772,#113152);font:600 14px/1.4 Arial,sans-serif!important;color:#e8f3ff;cursor:pointer;margin:0}
.story-embedded #narration-panel .narration-controls>.course-audio-option{order:0!important;grid-column:auto!important}
.story-embedded #narration-panel .course-audio-option select,.phone-narration-dock .course-audio-option select{width:76px;max-width:76px;min-width:0;padding:6px;border:1px solid #5ca8dc;border-radius:7px;background:#092b49;color:#f1f8ff;font-size:14px}
.story-embedded #narration-panel .audio-player-timeline{flex:1 1 140px!important;width:auto!important;min-width:140px}
.story-embedded .narration-settings>summary{height:44px;min-height:44px!important;width:44px!important;padding:7px!important}
.story-embedded .narration-settings-panel{width:240px}
@media(max-width:900px){
 .story-embedded #narration-panel{display:block!important;padding:10px 12px!important}
 .story-embedded #narration-panel .narration-controls,.phone-narration-dock .phone-audio-buttons{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px!important;align-items:stretch}
 .story-embedded #narration-panel .narration-controls>button,.story-embedded .narration-settings>summary,.phone-narration-dock .phone-audio-buttons>button,.phone-narration-dock .phone-audio-buttons summary{width:100%!important;min-width:0!important;min-height:44px!important;height:44px;padding:4px!important;font-size:12px!important}
 .story-embedded #narration-panel #play-narration,.phone-narration-dock [data-audio=play-narration]{font-size:22px!important;min-width:0!important}
 .story-embedded #narration-panel #narration-loop{min-width:0!important}
 .story-embedded #narration-panel #restart-narration,.phone-narration-dock [data-audio=restart-narration]{display:none!important}
 .story-embedded #narration-panel .course-audio-option{grid-row:2!important;grid-column:span 2!important;gap:6px;padding:5px 6px!important;font-size:12px!important}
 .story-embedded #narration-panel .narration-controls>label:has(#narration-speed){grid-column:1/3!important}
 .story-embedded #narration-panel .narration-controls>label:has(#narration-autoplay){grid-column:3/6!important}
 .story-embedded .narration-settings{grid-row:1;grid-column:5}
 .story-embedded #narration-panel .audio-player-timeline{width:100%!important;margin-top:4px!important}
 .phone-narration-dock:not([hidden]){padding:10px 12px}
 .phone-narration-dock .phone-audio-buttons details{grid-row:1;grid-column:5}
 .phone-narration-dock .phone-speed{grid-row:2;grid-column:1/3}
 .phone-narration-dock .phone-auto{grid-row:2;grid-column:3/6}
 .phone-narration-dock .course-audio-option{gap:6px;padding:5px 6px!important;font-size:12px!important}
 .phone-narration-dock .course-audio-option select{width:58px;padding:4px;font-size:14px}
 .phone-narration-dock .course-audio-option input[type=checkbox]{width:40px!important;min-width:40px;height:24px;appearance:none;background:#49617b;border:1px solid #7991a9;border-radius:20px;position:relative;margin:0;flex:0 0 40px;cursor:pointer}
 .phone-narration-dock .course-audio-option input[type=checkbox]::after{content:'';position:absolute;width:18px;height:18px;left:2px;top:2px;background:linear-gradient(#fff,#cbd9e7);border-radius:50%}
 .phone-narration-dock .course-audio-option input[type=checkbox]:checked{background:#078fe5;border-color:#91d9ff}
 .phone-narration-dock .course-audio-option input[type=checkbox]:checked::after{transform:translateX(16px)}
 .phone-audio-options{width:230px}
}
@media(max-width:900px){.phone-narration-dock .phone-audio-buttons [data-audio=play-narration]{font-size:22px!important}}

/* Keep the established Arabic player in its scrolling practice column. */
.activity-tabs [data-tab=audio]{border-style:solid}
.story-language-note{display:inline-block;padding:6px 10px;border:1px solid #a97428;border-radius:7px;background:#30271a;color:#ffc45b;font:600 13px/1.4 Arial,sans-serif;direction:ltr;text-align:left}
.story-language-note[hidden],.mobile-story-language-note{display:none!important}
.shared-keyboard-warning{max-width:100%;gap:8px;align-items:center;flex-direction:row!important;flex-wrap:wrap;padding:6px 10px!important;border:1px solid #a97428!important;border-radius:7px!important;background:#30271a!important;color:#ffc45b!important;font:600 13px/1.4 Arial,sans-serif!important;box-shadow:none!important;text-align:left;direction:ltr}
.shared-keyboard-warning[hidden]{display:none!important}
#language-warning.shared-keyboard-warning:not([hidden]),#response-language-warning.shared-keyboard-warning:not([hidden]){display:inline-flex!important}
.shared-keyboard-warning strong{font:inherit;color:inherit!important}.shared-keyboard-warning .keyboard-warning-detail{display:none!important}
.shared-keyboard-warning button{margin:0 0 0 6px;min-height:32px!important;padding:4px 9px!important;border:1px solid #bd8735!important;border-radius:6px!important;background:#493820!important;box-shadow:none!important;color:#ffcf77!important;font:600 12px/1.4 Arial,sans-serif!important;white-space:normal}
.practice-topline{flex-wrap:wrap}.practice-topline #language-warning{flex:0 1 auto;margin:4px 0 0}
.practice-area.wrong-language,.response-question.wrong-language,.response-question.wrong-language textarea{border-color:#b4863c!important;box-shadow:0 0 0 2px #ba8a3022!important}
#keyboard-guide{max-width:min(680px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
.keyboard-device-guide{padding:10px 12px;margin:12px 0;border:1px solid #397fae;border-radius:9px;background:#0b2a46}
.keyboard-device-guide summary{cursor:pointer;color:#d1ebff;font:700 16px/1.5 Arial,sans-serif;padding:3px}
.keyboard-device-guide p{font-size:14px!important;line-height:1.65}.keyboard-device-guide a{color:#8bd4ff}
@media(max-width:900px){.shared-keyboard-warning button{min-height:44px!important;padding:6px 10px!important}#keyboard-guide{width:calc(100vw - 24px)!important;box-sizing:border-box;padding:14px!important}}
.story-practice-heading{flex-wrap:wrap;position:sticky;top:88px;z-index:3;background:#0b2845}
@media(max-width:900px){.story-practice-heading{position:relative;top:auto}.story-practice-heading .story-language-note{display:none!important}.mobile-story-language-note:not([hidden]){display:block!important;margin:8px}}
@media(min-width:901px){#dialogue-audio-player{position:sticky!important;top:8px;z-index:30;background:linear-gradient(#173f65,#102e4b);box-shadow:0 5px 16px #020c1988}}

/* Story typing uses the same start affordance and raised keyboard as Arabic. */
.story-practice-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid #255574;color:#b8d5e9;font:14px/1.5 Arial,sans-serif;direction:ltr}
.story-next-guide{display:flex;align-items:center;gap:10px}.story-next-guide b{display:flex;align-items:center;justify-content:center;min-width:50px;min-height:45px;padding:4px;border:1px solid #77bfe7;border-radius:9px;background:linear-gradient(#245f8c,#123b59);font:26px/1.4 Arial,sans-serif;color:white}
.story-start-typing{position:absolute;z-index:4;top:140px;left:50%;transform:translateX(-50%);padding:16px 22px!important;min-height:54px;border:2px solid #80d6ff!important;border-radius:13px!important;background:linear-gradient(#287db8,#12466e)!important;box-shadow:inset 0 0 0 4px #173650,0 3px #020c19;color:white;font:700 18px/1.4 Arial,sans-serif!important;white-space:nowrap}
.story-start-typing[hidden]{display:none!important}
#story-keyboard.guidance-row{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:18px;align-items:center;padding:14px;border:1px solid #287bb7;border-radius:13px;background:linear-gradient(130deg,#0e3255,#071d35)}
#story-keyboard .keyboard-column,#story-keyboard .keyboard{min-width:0;max-width:100%}
#story-keyboard .row{display:flex;direction:ltr;gap:5px;margin-bottom:5px}
#story-keyboard .key{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-width:0;height:48px;min-height:0;padding:0;border:1px solid #4da7e9;border-radius:8px;background:linear-gradient(#205788,#123759);box-shadow:inset 0 1px #8dd2ff88,inset 0 0 0 2px #0b2847,inset 0 -4px #061b32;font:24px/1.2 Arial,sans-serif;color:#e5f3ff;overflow:hidden}
#story-keyboard .key small{font:12px/1.2 Arial,sans-serif;color:#bdd7ed}#story-keyboard .key.home{border-bottom:3px solid #96cae9}
#story-keyboard .key.space{flex:6}#story-keyboard .key.space,#story-keyboard .shift-key{height:35px;font:14px/1.2 Arial,sans-serif}
#story-keyboard .key.next{background:linear-gradient(#35b9ff,#008de9);border-color:#c3efff;box-shadow:inset 0 1px #fff9,inset 0 -4px #0760a6,0 0 10px #159aff44}
#story-keyboard .key-vowel,#story-keyboard .key-mark,#story-keyboard .key-punctuation{position:absolute;top:1px;right:3px;font:12px/1.1 Arial,sans-serif;color:#ffcd69}#story-keyboard .key-vowel{right:1px;color:#b9e3ff}#story-keyboard .key-mark{left:3px;right:auto}
#story-keyboard .hand-guidance{padding:12px;border:1px solid #388bc6;border-radius:12px;background:linear-gradient(#16436c,#0a2947)}
#story-keyboard .hands{display:flex;justify-content:center;gap:12px;direction:ltr}#story-keyboard .hand-unit{width:95px;min-width:0;text-align:center;font:14px/1.5 Arial,sans-serif;color:#c5dff5}#story-keyboard .hand-unit svg{display:block;width:100%;height:90px;overflow:visible;margin-bottom:4px}
#story-keyboard .palm{fill:#14416b;stroke:#75b8e7;stroke-width:3}#story-keyboard .hand-finger{fill:#1b4c76;stroke:#75b8e7;stroke-width:3;stroke-linejoin:round;stroke-linecap:round}#story-keyboard .active-finger{fill:#aa64ed;stroke:#ecd4ff;stroke-width:4;filter:drop-shadow(0 0 4px #aa64ed99)}
#story-keyboard .hand-hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:1100px){#story-keyboard.guidance-row{grid-template-columns:minmax(0,1fr)}#story-keyboard .hand-unit svg{height:72px}}
@media(max-width:900px){
 .story-start-typing{position:relative;top:auto;left:auto;transform:none;display:block;margin:12px auto;white-space:normal;max-width:calc(100% - 24px);font-size:16px!important}
 .story-practice-heading{padding:8px 10px;font-size:12px}.story-next-guide b{min-width:40px;min-height:36px;font-size:22px}
 #story-keyboard .key{height:40px;font-size:18px}#story-keyboard .key small,#story-keyboard .key-mark,#story-keyboard .key-vowel{display:none}
 /* Two 44px control rows and one compact timeline, including the pinned copy. */
 #dialogue-audio-player,.story-embedded #narration-panel,.phone-narration-dock:not([hidden]){padding:5px 7px!important}
 #dialogue-audio-player .audio-player-buttons,.story-embedded #narration-panel .narration-controls,.phone-narration-dock .phone-audio-buttons{gap:4px!important}
 #dialogue-audio-player .audio-autoplay-toggle,.story-embedded #narration-panel .course-audio-option,.phone-narration-dock .course-audio-option{box-sizing:border-box;min-height:44px!important;height:44px;padding:2px 6px!important;gap:4px!important}
 #dialogue-audio-player .audio-player-timeline,.story-embedded #narration-panel .audio-player-timeline,.phone-audio-timeline{display:grid!important;grid-template-columns:31px minmax(0,1fr) 31px;align-items:center;gap:5px;height:28px;margin-top:2px!important}
 #dialogue-audio-player .audio-player-times,.story-embedded #narration-panel .audio-player-times,.phone-audio-times{display:contents!important;font:11px/1.2 Arial,sans-serif!important}
 #dialogue-audio-player .audio-player-times span:first-child,.story-embedded #narration-panel .audio-player-times span:first-child,.phone-audio-times span:first-child{grid-column:1;grid-row:1}
 #dialogue-audio-player .audio-player-times span:last-child,.story-embedded #narration-panel .audio-player-times span:last-child,.phone-audio-times span:last-child{grid-column:3;grid-row:1;text-align:right}
 #dialogue-audio-player input[type=range],.story-embedded #narration-panel #narration-seek,.phone-narration-dock .phone-audio-seek{grid-column:2;grid-row:1;height:28px!important;min-height:28px!important;margin:0!important;width:100%!important}
 .phone-narration-dock.arabic-audio-dock .phone-audio-buttons{grid-template-columns:repeat(4,minmax(0,1fr))}
 .phone-narration-dock.arabic-audio-dock .phone-auto{grid-column:3/5}
 .phone-narration-dock [hidden]{display:none!important}
}

/* Keep native input and its language help in one measurable mobile writing group. */
.mobile-writing-entry{display:contents}
@media(max-width:900px){
 .mobile-writing-entry{display:flex;flex-direction:column;gap:6px;min-width:0;margin:8px}
 .mobile-writing-entry>.shared-keyboard-warning:not([hidden]){order:-1!important;margin:0!important;max-width:100%;box-sizing:border-box}
 .mobile-writing-entry>#language-warning{flex:none}
 .mobile-writing-entry textarea::placeholder{font:16px/1.5 Arial,sans-serif!important}
 .mobile-writing-active .practice-topline,.mobile-writing-active .story-practice-heading,.mobile-writing-active .mobile-input-note{display:none!important}
 .mobile-writing-active .practice-area #target,.mobile-writing-active #typing-ghost{height:clamp(96px,calc(var(--mobile-screen-height,420px)*.25),132px)!important;min-height:96px!important;max-height:132px!important;padding:4px 10px!important;line-height:1.65!important;overflow-y:auto!important;overscroll-behavior-y:auto!important}
 .mobile-writing-active .mobile-writing-entry{gap:6px;margin:6px 8px}
 .mobile-writing-active #input.typing-capture,.mobile-writing-active #story-input.story-capture,.mobile-writing-active #audio-answer{position:relative!important;inset:auto!important;width:100%!important;height:88px!important;min-height:80px!important;max-height:120px!important;margin:0!important;box-sizing:border-box;resize:vertical}
}
.writing-audio-option{display:none!important}
@media(max-width:900px){
 /* Preserve the inline player's space, but expose only one set of controls. */
 .mobile-audio-docked{visibility:hidden!important;pointer-events:none!important}
 html[data-phone-writing] .phone-narration-dock .phone-audio-buttons{grid-template-columns:repeat(5,minmax(0,1fr))!important}
 html[data-phone-writing] .phone-narration-dock .phone-audio-buttons>.course-audio-option{display:none!important}
 html[data-phone-writing] .phone-narration-dock .writing-audio-option{display:flex!important}
 html[data-phone-writing] .phone-narration-dock details>summary{min-height:44px}
 html[data-phone-writing] .phone-narration-dock .phone-audio-options{max-height:50svh;overflow:auto}
 html[data-phone-writing] .phone-narration-dock summary{font-size:18px!important}
}

/* Ghost text is the mobile typing surface; keep the native input at its caret. */
@media(max-width:900px){
 .mobile-writing-active #activity:has(.mobile-direct-entry)>.subhead,.mobile-writing-active #activity:has(.mobile-direct-entry)>.subhead+p.tip,.mobile-writing-active #activity:has(.mobile-direct-entry)>label[for="story-input"]{display:none!important}
 .mobile-direct-entry{position:relative;display:flex;flex-direction:column;gap:6px;min-width:0}
 .mobile-direct-entry #typing-ghost,.mobile-direct-entry #target{width:100%;box-sizing:border-box;touch-action:pan-y;cursor:text}
 #language-workspace #input.typing-capture.mobile-direct-capture,body.typing-course-view #input.typing-capture.mobile-direct-capture,.story-embedded #story-input.story-capture.mobile-direct-capture{position:absolute!important;inset:auto!important;width:2px!important;min-width:2px!important;max-width:2px!important;height:32px!important;min-height:32px!important;max-height:32px!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;color:transparent!important;caret-color:transparent!important;opacity:.01!important;outline:0!important;box-shadow:none!important;clip-path:none!important;pointer-events:none!important;resize:none!important;font:16px/32px Arial,sans-serif!important;overflow:hidden!important}
 .story-typing-surface>.mobile-input-note,#language-workspace .mobile-input-note,body.typing-course-view .practice-area:has(.mobile-direct-entry)>.mobile-input-note{display:none!important}
 .mobile-direct-entry:focus-within #typing-ghost,.mobile-direct-entry:focus-within #target{outline:2px solid #b590f4;outline-offset:-2px}
 .mobile-writing-active .mobile-direct-entry #typing-ghost,.mobile-writing-active .mobile-direct-entry #target{height:clamp(140px,calc(var(--mobile-screen-height,420px)*.52),280px)!important;min-height:140px!important;max-height:280px!important}
 .mobile-writing-active .mobile-direct-entry:has(.shared-keyboard-warning:not([hidden])) #typing-ghost,.mobile-writing-active .mobile-direct-entry:has(.shared-keyboard-warning:not([hidden])) #target{height:clamp(120px,calc(var(--mobile-screen-height,420px)*.4),220px)!important;min-height:120px!important;max-height:220px!important}
 .mobile-direct-entry .story-start-typing,.mobile-direct-entry .start-overlay{position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;z-index:5;display:block!important;width:max-content!important;max-width:calc(100% - 16px)!important;min-height:44px!important;box-sizing:border-box;padding:10px 14px!important;font-size:16px!important;line-height:1.4!important;margin:0!important;white-space:normal}
 .mobile-direct-entry .story-start-typing[hidden],.mobile-direct-entry .start-overlay[hidden],.mobile-direct-entry:focus-within .story-start-typing,.mobile-direct-entry:focus-within .start-overlay{display:none!important}
}

/* Keep seeking beside the transport; playback preferences follow on the right. */
@media(min-width:901px){
 #dialogue-audio-player .audio-player-buttons,.story-embedded #narration-panel .narration-controls{display:flex!important;align-items:center;flex:1 1 100%;width:100%;min-width:0;flex-wrap:wrap!important;gap:8px!important}
 #dialogue-audio-player .audio-player-buttons>.audio-player-timeline,.story-embedded #narration-panel .narration-controls>.audio-player-timeline{flex:1 1 140px!important;min-width:140px!important;width:auto!important;order:0!important;margin:0!important}
 .story-embedded #narration-panel{gap:8px!important}
 .story-embedded .narration-settings>summary{width:auto!important;min-width:84px!important;font:600 14px/1.4 Arial,sans-serif!important;padding:7px 11px!important}
}
#restart-narration svg,.phone-narration-dock [data-audio=restart-narration] svg{display:block;margin:auto}
@media(max-width:900px){
 .story-embedded #narration-panel .narration-controls>.audio-player-timeline{grid-column:1/-1!important;grid-row:3!important;min-width:0!important;width:100%!important}
 #dialogue-audio-player .audio-player-buttons>.audio-player-timeline{flex:1 1 100%;width:100%;min-width:0}
 .story-embedded .narration-settings>summary,.phone-narration-dock .phone-audio-buttons summary{font:600 11px/1.2 Arial,sans-serif!important;white-space:nowrap}
}

/* Give the seek bar the space recovered from compact playback preferences. */
.story-embedded .narration-settings>summary{display:flex;align-items:center;justify-content:center}
@media(min-width:901px){
 .story-embedded .narration-settings>summary{width:44px!important;min-width:44px!important;padding:7px!important}
 .story-embedded #narration-panel .course-audio-option,#dialogue-audio-player .audio-autoplay-toggle{gap:6px!important;padding:5px 7px!important;font-size:12px!important;flex:0 0 auto!important;min-width:0!important}
 .story-embedded #narration-panel .course-audio-option:has(select),#dialogue-audio-player .audio-autoplay-toggle:has(select){padding:0!important;border:0!important;background:transparent!important}
 .story-embedded #narration-panel .course-audio-option select,#dialogue-audio-player #audio-speed{width:62px!important;max-width:62px!important;min-width:62px!important;min-height:40px;padding:5px!important;font-size:14px!important}
}

/* Story cards: recognition first, then production with optional sentence support. */
.card-face .card-prompt{font-size:calc(var(--arabic-size) + 9px);color:#e5d5ff}
.card-meaning{font-size:25px;font-weight:700;color:#ddc1ff;margin:12px 0}
.card-face .activity-actions{justify-content:center;margin-top:16px}
.card-sentence-hint{padding:16px 20px;margin-top:16px;border:1px solid #8060ad;border-radius:10px;background:#102b45}
.card-sentence-hint .arabic{margin:8px 0;overflow-wrap:anywhere}
.card-review-notice{color:#a7d6ed;font-size:13px;min-height:20px;margin:0 0 10px}
.card-rating button{min-width:110px}
@media(max-width:900px){.card-face{padding:20px 14px!important;min-height:200px}.card-meaning{font-size:22px}.card-rating{display:grid;grid-template-columns:1fr 1fr}.card-rating button{min-width:0;min-height:44px}.subhead:has(+.tip+.card-review-notice){align-items:flex-start;flex-wrap:wrap}.card-sentence-hint{padding:12px}}

/* Flashcard reveal and rating share one stable action row. */
#activity .card-face{display:grid;grid-template-rows:auto auto minmax(92px,auto) 58px;justify-items:center;align-items:center;gap:10px;min-height:310px;width:100%;box-sizing:border-box}
.card-face-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.card-face-heading .eyebrow{margin:0;text-align:left}
.card-face-heading #card-hint{font-size:12px;padding:6px 10px;min-height:38px}
.card-answer-slot{display:grid;place-items:center;min-height:92px;width:100%;min-width:0}
.card-answer-slot .card-answer{line-height:1.55;margin:0}
.card-control-slot{width:100%;height:58px;display:grid;place-items:center}
.card-control-slot>#reveal-card{height:58px;width:min(100%,350px);margin:0}
.card-control-slot .card-rating{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;height:58px;margin:0}
.card-rating button{min-width:0;min-height:58px;margin:0;font-size:14px;padding:8px}
.card-control-slot kbd{display:inline-block;font:600 11px/1.2 Arial,sans-serif;border:1px solid #8db9d5;border-radius:4px;padding:2px 4px;margin-right:5px}
.story-drill-progress{width:min(240px,45%);height:12px;flex:0 1 240px;margin:0}
.story-gap-entry{position:relative;display:inline-block;width:min(240px,100%);min-width:100px;max-width:100%}
.story-gap-entry .gap-input,.gap-correction-ghost{font:var(--arabic-size)/1.6 Arial,sans-serif;text-align:right;direction:rtl;box-sizing:border-box;white-space:pre-wrap;overflow-wrap:anywhere;padding:8px 14px;border:2px solid transparent;border-radius:10px;width:100%;min-height:60px;margin:0}
.story-gap-entry .gap-input{position:relative;background:transparent;border-color:#6586a6;z-index:1}
.gap-correction-ghost{position:absolute;inset:0;pointer-events:none;z-index:0}
.story-gap-entry.is-correction .gap-input{color:transparent;-webkit-text-fill-color:transparent;caret-color:white}
.gap-correction-ghost[hidden]{display:none}
#gap-form>.story-language-note:not([hidden]){display:flex;flex-wrap:wrap;align-items:center;margin:0 0 12px}
.translation-arabic[data-ghost]{cursor:help}
.translation-arabic[data-ghost]:focus-visible{outline:2px solid #ba91f1;outline-offset:3px}
@media(max-width:900px){
 #activity .card-face{grid-template-rows:auto auto minmax(124px,auto) 62px;gap:8px;padding:16px 12px!important;min-height:340px!important}
 .card-control-slot,.card-control-slot .card-rating{height:62px}
 .card-control-slot>#reveal-card{height:62px}
 .card-rating button{min-height:62px;font-size:12px;line-height:1.2;padding:5px;white-space:normal}
 .card-control-slot kbd{display:block;width:max-content;margin:0 auto 4px}
 .card-answer-slot{min-height:124px}
 .card-face-heading{gap:6px}.card-face-heading .eyebrow{font-size:10px}
 .card-face-heading #card-hint{font-size:11px;padding:5px 7px;min-height:40px}
 .story-drill-progress{flex:0 1 45%;width:45%}
 .story-gap-entry{width:min(210px,100%)}
}

/* A single centered review progress bar keeps the card area uncluttered. */
.card-progress-wrap{display:flex;justify-content:center;width:min(720px,92%);margin:12px auto 18px}
#card-progress{display:block;appearance:none;-webkit-appearance:none;flex:none;width:100%;height:16px;margin:0;border:1px solid #5385a6;border-radius:999px;overflow:hidden;background:#08243b}
#card-progress::-webkit-progress-bar{background:#08243b;border-radius:999px}
#card-progress::-webkit-progress-value{background:linear-gradient(90deg,#1c9adb,#67d8ff);border-radius:999px}
#card-progress::-moz-progress-bar{background:linear-gradient(90deg,#1c9adb,#67d8ff);border-radius:999px}
@media(max-width:900px){.card-progress-wrap{width:94%;margin:10px auto 16px}}

/* Shared quiet layout for Story Time review and question activities. */
.story-progress-wrap{display:flex;justify-content:center;width:min(720px,92%);margin:12px auto 18px}
.story-progress-wrap>progress{display:block;appearance:none;-webkit-appearance:none;flex:none;width:100%;height:16px;margin:0;border:1px solid #5385a6;border-radius:999px;overflow:hidden;background:#08243b}
.story-progress-wrap>progress::-webkit-progress-bar{background:#08243b;border-radius:999px}
.story-progress-wrap>progress::-webkit-progress-value{background:linear-gradient(90deg,#1c9adb,#67d8ff);border-radius:999px}
.story-progress-wrap>progress::-moz-progress-bar{background:linear-gradient(90deg,#1c9adb,#67d8ff);border-radius:999px}
#activity>h3:not(.reading-title){text-align:center;margin:16px 0}
@media(max-width:900px){.story-progress-wrap{width:94%;margin:10px auto 16px}}

/* Hub pages and the complete unit picker share the main page scroll. */
#candidate-hub-frame,#hub-revision-frame{display:block;width:100%!important;min-height:0!important;max-height:none!important;border:0;margin:0;overflow:visible}
html.training-hub-embedded,html.training-hub-embedded body,html.hub-embedded,html.hub-embedded body{height:auto!important;min-height:0!important;overflow:visible!important}
.hub-embedded #revision-dialog[open],.hub-embedded #unit-access-dialog[open]{position:relative!important;inset:auto!important;display:block!important;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;margin:0!important;overflow:visible!important}
.hub-embedded .revision-unit-grid{max-height:none!important;overflow:visible!important;padding:2px;scrollbar-gutter:auto}

/* Story UX review: isolated presentation changes, October 2026. */
.story-activity-navigation{display:flex;align-items:center;gap:10px;margin:10px 0;flex-wrap:wrap}
.story-activity-navigation label{font-weight:700;font-size:13px}
#story-activity-select{min-height:44px;max-width:100%;flex:1;padding:8px 10px;background:#0b2946;color:#fff;border:1px solid #7abce8;border-radius:8px;font:inherit}
#story-resume{font-size:13px;min-height:44px;padding:8px 12px}
#story-resume[hidden]{display:none}
#story-question-count{font-size:13px;color:#c9e3f7;margin:4px 0 8px}
.story-embedded .story-progress-wrap{display:block!important}
#story-question-count{white-space:nowrap}
.narration-settings summary,.phone-audio-buttons details summary{display:flex!important;align-items:center;justify-content:center;gap:5px;width:auto!important;min-width:64px!important;font-size:12px}
@media(min-width:901px){.story-activity-navigation label,.story-activity-navigation select{display:none}}
@media(max-width:900px){
 .story-embedded .activity-tabs{display:none!important}
 .story-embedded aside,.story-embedded .workspace{padding:10px!important}
 .story-embedded main{gap:8px!important;padding:8px!important}
 .story-embedded .scene-heading{gap:6px!important}
 .story-embedded .scene-heading h2{font-size:21px!important}
 .story-embedded .scene-heading .eyebrow{margin:0!important}
 .story-embedded .story-activity-navigation{margin:8px 0;gap:6px}
 .story-embedded #story-resume{flex-basis:100%}
 .story-embedded .narration-panel{margin:8px 0!important}
}

/* Keep the inline mobile Story player proportional to its pinned counterpart. */
@media(min-width:901px){.audio-speed-label{display:none}}
@media(max-width:900px){
 .story-embedded #narration-panel .narration-controls{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important;align-items:stretch!important}
 .story-embedded #narration-panel .narration-controls>button,.story-embedded #narration-panel .narration-settings{box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;justify-self:stretch!important;grid-row:1!important}
 .story-embedded #narration-panel #narration-back{grid-column:1!important}.story-embedded #narration-panel #play-narration{grid-column:2!important}.story-embedded #narration-panel #narration-forward{grid-column:3!important}.story-embedded #narration-panel #narration-loop{grid-column:4!important}
 .story-embedded #narration-panel .narration-settings{grid-column:5!important}
 .story-embedded #narration-panel .narration-settings>summary{box-sizing:border-box!important;width:100%!important;min-width:0!important;height:44px!important;padding:4px!important;font-size:12px!important}
 .story-embedded #narration-panel .course-audio-option:has(#narration-speed){padding:2px 6px!important;border:1px solid #3188ce!important;background:linear-gradient(#1a4772,#113152)!important;justify-content:space-between!important}
 .story-embedded #narration-panel #narration-speed{width:58px!important;min-width:0!important;max-width:58px!important;padding:4px!important;font-size:14px!important}
}

@media(max-width:900px){.story-embedded #narration-panel #narration-back,.story-embedded #narration-panel #narration-forward{width:100%!important;max-width:none!important}}

/* Story lessons share the outer page scroller on desktop and mobile. */
html.story-embedded,.story-embedded body{overflow:clip!important;height:auto!important;min-height:0!important}

@media(min-width:901px){.story-embedded aside{position:relative!important;top:var(--story-aside-offset,0px)!important;max-height:var(--story-page-available,calc(100dvh - 40px))!important}.story-embedded #narration-panel{position:relative!important;top:var(--story-audio-offset,0px)!important}}
/* Keep the outer shell steady between short and long course pages. */
html:has(#language-workspace){scrollbar-gutter:stable}
.course-menu.pointer-selection button:focus{outline:none!important}
#story-workspace{max-width:none}
#story-workspace,#story-frame,html.story-embedded,.story-embedded body{background:transparent!important}
@media(min-width:901px){
body>header{padding-left:max(18px,calc((100% - 1524px)/2))!important;padding-right:max(18px,calc((100% - 1524px)/2))!important}
.story-embedded .catalogue-sidebar{top:0!important}
}


/* Match the parent canvas rather than the browser's opaque dark iframe canvas. */
html.story-embedded{color-scheme:normal}
.story-embedded input,.story-embedded select,.story-embedded textarea{color-scheme:dark}
/* Embedded typing uses the parent canvas, avoiding a second gradient on entry. */
html:has(body.typing-course-view){color-scheme:normal;background:transparent!important}
body.typing-course-view,#typing-frame{background:transparent!important}
body.typing-course-view input,body.typing-course-view select,body.typing-course-view textarea{color-scheme:dark}

/* Separate harakaat must scale with the learner’s selected Arabic text size. */
.target.harakaat-mode .vowel-mark{font-size:1em;line-height:1.6;padding-inline:.1em;margin-inline:.08em}

/* Keep Arabic shaping continuous across correctness/caret spans. Per-letter
   opacity and inline borders split shaping runs in WebKit. Paint only. */
.entry-remaining,.story-ghost .entry-remaining{opacity:1!important;color:#59728e}
#typing-ghost .current-letter,#target .current:not(.vowel-mark),.input-ghost .current,.input-ghost .current-letter,.gap-correction-ghost .current-letter{
 border:0!important;box-shadow:none!important;opacity:1!important;
 outline:1px solid #cfe7ff;outline-offset:1px;animation:none!important;
}

/* Mobile consistency review: common ghost-text instructions and control rows. */
@media(max-width:900px){
 body:not(.mobile-writing-active) #practice-area .practice-topline,
 .story-embedded body:not(.mobile-writing-active) .story-practice-heading{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:8px!important;align-items:center!important;padding:10px!important;
 }
 #practice-area .practice-instructions:not([hidden]){display:contents!important}
 #practice-label,#story-practice-label{grid-row:1;grid-column:1;min-width:0;padding:0!important;font:13px/1.45 Arial,sans-serif!important;color:#b8d2e9}
 #practice-area .next-letter-guide,.story-practice-heading .story-next-guide{grid-row:1;grid-column:2;display:flex!important;align-items:center;gap:6px!important;font:12px/1.4 Arial,sans-serif!important;white-space:nowrap}
 #practice-area .next-letter-guide bdi,.story-practice-heading .story-next-guide b{display:flex;align-items:center;justify-content:center;min-width:38px!important;min-height:40px;font:25px/1.3 Arial,sans-serif!important;padding:2px 6px!important}
 #practice-area .practice-topline>.visible-text-size,.story-practice-heading>.visible-text-size{grid-row:2;grid-column:1/-1;justify-self:start;margin:0!important;padding:0!important;font:13px/1.4 Arial,sans-serif!important}
 #practice-area .practice-topline>.visible-text-size button,.story-practice-heading>.visible-text-size button{min-width:44px!important;min-height:44px!important}
 #translation-hint{grid-row:3;grid-column:1/-1;max-width:100%;margin:0!important;padding:0!important;background:transparent!important;border:0!important;font:12px/1.45 Arial,sans-serif!important;color:#aac6df!important}
 /* Match Story Time: transport, playback preferences, then full-width seek bar. */
 :root #dialogue-audio-player .audio-player-buttons{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;width:100%;align-items:stretch}
 :root #dialogue-audio-player .audio-player-buttons>button{grid-row:1;min-width:0!important;min-height:44px!important;height:44px;font:600 12px/1.4 Arial,sans-serif!important}
 :root #dialogue-audio-player .audio-player-buttons>label:has(#audio-speed){grid-row:2;grid-column:1/3!important}
 :root #dialogue-audio-player .audio-player-buttons>label:has(#audio-autoplay){grid-row:2;grid-column:3/5!important}
 :root #dialogue-audio-player .audio-player-buttons>.audio-player-timeline{grid-row:3;grid-column:1/-1!important;width:100%!important;min-width:0!important}
 :root #dialogue-audio-player .audio-autoplay-toggle{display:flex!important;align-items:center;justify-content:space-between;min-height:44px!important;height:44px;gap:6px!important;padding:2px 6px!important;margin:0!important;min-width:0}
 :root #dialogue-audio-player #audio-speed{width:62px!important;max-width:62px!important;min-width:0!important;min-height:40px!important}
}

/* Story text-size buttons must affect the text being read or entered on mobile. */
@media(max-width:900px){
 .story-embedded #typing-ghost,.story-embedded .continuous-story .story-paragraph,.story-embedded #audio-answer{font-size:var(--arabic-size,30px)!important}
 .story-embedded .story-practice-heading{border-radius:11px 11px 0 0}
}
/* Match Learn Arabic's mobile drill strip using the existing activity buttons. */
@media(max-width:900px){
 .story-embedded .activity-tabs{display:flex!important;flex-wrap:nowrap!important;gap:8px!important;width:100%;max-width:100%;overflow-x:auto!important;overflow-y:hidden;padding:3px 2px 8px!important;margin:12px 0!important;scroll-snap-type:x proximity;scrollbar-width:thin}
 .story-embedded .activity-tabs button{flex:0 0 142px!important;min-width:142px!important;min-height:48px!important;max-width:none;padding:8px!important;font-size:13px!important;line-height:1.35;white-space:normal!important;scroll-snap-align:center}
 .story-embedded .story-activity-navigation>label,.story-embedded #story-activity-select{display:none!important}
 .story-embedded .story-activity-navigation:not(:has(#story-resume:not([hidden]))){display:none!important}
}


/* Desktop consistency preview: presentation only; mobile rules remain intact. */
@media(min-width:901px){
 #drill-steps,.story-embedded .activity-tabs{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:8px!important;align-items:stretch}
 #drill-steps>button,.story-embedded .activity-tabs>button{min-width:0!important;min-height:60px!important;padding:9px 10px!important;font:700 13px/1.4 Arial,sans-serif!important;white-space:normal!important;grid-column:auto!important}
 .practice-topline,.story-practice-heading{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:10px 12px!important;padding:14px 18px!important;min-height:78px;box-sizing:border-box}
 .practice-topline .practice-instructions{display:flex;flex-direction:column;align-items:flex-start;min-width:0;flex:1 1 280px}
 .practice-topline .practice-label,.story-practice-heading>label{font:14px/1.5 Arial,sans-serif!important;color:#b3cce1!important;padding:0!important}
 .story-practice-heading>label{flex:1 1 220px}
 .practice-topline .next-letter-guide,.story-practice-heading .story-next-guide{gap:10px!important;font:14px/1.4 Arial,sans-serif!important;margin-left:auto}
 .practice-topline .next-letter-guide>bdi,.story-practice-heading .story-next-guide>bdi{display:inline-block;min-width:54px;min-height:50px;padding:3px 8px;box-sizing:border-box;font:28px/1.4 Arial,sans-serif!important;text-align:center}
 .visible-text-size>button{min-width:44px!important;min-height:44px!important}
 #translation-hint:not([hidden]){display:block!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:3px 0 0!important;margin:0!important;font:12px/1.5 Arial,sans-serif!important;color:#b3cce1!important;white-space:normal!important}
 .story-typing-surface{border-radius:15px!important}
 .story-practice-heading{border-radius:11px 11px 0 0!important}
 #start-typing,#story-start-typing{font:700 16px/1.4 Arial,sans-serif!important;min-height:52px;padding:12px 20px!important;max-width:calc(100% - 40px);white-space:normal!important;text-align:center}
 .actions{gap:8px;flex-wrap:wrap}
}
@media(min-width:901px) and (max-width:1100px){
 #drill-steps,.story-embedded .activity-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 .practice-topline .practice-instructions,.story-practice-heading>label{flex-basis:100%}
 .practice-topline .next-letter-guide,.story-practice-heading .story-next-guide{margin-left:0!important}
 .practice-topline>.visible-text-size,.story-practice-heading>.visible-text-size{margin-left:auto!important}
}

/* Match Story Time's available activity buttons in the other two courses. */
#drill-steps>button:not(.selected):not(:disabled),
.steps>.drill-choice:not(.selected):not(:disabled){
 background:linear-gradient(#285e91 0px,#174572 42%,#103153 100%)!important;
 border-color:#3898e3!important;
 box-shadow:inset 0 2px #99d8ff99,inset 0 0 0 3px #062346,inset 0 -5px #071b33,0 3px 0 #020c19!important;
 color:#f7fbff!important;
}
/* Keep the narrator control icon-only, with its accessible label and tooltip. */

 .story-embedded #narration-panel .narration-settings{flex:0 0 auto;min-width:44px}
 .story-embedded #narration-panel .narration-settings>summary{box-sizing:border-box!important;width:44px!important;min-width:44px!important;padding:8px!important;white-space:nowrap!important}

.story-embedded #narration-panel .narration-settings>summary svg,.phone-audio-buttons details summary svg{display:block!important;flex:0 0 22px;width:22px;height:22px}

/* One Learn Arabic reference treatment, with visibility owned by Options. */
.mobile-guide-toggle{display:none!important}
:root body :is(#guidance-row,#story-keyboard,.guidance-row).shared-keyboard-reference[data-keyboard-reference=false]{display:none!important}
:root body :is(#guidance-row,#story-keyboard,.guidance-row).shared-keyboard-reference[data-keyboard-reference=true]{display:grid!important;grid-template-columns:minmax(0,1fr) 240px!important;align-items:center;gap:18px!important;padding:14px!important;margin:0!important;border:1px solid #287bb7;border-radius:13px;background:linear-gradient(130deg,#0e3255,#071d35);box-shadow:inset 0 1px #7ecaff33}
:root body .shared-keyboard-reference .keyboard-column,:root body .shared-keyboard-reference .keyboard{min-width:0;max-width:100%;margin:0!important}
:root body .shared-keyboard-reference .row{display:flex;direction:ltr;gap:5px!important;margin:0 0 5px!important}
:root body .shared-keyboard-reference .key{position:relative;display:flex!important;flex-direction:column;align-items:center;justify-content:center;flex:1;min-width:0!important;max-width:none;height:48px!important;min-height:0!important;padding:0!important;border:1px solid #4da7e9;border-radius:8px;background:linear-gradient(#205788,#123759);box-shadow:inset 0 1px #8dd2ff88,inset 0 0 0 2px #0b2847,inset 0 -4px #061b32;font:24px/1.2 Arial,sans-serif!important;color:#e5f3ff;overflow:hidden}
:root body .shared-keyboard-reference .key small{font:12px/1.2 Arial,sans-serif!important;color:#bdd7ed}
:root body .shared-keyboard-reference .key.home{border-bottom:3px solid #96cae9}
:root body .shared-keyboard-reference .key.space{flex:6}
:root body .shared-keyboard-reference .key.space,:root body .shared-keyboard-reference .shift-key{height:35px!important;font:14px/1.2 Arial,sans-serif!important}
:root body .shared-keyboard-reference .key.next{background:linear-gradient(#35b9ff,#008de9)!important;border-color:#c3efff!important;box-shadow:inset 0 1px #fff9,inset 0 -4px #0760a6,0 0 10px #159aff44!important}
:root body .shared-keyboard-reference .key-vowel,:root body .shared-keyboard-reference .key-mark,:root body .shared-keyboard-reference .key-punctuation{position:absolute;top:1px;right:3px;font:12px/1.1 Arial,sans-serif!important;color:#ffcd69}
:root body .shared-keyboard-reference .key-vowel{right:1px;color:#b9e3ff}
:root body .shared-keyboard-reference .key-mark{left:3px;right:auto}
:root body .shared-keyboard-reference .hand-guidance{display:flex!important;flex-direction:column;justify-content:center;align-items:stretch;gap:0;padding:12px!important;border:1px solid #388bc6;border-radius:12px;background:linear-gradient(#16436c,#0a2947);box-shadow:inset 0 1px #9bd8ff44;min-width:0}
:root body .shared-keyboard-reference .hands{display:flex;justify-content:center;gap:12px!important;direction:ltr}
:root body .shared-keyboard-reference .hand-unit{width:95px;min-width:0;text-align:center;font:14px/1.5 Arial,sans-serif!important;color:#c5dff5}
:root body .shared-keyboard-reference .hand-unit svg{display:block;width:100%;height:90px!important;overflow:visible;margin:0 auto 4px}
:root body .shared-keyboard-reference .palm{fill:#14416b;stroke:#75b8e7;stroke-width:3}
:root body .shared-keyboard-reference .hand-finger{fill:#1b4c76;stroke:#75b8e7;stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
:root body .shared-keyboard-reference .active-finger{fill:#aa64ed;stroke:#ecd4ff;stroke-width:4;filter:drop-shadow(0 0 4px #aa64ed99)}
:root body .shared-keyboard-reference .hand-hint{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)}
.shared-options label[data-option=reference]{order:8}
.shared-options .keyboard-help,.shared-options .keyboard-help-bar{grid-column:1/-1;order:20}
@media(max-width:1100px){
 :root body :is(#guidance-row,#story-keyboard,.guidance-row).shared-keyboard-reference[data-keyboard-reference=true]{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 :root body .shared-keyboard-reference .hand-unit svg{height:72px!important}
}
@media(max-width:900px){
 :root body .shared-keyboard-reference .key{height:40px!important;font-size:20px!important}
 :root body .shared-keyboard-reference .row{gap:3px!important}
 :root body .shared-keyboard-reference .key.space,:root body .shared-keyboard-reference .shift-key{font-size:11px!important}
 :root body .shared-keyboard-reference .key small{font-size:9px!important}
}

/* Same reading order as Story Time: heading/Options, description, settings, activities. */
.practice-panel>.drill-heading{order:0!important}
.practice-panel>#description{order:1!important}
.practice-panel>.practice-options-panel{order:2!important}
.practice-panel>#drill-steps,.practice-panel>.steps{order:3!important;margin-bottom:6px!important}
/* Harakaat labels need enough space to remain legible at desktop and phone sizes. */
:root body .shared-keyboard-reference .key:not(.space):not(.shift-key){height:58px!important;padding-top:8px!important}
:root body .shared-keyboard-reference .key-vowel,:root body .shared-keyboard-reference .key-mark{font:22px/1.25 Arial,sans-serif!important;top:4px!important;left:auto!important;right:2px!important;color:#ffe49b!important;text-shadow:0 1px 2px #00101f}
@media(max-width:900px){
 :root body .shared-keyboard-reference .key:not(.space):not(.shift-key){height:54px!important}
 :root body .shared-keyboard-reference .key-vowel,:root body .shared-keyboard-reference .key-mark{font-size:20px!important;right:0!important}
}

/* Revision unit selectors are native checkboxes, not the site's toggle switch. */
.revision-unit input[type=checkbox]::after{content:none!important;display:none!important}

/* A prepared switch needs no busy-message flash. Keep feedback for real waits. */

/* Never expose the initial Typing lesson while the unit catalogue is preparing. */
html:not([data-typing-catalogue-ready=true]) body.typing-course-view>main.workspace{visibility:hidden!important}

.practice-strip-cue{display:none}
@media(max-width:900px){
 .story-embedded .story-strip-cue,
 .practice-panel:has(#drill-steps>button:nth-child(3))>.typing-strip-cue{
  display:block;
  color:#b6d9f4;
  font-size:12px;
  margin:6px 0 0;
  order:3;
 }
 .story-embedded .story-strip-cue+.activity-tabs{margin-top:4px!important}
}

.story-embedded .story-menu-popover:popover-open{
 position:fixed;
 inset-inline:0;
 bottom:auto;
 width:min(calc(100% - 24px),38rem);
 box-sizing:border-box;
 margin:0 auto;
 overflow:auto;
 overscroll-behavior:contain;
 padding:14px;
 border:1px solid #5284a5;
 border-radius:12px;
 background:#0b2845;
 color:#f0f6ff;
 box-shadow:0 6px 22px #010a17aa;
}
.story-embedded .story-menu-popover::backdrop{background:transparent}
@media(min-width:901px){
 .story-embedded #story-section-menu{display:contents}
}
@media(max-width:900px){
 .story-embedded #story-section-menu:not(:popover-open){display:none}
}

.story-embedded #story-options-panel.story-menu-popover:not(:popover-open){display:none!important}
/* The embedded reader manages scroll while changing lessons. Exclude its
   changing height from anchoring the outer page. */
body.story-time-view #story-frame{overflow-anchor:none}
@media(min-width:901px){
 html:has(#story-frame:focus,#typing-frame:focus,#input.typing-capture:focus){overflow-anchor:none}
 #story-input.story-capture{right:auto;bottom:auto;width:2px;height:2px;min-height:0;padding:0;border:0;overflow:hidden}
 #typing-ghost,#target{overflow-anchor:none}
}

/* A single compact loop control occupies the original transport slot. */
.narration-loop-scopes{position:relative;flex:none;order:0;min-width:0}
.narration-loop-scopes[hidden],.loop-menu[hidden],#narration-panel[data-combined-loop] #narration-loop,.phone-narration-dock[data-combined-loop] [data-audio="narration-loop"]{display:none!important}
.loop-menu-toggle{white-space:nowrap;font:700 12px/1.2 Arial,sans-serif!important;height:40px;min-height:40px;padding:6px 9px!important}
.loop-menu-toggle[data-active="true"]{background:linear-gradient(#a349dc,#6322a0)!important;border-color:#d4a2ff!important}
.loop-menu{position:absolute;z-index:20000;top:calc(100% + 7px);left:0;width:190px;padding:6px;border:1px solid #65b7eb;border-radius:10px;background:#092b49;box-shadow:0 8px 24px #020c19bb;display:grid;gap:4px}
.loop-menu>button{width:100%!important;min-height:44px!important;white-space:nowrap;text-align:left;font:600 13px/1.3 Arial,sans-serif!important;padding:8px 12px!important;box-sizing:border-box}
.loop-menu>button[aria-checked="true"]{background:linear-gradient(#8a3bcc,#532091)!important;border-color:#d4a2ff!important}
.loop-menu>button[aria-checked="true"]::before{content:'✓ ';}
.loop-menu>button:focus-visible{outline:2px solid #fff;outline-offset:1px}
@media(max-width:900px){
 .story-embedded #narration-panel .narration-loop-scopes,.phone-narration-dock .phone-loop-scopes{grid-column:4!important;grid-row:1!important;order:4;margin:0;width:100%}
 .story-embedded #narration-panel .loop-menu-toggle,.phone-narration-dock .loop-menu-toggle{box-sizing:border-box;width:100%!important;min-width:0!important;min-height:44px!important;height:44px;font:700 11px/1.2 Arial,sans-serif!important;padding:4px 1px!important}
 .narration-loop-scopes .loop-menu{left:auto;right:0;max-width:calc(100vw - 32px)}
}
@media(min-width:901px){
 .story-embedded #narration-panel[data-combined-loop] .narration-controls{flex-wrap:nowrap!important;gap:4px!important}
 .story-embedded #narration-panel[data-combined-loop] .narration-controls>button{min-width:40px!important;width:40px;padding:4px!important}
 .story-embedded #narration-panel[data-combined-loop] .narration-controls>.audio-player-timeline{min-width:80px!important;flex:1 1 80px!important}
}
