:root{font-family:"Courier New",Courier,monospace;color:#242424;background:#fff;font-size:15px;--green:#d9ffd9;--line:#a6a6a6;--blue:#477cff}*{box-sizing:border-box}body{margin:0}main{max-width:1880px;margin:38px auto;padding:0 34px}header{display:flex;align-items:center;gap:70px;margin-bottom:32px;flex-wrap:wrap}.course{display:flex;align-items:center;gap:65px;font-size:32px;white-space:nowrap}h1{font-size:34px;font-weight:400;margin:0}h2{font-size:18px;font-weight:400;margin:0 0 20px}.legend{display:flex;gap:70px;font-size:15px}.legend span{border:1px solid var(--line);padding:12px 16px;text-align:center;min-width:114px;background:#fafafa}.legend .received,.received{background:var(--green)}#account{margin-left:auto;font-size:13px;line-height:1.8}button,input,select{font:inherit}button{border:1px solid #999;background:#fafafa;padding:9px 16px;color:#222;cursor:pointer}button:hover{background:#eaeaea}button:disabled{opacity:.55;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--blue);outline-offset:2px}a,.link{color:var(--blue);text-decoration:underline;cursor:pointer}input,select{border:1px solid var(--line);background:#fff;padding:9px;min-width:0}label{display:flex;flex-direction:column;gap:8px}small,.muted{color:#626262;font-size:13px;line-height:1.6}.tabs{display:flex;gap:0}.tabs button{border-bottom:0}.selected{background:var(--green)}#auth{max-width:520px;margin:60px auto 100px}#authForm{border:1px solid var(--line);padding:28px;display:grid;gap:18px}#authForm h2{margin:0}#authHint{margin:0}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:45px}.toolbar h2{margin:0}.toolbar>div{display:flex;gap:16px;align-items:center}#searchLabel{flex-direction:row;align-items:center}.table-wrap{overflow:auto;border:1px solid var(--line)}table{border-collapse:collapse;width:100%;background:#fafafa;font-size:14px}th,td{border:1px solid var(--line);font-weight:400;text-align:left}th{vertical-align:bottom;height:55px;padding:5px}th:first-child,td:first-child{position:sticky;left:0;z-index:1;background:#fafafa;min-width:250px}th:first-child{z-index:2}th.assignment{text-align:center;min-width:99px}th.assignment span{display:block;margin-bottom:7px;color:var(--blue);text-decoration:underline}th small{white-space:nowrap;font-size:13px;color:#333}td{height:29px;padding:0}td>button{display:block;width:100%;height:100%;min-height:29px;border:0;background:transparent;padding:5px;text-align:left;font-size:14px}td.status>button{text-align:center;color:#39723d}td.status.received>button:hover{background:#c1f2c1}td.status:not(.received)>button:hover{background:#eee}.date{min-width:150px;text-align:center}td.date{font-size:13px;padding:4px}.empty{text-align:center;padding:35px}#uploadSection{border:1px solid var(--line);padding:24px;margin-top:35px}#uploadForm{display:flex;align-items:start;gap:24px;flex-wrap:wrap}#uploadForm button{align-self:center;background:var(--green)}.files-label{flex:1;min-width:240px}#notice:empty{display:none}#notice{border:1px solid #aaa;padding:14px;margin:15px 0;background:#f5f8ff;line-height:1.5}#notice.error{background:#fff0ee;color:#8b2b20}footer{margin-top:40px;border-top:1px solid #ddd;padding-top:16px;font-size:12px;color:#777;display:flex;justify-content:space-between;gap:20px}dialog{width:min(850px,95vw);max-height:85vh;border:1px solid #999;padding:26px;font:inherit}dialog::backdrop{background:#0005}.dialog-head{display:flex;justify-content:space-between;align-items:start;gap:20px}.dialog-head button{padding:3px 10px;font-size:22px}.folder-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.folder-list button{text-align:left;min-height:75px}.file-row{padding:14px 0;border-top:1px solid #ccc;overflow-wrap:anywhere}.file-row small{display:block;margin-top:6px}.back{margin-bottom:20px}[hidden]{display:none!important}@media(max-width:800px){main{margin:24px auto;padding:0 15px}header{gap:25px}.course{font-size:25px;gap:30px}h1{font-size:28px}.legend{gap:20px}.legend span{padding:8px;min-width:100px}#account{margin-left:0}.toolbar{align-items:start;flex-direction:column}.toolbar>div{flex-wrap:wrap}#searchLabel{flex-direction:column;align-items:start}#auth{margin-top:30px}.folder-list{grid-template-columns:1fr 1fr}th:first-child,td:first-child{min-width:190px}footer{flex-direction:column}}
/* Три самостоятельных представления: общая таблица, студент, преподаватель. */
nav{display:flex;gap:10px;flex-wrap:wrap;border-bottom:1px solid #ccc;padding-bottom:18px}nav .selected{background:var(--green)}.toolbar>div:first-child{display:block}.toolbar #summary{margin:10px 0 0}#tableHint{max-width:none;margin:20px 0}th strong{font-weight:400;display:block;margin-bottom:7px}th small{display:block}th:first-child,td:first-child{position:static;min-width:0;z-index:auto}.teacher-table th:first-child,.teacher-table td:first-child{position:sticky;left:0;z-index:1;min-width:250px;background:#fafafa}.teacher-table thead th:first-child{z-index:2}.teacher-table tbody th{height:auto;padding:0;vertical-align:middle}.teacher-table tbody th>button{font:inherit;display:block;width:100%;border:0;background:transparent;text-align:left;padding:7px}.teacher-table tbody th:not(:has(button)){padding:7px}.teacher-table .status{text-align:center;color:#555}.teacher-table .status.received{color:#39723d}.teacher-table td.status>span{display:block;padding:6px}.header-actions{display:flex;flex-direction:column;gap:7px;margin-top:10px}.header-actions button{font-size:12px;padding:6px 4px;white-space:nowrap}.header-actions .link{border:0;background:transparent}.header-actions small{font-size:11px;white-space:normal;color:#666}.teacher-table th.assignment{min-width:132px}.verification{padding:0 7px 5px;font-size:11px!important;color:#777}.student-table th{min-width:155px;text-align:center;padding:12px 6px;height:68px;position:static!important}.student-table th:first-child,.student-table td:first-child{min-width:155px;position:static;background:inherit}.student-table td.student-status{padding:16px 6px;text-align:center;height:100px;vertical-align:top}.student-status>span,.student-status>small{display:block;margin-bottom:8px}.student-status .link{min-height:25px;padding:0;text-align:center;font-size:12px}.student-table .student-actions{padding:10px;vertical-align:top}.student-actions>button{border:1px solid #999;text-align:center;margin-bottom:10px;padding:10px 6px;font-size:12px;min-height:40px}.student-actions .link{border:0;background:none;font-size:12px}.student-actions small{display:block;text-align:center;font-size:11px}#uploadForm{display:block}#uploadForm input[type=file]{width:100%}#selectedFiles{white-space:pre-wrap;overflow-wrap:anywhere}#uploadError{color:#9b2727}.form-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.form-actions #sendUpload{background:var(--green)}#uploadForm #cancelUpload{background:#fafafa}.version-title{background:var(--green);border:1px solid #aaa;padding:12px;line-height:1.6}.history{border-top:1px solid #aaa;margin-top:25px;padding-top:15px}.history summary{cursor:pointer;color:var(--blue);text-decoration:underline}.history h3{font-size:14px;font-weight:400;margin:25px 0 10px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}#account span{overflow-wrap:anywhere}@media(max-width:800px){.teacher-table th:first-child,.teacher-table td:first-child{min-width:160px;max-width:190px}.teacher-table tbody th>button{overflow-wrap:anywhere}.toolbar>div{width:100%}#searchLabel{flex:1}#search{width:100%}.student-table th,.student-table th:first-child,.student-table td:first-child{min-width:150px}#authForm{padding:20px}#account{width:100%}.form-actions{flex-wrap:wrap}.form-actions button{flex:1}dialog{padding:18px}.legend{gap:15px}}

.student-table td.student-status.received{background:var(--green)}
.student-table td>button{height:auto}.student-table .student-status .link{height:auto;min-height:30px}.student-table .student-actions>button{height:auto;min-height:40px}.student-table .student-actions .link{min-height:30px}
/* Все столбцы помещаются в ширину страницы без горизонтальной прокрутки. */
main{max-width:none}
.table-wrap{width:100%;max-width:100%;overflow:visible}
#journal{table-layout:fixed;width:100%;font-size:clamp(9px,.85vw,14px)}
#journal th,#journal td{min-width:0;max-width:none;overflow-wrap:anywhere;white-space:normal}
#journal th:first-child,#journal td:first-child{position:static;min-width:0;max-width:none}
#journal.teacher-table th:first-child{width:18%}
#journal.teacher-table th.date{width:8%}
#journal.student-table th{width:8.333333%}
#journal th small,#journal small,#journal button,#journal td.date{font-size:inherit;white-space:normal;overflow-wrap:anywhere}
#journal th{padding:8px 3px}
#journal th strong{overflow-wrap:normal;word-break:normal}
#journal .header-actions{gap:6px}
#journal button{max-width:100%;min-width:0;padding:6px 2px}
#journal .student-status{padding:12px 2px}
#journal .student-actions{padding:6px 2px}
#journal .student-actions button{padding:8px 2px}
#journal .status>span{padding:6px 1px}
#journal .date{padding:4px 2px}
@media(max-width:600px){
 main{padding:0 8px}
 #journal{font-size:9px}
 #journal th{padding:6px 1px}
 #journal th strong{overflow-wrap:anywhere}
 #journal .student-actions{padding:4px 1px}
 #journal .header-actions button{padding:5px 1px}
 #journal.teacher-table tbody th>button,#journal.teacher-table tbody th:not(:has(button)){padding:5px 2px}
 #journal .verification{padding:2px;font-size:8px!important}
}

.assignment-link{display:block;margin-bottom:7px;color:var(--blue);text-decoration:underline}.auth-switch{margin:0;font-size:14px;line-height:1.6}
/* v1: одна таблица; доступные действия находятся в строке владельца. */
#journal.unified-table th:first-child{width:22%}
#journal.unified-table tbody th{vertical-align:middle}
#journal .cell-controls{position:relative;min-height:48px;display:flex;align-items:center;justify-content:center}
#journal .cell-open{display:block;width:100%;height:48px;min-height:48px;border:0;background:transparent;text-align:center;padding:4px;cursor:pointer}
#journal .cell-open:hover{background:#00000008}
#journal .upload-icon{width:30px;height:34px;min-height:34px;padding:5px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #8b9c8b;background:#fff;color:#32643a;cursor:pointer}
#journal .upload-icon svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#journal .replace-icon{position:absolute;right:2px;bottom:3px;width:23px;height:24px;min-height:24px;padding:3px;background:var(--green)}
#journal .replace-icon svg{width:15px;height:15px}

#journal .own-row>th,#journal .own-row>td:not(.received){background:rgba(71,124,255,.07)}
#journal .own-label,#journal .rank-label{display:block;padding:0 7px 6px;color:#666;font-size:11px}
#journal .own-label{color:#32643a}
#journal .rank-top .student-name{color:#237236}
#journal .rank-bottom .student-name{color:#b43b32}
#journal .rank-top .rank-label{color:#237236}
#journal .rank-bottom .rank-label{color:#b43b32}
@media(max-width:600px){#journal .upload-icon{width:22px;padding:2px}#journal .upload-icon svg{width:14px}#journal .replace-icon{width:18px;right:1px}#journal .own-label,#journal .rank-label{padding:2px;font-size:8px}}

/* Компактные строки журнала: 20 студентов занимают около 520 px. */
#journal.unified-table tbody th,#journal.unified-table tbody td{height:26px;padding:0}
#journal .cell-controls{min-height:25px;height:25px}
#journal .cell-open{height:25px;min-height:25px;padding:2px}
#journal .upload-icon{width:22px;height:22px;min-height:22px;padding:2px}
#journal .upload-icon svg{width:14px;height:14px}
#journal.unified-table tbody th>button{padding:3px 5px}
#journal.unified-table tbody th:not(:has(button)){padding:3px 5px}
#journal .own-label{display:inline;padding:0 5px;font-size:8px;line-height:1}
#journal .own-row>th{position:relative}
.toolbar{margin-top:20px}
#tableHint{margin:12px 0}
header{margin-bottom:18px}
nav{padding-bottom:10px}
#journal.unified-table tbody th,#journal.unified-table tbody td{height:22px}
#journal .cell-controls,#journal .cell-open{height:21px;min-height:21px}
#journal .upload-icon{height:19px;min-height:19px;width:20px}
#journal.unified-table tbody th>button,#journal.unified-table tbody th:not(:has(button)){padding:2px 4px}
#journal .own-label{display:none}
.toolbar{flex-direction:row;align-items:center;gap:10px}
.toolbar>div{width:auto}
@media(max-width:800px){header{gap:12px}.course{font-size:23px}main{margin-top:16px}#account{width:auto;margin-left:auto;font-size:11px}.toolbar h2{font-size:16px}.toolbar #summary{font-size:11px}#tableHint{font-size:12px}}
#journal .header-actions{align-items:center;margin-top:4px}
#journal.unified-table thead th{padding-top:4px;padding-bottom:4px}
#journal.unified-table tbody th{line-height:1.05}

#recovery{max-width:520px;margin:30px auto}#recoveryForm{border:1px solid var(--line);padding:24px;display:grid;gap:18px}#recoveryForm h2,#recoveryHint{margin:0}

.dialog-head h2[tabindex="-1"]:focus{outline:none}

#tableHint{width:100%;max-width:none}
