/* Reclaim margins on tablets and short laptop windows; full-size desktops retain their layout. */
@media (max-width:1600px), (max-height:900px) {
  html:root .learning-page-layer:not([data-word-fit]) {
    padding:4px!important;
    min-width:0;
  }
  html:root .learning-main-canvas:not([data-word-art]) {
    max-width:none!important;
    padding:12px 16px!important;
    border-radius:18px!important;
  }
  /* Use the available lesson width before reducing content scale. */
  html:root .learning-main-canvas :is(.max-w-3xl,.max-w-5xl):has(>#spelling-practice,>#sentence-game) {
    max-width:100%!important;
  }
  html:root .learning-main-canvas:has(.learning-word-card):not([data-word-art]) {
    min-height:0!important;
  }
  /* The assistant rests in a corner during lessons; it needs no full-width lane. */
  html:root body:has(.learning-stage-entry .learning-word-card)::after {display:none!important;}
  html:root[data-app-mode="android"] .learning-page-layer:not([data-word-fit]) {padding:0!important;}
  html:root .learning-fullscreen-layer:fullscreen:not([data-word-frame]) {
    padding:48px 8px 8px!important;
  }
  html:root .learning-fullscreen-layer:fullscreen>.learning-main-canvas:not([data-word-art]) {
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    min-height:0!important;
    aspect-ratio:auto!important;
    margin:0!important;
  }
}

/* Keep the directory usable while giving small notebooks more lesson width. */
@media(min-width:1024px) and (max-width:1600px){
 [aria-label="本单元全部单词"]:has(.student-directory-scrollbar){width:clamp(184px,16vw,216px)!important;padding-inline:8px}
}
