/* Scoped lesson UI: calm, readable, touch-friendly at every age. */
.ml-overlay{position:fixed;inset:0;z-index:2147483600;background:#102f3d99;backdrop-filter:blur(7px);font-family:Nunito,system-ui,sans-serif;color:#153846;overflow:auto;overscroll-behavior:contain;padding:20px;box-sizing:border-box}.ml-overlay *{box-sizing:border-box}.ml-overlay button{font:inherit;cursor:pointer;touch-action:manipulation;min-height:46px}.ml-overlay button:disabled{cursor:default}.ml-overlay button:focus-visible,.ml-overlay summary:focus-visible{outline:3px solid #1596a5;outline-offset:3px}.ml-overlay [hidden]{display:none!important}.ml-theme-panel{width:min(100%,980px);margin:auto;padding:24px;border-radius:26px;background:#fffdf6;box-shadow:0 16px 65px #071e3866}.ml-theme-panel>header{display:flex;align-items:center;justify-content:space-between;gap:16px}.ml-theme-panel h2{font-size:28px;margin:4px 0}.ml-theme-panel header small{letter-spacing:2px;color:#167b87;font-weight:900}.ml-theme-panel header button{background:#e8f2ef;border:0;border-radius:50%;width:46px;font-size:22px}.ml-summary{padding:16px;background:#e8f6f1;border-radius:14px;font-weight:850}.ml-inherited{padding:12px 16px;border-left:4px solid #e6b535;background:#fff5d8;line-height:1.5}.ml-theme{margin:12px 0;border:1px solid #d5e6df;border-radius:18px;background:#fff;overflow:hidden}.ml-theme summary{list-style:none;display:flex;gap:13px;align-items:center;cursor:pointer;padding:17px;font-weight:900;font-size:18px}.ml-theme summary::-webkit-details-marker{display:none}.ml-theme summary>span:nth-child(2){flex:1}.ml-theme small{display:block;color:#618078;font-size:12px;font-weight:750;margin-top:5px}.ml-theme-number{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:#dcf2e9;color:#167465}.ml-topic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:0 16px 16px}.ml-topic-grid article{border:1px solid #e1eae4;border-radius:14px;background:#fbfcfa;padding:15px}.ml-topic-grid h3{font-size:16px;margin:0 0 7px}.ml-topic-grid p{color:#56756d;font-size:13px;line-height:1.5;min-height:38px;margin:6px 0 13px}.ml-topic-grid article>div{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ml-topic-grid button{border:1px solid #a8d6c3;border-radius:12px;background:#e5f6ed;color:#19654c;font-size:13px!important;padding:10px 7px;font-weight:850!important}.ml-topic-grid button.locked{filter:grayscale(1);opacity:.52}
/* Approved Papi arena. All interactive controls remain native HTML. */
#dmStoryLesson.ml-lesson{--arena-gold:#efcc75;--arena-ink:#0c1535;--arena-light:#f4f6ff;--arena-muted:#bbcbed;position:fixed;inset:0;z-index:2147483600;display:block;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);background-color:#091333;background-image:linear-gradient(#08113740,#06102b78),url('learning-assets/papi-arena-courtyard.webp');background-size:cover;background-position:center;backdrop-filter:none;color:var(--arena-light);isolation:isolate;overflow-anchor:none;overflow:auto;overflow-x:hidden;color-scheme:dark}
#dmStoryLesson .ml-shell{width:min(100%,800px);min-height:100dvh;margin:auto;padding:16px 24px 28px;display:flex;flex-direction:column;gap:16px}
#dmStoryLesson .ml-header{display:flex;align-items:center;gap:12px;min-width:0}
#dmStoryLesson .ml-header>div{flex:1;min-width:0}
#dmStoryLesson .ml-header small{display:block;color:#c7d6f5;font-size:12px;font-weight:800}
#dmStoryLesson .ml-header h1{margin:4px 0;font-size:clamp(20px,4vw,27px);line-height:1.2;color:#fff!important;-webkit-text-fill-color:#fff!important;overflow-wrap:anywhere}
#dmStoryLesson .ml-header>button{flex-shrink:0;width:48px;height:48px;border:2px solid #6e80df;border-radius:50%;background:linear-gradient(145deg,#303e9c,#101b52);color:white;box-shadow:inset 0 2px 6px #a4b5ff35,0 4px 12px #0005;font-size:25px}
#dmStoryLesson button:focus-visible,#dmStoryLesson summary:focus-visible{outline:3px solid #7df5ff;outline-offset:4px}
#dmStoryLesson .ml-arena-title{display:flex;align-items:center;justify-content:center;gap:14px;border:1px solid var(--arena-gold);border-radius:18px 6px;background:linear-gradient(110deg,#102451ed,#1b2056ed);color:#ffe197;box-shadow:0 0 22px #deac3730,inset 0 0 14px #dba73a12;padding:10px 15px;font-size:21px;font-weight:950;letter-spacing:.2px;text-align:center}
#dmStoryLesson .ml-arena-title span{color:#ffe7a3;font-size:18px}
#dmStoryLesson .ml-progress{display:flex;align-items:center;gap:12px;padding:0 3px}
#dmStoryLesson .ml-progress progress{appearance:none;flex:1;width:0;height:12px;overflow:hidden;border:0;border-radius:8px;background:#24365e;color:#68ecf5;box-shadow:0 0 16px #26dbe844}
#dmStoryLesson progress::-webkit-progress-bar{background:#24365e}
#dmStoryLesson progress::-webkit-progress-value{border-radius:8px;background:repeating-linear-gradient(90deg,#6cf4ff 0, #31bfdc calc(10% - 4px),#182957 calc(10% - 3px),#182957 10%)}
#dmStoryLesson progress::-moz-progress-bar{border-radius:8px;background:#55deed}
#dmStoryLesson .ml-progress>span{font-size:13px;font-weight:900;color:#b8faff;white-space:nowrap}
#dmStoryLesson .ml-board{flex:1;padding:22px;border:1px solid #7594df63;border-radius:26px;background:linear-gradient(145deg,#101d4cbf,#081331cf);box-shadow:0 15px 45px #0005,inset 0 1px 0 #bdd2ff22;min-width:0}
#dmStoryLesson .ml-task{min-width:0}
#dmStoryLesson .ml-task p{color:#d5e0f7;line-height:1.55}
#dmStoryLesson .ml-eyebrow{width:fit-content;max-width:100%;margin:0 auto 18px!important;padding:9px 20px;border:1px solid #e7c575;border-radius:12px 4px;background:linear-gradient(#172558,#111b41);color:#ffdf93!important;font-size:13px!important;font-weight:950;letter-spacing:1px;text-align:center;text-transform:uppercase;box-shadow:0 0 16px #ffd06016}
#dmStoryLesson .ml-arena-hero{display:grid;grid-template-columns:minmax(85px,29%) minmax(0,1fr);align-items:center;gap:6px;margin:4px -8px 22px;min-width:0}
#dmStoryLesson .ml-arena-papi{display:block;width:100%;height:auto;max-height:240px;object-fit:contain;filter:drop-shadow(0 10px 12px #0007);pointer-events:none;user-select:none}
#dmStoryLesson .ml-speech{position:relative;min-width:0;border:2px solid #e8cd8f;border-radius:28px;background:linear-gradient(140deg,#fff,#edf2ff);color:var(--arena-ink);padding:22px 20px;text-align:center;box-shadow:0 8px 22px #0004,inset 0 -3px 0 #c5d2ef60}
#dmStoryLesson .ml-speech:before{content:'';position:absolute;left:-9px;top:45%;width:15px;height:15px;background:#f7f9ff;border-left:2px solid #e8cd8f;border-bottom:2px solid #e8cd8f;transform:rotate(45deg)}
#dmStoryLesson .ml-speech h2{color:var(--arena-ink)!important;-webkit-text-fill-color:var(--arena-ink)!important;font-size:clamp(22px,4.5vw,33px);line-height:1.3;font-weight:950;margin:2px 0 14px;overflow-wrap:anywhere}
#dmStoryLesson .ml-speech h2:last-child{margin-bottom:0}
#dmStoryLesson .ml-speech p{color:#405677!important;font-size:15px;margin:8px 0;line-height:1.5}
#dmStoryLesson .ml-speech small{color:#5b6184;font-size:10px;font-weight:900;letter-spacing:1.7px}
#dmStoryLesson .ml-speaker{border:1px solid #a4c4fa;background:linear-gradient(#eaf2ff,#d8e6ff);color:#173d80;border-radius:16px;padding:11px 16px;min-height:46px;font-size:14px;font-weight:900;margin:5px 3px;max-width:100%;overflow-wrap:anywhere;box-shadow:0 3px 0 #b6c9ed}
#dmStoryLesson .ml-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:18px 0}
#dmStoryLesson .ml-choices:not(:has(>button:nth-child(3))){grid-template-columns:repeat(2,minmax(0,1fr))}
#dmStoryLesson .ml-choices:has(>button:nth-child(3)){grid-template-columns:1fr}
#dmStoryLesson .ml-choices button,#dmStoryLesson .ml-matches button{position:relative;min-width:0;min-height:74px;padding:18px 14px;border:2px solid #7585de;border-radius:20px;background:linear-gradient(140deg,#273d87,#172052);box-shadow:inset 0 2px 5px #a5b3ff24,0 5px 0 #070e2e,0 9px 20px #0003;color:#fff;font-size:20px;font-weight:900;line-height:1.4;text-align:center;overflow-wrap:anywhere;transition:background .15s,border-color .15s,transform .15s}
#dmStoryLesson .ml-choices button:hover:not(:disabled),#dmStoryLesson .ml-matches button:hover:not(:disabled){border-color:#b9d9ff;background:linear-gradient(140deg,#3555aa,#212f75)}
#dmStoryLesson .ml-choices button:active:not(:disabled),#dmStoryLesson .ml-matches button:active:not(:disabled){transform:translateY(2px)}
#dmStoryLesson button.is-correct,#dmStoryLesson .ml-matches button.is-correct{color:#f1ffe9;background:linear-gradient(135deg,#147b56,#075240);border-color:#8cf588;box-shadow:0 0 0 1px #b3ff9c,0 0 22px #51f49c55,inset 0 2px 8px #b9ffa650;opacity:1}
#dmStoryLesson button.is-wrong{background:linear-gradient(#6c354f,#472239);border-color:#ffb9a0;color:#fff4eb}
#dmStoryLesson button.is-selected{background:#245678;border-color:#8df6f9;box-shadow:0 0 18px #2ee9f547}
#dmStoryLesson .ml-matches{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}
#dmStoryLesson .ml-matches>div{display:flex;flex-direction:column;gap:12px;min-width:0}
#dmStoryLesson .ml-matches button{flex:1;font-size:17px;padding:12px 10px;min-height:82px}
#dmStoryLesson .ml-sentence{border:2px dashed #a0cbef;border-radius:18px;padding:20px;min-height:90px;background:#0c2346;color:#f3edcd;font-size:22px;line-height:1.5;overflow-wrap:anywhere}
#dmStoryLesson .ml-tokens{display:flex;flex-wrap:wrap;gap:10px;margin:22px 0}
#dmStoryLesson .ml-tokens button{border:1px solid #b6a7f5;border-radius:12px;background:linear-gradient(#443d88,#272755);color:#fff;padding:12px 17px;font-size:18px;box-shadow:0 4px 0 #080e29}
#dmStoryLesson .ml-tokens button:disabled{opacity:.35}
#dmStoryLesson .ml-teach{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:20px 0}
#dmStoryLesson .ml-teach button{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;border:1px solid #718cda;border-radius:18px;background:linear-gradient(#233970,#17254c);padding:16px 10px;box-shadow:0 4px 0 #080f2a;text-align:center;overflow-wrap:anywhere}
#dmStoryLesson .ml-teach b{font-size:19px;line-height:1.4;color:#fff}
#dmStoryLesson .ml-teach span:not(.ml-art){font-size:14px;color:#d2def6}
#dmStoryLesson .ml-teach small{font-size:12px;color:#96eff5;margin-top:auto}
#dmStoryLesson .ml-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
#dmStoryLesson .ml-actions:empty{display:none}
#dmStoryLesson .ml-actions button{flex:1;min-width:120px;border:1px solid #849acb;border-radius:16px;padding:15px 18px;background:linear-gradient(#253f76,#162a50);color:#edf4ff;font-size:17px;font-weight:900;box-shadow:0 4px 0 #07112b}
#dmStoryLesson .ml-actions .ml-primary{border-color:#ffdc78;background:linear-gradient(#ffe69b,#ecc150);color:#342b19;box-shadow:0 4px 0 #97732e,0 0 18px #e8bd4420}
#dmStoryLesson .ml-feedback:not(:empty){border:1px solid #efc577;border-radius:18px;padding:18px 18px 18px 48px;margin-top:20px;position:relative;background:linear-gradient(120deg,#442945,#252044);color:#fff0db;line-height:1.5;font-weight:800;box-shadow:0 0 22px #e7c46b14}
#dmStoryLesson .ml-feedback:not(:empty):before{content:'!';position:absolute;left:16px;top:17px;color:#ffdca2;font-size:24px}
#dmStoryLesson .ml-feedback.is-correct{border-color:#edcf8a;background:linear-gradient(115deg,#103d36,#082c3b);color:#d3ffc0;box-shadow:0 0 24px #56cf6120}
#dmStoryLesson .ml-feedback.is-correct:before{content:'✓';color:#a1ffb8}
#dmStoryLesson .ml-reference{margin:22px 0 4px;border-top:1px solid #748db044;padding-top:10px}
#dmStoryLesson .ml-reference summary{color:#bcccf0;font-size:13px;font-weight:800;cursor:pointer;padding:10px 0}
#dmStoryLesson .ml-reference>div{display:grid;gap:10px;margin-top:10px}
#dmStoryLesson .ml-reference button{display:grid;gap:5px;text-align:left;background:#112b50;border:1px solid #6385be;border-radius:13px;padding:14px;color:#fff;overflow-wrap:anywhere}
#dmStoryLesson .ml-reference b{font-size:16px;color:#fff}
#dmStoryLesson .ml-reference span{font-size:14px;color:#c2d2ed}
#dmStoryLesson .ml-reference small{color:#92e4ee;font-size:12px}
#dmStoryLesson .ml-hint{font-size:13px;text-align:center;color:#b8cae9!important}
#dmStoryLesson .ml-shell>footer{font-size:12px;text-align:center;color:#adbedc;padding-top:2px}
#dmStoryLesson .ml-art{display:block;width:150px;max-width:100%;aspect-ratio:1;background-repeat:no-repeat;background-color:white;border-radius:14px;flex-shrink:0;margin:0 auto 12px;overflow:hidden}
#dmStoryLesson .ml-teach .ml-art{width:100%;margin:0}
#dmStoryLesson .ml-art-color{background:var(--ml-color);border:2px solid #d9e4df;border-radius:50%;width:100px;box-shadow:inset 0 -9px 0 #0000000c}
#dmStoryLesson .ml-art-number{display:grid;place-items:center;font-size:48px;font-weight:900;color:#167c87;background:#edf8f5}
#dmStoryLesson .ml-art-shape{display:grid;place-items:center;background:#f2f7fb}
#dmStoryLesson .ml-shape-circle{width:70%;height:70%;border-radius:50%;background:#ed705b}
#dmStoryLesson .ml-shape-square{width:70%;height:70%;background:#3e9dd0}
#dmStoryLesson .ml-shape-triangle{width:0;height:0;border-left:47px solid transparent;border-right:47px solid transparent;border-bottom:85px solid #e3af29}
#dmStoryLesson .ml-image-choices:has(>button:nth-child(3)){grid-template-columns:repeat(3,minmax(0,1fr))}
#dmStoryLesson .ml-image-choices button{padding:10px}
#dmStoryLesson .ml-image-choices .ml-art{width:100%;margin:0}
#dmStoryLesson .ml-image-choices .ml-art-color{width:70%;margin:8px auto}
#dmStoryLesson .ml-matches .ml-art{width:58px;margin:0 auto}
#dmStoryLesson .ml-matches .ml-art-number{font-size:25px}
#dmStoryLesson .ml-matches .ml-shape-triangle{border-left-width:20px;border-right-width:20px;border-bottom-width:38px}
#dmStoryLesson .ml-final-review{text-align:center}
#dmStoryLesson .ml-review-count{font-weight:900;color:#ffe099!important;margin:0 0 10px}
#dmStoryLesson .ml-review-track{display:flex;gap:10px;justify-content:center;margin:0 0 16px}
#dmStoryLesson .ml-review-track span{display:grid;place-items:center;width:32px;height:39px;border:1px solid #9280d2;border-radius:7px;background:linear-gradient(#44366f,#241f4a);color:#a090c4;transform:rotate(-6deg);font-size:21px}
#dmStoryLesson .ml-review-track .is-current{border-color:#ffdc81;color:#ffe8a1;background:#3a3566}
#dmStoryLesson .ml-review-track .is-done{border-color:#91eea4;background:#14714e;color:#ffea8b;box-shadow:0 0 12px #63f5ad44}
#dmStoryLesson .ml-review-note{min-height:48px;color:#d9ffc9!important;font-size:15px;font-weight:850;padding:12px;margin:12px 0 0;border-radius:14px;background:#103e4155}
#dmStoryLesson .ml-review-note:empty{visibility:hidden}
#dmStoryLesson .ml-question-instruction{font-weight:900;font-size:18px;color:#fff!important}
#dmStoryLesson .ml-complete{text-align:center}
#dmStoryLesson .ml-complete>img{width:150px;height:150px;object-fit:contain;filter:drop-shadow(0 0 20px #48e9cc44)}
#dmStoryLesson .ml-complete h2{color:#fff1b8!important;-webkit-text-fill-color:#fff1b8!important;font-size:28px;line-height:1.3}
#dmStoryLesson .ml-earned{font-size:24px;font-weight:950;color:#b3f4ca;margin:20px 0}
#dmStoryLesson .ml-loading{width:min(90%,500px);margin:10vh auto;padding:36px;border:1px solid #eacb83;border-radius:22px;background:#101e49;color:#fff;font-weight:850}
#dmStoryLesson .ml-loading button{display:block;margin-top:20px;border:1px solid #e1c06a;border-radius:12px;background:#213a68;color:#fff;padding:10px 16px}
@media(max-width:600px){#dmStoryLesson .ml-shell{padding:12px 12px 24px;gap:13px}#dmStoryLesson .ml-board{padding:20px 14px;border-radius:22px}#dmStoryLesson .ml-arena-title{font-size:19px;padding:9px}#dmStoryLesson .ml-arena-hero{grid-template-columns:minmax(88px,31%) minmax(0,1fr);gap:4px;margin:0 -7px 18px}#dmStoryLesson .ml-arena-papi{max-height:185px}#dmStoryLesson .ml-speech{padding:18px 13px;border-radius:22px}#dmStoryLesson .ml-speech h2{font-size:23px}#dmStoryLesson .ml-speech p{font-size:13px}#dmStoryLesson .ml-speaker{padding:10px 11px;font-size:13px}#dmStoryLesson .ml-choices{gap:10px}#dmStoryLesson .ml-choices button{padding:16px 10px;font-size:18px;min-height:76px}#dmStoryLesson .ml-matches{gap:10px}#dmStoryLesson .ml-matches button{font-size:15px;padding:12px 8px}#dmStoryLesson .ml-teach{gap:8px}#dmStoryLesson .ml-teach:not(:has(.ml-art)){grid-template-columns:1fr}#dmStoryLesson .ml-teach b{font-size:17px}#dmStoryLesson .ml-teach button{padding:13px 8px}#dmStoryLesson .ml-image-choices button{padding:7px}#dmStoryLesson .ml-image-choices .ml-shape-triangle{border-left-width:25px;border-right-width:25px;border-bottom-width:45px}#dmStoryLesson .ml-tokens button{font-size:16px;padding:11px 14px}}
@media(max-width:350px){#dmStoryLesson .ml-shell{padding-left:8px;padding-right:8px}#dmStoryLesson .ml-board{padding:18px 11px}#dmStoryLesson .ml-header{gap:9px}#dmStoryLesson .ml-header>button{width:43px;height:43px}#dmStoryLesson .ml-speech h2{font-size:21px}#dmStoryLesson .ml-speech{padding:15px 11px}#dmStoryLesson .ml-choices button{font-size:17px}#dmStoryLesson .ml-eyebrow{font-size:12px!important;padding:9px 13px}}
@media(prefers-reduced-motion:no-preference){#dmStoryLesson .ml-arena-hero{animation:ml-arrive .25s ease-out}#dmStoryLesson .ml-complete>img{animation:ml-arrive .45s ease-out}@keyframes ml-arrive{from{opacity:.3;transform:translateY(7px)}to{opacity:1;transform:none}}}
@media(prefers-reduced-motion:reduce){#dmStoryLesson *{transition:none!important;animation:none!important}}

/* Confirm every thematic lesson entry before displaying its questions. */
#dmStoryLesson.ml-entry{display:grid;place-items:center;padding:max(64px,env(safe-area-inset-top)) 18px max(24px,env(safe-area-inset-bottom));background:#25194780;backdrop-filter:blur(5px);overflow-y:auto;box-sizing:border-box}
.ml-entry-card{position:relative;box-sizing:border-box;width:min(100%,430px);margin:36px auto 16px;padding:62px 25px 26px;border:3px solid #fff;border-radius:30px;background:linear-gradient(#f2e6ff,#fff 60%);box-shadow:0 10px 0 #cfbde4,0 22px 70px #21134240;text-align:center;color:#40246b;font-family:inherit}
.ml-entry-papi{position:absolute;top:-65px;left:50%;transform:translateX(-50%);width:130px;height:130px;object-fit:contain;pointer-events:none}.ml-entry-close{position:absolute;right:12px;top:13px;width:38px;height:38px;border:0;border-radius:50%;background:#fff;color:#78519e;font-size:28px;cursor:pointer}
.ml-entry-card>small{display:block;font-size:11px;font-weight:850;letter-spacing:.08em;color:#9278b0}.ml-entry-card h2{font-size:clamp(23px,6vw,31px)!important;margin:14px 0!important;color:#40246b!important;-webkit-text-fill-color:#40246b!important}.ml-entry-card p{color:#856d9e;font-size:15px;line-height:1.5;margin:10px 0}.ml-entry-prize{display:grid;gap:10px;margin:22px 0;padding:18px 12px;border:2px solid #e5d9f5;border-radius:22px;background:#faf7ff}.ml-entry-prize>b{font-size:16px;color:#302048}.ml-entry-prize strong{font-size:clamp(20px,5vw,27px);color:#7550ba}.ml-entry-prize span{font-size:12px;line-height:1.5;color:#806c95}.ml-entry-detail{font-size:13px!important}.ml-entry-start{width:100%;margin-top:14px;border:0;border-radius:18px;padding:17px 10px;background:linear-gradient(#b475ed,#8b51d5);box-shadow:0 5px 0 #673aa3;color:#fff;font-family:inherit;font-size:17px;font-weight:850;cursor:pointer}.ml-entry-start:focus-visible,.ml-entry-close:focus-visible{outline:3px solid #40246b;outline-offset:4px}
/* Account-owned live balance strip; sits above the question panel without overlays. */
#dmStoryLesson .ml-wallet{display:grid;grid-template-columns:1.08fr 1fr 1fr;gap:8px;min-width:0}
#dmStoryLesson .ml-wallet-chip{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;padding:12px 8px;border:2px solid #fff3c6;border-radius:21px;background:linear-gradient(#fffef0,#fff6cf);box-shadow:0 4px 0 #e4ce91,0 5px 16px #0003;color:#123d52}
#dmStoryLesson .ml-wallet-chip svg{width:28px;height:34px;flex-shrink:0}
#dmStoryLesson .ml-wallet-chip b{font-size:clamp(17px,4.4vw,25px);font-weight:950;line-height:1.1;white-space:nowrap;font-variant-numeric:tabular-nums;color:#123d52}
#dmStoryLesson .ml-wallet-chip small{font-size:.64em;color:#275468;font-weight:900}
#dmStoryLesson .ml-combo-toast{font-size:14px;text-align:center;font-weight:900;color:#bafed3;line-height:1.4}
#dmStoryLesson .ml-combo-toast:empty{display:none}
#dmStoryLesson .ml-letter-line{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:10px 4px;padding:19px 8px;border:1px solid #a0c9e4;border-radius:18px;background:#0b2247;margin:18px 0}
#dmStoryLesson .ml-letter-word{display:inline-flex;flex-wrap:wrap;justify-content:center;gap:3px;max-width:100%}
#dmStoryLesson .ml-letter-space{width:7px}
#dmStoryLesson .ml-letter-fixed,#dmStoryLesson .ml-letter-gap{display:inline-grid;place-items:center;min-width:24px;min-height:46px;font-size:23px;line-height:1;font-weight:900;font-family:inherit}
#dmStoryLesson .ml-letter-fixed{color:#f3f5ff}
#dmStoryLesson .ml-letter-gap{width:28px;border:0;border-bottom:3px solid #ffd879;border-radius:7px;background:#344e7c;color:#ffe494;padding:0}
#dmStoryLesson .ml-letter-gap.is-filled{background:#186b61;color:#f0ffda;border-color:#a2f8c1}
#dmStoryLesson .ml-letter-bank{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:20px 0}
#dmStoryLesson .ml-letter-bank button{width:46px;min-height:48px;border:1px solid #d4b5f3;border-radius:12px;background:linear-gradient(#48468c,#2b2c61);color:#fff;font-size:24px;font-weight:900;box-shadow:0 4px 0 #080f29}
#dmStoryLesson .ml-letter-bank button:disabled{opacity:.3}
#dmStoryLesson [data-letter-check]:disabled{opacity:.45}
@media(max-width:380px){#dmStoryLesson .ml-wallet{gap:6px}#dmStoryLesson .ml-wallet-chip{padding:11px 5px;gap:4px;border-radius:18px}#dmStoryLesson .ml-wallet-chip svg{width:23px;height:29px}#dmStoryLesson .ml-wallet-chip b{font-size:17px}#dmStoryLesson .ml-letter-fixed{min-width:19px;font-size:21px}#dmStoryLesson .ml-letter-gap{width:25px;min-width:25px;font-size:21px}#dmStoryLesson .ml-letter-word{gap:2px}}


/* One-viewport lesson layout. Optional study content opens in its own sheet. */
#dmStoryLesson.ml-lesson{height:var(--ml-view-height,100dvh);max-height:var(--ml-view-height,100dvh);overflow:hidden}
#dmStoryLesson .ml-shell{height:100%;min-height:0;max-height:100%;width:min(100%,920px);padding:8px 10px;display:grid;grid-template-rows:auto auto auto minmax(0,1fr);gap:7px}
#dmStoryLesson .ml-header{gap:9px;min-height:36px}
#dmStoryLesson .ml-header>button{width:36px;height:36px;min-height:36px;font-size:22px;border-width:1px}
#dmStoryLesson .ml-header small{font-size:10px;line-height:1.2}
#dmStoryLesson .ml-header h1{font-size:18px;line-height:1.15;margin:2px 0 0}
#dmStoryLesson .ml-wallet{gap:7px}
#dmStoryLesson .ml-wallet-chip{padding:5px 7px;min-height:35px;gap:5px;border-width:1px;border-radius:13px;box-shadow:0 2px 0 #e4ce91}
#dmStoryLesson .ml-wallet-chip svg{width:19px;height:23px}
#dmStoryLesson .ml-wallet-chip b{font-size:17px}
#dmStoryLesson .ml-wallet-chip small{font-size:11px}
#dmStoryLesson .ml-arena-title,#dmStoryLesson .ml-shell>footer{display:none}
#dmStoryLesson .ml-progress{gap:9px;min-height:14px;padding:0}
#dmStoryLesson .ml-progress progress{height:7px}
#dmStoryLesson .ml-progress>span{font-size:11px}
#dmStoryLesson .ml-combo-toast{position:fixed;top:35%;left:50%;transform:translateX(-50%);z-index:110;width:min(85%,300px);padding:18px;border:2px solid #ffdf85;border-radius:20px;background:#103c3e;box-shadow:0 10px 40px #0008;font-size:18px}
#dmStoryLesson .ml-board{min-height:0;padding:11px 12px;border-radius:20px;display:flex;flex-direction:column;justify-content:center;overflow:visible}
#dmStoryLesson .ml-stage{width:100%;min-width:0;flex:0 0 auto;transform-origin:top center}
#dmStoryLesson .ml-eyebrow{font-size:11px!important;padding:4px 10px;margin:0 auto 7px!important;letter-spacing:.7px;border-radius:9px 3px}
#dmStoryLesson .ml-arena-hero{grid-template-columns:minmax(55px,21%) minmax(0,1fr);gap:5px;margin:4px 0 9px}
#dmStoryLesson .ml-arena-papi{max-height:105px;width:100%;height:auto}
#dmStoryLesson .ml-speech{padding:10px 12px;border-radius:20px}
#dmStoryLesson .ml-speech h2{font-size:20px;line-height:1.18;margin:0 0 6px}
#dmStoryLesson .ml-speech p{font-size:12px;line-height:1.3;margin:4px 0}
#dmStoryLesson .ml-speaker{min-height:34px;padding:6px 10px;margin:3px 2px;font-size:12px;border-radius:11px;box-shadow:0 2px 0 #b6c9ed}
#dmStoryLesson .ml-speech>.ml-art{width:60px;margin:5px auto}
#dmStoryLesson .ml-task p{line-height:1.35}
#dmStoryLesson .ml-teach,#dmStoryLesson .ml-teach:not(:has(.ml-art)){grid-template-columns:1fr;gap:6px;margin:9px 0}
#dmStoryLesson .ml-teach button{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:2px 8px;min-height:54px;padding:7px 11px;border-radius:13px;text-align:left;box-shadow:0 2px 0 #080f2a}
#dmStoryLesson .ml-teach b{grid-column:1;grid-row:1;font-size:17px;line-height:1.2;text-align:left}
#dmStoryLesson .ml-teach span:not(.ml-art){grid-column:1;grid-row:2;font-size:12px;line-height:1.25}
#dmStoryLesson .ml-teach small{grid-column:2;grid-row:1/3;font-size:12px;margin:0;white-space:nowrap}
#dmStoryLesson .ml-teach button:has(.ml-art){grid-template-columns:43px minmax(0,1fr) auto}
#dmStoryLesson .ml-teach .ml-art{grid-column:1;grid-row:1/3;width:42px;height:42px;margin:0}
#dmStoryLesson .ml-teach button:has(.ml-art) b,#dmStoryLesson .ml-teach button:has(.ml-art) span:not(.ml-art){grid-column:2}
#dmStoryLesson .ml-teach button:has(.ml-art) small{grid-column:3}
#dmStoryLesson .ml-teach .ml-art-number{font-size:24px}
#dmStoryLesson .ml-teach .ml-shape-triangle{border-left-width:14px;border-right-width:14px;border-bottom-width:27px}
#dmStoryLesson .ml-hint{font-size:11px;line-height:1.25;margin:5px 0}
#dmStoryLesson .ml-choices{gap:7px;margin:8px 0}
#dmStoryLesson .ml-choices button{min-height:46px;padding:8px 11px;font-size:17px;line-height:1.25;border-radius:14px;box-shadow:inset 0 1px 3px #a5b3ff24,0 3px 0 #070e2e}
#dmStoryLesson .ml-image-choices button{padding:6px}
#dmStoryLesson .ml-image-choices .ml-art{width:min(100%,66px);margin:0 auto}
#dmStoryLesson .ml-image-choices .ml-art-number{font-size:30px}
#dmStoryLesson .ml-image-choices .ml-shape-triangle{border-left-width:20px;border-right-width:20px;border-bottom-width:38px}
#dmStoryLesson .ml-matches{gap:8px;margin:8px 0}
#dmStoryLesson .ml-matches>div{gap:7px}
#dmStoryLesson .ml-matches button{min-height:47px;padding:7px 8px;font-size:15px;line-height:1.25;border-radius:13px}
#dmStoryLesson .ml-matches .ml-art{width:40px}
#dmStoryLesson .ml-sentence{min-height:49px;padding:10px 12px;font-size:18px;line-height:1.3;border-radius:14px}
#dmStoryLesson .ml-tokens{gap:6px;margin:9px 0}
#dmStoryLesson .ml-tokens button{min-height:39px;padding:7px 11px;font-size:16px;border-radius:10px}
#dmStoryLesson .ml-actions{gap:8px;margin-top:9px}
#dmStoryLesson .ml-actions button{min-height:44px;min-width:110px;padding:9px 12px;font-size:16px;border-radius:13px;line-height:1.25}
#dmStoryLesson .ml-feedback:not(:empty){padding:8px 10px 8px 32px;margin-top:8px;border-radius:12px;font-size:13px;line-height:1.3}
#dmStoryLesson .ml-feedback:not(:empty):before{left:10px;top:7px;font-size:19px}
#dmStoryLesson .ml-reference-controls{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;margin-top:6px}
#dmStoryLesson .ml-reference-toggle{min-height:31px;padding:5px 8px;border:1px solid #718bb7;border-radius:9px;background:#152e53;color:#d9e9ff;font-size:11px;font-weight:800;line-height:1.2}
#dmStoryLesson .ml-reference-sheet{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:16px;background:#050d25c9;backdrop-filter:blur(5px)}
#dmStoryLesson .ml-reference-panel{width:min(100%,650px);max-height:calc(var(--ml-view-height,100dvh) - 32px);overflow:auto;border:1px solid #e4c885;border-radius:22px;background:#111e44;color:#fff;padding:16px}
#dmStoryLesson .ml-reference-panel header{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-bottom:14px}
#dmStoryLesson .ml-reference-panel h2{font-size:18px;color:#ffe4a5!important;-webkit-text-fill-color:#ffe4a5!important;margin:0}
#dmStoryLesson .ml-reference-panel [data-reference-close]{width:42px;min-height:42px;flex-shrink:0;border:1px solid #9ba8d0;border-radius:50%;background:#253b6b;color:#fff;font-size:26px}
#dmStoryLesson .ml-reference-list{display:grid;gap:9px}
#dmStoryLesson .ml-reference-list button{display:grid;gap:5px;min-height:60px;padding:12px;text-align:left;border:1px solid #6385be;border-radius:12px;background:#152e53;color:#fff}
#dmStoryLesson .ml-reference-list span{color:#c4d5ef;font-size:14px}
#dmStoryLesson .ml-reference-list small{color:#8ce3eb;font-size:12px}
#dmStoryLesson .ml-review-count{display:inline-block;font-size:12px;margin:0 10px 5px 0}
#dmStoryLesson .ml-review-track{display:inline-flex;gap:7px;margin:0 0 5px;vertical-align:middle}
#dmStoryLesson .ml-review-track span{width:21px;height:26px;font-size:16px}
#dmStoryLesson .ml-question-instruction{font-size:16px;margin:7px 0}
#dmStoryLesson .ml-review-note{min-height:0;padding:8px;margin:7px 0 0;font-size:13px;line-height:1.3}
#dmStoryLesson .ml-review-note:empty{display:none}
#dmStoryLesson .ml-letter-line{gap:6px 3px;padding:10px 7px;margin:9px 0}
#dmStoryLesson .ml-letter-word{gap:2px}
#dmStoryLesson .ml-letter-fixed{min-width:20px;min-height:37px;font-size:21px}
#dmStoryLesson .ml-letter-gap{width:25px;min-width:25px;min-height:38px;font-size:21px}
#dmStoryLesson .ml-letter-bank{gap:7px;margin:10px 0}
#dmStoryLesson .ml-letter-bank button{width:38px;min-height:40px;font-size:22px;border-radius:10px}
#dmStoryLesson[data-fit="1"] .ml-speech h2{font-size:18px}
#dmStoryLesson[data-fit="1"] .ml-arena-papi{max-height:83px}
#dmStoryLesson[data-fit="1"] .ml-speech{padding:8px 10px}
#dmStoryLesson[data-fit="1"] .ml-teach button{min-height:48px;padding:5px 9px}
#dmStoryLesson[data-fit="1"] .ml-teach .ml-art{width:36px;height:36px}
#dmStoryLesson[data-fit="1"] .ml-teach button:has(.ml-art){grid-template-columns:37px minmax(0,1fr) auto}
#dmStoryLesson[data-fit="1"] .ml-task>.ml-hint{display:none}
#dmStoryLesson[data-fit="1"] .ml-matches button{font-size:14px;min-height:44px}
#dmStoryLesson[data-fit="1"] .ml-choices button{font-size:16px;padding:7px 9px}
#dmStoryLesson[data-fit="2"] .ml-speech h2{font-size:16px}
#dmStoryLesson[data-fit="2"] .ml-speech{padding:6px 9px;border-radius:15px}
#dmStoryLesson[data-fit="2"] .ml-speech p{font-size:11px;line-height:1.2}
#dmStoryLesson[data-fit="2"] .ml-arena-hero{margin:3px 0 6px;grid-template-columns:48px minmax(0,1fr)}
#dmStoryLesson[data-fit="2"] .ml-arena-papi{max-height:70px}
#dmStoryLesson[data-fit="2"] .ml-teach{gap:4px;margin:6px 0}
#dmStoryLesson[data-fit="2"] .ml-teach button{min-height:45px;padding:4px 8px}
#dmStoryLesson[data-fit="2"] .ml-teach b{font-size:15px}
#dmStoryLesson[data-fit="2"] .ml-teach span:not(.ml-art){font-size:11px}
#dmStoryLesson[data-fit="2"] .ml-task>.ml-hint{display:none}
#dmStoryLesson[data-fit="2"] .ml-choices button,#dmStoryLesson[data-fit="2"] .ml-matches button{font-size:14px;min-height:42px;padding:6px 8px}
#dmStoryLesson[data-fit="2"] .ml-feedback:not(:empty){font-size:12px;padding-top:6px;padding-bottom:6px;margin-top:6px}
#dmStoryLesson[data-fit="2"] .ml-tokens{gap:5px;margin:6px 0}
#dmStoryLesson[data-fit="2"] .ml-tokens button{font-size:14px;min-height:34px;padding:5px 8px}
#dmStoryLesson[data-fit="2"] .ml-sentence{font-size:16px;min-height:40px;padding:8px}
#dmStoryLesson[data-fit="2"] .ml-letter-bank button{width:34px;min-height:36px;font-size:19px}
#dmStoryLesson[data-fit="2"] .ml-letter-line{padding:6px;margin:6px 0}
#dmStoryLesson[data-fit="2"] .ml-actions{margin-top:6px}
#dmStoryLesson[data-fit="2"] .ml-actions button{min-height:40px;font-size:14px;padding:7px 10px}
#dmStoryLesson.ml-scroll-fallback{overflow:auto}
#dmStoryLesson.ml-scroll-fallback .ml-shell{height:auto;max-height:none;min-height:100%;grid-template-rows:auto auto auto auto}
#dmStoryLesson.ml-scroll-fallback .ml-board{min-height:auto}
/* The result uses actual saved rewards; decoration never awards currency. */
#dmStoryLesson .ml-complete{position:relative;isolation:isolate;text-align:center;padding:3px 0}
#dmStoryLesson .ml-result-mascot{position:relative;width:120px;margin:0 auto 8px}
#dmStoryLesson .ml-result-mascot:before{content:'';position:absolute;inset:2px -12px;border-radius:50%;background:radial-gradient(#56f4cb80,#f5d88b22 45%,transparent 70%);z-index:-1}
#dmStoryLesson .ml-result-mascot img{display:block;width:115px;height:115px;object-fit:contain;margin:auto;filter:drop-shadow(0 0 15px #60edb84d)}
#dmStoryLesson .ml-complete h2{font-size:25px;line-height:1.2;margin:7px 0;color:#ffe8a8!important;-webkit-text-fill-color:#ffe8a8!important}
#dmStoryLesson .ml-result-stars{display:flex;justify-content:center;gap:9px;margin:7px 0}
#dmStoryLesson .ml-result-stars span{font-size:29px;color:#68718b}
#dmStoryLesson .ml-result-stars .is-earned{color:#ffde6c;text-shadow:0 2px 0 #af7b2b,0 0 18px #ffd96d44}
#dmStoryLesson .ml-result-message{font-size:14px;margin:7px 0}
#dmStoryLesson .ml-result-stats{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 12px;margin:9px 0;font-size:12px;color:#c8f0e4}
#dmStoryLesson .ml-result-rewards{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:10px;margin:12px auto;max-width:450px}
#dmStoryLesson .ml-result-rewards>div{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:center;gap:2px 8px;padding:12px;border:1px solid #e4c87e;border-radius:16px;background:linear-gradient(145deg,#274960,#1a3254);box-shadow:0 4px 0 #060f28,0 0 22px #dac86610}
#dmStoryLesson .ml-result-rewards span{font-size:25px}
#dmStoryLesson .ml-result-rewards b{font-size:28px;color:#ffe79b}
#dmStoryLesson .ml-result-rewards small{grid-column:1/-1;font-size:11px;color:#d9e7fb}
#dmStoryLesson .ml-result-words{font-size:12px;line-height:1.3;margin:8px 0;color:#adc7e9!important;overflow-wrap:anywhere}
#dmStoryLesson .ml-result-replay{font-size:13px;margin:10px 0;color:#c1d9ee!important}
#dmStoryLesson .ml-result-sparks{position:absolute;inset:-8px;overflow:hidden;pointer-events:none;z-index:-1}
#dmStoryLesson .ml-result-sparks i{position:absolute;top:calc(15% + var(--i)*4%);left:calc(var(--i)*7%);width:6px;height:12px;border-radius:2px;background:#ffe28c;transform:rotate(calc(var(--i)*33deg))}
#dmStoryLesson .ml-result-sparks i:nth-child(3n){background:#65f7d1}
#dmStoryLesson .ml-result-sparks i:nth-child(3n+1){background:#a8a0ff}
#dmStoryLesson[data-fit="1"] .ml-result-mascot img{width:92px;height:92px}
#dmStoryLesson[data-fit="2"] .ml-result-mascot img{width:68px;height:68px}
#dmStoryLesson[data-fit="2"] .ml-complete h2{font-size:21px;margin:5px 0}
#dmStoryLesson[data-fit="2"] .ml-result-rewards>div{padding:8px}
#dmStoryLesson[data-fit="2"] .ml-result-rewards b{font-size:23px}
#dmStoryLesson[data-fit="2"] .ml-result-message{font-size:12px}
@media(min-width:600px) and (max-height:520px){
 #dmStoryLesson .ml-shell{grid-template-columns:minmax(0,1fr) minmax(250px,.8fr);grid-template-rows:auto auto minmax(0,1fr);gap:5px 12px;padding:6px 10px}
 #dmStoryLesson .ml-header{grid-column:1;grid-row:1}
 #dmStoryLesson .ml-wallet{grid-column:2;grid-row:1}
 #dmStoryLesson .ml-progress{grid-column:1/-1;grid-row:2}
 #dmStoryLesson .ml-board{grid-column:1/-1;grid-row:3;padding:8px 10px}
 #dmStoryLesson .ml-task{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:4px 12px;align-items:center}
 #dmStoryLesson .ml-task>.ml-eyebrow{grid-column:1;grid-row:1;margin-bottom:3px!important}
 #dmStoryLesson .ml-task>.ml-arena-hero{grid-column:1;grid-row:2/5;margin:0}
 #dmStoryLesson .ml-task>.ml-choices,#dmStoryLesson .ml-task>.ml-matches,#dmStoryLesson .ml-task>.ml-teach,#dmStoryLesson .ml-letter-puzzle{grid-column:2;grid-row:1/5;margin:0}
 #dmStoryLesson .ml-task>.ml-hint{display:none}
 #dmStoryLesson .ml-reference-controls{grid-column:1/-1;grid-row:6;margin-top:2px}
 #dmStoryLesson .ml-reference-toggle{min-height:26px;font-size:10px;padding:4px 7px}
 #dmStoryLesson .ml-teach button{min-height:44px;padding:4px 8px}
 #dmStoryLesson .ml-teach .ml-art{width:34px;height:34px}
 #dmStoryLesson .ml-teach button:has(.ml-art){grid-template-columns:35px minmax(0,1fr) auto}
 #dmStoryLesson .ml-sentence{grid-column:2;grid-row:1/3}
 #dmStoryLesson .ml-tokens{grid-column:2;grid-row:3/5;margin:0}
 #dmStoryLesson .ml-final-review{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1fr 1fr;gap:4px 12px;align-items:center}
 #dmStoryLesson .ml-final-review .ml-review-count{grid-column:1;grid-row:1;margin:0}
 #dmStoryLesson .ml-final-review .ml-review-track{display:none}
 #dmStoryLesson .ml-final-review .ml-arena-hero{grid-column:1;grid-row:2/4;margin:0}
 #dmStoryLesson .ml-final-review .ml-question-instruction{grid-column:2;grid-row:1;margin:0;font-size:14px}
 #dmStoryLesson .ml-final-review .ml-choices{grid-column:2;grid-row:2;margin:0}
 #dmStoryLesson .ml-final-review .ml-review-note{grid-column:2;grid-row:3;margin:0}
 #dmStoryLesson[data-task-kind="complete"] .ml-task{display:block}
 #dmStoryLesson .ml-complete{display:grid;grid-template-columns:130px minmax(0,1fr);gap:4px 10px;align-items:center}
 #dmStoryLesson .ml-complete>:not(.ml-result-mascot):not(.ml-result-sparks){grid-column:2;margin:3px 0}
 #dmStoryLesson .ml-result-mascot{grid-column:1;grid-row:1/8;width:120px}
 #dmStoryLesson .ml-result-message,#dmStoryLesson .ml-result-words{display:none}
 #dmStoryLesson .ml-result-rewards{width:100%;max-width:none}
 #dmStoryLesson .ml-result-rewards>div{padding:7px 10px}
 #dmStoryLesson .ml-result-rewards b{font-size:24px}
 #dmStoryLesson .ml-actions{margin-top:6px}
 #dmStoryLesson .ml-actions button{min-height:39px;padding:7px 10px;font-size:14px}
 #dmStoryLesson.ml-scroll-fallback .ml-shell{grid-template-rows:auto auto auto}
}
@media(prefers-reduced-motion:no-preference){
 #dmStoryLesson .ml-result-mascot{animation:ml-result-pop .65s cubic-bezier(.2,1.3,.4,1) both}
 #dmStoryLesson .ml-result-rewards>div{animation:ml-result-pop .5s ease-out .2s both}
 #dmStoryLesson .ml-result-stars .is-earned{animation:ml-result-pop .45s ease-out both;animation-delay:calc(var(--i)*120ms)}
 #dmStoryLesson .ml-result-sparks i{animation:ml-result-confetti 2.8s ease-out both;animation-delay:calc(var(--i)*35ms)}
 @keyframes ml-result-pop{from{opacity:0;transform:translateY(14px) scale(.75)}to{opacity:1;transform:none}}
 @keyframes ml-result-confetti{0%{opacity:0;translate:0 65px}20%{opacity:1}100%{opacity:0;translate:0 -65px;rotate:150deg}}
}

#dmStoryLesson.ml-entry{overflow:auto}
#dmStoryLesson.ml-entry .ml-entry-card{margin:20px auto 8px;padding:46px 20px 19px}
#dmStoryLesson.ml-entry .ml-entry-papi{width:96px;height:96px;top:-48px}
#dmStoryLesson.ml-entry .ml-entry-prize{margin:14px 0;padding:12px;gap:7px}
#dmStoryLesson.ml-entry .ml-entry-card h2{margin:9px 0!important;font-size:25px!important}
#dmStoryLesson.ml-entry .ml-entry-start{padding:12px 10px;min-height:44px;margin-top:9px}

/* Top-aligned prompt, with the answer area kept in the lower reading band. */
#dmStoryLesson .ml-board{justify-content:flex-start}
#dmStoryLesson .ml-stage{display:flex;flex-direction:column}
#dmStoryLesson .ml-task{display:flex;flex-direction:column;flex:1;min-height:0}
#dmStoryLesson .ml-task>.ml-choices,#dmStoryLesson .ml-task>.ml-matches,#dmStoryLesson .ml-task>.ml-teach,#dmStoryLesson .ml-task>.ml-sentence,#dmStoryLesson .ml-task>.ml-letter-puzzle{margin-top:auto}
#dmStoryLesson .ml-arena-hero{grid-template-columns:minmax(76px,27%) minmax(0,1fr);align-items:center}
#dmStoryLesson .ml-arena-papi{max-height:150px}
#dmStoryLesson[data-fit="1"] .ml-arena-papi{max-height:115px}
#dmStoryLesson[data-fit="2"] .ml-arena-papi{max-height:85px}
#dmStoryLesson .ml-header>[data-lesson-theme]{width:30px;height:30px;min-height:30px;font-size:16px;border-width:1px}
#dmStoryLesson[data-appearance="day"]{--arena-ink:#0c1535;--arena-light:#163f4b;--arena-muted:#526c76;background-color:#e5f7ed;background-image:radial-gradient(ellipse at 85% 0%,#fff6ba 0,transparent 45%),linear-gradient(160deg,#bdebf5,#e5f7ed 55%,#fff3ce);color:#163f4b;color-scheme:light}
#dmStoryLesson[data-appearance="day"] .ml-header small{color:#476877}
#dmStoryLesson[data-appearance="day"] .ml-header h1{color:#153f4b!important;-webkit-text-fill-color:#153f4b!important}
#dmStoryLesson[data-appearance="day"] .ml-header>button{background:linear-gradient(#fffef4,#e1f3eb);color:#146c71;border-color:#98cfc7;box-shadow:0 3px 0 #8abeb54d}
#dmStoryLesson[data-appearance="day"] .ml-board{background:linear-gradient(145deg,#ffffffd9,#f9ffedc9);border-color:#9ecfc5;box-shadow:0 10px 30px #2b77741a,inset 0 1px #fff}
#dmStoryLesson[data-appearance="day"] .ml-eyebrow{background:#fff5d4;color:#705116!important;border-color:#d2ac51}
#dmStoryLesson[data-appearance="day"] .ml-progress>span{color:#126770}
#dmStoryLesson[data-appearance="day"] .ml-progress progress,#dmStoryLesson[data-appearance="day"] progress::-webkit-progress-bar{background:#c1ddd9;box-shadow:none}
#dmStoryLesson[data-appearance="day"] progress::-webkit-progress-value{background:linear-gradient(90deg,#15a697,#43c8ad)}
#dmStoryLesson[data-appearance="day"] .ml-task p{color:#3e626b}
#dmStoryLesson[data-appearance="day"] .ml-choices button:not(.is-correct):not(.is-wrong):not(.is-selected),#dmStoryLesson[data-appearance="day"] .ml-matches button:not(.is-correct):not(.is-wrong):not(.is-selected),#dmStoryLesson[data-appearance="day"] .ml-teach button{background:linear-gradient(#fffef6,#edf9ed);color:#194c50;border-color:#8dc7bb;box-shadow:inset 0 2px #fff,0 4px 0 #b4d5c7}
#dmStoryLesson[data-appearance="day"] .ml-teach b{color:#194c50}
#dmStoryLesson[data-appearance="day"] .ml-teach span:not(.ml-art),#dmStoryLesson[data-appearance="day"] .ml-teach small{color:#35666b}
#dmStoryLesson[data-appearance="day"] .ml-reference-toggle,#dmStoryLesson[data-appearance="day"] .ml-actions button:not(.ml-primary),#dmStoryLesson[data-appearance="day"] .ml-tokens button,#dmStoryLesson[data-appearance="day"] .ml-letter-bank button{background:#e2f3ed;border-color:#8bc2b7;color:#1a5557;box-shadow:0 3px 0 #aacfc3}
#dmStoryLesson[data-appearance="day"] .ml-sentence,#dmStoryLesson[data-appearance="day"] .ml-letter-line{background:#f4fcf5;color:#194c50;border-color:#83bcb3}
#dmStoryLesson[data-appearance="day"] .ml-letter-fixed{color:#194c50}
#dmStoryLesson[data-appearance="day"] .ml-complete h2{color:#31545b!important;-webkit-text-fill-color:#31545b!important}
#dmStoryLesson[data-appearance="day"] .ml-result-stats,#dmStoryLesson[data-appearance="day"] .ml-result-words,#dmStoryLesson[data-appearance="day"] .ml-result-replay{color:#3e626b!important}
@media(min-width:600px) and (max-height:520px){#dmStoryLesson .ml-task{display:grid}#dmStoryLesson .ml-task>.ml-choices,#dmStoryLesson .ml-task>.ml-matches,#dmStoryLesson .ml-task>.ml-teach,#dmStoryLesson .ml-task>.ml-sentence,#dmStoryLesson .ml-task>.ml-letter-puzzle{margin-top:0}#dmStoryLesson .ml-arena-papi{max-height:120px}}

#dmStoryLesson[data-appearance="day"] .ml-reference-card{background:#fffdf2;color:#194c50;border-color:#a8cfc4}
#dmStoryLesson[data-appearance="day"] .ml-reference-card h2{color:#194c50!important;-webkit-text-fill-color:#194c50!important}
#dmStoryLesson[data-appearance="day"] .ml-feedback:not(:empty){background:#fff0e8;color:#783346;border-color:#d49c8e}
#dmStoryLesson[data-appearance="day"] .ml-feedback.is-correct{background:#e3f6e7;color:#1c603e;border-color:#86bc95}
#dmStoryLesson[data-appearance="day"] .ml-feedback.is-correct:before{color:#1c603e}

/* Calm daylight lesson: plain background and consistently legible ink.
   Daylight only; night artwork, game rules and completion behaviour are untouched. */
#dmStoryLesson[data-appearance="day"]{
  --arena-ink:#183b43;
  --arena-light:#183b43;
  --arena-muted:#3c5d65;
  background:#edf5f2;
  background-image:none;
  color:#183b43;
  color-scheme:light;
}
#dmStoryLesson[data-appearance="day"] .ml-header small{
  color:#385e67;
  text-shadow:none;
}
#dmStoryLesson[data-appearance="day"] .ml-header h1{
  color:#183b43!important;
  -webkit-text-fill-color:#183b43!important;
  text-shadow:none;
}
#dmStoryLesson[data-appearance="day"] .ml-header>button{
  background:#e0f0ec;
  border-color:#8bbeb6;
  color:#174d54;
  box-shadow:none;
}
#dmStoryLesson[data-appearance="day"] button:focus-visible,
#dmStoryLesson[data-appearance="day"] summary:focus-visible{
  outline:3px solid #076c80;
  outline-offset:3px;
}
#dmStoryLesson[data-appearance="day"] .ml-wallet-chip{
  background:#ffffff;
  border-color:#c2dcd5;
  box-shadow:0 2px 7px #1a605017;
}
#dmStoryLesson[data-appearance="day"] .ml-wallet-chip b{color:#183b43}
#dmStoryLesson[data-appearance="day"] .ml-wallet-chip small{color:#365d66}
#dmStoryLesson[data-appearance="day"] .ml-progress{
  padding:5px 9px;
  border:1px solid #c9dfd9;
  border-radius:12px;
  background:#fff;
  min-height:22px;
}
#dmStoryLesson[data-appearance="day"] .ml-progress>span{color:#20545b}
#dmStoryLesson[data-appearance="day"] .ml-progress progress,
#dmStoryLesson[data-appearance="day"] progress::-webkit-progress-bar{background:#d8e9e4;box-shadow:none}
#dmStoryLesson[data-appearance="day"] progress::-webkit-progress-value{background:#168878}
#dmStoryLesson[data-appearance="day"] progress::-moz-progress-bar{background:#168878}
#dmStoryLesson[data-appearance="day"] .ml-board{
  background:#fff;
  border:1px solid #c6ddd6;
  box-shadow:0 6px 20px #23574916;
}
#dmStoryLesson[data-appearance="day"] .ml-eyebrow{
  background:#e4f2ee;
  border-color:#aad0c6;
  color:#20565c!important;
  box-shadow:none;
}
#dmStoryLesson[data-appearance="day"] .ml-speech{
  background:#f5faf8;
  border-color:#aecfc5;
  color:#183b43;
  box-shadow:0 3px 9px #1a605011;
}
#dmStoryLesson[data-appearance="day"] .ml-speech:before{background:#f5faf8;border-color:#aecfc5}
#dmStoryLesson[data-appearance="day"] .ml-speech h2{
  color:#183b43!important;
  -webkit-text-fill-color:#183b43!important;
}
#dmStoryLesson[data-appearance="day"] .ml-speech p{color:#3b5963!important}
#dmStoryLesson[data-appearance="day"] .ml-speech small{color:#45646b}
#dmStoryLesson[data-appearance="day"] .ml-speaker{
  background:#e8f2fc;
  border-color:#aacbdf;
  color:#154e70;
  box-shadow:none;
}
#dmStoryLesson[data-appearance="day"] .ml-task p,
#dmStoryLesson[data-appearance="day"] .ml-task .ml-hint{color:#385d66!important}
#dmStoryLesson[data-appearance="day"] .ml-task>.ml-hint,
#dmStoryLesson[data-appearance="day"] .ml-question-instruction,
#dmStoryLesson[data-appearance="day"] .ml-review-count{
  width:fit-content;
  max-width:100%;
  align-self:center;
  padding:4px 8px;
  border-radius:8px;
  background:#eff7f4;
  color:#245159!important;
}
#dmStoryLesson[data-appearance="day"] .ml-choices button:not(.is-correct):not(.is-wrong):not(.is-selected),
#dmStoryLesson[data-appearance="day"] .ml-matches button:not(.is-correct):not(.is-wrong):not(.is-selected),
#dmStoryLesson[data-appearance="day"] .ml-teach button{
  background:#f8fcfa;
  border-color:#a9cbc1;
  box-shadow:0 2px 0 #cfdfd9;
  color:#173e46;
}
#dmStoryLesson[data-appearance="day"] .ml-choices button:hover:not(:disabled):not(.is-correct):not(.is-wrong):not(.is-selected),
#dmStoryLesson[data-appearance="day"] .ml-matches button:hover:not(:disabled):not(.is-correct):not(.is-wrong):not(.is-selected){
  background:#e3f2ec;
  border-color:#328c7b;
}
#dmStoryLesson[data-appearance="day"] .ml-teach b{color:#173e46}
#dmStoryLesson[data-appearance="day"] .ml-teach span:not(.ml-art),
#dmStoryLesson[data-appearance="day"] .ml-teach small{color:#38636a}
#dmStoryLesson[data-appearance="day"] .ml-reference-toggle,
#dmStoryLesson[data-appearance="day"] .ml-actions button:not(.ml-primary),
#dmStoryLesson[data-appearance="day"] .ml-tokens button,
#dmStoryLesson[data-appearance="day"] .ml-letter-bank button{
  background:#e7f2ef;
  border-color:#a3c8bc;
  color:#174c52;
  box-shadow:0 2px 0 #d2e0da;
}
#dmStoryLesson[data-appearance="day"] .ml-sentence,
#dmStoryLesson[data-appearance="day"] .ml-letter-line{
  background:#f4faf7;
  color:#183b43;
  border-color:#afd2c7;
}
#dmStoryLesson[data-appearance="day"] .ml-letter-fixed{color:#183b43}
#dmStoryLesson[data-appearance="day"] .ml-letter-gap:not(.is-filled){
  background:#e3f1eb;
  border-color:#3b8e82;
  color:#174d55;
}
#dmStoryLesson[data-appearance="day"] .ml-reference{border-top-color:#ccdfd8}
#dmStoryLesson[data-appearance="day"] .ml-reference summary{color:#255861}
#dmStoryLesson[data-appearance="day"] .ml-reference button{
  background:#f6fbf8;
  border-color:#b2d1c6;
  color:#173f45;
}
#dmStoryLesson[data-appearance="day"] .ml-reference b{color:#173f45}
#dmStoryLesson[data-appearance="day"] .ml-reference span,
#dmStoryLesson[data-appearance="day"] .ml-reference small{color:#375f65}
#dmStoryLesson[data-appearance="day"] .ml-review-track span{
  background:#e6efed;
  border-color:#a8c9c1;
  color:#48656c;
}
#dmStoryLesson[data-appearance="day"] .ml-review-track .is-current{
  background:#d1e9e0;
  border-color:#3e9a8b;
  color:#18554d;
}
#dmStoryLesson[data-appearance="day"] .ml-review-track .is-done{
  background:#1c7956;
  border-color:#1c7956;
  color:#fff;
}
#dmStoryLesson[data-appearance="day"] .ml-review-note{
  background:#e7f5eb;
  color:#20593f!important;
}
#dmStoryLesson[data-appearance="day"] .ml-feedback:not(:empty){
  background:#fff1e8;
  border-color:#d5a78d;
  color:#663b31;
  box-shadow:none;
}
#dmStoryLesson[data-appearance="day"] .ml-feedback:not(:empty):before{color:#925b39}
#dmStoryLesson[data-appearance="day"] .ml-feedback.is-correct{
  background:#e5f6eb;
  border-color:#8fcb9f;
  color:#225e3e;
}
#dmStoryLesson[data-appearance="day"] .ml-feedback.is-correct:before{color:#225e3e}
#dmStoryLesson[data-appearance="day"] .ml-reference-sheet{background:#163e44aa}
#dmStoryLesson[data-appearance="day"] .ml-reference-panel,
#dmStoryLesson[data-appearance="day"] .ml-reference-card{
  background:#fff;
  border-color:#b6d5cb;
  color:#183b43;
}
#dmStoryLesson[data-appearance="day"] .ml-reference-panel h2,
#dmStoryLesson[data-appearance="day"] .ml-reference-card h2{
  color:#183b43!important;
  -webkit-text-fill-color:#183b43!important;
}
#dmStoryLesson[data-appearance="day"] .ml-reference-list button,
#dmStoryLesson[data-appearance="day"] [data-reference-close]{
  background:#eff8f3;
  color:#183b43;
  border-color:#b2d1c6;
}
#dmStoryLesson[data-appearance="day"] .ml-reference-list span,
#dmStoryLesson[data-appearance="day"] .ml-reference-list small{color:#385e67}
#dmStoryLesson[data-appearance="day"] .ml-complete{
  background:#f9fcf9;
  border:1px solid #c1ddd1;
  border-radius:20px;
  padding:12px;
}
#dmStoryLesson[data-appearance="day"] .ml-complete h2{
  color:#1c5556!important;
  -webkit-text-fill-color:#1c5556!important;
}
#dmStoryLesson[data-appearance="day"] .ml-result-message,
#dmStoryLesson[data-appearance="day"] .ml-result-stats,
#dmStoryLesson[data-appearance="day"] .ml-result-words,
#dmStoryLesson[data-appearance="day"] .ml-result-replay{color:#3b5f65!important}
#dmStoryLesson[data-appearance="day"] .ml-earned{color:#1f6c4b}
#dmStoryLesson[data-appearance="day"] .ml-result-rewards>div{
  background:#eef8f0;
  border-color:#acd1b9;
  box-shadow:0 2px 0 #d0dfd4;
}
#dmStoryLesson[data-appearance="day"] .ml-result-rewards b{color:#205c43}
#dmStoryLesson[data-appearance="day"] .ml-result-rewards small{color:#386356}
#dmStoryLesson[data-appearance="day"] .ml-loading{
  background:#fff;
  color:#183b43;
  border-color:#bfd8d0;
}
#dmStoryLesson[data-appearance="day"] .ml-loading button{
  background:#e7f2ef;
  color:#174c52;
  border-color:#a3c8bc;
}

