/* Phone corrections verified against the actual lesson and nature pages. */
[hidden]{display:none!important}
.mobile-menu,.focus-toggle,.mobile-steps-toggle{display:none}
.site-header nav{flex-wrap:wrap}
.scene-location{min-width:0}
.scene-title{display:block}
.gen-hero-copy,.gen-hero-visual,.gen-setting-grid>*{min-width:0}
#step-title:focus{outline:none}

@media(max-width:720px){
 .site-header{gap:12px;padding:13px 20px;position:sticky;top:0;z-index:40;transition:transform .22s ease,opacity .22s ease;box-shadow:0 2px 10px #1d3e3210}
 .site-header.header-away:not(:has(:focus-visible)):not(.menu-open){transform:translateY(-110%);opacity:0;pointer-events:none}
 .site-header .mobile-menu{display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:.85rem;padding:10px 14px;margin-left:auto}
 .site-header nav{display:none;grid-template-columns:1fr 1fr;gap:4px 12px;order:3;width:100%;margin:0;border-top:1px solid #c9d2c5;padding-top:10px}
 .site-header.menu-open nav{display:grid}
 .site-header nav a{display:flex;align-items:center;min-height:44px;padding:9px 4px;font-size:.85rem;line-height:1.4}
 .site-header>#notebook-open{display:none;order:4}
 .site-header.menu-open>#notebook-open:not([hidden]){display:flex;align-items:center;justify-content:center;width:100%;margin:0;font-size:.85rem}
 button,.primary-link,.file-button,.space-file{min-height:44px}
 input:not([type=checkbox]):not([type=radio]),select,textarea,
 .field input,.field select,.field textarea,
 .creator-body .field input,.creator-body .field select,.creator-body .field textarea,
 .gen-field>input,.gen-field>select,.gen-field>textarea,#gen-sourceText{font-size:16px}
 input[type=range]{min-height:44px;margin-top:5px;margin-bottom:5px}
 .file-button,.space-file{display:inline-flex;align-items:center;justify-content:center}
 .lesson-body,.gen-lesson-body,.guide-content,.gen-sources-page{overflow-wrap:break-word}
 .gen-hero h1{font-size:clamp(2.6rem,11vw,4.7rem)}
 .gen-path>a{min-height:48px;overflow-wrap:normal}
 .step-nav button{min-height:48px}
 .step-nav .mobile-step-options{display:none}
 .step-nav.steps-open .mobile-step-options{display:block;padding-top:12px}
 .step-nav ol{grid-template-columns:repeat(2,minmax(0,1fr))}
 .step-nav ol button{font-size:.82rem;line-height:1.4;min-height:52px;padding:10px;gap:8px}
 .step-nav .mobile-steps-toggle{display:flex;width:100%;min-height:48px;padding:12px 14px;border:1px solid #a8bca8;border-radius:5px;font-size:.84rem;line-height:1.5;background:var(--agency-panel,#e3e8df);color:var(--agency-ink,#203e47)}
 .gen-path{grid-template-columns:1fr 1fr}
 .gen-path>a{font-size:.8rem;border-bottom:1px solid #c5d0cd!important;border-right:1px solid #c5d0cd!important}
 .gen-path>a:nth-child(2n){border-right:0!important}
 .gen-path>a:nth-last-child(-n+2){border-bottom:0!important}
 .gen-source-card a,.source-list a,.place-note a{overflow-wrap:anywhere}
 .gen-source-input>summary{min-height:44px;align-items:center}
 .scene-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto}
 .scene-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .scene-glass{font-size:.78rem;min-height:44px;padding:10px 12px}
 .scene-location small{font-size:.65rem}
 .scene-location .weather-scene-label{font-size:.6rem}
 .play-action-row button,.weather-options button,.river-controls .actions button,.mask-controls button{font-size:.8rem}
 .focus-tool-label select{font-size:16px}
 .creator-body .actions>button,.creator-body .actions>label{font-size:.8rem}
 .mask-controls{max-height:calc(100dvh - 150px);overflow:auto;overscroll-behavior:contain}
 .mask-controls button{min-height:44px;font-size:.75rem}
 .mask-controls label{flex-wrap:wrap;font-size:.75rem;gap:6px}
 .mask-controls input{flex:1;min-width:135px}
}

.is-full-space .scene-location,.is-full-space .river-scene-label,.is-full-space .scene-message{transition:opacity .4s ease}
.is-full-space.scene-quiet .scene-location,.is-full-space.scene-quiet .river-scene-label,.is-full-space.scene-quiet .scene-message{opacity:0;transition-delay:1.8s;pointer-events:none}
@media(prefers-reduced-motion:reduce){.site-header,.is-full-space .scene-location,.is-full-space .river-scene-label,.is-full-space .scene-message{transition:none!important}}

@media(max-width:720px),(max-width:1000px) and (max-height:500px){
 .is-full-space .scene-toolbar{left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));top:calc(16px + env(safe-area-inset-top));display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}
 .is-full-space .scene-location{font-size:1.35rem}
 .is-full-space .scene-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .is-full-space [data-river-full]{min-height:44px;font-size:.75rem;padding:10px 12px}
 .river-scene-shell.is-full-space .focus-toggle{display:block;position:absolute;z-index:5;bottom:calc(12px + env(safe-area-inset-bottom));right:max(16px,env(safe-area-inset-right));min-height:44px;font-size:.8rem;padding:10px 14px}
 .river-scene-shell.is-full-space .focus-dock{display:none;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:calc(68px + env(safe-area-inset-bottom));max-height:calc(100dvh - 210px - env(safe-area-inset-top) - env(safe-area-inset-bottom));max-width:500px;margin-left:auto;overflow:auto;overscroll-behavior:contain;grid-template-columns:1fr 1fr;align-items:stretch;gap:8px;padding:12px;border:1px solid #f6f3df66;border-radius:9px;background:#102d33ed;backdrop-filter:blur(12px)}
 .river-scene-shell.is-full-space.show-focus-controls .focus-dock{display:grid}
 .is-full-space .focus-dock button{min-height:44px;font-size:.8rem;padding:10px;line-height:1.4}
 .is-full-space .focus-tool-label{grid-column:1/-1}
 .is-full-space .focus-tool-label select{width:100%;max-width:none;min-height:44px;font-size:16px}
 .is-full-space .focus-hint{display:none}
 .river-scene-shell.is-full-space .river-scene-label{top:112px;bottom:auto;left:16px;right:auto;max-width:calc(100% - 32px);font-size:.6rem;letter-spacing:.03em;padding:8px 10px}
 .is-full-space .river-scene-label>span{font-size:.72rem}
 .river-scene-shell.is-full-space .scene-message{top:184px;bottom:auto;left:16px;right:16px;max-width:none;font-size:.75rem;padding:8px 10px}
 .river-scene-shell.is-full-space:has(.mask-controls:not([hidden])) .focus-toggle{display:none}
 .river-scene-shell.is-full-space:has(.mask-controls:not([hidden])) .focus-dock{display:none}
}

@media(max-width:1000px) and (max-height:500px){
 .river-scene-shell.is-full-space .river-scene-label{top:102px;font-size:.55rem}
 .is-full-space .river-scene-label>span{display:none}
 .river-scene-shell.is-full-space .scene-message{top:145px;font-size:.7rem;max-width:55%}
 .river-scene-shell.is-full-space .focus-dock{max-height:calc(100dvh - 135px);max-width:440px}
}

@media(max-width:360px){
 .river-heading h1,.agency-settings h1{font-size:2.6rem}
 .gen-path{grid-template-columns:1fr 1fr}
 .gen-path>a{border-bottom:1px solid #c5d0cd!important;border-right:1px solid #c5d0cd!important}
 .gen-path>a:nth-child(2n){border-right:0!important}
 .gen-path>a:nth-last-child(-n+2){border-bottom:0!important}
 .theme-choice strong{font-size:1rem;padding-left:11px;padding-right:11px}
 .theme-choice small{padding-left:11px;padding-right:11px}
}

@media(max-width:480px){
 .budget-numbers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
 .budget-numbers>div:last-child{grid-column:1/-1;border-top:1px solid #ffffff44;padding-top:12px}
 .budget-numbers strong{font-size:1.8rem}
}
