@font-face{font-family:Plex;src:url('./assets/plex-arabic-400.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Plex;src:url('./assets/plex-arabic-600.ttf') format('truetype');font-weight:600;font-display:swap}
@font-face{font-family:Plex;src:url('./assets/plex-arabic-700.ttf') format('truetype');font-weight:700;font-display:swap}
:root {
  color-scheme:light;
  --ink:#193c34;
  --muted:#505d50;
  --paper:#e9dbc1;
  --paper-wash:radial-gradient(ellipse at 15% 8%,#f6e9cf,transparent 52%),linear-gradient(125deg,#e5d6b8,#e8d9be 60%,#d8c5a6);
  --surface:rgba(252,247,232,.68);
  --stroke:#858b7580;
  --accent:#285c49;
  --track:#c4c9b4;
  --progress:#347659;
  --paper-line:#858b7566;
  --glass-fill:rgba(32,64,52,.88);
  --glass-hover:rgba(32,65,53,.96);
  --glass-rim:rgba(255,255,255,.46);
  --glass-glint:inset 0 1px 0 rgba(255,255,255,.10);
  --glass-blur:blur(14px);
  --focus:#234e3d;
  --radius:22px;
  --pad:clamp(16px,5vw,27px);
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body{font:400 17px/1.5 Plex,Arial,sans-serif;color:var(--ink);background:#d4c5a9}
button,input{font:inherit}
button,a,input{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;color:inherit}
button:disabled{cursor:default}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
h1,h2,p{margin:0}
h1{font-size:clamp(25px,6.5vw,36px);line-height:1.18;font-weight:700}
h2{font-size:clamp(21px,5.8vw,29px);line-height:1.25}
small,.muted{color:var(--muted)}
.app {
  width:min(100%,500px);
  height:100dvh;
  margin:auto;
  position:relative;
  isolation:isolate;
  background-color:var(--paper);
  background-image:var(--paper-wash);
  box-shadow:0 0 65px #57482726;
}
.screen{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  height:100%;
  min-height:0;
  overflow:hidden;
  padding-block-start:env(safe-area-inset-top);
}
.header{min-height:68px;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:10px;padding:10px var(--pad);text-align:center}
.header h1{font-size:clamp(20px,5.5vw,27px);grid-column:2}
.header .leading{grid-column:1;grid-row:1}
.header .trailing{grid-column:3;grid-row:1}
.icon-button{width:44px;height:44px;padding:0;display:grid;place-items:center;border-radius:50%}
.icon{width:24px;height:24px;display:block;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.title-focus:focus{outline:none}
.content{
  min-height:0;
  min-width:0;
  padding:clamp(10px,3dvh,29px) var(--pad);
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:clamp(8px,2.15dvh,18px);
}
.content.center{text-align:center;align-items:center}
.content.center p{max-width:32ch}
.actions{
  padding:10px var(--pad) calc(clamp(13px,3dvh,26px) + env(safe-area-inset-bottom));
  display:grid;
  gap:8px;
}
.primary,.secondary,.option,.card-button,.toggle{
  min-height:47px;
  border-radius:15px;
  border:1px solid transparent;
  font-weight:700;
}
.primary,.secondary{width:100%;padding:8px 16px}
.primary{font-size:clamp(17px,4.6vw,21px)}
.text-button{font-weight:600;font-size:15px;padding:5px 13px;min-height:44px}
.glass{
  border:1px solid var(--stroke);
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:0 4px 14px #664a2610,inset 0 1px 0 #fff9;
}
.mascot{
  display:block;
  width:min(100%,295px,35dvh);
  height:auto;
  aspect-ratio:1;
  object-fit:contain;
  filter:drop-shadow(0 14px 10px #003d4322);
}
.mascot.small{width:min(165px,24dvh)}
.hero{gap:clamp(12px,3dvh,24px)}
.brand{font-size:clamp(45px,12vw,68px);letter-spacing:normal}
.home{justify-content:space-evenly;gap:12px}
.home-visual{position:relative;display:grid;place-items:center;width:100%;isolation:isolate}
.dashboard{width:100%;padding:clamp(12px,2.5dvh,21px);display:grid;gap:9px;text-align:start}
.dashboard h2{font-size:clamp(20px,5.5vw,25px)}
.dashboard .progress-row{display:flex;align-items:center;gap:12px;font-weight:700}
.progress{display:block;height:10px;flex:1;border-radius:100px;background:var(--track);overflow:hidden}
.progress > span{height:100%;display:block;background:var(--progress);border-radius:inherit;transition:width .23s ease}
.nav{align-self:end;justify-self:center;display:flex;align-items:center;justify-content:center;gap:6px;width:max-content;margin:0 auto calc(14px + env(safe-area-inset-bottom));padding:5px 9px;border-radius:999px}
.nav .icon-button{width:48px;height:48px}
.cover{--glass-fill:rgba(17,40,36,.68);--glass-hover:rgba(32,65,57,.86);--focus:#fff;isolation:isolate;position:relative;background:#123934;color:white}
.cover-photo{position:absolute;inset:0;z-index:-3;width:100%;height:100%;object-fit:cover}
.cover::before{content:'';position:absolute;inset:0;z-index:-2;pointer-events:none;background:linear-gradient(180deg,#08161340,transparent 24%,transparent 44%,#071d1c19 56%,#051a19aa 76%,#041412f2 100%)}
.cover .header{padding-inline:max(var(--pad),env(safe-area-inset-right)) max(var(--pad),env(safe-area-inset-left))}
.cover-tools{display:flex;gap:8px;width:max-content}
.cover .content{justify-content:flex-end;padding:0 clamp(21px,6vw,32px) clamp(8px,2.8dvh,26px)}
.cover-copy{text-align:start;max-width:34ch;text-shadow:0 1px 9px #03141070}
.cover-copy .unit-number{font-size:clamp(14px,3.6vw,18px);color:#e4efe8;margin-bottom:6px}
.cover-copy h1{font-size:clamp(32px,min(10vw,7dvh),54px);line-height:1.18}
.cover-description{font-size:clamp(16px,4.6vw,21px);line-height:1.55;margin-top:10px}
.cover .actions{padding-inline:clamp(21px,6vw,32px)}
.audio-status{color:white;font-size:15px}
.transcript-link{align-self:flex-start}
.dots{display:flex;gap:7px;align-items:center;justify-content:center;min-height:13px}
.dot{width:7px;height:7px;border-radius:50%;background:#918d77}
.dot.active{background:var(--accent);width:10px;height:10px}
.cover .dot.active{background:white}
.timeline{
  overflow-y:auto;
  overscroll-behavior-y:contain;
  scrollbar-color:#87977e transparent;
  justify-content:start;
  scrollbar-width:thin;
  gap:clamp(9px,2dvh,16px);
}
.timeline-row{display:grid;grid-template-columns:42px minmax(0,1fr);gap:12px;align-items:center;width:100%;text-align:start;padding:0;background:none;border:0;position:relative}
.timeline-row:not(:last-child)::after{content:'';width:1px;position:absolute;top:50%;z-index:0}
.node{border:1px solid;display:grid;place-items:center;border-radius:50%;font-weight:700;z-index:1}
.step .header{grid-template-columns:minmax(0,1fr) 44px;gap:14px}
.step .header .trailing{grid-column:2}
.step .header .progress{grid-column:1;grid-row:1}
.step .content{justify-content:flex-start}
.step h1{text-align:center;max-width:25ch;margin-inline:auto}
.step .body-text{font-size:clamp(17px,4.75vw,23px);line-height:1.62}
.example{padding:clamp(10px,2.6dvh,20px);text-align:center;font-size:clamp(16px,4.6vw,20px);font-weight:700}
.source{padding:8px 11px;background:#f4e8ce;border-inline-start:3px solid #889778;border-radius:10px;color:var(--ink);font-size:clamp(14px,3.9vw,16px)}
.choices{display:grid;gap:clamp(5px,1.25dvh,10px)}
.option{width:100%;padding:7px 12px;font-size:clamp(16px,4.5vw,20px);line-height:1.28}
.feedback{display:grid;gap:8px;text-align:center}
.feedback strong{font-size:clamp(19px,5vw,25px)}
.feedback.correct strong{color:#285d43}
.feedback.incorrect strong{color:#8c3b30}
.step-summary{display:flex;flex-flow:column;gap:12px;width:100%;margin-top:auto;margin-bottom:auto}
.media{width:100%;display:block}
audio{max-height:43px}
video{height:min(27dvh,190px);object-fit:contain;border-radius:14px;background:#263e31}
.carousel{touch-action:pan-y}
.carousel-row{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:5px;align-items:center;width:100%;margin-inline:auto}
.carousel-row .mascot{margin:auto}
.form{width:100%;display:grid;gap:12px;text-align:start}
.form label{display:grid;gap:4px;font-weight:700}
.form input{width:100%;min-height:46px;border-radius:13px;border:1px solid #8a8770;background:#fcf7e8de;color:var(--ink);padding:7px 12px}
.form-error{color:#8a342d;font-weight:600}
.segmented{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;width:100%;border-radius:999px}
.toggle{min-height:44px;border-radius:999px;background:transparent;color:var(--ink)}
.status-list{width:100%;padding:16px;display:grid;gap:6px;text-align:start}
.status-list div{display:flex;align-items:start;gap:8px}
.status-list .icon{width:20px;height:20px;flex-shrink:0;margin-top:2px;color:var(--accent)}
@media (min-height:740px){
  .header{min-height:90px}
  .header h1{font-size:clamp(23px,6.3vw,30px)}
  .primary,.secondary{min-height:56px}
  .step .content,.timeline{padding-block-start:38px}
  .step .content{gap:19px}
  .step h1{font-size:clamp(26px,7.1vw,36px)}
  .step .option{min-height:55px}
  .timeline{gap:19px}
}
@media (max-height:650px){
  .header{min-height:52px;padding-block:3px}
  .content{padding-block:8px;gap:8px}
  .actions{padding-block:6px calc(9px + env(safe-area-inset-bottom))}
  .primary,.secondary,.option{min-height:42px}
  .step h1{font-size:clamp(21px,6vw,27px)}
  .step .body-text{font-size:16px;line-height:1.45}
  .example{padding:9px}
  .option{font-size:16px}
  .nav{padding:4px;margin-bottom:calc(7px + env(safe-area-inset-bottom))}
  .form{gap:8px}
}
@media (max-height:470px){
  .header{min-height:44px}
  .step .content{gap:5px}
  .primary,.secondary,.option{min-height:35px}
  .form input{min-height:35px}
  .form .muted{font-size:12px}
  .cover h1{font-size:31px}
  video{height:23dvh}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important}}

.reaction-art{display:block;flex:none;width:min(180px,27dvh,60vw);aspect-ratio:1;background-repeat:no-repeat;background-size:400% 300%;margin-inline:auto}
.home-art,.gallery-art{width:min(100%,290px,36dvh)}
.reaction-caption{display:grid;gap:8px;justify-items:center}
.step-summary .reaction-art{width:min(154px,23dvh)}
[hidden]{display:none!important}
.part-controls{display:flex;align-items:center;justify-content:center;gap:6px;grid-column:1;grid-row:1;direction:rtl;font-weight:600}
.part-controls button{flex:none}
.step .content>*{flex-shrink:0}
.step .transcript-link{min-height:44px}
.cover .audio-status .transcript-link{min-height:44px}

.home-counts{display:grid;grid-template-columns:1fr 1fr;border-block:1px solid var(--paper-line);padding:8px 0}
.count-item{display:flex;align-items:center;justify-content:center;gap:10px}
.count-item+.count-item{border-inline-start:1px solid var(--paper-line)}
.count-item .icon{width:24px;height:24px}
.xp-count .icon{color:#2b654c;fill:#d2dfc5}
.streak-count .icon{color:#95541d;fill:#f4d5a9}
.count-item strong,.count-item small{display:block;line-height:1.25}
.count-item strong{font-size:21px}
.count-item small{font-size:13px;margin-top:2px}
.home .home-art{width:min(100%,275px,30dvh)}
.dot-player{--tint:#fff;--dots:#c2d7ca;--pale:#ffffff30;display:flex;align-items:center;gap:4px;width:100%;min-width:0;max-width:390px;padding:0 12px 0 0;border-radius:999px}
.dot-player audio{display:none}
.dot-toggle{display:grid;place-items:center;flex:none;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:inherit}
.dot-toggle svg{width:18px;height:18px;fill:currentColor}
.dot-track{position:relative;flex:1;min-width:0;height:44px;display:grid;align-items:center}
.dot-track svg{width:100%;height:24px;overflow:visible;display:block}
.dot-track .voice{fill:var(--dots)}
.dot-track .quiet{fill:var(--pale)}
.dot-track .heard .voice{fill:var(--tint)}
.dot-track:focus-within{outline:2px solid var(--tint);outline-offset:1px;border-radius:7px}
.dot-seek{position:absolute;inset:0;width:100%;height:100%;margin:0;cursor:pointer;opacity:0}
.dot-time{flex:none;font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;min-width:3ch}
.dot-player.playing g{transform-box:fill-box;transform-origin:center;animation:voice-breathe 1.05s ease-in-out var(--lag) infinite alternate}
@keyframes voice-breathe{from{transform:scaleY(.72);opacity:.78}to{transform:scaleY(1.08);opacity:1}}
@media(prefers-reduced-motion:reduce){.dot-player.playing g{animation:none}}
.cover-header .dot-player{
  grid-row:1;
  grid-column:2;
  justify-self:center;
  max-width:245px;
}
.audio-recovery{background:transparent;border:0;padding:6px 12px;color:inherit;text-decoration:underline;min-height:44px;margin:auto}
.player-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-height:620px){.home{gap:6px}.home .home-art{width:min(175px,23dvh)}.home-counts{padding:5px 0}}
@media(max-height:450px){.home .home-art{width:min(90px,15dvh)}.home .dashboard{padding:8px;gap:4px}.home-visual{min-height:0}.home .count-item small{font-size:12px}}

.paper-screen .home{display:grid;grid-template-rows:minmax(0,1fr) auto;align-content:center;justify-items:center;justify-content:stretch}
.paper-screen .home-visual{min-height:0}
.paper-screen .home-art{width:auto;height:min(100%,275px,30dvh);max-width:100%}

.lesson-page .timeline{gap:0;padding-block:clamp(6px,2.5dvh,19px);scrollbar-color:#87977e transparent}
.lesson-page .timeline-row{flex:none;gap:14px;grid-template-columns:34px minmax(0,1fr);min-height:clamp(63px,9.8dvh,86px)}
.lesson-page .timeline-row:not(:last-child)::after{right:16px;height:100%;background:#939f88}
.lesson-page .node{width:33px;height:33px;color:#4b5d4e;background:#eadfc9;border-color:#99a28a;opacity:1}
.lesson-page .complete .node{background:#d9e6d7;color:#285c4a}
.lesson-page .selected .node{color:white;background:#235d4b;border-color:#235d4b;outline:3px solid #c3cfb6}
.lesson-line{display:grid;align-content:center;align-self:stretch;gap:5px;border-bottom:1px solid var(--paper-line);padding:10px 0;font-weight:600;font-size:clamp(17px,4.5vw,21px)}
.timeline-row:last-child .lesson-line{border-bottom:none}
.lesson-line small{font-size:13px;color:#305d47;font-weight:600}
.lesson-page .progress{height:4px;flex:auto}
.lesson-page .timeline-row:disabled{color:#536050}
.album-content{min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto auto;justify-items:center;align-items:center;text-align:center;gap:clamp(3px,1.7dvh,13px);padding:4px var(--pad) 6px}
.sticker-mount{position:relative;isolation:isolate;height:min(89%,73vw,340px);aspect-ratio:.9;max-width:80%;padding:12px;display:grid;grid-template-rows:auto minmax(0,1fr);background:#fcf7e8;border:1px solid #d6c7aa;box-shadow:1px 4px 8px #5a472221;transform:rotate(-3deg)}
.sticker-mount::after{content:'';position:absolute;inset:5px;border:1px solid #d3c6a7;pointer-events:none}
.folio{font-weight:600;font-size:12px;color:#695e48}
.mounted-sticker,.sticker-outline{height:100%;width:100%;min-height:0;object-fit:contain}
.mounted-sticker{filter:drop-shadow(1px 3px 1px #8d714b40)}
.sticker-outline{background:repeating-linear-gradient(45deg,#d4cfba 0 1px,#e1ddcb 1px 5px);mask:var(--sticker-image) center/contain no-repeat;-webkit-mask:var(--sticker-image) center/contain no-repeat}
.album-caption h2{margin:2px 0;font-size:clamp(21px,6.3vw,29px)}
.album-caption p{font-size:15px}
.album-caption .primary{width:auto;padding-inline:28px;margin-top:7px}
.album-links{display:flex;justify-content:center;gap:clamp(8px,4vw,22px)}
.album-links button{min-height:44px;font-size:14px}
@media(max-height:470px){.paper-screen .home-art{max-height:15dvh}.album-content{gap:1px}.album-caption .primary{margin-top:2px}}

/* One material for controls throughout the pilot. Nested controls use the glass of their parent. */
.icon-button,.primary,.secondary,.nav,.dot-player,.film-controls,
.option[aria-pressed=true],.toggle[aria-pressed=true]{
  color:white;
  border:1px solid var(--glass-rim);
  background:var(--glass-fill);
  box-shadow:var(--glass-glint);
  -webkit-backdrop-filter:var(--glass-blur);
  backdrop-filter:var(--glass-blur);
}
.primary,.secondary,.text-button{border-radius:999px;min-height:44px}
.cover .primary{min-height:50px}
.nav .icon-button{
  color:inherit;
  border:0;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.nav .icon-button[aria-current=page]{background:#ffffff28}
.text-button,.option[aria-pressed=false],.segmented{
  background:var(--surface);
  border:1px solid var(--stroke);
  color:var(--ink);
  box-shadow:var(--glass-glint);
  -webkit-backdrop-filter:var(--glass-blur);
  backdrop-filter:var(--glass-blur);
}
.option{min-height:44px}
.option[aria-pressed=true]{box-shadow:inset 0 0 0 2px #f8f2de70}
.primary:disabled,.icon-button:disabled{
  color:#5d6053;
  background:#d2cbbba8;
  border-color:#aaa58b;
  box-shadow:none;
}
.nav button:focus-visible,.dot-player button:focus-visible,.film-controls :focus-visible{
  outline:2px solid white;
  outline-offset:-3px;
}
@media(hover:hover){
  :is(.primary,.secondary,.icon-button):enabled:hover{background:var(--glass-hover)}
  .nav .icon-button:enabled:hover,.dot-toggle:hover{background:#ffffff30}
  .text-button:hover,.option[aria-pressed=false]:hover,.toggle[aria-pressed=false]:hover{background:#fbf5e9;border-color:#73816b}
}
@media(forced-colors:active){
  .option[aria-pressed=true],.toggle[aria-pressed=true],.nav [aria-current=page]{outline:2px solid Highlight;outline-offset:-4px}
}

.lesson-film{width:100%;display:grid;gap:5px;justify-items:center}
.film-controls{width:100%;max-width:390px;min-height:44px;display:flex;align-items:center;gap:6px;border-radius:999px;padding-inline:2px 10px}
.film-controls input{flex:1;min-width:25px;height:44px;margin:0;accent-color:#fff}
.film-expand{display:grid;place-items:center;width:44px;height:44px;color:inherit;background:transparent;border:none;border-radius:50%}
.film-expand .icon{width:19px;height:19px}

.unit-picker{display:flex;align-items:center;justify-content:center;gap:16px;font-weight:600}
.unit-picker .icon-button{flex:none}
.cover-content,.album-content{touch-action:pan-y pinch-zoom}
.cover .actions{gap:4px}
.cover .unit-picker{font-size:14px;gap:10px;color:white}
.cover .icon-button:disabled{color:#d5d8ca;background:#25382fa8}
.cover-copy h1{font-size:clamp(28px,min(8.3vw,6.3dvh),47px)}
.cover-description{font-size:clamp(15px,4.1vw,20px)}
.album-content{grid-template-rows:minmax(0,1fr) auto auto auto;gap:clamp(2px,1dvh,8px)}
.step .response{width:100%;resize:none;border-radius:14px;padding:9px 12px;font:inherit;line-height:1.5;color:var(--ink);border:1px solid var(--stroke);background:#fcf7e8;min-height:50px;height:clamp(60px,20dvh,140px);max-height:45%;overflow-wrap:anywhere}
.step .response:focus-visible{outline:2px solid var(--focus)}
.write-label,.rubric-note{font-size:14px;font-weight:600}
.work-copy,.step .content,.cover-copy{overflow-wrap:anywhere}
@media(max-height:580px){.cover-description{margin-top:4px}.cover-copy .unit-number{margin-bottom:2px}.album-content{gap:0}}
.fit-mirror{position:absolute!important;inset:0;display:block;visibility:hidden;pointer-events:none}
.step .step-summary{margin-block:0}
.step .response{flex-shrink:0;font-size:max(16px,1em)}
.step .content .source,.step .content .example,.work-copy{white-space:pre-line}
.step .choices.fragments{display:flex;gap:5px;flex-wrap:wrap}
.step .fragments .option{flex:1 1 auto;width:auto}
.step .option:disabled[aria-pressed=true]{opacity:.85}
.part-controls [data-part]{font-size:26px}
@media(max-height:480px){.cover .content{padding-block-end:0}.cover .header{min-height:46px}.cover .unit-picker .icon-button{width:44px;height:44px}.cover .actions{padding-top:0}}
.work-menu{display:grid;gap:5px;width:100%;font-size:14px}
.work-menu select{max-width:100%;min-height:44px;font:inherit;padding-inline:9px;background:var(--surface);color:var(--ink);border:1px solid var(--stroke);border-radius:12px}
.cover .unit-picker .icon-button{background:var(--glass-fill)}
.cover .unit-picker .icon-button:disabled{opacity:.52}
.writer .response{display:block;overflow:hidden;height:clamp(56px,17dvh,128px);max-height:none}
.writing-probe{position:fixed!important;inset:0 auto auto -200vw;visibility:hidden;pointer-events:none;overflow:hidden;resize:none}
.writing-pages{display:flex;gap:10px;justify-content:center;align-items:center;padding-top:3px}
.writing-pages output{font-size:14px;font-variant-numeric:tabular-nums}
@media(max-width:360px){
  .cover-copy h1{font-size:clamp(27px,8vw,32px)}
  .album-links{gap:3px}
}

/* Focused companion controls and comfortable activity spacing. */
.header:has(.header-tools){grid-template-columns:94px minmax(0,1fr) 44px}
.header-tools{display:flex;align-items:center;gap:6px}
.header-tools .icon-button{flex:none}
.cover .actions{gap:16px}
.step .dot-player{max-width:none;align-self:stretch}
.album-content:has(.album-links){grid-template-rows:minmax(0,1fr) auto auto auto}
.album-content:not(:has(.album-links)){grid-template-rows:minmax(0,1fr) auto auto}

/* Candidate: compact counts and anchored learning tools retain the calm card layout. */
.home-counts{grid-template-columns:repeat(3,minmax(0,1fr));gap:0}
.count-item{gap:5px;min-width:0}
.count-item strong{font-size:clamp(15px,4vw,20px)}
.count-item .icon{width:20px;height:20px;flex:none}
.count-item small{font-size:12px}
.step-tools{display:flex;gap:8px;justify-content:space-between}
.step-tools .secondary{font-size:13px;min-height:38px;padding:5px 10px}
.acceptance-criteria{font-size:14px;line-height:1.45;border-inline-start:3px solid #789376;padding-inline-start:10px}
.acceptance-criteria ul{margin:4px 0;padding-inline-start:19px}
.response{overflow-y:auto!important;overscroll-behavior:contain;resize:none;min-height:100px;max-height:24dvh}
.writing-pages{display:none!important}
.form .muted{font-size:13px;line-height:1.5}
.sticker-counter{border:0;background:none;color:inherit;padding:0}
.sticker-counter strong{white-space:nowrap}
.mystery-mount{height:min(90%,65vw,330px);width:auto;aspect-ratio:.9;display:grid;place-items:center;transform:rotate(-3deg);background:#fcf7e8;border:1px solid #d6c7aa;box-shadow:1px 4px 8px #5a472221;padding:20px}
.mystery-mount .reaction-art{width:min(260px,57vw,32dvh)}
.mystery-symbol{font-size:clamp(65px,18vw,120px);color:#acaa90;font-weight:600}
.mystery-mount.locked{background:repeating-linear-gradient(45deg,#ede3cc 0 12px,#e6dbc2 12px 24px)}
.mystery-caption{min-height:94px;text-align:center}
.mystery-caption h2{font-size:22px}
.sticker-controls{display:flex;gap:15px;align-items:center;justify-content:center}
.sticker-position{font-size:14px;min-width:65px}
.collection-tools{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}
.collection-tools .text-button{font-size:13px}
.sticker-detail .reaction-art{width:min(300px,70vw,42dvh)}
.legacy-image{max-width:100%;max-height:37dvh;object-fit:contain}
@media(max-width:360px){.count-item{gap:3px}.count-item .icon{width:17px}.count-item small{font-size:11px}.header-tools{gap:4px}}
/* Full objective list remains independently readable without covering actions. */
.full-criteria { font-size: .85rem; }
.full-criteria[open] ul { max-height: 18dvh; overflow-y: auto; overscroll-behavior: contain; padding-inline: 1.3rem; }
/* Candidate v10: consistent RTL notebook/progress/close and two-action footer. */
.step .header.lesson-header{grid-template-columns:44px minmax(0,1fr) 44px;gap:12px}
.step .lesson-header .leading{grid-column:1;grid-row:1}
.step .lesson-header .progress{grid-column:2;grid-row:1}
.step .lesson-header .trailing{grid-column:3;grid-row:1}
.step .lesson-header .part-controls{grid-column:1/-1;grid-row:2;justify-self:center}
.step .actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.notebook-content{justify-content:flex-start;min-height:0;gap:18px}
.notebook-content .work-menu{width:100%}
.saved-answer{overflow-y:auto;min-height:0;max-height:100%;padding:20px;width:100%;text-align:right;overscroll-behavior:contain}
.saved-answer h2{font-size:20px;margin-bottom:14px}
.saved-answer .work-copy{white-space:pre-wrap;line-height:1.8}
.notebook-screen{grid-template-rows:auto minmax(0,1fr)}
.notifications-screen{grid-template-rows:auto minmax(0,1fr)}
.notifications-content{justify-content:flex-start;padding-top:clamp(16px,5dvh,40px)}

.notification-list{width:100%;text-align:right;overflow-y:auto;max-height:100%}.notification-list article{padding:20px 0;border-bottom:1px solid #39594b33}.notification-list article:first-child{padding-top:0}.notification-list article:last-child{border-bottom:0}.notification-list h2{font-size:22px;margin:0 0 10px}.notification-list p{margin:0;line-height:1.8}.notification-list button{margin-top:14px}.bell-wrap{position:relative;display:inline-flex}.notification-dot{position:absolute;right:2px;top:2px;width:9px;height:9px;border-radius:50%;background:#b65d37;border:1px solid #f3e6cc}.return-note{background:transparent;border:0;border-bottom:1px solid #39594b33;width:100%;padding:0 0 12px;margin-bottom:12px;text-align:right;color:inherit;font:inherit;font-weight:600}.return-note small{display:block;font-weight:400;font-size:12px;line-height:1.5}

.notification-list h2{border-bottom:1px solid #39594b33;padding-bottom:12px;margin-bottom:12px}

.notification-list .notice-title{display:flex;align-items:center;gap:9px;background:none;border:0;padding:0;margin:0;text-align:right;color:inherit;font:inherit;width:100%}.notice-unread{display:inline-block;width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#c43131}.notification-list .notice-read{display:block;background:none;border:0;padding:6px 0;color:#486555;font:inherit;font-size:12px;text-decoration:underline;min-height:32px}.notice-title:focus-visible,.notice-read:focus-visible{outline:2px solid #486555;outline-offset:4px}

.mark-all-read{width:48px;height:48px;min-width:48px;min-height:48px;display:grid;place-items:center;background:none;border:0;color:var(--ink,#284b3f);padding:11px}.mark-all-read svg{width:26px;height:26px}.mark-all-read:disabled{opacity:.6;cursor:default}.mark-all-read:focus-visible{outline:2px solid #486555;outline-offset:2px}
.mark-all-read{background:var(--glass-fill);color:white}.mark-all-read:disabled{background:#d2cbbba8;color:#5d6053}

/* v14 static illustrated entry surfaces: existing controls and storage unchanged. */
.illustrated-screen{position:relative;isolation:isolate;background:var(--paper)}
.scene-illustration{position:absolute;inset:auto 0 0;width:100%;height:auto;max-height:none;object-fit:contain;object-position:bottom;z-index:-1;pointer-events:none;user-select:none;mask-image:linear-gradient(to bottom,transparent 30%,#000 58%);-webkit-mask-image:linear-gradient(to bottom,transparent 30%,#000 58%)}
.illustrated-screen>.header,.illustrated-screen>.content,.illustrated-screen>.actions{position:relative;z-index:1}
.illustrated-landing .hero{justify-content:flex-start;padding-top:clamp(35px,10dvh,90px);gap:18px}
.illustrated-landing .brand{font-size:clamp(44px,13vw,66px)}
.illustrated-landing .hero p{font-size:17px;max-width:25ch}
.illustrated-screen>.actions{background:linear-gradient(transparent,#e9dbc1e8 45%)}
.illustrated-account .content{justify-content:flex-start;overflow-y:auto;padding-top:12px;gap:14px;scroll-padding:16px}
.illustrated-account .form{gap:9px}
.illustrated-account .content p{max-width:none}
.illustrated-account .account-return-note{font-size:13px;line-height:1.55}
.illustrated-account .form input{font-size:16px}
.illustrated-notifications .notification-list{max-height:min(48dvh,440px);padding-bottom:12px}
@media(max-height:650px){
 .illustrated-account .scene-illustration{opacity:.3}
 .illustrated-account .content{background:#e9dbc1d9}
 .illustrated-account .form{gap:6px}
 .illustrated-account .content{gap:8px}
 .illustrated-account .header{min-height:54px}
 .illustrated-landing .hero{padding-top:10px}
 .illustrated-notifications .notification-list{max-height:none;background:#e9dbc1e6}
}

/* Review-only reminder controls: no new Home icon, no automatic permission. */
.notifications-screen>.header{grid-template-columns:100px minmax(0,1fr) 44px;gap:7px}
.notification-header-tools{display:flex;gap:8px;align-items:center}
.notification-header-tools .icon-button{flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px}
.notifications-screen>.header h1{font-size:clamp(19px,5vw,25px)}
.reminder-settings-content{justify-content:flex-start;overflow-y:auto;padding-top:12px}
.reminder-settings-card{display:grid;gap:16px;padding-bottom:25px;text-align:right}
.reminder-settings-card h2{font-size:23px}.reminder-settings-card h3{font-size:18px;margin:4px 0 0}
.reminder-settings-card p{line-height:1.7;font-size:15px}.reminder-settings-card .muted{font-size:13px}
.reminder-settings-card .candidate-status{border-bottom:1px solid #39594b33;padding-bottom:12px;font-size:13px;color:#715323}
.reminder-settings-card details{border-block:1px solid #39594b33;padding:12px 0}.reminder-settings-card summary{cursor:pointer;min-height:34px;font-weight:600}
/* Symmetric reserved side lanes center headings in the full RTL header. */
.header:has(.header-tools){grid-template-columns:94px minmax(0,1fr) 94px}
.header:has(.header-tools)>.trailing{justify-self:end}
.header:has(.header-tools)>h1{font-size:clamp(18px,5vw,25px);white-space:nowrap}
.notifications-screen>.header{grid-template-columns:100px minmax(0,1fr) 100px}
.notifications-screen>.header>.trailing{justify-self:end}
@media(max-width:360px){.header:has(.header-tools){grid-template-columns:92px minmax(0,1fr) 92px;gap:6px}.notifications-screen>.header{grid-template-columns:96px minmax(0,1fr) 96px;gap:4px}.notifications-screen>.header h1{font-size:18px}.notification-header-tools{gap:4px}}

/* v16: quiet RTL reminder preference; unavailable delivery must never look enabled. */
.reminder-settings-card{width:100%}
.reminder-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding-block:8px;border-bottom:1px solid #39594b33}
.reminder-toggle-row>span{font-size:17px;line-height:1.6}
.reminder-switch{position:relative;flex:0 0 52px;width:52px;height:44px;padding:0;border:0;background:none;cursor:pointer}
.reminder-switch:before{content:"";position:absolute;inset:7px 0;border-radius:18px;background:#b9b6aa}
.reminder-switch>span{position:absolute;top:10px;left:3px;width:24px;height:24px;border-radius:50%;background:#fffdf5;box-shadow:0 1px 3px #0002}
.reminder-switch[aria-checked="true"]:before{background:#426f55}
.reminder-switch[aria-checked="true"]>span{left:25px}
.reminder-switch:disabled{cursor:default;opacity:.65}
.reminder-switch:focus-visible{outline:2px solid #486555;outline-offset:3px;border-radius:20px}
/* Private staging cloud save state; never imply local-only writes reached server. */
.cloud-sync-status{position:fixed;z-index:1000;bottom:0;left:0;right:0;min-height:24px;padding:4px 8px calc(4px + env(safe-area-inset-bottom));background:#f6efdf;color:#38554a;font:11px system-ui;text-align:center;display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap}.cloud-sync-status[data-phase=error],.cloud-sync-status[data-phase=conflict]{background:#fff1d3;color:#693c0c;font-size:13px;padding:10px 10px calc(10px + env(safe-area-inset-bottom))}.cloud-sync-status button{font:inherit;border:1px solid currentColor;background:transparent;border-radius:8px;padding:5px}.cloud-sync-status[hidden]{display:none}

.header:has(.header-tools){grid-template-columns:44px minmax(0,1fr) 44px}

.legacy-migration{text-align:right;font-size:14px}.legacy-migration label{margin-block:10px}.legacy-migration input[type=checkbox]{width:auto;min-height:0}.legacy-migration select{font:inherit;max-width:100%}

/* Keep the page surface behind the safe area; only .screen reserves top space. */
html{background-color:var(--paper)}
html[data-surface="cover"]{background-color:#123934}
@media (pointer:coarse){
  body{background-color:var(--paper);background-image:var(--paper-wash)}
  html[data-surface="cover"] body{background:#123934}
}
/* iOS standalone black-translucent uses light status glyphs. A soft, paper-toned
   shade protects their contrast and fades into the unchanged page surface.
   It adds no layout padding and is absent in browser tabs and on desktop. */
html.standalone body::after{content:'';position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:999;pointer-events:none;background:linear-gradient(to bottom,#514737eb 0%,#514737d9 65%,#51473700 100%)}
html.standalone[data-surface="cover"] body::after{background:linear-gradient(to bottom,#081613b8,#08161380 65%,#08161300)}
.account-tools{display:flex;align-items:center;gap:4px}
.install-help{width:44px;min-height:44px;padding:0;border:0;background:transparent;display:grid;place-content:center;line-height:1.1;font-size:12px;font-weight:600}
.install-help>span:first-child{font-size:24px;line-height:24px}
/* Retain the companion's original edge and the centered title. */
.header:has(.account-tools){grid-template-columns:92px minmax(0,1fr) 92px;gap:6px}
.install-dialog{width:min(440px,calc(100% - 32px));max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);overflow:auto;padding:22px;border:1px solid var(--stroke);border-radius:22px;background:#f6edda;color:var(--ink);font:400 16px/1.7 Plex,Arial,sans-serif}
.install-dialog::backdrop{background:#102c2680}
.install-dialog h2{font-size:23px;margin-bottom:10px}
.install-dialog details{padding-block:10px;border-bottom:1px solid #193c3426}
.install-dialog summary{cursor:pointer;font-weight:600;min-height:32px}
.install-dialog ol{padding-inline-start:24px}
.install-dialog p{margin-block:10px}
.install-dialog form{margin-top:16px}

/* Units only: the same image reaches the document canvas and physical viewport.
   Keep the existing focal point and single .screen safe inset for controls. */
html.standalone[data-surface="cover"] body::after{content:none}
@media (any-pointer:coarse){
  html[data-surface="cover"],html[data-surface="cover"] body{
    background-image:var(--active-cover-image);
    background-size:cover;
    background-position:var(--active-cover-position);
    background-repeat:no-repeat;
    background-attachment:fixed;
  }
  html[data-surface="cover"] .app{position:fixed;inset:0;width:100%;height:100%;max-width:none;margin:0;background:transparent;box-shadow:none}
  html[data-surface="cover"] .cover{background:transparent}
  html[data-surface="cover"] .cover .content,
  html[data-surface="cover"] .cover .actions{padding-inline:max(clamp(21px,6vw,32px),env(safe-area-inset-right)) max(clamp(21px,6vw,32px),env(safe-area-inset-left))}
}

/* Units: jouf.space's document-canvas / visible-controls separation. The image
   and gradient share one full-height layer, including the iOS orphan strip. */
#unit-backdrop{display:none}
@media (any-pointer:coarse){
  html[data-surface="cover"]{--cover-wash:linear-gradient(180deg,#08161340,transparent 24%,transparent 44%,#071d1c19 56%,#051a19aa 76%,#041412f2 100%);height:100vh;min-height:max(100lvh,var(--cover-canvas-height,100vh));background-image:var(--cover-wash),var(--active-cover-image);background-size:cover;background-position:var(--active-cover-position);background-attachment:scroll}
  html[data-surface="cover"] body{position:relative;height:100vh;min-height:max(100lvh,var(--cover-canvas-height,100vh));background:transparent}
  html[data-surface="cover"] #unit-backdrop{display:block;position:absolute;z-index:0;top:0;left:0;right:0;height:max(100lvh,100vh,var(--cover-canvas-height,100vh));background-image:var(--cover-wash),var(--active-cover-image);background-size:cover;background-position:var(--active-cover-position);background-repeat:no-repeat;pointer-events:none}
  html[data-surface="cover"] .app{z-index:1;top:var(--cover-app-top,0px);bottom:auto;height:var(--cover-app-height,100dvh)}
  html[data-surface="cover"] .cover-photo{visibility:hidden}
  html[data-surface="cover"] .cover::before{content:none}
}

/* Local paper-shell candidate. Existing cover rules above remain byte-for-byte. */
html[data-surface="paper"]{min-height:var(--paper-shell-height,100%)}
html[data-surface="paper"] body{min-height:var(--paper-shell-height,100%)}
html[data-surface="paper"] .app{height:var(--paper-shell-height,100dvh)}

html[data-surface="paper"] .screen{--paper-safe-bottom:env(safe-area-inset-bottom)}

/* Keep installed iOS entry CTAs below the illustration, above the home indicator. */
@supports (-webkit-touch-callout:none){
  html.standalone[data-surface="paper"] .illustrated-landing>.actions,
  html.standalone[data-surface="paper"] .illustrated-account>.actions{
    padding-bottom:calc(8px + env(safe-area-inset-bottom));
  }
}

/* Inline model-answer comparison, saved-draft preview on rubrics, and live word counter. */
.word-counter{font-size:13px;font-weight:600;color:var(--muted);margin-top:4px;text-align:start}
.word-counter.over-limit{color:#8c3b30}
.model-answer,.draft-preview{width:100%;text-align:start;font-size:14px;line-height:1.65;padding:10px 13px;border-radius:14px;background:#f4e8ce;border:1px solid var(--stroke)}
.model-answer strong{display:block;color:var(--accent);margin-bottom:4px;font-size:14px}
.model-answer p{margin:0;white-space:pre-line}
.draft-preview summary{cursor:pointer;font-weight:700;color:var(--accent);min-height:30px}
.draft-preview .draft-item{margin-top:8px;padding-top:8px;border-top:1px solid var(--paper-line);white-space:pre-line}
.draft-preview .draft-item small{display:block;font-weight:700;color:var(--muted);margin-bottom:2px}
