/* Student touch components. Desktop, teacher and administrator layouts stay in styles.css. */
.student-bottom-nav,.mobile-learning-bar,.mobile-reading-toggle,.mobile-filter-trigger,.mobile-exam-meter { display:none; }
@media (max-width:700px), (max-width:1000px) and (max-height:500px) {
  .student-mode {
    --mobile-ink:#183c65;
    --mobile-accent:#c71935;
    --mobile-canvas:#f3f6fa;
    --mobile-bar:calc(64px + env(safe-area-inset-bottom,0px));
    background:var(--mobile-canvas);
    -webkit-tap-highlight-color:transparent;
  }
  .student-mode .main { width:100%; min-width:0; }
  .student-mode .top { position:sticky; top:0; height:auto; min-height:60px; padding:env(safe-area-inset-top,0px) 16px 0; z-index:12; background:#fff; }
  .student-mode .learner-top { min-height:60px; height:auto; gap:12px; justify-content:space-between; }
  .student-mode .learner-links,.student-mode .learner-actions .portal-search,.student-mode .quick-rail { display:none!important; }
  .student-mode .learner-brand { display:flex; gap:8px; font-size:15px; }
  .student-mode .learner-brand > div { display:block; }
  .student-mode .learner-brand .solamoda-logo { width:46px; max-width:46px; }
  .student-mode .learner-brand > div > div { font-size:9px!important; }
  .student-mode .learner-actions { display:flex; gap:7px; margin-left:auto; }
  .student-mode .learner-actions .avatar { display:none; }
  .student-mode .learner-user-name { display:block; max-width:70px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
  .student-mode .learner-actions .logout { display:block; min-height:44px; padding:8px; color:#687a90; }
  .student-mode .content { padding:16px 16px calc(var(--mobile-bar) + 24px); width:100%; min-width:0; }
  .student-mode .page-context-nav { margin-bottom:12px; font-size:12px; flex-wrap:wrap; }
  .student-mode .page-context-nav .page-back { min-height:44px; }
  .student-mode button,.student-mode a,.student-mode label { touch-action:manipulation; }
  .student-mode :is(input,select,textarea) { font-size:16px; }
  .student-mode .btn,.student-mode .close { min-height:44px; }
  .student-mode .close { min-width:44px; flex:none; }
  .student-mode .head { margin-bottom:16px; }
  .student-mode .head h1 { font-size:22px; overflow-wrap:anywhere; }
  .student-mode .learner-page-banner { min-height:0; padding:20px; border-radius:14px; }
  .student-mode .learner-page-banner p { font-size:13px; line-height:1.7; }
  .student-mode #studentHome.active { display:flex; flex-direction:column; gap:0; }
  .student-mode #studentHome > .learner-dashboard-head { min-height:0; padding:22px 18px 16px; background-position:58% center; margin-bottom:20px; border-radius:16px; }
  .student-mode #studentHome .learner-hero-copy { min-height:126px; }
  .student-mode #studentHome .learner-hero-copy h1 { font-size:25px; max-width:none; line-height:1.45; }
  .student-mode #studentHome .learner-hero-copy p { font-size:12px; line-height:1.6; }
  .student-mode #studentHome .learning-stats { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .student-mode #studentHome .learning-stat { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:8px; padding:14px; text-align:left; min-height:64px; }
  .student-mode #studentHome .learning-stat strong { font-size:28px; }
  .student-mode #studentHome .learning-stat small { display:none; }
  .student-mode .portal-section { padding:16px; margin-bottom:16px; border-radius:14px; }
  .student-mode .section-head { gap:12px; align-items:center; }
  .student-mode .section-head h2 { font-size:18px; }
  .student-mode .section-head p { font-size:12px; margin-top:4px; }
  .student-mode .section-head .link { min-height:44px; white-space:nowrap; }
  .student-mode .course-mode-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .student-mode .course-mode-card { display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:14px 10px; min-height:116px; }
  .student-mode .course-mode-card > span { width:32px; height:32px; font-size:19px; }
  .student-mode .course-mode-card strong { font-size:14px; }
  .student-mode .course-mode-card small { font-size:10px; }
  .student-mode .course-mode-card > b { display:none; }
  .student-mode .learner-practice-banner { min-height:190px; padding:20px; }
  .student-mode .learner-practice-banner h2 { font-size:23px; }
  .student-mode .learner-practice-banner p { font-size:16px; }
  .student-mode .learning-task-card,.student-mode .student-learning-row,.student-mode .session-card { grid-template-columns:40px minmax(0,1fr); gap:12px; padding:14px; }
  .student-mode :is(.learning-task-card,.student-learning-row,.session-card) > .btn { grid-column:2; justify-self:stretch; min-height:44px; }
  .student-mode .course-grid,.student-mode #studentCourses .course-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  .student-mode #studentCenter #studentCenterCourses,
  .student-mode #studentCourses #studentOnlineRecords,
  .student-mode #studentLive #studentLiveRecords,
  .student-mode #studentOffline #studentOfflineRecords,
  .student-mode #studentHome #studentPublicCourses { grid-template-columns:minmax(0,1fr); gap:12px; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .course-card { border-radius:12px; height:auto; min-width:0; overflow:hidden; box-shadow:none; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .course-body {
    display:grid; grid-template-columns:76px minmax(0,1fr) auto; grid-template-rows:auto; gap:7px 12px; padding:14px; min-height:154px; height:auto;
  }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .course-cover-image { grid-column:1; grid-row:1 / 5; position:static; width:76px; height:96px; border-radius:8px; align-self:start; margin:0; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .course-cover-image img { width:100%; height:100%; object-fit:cover; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .learning-card-heading { display:flex; flex-direction:column; align-items:flex-start; grid-column:2 / -1; grid-row:1; gap:6px; min-width:0; padding:0; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .learning-card-heading h3 { white-space:normal; display:block; overflow:visible; font-size:16px; line-height:1.5; margin:0; overflow-wrap:anywhere; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .learning-card-heading > :is(.assigned-course-badge,.learning-state-badge) { position:static; flex:none; padding:3px 7px; font-size:11px; margin:0; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .course-body > :is(.learning-card-category,.learning-card-task,.learning-card-progress,.learning-card-notice) { grid-column:2 / -1; grid-row:auto; white-space:normal; line-height:1.6; font-size:12px; overflow-wrap:anywhere; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .course-body > .learning-history-link { grid-column:1 / 3; grid-row:auto; justify-self:start; min-height:44px; font-size:12px; text-align:left; }
  .student-mode :is(#studentCenterCourses,#studentOnlineRecords,#studentLiveRecords,#studentOfflineRecords,#studentPublicCourses) .course-body > .learning-card-action { grid-column:3; grid-row:auto; align-self:end; justify-self:stretch; min-height:44px; padding:10px 14px; font-size:13px; margin:0; }
  .student-mode .mobile-filter-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; }
  .student-mode .mobile-filter-toolbar > :is(select,.type-filter-levels,.cascade-control,.filter-reset) { display:none!important; }
  .student-mode .mobile-filter-toolbar .search { min-width:0; width:100%; height:46px; background:#fff; border-radius:12px; }
  .student-mode .mobile-filter-trigger { display:block; min-width:72px; border-radius:12px; background:#fff; height:46px; }
  .student-mode .mobile-filter-trigger.is-filtered { color:var(--mobile-accent); border-color:var(--mobile-accent); }
  .student-mode .public-course-tabs,.student-mode .learning-status-tabs { display:flex; width:100%; overflow:auto; gap:4px; padding:4px; border-radius:12px; background:#eaf0f7; }
  .student-mode :is(.public-course-tabs,.learning-status-tabs) button { flex:1; min-height:44px; border:0; border-radius:9px; background:transparent; white-space:nowrap; font-size:14px; }
  .student-mode :is(.public-course-tabs,.learning-status-tabs) button[aria-selected=true] { background:#fff; color:var(--mobile-ink); box-shadow:0 2px 5px #183c6510; }
  .student-mode .student-bottom-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); position:fixed; z-index:13; inset:auto 0 0; padding:6px max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left)); min-height:var(--mobile-bar); background:#fff; border-top:1px solid #e0e7f0; }
  .student-mode .student-bottom-nav button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:56px; padding:4px; border:0; background:transparent; color:#728198; font-size:11px; }
  .student-mode .student-bottom-nav button[aria-current=page] { color:var(--mobile-accent); font-weight:700; }
  .student-mode .student-bottom-nav svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
  .student-mode .mobile-learning-bar { display:flex; position:fixed; z-index:14; inset:auto 0 var(--mobile-bar); padding:10px 16px; gap:8px; background:#fff; border-top:1px solid #e0e7f0; }
  .student-mode .mobile-learning-bar > button { flex:1; padding-inline:8px; font-size:13px; }
  .student-mode #learning.active { padding-bottom:72px; }
  .student-mode #learning .learning-layout { display:block; }
  .student-mode #learning .learning-layout > .chapters { display:none; }
  .student-mode #learning .viewer { display:flex; flex-direction:column; min-height:0; padding:0; overflow:hidden; border-radius:12px; }
  .student-mode #learning .viewer-content { display:block; min-height:0; padding:0; }
  .student-mode #learning video { width:100%; height:auto; aspect-ratio:16 / 9; max-height:55dvh; background:#102339; }
  .student-mode #learning iframe { display:block; width:100%; height:62vh; height:62dvh; border:0; background:#fff; }
  .student-mode #learningCourseTitle { font-size:21px; line-height:1.5; }
  .student-mode #learningCourseSubtitle { font-size:12px; line-height:1.7; }
  .student-mode .mobile-reading-toggle { display:block; width:100%; border-radius:0; background:white; }
  .student-mode.mobile-reading-fullscreen #learning .viewer { position:fixed; z-index:25; inset:env(safe-area-inset-top,0px) 0 0; border-radius:0; display:flex; flex-direction:column; background:white; }
  .student-mode.mobile-reading-fullscreen #learning .viewer-content { flex:1; min-height:0; }
  .student-mode.mobile-reading-fullscreen #learning iframe { height:100%; }
  .student-mode.mobile-reading-fullscreen .mobile-reading-toggle { flex:none; padding-bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
  .student-mode :is(#examModal,#courseTrainingModal,#learningHistoryModal,.student-mobile-panel) { padding:0; z-index:30; }
  .student-mode :is(#examModal,#courseTrainingModal,#learningHistoryModal,.mobile-full-page) .dialog { display:flex; flex-direction:column; width:100%; max-width:none; height:100vh; height:100dvh; max-height:none; border-radius:0; margin:0; overflow:hidden; }
  .student-mode :is(#examModal,#courseTrainingModal,#learningHistoryModal,.student-mobile-panel) .dialog-head { flex:none; padding:calc(10px + env(safe-area-inset-top,0px)) 16px 10px; gap:12px; background:#fff; }
  .student-mode :is(#examModal,#courseTrainingModal,#learningHistoryModal,.student-mobile-panel) .dialog-head h2 { font-size:18px; line-height:1.5; overflow-wrap:anywhere; }
  .student-mode :is(#examModal,#courseTrainingModal,#learningHistoryModal,.student-mobile-panel) .dialog-body { flex:1; overflow:auto; min-height:0; padding:20px 16px; overscroll-behavior:contain; }
  .student-mode :is(#examModal,#courseTrainingModal,#learningHistoryModal,.student-mobile-panel) .dialog-foot { flex:none; padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px)); background:#fff; gap:10px; }
  .student-mode :is(#examModal,#courseTrainingModal,#learningHistoryModal,.student-mobile-panel) .dialog-foot > .btn { flex:1; }
  .student-mode .mobile-sheet { align-items:flex-end; }
  .student-mode .mobile-sheet .dialog { display:flex; flex-direction:column; width:100%; max-height:85vh; max-height:85dvh; border-radius:20px 20px 0 0; overflow:hidden; }
  .student-mode .mobile-sheet .dialog-head { padding-top:14px; }
  .student-mode .mobile-sheet .dialog-head::before { content:''; position:absolute; top:6px; left:calc(50% - 18px); width:36px; height:4px; border-radius:4px; background:#d4dce6; }
  .student-mode .mobile-sheet .dialog { position:relative; }
  .student-mode .mobile-course-cover { display:block; width:100%; height:154px; object-fit:cover; border-radius:12px; }
  .student-mode .mobile-course-title { font-size:23px; line-height:1.5; margin:20px 0 8px; overflow-wrap:anywhere; }
  .student-mode .mobile-course-status { color:var(--mobile-accent); font-weight:600; }
  .student-mode .mobile-course-rule { margin:20px 0; padding:14px; background:#edf3f9; border-left:3px solid var(--mobile-ink); line-height:1.7; }
  .student-mode .mobile-methods,.student-mode .mobile-filter-group { min-width:0; border:0; padding:0; margin:0 0 20px; }
  .student-mode :is(.mobile-methods,.mobile-filter-group) legend { font-weight:600; font-size:15px; margin-bottom:12px; }
  .student-mode .mobile-method { display:flex; gap:12px; align-items:center; padding:16px 12px; border:1px solid #dfe6ef; border-radius:12px; margin-bottom:10px; min-height:70px; cursor:pointer; }
  .student-mode .mobile-method:has(input:checked) { border-color:var(--mobile-ink); background:#eff5fb; }
  .student-mode .mobile-method input { width:19px; height:19px; accent-color:var(--mobile-ink); flex:none; }
  .student-mode .mobile-method small { display:block; color:#687a90; margin-top:5px; line-height:1.6; }
  .student-mode .mobile-history { min-height:44px; }
  .student-mode .mobile-filter-choice { display:flex; position:relative; min-height:48px; align-items:center; cursor:pointer; border-bottom:1px solid #edf1f6; }
  .student-mode .mobile-filter-choice input { width:18px; height:18px; accent-color:var(--mobile-ink); margin-right:12px; flex:none; }
  .student-mode .mobile-filter-choice span { line-height:1.6; overflow-wrap:anywhere; }
  .student-mode #mobileDirectory .chapters { display:block; padding:0; border:0; box-shadow:none; width:100%; }
  .student-mode #mobileDirectory .lesson { min-height:70px; padding:14px 8px; }
  .student-mode #mobileDirectory .lesson b { white-space:normal; overflow-wrap:anywhere; }
  .student-mode #mobileDirectory .lesson .sub { line-height:1.6; }
  .student-mode #mobileDirectory #learningExamButton { width:100%; min-height:60px; }
  .student-mode #examModal .exam-paper-question { padding:16px 0; margin:0; border:0; border-bottom:1px solid #dfe6ef; border-radius:0; scroll-margin-top:12px; }
  .student-mode #examModal .exam-paper-question > b { display:block; font-size:16px; line-height:1.75; overflow-wrap:anywhere; margin-bottom:14px; }
  .student-mode #examModal .exam-paper-option { display:flex; gap:12px; min-height:54px; padding:14px 12px; margin:10px 0; align-items:flex-start; border:1px solid #dfe6ef; border-radius:10px; }
  .student-mode #examModal .exam-paper-option:has(input:checked) { background:#edf3f9; border-color:var(--mobile-ink); }
  .student-mode #examModal .exam-paper-option input { width:19px; height:19px; margin:3px 0 0; accent-color:var(--mobile-ink); flex:none; }
  .student-mode #examModal .exam-paper-option span { min-width:0; line-height:1.65; overflow-wrap:anywhere; }
  .student-mode #examModal textarea { width:100%; min-height:140px; line-height:1.7; padding:12px; border-radius:10px; }
  .student-mode #examModal .dialog-foot { flex-wrap:wrap; }
  .student-mode .mobile-exam-meter { display:flex; width:100%; align-items:center; justify-content:space-between; gap:12px; font-size:13px; color:#687a90; }
  .student-mode .mobile-exam-meter .link { min-height:36px; }
  .student-mode #mobileExamConfirm { z-index:32; }
  .student-mode #directStudentExam { position:sticky; bottom:0; width:100%; min-height:48px; margin-top:16px; background:var(--mobile-ink); color:white; }
  .student-mode #directMaterials .btn { white-space:normal; text-align:left; overflow-wrap:anywhere; }
  .student-mode:has(.feature-modal.open,.modal.open),.student-mode.mobile-reading-fullscreen { overflow:hidden; }
  .student-mode .list-pagination { justify-content:center; gap:8px; }
  .student-mode .list-pagination button,.student-mode .list-pagination select { min-height:44px; font-size:14px; }
  .student-mode .list-pagination button { min-width:44px; }
  .student-mode .toast { top:auto; right:16px; left:16px; bottom:calc(var(--mobile-bar) + 14px); width:auto; max-width:440px; margin:auto; text-align:center; z-index:40; transform:translateY(8px); background:var(--mobile-ink); color:white; border:0; line-height:1.7; }
  .student-mode .toast.show { transform:translateY(0); }
  #offlineCheckinScreen .offline-checkin-card { width:100%; max-width:460px; border-radius:20px; padding:28px 20px; }
  #offlineCheckinScreen { padding:calc(20px + env(safe-area-inset-top,0px)) 16px calc(20px + env(safe-area-inset-bottom,0px)); }
  #offlineCheckinScreen .offline-checkin-actions { display:flex; flex-direction:column; gap:10px; }
  #offlineCheckinScreen .offline-checkin-actions > * { min-height:48px; width:100%; }
  #offlineCheckinScreen p { line-height:1.8; overflow-wrap:anywhere; }
}
@media (max-width:360px) {
  .student-mode .content { padding-inline:12px; }
  .student-mode .learner-brand { font-size:13px; }
  .student-mode .learner-user-name { max-width:46px; }
  .student-mode .mobile-learning-bar { padding-inline:10px; gap:6px; }
  .student-mode .mobile-learning-bar .btn { font-size:12px; }
}
@media (prefers-reduced-motion:reduce) {
  .student-mode .student-mobile-panel,.student-mode .student-bottom-nav * { scroll-behavior:auto; transition:none; animation:none; }
}