/* On-placement correctness: order tokens and missing-letter boxes only.
   Empty letters stay neutral; deleting or reordering recalculates state. */
#dmStoryLesson .ml-sentence{display:flex;align-items:center;align-content:center;justify-content:flex-start;flex-wrap:wrap;gap:6px}
#dmStoryLesson .ml-sentence-token{min-height:32px;max-width:100%;padding:5px 9px;border:2px solid transparent;border-radius:10px;font:900 .92em/1.15 Nunito,system-ui,sans-serif;overflow-wrap:anywhere}
#dmStoryLesson .ml-sentence-token.ml-live-correct,
#dmStoryLesson .ml-letter-gap.is-filled.ml-live-correct,
#dmStoryLesson[data-appearance="day"] .ml-sentence-token.ml-live-correct,
#dmStoryLesson[data-appearance="day"] .ml-letter-gap.is-filled.ml-live-correct{
 background:#146e4d!important;border-color:#0d593e!important;color:#fff!important;-webkit-text-fill-color:#fff!important;box-shadow:0 3px 0 #0d5138!important;
}
#dmStoryLesson .ml-sentence-token.ml-live-wrong,
#dmStoryLesson .ml-letter-gap.is-filled.ml-live-wrong,
#dmStoryLesson[data-appearance="day"] .ml-sentence-token.ml-live-wrong,
#dmStoryLesson[data-appearance="day"] .ml-letter-gap.is-filled.ml-live-wrong{
 background:#af3543!important;border-color:#892431!important;color:#fff!important;-webkit-text-fill-color:#fff!important;box-shadow:0 3px 0 #7a2530!important;
}
#dmStoryLesson .ml-sentence-token:focus-visible,
#dmStoryLesson .ml-letter-gap:focus-visible{outline:3px solid #2a8fcd;outline-offset:2px}
@media(max-width:380px){#dmStoryLesson .ml-sentence{gap:4px}#dmStoryLesson .ml-sentence-token{padding:4px 7px;min-height:30px}}

/* Larger DijiMedu discovery mascots. Scoped to the 10 new lesson characters only.
   Preserve the measured lesson fit levels, readable prompts and touch targets. */
#dmStoryLesson .ml-arena-hero{
  grid-template-columns:minmax(105px,35%) minmax(0,1fr);
  gap:12px;
}
#dmStoryLesson .ml-arena-papi[data-ml-character]{
  width:100%;
  height:auto;
  max-height:205px;
  object-fit:contain;
  transform:scale(1.16);
  transform-origin:center center;
}
#dmStoryLesson[data-fit="1"] .ml-arena-hero{
  grid-template-columns:minmax(92px,32%) minmax(0,1fr);
  gap:9px;
}
#dmStoryLesson[data-fit="1"] .ml-arena-papi[data-ml-character]{
  max-height:155px;
  transform:scale(1.12);
}
#dmStoryLesson[data-fit="2"] .ml-arena-hero{
  grid-template-columns:minmax(78px,28%) minmax(0,1fr);
  gap:8px;
}
#dmStoryLesson[data-fit="2"] .ml-arena-papi[data-ml-character]{
  max-height:122px;
  transform:scale(1.08);
}
@media(max-width:360px){
  #dmStoryLesson .ml-arena-hero{
    grid-template-columns:minmax(90px,33%) minmax(0,1fr);
    gap:7px;
  }
  #dmStoryLesson[data-fit="1"] .ml-arena-hero{
    grid-template-columns:minmax(84px,31%) minmax(0,1fr);
    gap:6px;
  }
  #dmStoryLesson[data-fit="2"] .ml-arena-hero{
    grid-template-columns:minmax(72px,27%) minmax(0,1fr);
    gap:6px;
  }
}
@media(min-width:600px) and (max-height:520px){
  #dmStoryLesson .ml-arena-papi[data-ml-character]{max-height:145px;}
  #dmStoryLesson[data-fit="1"] .ml-arena-papi[data-ml-character]{max-height:112px;}
  #dmStoryLesson[data-fit="2"] .ml-arena-papi[data-ml-character]{max-height:95px;}
}

