/* Stable identity, focused reading and dialogs that fit the available viewport. */
.topbar .topbar-right{margin-left:auto;align-self:center;flex-shrink:0}
.header-identity{min-width:0}.topbar-title{overflow-wrap:anywhere}
dialog{overflow:hidden;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px)}
dialog[open]{display:flex;flex-direction:column}
.modal-head,.modal-actions{flex:none}
.modal-head{align-items:flex-start;background:#fff}
.modal-head h2{min-width:0;line-height:1.35;align-items:flex-start;overflow-wrap:anywhere}
.modal-head>.icon-btn{flex-shrink:0}
.modal-body{overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-gutter:stable}
.modal-body>*{max-width:100%}.modal-body a{overflow-wrap:anywhere}
.student-header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:24px}
.student-header>.btn{justify-self:end;margin:0}
.child-identity{margin:0;justify-self:end;max-width:290px;gap:10px;order:initial;flex-basis:auto;padding:0;border:0}
.child-identity small{max-width:220px;font-size:11px}.child-identity strong{line-height:1.4}
.lesson-step-heading{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:22px}
.lesson-step-heading small,.student-activity-level{color:var(--muted);font-size:.82rem}
.read-text-block{display:flex;gap:12px;align-items:flex-start}
.read-text-block>p{margin:0;min-width:0;flex:1;line-height:1.75}
.read-text-block>h1{margin:4px 0 20px;min-width:0;flex:1}
.read-text-block .inline-reading{flex:none;margin-top:2px}
.read-inline-button{color:var(--deep);background:#fff;border:1px solid #aecbc7;border-radius:50%;width:44px;height:44px;min-width:44px}
.question-prompt .read-inline-button{background:#ecf6f2}
.read-inline-button[aria-pressed=true]{background:#075d63;color:white}
.lesson-help-dock{position:static;width:100%;max-width:900px;margin:20px auto 0;display:flex;flex-direction:column;align-items:stretch;gap:12px}
.lesson-help-dock>.btn{align-self:flex-end;min-height:48px;border-radius:10px;padding:12px 18px;box-shadow:none}
.lesson-help-dock .step-guide{margin:0;box-shadow:none;border:1px solid #b7d0cc;border-radius:14px;background:#fff;padding:20px}
@media(max-width:600px){.student-shell:has(.kg-activity) .lesson-help-dock{position:static;width:auto;margin:12px 16px 24px;}.student-shell:has(.kg-activity) .lesson-help-dock>.btn{align-self:stretch;box-shadow:none;}}
.step-guide-content{font-size:17px}.step-guide-actions{display:grid;grid-template-columns:1fr;gap:8px}.step-guide-actions .btn{justify-content:flex-start}.step-guide-heading h2{font-size:18px}
.student-shell{padding-bottom:100px}.student-tools{padding-bottom:25px}
.grade-paths{margin:0 0 24px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px 24px}
.grade-paths h2{font-size:1.1rem;margin:0 0 6px}.grade-paths p{font-size:.88rem;color:var(--muted);margin:0 0 16px}
.grade-path-grid{display:flex;flex-wrap:wrap;gap:9px}.grade-path-grid button{display:grid;gap:4px;min-width:83px;min-height:62px;border:1px solid #bad2d0;border-radius:11px;background:#f5faf8;color:var(--deep);padding:10px 13px;text-align:left}
.grade-path-grid button[aria-pressed=true]{background:#075d63;color:white;border-color:#075d63}.grade-path-grid small{font-size:11px;font-weight:400}
.grade-collection-note{border-left:3px solid var(--teal);padding:12px 16px;margin:15px 0 22px;background:#f1f8f5;font-size:.9rem}
.destination-card{max-width:700px}.destination-card>.icon{width:40px;height:40px;color:var(--teal);margin-bottom:20px}
.library-sharing-link{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;font-size:.84rem;color:var(--muted);margin:0 0 20px}.library-sharing-link a{display:inline-flex;gap:8px;align-items:center;min-height:44px}.library-sharing-link .icon{width:18px;height:18px}
.settings-grid h2>.icon{vertical-align:middle;margin-right:6px}.settings-grid h2{line-height:1.4}
@media(max-width:720px){
 .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;min-height:112px;height:auto;align-items:start;padding:16px 20px}
 .topbar .topbar-right{grid-column:2;grid-row:1;align-self:start;margin:0}
 .header-identity{display:contents}.mobile-brand{grid-column:1;grid-row:1;margin-top:9px}.topbar-title{grid-column:1/-1;grid-row:2;margin:2px 0 0;display:block;font-size:1.5rem}
 .student-header{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:14px 12px;padding:0;margin-bottom:24px}
 .student-header .student-logo{width:min(135px,100%);grid-column:1;grid-row:1}
 .child-identity{grid-column:2;grid-row:1/3;align-self:start;max-width:100%;gap:8px;align-items:flex-start;justify-content:flex-end}
 .child-identity .avatar{width:34px;height:34px;font-size:15px}.child-identity>div{min-width:0}.child-identity strong{font-size:16px}.child-identity small{max-width:100%;font-size:10px;line-height:1.5}
 .student-header>.btn{grid-column:1;grid-row:2;justify-self:start;margin:0;font-size:.75rem}
 .student-shell{padding:20px 16px 110px}.question-card{padding:22px 16px}
 .question-card .question-context{padding:15px 12px}.read-text-block{gap:9px}.read-text-block>h1{font-size:1.35rem;line-height:1.45;margin-top:2px}
 .lesson-help-dock{right:16px;bottom:max(16px,env(safe-area-inset-bottom))}
 .modal-head{padding:18px 16px;gap:10px}.modal-head h2{font-size:1.05rem;gap:9px}.modal-title-icon{width:32px;height:32px}.modal-head>.icon-btn{width:40px;height:40px;min-width:40px}.modal-body{padding:18px 16px}.modal-actions{padding:14px 16px}
 .grade-paths{padding:18px 16px}.grade-path-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.grade-path-grid button{min-width:0;min-height:62px;padding:9px;font-size:.85rem}.grade-path-grid small{font-size:10px}
 .student-activity .student-activity-level{font-size:.75rem}
}
@media(max-width:350px){.student-header{grid-template-columns:1fr 1fr}.child-identity .avatar{display:none}.student-header .student-logo{width:120px}.topbar{padding-inline:16px}.grade-path-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* The guide belongs with account tools, away from activity and form controls. */
.topbar .ep-chat-launcher{position:static;min-height:44px;padding:10px 14px;border-radius:9px;box-shadow:none;font-size:.84rem;gap:8px;z-index:auto}
.topbar .ep-chat-launcher>.icon{width:19px;height:19px}
@media(min-width:721px) and (max-width:970px){
 .shell{display:block}.sidebar{display:none}
 .content{padding:24px 28px 110px}
 .topbar{min-height:96px;padding:16px 28px;align-items:center}
 .header-identity{display:flex;flex-direction:column;gap:10px}
 .mobile-brand{display:block;width:135px;line-height:0}.mobile-brand img{width:100%;height:auto}
 .topbar-title{font-size:1.65rem}
}
@media(max-width:970px){
 .mobile-nav{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);position:fixed;bottom:0;left:0;right:0;border-top:1px solid #cbdbe3;background:#fffffff5;backdrop-filter:blur(14px);padding:6px 8px max(8px,env(safe-area-inset-bottom));gap:2px;z-index:40}
 .mobile-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:.7rem;text-decoration:none;color:#526b7e;min-height:54px;min-width:0;padding-inline:2px;text-align:center;overflow-wrap:anywhere;border-radius:8px}
 .mobile-nav a .icon{width:21px;height:21px}.mobile-nav a.active{color:var(--deep);background:#e8f4ef}
}
@media(max-width:720px){.topbar .topbar-right{gap:12px}.topbar .ep-chat-launcher{padding:10px 12px;font-size:.8rem}}

/* Keep dashboard artwork supportive instead of stretching the whole first row. */
.day-art .instruction-cards{gap:10px}
.day-art .instruction-cards .instruction-card{flex-basis:70px;max-width:110px;text-align:center}
.day-art .instruction-art{max-height:90px;width:100%}
.day-art .instruction-card figcaption{font-size:.88rem;font-weight:600;line-height:1.4;margin-top:4px}
.day-art:has(.instruction-cards){padding:24px 24px 60px}

/* Give navigation labels their own predictable column. */
@media(min-width:971px){
 .shell{grid-template-columns:264px minmax(0,1fr)}
 .sidebar{padding:24px 14px 18px;scrollbar-gutter:stable}
 .sidebar .brand{padding:0 10px 22px}
 .sidebar .nav-link{display:grid;grid-template-columns:20px minmax(0,1fr);gap:12px;padding:11px 12px;min-height:46px;font-size:.875rem;line-height:1.4}
 .sidebar .nav-link>.icon{width:20px;height:20px;flex:none}
 .sidebar .nav-link>span{overflow-wrap:normal;word-break:normal}
 .sidebar .nav-section{margin:0 12px 8px;font-size:.72rem}
 .sidebar .nav-group+.nav-group{margin-top:18px;padding-top:16px}
 .sidebar .workspace-switch{margin-inline:0}
 .sidebar .workspace-switch a{font-size:.72rem;padding-inline:8px}
}
