/* Mobile course selection only. Existing desktop and learning business logic are unchanged. */
@media (max-width: 767px) {
  html:has(.student-course-page), html body:has(.student-course-page) {height:100dvh!important;min-height:0!important;overflow:hidden!important}
  html body .student-course-page {
    height: 100dvh !important; min-height: 0 !important;
    padding-bottom: 0 !important; overflow: hidden !important;
    display: flex !important; flex-direction: column !important;
  }
  html body .student-course-page .student-course-header {
    position: relative !important; flex: 0 0 auto; padding: 10px 12px !important;
    display: flex !important; flex-wrap: wrap; gap: 8px !important;
  }
  html body .student-course-header > div:first-child {width:100%;min-width:0;gap:10px!important}
  html body .student-course-header > div:first-child > div {min-width:0;gap:6px!important}
  html body .student-course-header h1 {font-size:15px!important;line-height:1.4;white-space:normal}
  html body .student-course-header .learning-back-button {min-height:40px;padding:8px 10px!important}
  html body .student-course-header > div:last-child {width:100%;min-width:0;gap:8px!important;justify-content:flex-end}
  html body .student-course-header [data-community-tools] button {min-height:40px!important;max-width:100%;height:auto!important;white-space:normal;overflow-wrap:anywhere}
  html body .student-course-page .student-course-main {
    flex:1 1 auto!important;min-height:0!important;width:100%;max-width:100%;
    padding:14px 12px 20px!important;
    margin-bottom:calc(152px + env(safe-area-inset-bottom,0px))!important;
    overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;
    scroll-padding-bottom:16px;box-sizing:border-box;
  }
  html body .student-course-page .student-course-shell {
    display:block!important;height:auto!important;min-height:0!important;
    width:100%!important;max-width:100%!important;overflow:visible!important;
    margin:0!important;padding:0!important;
  }
  html body .student-course-page .student-course-intro {margin:0 0 14px!important}
  html body .student-course-page .student-course-intro h2 {font-size:23px!important;line-height:1.4}
  html body .student-course-page .student-course-picker {display:block!important;min-width:0;min-height:0!important;padding:14px!important;border-radius:20px!important}
  html body .student-course-page .student-course-picker-grid {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:none!important;gap:16px!important;min-width:0;width:100%;
    height:auto!important;overflow:visible!important;
  }
  html body .student-course-page .student-course-picker-grid > * {grid-column:1!important;min-width:0!important;max-width:100%!important;width:100%!important}
  html body .student-course-page .student-course-grade {justify-self:stretch!important}
  html body .student-course-page .student-course-picker-grid select {min-width:0!important;width:100%!important;min-height:44px;font-size:16px!important;box-sizing:border-box}
  html body .student-course-page .student-course-version > div:first-child,
  html body .student-course-page .student-course-grade > div:first-child {margin-bottom:8px!important}
  html body .student-course-page [aria-label="选择册次"] {flex-wrap:wrap!important;gap:12px!important}
  html body .student-course-page .student-course-book {display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;grid-template-rows:auto auto!important;gap:4px 12px!important;align-items:center!important;width:100%!important;min-width:0;text-align:left!important}
  html body .student-course-page .student-course-book > button {grid-row:1 / 3!important;grid-column:1!important;width:64px!important;height:80px!important;min-height:0!important;font-size:10px!important;padding:5px!important}
  html body .student-course-page .student-course-book > button > span:first-child {padding:3px!important}
  html body .student-course-page .student-course-book > button span {font-size:inherit!important;line-height:1.2!important}
  html body .student-course-page .student-course-book > :not(button) {grid-column:2!important;min-width:0!important;margin:0!important;text-align:left!important}
  html body .student-course-page .student-course-units {display:block!important;height:auto!important;min-height:0!important;overflow:visible!important;padding-top:16px!important}
  html body .student-course-page .student-course-unit-groups {height:auto!important;min-height:0!important;overflow:visible!important;display:block!important}
  html body .student-course-page .student-course-unit-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;min-width:0!important}
  html body .student-course-page .student-course-unit-card {min-width:0!important;min-height:70px!important;padding:10px!important}
  html body .student-course-page .student-course-unit-card > span:first-child {padding-right:17px!important;gap:4px 6px!important;line-height:1.4}
  html body .student-course-page .student-course-unit-card > span:first-child > span:first-child {font-size:14px!important}
  html body .student-course-page .cet-unit-pager {position:static!important;display:flex!important;flex-direction:column;align-items:stretch;gap:10px;margin-top:16px!important}
  html body .student-course-page .cet-unit-pager-controls {display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;gap:6px;width:100%}
  html body .student-course-page .cet-unit-pager-controls :is(button,select) {min-height:44px;font-size:12px!important;padding:8px!important;min-width:0!important}
  html body .student-course-page .cet-course-actions {
    position:fixed!important;left:12px!important;right:12px!important;
    bottom:calc(66px + env(safe-area-inset-bottom,0px))!important;
    transform:none!important;width:auto!important;max-width:none!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:10px!important;
    padding:12px!important;margin:0!important;box-sizing:border-box;z-index:300!important;
  }
  html body .student-course-page .cet-course-actions > div {max-width:none!important;font-size:12px!important;gap:3px!important;min-width:0;overflow-wrap:anywhere}
  html body .student-course-page .student-course-start {min-height:46px!important;font-size:14px!important;padding:10px 14px!important}
  /* Keep the existing feedback, mascot interaction and teacher controls, in separate slots. */
  html body:has(.student-course-page) button.tutu-feedback-entry.tutu-entry-surface {left:60px!important;bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;min-height:44px!important;width:90px!important;padding:6px!important;font-size:12px!important}
  html body:has(.student-course-page) button.tutu-launcher {right:12px!important;bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;min-height:44px!important;width:90px!important}
  html body:has(.student-course-page) .tutu-launcher .tutu-nameplate {min-height:44px!important;width:100%!important;padding:6px!important;font-size:12px!important;box-sizing:border-box}
  html body:has(.student-course-page) .tutu-launcher .tutu-invite {bottom:100%!important;max-width:150px;right:0}
  html body:has(.student-course-page) .st-walker-host .tutu-walking-lane {left:calc(50% - 10px)!important;right:auto!important;bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;width:44px!important;height:44px!important}
  html body:has(.student-course-page) .st-walker-host .tutu-walking-actor {left:0!important;bottom:0!important;width:44px!important;height:44px!important;transform:none!important;pointer-events:auto}
  html body:has(.student-course-page) .st-scope .st-caption {top:auto!important;bottom:calc(152px + env(safe-area-inset-bottom,0px))!important;left:16px!important;max-width:calc(100vw - 32px)!important;box-sizing:border-box}
}
