/* v1.3: iPad landscape first; portrait and phone continue to work. */
#panel{max-height:calc(var(--usable-height,100dvh) - 28px);top:calc(var(--viewport-top,0px) + 14px + env(safe-area-inset-top));bottom:auto;height:calc(var(--usable-height,100dvh) - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
.learning-visual,.learning-work{min-width:0}.learning-visual:empty{display:none}.learning-layout{display:block}.learning-work>.actions:last-child{margin-bottom:0}
.land-nav{width:960px}.land-symbol.harbor-symbol{color:#739eac}.ride-card.harbor .symbol{background:#d8e9eb;color:#578895}.panel-hero.harbor{background:linear-gradient(120deg,#d7e8e8,#f4e7c9)}
.harbor-hero{border-radius:22px;background:linear-gradient(145deg,#e2f2ed,#f9efd6);padding:26px;margin-bottom:22px}.harbor-hero h3{font-size:28px;margin:0 0 10px}.harbor-hero p{font-size:16px;line-height:1.7}.harbor-routes{display:grid;gap:14px}.harbor-route{background:#fffaf0;border:1px solid #d8e3d7;border-radius:22px;padding:24px;text-align:left}.harbor-route b{display:block;font-size:22px;margin:8px 0}.harbor-route small{display:block;font-size:15px;line-height:1.7;color:#61796c}.harbor-route .ship-symbol{font-size:42px}.legacy-area{height:100%;display:flex;flex-direction:column;min-height:0}.legacy-toolbar{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:12px 18px;background:#edf3e8;border-bottom:1px solid #d8e2d2;flex-wrap:wrap}.legacy-toolbar strong{font-size:16px}.legacy-toolbar span{font-size:12px;color:#61766b}.legacy-toolbar button{border:1px solid #cad8c4;border-radius:12px;background:#fffdf3;padding:10px 14px;min-height:44px}.legacy-frame{width:100%;height:100%;min-height:400px;flex:1;border:0;background:#f6f5f1}.legacy-note{padding:12px 18px;font-size:13px;line-height:1.6;background:#fff2d7}.legacy-note:empty{display:none}#panel[data-layout=legacy]{overflow:hidden}#panel[data-layout=legacy] #panel-content{height:100%}#panel[data-layout=legacy] #close-panel{position:absolute;right:8px;top:8px;margin:0}#panel[data-layout=legacy] .legacy-toolbar{padding-right:65px}
.harbor-chip{display:inline-block;padding:7px 12px;background:#e4efdc;border-radius:20px;color:#52755a;font-size:13px}.harbor-chip[data-state=connected]{background:#d7f2db}.harbor-chip[data-state=failed]{background:#fae6dc}
@media(min-width:850px) and (orientation:landscape){
 #panel{left:24px;right:24px;width:auto;max-width:1400px;margin:0 auto;border-radius:26px}
 .panel-hero{padding:21px 32px 17px}.panel-hero h2{font-size:27px;margin:5px 50px 5px 0}.panel-hero p{font-size:14px}.panel-hero small{font-size:10px}.panel-body{padding:22px 30px 30px}
 .learning-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:30px;align-items:start}
 .learning-visual{padding:20px;background:#f1f5e8;border:1px solid #e1e8d7;border-radius:24px}.learning-visual .teach-art{margin-top:0}.learning-visual .quote-line{font-size:28px;line-height:1.6;margin:18px 0 8px}.learning-visual .source-photos{background:#fffdf5}.learning-visual .source-photos img{max-height:550px;object-fit:contain}.learning-work .teacher-bubble{margin-top:0}.teacher-bubble p,.learning-tip{font-size:18px}.teacher-bubble{padding:18px}.teach-shell .question{font-size:26px}.teach-shell .teach-controls{gap:10px}.primary,.secondary{font-size:16px;min-height:48px}.text-button{font-size:15px;min-height:44px}.small-note,.source,.tiny{font-size:13px}.teach-tag{font-size:12px}.mission-track{display:grid;grid-template-columns:1fr 1fr;gap:12px}.mission-track button{font-size:15px;min-height:80px;margin:0}.segment-nav{margin:8px 0 18px}
 #panel[data-layout=task] .learning-layout{grid-template-columns:minmax(0,.9fr) minmax(0,1.15fr)}.answers button{font-size:21px;padding:18px;min-height:64px}.match-board button{font-size:19px;min-height:65px}.order-slots button,.word-tray button,.word-bank button{font-size:19px;padding:14px;min-height:50px}.task-art-row{margin:14px 0}.point-wrap{margin-top:16px}.point-dot{min-width:46px;min-height:46px}.point-key{font-size:17px}
 #panel[data-layout=task-centered] .teach-shell,#panel[data-layout=task-centered] .panel-body{max-width:960px;margin:auto}#panel[data-layout=task-centered] .answers{grid-template-columns:1fr}.order-slots{min-height:95px}.order-slots button{min-width:75px}.tiny-stage{width:120px}
 #panel[data-layout=writing] .learning-layout{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}textarea{min-height:200px;font-size:24px;line-height:1.7}.field{font-size:15px}.learning-work textarea:focus{scroll-margin:25px}.rhythm-levels button{font-size:14px;min-height:45px}.beat-pad{min-height:150px;font-size:34px}.beat-lights{margin:24px auto}
 #panel[data-layout=hub] .teach-shell{display:grid;grid-template-columns:1fr 1fr;gap:14px 24px}#panel[data-layout=hub] .teach-shell>#teach-home{grid-column:1/-1}#panel[data-layout=hub] .teach-shell>.teach-grid,#panel[data-layout=hub] .teach-shell>.teach-section,#panel[data-layout=hub] .teach-shell>.full{grid-column:1/-1}.teach-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.teach-tile{margin:0;min-height:112px;padding:20px}.teach-tile b{font-size:18px}.teach-tile small{font-size:13px}.harbor-routes{grid-template-columns:repeat(3,1fr)}.ride-card strong{font-size:19px}.ride-card small{font-size:14px}.ride-card{min-height:94px}.stamps{grid-template-columns:repeat(6,1fr)}.metric span{font-size:14px}.setting p{font-size:15px}
 .intro{top:18px;left:24px}.theme-control{top:20px}.land-nav{bottom:16px}.land{padding:12px 15px;gap:9px}.land b{font-size:14px}.land small{font-size:8px}.guide-button{font-size:14px}.hotspot .bubble{font-size:14px;padding:11px 16px}
}
@media(min-width:650px) and (orientation:portrait){#panel{left:18px;right:18px;width:auto;max-width:none}.panel-body{padding:24px 32px}.teach-grid{grid-template-columns:1fr 1fr}.teach-art{max-width:650px;margin-inline:auto}}
@media(max-width:649px){.land b{font-size:9px}.land-symbol{font-size:20px}.harbor-hero{padding:18px}.harbor-hero h3{font-size:23px}.legacy-toolbar{gap:6px;padding:9px}.legacy-toolbar strong{font-size:14px}.legacy-toolbar button{padding:8px;font-size:12px}.legacy-frame{min-height:200px}.learning-visual{margin-bottom:20px}.phone-preview #panel{height:calc(100% - 24px);max-height:calc(100% - 24px)}}
@media(max-height:550px){.learning-visual .theme-picture{max-height:120px;overflow:hidden}.learning-visual .theme-picture svg{max-height:120px}textarea{min-height:140px}#panel{top:8px;height:calc(var(--usable-height,100dvh) - 16px);max-height:calc(var(--usable-height,100dvh) - 16px)}}
@media(prefers-reduced-motion:no-preference){.learning-visual{animation:lesson-arrive .32s ease-out}@keyframes lesson-arrive{from{opacity:.4;transform:translateY(6px)}to{opacity:1;transform:none}}}

/* Phone preview follows the same stacked composition as a narrow device. */
.phone-preview #panel{left:auto;right:10px;top:12px;width:calc(100% - 20px);height:calc(100% - 24px);max-height:calc(100% - 24px)}
.phone-preview .learning-layout,.phone-preview #panel[data-layout=hub] .teach-shell{display:block}
.phone-preview .panel-hero{padding:26px 24px}.phone-preview .panel-body{padding:24px}.phone-preview .learning-visual{padding:0;border:0;background:none;margin-bottom:20px}.phone-preview .learning-visual .quote-line{font-size:23px}.phone-preview .teach-grid{grid-template-columns:1fr}.phone-preview .mission-track{display:block}.phone-preview .mission-track button{margin:8px 0;width:100%}.phone-preview .harbor-routes{grid-template-columns:1fr}.phone-preview .land-nav{width:calc(100% - 24px)}.phone-preview .land{padding:8px 4px;gap:3px}.phone-preview .land b{font-size:9px}.phone-preview .land small{display:none}.phone-preview .land-symbol{font-size:20px}

#reset-map{font-size:14px;letter-spacing:1px;font-weight:600}
