/* Master My Education v66.10.17 — full responsive containment + direct-selection navigation.
   Loaded after the v66.10.14 preservation layer so it can safely correct older cumulative layouts. */
html{scroll-padding-top:92px}
html,body{width:100%;max-width:100%;overflow-x:hidden}
body{min-width:0}
main,.screen,.card,.tile,.hero,.action-card,.session-head,.topbar,.top-actions,.brand-lockup,.brand-lockup-copy,
.admin-wrap,.owner-wrap,.qa-wrap,.diag,.feature-lab-wrap,.auth-wrap,.installer-card,.auth-card{min-width:0;max-width:100%}
[id]{scroll-margin-top:98px}
h1,h2,h3,h4,h5,h6,p,span,b,strong,small,label,summary,a,button{overflow-wrap:anywhere}
input,select,textarea,button{min-width:0;max-width:100%}
img,svg,canvas,video{max-width:100%;height:auto}
pre{max-width:100%;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
.card>table,.screen>table{max-width:100%}
.selection-arrival{animation:mmeSelectionArrival .85s ease}
@keyframes mmeSelectionArrival{0%{box-shadow:0 0 0 4px rgba(91,92,226,.28)}100%{box-shadow:0 4px 18px rgba(26,35,68,.04)}}

/* My Progress: do not force "mastered · retained" into one long line. */
.progress-hero{align-items:flex-start}
.progress-hero-copy{min-width:0;flex:1 1 420px}
.progress-hero-copy h2{margin:.15rem 0 .4rem;line-height:1.18}
.progress-summary-stats{display:grid;grid-template-columns:repeat(2,minmax(126px,1fr));gap:9px;flex:0 1 330px;min-width:270px}
.progress-summary-stat{display:grid;gap:4px;padding:11px 13px;border:1px solid var(--line,#dfe4ea);border-radius:14px;background:var(--card,#fff);text-align:center;min-width:0}
.progress-summary-stat span{font-size:.78rem;font-weight:800;color:var(--muted,#66717f);line-height:1.2}
.progress-summary-stat strong{font-size:1.55rem;line-height:1;color:var(--ink,#172033)}

/* Native same-page quick links land below sticky headers rather than hidden under them. */
.owner-jump-nav a,.join-nav a{scroll-margin-top:110px}

@media(max-width:820px){
 html{scroll-padding-top:144px}
 [id]{scroll-margin-top:144px}
 main{width:100%;margin:12px auto!important;padding-left:10px!important;padding-right:10px!important;padding-bottom:48px!important}
 .card{width:100%;max-width:100%;padding:15px!important;margin-left:0!important;margin-right:0!important}
 .hero,.action-card,.reward-hero,.progress-hero,.reward-guide-hero,.checks-hero,.training-plan-hero,.training-plan-mixed,
 .training-plan-detail-head,.school-tool-panel-head,.game-choice-head{min-width:0;max-width:100%}
 .session-head{width:100%;max-width:100%;align-items:flex-start!important}
 .session-head>div{min-width:0;max-width:100%}
 .session-head b,.session-head span{white-space:normal!important}
 .button-row,.admin-actions,.standalone-account-actions{max-width:100%}
 .button-row>*{min-width:0}
 .progress-summary-stats{width:100%;min-width:0;flex:1 1 100%}
 .progress-hero{flex-direction:column;gap:12px}
 .progress-hero-copy{flex:0 1 auto;width:100%}
 .progress-filter-card,.check-filter-card{position:relative}
 .progress-category-grid,.check-filter-grid,.training-plan-category-grid,.school-maths-hub,.curriculum-card-grid,
 .game-topic-grid,.achievement-grid,.student-skill-grid,.reward-guide-grid,.avatar-gallery{min-width:0;max-width:100%}
 .progress-filter-box,.check-filter-box,.game-topic-card,.school-maths-card,.training-plan-category-card,.student-skill-card,
 .curriculum-check-card,.reward-rule-card,.avatar-card{min-width:0!important;max-width:100%!important;width:100%}
 .progress-status-row{max-width:100%}
 .progress-status-row button{white-space:normal}
 .student-topic-head,.curriculum-strand-head,.student-skill-title,.curriculum-code-row{min-width:0}
 .student-topic-head>div:first-child,.student-skill-title>b,.curriculum-check-card h4{min-width:0}
 .status,.topic-master-count,.check-status{max-width:100%;white-space:normal!important}
 .reward-chip,.session-stats{max-width:100%;flex-wrap:wrap}
 .session-stats>div{white-space:normal!important}
 .chat-input{min-width:0}
 .chat-input textarea{min-width:0}
 .word-help-card,.school-tool-panel,.calculator-panel,.working-template-host,.manipulative-host{max-width:100%}
 .admin-table-wrap,.responsive-table-wrap{width:100%;max-width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
 .admin-table-wrap table,.responsive-table-wrap table{min-width:max-content;max-width:none}
 .card>table,.screen>table{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .owner-jump-nav,.admin-nav{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
 .owner-jump-nav a,.admin-nav a{flex:0 0 auto}
}

@media(max-width:560px){
 html{scroll-padding-top:150px}
 [id]{scroll-margin-top:150px}
 .progress-summary-stats{grid-template-columns:1fr 1fr;gap:7px}
 .progress-summary-stat{padding:10px 8px}
 .progress-summary-stat strong{font-size:1.4rem}
 .progress-summary-stat span{font-size:.72rem}
 .progress-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .progress-filter-box{grid-template-columns:1fr;text-align:center;place-items:center;min-height:72px}
 .check-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .question-card h2{font-size:clamp(1.25rem,6vw,1.55rem)!important;overflow-wrap:anywhere}
 .answer-submit-row{justify-content:stretch}
 .answer-submit-row #checkBtn{width:100%;min-width:0}
 .school-tools{max-width:100%}
 .school-tools .school-tool-button{white-space:normal}
 .chat-input{flex-direction:column}
 .chat-input button{width:100%}
 .calculator-keys{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 .working-template-picker{min-width:0}
 .working-template-picker select{width:100%}
 .reward-big b{font-size:clamp(1.8rem,10vw,2.25rem)}
}

@media(max-width:380px){
 main{padding-left:8px!important;padding-right:8px!important}
 .card{padding:13px!important}
 .progress-summary-stats{grid-template-columns:1fr}
 .progress-category-grid{grid-template-columns:1fr!important}
 .check-filter-grid{grid-template-columns:1fr 1fr!important}
}
