/* MIHO usability layer: retain the existing dark/violet identity and artwork. */
:root{--miho-readable:#b9c9e2;--miho-touch:44px}
body{font-family:Manrope,system-ui,-apple-system,"Segoe UI",sans-serif}
body .product-content{font-size:14px;line-height:1.6}
body .product-content :is(p,small,em,time,label){line-height:1.55}
body .product-content :is(small,.overline,.nav-caption){font-size:12px!important}
body .product-content :is(input,select,textarea,button,.btn){font-size:14px!important}
body .product-content :is(h2,h3){line-height:1.35}
body .product-content :is(.page-head,.admin-page-head,.mh-heading,.course-hero)>p{max-width:80ch}
body :is(button,.btn){touch-action:manipulation}
body .product-content button,body .product-content .btn{min-height:var(--miho-touch);min-width:var(--miho-touch);cursor:pointer}
body button:disabled{cursor:not-allowed!important}
body .product-content a:not(.btn):focus-visible{border-radius:5px}
body :is(button,a,input,textarea,select,summary):focus-visible{outline:3px solid #77ddff!important;outline-offset:3px}
body :is(input,textarea,select)[aria-invalid=true]{border-color:#ff939d!important;box-shadow:0 0 0 1px #ff939d}
.miho-field-error{display:block;color:#ffb2b8;font-size:12px!important;margin:4px 0 0}
.miho-skip{position:fixed;top:-100px;left:16px;z-index:10000;background:#e7f7ff;color:#10213b;padding:12px 18px;border-radius:10px;font-weight:700}
.miho-skip:focus{top:12px}
/* Navigation stays in the Categories menu, without redundant page trails. */
body :is(.miho-location,.reference-breadcrumb){display:none!important}
body .miho-course label:has(> :is([data-testing-grade],[data-path-grade])){display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;max-width:100%;padding:4px 0}
body .miho-course label> :is([data-testing-grade],[data-path-grade]){flex:0 1 160px;width:160px;min-width:0;max-width:100%;margin:0}
@media(max-width:650px){
 body .miho-course label:has(> :is([data-testing-grade],[data-path-grade])){flex-direction:column;align-items:stretch;gap:10px}
 body .miho-course label> :is([data-testing-grade],[data-path-grade]){flex:auto;width:100%}
}
.miho-data-warning,.miho-offline{padding:14px 18px;border:1px solid #98733b;border-radius:12px;background:#2c2315;color:#ffdeaa;font-size:14px;line-height:1.6}
.miho-data-warning{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:20px}.miho-offline{position:sticky;bottom:0;z-index:200;margin:12px;box-shadow:0 4px 30px #0005}
.miho-draft-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 16px;border:1px solid #7957bb;border-radius:10px;background:#291b493d;color:#cbb4f9;font:13px/1.6 inherit}.miho-draft-note p{margin:0;flex:1 1 220px}
.miho-draft-status{display:block;color:#b9c9e2;font-size:12px}
body .product-top{position:relative;z-index:50}
body .product-top .top-actions-new .top-profile{display:inline-flex!important;align-items:center;justify-content:center;min-height:44px;min-width:44px}
body .product-top .top-profile .top-avatar{display:flex!important;align-items:center;justify-content:center;visibility:visible;opacity:1}
body .top-actions-new::before{content:none!important}
body .category-trigger{width:auto!important;min-width:126px!important;padding:10px 14px!important;font-size:13px!important}
body .category-trigger>span:not(.ui-icon){display:inline!important}
/* The menu has a real text label; suppress the legacy CSS-generated duplicate. */
body .miho-category-button::after{content:none!important;display:none!important}
body .category-popover{position:fixed!important;left:16px!important;top:86px!important;width:min(340px,calc(100vw - 32px))!important;max-height:calc(100dvh - 108px)!important;z-index:200;overscroll-behavior:contain}
body .category-popover nav a{min-height:44px!important;font-size:14px!important}body .category-popover nav a b{font-size:14px!important}body .category-popover section>span{font-size:11px!important}
body .product-content [data-settings-tab]>span:not(.ui-icon){display:inline!important}
body .product-sidebar nav a{min-height:44px}
body .top-popover{max-width:calc(100vw - 24px);max-height:70dvh;overflow-y:auto;z-index:220}
body .global-search input{font-size:14px!important}
body .global-search:after{pointer-events:none}
body .product-content :is(.nx-achievements,.nx-ach-layout,.nx-ach-catalog,.nx-ach-ranking,.nx-ach-ranking-full,.nx-ach-grid,.nx-ach-filters,.nx-ach-card,.nx-rank-row){min-width:0;max-width:100%}
body .nx-ach-filters{flex-wrap:nowrap}body .nx-ach-card{grid-template-columns:48px minmax(0,1fr)!important}
body .product-content :is(.admin-users-table,.admin-performance-table,.reference-class-table,.entity-table){overflow-x:auto;overscroll-behavior-x:contain}
body .product-content :is(.admin-users-table,.admin-performance-table,.reference-class-table,.entity-table):focus-visible{outline:2px solid #77ddff}
body .admin-row-actions{display:flex;flex-wrap:wrap;gap:8px}
.miho-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:16px 20px;border-top:1px solid #293c58;font-size:13px}.miho-pagination>div{display:flex;align-items:center;gap:10px}.miho-pagination button{min-width:44px}
.miho-list-empty{padding:28px;color:var(--miho-readable);text-align:center}
body .product-content :is(.teacher-ref-metrics,.admin-page-metrics,.neon-metrics){gap:16px}
body .product-content :is(.tc-class-row,.reference-table-row,.admin-table-heading)>*{min-width:0}
body dialog::backdrop{background:#020817bf;backdrop-filter:blur(3px)}
body dialog .dialog-head [data-close]{min-width:44px;min-height:44px;font-size:26px}
body .product-content pre{max-width:100%;overflow:auto;tab-size:4}
[data-miho-settings]>.btn{margin-top:12px;max-width:100%;white-space:normal}
body .student-companion-card button{min-height:44px;min-width:44px}
body.miho-assistant-minimized .student-companion,body.miho-focus-helper .student-companion{display:none!important}
body.miho-focus-helper .product-content{padding-bottom:96px!important}
.miho-restore-assistant{position:fixed;right:16px;bottom:16px;z-index:1000;min-height:44px;padding:10px 18px;border:1px solid #9e78f9;border-radius:12px;background:#49259a;color:white;font:700 13px Manrope,system-ui,sans-serif;box-shadow:0 6px 20px #0006;cursor:pointer}
html[data-theme=light]{--miho-readable:#475d7d}
html[data-theme=light] .miho-location a{color:#6334b2}html[data-theme=light] .miho-field-error{color:#a51f36}
html[data-theme=light] .miho-draft-note{background:#f4efff;color:#59388f}
@media(max-width:1000px){
 body .product-shell .product-top{height:auto!important;min-height:76px;overflow:visible}
 body .product-top{display:flex!important;align-items:center;justify-content:space-between;flex-wrap:wrap!important;gap:12px!important;height:auto!important;padding:12px 16px!important}
 body .product-top .global-search{display:flex!important;order:10;flex:1 1 100%!important;max-width:none!important;min-height:44px;margin:0!important;width:100%!important}
 body .product-top .topbar-primary{display:contents!important}
 body .top-category{margin:0!important}body .top-actions-new{width:auto!important;margin-left:auto!important;gap:8px!important}
 body .product-top .top-profile>span:not(.top-avatar){display:none!important}
 body .product-top .top-profile>.ui-icon{display:none!important}
 body .product-top .home-brand{margin:0!important}
 body .product-top .top-streak{display:none!important}
 body .product-top .top-profile{padding:0!important}
 body .category-popover{top:72px!important;max-height:calc(100dvh - 90px)!important}
 body .product-top .miho-category-button{display:inline-flex!important;align-items:center;justify-content:center;width:auto!important;min-width:116px!important;min-height:44px;padding:8px 12px!important;gap:8px;margin:0!important;color:#dce9ff;border:1px solid #345077;border-radius:10px;background:#10213b}
 body .miho-category-text{display:inline!important;font-size:13px!important;font-weight:700}
 body .top-popover{position:fixed!important;right:12px!important;top:76px!important;left:auto!important;width:min(380px,calc(100vw - 24px))!important}
}
@media(max-width:600px){
 body .pixel-pair{flex-direction:column;gap:20px;min-width:0}
 body .pixel-pair>div{flex:none;width:calc(100% + 16px);margin-left:-8px;min-width:0}
 body .pixel-pair .game-board{width:100%;max-width:100%;gap:2px}
 body .pixel-pair .game-cell{min-width:0!important;min-height:0!important;padding:0!important;aspect-ratio:1}
 body .teacher-profile{min-width:0!important;max-width:100%;width:100%}
 body .teacher-profile :is(.teacher-profile-head,.teacher-profile-hero,.teacher-profile-info,.teacher-profile-grid,.teacher-profile-card){min-width:0!important;max-width:100%}
 body .teacher-profile-head{flex-wrap:wrap;gap:14px}
 body .teacher-profile-info :is(article,div,strong,p){min-width:0;overflow-wrap:anywhere;white-space:normal}
 body .tc-calendar{display:flex!important;gap:8px;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;padding-bottom:8px}
 body .tc-calendar>div{flex:0 0 100px}body .tc-calendar>button{flex:0 0 44px}
 body .tc-metrics footer{min-width:0;max-width:100%;flex-wrap:wrap;overflow-wrap:anywhere;font-size:12px!important}body .tc-metrics footer>i{display:none!important}
 body .product-top .header-brand{flex:none!important;font-size:18px}
 body .product-top .header-brand span{display:none}
 body .product-top .home-brand{display:none!important}
 body .product-top .mobile-logo{display:none!important}
 body .product-top .language-switcher{display:block!important;position:absolute;right:24px;bottom:14px;z-index:10}
 body .product-top .language-current{min-height:40px;height:40px!important;min-width:58px;padding:8px!important;font-size:12px!important}
 body .product-top .language-current>span{display:none}
 body .product-top .global-search input{padding-right:84px!important}
 body .product-top .global-search:after{display:none!important}
 body .product-top .top-profile .top-avatar{width:38px!important;height:38px!important;min-width:38px;font-size:13px}
 body .product-content{padding:20px 16px 44px!important}
 body .product-content :is(.teacher-ref-metrics,.admin-page-metrics,.neon-metrics){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 body .product-content :is(.teacher-ref-metrics,.admin-page-metrics,.neon-metrics)>a{display:flex!important;flex-direction:column;align-items:flex-start!important;gap:6px!important}
 body .product-content :is(.teacher-ref-metrics,.admin-page-metrics)>a>span:first-child{width:36px!important;height:36px!important;padding:8px!important}
 body .product-content :is(.teacher-ref-metrics,.admin-page-metrics,.neon-metrics)>*{padding:14px 12px!important;min-width:0;min-height:108px}
 body .product-content .neon-metrics article{grid-template-columns:1fr!important;gap:8px}
 body .product-content .neon-metrics article>span{display:none!important}
 body .product-content .neon-metrics svg{display:none}
 body .product-content .neon-metrics strong{font-size:26px!important}
 body .nx-ach-tabs{min-width:0;gap:8px!important}body .nx-ach-tabs button{overflow-wrap:anywhere}
 body .product-content .nx-ach-filters button{flex:1 1 120px;max-width:100%}
 body .nx-rank-row{grid-template-columns:26px 34px minmax(0,1fr)!important;gap:8px!important}body .nx-rank-row>strong{grid-column:3}
 body .mh-tabs button{flex:1 1 135px}
 body .mh-workspace :is(textarea,input,select){font-size:16px!important}
 body .tc-class-row{gap:12px!important}
 body .miho-course .course-nav{display:flex;flex-wrap:wrap;gap:8px}
 body .miho-course .class-history{grid-template-columns:minmax(0,1fr);gap:8px}
 body [data-path-summary] progress{max-width:100%;width:100%;height:10px;accent-color:#a47aff}
 body .course-nav a{min-height:44px;display:inline-flex;align-items:center}
 body .product-content .nx-ach-title h1{font-size:30px!important}
}
body .pixel-pair>div{flex:1;min-width:0}body .pixel-pair h3{font-size:15px;margin:10px 0 0}
@media(max-width:360px){body .product-top .header-brand{display:none!important}}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto!important}
 body .product-shell *,body .product-shell *::before,body .product-shell *::after{animation:none!important;transition:none!important}
}