/* Learning-path premium redesign — theme overview + journey entry, 2026-10-17. */
#mlThemeList{padding:clamp(10px,3vw,22px);background:#173e526e;backdrop-filter:blur(10px);color:#153b49}
#mlThemeList .ml-theme-panel{width:min(100%,810px);padding:22px clamp(13px,3.8vw,32px) 30px;border-radius:32px;background:linear-gradient(170deg,#fffef9,#f7fbf8);box-shadow:0 20px 60px #0d324447}
#mlThemeList .ml-theme-cover{position:relative;display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:135px;margin-bottom:12px;padding:8px 56px 8px 0}
#mlThemeList .ml-theme-cover-copy{position:relative;z-index:1;min-width:0}
#mlThemeList .ml-theme-cover-copy>small{color:#087783;font-size:12px;letter-spacing:3px;font-weight:950}
#mlThemeList .ml-theme-cover h2{color:#0c2c44!important;-webkit-text-fill-color:#0c2c44!important;font-size:clamp(27px,6vw,37px);line-height:1.14;margin:9px 0!important;letter-spacing:-.035em}
#mlThemeList .ml-theme-cover p{color:#5d7385;margin:8px 0 0;font-size:clamp(12px,3.2vw,15px);line-height:1.5}
#mlThemeList .ml-theme-cover-art{flex:0 0 auto;font-size:clamp(36px,9vw,66px);filter:drop-shadow(0 8px 13px #27877929);position:relative;white-space:nowrap}
#mlThemeList .ml-theme-cover-art span{position:absolute;font-size:.43em;top:-.3em;right:-.15em}
#mlThemeList .ml-theme-cover [data-close]{position:absolute;z-index:2;right:0;top:0;width:43px;height:43px;min-height:43px;background:#e4f4ee;color:#196573;border:0;border-radius:50%;font-size:27px;box-shadow:0 3px 10px #1e6c5917}
#mlThemeList .ml-summary-card{display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:18px;padding:19px;border-radius:27px;background:linear-gradient(120deg,#e9f7f3,#e5f6f5);margin:14px 0 12px}
#mlThemeList .ml-summary-ring{width:100px;aspect-ratio:1;border-radius:50%;background:conic-gradient(#24b99b var(--ml-done),#c9e9e0 0);display:grid;place-items:center;flex-shrink:0}
#mlThemeList .ml-summary-ring>div{width:77%;height:77%;border-radius:50%;background:#f9fffd;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.03;color:#092e48}
#mlThemeList .ml-summary-ring b{font-size:28px;font-weight:950}
#mlThemeList .ml-summary-ring small{font-size:14px;color:#355568;margin:3px 0 0}
#mlThemeList .ml-summary-info{min-width:0}
#mlThemeList .ml-summary-info>strong{display:block;color:#0d344b;font-size:clamp(17px,4vw,21px);font-weight:950}
#mlThemeList .ml-summary-info p{color:#577283;font-size:13px;line-height:1.4;margin:6px 0 11px}
#mlThemeList .ml-summary-track,#mlThemeList .ml-theme-track{display:block;height:9px;width:100%;border-radius:30px;background:#d6e3e5;overflow:hidden}
#mlThemeList .ml-summary-track>span,#mlThemeList .ml-theme-track>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#179d91,#36cda3)}
#mlThemeList .ml-summary-info>small{display:block;text-align:right;margin-top:5px;font-size:11px;color:#22696a;font-weight:850}
#mlThemeList .ml-inherited{display:flex;align-items:flex-start;gap:14px;border:0;border-radius:21px;padding:14px 16px;background:linear-gradient(120deg,#fff6d9,#fffaf0);color:#4a5760;font-size:13px;line-height:1.45;margin:12px 0 20px}
#mlThemeList .ml-inherited>span:first-child{font-size:27px;line-height:1.2;flex-shrink:0}
#mlThemeList .ml-theme-list-heading{display:flex;justify-content:space-between;align-items:center;color:#122e46;font-size:20px;margin:18px 4px 12px}
#mlThemeList .ml-theme-list-heading small{font-size:12px;color:#668e88}
#mlThemeList .ml-theme{border:1px solid #d8e6e4;border-radius:23px;background:#fff;box-shadow:0 6px 17px #173f4310;margin:10px 0;overflow:hidden}
#mlThemeList .ml-theme-current{border-color:#50bba9;box-shadow:0 7px 20px #34ad9523}
#mlThemeList .ml-theme>summary{display:flex;align-items:center;gap:12px;min-height:101px;padding:16px 13px;list-style:none}
#mlThemeList .ml-theme>summary::-webkit-details-marker{display:none}
#mlThemeList .ml-theme-number{flex:0 0 51px;height:56px;border-radius:16px;background:#daf3eb;color:#0d6e5d;font-size:24px;font-weight:950;display:grid;place-items:center}
#mlThemeList .ml-theme-info{flex:1;min-width:0;display:block}
#mlThemeList .ml-theme-info>strong{display:block;color:#123246;font-size:clamp(16px,3.9vw,20px);line-height:1.2;font-weight:950;overflow-wrap:anywhere}
#mlThemeList .ml-theme-info>small{font-size:12px;line-height:1.35;color:#608078;font-weight:750;margin:5px 0 8px}
#mlThemeList .ml-theme-track{height:6px}
#mlThemeList .ml-theme-state{flex:0 0 auto;min-width:41px;height:41px;padding:0 4px;border-radius:50%;background:#e5f5ef;display:grid;place-items:center;color:#167762;font-size:12px;font-weight:950}
#mlThemeList .ml-theme-state:has(+ .ml-theme-chevron){white-space:nowrap}
#mlThemeList .ml-theme-chevron{font-size:24px;color:#205e6a;line-height:1;transition:transform .2s}
#mlThemeList .ml-theme[open] .ml-theme-chevron{transform:rotate(180deg)}
#mlThemeList .ml-theme[open]>summary{background:linear-gradient(115deg,#f3fdfa,#e8f8f4)}
#mlThemeList .ml-theme-body{padding:13px 12px 17px;border-top:1px solid #e1f2ee}
#mlThemeList .ml-topic-heading{display:flex;justify-content:space-between;align-items:center;padding:1px 4px 12px;color:#193447}
#mlThemeList .ml-topic-heading strong{font-size:15px}
#mlThemeList .ml-topic-heading small{font-size:12px;color:#667f8c}
#mlThemeList .ml-topic-grid{display:grid;grid-template-columns:1fr;gap:10px;padding:0}
#mlThemeList .ml-topic-card{min-width:0;padding:12px;border:1px solid #e1e9e9;border-radius:17px;background:#fff;box-shadow:0 2px 5px #132d3410}
#mlThemeList .ml-topic-card.is-current{border-color:#b3e6d7;background:linear-gradient(115deg,#ffffff,#f4fdfa)}
#mlThemeList .ml-topic-head{display:flex;align-items:center;gap:9px;min-width:0}
#mlThemeList .ml-topic-number{flex:0 0 27px;height:33px;display:grid;place-items:center;border-radius:10px;background:#f3f5ec;color:#1e5368;font-size:13px;font-weight:950}
#mlThemeList .ml-topic-icon{flex:0 0 39px;height:41px;display:grid;place-items:center;border-radius:12px;background:#f1f5ff;font-size:23px}
#mlThemeList .ml-topic-copy{flex:1;min-width:0}
#mlThemeList .ml-topic-copy h3{font-size:clamp(14px,3.5vw,17px);line-height:1.25;margin:0 0 3px;color:#15364a;font-weight:950}
#mlThemeList .ml-topic-copy p{font-size:12px;line-height:1.4;color:#657d86;margin:0;min-height:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
#mlThemeList .ml-topic-status{flex:0 0 44px;display:grid;place-items:center;color:#4c6d75;font-weight:950}
#mlThemeList .ml-topic-status b{width:37px;height:34px;border-radius:12px;background:#f0f4f4;display:grid;place-items:center;font-size:13px}
#mlThemeList .ml-topic-status.is-done b{background:#dcf6e9;color:#167b5d;font-size:21px}
#mlThemeList .ml-topic-status small{font-size:10px;color:#638078;margin-top:2px}
#mlThemeList .ml-topic-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
#mlThemeList .ml-topic-step{min-width:0;min-height:48px!important;border:1px solid #a7dbcb!important;border-radius:12px!important;background:#eaf8f2!important;color:#155e55!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:6px 4px!important;text-align:center;font-size:12px!important;font-weight:850!important}
#mlThemeList .ml-topic-step>span{max-width:100%;white-space:normal;overflow-wrap:anywhere}
#mlThemeList .ml-topic-step small{font-size:10px;color:#468578;margin:0;font-weight:650}
#mlThemeList .ml-topic-step.locked{background:#f5f7f6!important;border-color:#e1e8e6!important;color:#8b9a97!important;filter:none;opacity:.72}
#mlThemeList .ml-topic-step.is-done{background:#daf6e9!important}
#mlThemeList .ml-topic-step:focus-visible,#mlThemeList summary:focus-visible{outline:3px solid #147ba2;outline-offset:2px}
@media(max-width:430px){
 #mlThemeList{padding:9px}
 #mlThemeList .ml-theme-panel{padding:15px 12px 24px;border-radius:25px}
 #mlThemeList .ml-theme-cover{min-height:104px;padding-right:41px}
 #mlThemeList .ml-theme-cover-art{font-size:39px}
 #mlThemeList .ml-theme-cover [data-close]{width:36px;height:36px;min-height:36px;font-size:24px}
 #mlThemeList .ml-summary-card{grid-template-columns:76px minmax(0,1fr);gap:12px;padding:14px}
 #mlThemeList .ml-summary-ring{width:76px}
 #mlThemeList .ml-summary-ring b{font-size:24px}
 #mlThemeList .ml-theme>summary{gap:8px;padding:12px 9px;min-height:84px}
 #mlThemeList .ml-theme-number{flex-basis:42px;height:46px;font-size:21px}
 #mlThemeList .ml-theme-info>small{font-size:10.5px}
 #mlThemeList .ml-theme-state{min-width:33px;height:33px;font-size:10px}
 #mlThemeList .ml-theme-chevron{font-size:19px}
 #mlThemeList .ml-topic-head{gap:7px}
 #mlThemeList .ml-topic-number{flex-basis:23px}
 #mlThemeList .ml-topic-icon{flex-basis:32px;height:35px;font-size:19px}
 #mlThemeList .ml-topic-status{flex-basis:37px}
 #mlThemeList .ml-topic-card{padding:10px}
}
@media(max-width:350px){#mlThemeList .ml-theme-cover-art{display:none}#mlThemeList .ml-topic-copy p{-webkit-line-clamp:1}#mlThemeList .ml-topic-head{gap:5px}}
/* Journey entry is intentionally distinct from game/course start dialogs. */
#dmStoryLesson.ml-entry{padding:max(70px,env(safe-area-inset-top)) 12px 24px;align-items:start;overflow-y:auto}
#dmStoryLesson.ml-entry .ml-entry-card{position:relative;isolation:isolate;overflow:visible;width:min(100%,455px);margin:36px auto 14px;padding:90px clamp(16px,4vw,26px) 22px;border:3px solid #fff;border-radius:32px;background:linear-gradient(170deg,#f4e7ff 0%,#fefbff 42%,#fff 74%);box-shadow:0 8px 0 #d9c3eb,0 22px 48px #2e164b3b;color:#45206a}
#dmStoryLesson.ml-entry .ml-entry-journey{position:absolute;inset:38px 9% auto;pointer-events:none;color:#bea0e3;font-size:25px;letter-spacing:2.3em;white-space:nowrap;overflow:hidden;opacity:.75}
#dmStoryLesson.ml-entry .ml-entry-papi{position:absolute;top:-93px;left:50%;transform:translateX(-50%);width:188px;height:188px;max-width:55%;object-fit:contain;filter:drop-shadow(0 7px 8px #8064a947);pointer-events:none;z-index:2}
#dmStoryLesson.ml-entry .ml-entry-close{right:12px;top:13px;width:43px;height:43px;min-height:43px;background:#fff;color:#7d52a8;border-radius:50%;box-shadow:0 4px 12px #8866aa28;z-index:3}
#dmStoryLesson.ml-entry .ml-entry-badge{display:inline-block;width:auto;padding:6px 13px;border-radius:99px;background:#ead8fa;color:#8a58ae;font-size:11px;font-weight:950;letter-spacing:1.2px}
#dmStoryLesson.ml-entry .ml-entry-card h2{font-size:clamp(25px,6vw,33px)!important;line-height:1.1;margin:12px 0 7px!important;color:#3b1c68!important;-webkit-text-fill-color:#3b1c68!important}
#dmStoryLesson.ml-entry .ml-entry-theme{font-size:16px;line-height:1.3;margin:7px 0 16px;color:#8c75a2}
#dmStoryLesson.ml-entry .ml-entry-prize{display:grid;grid-template-columns:82px minmax(0,1fr);align-items:center;gap:13px;margin:12px 0 16px;padding:15px;border:2px solid #e5d6f8;border-radius:22px;background:linear-gradient(150deg,#ffffffc2,#f6f0ff);text-align:left}
#dmStoryLesson.ml-entry .ml-prize-art{position:relative;font-size:45px;line-height:1.1;text-align:center;filter:drop-shadow(0 5px 8px #dba82950)}
#dmStoryLesson.ml-entry .ml-prize-art span{position:absolute;right:0;bottom:-5px;font-size:30px}
#dmStoryLesson.ml-entry .ml-prize-copy{display:flex;flex-direction:column;gap:5px;min-width:0}
#dmStoryLesson.ml-entry .ml-prize-copy b{color:#402463;font-size:14px}
#dmStoryLesson.ml-entry .ml-prize-copy strong{font-size:clamp(18px,5vw,25px);line-height:1.2;font-weight:950;color:#8554c7}
#dmStoryLesson.ml-entry .ml-prize-copy>span{font-size:12px;color:#86709b;line-height:1.4}
#dmStoryLesson.ml-entry .ml-entry-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;margin:6px 0 12px;align-items:center}
#dmStoryLesson.ml-entry .ml-entry-stats>div{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;padding:5px 3px;color:#4c5076}
#dmStoryLesson.ml-entry .ml-entry-stats>div:not(:last-child){border-right:1px solid #e1d4f1}
#dmStoryLesson.ml-entry .ml-entry-stats span{display:grid;place-items:center;flex:0 0 30px;width:30px;height:33px;background:#f0eafa;border-radius:50%;font-size:18px}
#dmStoryLesson.ml-entry .ml-entry-stats>div:nth-child(2) span{background:#ebf1ff}
#dmStoryLesson.ml-entry .ml-entry-stats>div:nth-child(3) span{background:#e3f7ee}
#dmStoryLesson.ml-entry .ml-entry-stats b{font-size:11px;line-height:1.2;font-weight:900;text-align:left}
#dmStoryLesson.ml-entry .ml-entry-resume{color:#715b89;background:#f6f0fc;padding:9px 12px;border-radius:13px;margin:8px 0 10px;font-size:12px;line-height:1.35}
#dmStoryLesson.ml-entry .ml-entry-start{position:relative;display:flex;align-items:center;justify-content:center;gap:9px;min-height:61px;padding:11px 13px;margin:12px 0 0;border:1px solid #e6beff;border-radius:25px;background:linear-gradient(165deg,#c386ed,#8b45e5 55%,#712cc6);box-shadow:0 6px 0 #6831ae,0 11px 22px #8640d03a;color:white;font-size:clamp(13px,3.7vw,17px);font-weight:950;line-height:1.2;text-shadow:0 1px 3px #3d1a6c45}
#dmStoryLesson.ml-entry .ml-entry-start-icon{font-size:22px}
#dmStoryLesson.ml-entry .ml-entry-start-arrow{font-size:24px;line-height:1}
#dmStoryLesson.ml-entry .ml-entry-start:hover{filter:brightness(1.05)}
#dmStoryLesson.ml-entry .ml-entry-start:active{transform:translateY(3px);box-shadow:0 3px 0 #6831ae}
@media(max-width:360px){
 #dmStoryLesson.ml-entry .ml-entry-card{padding:76px 13px 19px}
 #dmStoryLesson.ml-entry .ml-entry-papi{width:156px;height:156px;top:-79px}
 #dmStoryLesson.ml-entry .ml-entry-prize{grid-template-columns:55px minmax(0,1fr);padding:11px;gap:10px}
 #dmStoryLesson.ml-entry .ml-prize-art{font-size:33px}
 #dmStoryLesson.ml-entry .ml-entry-stats span{flex-basis:26px;width:26px;height:29px;font-size:16px}
 #dmStoryLesson.ml-entry .ml-entry-stats b{font-size:10px}
}
@media(prefers-reduced-motion:reduce){#mlThemeList .ml-theme-chevron,#dmStoryLesson.ml-entry .ml-entry-start{transition:none;animation:none}}

/* Papi's short mastery-recovery stage; appropriate contrast in both themes. */
#dmStoryLesson .ml-recovery-status{padding:9px 13px;margin:8px 0;border:1px solid #85b5c3;border-radius:13px;background:#123b50;color:#f2f9fb;font-size:13px;font-weight:800;line-height:1.4}
#dmStoryLesson[data-appearance="day"] .ml-recovery-status{background:#e7f4f1;border-color:#8abdb4;color:#183b43;-webkit-text-fill-color:#183b43}
#dmStoryLesson .ml-recovery-choices{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:9px}
#dmStoryLesson .ml-recovery-choices button{min-height:46px;font-weight:900}
#dmStoryLesson .ml-result-fair{display:block;margin:9px auto;padding:8px 12px;width:fit-content;border:1px solid #72c5bc;border-radius:12px;background:#163e4c;color:#eafff6;font-size:13px;font-weight:900;text-align:center}
#dmStoryLesson[data-appearance="day"] .ml-result-fair{background:#e5f6ed;color:#174e40;-webkit-text-fill-color:#174e40}
