/* A single visual and motion language for browse, learn, record and feedback. */
:root{--flow-radius:20px;--flow-control:12px;--flow-ease:cubic-bezier(.16,1,.3,1);--flow-quiet:#efedf4;--flow-ink:#37324f;--flow-white:#fff;--flow-copy:#64646b;--flow-line:#e7e4ec;--flow-focus:#116b66}
body :is(.menu-primary,.summary-primary,.lesson-next,#next,#retryBottom,.setup-next){border-radius:var(--flow-control)!important;box-shadow:none!important;border:0!important;background:var(--flow-ink)!important;color:var(--flow-white)!important;min-height:44px;font-weight:750;transition:transform .16s var(--flow-ease),background-color .16s ease}
body #hubView .direction-next .menu-primary{background:var(--flow-white)!important;color:var(--flow-ink)!important}
body :is(.text-btn,.listen-btn,.slow-btn,.arena-guide-action,.lesson-stage-action,.study-stages a,.study-stages button){border-radius:var(--flow-control)!important;box-shadow:none!important;font-size:14px;min-height:44px}
body :is(.listen-btn,.slow-btn,.arena-guide-action,#compareSpeed){background:var(--flow-quiet)!important;color:var(--flow-ink)!important;border:0!important}
body :is(.menu-primary,.summary-primary,.lesson-next,#next,#retryBottom,.setup-next,.listen-btn,.slow-btn,.arena-guide-action):active{transform:scale(.97)}
body #hubView :is(.learning-card,.lesson-intro,.learn-panel,.lesson-content,.course-stop,.open-progress-card,.setup-card){border-radius:var(--flow-radius)!important;background:var(--flow-white);box-shadow:var(--ref-shadow);border:0}
body :is(#arenaGuide,#arenaLessonGuide,.help-dialog){background:var(--flow-white)!important;color:var(--ref-ink)!important;border-radius:24px!important;box-shadow:0 24px 64px rgb(37 37 42 / .18)!important}
body :is(#arenaGuide,#arenaLessonGuide,.help-dialog) h2{font:800 24px/1.2 var(--ui)!important;letter-spacing:-.035em}
body :is(.study-stages,.sound-tabs,.open-depth){padding:4px;border-radius:14px;background:var(--flow-quiet)!important;box-shadow:none!important}
body .study-stages [aria-current=step]{background:var(--flow-white)!important;color:var(--flow-ink)!important;box-shadow:0 2px 6px rgb(37 37 42 / .07)!important}
body #practiceView :is(#lessonTitle,.practice-heading h1){color:var(--ref-ink);font:800 clamp(22px,3vw,30px)/1.15 var(--ui)!important;letter-spacing:-.035em}
body #record{background:transparent!important;color:var(--flow-ink)!important;border:0!important;box-shadow:none!important;transition:transform .16s var(--flow-ease),box-shadow .2s ease}
body #practiceView #record>.icon{background:var(--flow-ink)!important;color:var(--flow-white)!important;border-color:var(--flow-white)!important;box-shadow:0 0 0 5px var(--flow-quiet)!important}body #record span{color:var(--flow-ink)}
body #arenaFocus{border-radius:16px!important;box-shadow:none!important}body .voice-compare{background:var(--flow-quiet)!important;border:0!important;padding:12px!important}
body :is(#compareReference,#compareTake){border-radius:10px!important;background:var(--flow-white)!important;color:var(--flow-ink)!important;box-shadow:none!important}
body #summaryView{border-radius:var(--flow-radius)!important;background:var(--flow-white)!important;box-shadow:var(--ref-shadow)!important}body #summaryTitle{color:var(--ref-ink);font:800 clamp(26px,3vw,36px)/1.1 var(--ui)!important;letter-spacing:-.035em}
/* Avoid duplicate legacy reward entrances; orchestration owns the transition. */
body[data-mode=result] #arenaFocus,body #summaryTitle{animation:none!important}
@keyframes flow-recording{0%,100%{box-shadow:0 0 0 5px var(--flow-quiet)}50%{box-shadow:0 0 0 13px var(--flow-quiet)}}
body[data-mode=recording] #record>.icon{animation:flow-recording 1.4s ease-in-out infinite!important}
@keyframes flow-speaker{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
body .is-audio-playing{outline:2px solid var(--flow-focus);outline-offset:2px}body .is-audio-playing svg{animation:flow-speaker .85s ease-in-out infinite;transform-origin:center}
@media(hover:hover){body :is(.lesson-tile,.course-card,.explore-skill,.ref-choice){transition:transform .2s var(--flow-ease),box-shadow .2s ease}body :is(.lesson-tile,.course-card,.explore-skill,.ref-choice):hover{transform:translateY(-3px);box-shadow:0 8px 24px rgb(37 37 42 / .08)!important}.ref-choice:hover svg{transform:rotate(-4deg)}.ref-choice svg{transition:transform .25s var(--flow-ease)}}
body :is(button,a,input):focus-visible{outline:3px solid var(--flow-focus);outline-offset:3px}
@media(max-width:759px){body :is(#arenaGuide,#arenaLessonGuide){border-radius:24px 24px 0 0!important}body .voice-compare{padding:8px!important}body #practiceView :is(#lessonTitle,.practice-heading h1){font-size:23px!important}}
@media(prefers-reduced-motion:reduce){body[data-mode=recording] #record>.icon,body .is-audio-playing svg{animation:none!important}body :is(button,a,.ref-choice svg){transition:none!important}body :is(.lesson-tile,.course-card,.explore-skill,.ref-choice):hover{transform:none}}

body #practiceView #targetWord{color:var(--flow-ink)!important}
html[data-motion-preview=full] body[data-mode=recording] #record>.icon{animation:flow-recording 1.4s ease-in-out infinite!important}html[data-motion-preview=full] body .is-audio-playing svg{animation:flow-speaker .85s ease-in-out infinite!important}

/* The illustration has its own stage; movement never changes layout. */
.motion-scene{overflow:visible;pointer-events:none}
.motion-scene g,.motion-scene circle{transform-box:fill-box;transform-origin:center}
.scene-back{transform:rotate(-8deg)}.scene-front{transform:rotate(4deg)}
.scene-signal path{stroke-dasharray:100;stroke-dashoffset:0}
body .ref-hero-art{overflow:visible}
body .ref-choice svg{transform-box:fill-box;transform-origin:center}
body #targetWord{will-change:auto}
@media(prefers-reduced-motion:reduce){.motion-scene *{animation:none!important}}

/* Word-only carousel stage: controls below never translate. */
body #practiceView .word-deck-stage{position:relative;isolation:isolate;width:min(100%,460px);margin:0 auto 18px;perspective:900px}
.word-deck-stage::before,.word-deck-stage::after{content:"";position:absolute;inset:0 5%;border-radius:24px;background:#dcebe5;transform:rotate(-5deg);z-index:-2;pointer-events:none}
.word-deck-stage::after{background:#e5dff0;transform:rotate(5deg);z-index:-1}
body #practiceView .word-deck-face{position:relative;box-sizing:border-box;border-radius:22px;background:#f3eff8;padding:22px 16px;min-height:130px;box-shadow:0 6px 20px rgb(55 50 79 / .06);transform-origin:50% 85%}
body #practiceView .word-deck-face #targetWord{margin:0!important;line-height:1.1!important}
body #practiceView .word-deck-face #targetIpa{margin:10px 0 0!important}
body #practiceView .word-deck-ghost{position:absolute;inset:0;pointer-events:none;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center}
.word-deck-ghost strong{font-size:clamp(40px,6vw,72px);line-height:1.1;letter-spacing:-.05em;color:#37324f}.word-deck-ghost span{margin-top:10px;color:#116b66}
body #practiceView .word-stage{overflow:visible}
@media(max-width:759px){body #practiceView .word-deck-stage{width:calc(100% - 28px);max-width:330px;margin-bottom:14px}body #practiceView .word-deck-face{min-height:114px;padding:18px 12px}}
@media(max-height:700px){body #practiceView .word-deck-face{min-height:94px;padding:12px}.word-deck-ghost strong{font-size:40px}}

body #practiceView .word-deck-stage{height:150px;clip-path:inset(-20px -16px);flex-shrink:0}body #practiceView .word-deck-face{height:100%;min-height:0;display:flex;flex-direction:column;justify-content:center}body #practiceView .word-deck-face #targetIpa{min-height:24px;flex-shrink:0}@media(max-width:759px){body #practiceView .word-deck-stage{height:135px}}@media(max-height:700px){body #practiceView .word-deck-stage{height:118px}}

body[data-mode=ready] #practiceView #status{display:block!important;min-height:34px!important;line-height:17px!important;margin-top:8px!important}

/* Compact lesson masthead, inspired by 21st's isometric progress component. */
body #practiceView .journey-header{background:#37324f;color:white;border-radius:22px;padding:16px 20px;margin-bottom:12px;overflow:hidden;box-shadow:0 5px 0 #ddd5e8}
body #practiceView .journey-header .lesson-header{margin:0!important;gap:12px!important}
body #practiceView .journey-header #lessonTitle{color:#fff!important;font-size:clamp(20px,2.3vw,28px)!important;line-height:1.15!important;margin:0!important;letter-spacing:-.025em!important}
body #practiceView .journey-header :is(.eyebrow,#lessonSubtitle,.duration){display:none!important}
body #practiceView .journey-header .session-progress{display:flex!important;align-items:center;gap:12px;margin:2px 0 0!important;height:62px!important}
body #practiceView .journey-header .session-progress>div:first-child{flex:0 0 98px;margin:0!important}
body #practiceView .journey-header #position{color:#d7e9e4!important;font-size:13px!important;font-weight:700}
body #practiceView .journey-header #completedLabel,body #practiceView .journey-header #progressSteps{position:absolute!important;width:1px!important;height:1px!important;clip-path:inset(50%);overflow:hidden}
body #practiceView .journey-scene{flex:1;min-width:0;height:76px;display:flex;align-items:center;justify-content:flex-end;pointer-events:none}
.journey-scene svg{width:100%;height:76px;max-width:420px;overflow:visible}
body #practiceView .journey-header button{background:#fff!important;color:#37324f!important;border:0!important}
@media(max-width:759px){body #practiceView .journey-header{padding:14px 14px 8px;border-radius:18px;margin-bottom:10px}body #practiceView .journey-header #lessonTitle{font-size:20px!important}body #practiceView .journey-header .session-progress{height:56px!important;gap:0}body #practiceView .journey-header .session-progress>div:first-child{flex-basis:76px}.journey-scene svg{height:64px}}
@media(max-height:700px){body #practiceView .journey-header{padding:10px 12px 4px}body #practiceView .journey-header #lessonTitle{font-size:18px!important}body #practiceView .journey-header .session-progress{height:46px!important}.journey-scene svg{height:58px}}

/* Selected C: generous type and a compact segmented speech dial. */
body #practiceView .dial-header{position:relative;min-height:116px;padding:22px 132px 18px 22px;box-sizing:border-box}
body #practiceView .dial-header .lesson-header{min-height:40px}
body #practiceView .dial-header .session-progress{height:28px!important;margin:6px 0 0!important}
body #practiceView .dial-header #lessonTitle{font-size:clamp(20px,2vw,27px)!important}
.dial-scene{position:absolute;right:18px;top:50%;transform:translateY(-50%);width:100px;height:100px;pointer-events:none}.dial-scene svg{width:100%;height:100%}.dial-voice{transform-box:fill-box;transform-origin:center}
body #activityContainer .activity-nav{align-items:center;gap:8px;margin-bottom:10px}
body #activityContainer .activity-nav>#backToLesson{display:inline-flex;align-items:center;gap:8px;background:#efedf4;color:#37324f!important;border-radius:12px;min-height:40px;padding:0 14px;font-size:14px;font-weight:800;text-decoration:none}
body #activityContainer .activity-nav>#backToLesson::before{content:"";width:16px;height:16px;background:currentColor;clip-path:polygon(0 0,46% 8%,50% 13%,54% 8%,100% 0,100% 88%,54% 100%,50% 95%,46% 100%,0 88%)}
body #activityContainer .arena-options-action{background:#efedf4!important;color:#37324f!important;border:0!important;border-radius:12px!important;min-height:40px;font-size:14px;font-weight:800;padding:0 14px}
body #hubView :is(.open-heading,.setup-heading) h1{letter-spacing:-.035em}
@media(max-width:759px){body #practiceView .dial-header{min-height:112px;padding:16px 104px 12px 16px}body #practiceView .dial-header #lessonTitle{font-size:19px!important}.dial-scene{right:12px;width:80px;height:80px}body #practiceView .dial-header .session-progress{height:22px!important}}
@media(max-height:700px){body #practiceView .dial-header{min-height:96px;padding:12px 94px 10px 12px}body #practiceView .dial-header #lessonTitle{font-size:17px!important}.dial-scene{width:72px;height:72px;right:10px}body #activityContainer .activity-nav{margin-bottom:6px}}

/* Mobile audit: retain useful controls and results; remove decorative clutter. */
.word-deck-stage::before,.word-deck-stage::after{display:none!important}
body[data-mode=result] #practiceView .word-stage{flex:0 0 auto!important;min-height:0!important;height:auto!important;padding:0!important;margin:0!important}
body[data-mode=result] #practiceView .word-deck-stage{height:44px!important;margin:0 auto!important}
body[data-mode=result] #practiceView .word-deck-face{background:transparent!important;box-shadow:none!important;padding:0!important;border-radius:0!important}
body[data-mode=result] #practiceView #targetWord{font-size:28px!important}
body #summaryView #restart{background:#efedf4!important;color:#37324f!important}
body #summaryView :is(#restart,#lessonReview)>.icon{display:none!important}
@media(max-width:759px){
body #summaryView{padding:18px 16px!important;gap:10px!important}
body #summaryView #summaryTitle{font-size:26px!important;margin:0!important}
body #summaryView #summaryDescription{font-size:14px!important;line-height:1.4!important;margin:0!important}
body #summaryView .summary-stats{margin:0!important;padding:0!important}
body #summaryView .summary-word{min-height:34px!important;padding:6px 4px!important;line-height:1.3!important;font-size:14px!important;box-sizing:border-box}
body #summaryView .summary-word :is(strong,span){font-size:14px!important}
body #summaryView:not(:has(.summary-word:nth-child(9))) #summaryWords{max-height:none!important;flex:0 0 auto!important;overflow:visible!important}
body #summaryView :is(#restart,#lessonReview){min-height:44px!important;margin:0!important;padding:10px!important;font-size:14px!important}
}

/* Shared calm surfaces for setup, browsing and meaningful saved progress. */
body #hubView .onboard-setup .setup-track,body #hubView .onboard-setup .setup-icon{display:none!important}
body #hubView .onboard-setup .setup-eyebrow{color:#64646b!important;font-size:13px!important;letter-spacing:0!important;margin:14px 0!important}
body #hubView .onboard-setup .setup-intro{font-size:15px!important;line-height:1.5!important;margin:0 0 16px!important}
body #hubView .onboard-setup .setup-choice{min-height:76px!important;padding:16px!important;border-radius:16px!important;background:white!important;color:#37324f!important;box-shadow:0 2px 8px rgb(55 50 79 / .04)!important;border:1px solid #e7e4ec!important;gap:12px!important}
body #hubView .onboard-setup .setup-choice[aria-pressed=true]{border-color:#116b66!important;background:#edf5f1!important}
body #hubView .onboard-setup .setup-options{gap:12px!important}
body #hubView .onboard-setup .setup-choice strong{font-size:17px!important}body #hubView .onboard-setup .setup-choice small{font-size:14px!important;line-height:1.4!important}
body #hubView .onboard-setup h1{color:#37324f!important;font-size:clamp(26px,4vw,34px)!important}
body #hubView .onboard-setup .setup-footnote{font-size:13px!important;color:#64646b!important}
body #hubView .prep-stages,body #hubView .voice-mark>span{display:none!important}
body #hubView .voice-mark,body #hubView .voice-mark *{animation:none!important}
body #hubView .preparation-card{border-radius:20px!important;background:white!important;box-shadow:none!important}
body #hubView .prep-tip{background:#efedf4!important;border-radius:12px!important}
body #hubView .sound-map-tile{background:white!important;border:1px solid #e7e4ec!important;border-radius:16px!important;box-shadow:none!important;transform:none!important}
body #hubView .sound-map-tile .map-ipa{color:#37324f!important}
body #hubView :is(#soundSearch,#soundFamily){border:1px solid #dedbe5!important;background:white!important;color:#37324f!important;border-radius:12px!important;min-height:44px;font-size:14px!important}
body #hubView .sound-family-heading h2{font-size:18px!important;color:#37324f!important}
body #hubView .sound-family-heading>span,body #hubView .sound-coverage{display:none!important}
body #hubView .open-progress-card{padding:18px!important;border-radius:18px!important;background:white!important;box-shadow:none!important;border:1px solid #e7e4ec!important}
body #hubView .open-progress-card[hidden]{display:none!important}
body #hubView .open-progress-card h2{font-size:20px!important;color:#37324f!important;margin:0 0 10px!important}
body #hubView .open-progress-card p{font-size:14px!important;line-height:1.5!important}
body #hubView .open-progress-card .clean-progress-stat{display:flex;align-items:baseline;justify-content:space-between;gap:14px;margin:0!important;padding:12px 0;border-bottom:1px solid #efedf4}
.clean-progress-stat strong{color:#37324f;font-size:17px}.clean-progress-stat span{text-align:right;color:#64646b}
body #hubView .open-history-row{min-height:48px;border-radius:10px!important;box-shadow:none!important;padding:10px 12px!important}
body #hubView .open-detail-links [hidden]{display:none!important}
body #hubView :is(.open-progress-card,.sound-map-tile,.setup-choice):hover{transform:none!important}
@media(max-width:759px){body #hubView .onboard-setup{padding-inline:4px!important}body #hubView .onboard-setup>header{gap:14px!important}.clean-progress-stat strong{font-size:15px}.clean-progress-stat span{font-size:13px}}

/* Routine guidance is carried by named controls. Keep status geometry stable. */
#practiceView .reference-caption,
#practiceView #recordHint,
#practiceView #readyPrompt,
.coach-footnote {display:none!important}
#practiceView #status.routine-instruction {visibility:hidden!important}

/* Remove only explicitly reviewed duplicate instructions. */
.concise-redundant {display:none!important}

body #practiceView #feedback #feedbackSubtitle.concise-required {display:block!important}

/* Compact sound-first feedback. Full sound guidance remains in its existing sheet. */
body #practiceView #feedback .feedback-overview {min-height:0!important; margin:0!important;justify-content:center!important}
body #practiceView #feedback #scoreRing {width:auto!important;height:auto!important;display:flex!important;gap:6px!important;align-items:baseline!important;background:none!important;padding:0!important}
body #practiceView #feedback #percentage {font-size:22px!important;line-height:1.2!important}
body #practiceView #feedback #scoreRing small {font-size:13px!important}
body #practiceView #arenaFocus {padding:12px 16px!important;min-height:44px!important}
body #practiceView #arenaFocusCue {display:none!important}
body #practiceView #arenaFocusTitle {font-size:16px!important}
body #practiceView .voice-compare {display:flex!important;flex-wrap:wrap!important;gap:8px!important;background:none!important;padding:0!important}
body #practiceView .voice-compare .comparison-player {display:block!important;flex:1!important;min-width:0!important}
body #practiceView .voice-compare input[type=range],body #practiceView .voice-compare .comparison-time {display:none!important}
body #practiceView :is(#compareReference,#compareTake) {width:100%!important;min-height:48px!important;background:var(--flow-quiet)!important;justify-content:center!important;font-size:15px!important}
body #practiceView #compareSpeed {flex:0 0 auto!important;min-height:44px!important;padding:8px 12px!important}

body #practiceView[data-kind="diagnostic"] :is(.session-progress,.dial-scene) {display:none!important}
body #practiceView[data-kind="diagnostic"] .journey-header {grid-template-columns:1fr!important;min-height:0!important;padding:18px 22px!important}

/* Keep the confirmed listening answer readable after controls lock. */
#hubView [data-depth-answer].correct:disabled { opacity:1; color:var(--ink); border:2px solid currentColor; }
