/* Mobile layout intentionally follows the same components as the desktop app. */
.mobile-bottom-nav,.mobile-menu-backdrop{display:none}.app-legal-footer{margin-top:44px;border-top:1px solid var(--line);padding-top:22px;color:var(--ink-muted);font-size:11px;line-height:1.8}.app-legal-footer nav{display:flex;gap:8px 22px;flex-wrap:wrap}.app-legal-footer a{color:var(--ink-muted);text-decoration:none}.app-legal-footer a:hover{text-decoration:underline}.legal-account-note{font-size:.75rem;color:var(--ink-muted);line-height:1.8;margin:16px 0}.legal-account-note a,.recurring-consent a{color:#c8a7f0;text-decoration:underline;text-underline-offset:3px}.recurring-consent{cursor:pointer}.billing-legal-links{display:flex;gap:8px 18px;flex-wrap:wrap;font-size:11px;line-height:1.8;margin:20px 0}.billing-legal-links a{color:var(--ink-muted)}
@media(max-width:768px){
 html{scroll-padding-top:88px;scroll-padding-bottom:90px}body{-webkit-text-size-adjust:100%}body.mobile-menu-open{overflow:hidden}
 .platform-main{padding:14px 18px calc(104px + env(safe-area-inset-bottom));min-width:0;width:100%}
 .mobile-header{position:sticky;top:0;height:66px;min-height:66px;padding:0 18px;z-index:200;background:var(--sidebar-bg);border-bottom:1px solid var(--line)}
 .mobile-header .platform-brand{font-size:27px;letter-spacing:-1.5px}.mobile-menu-btn{border:1px solid var(--line);background:var(--surface);border-radius:14px;width:44px;height:44px;font-size:19px;color:var(--ink)}
 .mobile-bottom-nav{position:fixed;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));inset:auto 0 0;z-index:190;background:var(--sidebar-bg);border-top:1px solid var(--line);padding:8px 12px calc(8px + env(safe-area-inset-bottom));box-shadow:0 -10px 30px #00000012}
 .mobile-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:52px;border-radius:15px;padding:7px 4px;color:var(--ink-muted);text-decoration:none;font-size:10px;font-weight:600;line-height:1.4;position:relative}
 .mobile-tab svg{width:21px;height:21px}.mobile-tab.active{color:var(--ink);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent-border)}
 .mobile-menu-backdrop{position:fixed;inset:66px 0 calc(76px + env(safe-area-inset-bottom));z-index:194;border:0;background:#08050fc4;backdrop-filter:blur(5px)}
 .mobile-menu-open .mobile-menu-backdrop{display:block}
 .platform-sidebar{visibility:hidden;top:66px;bottom:calc(76px + env(safe-area-inset-bottom));height:auto;width:min(330px,calc(100vw - 42px));max-height:none;padding:20px 14px;border-radius:0 24px 24px 0;z-index:195;overflow-y:auto;overscroll-behavior:contain;transition:transform 220ms ease,visibility 220ms;box-shadow:12px 0 40px #00000030}
 .platform-sidebar.open{visibility:visible;top:66px;bottom:calc(76px + env(safe-area-inset-bottom));height:auto;max-height:none;width:min(330px,calc(100vw - 42px))}
 .platform-sidebar>.platform-brand{display:none}.platform-sidebar .nav-item{min-height:48px;font-size:14px;padding:12px 16px;border-radius:14px}.platform-sidebar .platform-sidebar-bottom{margin-top:22px;padding-top:14px}.platform-nav{gap:5px}
 .main-topbar{margin:0 0 18px;min-height:42px;gap:18px}.topbar-left::after{font-size:10px;line-height:1.6;max-width:185px}.gems-pill{padding:9px 13px;min-height:40px;gap:7px;font-size:13px}.gems-icon{font-size:18px}
 .view-content{min-width:0}.page-title{font-size:clamp(26px,7.4vw,34px);line-height:1.18;letter-spacing:-.045em;margin-bottom:12px;overflow-wrap:break-word}.page-subtitle{font-size:13px;line-height:1.8;margin-bottom:24px}
 .dashboard-intro{padding:12px 91px 20px 0;min-height:172px;margin-bottom:18px}.dashboard-intro .page-title{font-size:clamp(24px,6.5vw,30px);line-height:1.16;margin:12px 0}.dashboard-intro .page-subtitle{font-size:12px;line-height:1.8;margin-bottom:0;max-width:240px}.dashboard-intro>.eyebrow{font-size:9px;letter-spacing:.11em}.dashboard-intro>img{width:105px;height:122px;right:-11px;top:38px;bottom:auto}.app-constellation{opacity:.55}
 .dashboard-grid{display:flex;flex-direction:column;gap:24px}.dashboard-main{display:contents}.dashboard-main>.continue-banner{order:0}.dashboard-subjects{order:1}.dashboard-side{order:2}.dashboard-recommendations{order:3}
 .continue-banner{padding:20px 16px;border-radius:22px;margin:0;min-height:118px;gap:10px;box-shadow:0 12px 28px #7850dc13}.continue-left{gap:12px;min-width:0}.continue-avatar{width:47px;height:55px;flex:0 0 47px}.continue-text{min-width:0}.continue-label{font-size:9px;letter-spacing:.07em;line-height:1.5}.continue-title{font-size:24px;line-height:1.4}.continue-meta{font-size:10px;line-height:1.65}.continue-play{width:38px;height:38px;min-width:38px;flex:0 0 38px}.continue-play svg{width:18px;height:18px}
 .content-section-head{gap:12px;align-items:center;margin:0 0 16px}.section-headline{font-size:20px;line-height:1.35;letter-spacing:-.035em}.section-action-btn{padding:8px 11px;font-size:10px;min-height:36px;gap:6px}.section-action-btn svg{width:14px;height:14px}
 .subjects-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.subject-tile-card{width:auto;min-height:162px;padding:16px 12px;border-radius:20px;display:flex;flex-direction:column;justify-content:center;gap:10px}.subject-tile-card img{width:90px;height:90px;object-fit:contain;margin:0 auto}.subject-tile-card .subject-tile-name{font-size:13px;line-height:1.45}.subject-tile-card.add-subject-card{min-height:114px;grid-column:1/-1;display:flex;flex-direction:row;align-items:center;gap:16px;padding:18px}.add-subject-card .add-icon{width:46px;height:46px;min-width:46px;border-radius:15px;font-size:28px;margin:0}
 .dashboard-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%;margin:0}.dashboard-side .widget-card{padding:18px 14px;border-radius:20px;min-width:0;box-shadow:none}.dashboard-side .widget-card:before{left:16px;right:16px}.dashboard-side .streak-head,.dashboard-side .countdown-content{position:relative;display:block;min-height:0;padding:0}.dashboard-side .streak-flame,.dashboard-side .calendar-icon-wrap{position:absolute;right:0;top:-3px;width:30px;height:30px;min-width:30px;min-height:30px;flex-basis:30px;font-size:17px;border-radius:10px}.dashboard-side .widget-head-label{font-size:9px;line-height:1.5;letter-spacing:.06em;min-height:30px;padding-right:32px;margin:0 0 10px}.dashboard-side .widget-value-row{gap:5px;align-items:baseline;flex-wrap:wrap}.dashboard-side .widget-big-number{font-size:32px;line-height:1.1}.dashboard-side .widget-subtext{font-size:10px}.dashboard-side .daily-progress{margin-top:17px;padding-top:13px}.dashboard-side .daily-progress span{font-size:10px;line-height:1.7;display:block}.dashboard-side .daily-progress progress{margin-top:9px;height:6px}.countdown-edit{margin-top:17px;padding-top:13px;gap:5px;min-height:39px;font-size:10px;line-height:1.5}.countdown-edit svg{width:14px;height:14px}.countdown-edit>svg:last-child{display:none}
 .dashboard-side .widget-invite{grid-column:1/-1;padding:21px}.dashboard-side .widget-invite .widget-head-label{min-height:0;padding:0;margin:0 0 7px;font-size:9px}.dashboard-side .invite-content{display:flex;gap:13px;margin:0}.dashboard-side .invite-icon-wrap{width:40px;height:40px;min-width:40px;flex-basis:40px;font-size:23px;border-radius:13px}.dashboard-side .invite-title{font-size:16px;margin-bottom:8px}.dashboard-side .invite-description{font-size:12px;line-height:1.85}.dashboard-side .widget-invite .btn-purple{margin-top:18px;font-size:12px;min-height:45px}
 .dashboard-recommendations .content-section-head{align-items:flex-start;flex-wrap:wrap}.dashboard-recommendations .section-headline{max-width:250px}.recommended-3col-grid{grid-template-columns:1fr;gap:10px}.material-chip-card{padding:16px;border-radius:18px;gap:12px}.material-chip-avatar{width:48px;height:48px;min-width:48px}.material-chip-title{font-size:14px}.material-chip-by{font-size:12px;line-height:1.6}
 .books-filter-bar{gap:12px;margin:18px 0}.search-input-pill{min-width:0!important}.search-input-pill input{font-size:16px!important;height:48px;min-height:48px}.book-card-2col{padding:15px;border-radius:18px;min-height:106px}.book-card-avatar{width:55px;height:64px;flex-basis:55px}.book-card-title{font-size:14px;line-height:1.5}.book-card-by{font-size:12px;line-height:1.65}.book-card-bookmark-btn{width:44px;min-width:44px;height:44px;flex-basis:44px}.books-2col-grid{gap:12px}
 .subject-header-row{padding:20px 16px;border-radius:20px;gap:13px;margin:12px 0 20px}.subject-header-avatar{width:66px;height:78px;max-width:66px;flex-basis:66px}.subject-header-row>div{padding-right:0}.subject-header-name{font-size:22px;line-height:1.2;margin-bottom:8px}.subject-header-subtitle{font-size:12px;line-height:1.75}.practice-book-card{padding:17px;gap:12px;border-radius:18px}.practice-book-title{font-size:14px;line-height:1.5}.practice-book-by{font-size:12px}.practice-book-avatar{width:48px;height:55px;flex-basis:48px}.practice-book-badge{font-size:10px}.practice-3col-grid{gap:12px}
 .hub-hero-banner{padding:22px 18px;border-radius:22px;gap:12px}.hub-hero-title{font-size:25px;line-height:1.25}.hub-hero-desc{font-size:12px;line-height:1.8}.hub-mode-card{padding:18px;gap:12px;border-radius:18px;min-height:130px}.hub-mode-title{font-size:14px}.hub-mode-desc{font-size:12px;line-height:1.75}
 .settings-section-card{padding:22px 18px;border-radius:20px}.settings-fields-col{width:100%}.settings-section-card input,.settings-section-card select,.admin-user input,.admin-search input{font-size:16px}.settings-nav-pills{gap:8px;overflow:auto;flex-wrap:nowrap}.settings-nav-pill{white-space:nowrap;flex:0 0 auto;font-size:12px;min-height:42px}.settings-header-title{font-size:18px}.settings-header-desc,.settings-subdesc{font-size:12px;line-height:1.8}
 .billing-layout{grid-template-columns:1fr;gap:18px;margin-top:24px}.billing-plan,.billing-state{padding:25px 21px;border-radius:23px}.billing-plan h2{font-size:29px;margin-top:20px}.plan-price{font-size:42px;line-height:1.3}.plan-price span{font-size:12px}.billing-plan ul{font-size:13px;line-height:1.9;margin:22px 0}.billing-plan p{font-size:12px;line-height:1.9}.recurring-consent{font-size:12px;line-height:1.8;gap:11px;padding:13px 0;margin-top:0;border-bottom:1px solid var(--line)}.recurring-consent input{width:21px;height:21px;margin-top:1px}.billing-state>img{width:125px;height:125px}.billing-state dl>div{font-size:12px;gap:12px}.billing-state h2{font-size:22px}.billing-notice{font-size:12px}.access-banner{padding:17px;border-radius:18px;margin-bottom:22px}.access-banner>div{min-width:0}.access-banner strong{font-size:13px}.access-banner p{font-size:11px;line-height:1.8}.access-banner>span{font-size:23px}.access-banner>.back-pill-btn{width:100%;min-height:42px}
 .quiz-speech-row{gap:10px}.quiz-speech-bubble{padding:20px 17px;border-radius:20px}.quiz-bubble-question{font-size:19px;line-height:1.55}.quiz-bubble-label{font-size:9px}.quiz-mascot-avatar{width:62px;height:76px;flex-basis:62px}.quiz-answer-card{padding:17px 15px;min-height:68px;font-size:14px;line-height:1.65;border-radius:17px}.quiz-answers-2x2{gap:12px}.quiz-feedback{padding:20px 17px}.quiz-next-btn{min-height:48px}.quiz-exit-modal{width:calc(100vw - 32px);max-height:calc(100dvh - 40px);overflow:auto;padding:26px 20px;border-radius:24px}.modal-overlay{padding:16px}.quiz-exit-title{font-size:23px}.invite-dialog p{font-size:13px}.modal-overlay input{font-size:16px}.app-toast{max-width:calc(100vw - 32px);bottom:calc(96px + env(safe-area-inset-bottom));font-size:12px;line-height:1.7}
 .study-layout-grid{gap:18px}.study-article-pane{padding:22px 18px;border-radius:20px}.study-article-body{font-size:14px;line-height:1.9;overflow-wrap:anywhere}.study-mode-btn,.btn-download-pdf,.btn-top-back{min-height:44px;font-size:12px}.study-top-row{gap:12px;flex-wrap:wrap}.flashcard-surface{padding:28px 20px;min-height:260px}.flashcard-question{font-size:21px;line-height:1.6}.fc-buttons-row{gap:10px}.fc-buttons-row>button{font-size:12px;min-height:50px}
 .app-legal-footer{margin-top:30px;padding-top:21px;font-size:10px;line-height:1.9}.app-legal-footer nav{gap:9px 18px}.app-legal-footer a{display:inline-block;min-height:30px}
 .admin-user{padding:21px 17px;border-radius:20px}.admin-stats{gap:10px}.admin-stats article{padding:18px 14px;border-radius:18px}.admin-stats strong{font-size:27px}.admin-stats span{font-size:11px;line-height:1.6}.admin-search{gap:8px}.admin-search>.btn-purple{min-width:76px;font-size:12px;padding:12px}.admin-user form>div{display:grid;grid-template-columns:1fr;gap:10px}.admin-user button{min-height:44px}
 :is(button,a,input,select,textarea):focus-visible{outline:2px solid #b58fe9;outline-offset:3px}
 body:has(input:focus,textarea:focus,select:focus) .mobile-bottom-nav{visibility:hidden;pointer-events:none}
}
@media(max-width:360px){.platform-main{padding-inline:14px}.dashboard-intro{padding-right:70px}.dashboard-intro>img{width:90px;right:-15px}.dashboard-intro .page-title{font-size:23px}.dashboard-side .widget-card{padding:16px 12px}.dashboard-side .widget-big-number{font-size:29px}.dashboard-side .widget-subtext{font-size:9px}.subject-tile-card img{width:80px;height:80px}.continue-avatar{width:36px;flex-basis:36px}.continue-banner{padding:17px 13px}.plan-price{font-size:37px}}
@media print{.mobile-bottom-nav,.mobile-header,.mobile-menu-backdrop,.app-legal-footer{display:none!important}}
@media(max-width:768px){.subject-tile-title{font-size:13px;line-height:1.45}.add-subject-card .plus-icon-pill{width:46px;height:46px;min-width:46px;font-size:27px;margin:0;border-radius:14px}.dashboard-recommendations .materials-row{display:grid;grid-template-columns:1fr;gap:10px}.billing-state>a.back-pill-btn{display:flex;justify-content:center;margin:10px 0;text-align:center;text-decoration:none;font-size:12px;line-height:1.7}}
@media(max-width:768px){
 .mobile-header{position:fixed;inset:0 0 auto;height:calc(66px + env(safe-area-inset-top));padding-top:env(safe-area-inset-top)}
 .platform-main{padding-top:calc(80px + env(safe-area-inset-top))}
 .mobile-bottom-nav{height:calc(76px + env(safe-area-inset-bottom))}
 .platform-sidebar,.platform-sidebar.open{top:calc(66px + env(safe-area-inset-top))}
 .mobile-menu-backdrop{top:calc(66px + env(safe-area-inset-top))}
 .subject-tile-card.add-subject-card{aspect-ratio:auto;height:86px;min-height:86px}
}
@media(max-width:768px){
 .subject-tile-card{aspect-ratio:auto;width:100%;height:166px;min-height:166px;min-width:0}
 .subject-tile-card.add-subject-card{height:86px;min-height:86px}
 .practice-subject-title{font-size:14px;line-height:1.5;max-width:100%;overflow-wrap:break-word}
 .practice-subject-img{max-width:100%;object-fit:contain}
}
@media(min-width:540px) and (max-width:768px){.subjects-row{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Dashboard: keep the first screen compact and the subject actions usable on phones. */
@media(max-width:768px){
 .platform-shell,.platform-main,.view-content,.dashboard-grid,.dashboard-main,.dashboard-subjects,.dashboard-recommendations{min-width:0;max-width:100%}
 .dashboard-intro{box-sizing:border-box;padding:8px 88px 12px 0;min-height:0;margin:0 0 20px}
 .dashboard-intro .page-title{font-size:clamp(25px,7vw,32px);line-height:1.2;max-width:15ch;margin:10px 0}
 .dashboard-intro .page-subtitle{max-width:28ch;font-size:13px;line-height:1.7}
 .dashboard-intro>img{width:96px;height:116px;right:-5px;top:30px;bottom:auto}
 .dashboard-grid{gap:25px}
 .content-section-head{min-width:0;flex-wrap:wrap;justify-content:space-between}
 .content-section-head>.section-headline{min-width:0;flex:1 1 150px}
 .section-action-btn{max-width:100%;min-width:0}
 .subjects-row{min-width:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
 .subject-tile-card{width:100%;min-width:0;overflow:hidden}
 .subject-tile-card .subject-tile-title{max-width:100%;overflow-wrap:anywhere}
 .dashboard-side,.dashboard-side>.widget-card{min-width:0}
 .mobile-bottom-nav{box-sizing:border-box;grid-template-columns:repeat(4,minmax(0,1fr));padding-inline:max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right))}
 .mobile-tab{min-width:0;font-size:10px;white-space:nowrap}
}
@media(max-width:420px){
 .platform-main{padding-inline:15px}
 .main-topbar{gap:10px}
 .topbar-left::after{max-width:190px}
 .dashboard-intro{padding-right:76px}
 .dashboard-intro>img{width:84px;height:104px;right:-7px;top:34px}
 .content-section-head{align-items:flex-start}
 .content-section-head>.section-headline{flex-basis:100%}
 .section-action-btn{width:100%;justify-content:center}
 .subject-tile-card{height:152px;min-height:152px;padding:12px 9px}
 .subject-tile-card img{width:82px;height:82px}
 .subject-tile-card.add-subject-card{height:76px;min-height:76px;padding:12px}
}

/* Home dashboard: use the available phone width consistently (including 430–540px phones). */
@media(max-width:600px){
 .platform-main{padding-inline:18px}
 /* dashboard-main uses display:contents on mobile; make this grid section
    claim the full flex row so its subject cards do not collapse to the left. */
 .dashboard-subjects{display:block;width:100%;max-width:100%;min-width:0;flex:1 1 100%;align-self:stretch;box-sizing:border-box}
 .dashboard-subjects>.subjects-row{display:grid;width:100%;max-width:100%;min-width:0;box-sizing:border-box;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .dashboard-intro{padding:8px 82px 14px 0;margin-bottom:18px}
 .dashboard-intro .page-title{font-size:clamp(27px,7.2vw,34px);line-height:1.14;max-width:none}
 .dashboard-intro .page-subtitle{max-width:32ch;font-size:14px;line-height:1.65}
 .dashboard-intro>img{width:88px;height:108px;right:-4px;top:35px}
 .content-section-head{display:flex;flex-direction:column;align-items:stretch;gap:10px;margin-bottom:14px}
 .content-section-head>.section-headline{flex:initial;max-width:none;font-size:23px;line-height:1.2}
 .content-section-head>.section-action-btn{width:100%;justify-content:center;min-height:44px;font-size:13px}
 .subjects-row{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px}
 .subjects-row>.subject-tile-card{box-sizing:border-box;width:100%;min-width:0;height:170px;min-height:170px;aspect-ratio:auto;padding:14px 10px}
 .subjects-row>.subject-tile-card .subject-tile-img{width:94px;height:94px;max-width:100%;object-fit:contain}
 .subjects-row>.subject-tile-card .subject-tile-title{font-size:15px;line-height:1.35;overflow-wrap:anywhere}
 .subjects-row>.subject-tile-card.add-subject-card{grid-column:1/-1!important;display:flex;flex-direction:row;justify-content:center;gap:14px;height:78px;min-height:78px;padding:12px}
 .subjects-row>.subject-tile-card.add-subject-card .plus-icon-pill{flex:0 0 46px}
 .dashboard-side{gap:10px}
 .dashboard-side .widget-card{padding:16px 12px}
 .dashboard-recommendations .content-section-head{align-items:stretch}
 .dashboard-recommendations .section-headline{max-width:none}
}
