/* Nihongo-only lesson polish; supplied route icons are unchanged originals. */
.koi-learning-body:is(.koi-stage-cards-page,.koi-stage-translation-page,.koi-stage-practice-page,.koi-stage-test-page,.koi-stage-listening-page){background:linear-gradient(#060c1280,#060c1280),url('./nihongo/learning/background.jpg') center/cover fixed no-repeat #080f16}
.koi-sensei-portrait{position:relative;isolation:isolate;width:100%;aspect-ratio:1.3;overflow:hidden;border-radius:8px;background:#10181c}
.koi-sensei-portrait img[data-sensei-frame]{position:absolute!important;inset:0;display:block!important;width:100%!important;height:100%!important;max-width:100%;margin:0!important;object-fit:cover;object-position:center 24%;border-radius:inherit;opacity:0;transition:opacity 300ms ease}
.koi-sensei-portrait[data-sensei-state=looks] [data-sensei-frame=looks],.koi-sensei-portrait[data-sensei-state=thinks] [data-sensei-frame=thinks],.koi-sensei-portrait[data-sensei-state=sleep] [data-sensei-frame=sleep]{opacity:1}
.koi-learning-body .koi-learning-help.koi-lesson-ai-panel{display:flex;flex-direction:column;height:auto;min-height:0;background:#0a1117ed;isolation:isolate}
.koi-learning-body .koi-lesson-ai-panel::before{display:none}
.koi-learning-body .koi-lesson-ai-panel .koi-sensei-portrait{flex:none;margin:16px 0}
.koi-learning-body .koi-lesson-ai-panel .koi-lesson-ai-footer{position:static;display:flex;flex-direction:column;max-height:none;min-height:0;gap:10px;padding-top:0}
.koi-learning-body .koi-lesson-ai-panel .koi-learning-help-prompts{display:grid;grid-template-columns:1fr;gap:8px}
.koi-learning-body .koi-lesson-ai-panel .koi-ai-chat{display:flex;flex-direction:column;gap:8px;min-height:0}
.koi-home-ai-content>.koi-sensei-portrait,.sensei-mentor>.koi-sensei-portrait{margin-bottom:16px;max-height:300px}
.koi-sensei-shell>[data-sensei-portrait]{max-width:390px;margin-bottom:20px}
.koi-learning-body .koi-stage-strip img{width:64px;height:64px;padding:0;border:0;border-radius:50%;background:transparent;object-fit:contain;box-shadow:none;filter:brightness(.84);transition:filter 220ms ease,transform 220ms ease}
.koi-learning-body .koi-stage-strip .koi-stage-active img{filter:brightness(0) saturate(100%) invert(22%) sepia(93%) saturate(4510%) hue-rotate(345deg) brightness(106%) contrast(110%) drop-shadow(0 0 5px #ee163d99) drop-shadow(0 0 12px #d5113544)}
.koi-learning-body .koi-stage-strip .koi-stage-active strong{color:#ff425d;text-shadow:0 0 12px #e7224855}
.koi-learning-body .koi-stage-strip li:not(:last-child)::after{top:32px;left:calc(50% + 32px);right:calc(-50% + 32px)}
.koi-learning-body .koi-stage-strip a:hover img{filter:brightness(1.1);transform:translateY(-2px)}
@media(min-width:1181px){.koi-learning-body .koi-learning-help{position:sticky;top:20px;align-self:start;max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}}
@media(max-width:760px){.koi-learning-body .koi-stage-strip ol{flex-wrap:wrap;gap:14px 6px}.koi-learning-body .koi-stage-strip li{flex:0 1 calc(33.333% - 6px);min-width:0}.koi-learning-body .koi-stage-strip img{width:56px;height:56px}}
@media(prefers-reduced-motion:reduce){.koi-learning-body .koi-stage-strip img,.koi-sensei-portrait img[data-sensei-frame]{transition:none}}
/* Sleeping panels belong to the document, never follow the viewport. */
.koi-learning-body .koi-learning-help.koi-lesson-ai-observing{position:static;top:auto;max-height:none;overflow:visible}
.koi-learning-body .koi-learning-reading{background:rgb(7 13 17/.88);border-radius:12px;overflow:hidden}
.koi-learning-body .koi-stage-strip{padding-block:10px}
.koi-learning-body .koi-stage-strip .koi-stage-active{border-bottom:0}
.koi-learning-body .koi-stage-strip a,.koi-learning-body .koi-stage-strip span{gap:2px}
.koi-learning-body .koi-stage-strip img{width:56px;height:56px}
.koi-learning-body .koi-stage-strip li:not(:last-child)::after{top:28px;left:calc(50% + 28px);right:calc(-50% + 28px)}
.koi-practice-rail{display:flex;flex-direction:column;align-self:stretch;gap:16px;min-width:0}
.koi-learning-body .koi-practice-rail .koi-learning-help{position:static;box-sizing:border-box;width:100%;max-height:none;flex:none}
.koi-practice-memo{flex:1;padding:16px;border:1px solid var(--koi-border-quiet);border-radius:10px;background:linear-gradient(145deg,#0c171df5,#091015f5);box-shadow:inset 0 1px #ffffff05;min-width:0}
.koi-practice-memo header{display:flex;align-items:center;gap:4px;margin-left:-8px}
.koi-practice-memo header>img{width:48px;height:48px;flex:none;object-fit:contain}
.koi-practice-memo h2{margin:0;font-family:var(--koi-font-display);font-size:1.3rem;line-height:1.2;font-weight:400;color:var(--koi-text)}
.koi-practice-memo-intro{margin:0 0 16px;color:var(--koi-secondary);font-size:.8rem;line-height:1.45}
.koi-practice-memo ul{display:grid;gap:16px;margin:0;padding:0;list-style:none}
.koi-practice-memo li{display:grid;grid-template-columns:42px minmax(0,1fr);gap:12px;align-items:start}
.koi-practice-memo-icon{position:relative;display:block;width:42px;height:44px;border-radius:9px;background:#050b0f99;overflow:hidden}
.koi-practice-memo-icon img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;width:62px;height:62px;margin:0;max-width:none;object-fit:contain;filter:drop-shadow(0 0 5px #ed244529)}
.koi-practice-memo h3{margin:0 0 3px;font-size:.85rem;line-height:1.4;font-weight:650;color:var(--koi-text)}
.koi-practice-memo li p{margin:0;font-size:.8rem;line-height:1.5;color:var(--koi-secondary);overflow-wrap:anywhere}
@media(min-width:1181px){
  .koi-stage-practice-page .koi-learning-reading{align-self:stretch;display:flex;flex-direction:column}
  .koi-stage-practice-page .koi-learning-reading>.koi-learning-card{flex:1;display:flex;flex-direction:column}
  .koi-stage-practice-page .koi-learning-card>.koi-practice-modern{flex:1;display:flex;flex-direction:column}
  .koi-stage-practice-page .koi-practice-modern>.koi-stage-strip{margin-top:auto}
}
@media(max-width:1180px){.koi-practice-rail{grid-column:1/-1;order:3;width:100%}.koi-practice-memo{flex:auto}}
