:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#122039;background:#f6f8fb;font-synthesis:none;--navy:#071d38;--navy2:#0c2a4c;--blue:#1f67e8;--line:#e3e8ef;--muted:#718096;--green:#1aa56b;--red:#e44e57;--shadow:0 18px 55px rgba(17,34,68,.08)}*{box-sizing:border-box}body{margin:0;background:#f6f8fb}button,input,select,textarea{font:inherit}button{cursor:pointer;border:0;border-radius:10px;padding:11px 16px;background:var(--navy);color:white;font-weight:750;transition:.18s ease}button:hover{transform:translateY(-1px);filter:brightness(1.05)}button:disabled{opacity:.48;cursor:not-allowed;transform:none}.secondary,.ghost{background:#eef3f8;color:#20314d}.link,.crumb-btn,.drawer-back{background:transparent;color:#5c6a7e;padding:5px 3px;border-radius:6px}.crumb-btn:hover,.link:hover,.drawer-back:hover{transform:none;color:#13233e;background:transparent}.welcome,.auth-page{min-height:100vh;display:grid;place-content:center;text-align:center;padding:28px}.brand-circle{width:74px;height:74px;border-radius:22px;background:var(--navy);color:#fff;display:grid;place-items:center;margin:0 auto 18px;font-weight:800;box-shadow:var(--shadow)}.brand-circle.small{width:52px;height:52px}.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:11px;font-weight:850;color:#7f8da2}.lead,.muted{color:var(--muted)}.muted.compact{margin:5px 0 0;font-size:13px}.choice-grid,.cards,.studentcards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:24px}.choice,.card,.studentcard{background:#fff;color:#172033;border:1px solid var(--line);padding:20px;text-align:left;display:flex;flex-direction:column;gap:8px;border-radius:16px;box-shadow:0 6px 20px rgba(31,49,80,.035)}.choice:hover,.studentcard:hover,.card.open-class:hover{border-color:#b6caec;box-shadow:0 12px 30px rgba(31,76,145,.09);transform:translateY(-2px)}.card em{font-style:normal;color:#2d6bda;font-size:13px;margin-top:8px}.card-icon{width:38px;height:38px;border-radius:11px;background:#eef4ff;color:#1f67e8;display:grid;place-items:center;font-weight:900}.template-card button{margin-top:auto}.auth-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:30px;min-width:min(420px,92vw);box-shadow:var(--shadow)}label{display:flex;flex-direction:column;gap:8px;text-align:left;margin:14px 0;font-weight:720;color:#23334d;font-size:14px}.optional{font-weight:500;color:#99a4b4;margin-left:4px}input,select,textarea{border:1px solid #d9e0e9;border-radius:10px;padding:12px 13px;background:#fff;color:#172033;outline:none;transition:.15s}input:focus,select:focus,textarea:focus{border-color:#6ca0f6;box-shadow:0 0 0 3px rgba(57,121,227,.10)}input:disabled{background:#f8fafc;color:#5c6879}textarea{min-height:112px;resize:vertical}.notice{padding:11px 13px;border-radius:10px;background:#eef5ff;margin:12px 0;font-size:13px}.notice.error{background:#fff1f1;color:#a8373d;border:1px solid #ffd8da}
/* Teacher shell */.teacher-layout{display:grid;grid-template-columns:230px minmax(0,1fr);min-height:100vh}.sidebar{background:linear-gradient(180deg,#071d38 0%,#09233f 100%);color:#fff;padding:22px 14px;display:flex;flex-direction:column;gap:18px;position:sticky;top:0;height:100vh;z-index:30}.teacher-brand{display:flex;align-items:center;gap:11px;padding:0 7px 14px}.teacher-brand strong{font-size:17px;line-height:1.22}.brand-book{width:38px;height:38px;border-radius:10px;background:#ffc83d;color:#0b2545;display:grid;place-items:center;font-size:20px;font-weight:900}.teacher-nav{display:flex;flex-direction:column;gap:6px}.nav-label{font-size:11px;color:#a9bad0;padding:10px 10px 7px;letter-spacing:.08em}.teacher-nav button,.sidebar-bottom button{background:transparent;text-align:left;display:flex;align-items:center;gap:12px;color:#f4f7fb;padding:11px 12px;border-radius:9px;font-weight:620}.teacher-nav button span,.sidebar-bottom button span{width:22px;text-align:center;font-size:17px;color:#c3d0df}.teacher-nav button.active{background:linear-gradient(90deg,#1d4678,#214d80);color:#9fc3ff}.teacher-nav button.active span{color:#8bb7ff}.teacher-nav .nav-disabled{opacity:.58;cursor:default}.teacher-nav .nav-disabled:hover{transform:none;filter:none}.sidebar-bottom{margin-top:auto;border-top:1px solid rgba(255,255,255,.12);padding-top:14px;display:flex;flex-direction:column;gap:4px}.saved-chip{border:1px solid #32d48c;color:#57dfa4;padding:10px;border-radius:9px;text-align:center;font-size:13px;margin-bottom:8px}.content{min-width:0;overflow:auto;padding:0;background:#f8fafc}.teacher-topbar{height:80px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:20}.teacher-topbar>div{display:flex;align-items:center;gap:12px}.crumb,.crumb-btn{font-size:14px}.crumb-sep{color:#b3bdca}.teacher-user{color:#65748a}.avatar{width:34px;height:34px;border-radius:50%;background:#e7effc;color:#1f67e8;display:grid;place-items:center;font-weight:800}.teacher-page{padding:28px;max-width:1450px;margin:0 auto}.pagehead,.sectionhead,.parthead,.homeworktop,.student-top,.reviewsummary,.lessonrow{display:flex;align-items:center;justify-content:space-between;gap:18px}.pagehead{margin-bottom:20px}.pagehead h1{margin:2px 0 6px;font-size:30px;letter-spacing:-.02em}.panel,.part,.builder-card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:22px;margin:18px 0;box-shadow:0 3px 14px rgba(17,34,68,.025)}.panel h3,.builder-card h2{margin:0}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.stats>div{background:#fff;border:1px solid var(--line);border-radius:14px;padding:19px;box-shadow:0 3px 14px rgba(17,34,68,.025)}.stats b{display:block;font-size:29px}.stats span,.card span,.studentcard span,.lessonrow span,.questionline span,.question-row span{color:#768196;font-size:13px}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:13px 11px;border-bottom:1px solid #edf0f4}th{font-size:12px;text-transform:uppercase;color:#8592a6;letter-spacing:.04em}.student-code{background:#eef3fb;color:#255ca9;padding:5px 8px;border-radius:7px}.status-dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:7px}.status-dot.ok{background:#28b476}.status-dot.off{background:#b5bdc9}.class-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:4px}.inline-add{display:flex;gap:8px;align-items:center}.inline-add select{min-width:230px}.lessonrows{display:flex;flex-direction:column;gap:9px}.lessonrow{border:1px solid #e5eaf0;border-radius:11px;padding:14px 15px;background:#fff;color:#172033;width:100%;text-align:left}.lessonrow:hover{border-color:#bdd0ef;background:#fbfdff}.lessonrow>div:first-child{display:flex;flex-direction:column;gap:5px}.lessonrow>div:last-child{display:flex;align-items:center;gap:9px}.row-arrow{font-size:22px!important;color:#8aa0bb!important}.pill{background:#eef3f7;border-radius:999px;padding:5px 9px;font-size:11px!important;color:#506178!important;text-transform:capitalize}.pill.late,.latebanner{background:#fff4dc;color:#8c5a00}.empty-state,.empty-questions{border:1px dashed #d7dee8;border-radius:12px;padding:24px;text-align:center;color:#8b98aa;background:#fbfcfe}.partbox{border:1px solid #e4e7ec;border-radius:12px;padding:14px;margin:12px 0}.questionline{padding:12px 0;border-top:1px solid #eceef2}.questionline>div{display:flex;flex-direction:column;gap:5px}.scoretotal{font-weight:820;margin-right:10px;white-space:nowrap}
/* Builder */.builder-content{position:relative;overflow:visible}.builder-bar{padding-right:28px}.builder-actions{margin-left:auto}.save-state{font-size:13px;color:#65768b;border-right:1px solid var(--line);padding-right:18px}.builder-page{padding:26px 28px;max-width:1120px;margin:0 auto}.builder-card{margin:0 0 16px}.builder-section-title{display:flex;align-items:center;gap:12px;margin-bottom:18px}.builder-section-title h2{font-size:18px}.section-icon{width:36px;height:36px;border-radius:9px;background:#edf4ff;color:#2072ee;display:grid;place-items:center}.draft-pill{margin-left:auto;background:#e9f8f0;color:#1a9c65;border-radius:7px;padding:6px 9px;font-size:12px;text-transform:capitalize}.form-grid{display:grid;grid-template-columns:1fr 220px;gap:8px 20px}.form-grid .span-2{grid-column:1/-1}.points-display{height:44px;border:1px solid #d9e0e9;border-radius:10px;display:flex;align-items:center;justify-content:flex-end;gap:4px;padding:0 14px}.points-display strong{font-size:18px}.points-display span{color:#8b98aa}.date-summary{border:1px solid #e2e7ee;border-radius:10px;background:#fafbfd;padding:13px;color:#65758a;font-weight:500}.date-summary span{padding:0 7px;color:#a0abba}.parts-list{display:flex;flex-direction:column;gap:13px;margin-top:18px}.part-editor{border:1px solid #dfe5ed;border-radius:12px;overflow:hidden;background:#fff}.part-editor-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid #e7ebf0}.part-editor-head>div{display:flex;flex-direction:column;gap:6px}.part-title{font-size:15px}.part-editor-head span{font-size:13px;color:#708096}.part-questions{padding:0 18px}.question-row{display:grid;grid-template-columns:31px 1fr;gap:10px;align-items:start;padding:14px 0;border-top:1px solid #edf0f4}.question-row:first-child{border-top:0}.question-row>div:last-child{display:flex;flex-direction:column;gap:5px}.question-number{width:28px;height:28px;border-radius:8px;background:#eef3f9;display:grid;place-items:center;font-size:12px;font-weight:800;color:#4f627a}.empty-questions{border:0;background:transparent;padding:24px 0}.add-part-bottom{width:100%;margin-top:16px;background:#fff;color:#1d67d8;border:1px dashed #cbd8e9}.question-drawer{position:fixed;right:-440px;top:80px;width:410px;height:calc(100vh - 80px);background:#fff;border-left:1px solid var(--line);box-shadow:-16px 0 40px rgba(22,44,78,.08);z-index:40;padding:22px;transition:right .22s ease;overflow:auto}.question-drawer.open{right:0}.drawer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}.drawer-head h2{margin:0 0 5px;font-size:21px}.drawer-head p{margin:0;color:#7b899b;font-size:13px}.icon-btn{background:transparent;color:#526278;padding:2px 7px;font-size:27px;font-weight:400}.icon-btn:hover{transform:none;background:#f3f5f8}.question-type-list{display:flex;flex-direction:column;gap:7px}.question-type{background:#fff;color:#172033;border:1px solid #dfe5ed;display:grid;grid-template-columns:42px 1fr 18px;align-items:center;gap:12px;text-align:left;padding:10px 12px}.question-type:hover{transform:none;border-color:#b7c9e8;background:#fbfdff}.question-type>span:nth-child(2){display:flex;flex-direction:column;gap:2px}.question-type small{color:#8190a3}.type-icon{width:38px;height:38px;border-radius:10px;background:#6b3df0;color:#fff;display:grid;place-items:center;font-size:18px}.type-1 .type-icon{background:#24bd51}.type-2 .type-icon{background:#1775e8}.type-3 .type-icon{background:#ff5b1f}.type-4 .type-icon{background:#10a9b2}.type-5 .type-icon{background:#ec2c76}.type-6 .type-icon{background:#f6b91d}.type-7 .type-icon{background:#1874df}.drawer-tip{margin-top:16px;padding:12px;border-radius:10px;background:#f7f9fb;color:#718096;font-size:12px}.drawer-form label{margin:12px 0}.drawer-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.drawer-back{padding:0;margin-bottom:10px;font-size:12px}.student-answer-box{background:#f7f9fc;border:1px solid #e1e6ee;border-radius:12px;padding:14px;margin-bottom:12px}.student-answer-box span{font-size:11px;text-transform:uppercase;color:#8290a3}.student-answer-box p{margin-bottom:0}
/* Modal + toast */.ui-overlay{position:fixed;inset:0;background:rgba(7,24,45,.46);backdrop-filter:blur(2px);z-index:100;display:grid;place-items:center;padding:20px}.ui-modal{width:min(520px,94vw);background:#fff;border-radius:17px;box-shadow:0 24px 70px rgba(3,18,38,.23);overflow:hidden}.ui-modal.wide{width:min(760px,94vw)}.ui-modal-head{display:flex;justify-content:space-between;align-items:flex-start;padding:21px 22px 10px}.ui-modal-head h3{margin:0;font-size:21px}.ui-modal-head p{margin:5px 0 0;color:#7a8798;font-size:13px}.ui-modal-body{padding:5px 22px 10px}.ui-modal-actions{display:flex;justify-content:flex-end;gap:9px;padding:14px 22px 20px;border-top:1px solid #edf0f4;margin-top:8px}.modal-message{color:#5d6c80;line-height:1.55}.toast-host{position:fixed;right:22px;bottom:22px;z-index:150;display:flex;flex-direction:column;gap:8px}.toast{min-width:240px;max-width:360px;background:#102a47;color:#fff;border-radius:11px;padding:12px 14px;box-shadow:0 15px 40px rgba(5,22,43,.22);display:flex;gap:10px;align-items:center;opacity:0;transform:translateY(8px);transition:.22s}.toast.show{opacity:1;transform:none}.toast.success span{color:#55e4a4}.toast.error{background:#6e2329}.toast.error span{color:#ffc4c7}
/* Student */.student-shell{min-height:100vh}.student-top{padding:16px 28px;border-bottom:1px solid #e3e6eb;background:#fff;position:sticky;top:0;z-index:10}.studentbrand,.studentid{display:flex;align-items:center;gap:12px}.studentbrand>div,.studentid{flex-wrap:wrap}.studentbrand span{display:block;font-size:12px;color:#788399}.studentid code{background:#eef1f5;padding:5px 8px;border-radius:8px}.homebtn{width:40px;height:40px;padding:0;border-radius:50%}.studentmain,.homework{max-width:1000px;margin:0 auto;padding:28px}.studentcards{grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}.homeworktop{align-items:flex-start}.progress{background:#fff;border:1px solid #e3e6eb;padding:12px 16px;border-radius:12px;font-weight:800}.latebanner{padding:12px;border-radius:10px;margin:14px 0}.part{margin:22px 0}.parthead span{font-size:12px;text-transform:uppercase;color:#798396}.studentq{display:grid;grid-template-columns:34px 1fr;gap:10px;padding:18px 0;border-top:1px solid #eceef2}.qnum{width:30px;height:30px;border-radius:50%;background:#edf0f4;display:grid;place-items:center;font-weight:800}.qbody>p{font-weight:700}.qbody>input,.qbody>textarea{width:100%}.options{display:grid;gap:8px}.options label{flex-direction:row;align-items:center;border:1px solid #e2e5ea;border-radius:10px;padding:10px;margin:0}.sticky{position:sticky;bottom:16px;background:rgba(255,255,255,.94);backdrop-filter:blur(8px);border:1px solid #e0e4e9;border-radius:14px;padding:12px;display:flex;justify-content:flex-end;gap:10px}.reviewsummary{background:var(--navy);color:white;padding:22px;border-radius:16px;margin:20px 0}.reviewsummary strong{font-size:34px}.reviewq{border:1px solid #e2e5ea;border-radius:12px;padding:16px;margin:12px 0;background:#fff}.reviewq.correct{border-color:#9bd4ad;background:#f2fbf5}.reviewq.incorrect{border-color:#e9aaa6;background:#fff6f5}.waiting{display:inline-block;background:#fff3d7;color:#7d5600;padding:7px 10px;border-radius:8px}.loading{padding:30px;text-align:center;color:#7a8494}
@media(max-width:920px){.teacher-layout{grid-template-columns:78px minmax(0,1fr)}.teacher-brand strong,.nav-label,.teacher-nav button:not(.active){font-size:0}.teacher-brand{justify-content:center}.teacher-nav button,.sidebar-bottom button{justify-content:center}.teacher-nav button span,.sidebar-bottom button span{width:auto}.saved-chip{font-size:0}.saved-chip:after{content:'✓';font-size:14px}.form-grid{grid-template-columns:1fr}.form-grid .span-2{grid-column:auto}.question-drawer{width:min(410px,100vw)}}
@media(max-width:680px){.teacher-layout{grid-template-columns:1fr}.sidebar{position:static;height:auto;padding:12px}.teacher-brand{justify-content:flex-start}.teacher-brand strong{font-size:15px}.teacher-nav{flex-direction:row;overflow:auto}.teacher-nav .nav-label,.nav-disabled{display:none}.teacher-nav button{font-size:13px;white-space:nowrap}.sidebar-bottom{display:none}.teacher-topbar{position:static;height:auto;padding:14px 16px;align-items:flex-start;gap:10px}.builder-actions{flex-wrap:wrap;justify-content:flex-end}.save-state{display:none}.teacher-page,.builder-page{padding:17px}.stats{grid-template-columns:repeat(2,1fr)}.pagehead,.sectionhead,.homeworktop,.student-top,.reviewsummary{align-items:flex-start;flex-direction:column}.inline-add{width:100%;flex-direction:column;align-items:stretch}.inline-add select{min-width:0}.question-drawer{top:0;height:100vh}.studentid{width:100%}.lessonrow{align-items:flex-start;flex-direction:column}.lessonrow>div:last-child{flex-wrap:wrap}.homework,.studentmain{padding:18px}.ui-modal{border-radius:14px}}
