/* One interface that reflows with the available viewport, including split view. */
:root{--app-header-height:calc(78px + env(safe-area-inset-top));--rail-width:116px;--app-max-width:1480px}
.app-shell{width:100%;max-width:var(--app-max-width)}
.app-header{min-height:var(--app-header-height);padding-left:max(19px,env(safe-area-inset-left));padding-right:max(19px,env(safe-area-inset-right))}
main{min-width:0;padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}
main>*,.home-layout>*,.tasks-layout>*,.collection-layout>*,.settings-layout>*,.study-session-layout>*{min-width:0}
.bottom-nav{width:min(var(--app-max-width),100%);padding-left:max(9px,env(safe-area-inset-left));padding-right:max(9px,env(safe-area-inset-right))}
.global-timer,.save-error{top:var(--app-header-height)}
.card p,.hint,.task-title,.event-card b,.reward b,.sheet-header h2{overflow-wrap:anywhere}
.home-tools>.section-title{margin-top:26px}
.collection-browser{min-width:0}.settings-layout{display:grid;gap:18px}
.calendar-day-details>.day-title{margin-top:22px}
.study-session-layout{display:grid;gap:18px}.study-session-layout>.timer-card{margin-bottom:0}
.journey-overview>.card{margin-top:20px}
.full-journey-map{max-width:500px;margin-left:auto;margin-right:auto}
.onboarding main{max-width:680px;margin-left:auto;margin-right:auto}
.tour-compact .tour-card{max-height:calc(100dvh - 24px)}
@media(min-width:600px){
 main{padding:30px max(26px,env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(26px,env(safe-area-inset-left))}
 .app-header{padding-left:max(26px,env(safe-area-inset-left));padding-right:max(26px,env(safe-area-inset-right))}
 .bottom-nav button{font-size:.76rem;min-height:60px;gap:5px}.bottom-nav button .jr-icon{width:24px;height:24px}
 .reward-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px}
 dialog{width:min(720px,calc(100% - 48px));max-height:calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin:auto;border-radius:22px}
 #sheet-body{padding:25px 28px calc(28px + env(safe-area-inset-bottom))}.sheet-header{padding:17px 28px 14px}
 .onboarding main{padding-top:35px}.onboarding .subject-editor{grid-template-columns:1fr 1fr}
}
@media(min-width:680px){
 :root{--app-header-height:calc(88px + env(safe-area-inset-top))}
 .brand-logo{width:170px;height:82px}.prototype-label{font-size:.63rem;max-width:none;letter-spacing:.08em;margin-right:12px}
 .profile-button{width:62px;height:66px}.profile-button>.collection-frame{width:62px;height:66px}
 .home-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);grid-template-areas:'overview priorities' 'tools priorities';column-gap:26px;row-gap:0;align-items:start}
 .home-overview{grid-area:overview}.home-priorities{grid-area:priorities}.home-tools{grid-area:tools}
 .home-welcome h1{font-size:2.5rem}.home-welcome p{max-width:none}
 .home-priorities .section-title:first-child{margin-top:0}.home-priorities .section-title h2{font-size:1.28rem}
 .home-overview .journey-card{padding:22px 17px}.home-overview .hero-mascot{width:125px;flex-basis:125px}
 .home-overview .journey-card h2{font-size:1.7rem}.today-summary{padding:14px}
 .today-summary h3{font-size:.94rem}.today-summary p{font-size:.73rem}.today-count{font-size:2.5rem}
 #task-results{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:18px}
 .task-controls{margin-bottom:25px}.task-controls .toolbar{margin-bottom:15px}.task-controls .filter-tabs{margin-top:16px}
 .task-controls .filter-selects{margin-bottom:0}
 .calendar-view-switch{max-width:460px;margin-bottom:20px}.agenda-create{max-width:600px;margin-bottom:20px}
 .calendar-period{margin-bottom:22px}.calendar-period h2{font-size:1.04rem}.calendar-period .icon-button{min-width:40px}
 .calendar-day{min-height:64px;font-size:.93rem}.weekdays{font-size:.75rem}.calendar{padding:20px 15px}
 .week-planner{min-width:660px;width:100%}.timeline-window{height:clamp(370px,calc(100dvh - 380px),720px);max-height:none}
 .week-dates{grid-template-columns:48px repeat(7,minmax(0,1fr))}.week-deadlines,.time-grid:not(.single-day){grid-template-columns:48px repeat(7,minmax(0,1fr))}
 .week-dates b{font-size:1.1rem}.week-dates small{font-size:.7rem}.week-deadline{font-size:.7rem}
 .time-event b,.short-event b{font-size:.76rem}.time-event small{font-size:.65rem}.hour-gutter{font-size:.68rem}
 .tech-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:stretch}
 .tech-open{display:flex;flex-direction:column;height:100%;padding:0 20px 20px}
 .tech-open .method-identity{margin:0 -20px;padding:18px 62px 12px 20px;width:calc(100% + 40px)}
 .tech-open .tech-visual,.tech-open .cornell-visual{margin:0 -20px 20px;width:calc(100% + 40px);min-height:110px}
 .tech-distinct h2{font-size:1.4rem}.tech-distinct .tech-open>p{font-size:.85rem;flex:1}
 .method-footer{width:100%}.tech-distinct .favourite{width:44px;height:44px;top:13px;right:12px;font-size:1.6rem}
 .cornell-visual{padding-left:45px;padding-right:45px}
 .study-session-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:24px}
 .timer-dial{width:250px;height:250px}.timer-dial strong{font-size:4rem}
 #app[data-study-tab='history']>.stack{grid-template-columns:repeat(2,minmax(0,1fr))}
 .journey-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:stretch}
 .journey-overview>.journey-map-preview{margin:0}.journey-overview>.card{grid-column:1/-1;margin-top:0}
 .journey-overview>.journey-card{min-height:260px}.journey-overview .hero-mascot{width:130px;flex-basis:130px}
 .journey-overview .journey-card h2{font-size:1.8rem}
 .badge-families{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.badge-family{min-width:0}
 .settings-layout{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:start}.settings-layout>section:first-child{grid-row:span 2}
 .collection-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:24px;align-items:start}
 .collection-preview{position:sticky;top:calc(var(--app-header-height) + 20px);padding:70px 15px 22px;margin:0}
 .collection-preview .collection-mascot{width:180px;max-width:100%}.collection-preview>.original-frame{top:14px;right:12px;width:52px;height:56px}
 .collection-browser>.filter-tabs{margin-top:0}.collection-browser .reward-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px}
 .reward{min-height:206px}.reward-art{height:138px}.reward-art>.jr-mascot{width:140px;max-width:100%;height:auto}
 .collection-preview .hint{font-size:.75rem}.collection-preview h2{font-size:1.45rem}
}
@media(min-width:760px){
 .calendar-month-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);gap:26px;align-items:start}
 .calendar-month-layout>.calendar{position:sticky;top:calc(var(--app-header-height) + 20px)}
 .calendar-day-details>.day-title{margin-top:0;min-height:44px}.calendar-day-details .task-card{padding:16px 14px}
 .onboarding .app-header .brand-logo{width:190px}
}
@media(min-width:1024px){
 .app-shell:not(.onboarding) main{margin-left:var(--rail-width);padding:34px 34px calc(40px + env(safe-area-inset-bottom))}
 .app-shell:not(.onboarding)>.bottom-nav{left:max(0px,calc((100% - var(--app-max-width))/2));transform:none;top:var(--app-header-height);bottom:0;width:var(--rail-width);flex-direction:column;justify-content:flex-start;gap:9px;padding:24px 10px max(20px,env(safe-area-inset-bottom));border-top:0;border-right:1px solid var(--line);background:var(--cream);box-shadow:none;backdrop-filter:none;overflow-y:auto}
 .bottom-nav button{flex:0 0 auto;min-height:72px;white-space:normal;line-height:1.3;font-size:.74rem;padding:10px 5px;gap:8px}
 .bottom-nav button .jr-icon{width:25px;height:25px}.bottom-nav button.active{box-shadow:inset 3px 0 var(--teal)}
 .app-shell:not(.onboarding)>.offline-banner,.app-shell:not(.onboarding)>.save-error{margin-left:var(--rail-width)}
 .app-shell:not(.onboarding)>.global-timer{margin-left:var(--rail-width);width:calc(100% - var(--rail-width))}
 .home-layout{column-gap:32px;grid-template-columns:minmax(0,.95fr) minmax(0,1.15fr)}
 .home-overview .journey-card{padding:25px 20px}.home-overview .hero-mascot{width:145px;flex-basis:145px}
 .calendar-month-layout{grid-template-columns:minmax(0,1.3fr) minmax(290px,.9fr)}
 .collection-layout{grid-template-columns:240px minmax(0,1fr);gap:30px}.collection-preview .collection-mascot{width:200px}
 .journey-overview>.journey-card{padding:28px}.journey-overview .hero-mascot{width:155px;flex-basis:155px}
 #toast{bottom:24px}.onboarding main{padding-bottom:50px}
}
@media(min-width:1200px){
 .tasks-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:28px;align-items:start}
 .task-controls{position:sticky;top:calc(var(--app-header-height) + 24px);margin-bottom:0}
 .task-controls .filter-selects{grid-template-columns:1fr;gap:12px}.task-controls .filter-tabs{gap:7px}
 .task-controls .toolbar .primary{font-size:.82rem}.task-controls .toolbar{gap:8px}
 .today-tasks{grid-template-columns:repeat(auto-fit,minmax(235px,1fr))}
 .badge-families{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(min-width:1360px){
 .tech-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .collection-layout{grid-template-columns:260px minmax(0,1fr)}
}
@media(max-height:500px) and (max-width:1023px){
 :root{--app-header-height:calc(64px + env(safe-area-inset-top))}
 .app-header{padding-top:env(safe-area-inset-top);padding-bottom:0}.brand-logo{height:60px;width:132px}.profile-button,.profile-button>.collection-frame{height:53px;width:49px}
 .bottom-nav{padding-top:4px;padding-bottom:max(4px,env(safe-area-inset-bottom))}.bottom-nav button{min-height:44px;font-size:.62rem;gap:2px}.bottom-nav button .jr-icon{width:19px;height:19px}
 main{padding-top:20px;padding-bottom:calc(78px + env(safe-area-inset-bottom))}
 dialog{max-height:calc(100dvh - 16px);border-radius:18px}.sheet-header{padding-top:12px;padding-bottom:10px}#sheet-body{padding-top:16px}
 .onboarding .welcome-art{width:125px;height:125px;margin-bottom:20px}.onboarding .welcome-art .jr-mascot{width:120px}
}

@media(min-width:760px){
 .calendar-toolbar{display:flex;align-items:flex-start;gap:24px;margin-bottom:22px}
 .calendar-toolbar>.page-heading{flex:1;min-width:0;margin-bottom:0}
 .calendar-toolbar>.agenda-create{flex:0 1 330px;min-width:270px;max-width:330px;margin:0}
 .calendar-navigation{display:flex;align-items:center;gap:24px;margin-bottom:22px}
 .calendar-navigation>.calendar-view-switch{flex:0 1 300px;width:300px;margin:0}
 .calendar-navigation>.calendar-period{flex:1;min-width:0;margin:0}
}
