.hw-page{padding:24px;max-width:1300px;margin:auto;color:#182230}.hw-page header,.hw-dialog header,.hw-dialog footer,.hw-page footer{display:flex;justify-content:space-between;align-items:center;gap:16px}.hw-page h1{margin:4px 0;font-size:28px}.hw-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:24px 0}.hw-filters label,.hw-review-form label{display:grid;gap:6px;font-weight:650}.hw-page input,.hw-page select,.hw-dialog textarea{font:inherit;border:1px solid #cdd7e5;border-radius:10px;padding:10px;background:white}.hw-dialog textarea{width:100%;box-sizing:border-box}.hw-page button,.hw-dialog button{font:inherit;padding:10px 14px;border:1px solid #cdd7e5;border-radius:10px;background:#fff;cursor:pointer;color:#243248}.hw-page button:disabled,.hw-dialog button:disabled{opacity:.5;cursor:wait}.hw-primary{background:#168348!important;color:white!important;border-color:#168348!important}.hw-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:16px;margin:8px 0;border:1px solid #dbe2ec;border-radius:12px;text-decoration:none;color:#182230;background:#fff;width:100%;box-sizing:border-box;text-align:left}.hw-row div{display:grid;gap:5px}.hw-row span,.hw-row small{font-size:13px}.hw-row:hover{border-color:#2563eb}.hw-status{display:inline-block;border-radius:20px;padding:4px 10px;background:#eaf2ff;color:#24579a}.hw-muted{color:#667085;font-size:13px}.hw-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}.hw-dialog{width:min(740px,calc(100vw - 32px));max-height:85vh;box-sizing:border-box;border:1px solid #dbe2ec;border-radius:20px;padding:24px;color:#182230}.hw-dialog::backdrop{background:rgba(16,24,40,.45)}.hw-dialog section{padding:12px 0;border-bottom:1px solid #edf0f4}.hw-dialog summary{cursor:pointer;padding:16px 0;font-weight:700}.hw-files{display:flex;flex-wrap:wrap;gap:8px}.hw-error{color:#b42318}.hw-dialog :focus-visible,.hw-page :focus-visible{outline:3px solid #93c5fd;outline-offset:2px}.hw-dialog footer{margin-top:16px}.hw-lesson{margin-top:18px}.hw-count:empty{display:none}.hw-count{border-radius:20px;background:#eaf2ff;color:#2563eb;padding:2px 6px;font-size:12px}@media(max-width:600px){.hw-page{padding:14px}.hw-row{align-items:start;flex-direction:column}.hw-filters label{width:100%}.hw-filters input,.hw-filters select{width:100%;box-sizing:border-box}.hw-dialog{padding:16px}.hw-dialog footer{flex-direction:column;align-items:stretch}.hw-page header{align-items:start}.hw-dialog h2{font-size:22px}}

/* Homework surfaces follow the CRM card and button styles. */
.hw-page{max-width:1440px;padding:24px;display:grid;gap:24px}
.hw-page>header{align-items:flex-start;padding:4px 0}
.hw-page>header p:last-child{margin:12px 0 0;color:#667085;font-size:14px;line-height:1.5}
.hw-page>header .hw-muted{margin:0 0 8px;font-weight:600}
.hw-button,.hw-button:visited{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-shrink:0;min-height:40px;box-sizing:border-box;padding:9px 14px;border:1px solid #dbe2ec;border-radius:10px;background:#fff;color:#344054;font-size:14px;font-weight:600;text-decoration:none;transition:background .15s,border-color .15s}
.hw-button:hover,.hw-button:active{background:#f2f5fa;border-color:#aabbd2;color:#182230;text-decoration:none}
.hw-schedule-button,.hw-schedule-button:visited,.hw-schedule-button:hover,.hw-schedule-button:active{text-decoration:none!important;display:inline-flex;align-items:center;justify-content:center;gap:7px}
.hw-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;box-sizing:border-box;padding:0 6px;background:#dc2626;color:#fff;font-size:12px;font-weight:700;line-height:1;vertical-align:middle;font-variant-numeric:tabular-nums}
.hw-filters,.hw-results{margin:0;padding:22px;background:#fff;border:1px solid #e2e6ed;border-radius:16px;box-shadow:0 1px 3px #10182805}
.hw-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) minmax(0,1.3fr) auto;gap:16px}
.hw-filters label{min-width:0;font-size:13px;color:#475467;gap:8px}
.hw-filters select{width:100%;min-width:0;height:44px;font-weight:500;color:#182230;background:#f9fafb}
.hw-filters button{height:44px;background:#2563eb;border-color:#2563eb;color:#fff;font-weight:600}
.hw-page button:hover:not(:disabled),.hw-dialog button:hover:not(:disabled){filter:brightness(.96)}
.hw-page button:disabled,.hw-dialog button:disabled{cursor:default}
.hw-results-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.hw-results-head h2{font-size:17px;margin:0}.hw-total{margin:0;color:#667085;font-size:13px}
.hw-results footer{border-top:1px solid #edf0f4;padding-top:16px;margin-top:20px}
.hw-row,.hw-row:visited,.hw-row:hover,.hw-row:active{color:#182230;text-decoration:none}
.hw-row{padding:18px;transition:border-color .15s,background .15s}
.hw-row:hover{background:#f8faff}.hw-row small,.hw-row div>span:not(.hw-status){color:#667085}.hw-status{width:fit-content;white-space:nowrap;font-weight:600;font-size:12px}
.hw-list>.hw-muted{padding:32px 16px;text-align:center;background:#f9fafb;border-radius:12px}
.hw-dialog{width:min(1080px,calc(100vw - 48px));max-width:none;max-height:90dvh;padding:28px;background:#f8fafc;box-shadow:0 24px 80px #10182833}
.hw-dialog>header{margin-bottom:20px;align-items:flex-start}.hw-dialog h2{margin:8px 0 12px}.hw-dialog h3{margin:0 0 12px;font-size:16px}
.hw-dialog>section,.hw-dialog>.hw-review-form,.hw-dialog>details{padding:20px;margin:14px 0;border:1px solid #e2e6ed;border-radius:14px;background:#fff}
.hw-dialog>section .hw-text:last-child{margin-bottom:0}.hw-dialog>details{margin-bottom:0}.hw-dialog>details>summary{padding:0}.hw-dialog .hw-review-form label{font-size:14px;gap:10px}.hw-dialog textarea{font-weight:400;line-height:1.5;min-height:120px}
.home-card[data-widget="homework"]{align-self:start;min-width:0}
.home-card[data-widget="homework"] .home-card__head{flex-wrap:wrap;gap:10px;margin-bottom:12px}
.home-card[data-widget="homework"] .hw-button{font-size:12px;min-height:32px;padding:6px 10px}
[data-homework-widget]>p{font-size:13px;color:#667085;margin:0 0 12px}
[data-homework-widget] .hw-row{flex-direction:column;align-items:flex-start;gap:7px;padding:12px;font-size:14px;margin-bottom:0}
[data-homework-widget] .hw-row>span{font-size:12px;color:#667085}
.hw-button:focus-visible,.hw-schedule-button:focus-visible,[data-homework-widget] .hw-row:focus-visible{outline:3px solid #93c5fd;outline-offset:3px}
@media(max-width:1000px){.hw-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.hw-filters button{justify-self:start}}
@media(max-width:600px){.hw-page{padding:14px;gap:18px}.hw-page>header{flex-direction:column}.hw-page h1{font-size:25px}.hw-filters{grid-template-columns:1fr;padding:16px}.hw-filters button{width:100%}.hw-results{padding:16px}.hw-results-head{align-items:flex-start;flex-direction:column;gap:6px}.hw-dialog{width:calc(100vw - 20px);max-height:94dvh;padding:14px}.hw-dialog>section,.hw-dialog>.hw-review-form,.hw-dialog>details{padding:16px}.hw-dialog footer{gap:10px}}
.hw-filters .hw-pick-button{width:100%;text-align:left;justify-content:space-between;background:#f9fafb;border-color:#cdd7e5;color:#182230;font-weight:500}
.hw-pick-button::after{content:'⌄';float:right;margin-left:8px}
.hw-picker{width:min(900px,calc(100vw - 32px))}.hw-picker>input[type=search]{width:100%;box-sizing:border-box;padding:12px;border:1px solid #cdd7e5;border-radius:10px;font:inherit}
.hw-picker-toolbar{display:flex;justify-content:space-between;align-items:center;margin:14px 0;color:#667085;font-size:14px}.hw-picker-list{max-height:45vh;overflow:auto;border:1px solid #dbe2ec;border-radius:12px;background:white}.hw-picker-row{display:flex;align-items:center;gap:14px;padding:16px;border-bottom:1px solid #edf0f4;cursor:pointer}.hw-picker-row:has(:checked){background:#eff6ff}.hw-picker-row input{width:18px;height:18px;accent-color:#2563eb}.hw-picker-list>.hw-muted{padding:16px}
/* Keep native scrollbars inside the rounded outer frame. */
.hw-review-dialog{padding:0;overflow:hidden}
.hw-review-scroll{max-height:calc(90dvh - 2px);overflow:auto;padding:28px;box-sizing:border-box;scrollbar-width:thin;scrollbar-color:#c4ccd8 transparent}
.hw-review-scroll>header{margin-bottom:20px;align-items:flex-start}.hw-review-scroll>section,.hw-review-scroll>.hw-review-form,.hw-review-scroll>details{padding:20px;margin:14px 0;border:1px solid #e2e6ed;border-radius:14px;background:#fff}.hw-review-scroll>details>summary{padding:0}.hw-review-scroll>details{margin-bottom:0}
.hw-files button{max-width:100%;overflow-wrap:anywhere;text-align:left;line-height:1.5}.hw-files button[data-hw-name$=".png"]::after,.hw-files button[data-hw-name$=".jpg"]::after,.hw-files button[data-hw-name$=".jpeg"]::after,.hw-files button[data-hw-name$=".webp"]::after{content:' · Просмотреть';color:#2563eb;font-size:12px}
.hw-image-viewer{padding:0;overflow:hidden;background:#fff;width:min(1200px,calc(100vw - 32px))}.hw-image-viewer>header{padding:16px 20px;margin:0;border-bottom:1px solid #e2e6ed;align-items:center}.hw-image-viewer header strong{min-width:0;overflow-wrap:anywhere;font-size:14px}.hw-image-viewer header>div{display:flex;gap:8px;flex-shrink:0}.hw-image-stage{display:flex;align-items:center;justify-content:center;min-height:180px;max-height:calc(90dvh - 90px);overflow:auto;background:#eef1f6;padding:16px}.hw-image-stage img{display:block;max-width:100%;max-height:calc(90dvh - 122px);object-fit:contain;border-radius:6px}
@media(max-width:600px){.hw-review-scroll{padding:14px;max-height:calc(94dvh - 2px)}.hw-review-scroll>section,.hw-review-scroll>.hw-review-form,.hw-review-scroll>details{padding:16px}.hw-image-viewer>header{padding:12px;flex-wrap:wrap}.hw-image-stage{padding:8px}}
.hw-calendar{width:min(1120px,calc(100vw - 32px));scrollbar-width:thin}.hw-calendar-filters{display:grid;grid-template-columns:1fr 1fr 1fr auto;align-items:end;gap:12px;margin-bottom:20px}.hw-calendar label{display:grid;gap:7px;font-size:13px;font-weight:600}.hw-calendar input,.hw-calendar select{font:inherit;min-width:0;padding:10px;border:1px solid #cdd7e5;border-radius:10px;background:#fff}.hw-calendar-layout{display:grid;grid-template-columns:minmax(280px,.9fr) minmax(0,1.3fr);gap:20px}.hw-calendar-layout>section{background:#fff;border:1px solid #e2e6ed;border-radius:14px;padding:16px;min-width:0}.hw-month-nav{display:flex;justify-content:space-between;gap:8px;margin-bottom:12px}.hw-month-nav input{width:100%;min-width:0}.hw-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.hw-calendar-grid button{padding:8px 2px;border-color:transparent}.hw-calendar-grid small{display:block;font-size:10px;color:#667085;margin-top:4px}.hw-calendar-grid button[aria-pressed=true]{background:#2563eb;color:#fff}.hw-calendar-grid button[aria-pressed=true] small{color:#fff}.hw-weekday{text-align:center;font-size:12px;color:#667085;padding:8px 0}.hw-calendar .hw-row[aria-pressed=true]{border-color:#2563eb;background:#eff6ff}.hw-calendar .hw-row strong{overflow-wrap:anywhere}.hw-calendar footer{flex-wrap:wrap}
@media(max-width:720px){.hw-calendar-layout{grid-template-columns:1fr}.hw-calendar-filters{grid-template-columns:1fr 1fr}.hw-calendar{padding:14px}.hw-calendar-filters button{width:100%}}
/* Clearly distinguish the two participants in a review. */
.hw-review-dialog{border-radius:8px}
.hw-review-scroll>.hw-assignment-card{border-radius:8px;background:#fff;border-left:4px solid #cbd5e1}
.hw-review-scroll>.hw-message{width:calc(100% - 48px);box-sizing:border-box;border-radius:8px;padding:22px;margin-top:20px;margin-bottom:20px}
.hw-review-scroll>.hw-message-student{margin-right:48px;background:#eff6ff;border:1px solid #bfdbfe;border-left:4px solid #3b82f6}
.hw-review-scroll>.hw-message-teacher{margin-left:48px;background:#f0fdf4;border:1px solid #bbdfc8;border-right:4px solid #168348}
.hw-message-author{display:flex;align-items:center;gap:12px;margin-bottom:16px}.hw-author-icon{display:flex;align-items:center;justify-content:center;flex:0 0 36px;height:36px;border-radius:8px;background:#dbeafe;color:#1d4ed8;font-size:15px;font-weight:750}.hw-message-teacher .hw-author-icon{background:#d1fae5;color:#166534}
.hw-author-role{display:block;font-size:11px;font-weight:750;letter-spacing:.05em;text-transform:uppercase;color:#1e40af;margin-bottom:4px}.hw-message-teacher .hw-author-role{color:#166534}.hw-message-author h3{margin:0;font-size:15px}.hw-message-caption{font-size:13px;font-weight:650;color:#344054;margin:0 0 8px}
.hw-message-teacher label{font-size:13px;color:#344054}.hw-message-teacher textarea{margin-top:8px;background:#fff;border-color:#a7cbb3}.hw-message .hw-muted{font-size:12px}.hw-message footer{border-top:1px solid #cde5d5;padding-top:16px;flex-wrap:wrap}
.hw-dialog .hw-revision-button{background:#fff1db;border:1px solid #d68a16;color:#854d0e;font-weight:700;box-shadow:0 1px 2px #854d0e12}.hw-dialog .hw-revision-button:hover:not(:disabled){background:#ffe4b3;border-color:#a86509;filter:none}
.hw-history-student,.hw-history-teacher{padding:14px;margin-top:12px;border-radius:6px}.hw-history-student{background:#eff6ff;border-left:3px solid #3b82f6}.hw-history-teacher{background:#f0fdf4;border-left:3px solid #168348}.hw-history-student>strong,.hw-history-teacher>strong{font-size:12px}.hw-history-student .hw-text,.hw-history-teacher .hw-text{margin-bottom:0}
@media(max-width:600px){.hw-review-scroll>.hw-message{width:100%;margin-left:0;margin-right:0;padding:16px}.hw-message footer button{width:100%}.hw-review-dialog{border-radius:6px}}
.hw-review-dialog[open]{display:flex;flex-direction:column;max-height:90dvh}.hw-review-dialog>.hw-chat-header{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0;padding:14px 20px;border-bottom:1px solid #dbe2ec;background:#fff;flex-shrink:0}.hw-chat-header h2{font-size:18px;margin:0}.hw-chat-header [data-close]{margin-left:auto;flex-shrink:0}.hw-review-dialog>.hw-review-scroll{min-height:0;max-height:none;overflow:auto;padding:18px 20px}.hw-chat{display:grid;gap:12px;margin:16px 0}.hw-chat .hw-message{margin:0;padding:14px;border-radius:8px;border:1px solid #bfdbfe;background:#eff6ff}.hw-chat .hw-message-teacher{background:#f0fdf4;border-color:#bbdfc8}.hw-chat-meta{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px;align-items:center}.hw-chat-meta span{color:#667085}.hw-chat-text{background:#ffffffbf;border:1px solid #dbe2ec;border-radius:6px;padding:12px;margin:10px 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.5}.hw-review-scroll>.hw-review-form.hw-message{width:100%;margin:16px 0 0;padding:16px}.hw-review-dialog .hw-files button{display:inline-flex;align-items:center;gap:6px;max-width:280px;padding:6px 9px;font-size:12px;min-height:32px}.hw-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hw-files small{flex-shrink:0}.hw-files button[data-hw-name]::after{content:none}.hw-teacher-attachments{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:12px}.hw-teacher-attachments .hw-button{cursor:pointer}.hw-review-drafts>div{display:flex;align-items:center;gap:6px}.hw-review-drafts .hw-files{margin-top:8px}.hw-all-files summary{font-size:13px}.hw-review-form .hw-error:empty{display:none}
@media(max-width:600px){.hw-review-dialog>.hw-chat-header{padding:12px;gap:8px}.hw-chat-header h2{font-size:16px}.hw-review-dialog>.hw-review-scroll{padding:12px}.hw-review-dialog .hw-files button{max-width:100%}}
/* Conversation layout: independently scrolling messages and a fixed composer. */
.hw-review-dialog[open]{height:90dvh;background:#fff}
.hw-review-dialog>.hw-review-scroll{flex:1;background:#f8faf9;overscroll-behavior:contain}
.hw-chat{display:flex;flex-direction:column;gap:14px}
.hw-chat .hw-message{width:fit-content;max-width:82%;min-width:min(240px,100%);border:0;padding:14px 16px;background:#edf0ed;border-radius:16px 16px 16px 4px;align-self:flex-start;box-shadow:0 1px 1px #10182806}
.hw-chat .hw-message-teacher{align-self:flex-end;background:#e4f2e9;border-radius:16px 16px 4px 16px}
.hw-chat .hw-chat-text{border:0;background:transparent;padding:0;margin:0 0 10px;font-size:15px;line-height:1.5}
.hw-chat .hw-message{display:flex;flex-direction:column}
.hw-chat .hw-chat-meta{order:3;justify-content:flex-start;font-size:11px;margin-top:8px;gap:6px 12px;color:#667085}
.hw-chat-meta strong{font-weight:500}
.hw-chat .hw-files{margin-top:2px}
.hw-review-dialog>.hw-review-form.hw-message{flex:0 0 auto;max-height:42dvh;overflow:auto;margin:0;padding:14px 20px;border:0;border-top:1px solid #dbe2ec;border-radius:0;background:#fff;width:100%;box-sizing:border-box}
.hw-review-dialog>.hw-review-form label{font-size:13px;gap:5px}
.hw-review-dialog>.hw-review-form textarea{min-height:72px;height:80px;max-height:140px;margin-top:0;resize:vertical}
.hw-review-dialog>.hw-review-form footer{margin-top:10px;padding-top:0;border:0;justify-content:flex-end;gap:10px}
.hw-review-dialog>.hw-review-form .hw-teacher-attachments{margin-top:8px}
.hw-review-dialog>.hw-review-form .hw-teacher-attachments .hw-button{min-height:32px;padding:6px 10px;font-size:12px}
.hw-review-dialog>.hw-review-form .hw-review-drafts{display:flex;gap:8px;flex-wrap:wrap}
.hw-review-dialog>.hw-review-form .hw-error{margin:8px 0 0}
@media(max-width:600px){.hw-chat .hw-message{max-width:94%;min-width:0;padding:12px}.hw-review-dialog>.hw-review-form.hw-message{padding:10px 12px;max-height:45dvh}.hw-review-dialog>.hw-review-form footer{flex-direction:row;align-items:center}.hw-review-dialog>.hw-review-form footer button{width:auto;flex:1;font-size:12px;padding:9px}.hw-review-dialog>.hw-review-form .hw-teacher-attachments>.hw-muted{font-size:11px}}
.hw-chat-header .hw-open-lesson{font-size:12px;padding:7px 10px;min-height:32px;color:#24579a;background:#eff6ff;border-color:#bfdbfe;white-space:nowrap}
.hw-chat-meta [data-edit-message]{padding:2px 6px;font-size:11px;min-height:24px;border:0;background:transparent;color:#24579a}.hw-edit-message{margin-top:12px;order:4;border-top:1px solid #cbd5e1;padding-top:12px}.hw-edit-message label{font-size:12px;display:grid;gap:6px}.hw-edit-message>div{display:flex;gap:8px;margin-top:8px}.hw-edit-message button{font-size:12px;padding:6px 10px}.hw-chat .hw-message:has(.hw-edit-message){width:82%}

.hw-image-viewer{height:90dvh;max-height:90dvh;flex-direction:column}
.hw-image-viewer[open]{display:flex}
.hw-image-viewer>header{flex-shrink:0;gap:12px}
.hw-image-viewer>header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hw-image-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 16px;background:#f4f6fa;border-bottom:1px solid #d5dce8;flex-shrink:0}
.hw-image-tools output{min-width:52px;text-align:center;font-size:13px;font-variant-numeric:tabular-nums;color:#263650}
.hw-image-tools>span{font-size:12px;color:#59677c;margin-left:8px}
.hw-image-viewer button{background:#e0e8f5;color:#233e65;border:1px solid #b9c9e1;border-radius:8px;padding:8px 12px;min-height:38px}
.hw-image-viewer button:hover:not(:disabled){background:#cbdaf0;border-color:#7c9bc6}
.hw-image-viewer button:focus-visible{outline:3px solid #7daaff;outline-offset:2px}
.hw-image-viewer button:disabled{opacity:.45;cursor:default}
.hw-image-viewer [data-save]{background:#315b91;color:#fff;border-color:#315b91}
.hw-image-viewer [data-save]:hover{background:#234674;color:#fff}
.hw-image-viewer .hw-image-stage{position:relative;flex:1;min-height:0;max-height:none;overflow:hidden;padding:0;background:#e5e9f0;touch-action:none}
.hw-image-viewer .hw-image-stage img{position:absolute;max-width:none;max-height:none;flex-shrink:0;border-radius:0;user-select:none;pointer-events:none;transform-origin:center}
.hw-image-stage.is-zoomed{cursor:grab}.hw-image-stage.is-dragging{cursor:grabbing}
@media(max-width:600px){.hw-image-tools{padding:8px;gap:6px}.hw-image-tools>span{display:none}.hw-image-viewer>header strong{flex:1;font-size:12px}}
