/* Action-first report and progressive story workspace. */
.journal-cover{background:#21334f;color:#fffdf5;border:0;border-radius:24px;padding:32px}
.journal-cover h2{font-family:inherit;font-weight:700;font-size:clamp(26px,3vw,38px);line-height:1.35;max-width:680px;overflow-wrap:anywhere}
.journal-cover small,.journal-cover p{color:#d2dbe8}.journal-seal{border-color:#8b9eba;transform:none}
.journal-actions{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin-top:24px}
.journal-primary{background:#f0d59a;color:#26364d;border:0;border-radius:12px;padding:15px 22px;font-family:inherit;font-size:16px;font-weight:600;cursor:pointer;min-height:48px}
.journal-review-link{background:transparent;border:0;color:#fffdf5;padding:12px;cursor:pointer;text-decoration:underline;text-underline-offset:5px}
.journal-focus{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;margin:24px 0 30px}
.journal-focus>div{padding:8px 22px;border-left:4px solid #c59d57}.journal-focus>div+div{border-color:#8fa1bc}
.journal-focus small{color:#53698b}.journal-focus h3{margin:6px 0;font-size:21px}.journal-focus p{font-size:14px;margin:0;color:#506584}
.journal-task-body{padding-bottom:12px}.journal-task-fold{background:#fffdf7;border:1px solid #d4dce9;border-radius:16px;padding:0 22px;scroll-margin-top:24px}
.journal-task-fold>summary{display:flex;gap:16px;align-items:center;cursor:pointer;padding:20px 0;list-style:none}
.journal-task-fold>summary::-webkit-details-marker{display:none}.journal-task-fold>summary>div{flex:1;min-width:0}
.journal-task-fold h2{font-size:18px}.journal-open-label{font-size:12px;color:#4b5f7c;white-space:nowrap}
.journal-task-fold[open]{padding-bottom:22px}.journal-task-fold[open]>summary{border-bottom:1px solid #d5ddea}
.journal-path button{background:#2b3b54;color:white;text-decoration:none;border-radius:10px;padding:12px 16px}
.journal-findings p{max-height:110px;overflow:auto}.journal-boundary{font-size:12px}
.story-stages{display:flex;gap:8px;padding:18px 28px;background:#f8f7f0;border-bottom:1px solid #dedfd3}
.story-stages button{flex:1;display:flex;align-items:center;justify-content:center;gap:12px;min-height:52px;border:1px solid #cfd7e2;border-radius:12px;background:transparent;color:#4d6180}
.story-stages button[aria-pressed="true"]{background:#24354f;color:#fff;border-color:#24354f;box-shadow:0 5px 14px #24354f18}
.story-stages button span{font-weight:600}.story-clue-count{font-size:11px}
.story-room .story-layout{display:block;min-height:0;max-width:880px;margin:auto}
.story-room [hidden]{display:none!important}
.story-room .story-notebook{border:0;background:transparent;padding:28px 42px}
.story-heading h1{font-size:clamp(28px,3vw,38px);margin:8px 0}.story-heading h1 br{display:none}
.story-person{margin:18px 0 12px}.story-messages{max-height:260px;min-height:0}
.story-conversation{display:flex;flex-direction:column;padding-top:24px}
.story-heading{order:0}.story-person{order:1}.story-messages{order:2}.story-guide{order:3}.story-prompts{order:4}.story-ask{order:5}.story-notebook-jump{order:6}.story-hint{order:7}.story-whisper{order:8}
.story-guide{margin-top:14px}.story-guide small{display:block;color:#96753c;font-size:11px}.story-guide b{display:block;margin-top:5px;font-size:17px}.story-guide p{font-size:12px;color:#516787;margin:5px 0}
.story-prompts{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.story-prompts button{border-radius:12px;background:#dde4ee;border-color:#b1bdd0;color:#28374e;padding:16px;font-size:14px;min-height:56px;box-shadow:0 3px 0 #c8d1de}
.story-prompts button:hover{background:#ced7e6;transform:translateY(-2px)}
.story-ask{border:1px solid #c1cbda;border-radius:14px;background:#fffdf8;padding:10px;margin-top:8px}
.story-room textarea{font-size:16px!important}.story-notebook-jump{background:#24354f;color:#fff;padding:14px 20px;border-radius:12px;text-decoration:none;margin-top:16px;align-self:flex-start}
.story-letter{margin-top:0;border-top:0;padding-top:0}.story-letter h2{font-size:30px;font-weight:700}
.story-next{background:#24354f;color:white;border:0;padding:15px 20px;border-radius:12px;font-size:15px}
.notebook-empty{padding:22px 10px}.story-review{font-size:15px;padding:16px 24px}.evidence-slip{border-radius:10px}
.journal-primary:focus-visible,.journal-review-link:focus-visible,.journal-task-fold>summary:focus-visible{outline:3px solid #c59d57;outline-offset:4px}
@media(max-width:600px){.journal-cover{padding:24px}.journal-seal{display:none}.journal-focus{grid-template-columns:1fr;gap:16px}.journal-task{grid-template-columns:1fr}.journal-task-rail{display:none}.journal-task-fold{padding:0 16px}.journal-task-fold>summary{flex-wrap:wrap;gap:8px}.journal-task-fold>summary>div{flex-basis:100%}.journal-open-label{margin-left:auto}.story-stages{padding:12px;gap:6px}.story-stages button{gap:5px;font-size:12px}.story-stages small{font-size:10px}.story-conversation,.story-room .story-notebook{padding:22px}.story-prompts{grid-template-columns:1fr}.story-person i{display:none}.journal-actions{align-items:stretch;flex-direction:column}}
@media(prefers-reduced-motion:no-preference){.story-prompts button,.story-stages button{transition:background .18s,transform .18s}.story-letter,.story-evidence{animation:letter-arrive .25s ease}}

/* Shared forms: readable feedback, reachable controls and keyboard navigation. */
body.modal-open{overflow:hidden}
.cm-modal-card{overscroll-behavior:contain;max-height:calc(100dvh - 32px);padding-top:56px}
.cm-modal-close{width:44px;height:44px;cursor:pointer}
#modal .auth-error{padding:12px 14px;border:1px solid #e5b4a7;border-radius:12px;background:#fff3ef;color:#913c28;font-size:14px;line-height:1.6;text-align:left}
#modal .field label{font-size:13px}
#modal .field input,#modal .field textarea{font-size:16px;min-height:44px}
#modal button{min-height:44px}
button:focus-visible,a:focus-visible{outline:3px solid #247a92;outline-offset:3px}
.cm-toast{max-width:calc(100vw - 32px);width:max-content;white-space:normal;text-align:center;line-height:1.6}
@media(prefers-reduced-motion:reduce){.auth-spinner{animation:none}}

/* Teacher workspace: one purpose per route, with a shared class context. */
.teacher-workspace{display:grid;grid-template-columns:190px minmax(0,1fr);gap:28px;align-items:start}
.teacher-sidebar{position:sticky;top:90px;padding:20px 14px;background:#fff;border:1px solid var(--line);border-radius:20px}
.teacher-sidebar>small{display:block;margin:0 12px 16px;color:var(--muted)}
.teacher-sidebar nav{display:grid;gap:6px}
.teacher-sidebar nav a{display:block;padding:14px 16px;border-radius:12px;text-decoration:none;color:var(--ink);font-size:14px;font-weight:600}
.teacher-sidebar nav a:hover{background:#eff2f7}
.teacher-sidebar nav a[aria-current=page]{background:#243a5b;color:white}
.teacher-sidebar-footer{border-top:1px solid var(--line);margin-top:24px;padding-top:12px}
.teacher-content{min-width:0}
.teacher-context{display:flex;gap:14px;align-items:center;justify-content:flex-end;margin-bottom:20px;font-size:13px;color:var(--muted)}
.teacher-context select{max-width:75%;min-height:44px;border:1px solid var(--line);border-radius:12px;padding:10px 14px;background:white;color:var(--ink);font:inherit}
.teacher-page[hidden]{display:none!important}
.teacher-page>.panel,.teacher-page>.agent-console,.teacher-page>#aiInsight{margin-bottom:20px}
.teacher-page .kpis{margin-top:0}
.teacher-next{padding:28px!important}
.teacher-next h2{font-size:24px;margin:12px 0}
.teacher-next p{color:var(--muted);line-height:1.8}
.teacher-next>div{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
.teacher-next a{display:inline-flex;text-decoration:none;align-items:center;min-height:44px;padding:12px 18px;border-radius:12px}
#teacher-tasks .panel-head{gap:12px;flex-wrap:wrap}
#teacher-tasks .panel-head .primary{margin-left:auto}
#teacher-insights>#aiInsight{min-height:44px;padding:12px 18px;border-radius:12px;border:1px solid var(--line);background:#243a5b;color:#fff}
@media(max-width:760px){.teacher-workspace{grid-template-columns:1fr;gap:16px}.teacher-sidebar{position:static;padding:8px}.teacher-sidebar>small,.teacher-sidebar-footer{display:none}.teacher-sidebar nav{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.teacher-sidebar nav a{padding:13px 2px;text-align:center;font-size:12px}.teacher-context{justify-content:space-between}.teacher-page .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.teacher-next{padding:20px!important}}

@media(max-width:760px){.teacher-sidebar-footer{display:block;margin-top:8px;padding-top:4px;text-align:right}.teacher-sidebar-footer .text-btn{min-height:36px;margin:0}}

.teacher-class-switcher{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 16px;margin-bottom:8px;scrollbar-width:thin}
.teacher-class-switcher button{display:flex;align-items:center;gap:10px;flex:none;padding:12px 16px;background:#fff;border:1px solid #d6deea;border-radius:16px;color:#25344b;cursor:pointer;min-height:58px}
.teacher-class-switcher button>span{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:#e9edf4}
.teacher-class-switcher button>b{font-size:14px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.teacher-class-switcher button>small{color:#5a7297}
.teacher-class-switcher button[aria-pressed=true]{border-color:#274066;background:#edf0f5;box-shadow:0 0 0 1px #274066}
.teacher-refresh{border:0;background:transparent;color:#274066;min-height:44px;cursor:pointer;font:inherit}
.teacher-loading{padding:36px 24px;color:#283b57}.teacher-loading p{color:#5c7499}.teacher-loading>div{height:120px;margin-top:20px;border-radius:20px;background:#e9edf3}
.teaching-brief{padding:0!important;border:0!important;background:transparent!important}
.teaching-brief .insight-hero{display:flex;align-items:center;justify-content:space-between;gap:28px;padding:32px;border-radius:24px;background:#23344e;color:#fff}
.teaching-brief .insight-hero small,.teaching-brief .insight-hero p{color:#d2dbe8}.teaching-brief .insight-hero h2{color:white;font-size:26px;line-height:1.45;margin:12px 0}.teaching-brief .insight-hero p{max-width:650px;line-height:1.8}
.insight-hero-number{min-width:120px;text-align:center}.insight-hero-number b{display:block;font-size:48px;font-weight:600;color:#e5edbc}.insight-hero-number span{font-size:12px;color:#d2dbe8}
.insight-summary-strip{display:grid;grid-template-columns:repeat(3,1fr);background:white;border:1px solid #d9e0eb;border-radius:18px;margin:18px 0 28px;padding:20px 8px}.insight-summary-strip>div{text-align:center;border-right:1px solid #dce3ed}.insight-summary-strip>div:last-child{border:0}.insight-summary-strip small{display:block;color:#5e779d;font-size:12px}.insight-summary-strip b{display:block;font-size:28px;margin-top:8px;color:#24354e}.insight-summary-strip em{font-size:12px;font-style:normal;font-weight:400}
.insight-section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.insight-section-heading h3{margin:0;font-size:18px}.insight-section-heading span{font-size:12px;color:#5e789e}
.priority-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.teaching-brief .priority-question{padding:22px;background:#fff;border:1px solid #d9e0eb;border-radius:18px;margin:0;display:block}.priority-question>div{min-width:0}.priority-meta{display:flex;flex-direction:column;gap:10px}.priority-meta>span{font-size:12px;font-weight:700;color:#9b6533}.priority-meta small{font-size:11px;color:#617aa0}.teaching-brief .priority-question h3{font-size:20px;margin:16px 0 10px}.priority-question p{font-size:13px;line-height:1.8;overflow-wrap:anywhere}.priority-numbers{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#8c6a45;margin:10px 0 18px;flex-wrap:wrap}.mistake-meter{height:6px;background:#f3eee4;border-radius:10px;margin-top:20px;overflow:hidden}.mistake-meter i{display:block;height:100%;background:#c59a61;border-radius:10px}.priority-question details{font-size:12px;line-height:1.8;margin-bottom:16px}.priority-question button{width:100%;min-height:44px;font-size:12px!important}.insight-more,.teacher-secondary-data{border:1px solid #d9e0eb;background:#fff;border-radius:16px;padding:18px;margin:18px 0}.insight-more summary,.teacher-secondary-data summary{cursor:pointer;font-size:14px;font-weight:600;min-height:24px}.teacher-secondary-data>.panel{margin-top:18px}.insight-footnote{font-size:12px;color:#627ba1;line-height:1.8}.insight-empty{padding:28px;border:1px dashed #c4cedc;border-radius:18px;color:#597194;line-height:1.8}
@media(max-width:1050px){.priority-grid{grid-template-columns:1fr}.teaching-brief .priority-question{padding:22px}}
@media(max-width:760px){.teaching-brief .insight-hero{padding:24px;align-items:flex-start;flex-direction:column;gap:12px}.teaching-brief .insight-hero h2{font-size:23px}.insight-hero-number{text-align:left;display:flex;align-items:baseline;gap:14px}.insight-hero-number b{font-size:38px}.insight-section-heading{align-items:flex-start;flex-direction:column}.teacher-context{gap:8px}.teacher-context select{max-width:50%}.teacher-class-switcher button{padding:10px 12px}}

/* Compact teacher header and consistently aligned comparison cards. */
body:not(.student-mode) #view{padding-top:18px}
body:not(.student-mode) .dash-head{display:flex;align-items:center;gap:20px;margin-bottom:18px;flex-wrap:wrap}
body:not(.student-mode) .dash-head h1{font-size:26px;margin:4px 0 0}
body:not(.student-mode) .dash-head .dash-actions{margin-left:auto}
.dash-head .teacher-context{margin:0}
.teacher-sidebar{top:88px}.teacher-sidebar nav a{padding:12px 16px}.teacher-workspace{gap:20px}
.teacher-class-switcher{padding-bottom:8px;margin-bottom:10px}
.teacher-class-switcher[hidden]{display:none}
#teacher-classes .class-item{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid var(--line)}
#teacher-classes .class-row{width:100%;margin:0;padding:12px;border:0}
#teacher-classes .class-invite{display:flex;align-items:center;gap:18px;padding:0;border:0;margin:0}
.delete-class{background:none;border:1px solid #e7cfca;color:#964b3b;padding:10px 12px;border-radius:10px;min-height:44px;cursor:pointer;font:inherit;font-size:12px}
.priority-grid{align-items:stretch;grid-template-columns:repeat(3,minmax(0,1fr))}
.priority-grid .priority-question{display:grid;grid-template-rows:subgrid;grid-row:span 7}
.priority-grid .priority-question>div{display:contents}
.priority-grid .priority-question .priority-meta,.priority-grid .priority-question h3,.priority-grid .priority-question>div>p,.priority-grid .mistake-meter,.priority-grid .priority-numbers,.priority-grid .priority-question details,.priority-grid .priority-question button{margin-top:0;margin-bottom:0}
.priority-grid .priority-question h3{line-height:1.5}.priority-grid{row-gap:18px}
.priority-grid .priority-question button{align-self:end}
.news-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:20px}.news-page-head h2{margin:8px 0;font-size:24px}.news-page-head p,.news-page-head>span{font-size:13px;color:#576e90;line-height:1.7}.law-news-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.law-news-card{display:flex;flex-direction:column;padding:24px;background:white;border:1px solid #d7dfea;border-radius:20px;min-width:0}.news-meta{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:#5b7397}.news-meta>span{color:#2c4263}.law-news-card h3{font-size:21px;line-height:1.5;margin:18px 0 12px}.law-news-card p{font-size:14px;line-height:1.8}.news-question{padding:16px;background:#e9edf3;border-radius:12px;margin:12px 0}.news-question small{display:block;color:#576e91;margin-bottom:8px}.news-question b{font-size:14px;line-height:1.8;font-weight:500}.law-news-card .news-event{font-size:12px;color:#5c759a}.law-news-card footer{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:auto;padding-top:18px;flex-wrap:wrap}.law-news-card footer a{font-size:12px;color:#304666}.law-news-card button{min-height:44px}.news-feedback{font-size:14px;color:#324766}.student-class-news{margin-top:28px}.news-empty,.news-sender{color:#5a7295}.news-sender{font-size:12px}
@media(max-width:1050px){.priority-grid{grid-template-columns:1fr}.priority-grid .priority-question{grid-row:auto;display:block}.priority-grid .priority-question>div{display:flex;flex-direction:column;gap:14px}#teacher-classes .class-item{grid-template-columns:1fr auto}#teacher-classes .class-row{grid-column:1/-1}}
@media(max-width:760px){body:not(.student-mode) .dash-head{gap:12px;margin-bottom:14px}.dash-head .teacher-context{width:100%;justify-content:space-between}.teacher-workspace{gap:12px}.teacher-sidebar nav{grid-template-columns:repeat(5,minmax(0,1fr))}.teacher-sidebar nav a{padding:12px 1px;font-size:11px}.law-news-grid{grid-template-columns:1fr}.news-page-head{flex-direction:column;gap:0}.law-news-card{padding:20px}#teacher-classes .class-invite{gap:8px}#teacher-classes .class-invite code{font-size:14px}.teacher-class-switcher button{min-height:48px}.teacher-context select{font-size:14px}.priority-grid{row-gap:14px}}

.ability-radar{max-width:700px;margin:auto;text-align:center}.ability-radar svg{display:block;width:min(100%,460px);height:auto;margin:auto;overflow:visible}.radar-grid{fill:none;stroke:#d3dce9;stroke-width:1}.radar-axis{stroke:#d3dce9;stroke-width:1}.radar-tick{fill:#7087a9;font-size:10px}.radar-label{fill:#324259;font-size:13px;font-weight:600}.radar-area{fill:#4c679033;stroke:#2c4975;stroke-width:2.5;stroke-linejoin:round}.radar-point{fill:#243e64;stroke:#fff;stroke-width:1.5}.radar-values{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.radar-values>div{padding:12px 4px;background:#edf1f6;border-radius:12px}.radar-values span{display:block;color:#556c8e;font-size:12px}.radar-values b{display:block;margin-top:8px;font-size:22px;color:#283b57}.ability-radar>p{font-size:12px;color:#627ba0;line-height:1.7}@media(max-width:480px){.radar-values{gap:4px}.radar-values span{font-size:10px}.radar-values b{font-size:18px}}

.class-management-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.member-row{display:flex;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid #dbe2ec}.member-row small{display:block;color:#526889;margin-top:5px}.lesson-plan h2{font-size:23px}.lesson-evidence{padding:12px;background:#e9edf3;border-radius:10px}.lesson-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}.lesson-steps article{border:1px solid #dbe2ec;padding:16px;border-radius:12px}.lesson-steps p{margin-bottom:0;line-height:1.7}@media(max-width:760px){.class-management-actions{grid-column:1/-1}.lesson-steps{grid-template-columns:1fr}.member-row{font-size:14px}}

.news-filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;margin:18px 0}.news-filters label{display:grid;gap:7px;color:#475a77;font-size:14px}.news-filters input,.news-filters select{width:100%;min-width:0;padding:12px;border:1px solid #d6deea;border-radius:10px;background:#fff;color:#18273d}.news-count{color:#516787}.news-more{display:block;margin:24px auto}.news-more[hidden]{display:none}.news-page-head>button{flex-shrink:0;align-self:flex-start}@media(max-width:640px){.news-filters{grid-template-columns:1fr 1fr}.news-filters label:first-child{grid-column:1/-1}.news-page-head{align-items:flex-start;gap:12px}}
