/* Prayash IQ V39 — final Excel collision and responsive stability layer. */
.excel-shell-v30{max-width:100%;overflow-x:clip}
.excel-shell-v30 main,.excel-shell-v30 main *{min-width:0}
.excel-shell-v30 main :is(h1,h2,h3,h4,p,li,dd,dt,a,button,label,span,small,strong,b,em,summary){overflow-wrap:anywhere;word-break:normal}
.excel-shell-v30 main :is(img,svg,canvas,video,iframe){display:block;max-width:100%;height:auto}

/* Keep the two navigation bars in normal document flow so they never cover content. */
.excel-shell-v30 .excel-context-v30{position:relative!important;top:auto!important;z-index:120}
.excel-shell-v30 .excel-context-v30-inner{max-width:100%;min-width:0}
.excel-shell-v30 .excel-workspace-links{flex:1 1 auto;max-width:100%;min-width:0;overflow-x:auto!important;overscroll-behavior-inline:contain}
.excel-shell-v30 .excel-product,.excel-shell-v30 .excel-workspace-search{flex:0 0 auto}

/* Neutralise legacy course styling that was positioning visuals over text. */
.excel-shell-v30 .course-hero{display:flow-root;min-height:0!important;color:var(--xl-ink)!important}
.excel-shell-v30 .course-hero :is(h1,h2,h3,h4){color:var(--xl-ink)!important}
.excel-shell-v30 .course-hero :is(p,li){color:#3f4943!important}
.excel-shell-v30 .course-hero .course-meta span{color:#30473a!important;background:#fff!important;border-color:#cfdcd4!important}
.excel-shell-v30 .course-hero-image{position:static!important;inset:auto!important;float:right!important;width:min(30%,260px)!important;height:auto!important;max-height:190px!important;margin:0 0 18px 26px!important;opacity:1!important;filter:none!important;object-fit:contain!important}

/* Restore readable foreground colours after the legacy dark-panel rules. */
.excel-shell-v30 .syntax-box{color:#263a2e!important}
.excel-shell-v30 .syntax-box code,.excel-shell-v30 .library-card code,.excel-shell-v30 .accuracy-grid-v34 code{color:#17492b!important;background:#fff!important;white-space:pre-wrap}

/* Notes and completion controls receive explicit rows instead of auto-overlapping. */
.excel-shell-v30 .app-action-panel{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px 14px!important;align-items:end!important}
.excel-shell-v30 .app-action-panel>.eyebrow{grid-column:1/-1!important;grid-row:1!important}
.excel-shell-v30 .app-action-panel>.app-actions{grid-column:1/-1!important;grid-row:2!important;margin:0!important;align-items:center}
.excel-shell-v30 .app-action-panel>label{grid-column:1!important;grid-row:3!important}
.excel-shell-v30 .app-action-panel>textarea{grid-column:1!important;grid-row:4!important}
.excel-shell-v30 .app-action-panel>#saveLessonNote,.excel-shell-v30 .app-action-panel>#saveFormulaNote{grid-column:2!important;grid-row:4!important}

/* Secondary sticky panels were colliding with the two app headers. */
.excel-shell-v30 .lesson-side .sticky-card,.excel-shell-v30 .exam-sidebar,.excel-shell-v30 .mastery-filter{position:static!important;top:auto!important;max-height:none!important}

/* Wide data stays inside its own scrolling region; page content never spills sideways. */
.excel-shell-v30 :is(.excel-table-scroll-v30,.v25-table-scroll,.table-scroll,.table-wrap,.argument-table-wrap,.standard-matrix,.excel-course-table-wrap,.excel-map-table-wrap){display:block;width:100%;max-width:100%;overflow-x:auto!important;overflow-y:hidden;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
.excel-shell-v30 main table{width:100%;max-width:100%;border-collapse:collapse}
.excel-shell-v30 main :is(th,td){max-width:min(46vw,520px);white-space:normal!important;overflow-wrap:anywhere;vertical-align:top}
.excel-shell-v30 main :is(pre,code){max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
.excel-shell-v30 :is(.curriculum-table,.data-list-table,.module-lesson-grid,.mastery-list-v30,.lesson-action-list-v30){max-width:100%;overflow:hidden}
.excel-shell-v30 :is(.content-box,.panel,.reference-record,.library-card,.project-card,.answer-card,.exam-question-stage,.exam-sidebar){max-width:100%}
.excel-shell-v30 .question-nav{grid-template-columns:repeat(5,minmax(36px,1fr));gap:7px}
.excel-shell-v30 .question-nav button{width:100%;min-width:36px;height:36px;min-height:36px;padding:0;display:grid;place-items:center;white-space:nowrap!important;overflow-wrap:normal!important;word-break:keep-all!important;line-height:1!important;text-align:center}
.excel-shell-v30 .reference-content{max-width:100%;overflow:visible!important}
.excel-shell-v30 .reference-record{overflow:hidden}

/* Flexible headings, controls and actions must wrap before they collide. */
.excel-shell-v30 :is(.page-context-v25,.excel-page-intro-v28,.section-title,.section-heading,.dashboard-hero,.exam-setup-heading,.exam-setup-footer,.exam-question-meta,.exam-question-actions,.mastery-module-head,.connected-head,.accuracy-title-v34){max-width:100%;flex-wrap:wrap}
.excel-shell-v30 :is(.hero-actions,.course-actions,.app-actions,.actions,.tags,.formula-tags,.course-meta,.search-filters,.result-actions){max-width:100%;flex-wrap:wrap}
.excel-shell-v30 :is(input,select,textarea,button){max-width:100%}
.excel-shell-v30 .flag-btn{margin-left:auto}

/* Intermediate widths are where the previous fixed columns collided most often. */
@media(max-width:1100px){
 .excel-shell-v30 :is(.mastery-hero,.accuracy-hero-v34,.excel-map-hero,.formula-library-hero){grid-template-columns:1fr!important}
 .excel-shell-v30 :is(.accuracy-kpis-v34,.excel-map-kpis){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .excel-shell-v30 .lesson-layout{grid-template-columns:1fr!important}
 .excel-shell-v30 .lesson-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
}
@media(max-width:900px){
 .excel-shell-v30 .course-hero-image{float:none!important;width:min(100%,360px)!important;max-height:220px!important;margin:0 auto 20px!important}
 .excel-shell-v30 .exam-workspace{grid-template-columns:1fr!important}
 .excel-shell-v30 .curriculum-head{display:none!important}
 .excel-shell-v30 .curriculum-row{grid-template-columns:40px minmax(0,1fr) auto!important;padding:13px!important}
 .excel-shell-v30 .curriculum-progress,.excel-shell-v30 .curriculum-preview{grid-column:2/-1!important}
 .excel-shell-v30 .curriculum-status{display:none!important}
 .excel-shell-v30 .module-lesson-row{grid-template-columns:40px minmax(0,1fr) auto!important}
 .excel-shell-v30 .module-lesson-row p{display:none}
 .excel-shell-v30 :is(.mastery-ladder,.mastery-pack-stats,.mastery-home-grid,.project-grid,.library-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:700px){
 .excel-shell-v30 .academy-wrap,.excel-shell-v30 .container,.excel-shell-v30 .formula-wrap,.excel-shell-v30 .v25-wrap,.excel-shell-v30 .standards-hero{width:calc(100% - 20px)!important;padding-left:0!important;padding-right:0!important}
 .excel-shell-v30 .content-box,.excel-shell-v30 .panel,.excel-shell-v30 .exam-setup-card,.excel-shell-v30 .exam-question-stage,.excel-shell-v30 .answer-card,.excel-shell-v30 .reference-intro{padding:17px!important}
 .excel-shell-v30 .app-action-panel{grid-template-columns:1fr!important}
 .excel-shell-v30 .app-action-panel>*{grid-column:1!important;grid-row:auto!important}
 .excel-shell-v30 .lesson-side{grid-template-columns:1fr}
 .excel-shell-v30 :is(.global-module-grid,.global-standard-grid,.lesson-compare,.mastery-card-grid,.decision-results,.industry-case-grid,.mastery-pack-preview,.mastery-home-grid,.reference-context-v31,.connected-search-results,.project-grid,.library-grid){grid-template-columns:1fr!important}
 .excel-shell-v30 :is(.mastery-ladder,.mastery-pack-stats,.accuracy-kpis-v34,.excel-map-kpis,.stats,.steps){grid-template-columns:1fr!important}
 .excel-shell-v30 .function-meta{grid-template-columns:1fr!important}
 .excel-shell-v30 .function-meta>div+div{border-left:0!important;border-top:1px solid var(--xl-line)}
 .excel-shell-v30 .quality-check-row{grid-template-columns:28px minmax(0,1fr)!important}
 .excel-shell-v30 .quality-check-row>*:nth-child(n+3){grid-column:2}
 .excel-shell-v30 .data-list-table .data-head{display:none}
 .excel-shell-v30 .data-list-table .data-row{grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start}
 .excel-shell-v30 .data-list-table .data-row>a{grid-column:1/-1;text-align:left}
 .excel-shell-v30 .lesson-action-list-v30>a,.excel-shell-v30 .learning-next-row-v30{grid-template-columns:32px minmax(0,1fr)!important}
 .excel-shell-v30 .lesson-action-list-v30 em,.excel-shell-v30 .learning-next-row-v30 em{grid-column:2}
 .excel-shell-v30 .exam-question-actions{gap:10px}
}
@media(max-width:420px){
 .excel-shell-v30 .excel-context-v30-inner{width:calc(100% - 16px)}
 .excel-shell-v30 .excel-workspace-links a{padding-inline:8px;font-size:12px}
 .excel-shell-v30 .course-hero{padding:18px!important}
 .excel-shell-v30 .curriculum-row{grid-template-columns:34px minmax(0,1fr)!important}
 .excel-shell-v30 .curriculum-action{grid-column:2;text-align:left}
 .excel-shell-v30 .data-list-table .data-row{grid-template-columns:1fr!important}
 .excel-shell-v30 .data-list-table .data-row>*{grid-column:1!important}
 .excel-shell-v30 .question-nav{grid-template-columns:repeat(5,minmax(0,1fr))!important}
}
