:root{font:16px/1.45 system-ui,"Malgun Gothic",sans-serif;color:#16332b;background:#eff3ee;--white:#fff;--green:#165e47;--dark:#123a30;--muted:#526960;--line:#d8e3db;--lime:#d9f287;--pale:#edf5eb;color-scheme:light}
*{box-sizing:border-box}
body{margin:0;min-width:310px}
[hidden]{display:none!important}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;min-height:42px;padding:8px 14px;border:1px solid #cedcd2;border-radius:8px;background:white;font-weight:700;white-space:nowrap}
button:disabled{opacity:.48;cursor:default}
button:not(:disabled):hover{background:#edf5ee;border-color:#a8c4b1}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #238367;outline-offset:2px}
input[type=checkbox]{accent-color:var(--green);width:16px;height:16px;vertical-align:middle}
.primary{background:var(--green);border-color:var(--green);color:white}
button.primary:not(:disabled):hover{background:#104635;color:white}
.small{min-height:33px;padding:4px 9px;font-size:.84rem}
.top{height:70px;background:var(--dark);color:white;display:flex;justify-content:space-between;align-items:center;padding:0 clamp(20px,4vw,60px);border-bottom:1px solid #225444}
.brand{display:flex;align-items:center;gap:11px}
.brand img{width:40px;height:40px;border-radius:10px;border:1px solid #457363}
.brand strong{font-size:1.15rem;letter-spacing:-.05em}
.brand small{margin-left:9px;border-left:1px solid #67907c;padding-left:10px;color:#dae9de;font-weight:650;font-size:.9rem}
.top-status{color:#d0e5d5;font-size:.87rem}
.top-status span{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--lime);margin-right:7px}
main{max-width:1600px;margin:auto;padding:31px clamp(14px,3.2vw,52px) 22px}
.intro{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:21px}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(1.8rem,3vw,2.6rem);letter-spacing:-.07em;line-height:1.1}
.intro p{margin-top:7px;color:var(--muted);font-size:.94rem}
.actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.message{border:1px solid #cbded0;border-radius:8px;padding:10px 13px;margin:0 0 12px;background:#edf7eb;color:#205442;font-size:.9rem}
.message.error{border-color:#edd0c7;background:#fff0e9;color:#922c22}
.workbench{display:grid;grid-template-columns:minmax(168px,.57fr) minmax(270px,1.58fr) minmax(335px,1.1fr);gap:13px}
.panel{min-width:0;background:white;border:1px solid var(--line);border-radius:13px;overflow:hidden;min-height:520px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:7px;min-height:61px;padding:11px 15px;border-bottom:1px solid var(--line)}
.panel h2{font-size:1.04rem;letter-spacing:-.03em}
.counter{border-radius:20px;background:var(--pale);color:#235343;padding:4px 9px;font-size:.85rem;font-weight:750;white-space:nowrap}
.queue-tools{height:auto;min-height:39px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:4px;padding:5px 8px;font-size:.8rem}
.queue-empty{margin:21px 13px;padding:20px 8px;border:1px dashed #c3d6c7;border-radius:10px;text-align:center;color:var(--muted);font-size:.9rem}
.queue-empty span{display:block;font-size:24px;color:#38775d;margin-bottom:8px}
.student{display:flex;align-items:center;border-bottom:1px solid #eef2ee;padding:6px 8px;gap:5px}
.student.active{background:#e9f4e9}
.student button{min-width:0;flex:1;text-align:left;padding:6px 3px;border:none;background:transparent;white-space:normal}
.student strong{display:block;overflow-wrap:anywhere}
.student small{display:block;color:var(--muted);font-size:.76rem;font-weight:550}
#students{max-height:495px;overflow:auto}
.viewer{background:#edf3ef}
.viewer .panel-head{background:#fff}
.photo-empty{min-height:455px;padding:30px 14px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}
.photo-empty h3{margin-top:17px;font-size:1rem}
.photo-empty p{margin:6px 0 12px;color:var(--muted);font-size:.89rem}
.empty-sheet{position:relative;width:103px;height:139px;background:#fff;border:1px solid #d2e2d5;border-radius:5px;box-shadow:0 8px 19px #1943361a;padding:36px 15px 0;transform:rotate(-5deg)}
.empty-sheet span{position:absolute;width:7px;height:7px;background:#155845}
.empty-sheet span:nth-child(1){top:12px;left:12px}.empty-sheet span:nth-child(2){top:12px;right:12px}.empty-sheet span:nth-child(3){bottom:12px;right:12px}.empty-sheet span:nth-child(4){bottom:12px;left:12px}
.empty-sheet i{display:block;margin:9px 0;height:5px;background:repeating-linear-gradient(90deg,#cfe1d5 0 7px,transparent 7px 14px)}
.empty-sheet b{position:absolute;bottom:16px;left:35px;width:34px;height:7px;background:repeating-linear-gradient(90deg,#659c7f 0 2px,transparent 2px 4px)}
.photo-tools{display:flex;align-items:center;justify-content:center;gap:7px;padding:8px 10px}
.photo-tools button[aria-pressed=true]{background:#e3f1e4;border-color:#77a489}
#photo{position:relative;display:table;margin:4px auto 17px;max-width:calc(100% - 20px);line-height:0}
#photo img{display:block;max-width:100%;max-height:560px;width:auto;height:auto;object-fit:contain;border:1px solid #bdccc0;border-radius:3px}
.photo-highlight{position:absolute;pointer-events:none;border:2px solid #e26628;background:#ed973b29}
.result-empty{margin:21px 15px;color:var(--muted);font-size:.93rem}
.result-body{padding:12px}
.field{display:flex;flex-direction:column;gap:4px;font-weight:700;font-size:.88rem}
.field input,.field textarea,select{min-height:39px;background:#fbfdfb;border:1px solid #cbdacf;border-radius:7px;padding:7px 9px;width:100%;font-weight:450}
.wrong{font-size:.86rem;background:#fff0ee;color:#962e25;border-radius:7px;padding:6px 9px;margin-top:7px;overflow-wrap:anywhere}
.review-tools{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:.82rem;margin:9px 0;}
.table-scroll{max-height:390px;overflow:auto}
table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;text-align:center;font-size:.86rem}
th{background:#e8f1e7;padding:8px 4px;position:sticky;top:0;z-index:1}
td{border-bottom:1px solid #e9efe9;padding:5px 3px;overflow-wrap:anywhere;}
.results table th:first-child{width:19%}.results table th:last-child{width:28%}
.status{cursor:pointer;min-height:33px;max-width:100%;padding:3px 7px;border:0;border-radius:6px;font-size:.78rem;}
.status.correct{background:#e0f3d6;color:#24561e}.status.wrong{margin:0;background:#fce0de;color:#921e19}.status.pending{background:#ffecad;color:#73500d}
td input,td select{width:100%;max-width:100%;border:1px solid #cfddd1;border-radius:5px;padding:4px;background:#fff;text-align:center;min-height:32px;font-size:.85rem}
.inline-empty{padding:12px 0;color:var(--muted);font-size:.85rem}
.confirm{width:100%;margin-top:9px}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:13px;padding:11px 13px;background:#fff;border:1px solid var(--line);border-radius:11px}
.toolbar>span{color:var(--muted);font-weight:700;font-size:.9rem;white-space:nowrap}
dialog{width:min(740px,94vw);border:1px solid var(--line);border-radius:14px;padding:0;color:inherit;box-shadow:0 24px 70px #09241d50;max-height:93vh}
dialog::backdrop{background:#0d2c259c}
.dialog-head,.dialog-foot{padding:13px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.dialog-head{border-bottom:1px solid var(--line)}
.dialog-head h2{font-size:1.2rem}
.dialog-head p,.note{font-size:.85rem;color:var(--muted);margin-top:4px}
.dialog-content{padding:14px 16px}
.dialog-foot{border-top:1px solid var(--line);background:white;position:sticky;bottom:0;z-index:2}
.settings-grid{display:grid;grid-template-columns:1fr 100px;gap:10px}
.setup-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:11px 0}
.setup-tools button{font-size:.86rem}
.setup-tools select{width:auto;min-width:130px;max-width:100%}
.bulk-tools{margin:5px 0 0}
.bulk-tools .field{flex-direction:row;align-items:center}.bulk-tools input{width:64px}
#catalog{margin-bottom:10px}
#setup-message{margin-top:9px}
.question-table{margin-top:10px;max-height:290px;overflow:auto}
.question-table th:first-child{width:55px}.question-table th:nth-child(2){width:100px}.question-table th:last-child{width:75px}
.question-table td{padding:4px}
.manual-dialog{width:min(650px,95vw)}
.manual-picture{position:relative;display:table;max-width:calc(100% - 20px);margin:8px auto;line-height:0;cursor:crosshair}
.manual-picture img{display:block;max-height:65vh;max-width:100%;object-fit:contain}
.click-marker{position:absolute;border:2px solid white;background:#178154;color:#fff;border-radius:50%;width:24px;height:24px;display:grid;place-items:center;font-weight:800;transform:translate(-50%,-50%);pointer-events:none}
.sr-only{position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap}
@media(max-width:1030px){.workbench{grid-template-columns:minmax(132px,.56fr) minmax(220px,1.18fr) minmax(288px,1fr)}.panel-head{padding-inline:10px}}
@media(max-width:745px){.workbench{grid-template-columns:1fr}.panel{min-height:0}.photo-empty{min-height:320px}.intro,.toolbar{align-items:flex-start;flex-direction:column}main{padding-top:22px}#students{max-height:195px}.top{height:58px}}
@media(max-width:390px){.top-status{font-size:.73rem}.top-status span{margin-right:3px}}
button.short-switch{display:inline-grid;place-items:center;width:100%;min-height:34px;padding:2px 0;border:0;background:transparent;border-radius:5px}
button.short-switch:not(:disabled):hover{background:#eff4ee}
.short-switch-track{position:relative;display:block;width:46px;height:25px;border:1px solid #b32129;border-radius:20px;background:#a80924}
.short-switch-thumb{position:absolute;display:grid;place-items:center;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:white;color:#8d1924;font-size:.65rem;font-weight:850;line-height:1;box-shadow:0 1px 3px #0004}
.short-switch[data-verdict=correct] .short-switch-track{background:#b7d59c;border-color:#719458}
.short-switch[data-verdict=correct] .short-switch-thumb{transform:translateX(21px);color:#275221}
.short-switch[data-verdict=pending] .short-switch-track{background:#ffcc00;border-color:#a17900}
.short-switch[data-verdict=pending] .short-switch-thumb{transform:translateX(10px);color:#775600}
#review-rows tr[data-verdict=correct]{--verdict-fill:#e9f5e8;--verdict-ink:#265532;--verdict-line:#71a773}
#review-rows tr[data-verdict=wrong]{--verdict-fill:#ffdedb;--verdict-ink:#801e24;--verdict-line:#c53d45}
#review-rows tr[data-verdict=pending]{--verdict-fill:#fff0bd;--verdict-ink:#695016;--verdict-line:#c79423}
#review-rows td{background:var(--verdict-fill);color:var(--verdict-ink);border-bottom-color:#fff}
#review-rows td:first-child{border-inline-start:4px solid var(--verdict-line)}
#review-rows tr[data-verdict=wrong] td:nth-child(2){font-weight:750}

.page-error{margin:5px 10px 9px}
.printed-settings{margin:9px 0 12px;padding:9px 10px;border:1px solid var(--line);border-radius:8px}
.printed-settings summary{font-size:.88rem;font-weight:700;cursor:pointer}
.printed-settings .field{margin-top:8px;max-width:275px}
