/* Stable teacher workspace and one-page account center. */
.header-account{min-width:150px;justify-content:flex-start;border-color:#cadbce;box-shadow:0 5px 16px rgba(24,67,53,.07);font-weight:700}.header-account:hover{border-color:#81aa8d;background:#f7fbf7}.account-arrow{margin-right:auto;color:#5b8068}.session-group-label{padding:13px 9px 6px;color:#6e8075;font-size:10px;font-weight:700;border-top:1px solid #dde6dc;margin-top:6px}.session-row{position:relative;display:flex;align-items:center;gap:4px}.session-row .session-button{min-width:0;flex:1}.session-row.opened-session .session-button{background:#fff;border:1px solid #dce6dc}.session-actions{display:flex;gap:1px}.session-actions button{width:27px;height:27px;border-radius:8px;color:#73827a}.session-actions button:hover{background:#fff}.trash-button{font-size:14px;color:#a45d50!important}.activity-view-toolbar{position:sticky;top:-38px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 18px;margin:-18px 0 20px;background:rgba(247,248,245,.94);backdrop-filter:blur(10px);border:1px solid #dce6dc;border-radius:15px}.activity-view-toolbar div{display:flex;flex-direction:column}.activity-view-toolbar span{font-size:10px;color:#75857a}.activity-view-toolbar strong{font-size:14px}.confirm-dialog{width:min(440px,calc(100vw - 28px));display:none;grid-template-columns:52px 1fr;gap:12px 16px;overflow:visible}.confirm-dialog[open]{display:grid}.confirm-dialog .confirm-icon{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;background:#fff0df;color:#a86b2c;font-weight:800;font-size:20px}.confirm-dialog h2{margin:2px 0 4px;font-size:20px}.confirm-dialog p{color:#697970;line-height:1.9}.confirm-dialog .dialog-actions{grid-column:1/-1;justify-content:flex-end;margin:6px 0 0}.confirm-dialog .danger{background:#a84e43;border-color:#a84e43}
body[data-module="math"]:not(.chat-empty):not(.activity-open) #main{display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}body[data-module="math"]:not(.chat-empty):not(.activity-open) #chat-view{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:10px 8px 28px;scrollbar-gutter:stable}body[data-module="math"].activity-open #main{overflow-y:auto}.message{overflow-anchor:none}.pending-message,.chat-turn:last-child{overflow-anchor:auto}
.starter{min-height:145px}.starter strong{font-size:12px;line-height:2;color:#28463a}.welcome-description{max-width:700px;margin:auto}.home-section-heading p{color:#718078;font-size:12px;margin-top:5px}.suite-hero{min-height:280px}.suite-hero h1{margin:5px 0 10px}.suite-hero>div:first-child{align-self:center}.suite-summary strong{font-size:20px}.module-overview-card{min-height:190px}
.account-dialog{width:min(1080px,calc(100vw - 28px));max-width:1080px;max-height:94dvh;padding:20px}.account-dashboard{display:grid;gap:12px}.account-identity{display:grid;grid-template-columns:50px 1fr auto;align-items:center;gap:12px;padding:13px 16px;border-radius:17px;background:linear-gradient(135deg,#173f34,#28634f);color:#fff}.account-identity .account-avatar{width:46px;height:46px;border-radius:14px;background:#f2bd6c;color:#173f34;display:grid;place-items:center;font-weight:800}.account-identity span,.account-identity p{font-size:9px;color:#c7d9d2}.account-identity h3{font-size:15px}.plan-state{padding:6px 11px;border:1px solid rgba(255,255,255,.18);border-radius:999px;font-size:10px;color:#f6cc8c}.account-kpis{display:grid;grid-template-columns:180px repeat(2,1fr);gap:10px}.quota-ring,.account-kpi{min-height:100px;border:1px solid #dfe7df;border-radius:16px;background:#fafcf9;padding:12px}.quota-ring{display:grid;place-items:center;background:conic-gradient(#4f966d var(--quota),#e5ece5 0)}.quota-ring:before{content:"";grid-area:1/1;width:80px;height:80px;border-radius:50%;background:#fff}.quota-ring>div{grid-area:1/1;z-index:1;text-align:center;display:flex;flex-direction:column}.quota-ring strong{font-size:17px}.quota-ring span,.account-kpi span{font-size:9px;color:#7b8980}.account-kpi{display:flex;flex-direction:column;justify-content:center}.account-kpi strong{font-size:16px;margin:3px 0}.account-kpi small{font-size:9px;color:#8a958e}.account-columns{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(290px,.7fr);gap:11px}.account-plans,.account-actions-panel{border:1px solid #dfe7df;border-radius:17px;background:#fff;padding:14px}.account-section-title{display:flex;justify-content:space-between;align-items:end}.account-section-title span,.account-section-title small{font-size:9px;color:#819087}.account-section-title h3{font-size:15px}.account-dashboard .plans-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:10px 0 0}.account-dashboard .plan-card{display:grid;grid-template-columns:1fr auto;gap:7px;margin:0;padding:12px;background:#f7faf6;border-radius:13px}.account-dashboard .plan-card h3{font-size:13px;margin:0}.account-dashboard .plan-card span{font-size:9px;color:#7b887e}.account-dashboard .plan-card>strong{font-size:13px}.account-dashboard .plan-card>strong small{display:inline;font-size:8px}.account-dashboard .plan-card button{grid-column:1/-1;margin:2px 0 0;padding:7px}.account-actions-panel{display:flex;flex-direction:column;gap:7px}.account-action-card{width:100%;display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:9px;padding:10px;text-align:right;border-radius:12px;background:#f7faf6;border:1px solid #e1e8e0}.account-action-card>span{width:32px;height:32px;display:grid;place-items:center;border-radius:9px;background:#e3eee5;color:#2c6c50}.account-action-card div{display:flex;flex-direction:column}.account-action-card strong{font-size:11px}.account-action-card small{font-size:8px;color:#819087}.account-action-card i{font-style:normal;color:#789080}.danger-card{color:#8a4d45}.danger-card>span{background:#faeae7;color:#a15349}.payments-panel,.password-inline{max-height:170px;overflow:auto;padding:7px 10px;border:1px solid #e4eae2;border-radius:11px;background:#fcfdfb}.password-inline{display:grid;grid-template-columns:1fr 1fr;gap:7px}.password-inline label{margin:0;font-size:9px}.password-inline button{grid-column:1/-1;padding:7px}.integration-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.integration-grid .admin-plan-form{border:1px solid #dce5dc;border-radius:15px;padding:15px}
@media(max-width:820px){.header-account{min-width:0}.account-arrow{display:none}.module-overview-grid{width:100%;margin-inline:auto}.module-overview-card{width:100%;max-width:none}.module-rail-items{flex:1;justify-content:center}.module-switch{flex:1;min-width:52px}.activity-view-toolbar{top:-22px;align-items:flex-start;flex-direction:column}.activity-view-toolbar button{width:100%}.account-dialog{max-height:92dvh}.account-kpis,.account-columns{grid-template-columns:1fr}.account-dashboard .plans-grid{grid-template-columns:1fr}.integration-grid{grid-template-columns:1fr}.account-identity{grid-template-columns:46px 1fr}.plan-state{grid-column:1/-1;justify-self:start}.quota-ring{min-height:115px}.module-home{width:100%;padding-inline:12px}.suite-hero,.module-overview-grid{width:100%}}
@media(min-width:821px){.account-dialog #account-body{overflow:hidden}.account-dashboard{max-height:calc(94dvh - 86px)}.account-dialog .dialog-heading{margin-bottom:9px}}
.dl-chat-shell{height:clamp(500px,calc(100dvh - 135px),820px);min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}.dl-chat-log{min-height:0;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable}.dl-chat-shell>header,#dl-chat{position:relative;z-index:2;background:#fff}.dl-conversation-row{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:3px}.dl-conversation-row .module-menu-item{min-width:0;width:100%}.dl-delete-chat{width:28px;height:28px;border-radius:8px;font-size:12px;color:#a35850}.dl-delete-chat:hover{background:#faeae7}.dl-message{overflow-anchor:none}.dl-message:last-child{overflow-anchor:auto}@media(max-width:820px){.dl-chat-shell{height:calc(100dvh - 165px);min-height:520px}}

/* Final structural layer: keep actions inside rows and activity headers in flow. */
#math-sidebar,#module-sidebar{display:flex;flex:1;flex-direction:column;min-height:0}#math-sidebar[hidden],#module-sidebar[hidden]{display:none!important}#sessions,.module-menu{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable}
.session-row{position:relative;display:block;padding-left:30px;margin-bottom:4px}.session-row .session-button{width:100%;min-width:0;margin:0}.session-actions{position:absolute;left:2px;top:7px;display:flex;flex-direction:column;gap:2px}.session-actions button{width:26px;height:26px;min-height:0;padding:0}
.activity-view-toolbar{position:relative;top:auto;margin:0 0 20px}.activity-view-toolbar>div{min-width:0}.activity-view-toolbar strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:820px){.session-actions{flex-direction:row;top:5px}.activity-view-toolbar{align-items:stretch}.activity-view-toolbar strong{white-space:normal}}

/* Unified, single-viewport conversation workspace. */
body[data-module="math"],body[data-module="lab"]{height:100dvh;overflow:hidden}
body[data-module="math"] .app-shell,body[data-module="lab"] .app-shell,
body[data-module="math"] .main-shell,body[data-module="lab"] .main-shell{height:100dvh;min-height:0;overflow:hidden}
body[data-module="math"] #main,body[data-module="lab"] #main{min-height:0;overflow:hidden}
.header-actions,.profile-menu-wrap{height:100%;display:flex;align-items:center}.header-account,.profile-menu-toggle{margin-block:0;align-self:center}
.session-row,.dl-conversation-row{position:relative;display:block;padding-left:31px;margin:0 0 4px}.session-row .trash-button,.dl-conversation-row .dl-delete-chat{position:absolute;left:2px;top:50%;transform:translateY(-50%);width:27px;height:27px;padding:0;display:grid;place-items:center}.session-row .module-menu-item,.dl-conversation-row .module-menu-item{width:100%;min-width:0;margin:0}.session-empty,.dl-sidebar-empty{padding:18px 10px;text-align:center;color:#7e8b83;font-size:10px}.session-empty strong,.session-empty span{display:block}
body[data-module="math"] #main{display:flex;flex-direction:column;padding:12px 30px 0}
body[data-module="math"] #welcome{flex:0 0 auto;width:min(900px,100%);padding:5px 0 9px}
body[data-module="math"] #welcome .welcome-badge{margin-bottom:2px;padding:3px 9px}.welcome .eyebrow{font-size:10px}
body[data-module="math"] #welcome h1{font-size:29px;line-height:1.45;margin:4px 0 7px}
body[data-module="math"] #welcome .welcome-description{font-size:11px;line-height:1.8}
body[data-module="math"] .starter-grid{gap:10px;margin-top:11px}
body[data-module="math"] .starter{min-height:104px;padding:12px 14px;gap:4px}
body[data-module="math"] .starter-icon{width:30px;height:30px;margin:0;font-size:18px}
body[data-module="math"] .starter strong{font-size:10px;line-height:1.85}
body[data-module="math"] #chat-view{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:8px 7px 20px;scrollbar-gutter:stable}
body[data-module="math"] .composer-wrap{position:relative;flex:0 0 auto;padding:7px 30px 9px;background:#fbfcfa}
body[data-module="math"] .composer{padding:8px 13px 7px;border-radius:16px}
body[data-module="math"] .composer textarea{min-height:42px;max-height:96px;resize:none}
body[data-module="math"] .composer-heading{margin-bottom:0}body[data-module="math"] .composer-footnote{display:none}
body[data-module="math"].activity-open #main{overflow-y:auto;padding-bottom:28px}
body[data-module="lab"] #main{display:flex;padding:12px 20px 14px}
body[data-module="lab"] #module-home{width:100%;height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:9px;overflow:hidden;padding:0}
body[data-module="lab"] #module-home[hidden]{display:none!important}
body[data-module="lab"] .dl-hero{display:block;min-height:0;padding:11px 18px 12px;border-radius:18px;box-shadow:0 9px 25px rgba(27,76,88,.12)}
body[data-module="lab"] .dl-hero h1{font-size:20px;line-height:1.45;margin:1px 0 2px}
body[data-module="lab"] .dl-hero p{font-size:10px;line-height:1.7;margin:0}
body[data-module="lab"] .dl-kicker{font-size:8px}
body[data-module="lab"] .dl-starters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:7px}
body[data-module="lab"] .dl-starters button{min-height:34px;padding:5px 8px;border-radius:9px;font-size:8px;line-height:1.7;text-align:right}
body[data-module="lab"] .dl-chat-shell{height:auto;min-height:0;margin:0;border-radius:18px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
body[data-module="lab"] .dl-chat-shell>header{min-height:48px!important;padding:7px 13px}
body[data-module="lab"] .dl-chat-shell>header button{min-height:32px;font-size:9px;padding:5px 9px}
body[data-module="lab"] .dl-bot-dot{width:30px;height:30px}.dl-chat-shell header strong{font-size:11px}.dl-chat-shell header small{font-size:8px}
body[data-module="lab"] .dl-chat-log{min-height:0;max-height:none;padding:12px 17px;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable}
body[data-module="lab"] #dl-chat{padding:8px 14px 7px}
body[data-module="lab"] #dl-chat label{font-size:9px;margin-bottom:2px}.dl-composer-heading{margin-bottom:2px}
body[data-module="lab"] #dl-chat textarea{min-height:40px;max-height:78px;resize:none;padding:7px 9px;font-size:11px}
body[data-module="lab"] #dl-chat small{margin-top:2px;font-size:8px}
body[data-module="lab"] #module-home.dl-chat-focused{height:100%;overflow:hidden;grid-template-rows:minmax(0,1fr)}
body[data-module="lab"] #module-home.dl-chat-focused .dl-hero{display:none}
body[data-module="lab"] #module-home.dl-chat-focused .dl-chat-shell{height:auto;margin:0}
body[data-module="lab"] #module-home.dl-detail-open{display:block;overflow-y:auto;padding-bottom:24px}
@media(max-width:820px){
 .module-rail{overflow:hidden;gap:0}.module-rail-items{display:contents;min-width:0}.module-switch,.rail-help{flex:1 1 0;width:auto;min-width:0;margin:0;min-height:54px;padding-inline:1px}.rail-help{margin:0}.module-switch small{font-size:7px;white-space:nowrap}.module-switch.active:after{right:calc(50% - 14px)}
 body[data-module="math"] #main{padding:8px 12px 0}body[data-module="math"] #welcome h1{font-size:24px}.starter-grid{grid-template-columns:1fr!important}.starter:nth-child(n+3){display:none}body[data-module="math"] .starter{min-height:70px;display:grid;grid-template-columns:30px 1fr}.composer-wrap{padding-inline:12px!important}
 body[data-module="lab"] #main{padding:8px 10px 9px}body[data-module="lab"] .dl-starters{grid-template-columns:1fr}body[data-module="lab"] .dl-starters button:nth-child(n+3){display:none}body[data-module="lab"] .dl-hero{padding:10px 13px}body[data-module="lab"] .dl-hero h1{font-size:17px}body[data-module="lab"] .dl-chat-shell{min-height:0;height:auto}
}

/* 1.25: readable lists, balanced recommendations and a roomier lab chat. */
.session-row .module-menu-item,.dl-conversation-row .module-menu-item{background:transparent!important;border:0!important;box-shadow:none!important}
.session-row .module-menu-item:hover,.dl-conversation-row .module-menu-item:hover{background:#eaf0e9!important}
.session-row .module-menu-item.active,.dl-conversation-row .module-menu-item.active{background:#dfeadf!important;box-shadow:inset 0 0 0 1px #cfddcf!important}
.session-button{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
.session-row .module-menu-item>span:last-child,.dl-conversation-row .module-menu-item>span:last-child{min-width:0}
.session-row .module-menu-item strong,.dl-conversation-row .module-menu-item strong{display:-webkit-box!important;overflow:hidden!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal!important;text-overflow:clip!important;line-height:1.75;max-height:3.5em}
.session-row .module-menu-item small,.dl-conversation-row .module-menu-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.candidate-section{width:100%;margin:12px auto 28px}.candidate-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 2px 13px}.candidate-heading>div{display:flex;flex-direction:column}.candidate-heading span,.candidate-heading small{font-size:10px;color:#77877e}.candidate-heading h2{font-size:19px;line-height:1.6}
.candidate-section .result-grid{gap:13px;align-items:stretch;margin:0}.candidate-section .activity-card{display:flex;min-height:0;overflow:hidden;border-color:#d6e3d8;border-radius:18px;background:#fff;box-shadow:0 10px 28px rgba(31,70,57,.055)}
.candidate-section .card-accent{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 16px;background:#eef5ee;border-bottom:1px solid #dae6db;color:#36634d}
.candidate-section .card-accent span{font-size:10px;font-weight:800}.candidate-section .card-accent small{font-size:9px;color:#6d7f74}
.candidate-section .collection-card .card-accent{background:#e5f0e6;border-bottom-color:#cbdccb}.candidate-section .collection-card .card-body{border-top:0}
.candidate-section .card-body{padding:15px 16px 16px;gap:0}.candidate-section .content-kind{margin:0 0 7px}.candidate-section .card-body h3{font-size:17px;line-height:1.75;margin:0 0 9px;color:#173f34}
.candidate-section .card-meta{display:grid;gap:5px;margin-bottom:11px;padding:9px 11px;border-radius:11px;background:#f7f9f6}.candidate-section .card-meta span{display:grid;grid-template-columns:66px minmax(0,1fr);gap:6px;font-size:10px;line-height:1.8;color:#53685d}.candidate-section .card-meta b{font-size:9px;color:#7b8a82}
.candidate-section .expandable-block p{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:4;margin:0;color:#52675b;font-size:11px;line-height:1.95}.candidate-section .expandable-block.expanded p{-webkit-line-clamp:unset;display:block}.candidate-section .card-expand{display:flex;align-items:center;gap:5px;margin-top:4px;padding:3px 0;color:#28674e;font-size:10px;font-weight:700}.candidate-section .card-expand b{font-size:12px}
.candidate-section .match-reason{margin:10px 0 8px;padding:10px 11px}.candidate-section .match-reason>strong{display:block;margin-bottom:3px;font-size:10px}.candidate-section .match-reason .expandable-block p{-webkit-line-clamp:3;color:#365f45!important}
.candidate-section .match-differences{margin:3px 0 9px;padding:8px 10px}.candidate-section .card-footer{display:flex;flex-direction:column;gap:7px;margin-top:auto;padding-top:11px;border-top:1px solid #e3eae3}.candidate-section .card-footer>span{font-size:10px;color:#687a70}.candidate-section .card-footer .primary{width:100%;min-height:42px;font-weight:800}
body[data-module="lab"] .dl-hero{padding:14px 20px 15px}body[data-module="lab"] .dl-hero h1{font-size:24px;line-height:1.5;margin:2px 0 3px}body[data-module="lab"] .dl-hero p{font-size:12px;line-height:1.8}body[data-module="lab"] .dl-kicker{font-size:9px}
body[data-module="lab"] .dl-starters{gap:8px;margin-top:9px}body[data-module="lab"] .dl-starters button{min-height:42px;padding:7px 10px;font-size:10px;line-height:1.75}
body[data-module="lab"] .dl-chat-shell>header{min-height:58px!important;padding:9px 16px}body[data-module="lab"] .dl-chat-shell>header button{min-height:38px;font-size:11px;padding:7px 11px}body[data-module="lab"] .dl-bot-dot{width:34px;height:34px}.dl-chat-shell header strong{font-size:13px}.dl-chat-shell header small{font-size:9px}
body[data-module="lab"] .dl-chat-log{padding:17px 20px;gap:16px}body[data-module="lab"] .dl-message>span{font-size:10px}body[data-module="lab"] .dl-bubble{padding:14px 17px}body[data-module="lab"] .dl-bubble>p{font-size:14px;line-height:2}
body[data-module="lab"] #dl-chat{padding:11px 16px 9px}body[data-module="lab"] #dl-chat label{font-size:11px;margin-bottom:4px}body[data-module="lab"] #dl-chat textarea{min-height:47px;max-height:94px;padding:9px 11px;font-size:14px}body[data-module="lab"] #dl-chat small{margin-top:3px;font-size:9px}body[data-module="lab"] #dl-chat .primary{min-width:88px;min-height:43px;font-size:12px}
@media(max-width:820px){.candidate-heading{align-items:flex-start;flex-direction:column;gap:2px}.candidate-section .card-meta span{grid-template-columns:58px minmax(0,1fr)}body[data-module="lab"] .dl-hero h1{font-size:20px}body[data-module="lab"] .dl-hero p{font-size:11px}body[data-module="lab"] .dl-starters button{font-size:9px}}

/* Collection section headers keep labels, time and titles in separate rows. */
.collection-component>header{display:flow-root;width:100%;height:auto;min-height:0;min-width:0;margin:0 0 18px;padding:0 0 14px;border-bottom:1px solid #e2ebe1;background:transparent;position:static;z-index:auto;overflow:visible;backdrop-filter:none}.collection-component-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.collection-component-meta>span{display:inline-flex;align-items:center;min-height:30px;padding:4px 11px;border-radius:999px;background:#e9f3e8;color:#2d6c50;font-size:11px;font-weight:700;white-space:nowrap}.collection-component-meta>small{display:inline-flex;align-items:baseline;gap:4px;flex:0 0 auto;padding:4px 9px;border-radius:999px;background:#f5f7f4;color:#65776d;font-size:10px;white-space:nowrap}.collection-component-meta>small b{font-size:12px;color:#294f3d}.collection-component>header>h3{display:block;width:100%;max-width:none;margin:12px 0 7px;font-size:20px;line-height:1.75;overflow:visible;white-space:normal;word-break:normal}.collection-component>header>p{width:100%;line-height:2}.collection-closing .collection-component-meta>span{background:#f1eee2;color:#746442}.collection-intro strong{line-height:1.8}.collection-intro span{line-height:1.8}
@media(max-width:620px){.collection-component{padding:17px}.collection-component-meta{align-items:flex-start}.collection-component>header>h3{font-size:18px}.collection-intro{align-items:flex-start;flex-direction:column}}
