/* Shared alignment pass. Keep each page's existing palette and artwork. */
:root{--miho-control:42px;--miho-gap:16px}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html,body{min-width:320px}
body :is(.product-main,.product-content,.topbar-primary,.top-actions-new,.global-search){min-width:0}
body .product-content{padding-top:24px!important;padding-bottom:40px!important}
body :is(.product-content,.miho-course) :is(h1,h2,h3,p){overflow-wrap:anywhere}
body :is(.product-content,.miho-course) :is(button,.btn,select,input){max-width:100%}
body :is(.btn,.category-trigger,.top-icon){display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--miho-control);line-height:1.35;vertical-align:middle;white-space:normal;text-align:center}
body :is(.btn,.category-trigger) .ui-icon{flex:none}
body .btn:disabled{cursor:wait;opacity:.6}
body :is(.page-head,.admin-page-head,.reference-class-head,.teacher-homework-head,.course-panel>header,.lx-panel>header){gap:16px;flex-wrap:wrap;align-items:center}
body :is(.page-head,.admin-page-head,.reference-class-head)>div{min-width:0;flex:1 1 260px}
body :is(.page-head,.admin-page-head,.reference-class-head) :is(h1,h2,p){margin-top:0}
body :is(.row-actions,.filter-row,.filter-tabs,.course-toolbar,.course-tabs,.lx-tabs,.settings-tabs,.teacher-homework-tabs){display:flex;flex-wrap:wrap;gap:10px;align-items:center}
body :is(.teacher-ref-grid,.admin-ref-grid,.hw-layout,.lx-grid,.insights-grid,.ach-layout,.assign-layout)>*{min-width:0}
body :is(.product-content,.miho-course) :is(textarea,input:not([type=checkbox]):not([type=radio]),select){min-height:var(--miho-control);font:inherit}
body textarea{resize:vertical}
body dialog{max-height:calc(100dvh - 32px);max-width:min(760px,calc(100vw - 32px));overflow:auto;margin:auto}
body dialog :is(.work-form,.modal-body){min-width:0}
body :is(.form-actions,.row-actions){gap:12px}
body :is(.reference-table-row,.reference-table-head,.entity-table article,.admin-performance-table>article){align-items:center}
body :is(.reference-table-head,.reference-table-row){grid-template-columns:30px minmax(190px,1.3fr) 105px minmax(150px,1fr) 135px 130px}
body :is(button,a,input,select,textarea):focus-visible{outline:2px solid #67d6ff;outline-offset:3px}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media(min-width:1001px){body .product-top{gap:20px!important}body .topbar-primary{flex:1 1 auto;gap:16px!important}body .global-search{width:auto!important;flex:1 1 240px;max-width:520px}body .top-actions-new{flex:0 0 auto;gap:12px!important}body .top-profile{max-width:260px}}
@media(max-width:1000px){body .product-top{display:flex!important;flex-wrap:wrap!important;height:auto!important;min-height:76px;padding:12px 16px!important;gap:12px!important}body .topbar-primary{display:flex;align-items:center;flex:1 1 440px;gap:12px!important}body .global-search{flex:1 1 160px;width:auto!important;max-width:none!important}body .top-actions-new{display:flex;align-items:center;gap:10px!important;margin-left:auto}body .product-content{padding:20px 16px 32px!important}body :is(.teacher-ref-grid,.teacher-main-grid,.admin-ref-grid,.hw-layout,.lx-profile-grid,.lx-settings-grid,.lx-group-grid){grid-template-columns:minmax(0,1fr)!important}body :is(.page-head,.admin-page-head){margin-bottom:20px}}
@media(max-width:600px){body .topbar-primary{flex-wrap:wrap;gap:10px!important}body .header-brand{flex:1 1 auto}body .global-search{flex-basis:100%;order:3}body .top-actions-new{width:100%;justify-content:flex-end!important;margin:0!important}body .top-profile>span:not(.top-avatar){display:none!important}body :is(.page-head,.admin-page-head,.reference-class-head)>.btn{width:100%}body :is(.student-home-shell .lx-page,.student-home-shell .insights-page){width:100%}body :is(.course-grid,.metric-grid,.stats-grid,.reference-class-metrics,.teacher-ref-metrics,.admin-page-metrics){grid-template-columns:minmax(0,1fr)!important}body :is(.lx-panel>header,.course-panel>header){align-items:flex-start}body :is(.btn,.category-trigger){font-size:13px!important}body :is(.product-content h1,.miho-course h1){font-size:clamp(26px,7vw,34px)!important}body :is(.hw-board,.entity-table,.reference-class-table,.admin-performance-table){max-width:100%;overflow:auto}}

body .mh-workspace .btn{min-height:44px!important;padding:11px 18px!important;font:600 13px/1.4 Manrope,system-ui,sans-serif!important}
body .admin-ref-hero{overflow:hidden;min-width:0;max-width:100%}
body :is(.admin-ref-metrics,.admin-ref-grid,.admin-ref-bottom)>*{min-width:0;max-width:100%}
body .category-trigger .ui-icon{display:inline-flex!important;width:18px!important;height:18px!important}
body .neon-path-track>a{min-width:0}
body .neon-path-track>a>b{position:static!important;display:block;margin-top:8px}
body .neon-path-flow>a{min-width:0}
body .neon-path-flow>a>b{position:static!important;display:block;margin-top:8px}
@media(max-width:600px){body .admin-ref-classes>a{grid-template-columns:32px minmax(0,1fr) 60px 28px 12px!important;gap:8px!important;min-width:0;max-width:100%}body .admin-ref-classes>a>*{min-width:0}body .admin-ref-classes progress{width:100%!important}}
@media(max-width:600px){body .admin-ref-hero>img{max-width:100%;right:0!important}body .category-trigger{min-width:44px!important}body .student-companion:not(.is-open){width:100px!important;height:115px!important;left:auto!important;top:auto!important;right:8px!important;bottom:8px!important;pointer-events:none}body .student-companion:not(.is-open) .student-companion-robot{transform:scale(.44);transform-origin:bottom right;pointer-events:auto}body:has(.mh-editor,.mh-review-form,[data-homework-answer]) .student-companion:not(.is-open){visibility:hidden}}
/* Unified homework workspace. */
@media(max-width:600px){body .student-companion.is-open{left:auto!important;top:auto!important;right:8px!important;bottom:8px!important}body .student-companion.is-open .student-companion-card{position:fixed!important;left:12px!important;right:12px!important;top:auto!important;bottom:120px!important;width:auto!important;max-height:calc(100dvh - 160px);overflow:auto}}
.mh-workspace{width:100%;max-width:1500px;margin:0 auto;color:inherit;font:14px/1.6 Manrope,system-ui,sans-serif}
.mh-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 24px;flex-wrap:wrap}
.mh-heading>div{min-width:0;flex:1 1 320px}.mh-heading h1{margin:4px 0 8px;font-size:32px;line-height:1.25}.mh-heading h2{margin:0;font-size:18px}.mh-heading p{margin:0;color:#9cafd0;max-width:850px}.mh-heading .btn{flex:none}
.mh-tabs{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:16px}.mh-tabs button{display:flex;align-items:center;gap:10px;min-height:44px;padding:10px 16px;border:1px solid #283d5a;border-radius:10px;background:#0b192b;color:#b7c5df;font:inherit;cursor:pointer}.mh-tabs button.active{background:linear-gradient(110deg,#8249f7,#5f27d7);color:#fff;border-color:#a16cff}.mh-tabs span{min-width:24px;border-radius:7px;padding:1px 6px;background:#ffffff12;text-align:center}
.mh-toolbar{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-bottom:20px}.mh-toolbar>label:first-child{flex:1 1 260px}.mh-toolbar>label{flex:0 1 250px}.mh-toolbar>span{color:#a8b9d8}.mh-workspace :is(input:not([type=radio]),select,textarea){width:100%;padding:11px 13px;border:1px solid #294362;border-radius:9px;background:#071525;color:#edf2ff;line-height:1.5}.mh-workspace label{display:flex;flex-direction:column;gap:7px;font-weight:600}.mh-workspace .btn{min-height:44px;padding:11px 18px;font:600 13px/1.4 Manrope,system-ui,sans-serif;border-radius:9px}
.mh-list{display:grid;gap:14px}.mh-item{display:flex;align-items:center;gap:20px;border:1px solid #263b58;border-radius:14px;padding:22px;background:linear-gradient(130deg,#0c1a2e,#07121f)}.mh-item-icon{display:grid;place-items:center;flex:0 0 52px;height:52px;background:#792bdf35;border:1px solid #995cff45;border-radius:12px;color:#b685ff;font-size:26px}.mh-item-copy{flex:1 1 320px;min-width:0}.mh-item h2{margin:8px 0;font-size:17px;line-height:1.5}.mh-item p{margin:0 0 8px;color:#9fb1ce;overflow-wrap:anywhere}.mh-item small{display:block;color:#9fb1ce}.mh-item-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap;color:#95a7c4;font-size:12px}.mh-badge{display:inline-flex;align-items:center;min-height:28px;padding:4px 10px;max-width:100%;border:1px solid #25b3a63f;background:#007e7040;color:#75ebd5;border-radius:8px;font-size:12px;white-space:normal}.mh-badge.draft{border-color:#a576ee60;background:#7226ca30;color:#cdadff}.mh-item-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;flex:0 1 340px}.mh-empty{padding:44px 24px;text-align:center;border:1px dashed #384f6f;border-radius:14px;color:#9fb1ce}.mh-empty h2{color:inherit}
.mh-editor{max-width:1060px}.mh-back{display:inline-flex;margin-bottom:18px;color:#b798ff;text-decoration:none}.mh-panel{padding:24px;border:1px solid #293e5d;border-radius:14px;background:linear-gradient(130deg,#0b1a2c,#07131f)}.mh-editor form{display:grid;gap:20px}.mh-create-mode{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:16px 0;border-top:1px solid #24364f;border-bottom:1px solid #24364f;color:#99afcf}.mh-ai-panel{display:grid;gap:14px;padding:18px;border:1px solid #8351ca;border-radius:12px;background:#52239022}.mh-ai-panel button{justify-self:start}.mh-question{min-width:0;border:1px solid #2e4463;border-radius:12px;padding:18px;margin:0 0 18px;display:grid;gap:16px}.mh-question legend{padding:0 8px;color:#bd99ff;font-weight:700}.mh-question-tools{display:flex;align-items:flex-end;gap:18px;flex-wrap:wrap}.mh-question-tools>label{flex:1 1 220px}.mh-question-tools>button{flex:0 0 auto}.mh-question [data-choice-fields]{display:grid;gap:14px}.mh-save-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding-top:18px;border-top:1px solid #263e59}.mh-save-bar [role=status]{flex:1 1 240px}.mh-note{color:#9fb1ce;font-size:12px;margin:0}.mh-workspace [role=status]{color:#c9b2ff;overflow-wrap:anywhere}.mh-prewrap{white-space:pre-wrap;overflow-wrap:anywhere}.mh-workspace .mh-option{display:flex;flex-direction:row;align-items:flex-start;gap:12px;padding:12px;border:1px solid #2b4161;border-radius:9px;font-weight:400}.mh-option input{width:18px;height:18px;flex:none;margin:4px 0 0;accent-color:#9e6bff}.mh-code{font-family:Consolas,monospace!important;tab-size:4}.mh-late{color:#ffc26a}.mh-feedback{padding:16px;border:1px solid #5f44a1;border-radius:10px;background:#8548d41b;margin:16px 0}.mh-feedback h2{font-size:17px}.mh-review-list{display:grid;gap:18px}.mh-review-form{display:grid;grid-template-columns:120px minmax(0,1fr) auto;align-items:end;gap:16px;border-top:1px solid #2c4260;padding-top:18px}.mh-review-form p{grid-column:1/-1;margin:0}.mh-response{margin:16px 0}.mh-response h3{font-size:14px}.mh-response pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#0003;padding:14px;border-radius:8px;font:13px/1.6 Consolas,monospace}
html[data-theme=light] .mh-workspace :is(.mh-panel,.mh-item,.mh-tabs button,.mh-ai-panel){background:#fff;color:#1d2c45;border-color:#d9e2f0}html[data-theme=light] .mh-workspace :is(input:not([type=radio]),select,textarea){background:#f7f9ff;color:#1d2c45;border-color:#cbd7e8}html[data-theme=light] .mh-workspace :is(p,small,.mh-item-meta,.mh-note){color:#5b6f8e}html[data-theme=light] .mh-tabs button.active{background:#713be1;color:white}html[data-theme=light] .mh-badge{color:#087b68;background:#e4f6f0}html[data-theme=light] .mh-badge.draft{color:#7540bb;background:#f3eafd}
@media(max-width:800px){.mh-item{align-items:flex-start;flex-wrap:wrap;gap:14px;padding:18px}.mh-item-copy{flex-basis:calc(100% - 74px)}.mh-item-actions{flex-basis:100%;justify-content:flex-start;padding-left:66px}.mh-panel{padding:18px}.mh-review-form{grid-template-columns:minmax(0,1fr)}.mh-review-form p{grid-column:1}.mh-heading h1{font-size:28px}}
@media(max-width:480px){.mh-item-icon{flex-basis:40px;height:40px;font-size:20px}.mh-item-copy{flex-basis:calc(100% - 58px)}.mh-item-actions{padding-left:0;display:grid;grid-template-columns:1fr;flex-grow:1}.mh-item-actions>.btn{width:100%}.mh-heading>.btn{width:100%}.mh-tabs button{flex:1 1 140px;justify-content:center}.mh-question{padding:12px}.mh-save-bar>.btn{width:100%}.mh-toolbar>label{flex-basis:100%}}
