/* Phone-sized desktop preview; real phones use the full viewport. */
body{background:#e5e7df;background-image:radial-gradient(ellipse at 50% 15%,#f8f8f1,transparent 70%);padding:24px 0}
.shell{display:block;position:relative;width:414px;max-width:calc(100vw - 32px);height:min(880px,calc(100dvh - 48px));min-height:0;margin:0 auto;border:9px solid #26332e;border-radius:42px;overflow:auto;scrollbar-width:none;background:#f9f7ef;box-shadow:0 25px 65px #24352830,0 0 0 2px #a8ada1;background-image:url('airport-background.png');background-size:auto 350px;background-position:54% -40px;background-repeat:no-repeat}
.shell::-webkit-scrollbar{display:none}
aside{position:relative;top:auto;height:190px;min-height:0;padding:24px 20px;background:transparent;color:#214f42;display:block}
.brand{width:fit-content;gap:10px;font-size:17px;line-height:1.18;background:#fffcf096;border:1px solid #ffffff55;border-radius:17px;padding:9px 13px 9px 9px;text-shadow:0 0 2px #fffdf5,0 1px 4px #fffdf5}
.brand-mark{display:none}.brand img{width:44px;height:44px;display:block}
.aside-copy,.airport-art,.aside-bottom{display:none}
main{padding:24px 21px 25px;border-radius:28px 28px 0 0;background:linear-gradient(#faf9f2f0,#faf9f5 310px);min-height:calc(100% - 190px);box-shadow:0 -8px 25px #42533c08}
header{padding-bottom:15px;gap:10px;align-items:flex-start}.header-title{font-size:12px;line-height:1.4;max-width:160px}.eyebrow{font-size:9px;letter-spacing:1.3px}
select{max-width:133px;padding:8px 5px;font-size:10px;border-radius:8px}
nav{margin:18px 0 25px;gap:6px}nav span{font-size:9px;padding-top:8px}
h2{font-family:Segoe UI,Arial,sans-serif;font-weight:700;font-size:28px;letter-spacing:-.8px;line-height:1.16;margin:14px 0}
.subtitle{font-size:13px;line-height:1.65}.pill{font-size:9px;letter-spacing:.3px;padding:6px 8px}
.card{padding:18px;border-radius:18px;background:#fffefbf5}.card.sage{background:#eaf0e1f5}.russian{font-size:20px;line-height:1.4}
.translation{font-size:13px}.small{font-size:11px}.label{font-size:9px;letter-spacing:1.1px}.actions{gap:9px;margin-top:17px}.actions>.btn{flex:1}.btn{font-size:13px;padding:14px 14px;min-height:48px;border-radius:13px}
.intro-grid{margin:20px 0;gap:9px}.intro-grid b{font-size:12px}.intro-grid span{font-size:10px}.count{font-family:inherit;font-size:19px}
.utterance{padding:11px 6px;grid-template-columns:27px 1fr 34px;gap:8px;background:#ffffffa8}.utterance.staff{background:#edf1e5}.role{width:26px;height:26px}.utterance p{font-size:14px}.utterance small{font-size:11px}.play{flex-shrink:0}
.phrase{gap:9px}.phrase p{font-size:14px}.phrase small{font-size:11px}.bookmark{padding:8px}.recorder{padding:23px 15px}footer{margin-top:25px;font-size:10px}
@media(max-width:480px){body{padding:0;background:#faf9f5}.shell{width:100%;max-width:none;height:auto;min-height:100dvh;border:0;border-radius:0;margin:0;box-shadow:none;overflow:visible;background-size:auto 350px}aside{height:190px}.brand{font-size:17px}main{padding:24px 22px}select{max-width:140px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.shell{background-position:72% -105px}.intro-grid{display:none}#screen>.btn.full{margin-top:8px}@media(max-width:480px){.shell{background-position:72% -105px}}
/* Fixed phone viewport. Only the dialogue panel scrolls. */
html,body{height:100%;overflow:hidden}
.shell{height:min(880px,calc(100dvh - 48px));min-height:0;display:flex;flex-direction:column;overflow:hidden}
aside{height:150px;flex:0 0 150px;padding:18px 20px}
main{flex:1;min-height:0;display:flex;flex-direction:column;padding:16px 20px 18px;background:linear-gradient(#faf9f2d9,#faf9f5ed)}
header{flex-shrink:0;padding-bottom:10px}.header-title{margin-top:4px}
nav{flex-shrink:0;margin:12px 0 14px}
#screen{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}
#screen>[hidden]{display:none!important}
#screen>h2{font-size:26px;margin:10px 0;flex-shrink:0}
#screen>.pill{align-self:flex-start}
#screen>.subtitle{line-height:1.5;margin-bottom:10px}
#screen>.card{margin:10px 0;padding:15px}
#screen>.actions{margin-top:12px}
#screen>.btn.full{flex-shrink:0}
#screen>.small{margin-bottom:8px}
.screen-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding-top:8px;min-height:54px;flex-shrink:0}
.screen-pager .btn{min-height:44px;padding:10px 16px}
footer{display:none}
#notice:empty{display:none}#notice{flex-shrink:0;margin-top:8px;font-size:11px}
.card .label{margin-bottom:8px}.card .actions{margin-top:10px}.russian{font-size:19px;line-height:1.4}.translation{margin-top:10px;padding-top:8px}
.recorder{margin-top:10px;padding:14px}.recorder p{font-size:11px;line-height:1.4}.hint{padding:10px;font-size:12px;margin-top:8px}
.player-row{margin-bottom:10px}.success-icon{margin-bottom:8px;width:38px;height:38px}
.shell[data-stage="listen"] #screen>.subtitle,.shell[data-stage="listen"] #screen>details{display:none}
.shell[data-stage="listen"] #screen>h2{font-size:23px}
.shell[data-stage="listen"] .dialogue-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin-top:12px;padding:14px 2px;scrollbar-width:thin;mask-image:linear-gradient(transparent,#000 12px,#000 calc(100% - 12px),transparent)}
.shell[data-stage="listen"] .utterance{background:#ffffff73}
.shell[data-stage="listen"] .utterance.staff{background:#dfe9d385}
.shell[data-stage="listen"] .utterance.current{background:#d2e3bcaa}
.shell[data-stage="listen"] #screen>.actions{flex-shrink:0;margin-top:8px}
.shell[data-stage="listen"] #screen>.actions>.btn{font-size:12px;padding:10px;min-height:44px}
@media(max-width:480px){.shell{height:100dvh;min-height:0}aside{height:140px;flex-basis:140px}main{padding:14px 20px max(12px,env(safe-area-inset-bottom))}}
@media(max-height:740px){aside{height:100px;flex-basis:100px;padding:12px 18px}.brand{font-size:14px;padding:6px 10px}.brand img{width:36px;height:36px}.shell{background-position:72% -150px}main{padding-top:12px}nav{margin:8px 0 10px}#screen>h2{font-size:23px}#screen>.subtitle{font-size:12px}}

#screen>*{flex-shrink:0}.shell[data-stage='listen'] .dialogue-list{flex-shrink:1}
/* Keep the airport scene inside its own header, above the lesson panel. */
.shell{background-image:none}
aside{background-image:url('airport-background.png');background-size:cover;background-position:center bottom;background-repeat:no-repeat;isolation:isolate}
main{border-radius:0;box-shadow:none;background:#faf9f5}
/* Chapter 3: diagonal overhead security scene, contained above the panel. */
.shell[data-chapter="3"][data-hub="false"] aside{background-image:url('security-bright.png');background-position:center 58%}
@media(min-height:741px){.shell[data-chapter="3"][data-hub="false"] aside{height:190px;flex-basis:190px;background-position:center 60%}}

/* Each lesson uses its own scene; keep artwork above the reading panel. */
.shell[data-chapter][data-hub="false"] aside{background-image:var(--chapter-art);background-position:center 48%}
.shell[data-chapter="4"][data-hub="false"] aside{background-position:center 23%}
.shell[data-chapter="5"][data-hub="false"] aside{background-position:center 30%}
.shell[data-chapter="6"][data-hub="false"] aside{background-position:center 62%}
.shell[data-chapter="7"][data-hub="false"] aside{background-position:center 60%}
.shell[data-chapter="8"][data-hub="false"] aside{background-position:center 55%}
.shell[data-hub="false"] aside{
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  justify-content:space-between;
  padding:8px;
  gap:8px;
}
#lesson-home{position:relative;isolation:isolate;min-height:44px;flex-shrink:0;padding:0 8px;color:#214f42;background:transparent;border:0;border-radius:10px;font-family:inherit;font-weight:650;font-size:13px}
#lesson-home[hidden]{display:none}

#lesson-home::before{content:'';position:absolute;inset:6px 0;z-index:-1;border-radius:10px;background:#fffcf096}

.shell[data-chapter="11"][data-hub="false"] aside{background-position:center top}
@media (min-height:560px){
  .shell[data-hub="false"]:is([data-stage="listen"],[data-stage="practice"]) aside{
    flex-basis:clamp(140px,28dvh,225px);
  }
}


.shell[data-stage="practice"] .recorder{padding-block:8px}
.shell[data-stage="practice"] #screen>.card{padding-block:10px;margin-block:5px}


/* Reserve the quiet upper edge for the two lesson controls. */
.shell.cafe-lesson[data-chapter][data-hub="false"] aside{
  --art-top:clamp(34px,6.8dvh,54px);
  background-color:#f3dfc8;
  background-image:linear-gradient(to bottom,#f3dfc8,transparent 14px),var(--chapter-art);
  background-position:center var(--art-top),center var(--art-top);
  background-size:100% 15px,100% auto;
  background-repeat:no-repeat;
}


@media(min-height:560px){
  .shell.cafe-lesson[data-hub="false"]:is([data-stage="listen"],[data-stage="practice"]) aside{
    flex-basis:clamp(150px,31dvh,244px);
  }
}

.shell[data-chapter="62"][data-hub="false"] aside{
  --art-top:clamp(34px,6.8dvh,54px);
  background-color:#f8e4c8;
  background-image:linear-gradient(to bottom,#f8e4c8,transparent 12px),var(--chapter-art);
  background-position:center var(--art-top),center var(--art-top);
  background-size:100% 13px,100% auto;
  background-repeat:no-repeat;
}

/* Keep controls outside the complete, uncropped illustration. */
.shell[data-chapter][data-hub="false"][data-stage] aside{
  background:#f4e8d7;
  overflow:hidden;
  isolation:isolate;
}
.shell[data-hub="false"] aside .brand{
  position:absolute;
  top:8px;
  right:8px;
  padding:6px 8px;
  gap:7px;
  font-size:14px;
  z-index:2;
}
.shell[data-hub="false"] aside .brand img{width:36px;height:36px}
.shell[data-hub="false"] #lesson-home{
  position:absolute;
  top:8px;
  left:8px;
  z-index:2;
}
.lesson-artwork{
  position:absolute;
  inset:66px 0 0;
  overflow:hidden;
  background:#f4e8d7;
}
.lesson-artwork::before{
  content:"";
  position:absolute;
  inset:-24px;
  background-image:var(--chapter-art);
  background-size:cover;
  background-position:center;
  filter:blur(20px);
  opacity:.3;
}
.lesson-artwork>img{
  position:relative;
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}
.shell[data-hub="true"] .lesson-artwork{display:none}


/* The lesson title is already shown above the progress indicator. */
.shell[data-stage="listen"] #screen>.pill,
.shell[data-stage="listen"] #screen>h2{display:none}
.shell[data-stage="listen"] .header-title{
  font-size:17px;
  line-height:1.3;
  max-width:none;
}


/* Direct navigation between lesson stages. */
#steps button{flex:1;min-width:0;min-height:44px;margin:0;padding:10px 0 5px;border:0;border-top:3px solid #e0e5db;border-radius:0;background:transparent;box-shadow:none;text-align:left;font:inherit;font-size:11px;line-height:1.3;color:#788987;cursor:pointer}
#steps button.active{border-top-color:#204f43;color:#163f3d;font-weight:700}
#steps button.done{border-top-color:#99b38a}
#steps button:hover:not(:disabled){color:#087f70;background:rgba(8,127,112,.06)}
#steps button:focus-visible{outline:2px solid #087f70;outline-offset:2px}
#steps button:disabled{cursor:default;opacity:.55}
@media(max-width:400px){#steps button{font-size:9px}}

.shell[data-chapter="77"] .lesson-artwork{inset:0}
.shell[data-chapter="77"] .lesson-artwork>img{object-fit:cover;object-position:center top}
.shell[data-chapter="77"] .lesson-artwork::before{display:none}

/* Compact lesson chrome and full-width artwork. */
.shell[data-hub="false"] .lesson-artwork{inset:50px 0 0}
.shell[data-hub="false"] .lesson-artwork::before{display:none}
.shell[data-hub="false"] .lesson-artwork>img{object-fit:cover;object-position:center top}
.shell[data-hub="false"] aside .brand{top:5px;right:8px;padding:3px 7px;font-size:12px;border-radius:12px;gap:6px}
.shell[data-hub="false"] aside .brand img{width:30px;height:30px}
.shell[data-hub="false"] #lesson-home{top:5px;padding:8px;min-height:38px;font-size:12px;border-radius:10px}
.shell[data-hub="false"] header{align-items:center;padding-bottom:8px}
.shell[data-hub="false"] #chapterTag{font-size:10px;letter-spacing:.5px;line-height:1.4}
.shell[data-stage="intro"] #headerTitle{display:none}
.shell[data-stage="intro"] #screen>.pill{display:none}
.shell[data-chapter="77"][data-hub="false"] .lesson-artwork{inset:0}

/* One consistent bookmark control in dialogues and lesson summaries. */
.shell .bookmark{display:inline-grid;place-items:center;flex-shrink:0;width:44px;height:44px;min-height:44px;padding:10px;border:1px solid #cbdacf;border-radius:12px;color:#51766a;background:#ffffffb0}
.shell .bookmark svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.shell .bookmark.saved{background:#d8eee1;border-color:#91bea7;color:#087f70}
.shell .bookmark.saved svg{fill:currentColor}
.shell .utterance{grid-template-columns:27px minmax(0,1fr) 44px}
.utterance-controls{display:flex;flex-direction:column;align-items:center;gap:5px}
.shell .utterance-controls .play{width:44px;height:44px}
#save-toast{position:absolute;z-index:20;bottom:85px;left:18px;right:18px;pointer-events:none;padding:12px 16px;border-radius:14px;background:#214f42;color:#fffdf5;font-size:12px;line-height:1.4;text-align:center;box-shadow:0 5px 20px #163f3925}
#save-toast[hidden]{display:none}

/* Keep playback and saving on one line, without increasing card height. */
.shell .utterance{grid-template-columns:27px minmax(0,1fr) 92px}
.utterance-controls{flex-direction:row;align-items:center;gap:4px}
@media(max-width:380px){.shell .utterance{grid-template-columns:24px minmax(0,1fr) 88px;gap:5px}.utterance-controls{gap:0}}

/* Saving feedback is a notice, visually distinct from green lesson actions. */
#save-toast{background:#fff0c7;color:#594319;border:1px solid #d6ac58;box-shadow:0 6px 22px #382a1924}

.trainer-start{width:100%;margin:0 0 14px}
.shell[data-phrase-trainer="true"] #screen{overflow:hidden;display:flex;flex-direction:column;gap:12px}
.trainer-heading{display:flex;justify-content:space-between;align-items:center;flex:0 0 auto;gap:12px}
.trainer-content{flex:1 1 0!important;min-height:0;overflow-y:auto;padding:2px}
.trainer-instruction{margin:12px 0}
.trainer-quote{padding:20px;background:#eaf0e1;border:1px solid #d8e2d0;border-radius:18px;margin:12px 0}
.trainer-quote .russian{font-size:23px;line-height:1.45}
.trainer-players{display:flex;gap:10px;flex-wrap:wrap}
.trainer-players .btn{flex:1;min-width:130px}
.trainer-controls{flex:0 0 auto}
.trainer-controls>.actions{margin:0;display:flex}
.trainer-minor{display:flex;align-items:center;justify-content:space-between;min-height:36px}
.trainer-privacy{font-size:11px;line-height:1.45;margin:8px 0 0}
#trainer-message{font-size:13px;line-height:1.5;margin:8px 0}
.shell[data-phrase-trainer="true"] #hubNav{display:none}

.site-sound-toggle{display:inline-grid;place-items:center;flex:0 0 auto;width:34px;height:34px;min-height:34px;padding:7px;border:1px solid #d5dfd0;border-radius:50%;background:#fffdf3;color:#527466;cursor:pointer;box-shadow:none}.site-sound-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.site-sound-toggle[aria-checked="false"]{color:#88958a;background:transparent}#web-account-bar .site-sound-toggle{margin-left:auto;margin-right:14px}#screen{backface-visibility:hidden}@media(prefers-reduced-motion:reduce){#screen{transform:none!important}}
