/* Header/footer stay outside the scroll area; compact screens use one page scroller. */
html,body{height:100%;width:100%;margin:0;overflow:hidden}
body{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100vh;height:100dvh;min-width:0}
body>header{position:relative;z-index:20;min-height:72px;height:auto;padding:14px clamp(12px,3vw,36px);gap:12px;flex-wrap:wrap;background:#10171d}
.brand{min-width:0;gap:9px;font-size:clamp(19px,2vw,23px)}.engine{font-size:14px}.brand,.engine{max-width:100%}
main{width:100%;height:100%;min-width:0;min-height:0;margin:0 auto;overflow:hidden;grid-template-columns:clamp(220px,23vw,280px) minmax(0,1fr);align-self:stretch}
aside{min-width:0;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden;padding:22px 18px 12px}
.database-heading{flex:0 0 auto;min-width:0}.database-heading .muted{margin-bottom:12px}.section-heading{gap:10px;flex-wrap:wrap}
#schema{display:block;flex:1 1 0;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:8px;scrollbar-width:thin;scrollbar-color:#536e7d #131c23}
.schema-table{min-width:0;padding-top:12px}.table-button{gap:8px;overflow-wrap:anywhere;min-height:36px}.table-button span{flex:0 0 auto}.column{display:flex;gap:8px;overflow-wrap:anywhere}.column span{min-width:0}.column small{flex-shrink:0}
.database-tools{flex:0 1 auto;min-height:0;max-height:46%;overflow:auto;border-top:1px solid #31414d;padding-top:10px}
.database-tools .relation{margin-top:0}.database-tools .reset{margin-top:8px;padding:10px;font-size:14px;white-space:normal;overflow-wrap:anywhere}.database-tools .fine{margin:10px 0 0}
.workspace{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scroll-padding-top:20px;padding:28px clamp(16px,3vw,38px) 32px}
.intro>div{min-width:0}.intro h1{overflow-wrap:anywhere}.intro .number{flex-shrink:0}
.modebar{flex-wrap:wrap;gap:12px 22px}.modebar button{min-height:44px}.challenge-top{flex-wrap:wrap;align-items:center}.challenge-top select{flex:1 1 220px;min-width:0;width:100%;max-width:100%;font-size:16px;min-height:44px}.challenge-top .eyebrow{flex:1 1 160px}
#challenge,#challenge p,#feedback{min-width:0;overflow-wrap:anywhere}.challenge-actions{flex-wrap:wrap;gap:10px 16px}.challenge-actions button{min-height:44px}.challenge-actions span{margin-left:0}
.editor-panel,.results,.editor,.table-wrap{min-width:0;max-width:100%}.editor{align-items:stretch}.line-numbers{flex:0 0 42px;width:42px;padding-right:12px}textarea{flex:1 1 0;min-width:0;width:0;max-width:100%;font-size:16px}
.panel-heading{flex-wrap:wrap;overflow-wrap:anywhere}.editor-footer{flex-wrap:wrap;gap:12px}.editor-footer>div{display:flex;flex-wrap:wrap;gap:8px;min-width:0;margin-left:auto}.editor-footer .run{margin-left:0}.editor-footer button{min-height:44px}.table-wrap{overflow:auto;max-height:360px;overscroll-behavior:contain}
.site-footer{margin:0;padding:10px clamp(12px,2vw,25px);min-height:44px;background:#131c23;border-top:1px solid #31414d;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:5px 20px;z-index:20;font-size:12px;color:#9bb0bf;overflow-wrap:anywhere}.site-footer strong{color:#dce9ed;font-weight:600}.site-footer span{min-width:0}
.learning-path{border-bottom:1px solid #3a505b;margin-bottom:20px;padding-bottom:18px}.learning-path strong{font-size:16px}.learning-path p{font-size:14px;color:#c2d3dc}.learning-path .practice-note{font-size:13px;color:#93aebc}
.progress-row{display:flex;gap:16px;align-items:center;margin-top:15px}.progress-row label{font-size:13px;color:#8ee7bd;white-space:nowrap}.progress-row progress{width:100%;height:7px;border:0;accent-color:#79efb6;border-radius:5px;overflow:hidden}.progress-row progress::-webkit-progress-bar{background:#30454f}.progress-row progress::-webkit-progress-value{background:#79efb6}
#concept{color:#a5bbc7;font-size:14px}.practice-goal{border-left:3px solid #79efb6;padding:8px 14px;margin:18px 0;background:#15232b}.practice-goal strong{color:#91ebc0;font-size:14px}.practice-goal p{margin:5px 0!important}
.steps-heading{font-size:14px;font-weight:600;margin:18px 0 10px}#practice-steps{padding-left:24px;margin:0 0 18px;font-size:15px;line-height:1.6}#practice-steps li{padding-left:5px;margin-bottom:8px}#practice-steps li::marker{color:#79efb6}
.expected{font-size:14px;color:#adc6d2}.expected strong{color:#d8e7ee}.lesson-navigation{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:19px;padding-top:16px;border-top:1px solid #3a505b}.lesson-navigation button{font-size:14px;border:1px solid #4a656e;background:#213b44;padding:8px 12px;border-radius:5px;color:#daf1e8}.lesson-navigation button:disabled{cursor:default;opacity:.35}.lesson-navigation span{font-size:13px;color:#9ab3c0}#lesson-state{color:#79efb6;font-size:13px}#hint-text{font-size:14px;background:#20383c;padding:12px;border-radius:5px}

.progress-row progress{min-width:0;flex:1 1 120px}.progress-row{flex-wrap:wrap}.lesson-navigation{flex-wrap:wrap}.lesson-navigation button{min-height:44px}.lesson-navigation span{white-space:normal}.learning-path{min-width:0}
@media(max-width:1100px){.intro .number{display:none}.tag{display:none}.workspace{padding-inline:20px}.challenge-top{flex-direction:column;align-items:stretch}.challenge-top .eyebrow,.challenge-top select{flex:auto}.editor-footer>span{display:none}}
/* Do not divide a phone or a short landscape window into two fixed-height scrolling panels. */
@media(max-width:900px),(max-height:560px){
 main{display:block;overflow-y:auto;overflow-x:hidden;overscroll-behavior:auto;scrollbar-gutter:stable}
 aside{display:block;min-height:0;height:auto;padding:18px 20px;border-right:0;border-bottom:1px solid #31414d;overflow:visible}
 .database-heading h2{margin:8px 0}.database-heading .muted{display:none}
 #schema{display:block;min-height:0;height:auto;max-height:230px;max-height:min(30dvh,230px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:auto}
 .schema-table{min-width:0;padding:9px 0}.column{display:flex;padding-top:3px}.database-tools{display:flex;flex-wrap:wrap;gap:8px;max-height:none;overflow:visible;padding-top:12px;margin-top:8px}
 .database-tools .reset{flex:1 1 180px;width:auto;margin:0;min-height:44px}.database-tools .relation,.database-tools .fine{display:none}
 .workspace{height:auto;overflow:visible;min-height:0;padding:24px 20px 32px;scrollbar-gutter:auto;overscroll-behavior:auto}
 .intro{margin-bottom:22px}.intro .number{display:none}.challenge-top{flex-direction:column;align-items:stretch}.challenge-top .eyebrow,.challenge-top select{flex:auto}
 .site-footer span:last-child{display:none}
}
@media(max-width:480px){
 body>header{min-height:60px;padding:10px 12px;gap:8px}.engine{font-size:12px}.engine span,.tag{display:none}.brand{font-size:19px}
 aside{padding:14px 12px}.workspace{padding:20px 12px 28px}h1{font-size:26px;letter-spacing:-.5px}.intro p{font-size:15px}
 .database-tools .reset{flex:1 1 100%;font-size:14px}.section-heading{font-size:12px;letter-spacing:1px}#challenge{padding:16px 12px}
 .modebar{gap:8px 16px}.modebar button{font-size:14px}.progress-row{gap:8px}.progress-row label{white-space:normal}
 .lesson-navigation{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.lesson-navigation span{grid-row:1;grid-column:1 / -1;text-align:center}.lesson-navigation button{font-size:14px;padding:8px;white-space:normal}
 .editor-footer{padding:12px}.editor-footer>div{width:100%;margin:0}.editor-footer button{flex:1 1 100px}.panel-heading{padding:12px}.line-numbers{flex-basis:32px;width:32px;padding-right:8px}
 td,th{padding:10px 12px}.site-footer{padding:8px 12px;gap:4px;font-size:12px}.site-footer span:nth-child(2){flex-basis:100%}
}
@media(max-height:560px){body>header{min-height:52px;padding-block:8px}.site-footer{min-height:36px;padding-block:6px}.site-footer span:not(:first-child){display:none}.database-tools .reset{flex-basis:170px}#schema{max-height:150px}}

.schema-detail{font:12px/1.5 Consolas,monospace;color:#8ee1b9;padding:7px 0 0;overflow-wrap:anywhere;min-width:0}
