/* Siqma / framed-sheet. At 1440: 228px rail + 1204px work column + 8px inset.
   Sheet content: 1204 - 2px border - 64px padding = 1138px. 24px shared grid gutter. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/ibm-plex-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/ibm-plex-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root{color-scheme:light;--ground:#f5f4f1;--surface:#fff;--raised:#f8f8f6;--active:#eae9e5;--border:#e7e6e2;--rule:#efeeeb;--control:#d4d3cf;--ink:#252825;--muted:#62665f;--accent:#b84b0a;--accent-hover:#903907;--accent-pressed:#763007;--accent-soft:#fff2e8;--ok:#237548;--ok-soft:#edf5ef;--bad:#b83b38;--bad-soft:#fbefed;--warn:#8b681c;--warn-soft:#fbf6e8;--radius:12px;--gap:24px;--font:'IBM Plex Sans',sans-serif;--sidebar-width:228px;--bg:var(--ground);--card:var(--surface);--mut:var(--muted);--line:var(--border);--soft:var(--raised)}
*{box-sizing:border-box;min-width:0}html{scroll-behavior:smooth;scroll-padding-top:24px}body{margin:0;font:400 14px/1.5 var(--font);color:var(--ink);background:var(--ground);-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit}button,a,label.btn{touch-action:manipulation}button{cursor:pointer}a{color:inherit;text-underline-offset:3px}p{margin:0 0 12px}h1,h2,h3{margin:0;line-height:1.3;font-weight:600;text-wrap:balance}h1{font-size:26px;letter-spacing:-.025em}h2{font-size:17px;letter-spacing:-.01em}h3{font-size:15px}button,select,input,textarea{color:var(--ink)}button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 14px;border:1px solid transparent;border-radius:6px;background:transparent;font-weight:500;line-height:1.3;text-decoration:none;transition:background-color .15s,color .15s,border-color .15s;white-space:nowrap}button:hover,.btn:hover{background:var(--active)}button:active,.btn:active{background:#deddd7}.primary{background:var(--accent);color:#fff;border-color:var(--accent)}.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}.primary:active{background:var(--accent-pressed);border-color:var(--accent-pressed)}.secondary,.ghost{background:var(--surface);border-color:var(--control)}.secondary:hover,.ghost:hover{background:var(--raised);border-color:#b4b6ae}.text-button{padding:4px 0;min-height:30px;justify-content:flex-start;border-radius:3px;color:var(--ink);white-space:normal}.text-button:hover{background:transparent;text-decoration:underline;text-underline-offset:4px}.icon-button{width:36px;height:36px;min-height:36px;padding:8px;flex:none;border-radius:6px}.icon{width:18px;height:18px;flex:none;display:inline-block;vertical-align:middle}.danger{color:var(--bad);border-color:#e7c7c3;background:white}.danger:hover{background:var(--bad-soft);border-color:var(--bad)}button:disabled,.btn[aria-disabled=true]{cursor:not-allowed;color:var(--muted);background:var(--raised);border-color:var(--border)}.primary:disabled{color:#e8e8e5;background:#666b63}.hide{display:none!important}.mut{color:var(--muted)}.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}.skip-link{position:fixed;top:8px;left:8px;z-index:100;transform:translateY(-160%);padding:10px 16px;border-radius:6px;background:var(--ink);color:white}.skip-link:focus{transform:translateY(0)}:focus-visible{outline:2px solid var(--accent);outline-offset:3px}::selection{background:#ffe0c7;color:#71320b}input,select,textarea{width:100%;border:1px solid var(--control);background:white;border-radius:6px;min-height:40px;padding:9px 12px;transition:border-color .15s;caret-color:var(--accent)}input:hover,textarea:hover,select:hover{border-color:#a9ada3}input:focus,textarea:focus,select:focus{border-color:var(--accent)}input::placeholder,textarea::placeholder{color:#696d65;opacity:1}input[type=checkbox]{width:18px;height:18px;min-height:18px;accent-color:var(--ink);padding:0;flex:none}input[type=file]{min-height:0}.btn input[type=file]{position:absolute;width:1px;height:1px;opacity:0;padding:0;overflow:hidden}.btn{position:relative;cursor:pointer}.btn:focus-within{outline:2px solid var(--accent);outline-offset:3px}label{display:block;font-size:13px;font-weight:500;margin-bottom:7px}.field{display:flex;flex-direction:column;gap:0}.field-note{color:var(--muted);font-size:12px;margin:10px 0 0}.field-error{color:var(--bad);font-size:13px;margin:10px 0 0}.brand{display:flex;gap:9px;align-items:center;text-decoration:none;font-size:29px;font-weight:600;letter-spacing:-.045em;width:fit-content}.brand-mark{width:25px;height:31px;color:var(--accent);flex:none}.brand-period{color:var(--accent)}
/* Authentication: real printed card as evidence; no invented results. */
.auth-layout{display:grid;grid-template-columns:1fr 1fr;min-height:100vh;background:white}.auth-story{position:relative;display:flex;flex-direction:column;background:var(--ground);padding:36px 48px 24px;overflow:hidden}.auth-story-content{max-width:470px;margin:56px auto 28px;width:100%}.auth-story h2{font-size:42px;letter-spacing:-.035em;line-height:1.14}.auth-story p{font-size:16px;color:var(--muted);margin:20px 0 28px}.auth-paper{position:relative;margin:0 22px 0 0;max-width:390px;padding:18px;background:white;border:1px solid var(--border);border-radius:4px;max-height:316px;overflow:hidden}.auth-paper>img{display:block;width:100%;height:auto}.paper-caption{position:absolute;bottom:0;left:0;right:0;background:white;border-top:1px solid var(--border);padding:14px 18px;font-size:14px;font-weight:500;display:flex;justify-content:space-between}.paper-caption span{font-size:12px;color:var(--muted);font-weight:400}.auth-main{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 40px 24px}.auth-form-wrap{width:100%;max-width:360px;margin:auto}.auth-form-wrap h1{font-size:28px;margin:0 0 10px}.auth-form-wrap>.mut{font-size:15px;margin-bottom:32px}.auth-form-wrap .field{margin-bottom:20px}.auth-submit{width:100%;height:44px;justify-content:space-between}.password-field{position:relative}.password-field input{padding-right:48px}.password-field button{position:absolute;right:4px;top:3px}.auth-status{font-size:13px;color:var(--muted);margin:0 0 14px;min-height:20px}.auth-status.error{color:var(--bad)}.auth-help{font-size:13px;line-height:1.6;color:var(--muted);margin-top:20px}.auth-footer{display:flex;justify-content:space-between;gap:24px;width:100%;font-size:12px;color:var(--muted);margin-top:60px;max-width:420px}.auth-mini-brand{display:none}
/* Navigation and white working sheet. */
.app-shell{display:grid;grid-template-columns:var(--sidebar-width) minmax(0,1fr);min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:24px 14px 16px}.sidebar>.brand{margin:0 14px 24px}.workspace-label{font-size:12px;color:var(--muted);padding:0 14px;margin-bottom:12px}.sidebar nav{display:flex;flex-direction:column;gap:5px}.sidebar button[data-t]{justify-content:flex-start;padding:10px 13px;gap:11px;min-height:42px;text-align:left;color:#5d6259;font-weight:400;width:100%;border:0;border-radius:6px}.sidebar button[data-t] .icon{width:17px;height:17px}.sidebar button[data-t][aria-selected=true]{background:var(--active);color:var(--ink);font-weight:500}.sidebar button[data-t]:hover{background:#edede8}.sidebar-bottom{margin-top:auto}.account{border-top:1px solid #e0e0d9;padding:18px 0 0;margin-top:16px;display:flex;gap:10px;align-items:center}.avatar{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;flex:none;background:#fff2e8;color:#78370a;font-size:13px;font-weight:600}.account>div{flex:1;overflow:hidden}.account strong{font-size:13px;font-weight:500;display:block}.account #userLabel{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.account .icon-button{width:30px;padding:6px}.app-column{min-width:0;padding-right:8px;padding-bottom:8px}.topbar{height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 24px 0 32px}.breadcrumb{display:flex;align-items:center;gap:12px;font-size:13px}.breadcrumb-parent{color:var(--muted)}.breadcrumb>.icon{width:12px;height:12px;color:#787c73}.topbar-right{display:flex;align-items:center;gap:16px}.topbar-date{font-size:12px;color:var(--muted)}.workspace-sheet{background:var(--surface);border:1px solid var(--border);border-radius:16px;min-height:calc(100vh - 72px);padding:32px;outline:none;display:flex;flex-direction:column}.workspace-sheet>section{flex:1}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:24px}.page-heading p{color:var(--muted);margin:7px 0 0;font-size:14px}.page-heading>.primary{flex:none}.exam-context{display:flex;align-items:center;gap:18px;background:var(--raised);padding:13px 16px;border:1px solid var(--border);border-radius:8px;margin-bottom:28px}.context-field{display:flex;align-items:center;gap:12px;flex:1;max-width:470px}.context-field label{white-space:nowrap;margin:0;color:var(--muted);font-size:12px}.context-field select{min-height:34px;padding:6px 28px 6px 10px;font-size:13px;background-color:white}.context-type{font-size:12px;color:var(--muted);margin-left:auto}.exam-context>.icon-button{width:30px;height:30px;min-height:30px}.status-tag{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;flex:none;font-size:12px;font-weight:500;padding:3px 8px;border-radius:4px;line-height:1.4}.status-tag:before{content:'';width:5px;height:5px;flex:none;background:currentColor;border-radius:50%}.status-tag.success{background:var(--ok-soft);color:var(--ok)}.status-tag.warning{background:var(--warn-soft);color:var(--warn)}.status-tag.neutral{background:var(--active);color:#5b6056}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.section-heading>.mut{font-size:12px}.section-intro{color:var(--muted);max-width:65ch;margin-bottom:24px}.workspace-footer{display:flex;justify-content:space-between;align-items:center;gap:24px;border-top:1px solid var(--rule);padding-top:18px;margin-top:36px;font-size:12px;color:var(--muted)}#syncState{display:flex;align-items:center;gap:7px}#syncState:before{content:'';width:5px;height:5px;background:var(--ok);border-radius:50%;flex:none}#syncState.w:before{background:var(--bad)}.operation-notice{display:flex;align-items:center;gap:14px;padding:12px 16px;border-radius:6px;background:var(--bad-soft);color:#8b302c;margin-bottom:20px}.operation-notice>span{flex:1}.operation-notice .text-button{color:inherit;flex:none}.operation-notice .icon-button{width:28px;height:28px;min-height:28px;padding:5px}.toast{position:fixed;z-index:100;bottom:24px;left:50%;transform:translateX(-50%);padding:12px 18px;background:var(--ink);color:white;border-radius:8px;max-width:min(90vw,560px);font-size:14px;box-shadow:0 5px 20px #0002}
/* Actual exam data, no placeholder dashboard metrics. */
.metric-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-bottom:1px solid var(--border);margin-bottom:28px;padding-bottom:24px}.metric{padding:0 24px;border-left:1px solid var(--border)}.metric:first-child{padding-left:0;border-left:0}.metric-label{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}.metric-value{font-size:30px;font-weight:400;letter-spacing:-.02em;line-height:1.2;font-variant-numeric:tabular-nums}.overview-grid{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:32px}.search-field{display:flex;align-items:center;gap:8px;border:1px solid var(--control);border-radius:6px;padding:0 10px;background:white;min-height:38px}.search-field .icon{width:16px;height:16px;color:var(--muted)}.search-field input{border:0;padding:8px 0;min-height:36px;background:none;outline:none;font-size:13px}.search-field:focus-within{outline:2px solid var(--accent);outline-offset:2px}.exam-search{max-width:300px;margin-bottom:12px}.exam-row{display:grid;grid-template-columns:minmax(0,1fr) 106px 64px 28px;align-items:center;gap:16px;min-height:86px;border-bottom:1px solid var(--rule);padding:14px 0}.exam-row .exam-name{font-size:14px;font-weight:500;margin:0 0 4px;text-align:left;justify-content:flex-start}.exam-row p{font-size:12px;color:var(--muted);margin:0}.exam-row .exam-result-count{text-align:right;font-size:14px;font-variant-numeric:tabular-nums}.exam-row .exam-result-count span{display:block;font-size:12px;color:var(--muted)}.exam-row .icon-button{width:28px;height:28px;min-height:28px;padding:5px}.next-action{padding-bottom:24px;border-bottom:1px solid var(--rule)}.next-action h3{margin:12px 0 8px}.next-action p{font-size:13px;color:var(--muted);line-height:1.6;margin-bottom:16px}.next-action .primary{width:100%;justify-content:space-between;font-size:13px}.bubble-strip{display:flex;gap:3px;flex-wrap:wrap;margin:14px 0 8px}.bubble-strip i{width:7px;height:7px;border:1px solid #b9bcb3;border-radius:50%}.bubble-strip i.filled{background:var(--ink);border-color:var(--ink)}.workflow-list{list-style:none;margin:0;padding:0;display:grid;gap:20px}.workflow-list li{display:flex;gap:12px}.step-number{width:23px;height:23px;border:1px solid var(--control);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;flex:none;margin-top:3px}.workflow-list button{font-size:13px;min-height:24px;padding:1px 0;line-height:1.4}.workflow-list p{font-size:12px;color:var(--muted);margin:4px 0 0}.pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px;margin-top:18px}.pagination:empty{display:none}.pagination .inline-actions{gap:6px}.pagination button{font-size:12px;min-height:32px;padding:6px 10px}
/* Scan: upload first; a readable sheet beside the result, never a thumbnail beside a giant score. */
.scan-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:32px}.upload-area{border:1px dashed #c9ccc2;border-radius:12px;background:#fdfdfb;padding:48px 28px;min-height:380px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center}.upload-area.drag-over{background:var(--accent-soft);border-color:var(--accent)}.upload-icon{margin-bottom:20px;color:#666f5d}.upload-icon>.icon{width:38px;height:38px}.upload-area h2{font-size:21px;margin-bottom:12px}.upload-area #scanHint{font-size:14px;max-width:43ch;line-height:1.65;margin-bottom:24px}.upload-actions{display:flex;align-items:center;justify-content:center;gap:10px}.upload-actions .btn{height:42px}.upload-caption{font-size:12px;color:var(--muted);margin:16px 0 0}.upload-area.key-incomplete{border-style:solid}.upload-area.key-incomplete .upload-actions .btn,.upload-area.key-incomplete .upload-caption{display:none}.upload-area #prepareKey{margin-top:6px;color:var(--accent)}.scan-guide{padding:16px 4px 0}.guide-paper{width:126px;padding:6px;border:1px solid var(--border);border-radius:3px;background:white;margin-bottom:22px}.guide-paper img{width:100%;height:auto;display:block}.scan-guide h3{margin-bottom:16px}.check-list{list-style:none;padding:0;margin:0;display:grid;gap:12px;font-size:12px;color:var(--muted)}.check-list li{display:flex;gap:8px;align-items:center}.check-list .icon{width:15px;height:15px;color:var(--ok)}.status{margin-top:16px;padding:12px 14px;border-radius:6px;background:var(--raised);text-align:left;font-size:13px;line-height:1.6}.status.err{background:var(--bad-soft);color:#8b302c}.status .mut{color:inherit}.spin{display:inline-block;width:15px;height:15px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite;vertical-align:-2px;margin-right:7px}@keyframes spin{to{transform:rotate(360deg)}}#t-scan.has-scan .scan-layout{grid-template-columns:1fr}#t-scan.has-scan .scan-guide{display:none}#t-scan.has-scan .upload-area{min-height:0;padding:14px 18px;flex-direction:row;justify-content:flex-start;gap:16px;text-align:left;border:1px solid var(--border);background:white;border-radius:8px}#t-scan.has-scan .upload-icon{margin:0}#t-scan.has-scan .upload-icon .icon{width:23px;height:23px}#t-scan.has-scan .upload-area h2{font-size:14px;margin:0}#t-scan.has-scan #scanHint,#t-scan.has-scan .upload-caption{display:none}#t-scan.has-scan .upload-actions{margin-left:auto}#t-scan.has-scan .upload-actions .btn{height:34px;min-height:34px;font-size:12px;padding:6px 10px}#t-scan.has-scan .upload-area .status{flex-basis:100%;margin:0}#t-scan.has-scan .upload-area{flex-wrap:wrap}.scan-result-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 16px}.scan-result-grid{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(340px,1fr);gap:28px;align-items:start}.card-review{min-width:0}.review-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--raised);border:1px solid var(--border);border-radius:8px 8px 0 0;padding:8px 12px;font-size:12px;color:var(--muted)}.review-toolbar>span{display:flex;align-items:center;gap:7px}.review-toolbar .text-button{font-size:12px}.canvas-frame{background:#efefeb;border:1px solid var(--border);border-top:0;padding:14px;border-radius:0 0 8px 8px;overflow:auto}#ov{width:100%;height:auto;display:block;background:white;touch-action:manipulation}.card-review.expanded .canvas-frame{max-height:800px}.card-review.expanded #ov{width:850px;max-width:none}.legend{display:flex;gap:16px;flex-wrap:wrap;margin:12px 0 8px;font-size:12px;color:var(--muted)}.legend i{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}.legend-c{background:var(--ok)}.legend-w{background:var(--bad)}.legend-k{background:#cba344}.review-hint{font-size:12px;line-height:1.6}.score-heading{padding:2px 0 20px}.score-heading>span{font-size:13px;color:var(--muted)}.score{display:flex;align-items:baseline;gap:10px;margin:8px 0 10px;font-variant-numeric:tabular-nums}.score b{font-size:40px;line-height:1.1;letter-spacing:-.03em;font-weight:500}.score>span{font-size:13px;color:var(--muted)}#sLine{font-size:13px;margin:0;color:var(--muted)}.c{color:var(--ok)}.w{color:var(--bad)}table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}th{text-align:left;font-size:12px;font-weight:400;color:var(--muted);height:40px}td{padding:12px 8px;border-bottom:1px solid var(--rule)}th:first-child,td:first-child{padding-left:0}th:last-child,td:last-child{padding-right:0}td.n,th.n{text-align:right}.score-table{border-top:1px solid var(--border)}.score-table td{font-size:12px;padding:10px 6px}.score-table td:first-child{padding-left:0}.score-table td:last-child{padding-right:0}.student-section{margin-top:24px;padding-top:20px;border-top:1px solid var(--border)}.student-section h3{margin-bottom:14px}.name-evidence{margin-bottom:18px}.name-evidence summary{font-size:12px;color:var(--muted);cursor:pointer}.name-evidence img{width:100%;height:auto;display:block;border:1px solid var(--border);border-radius:4px;margin-top:10px}.name-evidence p{font-size:12px;margin:7px 0 0}.student-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.student-fields input{font-size:13px}.scan-save-actions{display:flex;gap:10px;margin-top:20px}.scan-save-actions>*{flex:1}.scan-save-actions .btn{font-size:13px}.answer-correction{border-top:1px solid var(--border);padding-top:14px;margin-top:18px}.answer-correction summary{font-size:13px;cursor:pointer;font-weight:500}.manual-row{display:flex;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--rule)}.manual-row>label{width:70px;margin:0;font-size:12px}.manual-row>select{width:auto;flex:1;min-height:34px;font-size:12px}.manual-row>span{font-size:12px;color:var(--muted)}#manualAnswers{max-height:320px;overflow-y:auto;margin-top:10px}
/* Answer-key editor and preparation. */
.exam-settings{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.7fr);gap:20px 40px;padding-bottom:24px;margin-bottom:28px;border-bottom:1px solid var(--border)}.exam-settings>.field{max-width:520px}.exam-settings>.switch{align-self:center}.exam-settings>#exInfo{grid-column:1/-1;font-size:12px;line-height:1.7;margin:0}#exInfo b{font-weight:500;color:var(--ink)}.switch{display:flex;gap:10px;align-items:center;margin:0;font-size:13px;font-weight:400;cursor:pointer}.switch small{display:block;color:var(--muted);font-size:12px;margin-top:3px}.key-heading{display:flex;justify-content:space-between;gap:24px;align-items:center;margin-bottom:16px}.key-heading p{font-size:12px;margin:7px 0 0}.inline-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.inline-actions button,.inline-actions .btn{font-size:12px;min-height:34px;padding:7px 11px}.key-progress{height:5px;border-radius:4px;background:var(--active);margin-bottom:26px;overflow:hidden}.key-progress>span{display:block;height:100%;background:var(--ok);border-radius:4px;transition:width .2s}.subject-tabs{display:flex;align-items:center;gap:24px;border-bottom:1px solid var(--border);margin-bottom:24px;overflow-x:auto}.subject-tabs button{flex:0 0 auto;position:relative;border:0;border-radius:0;padding:12px 0;white-space:nowrap;color:var(--muted);min-height:42px;font-size:13px}.subject-tabs button[aria-selected=true]{color:var(--ink)}.subject-tabs button[aria-selected=true]:after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--ink)}.subject-tabs button:hover{background:none;color:var(--ink)}.subject-tabs small{margin-left:6px;font-size:12px}.keygrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}.subject-group{min-width:0}.subject-group>h3{font-size:13px;margin:0 0 14px;display:flex;justify-content:space-between;gap:10px}.subject-group>h3>span{font-size:12px;color:var(--muted);font-weight:400}.kq{display:flex;gap:6px;align-items:center;min-height:43px;padding:4px 0}.kq b{width:25px;margin-right:4px;font-size:12px;text-align:right;font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums}.kq.miss b{color:var(--bad)}.kq button{width:30px;height:30px;min-height:30px;padding:0;border-radius:50%;font-size:12px;border:1px solid var(--control);font-weight:400;background:white}.kq button:hover{border-color:var(--ink)}.kq button.on{background:var(--ink);border-color:var(--ink);color:white}.key-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-top:20px;border-top:1px solid var(--border);margin-top:26px;font-size:12px;color:var(--muted)}.key-footer>span{display:flex;gap:7px;align-items:center}.key-footer .text-button{font-size:12px}.danger-zone{border-top:1px solid var(--border);margin-top:28px;padding-top:20px}.danger-zone summary{font-size:12px;cursor:pointer;color:var(--muted)}.danger-zone p{font-size:13px;color:var(--muted);margin:14px 0}.danger-zone button{font-size:12px}.text-key-panel,.new-exam-panel{padding:24px;background:var(--raised);border:1px solid var(--border);border-radius:8px;margin-bottom:24px}.text-key-panel textarea{min-height:95px;resize:vertical;margin-top:3px;line-height:1.8;letter-spacing:.13em}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.types{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}.types button{background:white;border:1px solid var(--control);display:flex;flex-direction:column;align-items:flex-start;white-space:normal;text-align:left;padding:16px;min-height:80px;gap:8px;font-size:14px}.types button small{font-size:12px;color:var(--muted);font-weight:400}.types button[aria-pressed=true]{border-color:var(--ink);outline:1px solid var(--ink)}
/* Results: aligned ledger, searchable and keyboard-accessible. */
.results-exam-name{font-size:15px;margin-bottom:22px}.results-toolbar{display:flex;align-items:center;gap:12px;margin:4px 0 22px;flex-wrap:wrap}.results-toolbar>.search-field{flex:1;min-width:220px;max-width:350px}.result-filters{display:flex;gap:8px;align-items:center;flex:1}.result-filters select{width:auto;min-height:36px;font-size:12px;padding:7px 24px 7px 10px}.list-meta{display:flex;justify-content:space-between;gap:16px;font-size:12px;margin-bottom:8px}.results-table th{height:44px;padding:8px 12px}.results-table td{height:64px;padding:12px;font-size:13px}.results-table th:first-child,.results-table td:first-child{width:34px;padding-left:0;color:var(--muted);font-size:12px}.results-table th:last-child,.results-table td:last-child{padding-right:4px}.results-table tr.click{cursor:pointer}.results-table tr.click:hover{outline:1px solid var(--border);outline-offset:-1px}.student-cell{display:flex;align-items:center;gap:10px;min-width:150px}.student-cell>.avatar{width:30px;height:30px;font-size:12px}.student-cell>div{min-width:0}.student-cell button{font-size:13px;padding:0;min-height:24px;max-width:260px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;text-align:left}.student-cell button:hover{background:none;color:var(--accent)}.student-cell small{display:block;font-size:12px;color:var(--muted);margin-top:2px}.results-table .score-value{font-size:15px;font-weight:500}.results-table .c,.results-table .w{font-weight:400}.empty-state{display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;min-height:250px;border:1px solid var(--border);border-radius:8px;padding:32px}.empty-state>.icon{width:30px;height:30px;color:var(--muted);margin-bottom:18px}.empty-state h3{font-size:16px;margin-bottom:8px}.empty-state p{max-width:42ch;font-size:13px}.empty-state button{margin-top:8px;font-size:13px}.result-detail{padding-top:28px;margin-top:28px;border-top:1px solid var(--border)}.detail-heading{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:20px}.detail-heading p{font-size:13px;color:var(--muted);margin-top:6px}.detail-actions{display:flex;gap:8px;align-items:center}.detail-subjects{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.detail-subjects h3{font-size:13px;display:flex;justify-content:space-between;margin-bottom:10px;gap:12px}.detail-subjects h3 span{font-weight:400;color:var(--muted);font-size:12px}.chips{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.chip{font-size:12px;padding:6px;border-radius:4px;font-variant-numeric:tabular-nums;white-space:nowrap;text-align:center}.chip.c{background:var(--ok-soft);color:#265c3a}.chip.w{background:var(--bad-soft);color:#8b302b}.chip.b,.chip.x{background:var(--raised);color:var(--muted)}.detail-footer{display:flex;justify-content:space-between;gap:24px;align-items:center;margin-top:24px;border-top:1px solid var(--rule);padding-top:18px}.detail-footer p{font-size:12px;color:var(--muted);margin:0}.detail-footer a{font-size:12px;white-space:nowrap}.danger-row{margin-top:24px;display:flex;justify-content:space-between;align-items:center}.danger-row p{font-size:12px;color:var(--muted);margin:0}
/* Printed-card library and account utilities. */
.card-library{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px}.library-card{display:flex;flex-direction:column}.library-preview{padding:18px;background:var(--raised);border:1px solid var(--border);border-radius:8px;margin-bottom:16px;display:block}.library-preview img{display:block;width:100%;height:auto;border:1px solid var(--border)}.library-card h2{font-size:15px;line-height:1.4;margin-bottom:7px}.library-card p{font-size:12px;color:var(--muted);line-height:1.6}.library-card .card-subjects{min-height:58px;margin-bottom:14px}.library-card .library-actions{display:flex;gap:6px;align-items:center;margin-top:auto}.library-actions>a,.library-actions>button{min-height:34px;font-size:12px;padding:7px 9px}.print-note{display:flex;gap:12px;padding-top:24px;border-top:1px solid var(--border);margin-top:32px;color:var(--muted);font-size:13px}.print-note>.icon{color:var(--ink);margin-top:2px}.print-note strong{color:var(--ink);font-size:13px;font-weight:500}.print-note p{margin:5px 0 0}.settings-row{display:grid;grid-template-columns:minmax(220px,.85fr) minmax(0,1.15fr);gap:56px;padding:28px 0;border-bottom:1px solid var(--border)}.settings-row:first-child{padding-top:0}.settings-row:last-child{border-bottom:0}.settings-row h2{font-size:16px;margin-bottom:8px}.settings-row .mut{font-size:13px;max-width:42ch}.settings-content{padding:20px;background:var(--raised);border-radius:8px;font-size:13px}.settings-content>label{font-size:12px;color:var(--muted)}.settings-content>p{max-width:58ch;line-height:1.7}.settings-content .field-note{font-size:12px}.help-list{margin:0;padding-left:18px;display:grid;gap:10px;line-height:1.6}.help-list li::marker{color:var(--muted)}
/* Responsive navigation keeps the work as the first mobile surface. */
@media(min-width:1600px){.workspace-sheet{padding:36px 40px}.overview-grid{grid-template-columns:minmax(0,1fr) 320px}.scan-layout{grid-template-columns:minmax(0,1fr) 320px}.scan-result-grid{grid-template-columns:minmax(0,1.2fr) minmax(380px,.8fr)}}
@media(max-width:1190px){.workspace-sheet{padding:26px}.overview-grid{grid-template-columns:minmax(0,1fr) 240px;gap:24px}.context-type{display:none}.scan-layout{grid-template-columns:minmax(0,1fr) 220px;gap:24px}.scan-result-grid{grid-template-columns:minmax(0,1fr) minmax(300px,1fr);gap:22px}.card-library{grid-template-columns:repeat(2,minmax(0,1fr))}.library-preview{padding:24px 40px}.keygrid{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-subjects{grid-template-columns:1fr}.results-table th,.results-table td{padding-left:8px;padding-right:8px}.student-cell>.avatar{display:none}}
@media(max-width:1000px){:root{--sidebar-width:200px}.sidebar{padding-inline:10px}.sidebar button[data-t]{font-size:13px;gap:9px;padding-inline:11px}.sidebar>.brand{margin-left:12px}.overview-grid{grid-template-columns:1fr}.next-action{padding-bottom:0;border-bottom:0}.scan-layout{grid-template-columns:1fr}.scan-guide{display:grid;grid-template-columns:80px 1fr;column-gap:20px;align-items:center;padding:0}.guide-paper{grid-row:1/3;width:80px;margin:0}.scan-guide h3{margin:0 0 8px}.check-list{gap:7px}.scan-result-grid{grid-template-columns:1fr}.card-review{max-width:540px;width:100%;margin:0 auto}.result-summary{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}.score-table{border-top:0}.student-section{grid-column:1/-1}.result-filters{flex:initial}.results-toolbar>.search-field{max-width:none}.exam-settings{grid-template-columns:1fr;gap:18px}.keygrid{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-row{gap:24px;grid-template-columns:1fr 1.3fr}.account #userLabel{max-width:105px}.results-table th:nth-last-child(2),.results-table td:nth-last-child(2){display:none}.results-table .student-cell{min-width:120px}}
@media(max-width:760px){.app-shell{display:block}.app-column{padding:0}.sidebar{position:fixed;left:0;top:0;bottom:0;width:260px;height:100dvh;background:var(--ground);z-index:60;transform:translateX(-100%);transition:transform .2s ease-out;border-right:1px solid var(--border);padding:24px 16px}.sidebar.open{transform:translateX(0)}.sidebar button[data-t]{font-size:14px;min-height:46px}.sidebar>.brand{margin-bottom:28px}.nav-backdrop{position:fixed;inset:0;background:#1c251d55;z-index:50}.topbar{height:58px;padding:0 16px;background:var(--ground)}.topbar-date{display:none}.breadcrumb{gap:9px}.breadcrumb-parent{display:none}.breadcrumb>.icon{display:none}.topbar-right{gap:0}.workspace-sheet{border-radius:0;border:0;min-height:calc(100vh - 58px);padding:24px}.page-heading{margin-bottom:20px;align-items:flex-start;gap:14px}.page-heading h1{font-size:24px}.page-heading p{font-size:13px;max-width:32ch}.page-heading>.primary{font-size:12px;padding:8px 11px;min-height:36px;margin-top:1px}.page-heading>.primary>.icon{width:15px;height:15px}.exam-context{padding:10px 12px;gap:10px;margin-bottom:24px}.context-field{display:block;max-width:none}.context-field label{font-size:12px;margin-bottom:5px}.context-field select{max-width:100%;font-size:12px;min-height:34px}.exam-context .status-tag{font-size:12px;max-width:100px;white-space:normal;align-self:flex-end;margin-bottom:7px}.exam-context>.icon-button{align-self:flex-end;margin-bottom:4px}.metric{padding:0 16px}.metric-label{font-size:12px}.metric-value{font-size:27px}.overview-grid{gap:24px}.exam-row{grid-template-columns:minmax(0,1fr) 96px 48px 24px;gap:10px;min-height:86px}.exam-row .exam-name{font-size:13px}.exam-row .status-tag{font-size:12px}.exam-row p{font-size:12px}.exam-search{max-width:none}.section-heading{margin-bottom:14px}.auth-story{display:none}.auth-layout{display:block;min-height:100dvh}.auth-main{min-height:100dvh;padding:32px 24px 22px}.auth-form-wrap{max-width:380px}.auth-mini-brand{display:flex;align-items:center;gap:8px;font-size:26px;font-weight:600;letter-spacing:-.04em;margin-bottom:44px}.auth-mini-brand .brand-mark{width:24px;height:29px}.auth-form-wrap h1{font-size:27px}.auth-footer{max-width:380px;font-size:12px}.scan-result-grid{gap:24px}.card-review{max-width:480px}.result-summary{grid-template-columns:1fr 1fr}.score b{font-size:36px}.scan-result-header h2{font-size:16px}.upload-area{padding:36px 20px;min-height:330px}.upload-area h2{font-size:20px}.upload-area #scanHint{font-size:13px}.scan-save-actions{padding:12px 0;background:white;border-top:1px solid var(--rule)}.exam-settings{margin-bottom:24px}.key-heading{align-items:flex-start;flex-direction:column;gap:14px}.subject-tabs{gap:24px}.keygrid{gap:24px}.key-footer{align-items:flex-start;flex-direction:column;gap:10px}.result-filters{width:100%;flex:1}.result-filters select{flex:1;max-width:50%}.results-toolbar>.search-field{min-width:100%;order:0}.results-toolbar>.result-filters{order:2}.results-toolbar{gap:12px}.result-filters{order:1!important;min-width:100%;max-width:100%}.results-table th,.results-table td{padding:10px 5px;font-size:12px}.results-table th:first-child,.results-table td:first-child{width:22px;font-size:12px}.results-table th:nth-child(n+3):not(:last-child),.results-table td:nth-child(n+3):not(:last-child){display:none}.results-table td{height:66px}.results-table .student-cell{min-width:0}.student-cell>.avatar{display:inline-flex}.student-cell button{max-width:260px}.results-table th:nth-child(2){width:auto}.results-table .score-value{font-size:18px}.list-meta .mut{display:none}.detail-heading{gap:12px}.detail-heading h2{font-size:17px}.detail-heading p{font-size:12px}.detail-subjects{grid-template-columns:1fr}.chips{grid-template-columns:repeat(5,minmax(0,1fr))}.detail-footer{align-items:flex-start;flex-direction:column;gap:12px}.settings-row{grid-template-columns:1fr;gap:18px;padding:24px 0}.settings-row h2{font-size:16px}.settings-content{padding:18px}.card-library{gap:24px}.library-preview{padding:16px 22px}.library-card h2{font-size:14px}.library-card .card-subjects{min-height:0}.library-card p{font-size:12px}.library-actions{flex-wrap:wrap}.workspace-footer{align-items:flex-start;gap:12px;font-size:12px}.workspace-footer>span:last-child{white-space:nowrap}.operation-notice{flex-wrap:wrap;font-size:12px;gap:8px}.operation-notice>span{flex-basis:calc(100% - 45px)}.operation-notice .icon-button{position:absolute;right:28px}.operation-notice .text-button{font-size:12px}}
@media(max-width:450px){.workspace-sheet{padding:22px 18px}.page-heading{gap:10px}.page-heading h1{font-size:23px}.page-heading>.primary{font-size:12px;padding-inline:9px;gap:5px}.page-heading p{max-width:25ch;font-size:12px}.context-field{min-width:0}.exam-context{padding:10px}.exam-context>.status-tag{display:none}.exam-row{grid-template-columns:minmax(0,1fr) 87px 24px;gap:8px}.exam-row .exam-result-count{display:none}.exam-row .status-tag{font-size:12px;padding:3px 6px}.next-action{padding-bottom:24px;border-bottom:1px solid var(--border)}.metric{padding-inline:12px}.metric-value{font-size:26px}.metric-label{font-size:12px}.upload-area{min-height:350px;padding:32px 16px}.upload-actions{flex-direction:column;align-items:stretch;width:100%;max-width:230px}.upload-actions .btn{width:100%}.scan-guide{column-gap:16px}.scan-guide h3{font-size:14px}.check-list{font-size:12px}#t-scan.has-scan .upload-area{gap:12px}#t-scan.has-scan .upload-area h2{flex:1}#t-scan.has-scan .upload-actions{width:auto;max-width:none;flex-direction:row;gap:8px}#t-scan.has-scan .upload-actions .camera-button{display:none}#t-scan.has-scan .upload-actions .btn{width:auto}.result-summary{display:block}.score-table{border-top:1px solid var(--border)}.student-fields{gap:16px 12px}.scan-save-actions{gap:8px}.scan-save-actions button,.scan-save-actions .btn{font-size:12px;padding-inline:10px}.keygrid{grid-template-columns:1fr 1fr;gap:20px}.kq{gap:4px}.kq b{width:20px;margin-right:0;font-size:12px}.kq button{width:27px;height:27px;min-height:27px;font-size:12px}.keygrid.five-options{grid-template-columns:1fr}.keygrid.five-options .kq{gap:12px;min-height:46px}.keygrid.five-options .kq button{width:33px;height:33px;min-height:33px;font-size:12px}.keygrid.five-options .kq b{width:24px;font-size:12px}.subject-group>h3{font-size:12px;display:block;line-height:1.5}.subject-group>h3>span{display:block;font-size:12px}.subject-tabs{gap:22px}.subject-tabs button{font-size:12px}.inline-actions .btn,.inline-actions button{font-size:12px;padding-inline:9px}.types{grid-template-columns:1fr}.types button{min-height:72px}.new-exam-panel,.text-key-panel{padding:18px}.result-filters select{font-size:12px}.result-filters select:last-child{max-width:60%}.student-cell button{max-width:200px;font-size:13px}.results-table .score-value{font-size:17px}.chips{grid-template-columns:repeat(4,minmax(0,1fr))}.detail-subjects h3{font-size:12px}.detail-subjects h3 span{font-size:12px}.danger-row{align-items:flex-start;flex-direction:column;gap:12px}.card-library{gap:24px 18px}.library-preview{padding:10px 12px}.library-card h2{font-size:13px}.library-card p{font-size:12px}.library-card .library-actions{gap:6px}.library-actions>a,.library-actions>button{font-size:12px;padding:6px 8px;min-height:32px}.workspace-footer{flex-direction:column;gap:6px}.auth-footer{flex-direction:column;gap:8px}.toast{font-size:13px;bottom:16px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{animation:none!important;transition:none!important}}
@media print{.sidebar,.topbar,.page-heading,.exam-context,.workspace-footer,.results-toolbar,.operation-notice,.pagination,.toast{display:none!important}.app-shell{display:block}.workspace-sheet{border:0;padding:0}body{background:white}.result-detail{break-before:page}.results-table td,.results-table th{font-size:12px}}

/* Native selects receive the same control geometry in WebKit and Chromium. */
select{appearance:none;-webkit-appearance:none;background-image:url('/assets/chevron-down.svg');background-repeat:no-repeat;background-position:right 10px center;background-size:12px 12px;padding-right:30px}
body.menu-open{overflow:hidden}.chip .icon{width:10px;height:10px;margin-left:2px;vertical-align:-1px}.keygrid.four-subjects{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1190px){.keygrid.four-subjects{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Administration and verification panels follow the existing work surface. */
.management-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin: 16px 0;
  background: var(--surface);
}
.management-panel h2, .management-panel h3 { margin: 0 0 10px; }
.management-panel summary { cursor: pointer; font-weight: 500; }
.management-panel form { margin: 12px 0; }
.management-panel .field { margin-bottom: 10px; }
.manage-fields, .manage-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.manage-fields > .field { flex: 1 1 150px; }
.manage-fields select, .manage-actions select { width: auto; max-width: 100%; }
.manage-actions button, .manage-fields button { white-space: normal; }
.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.manage-row strong, .manage-row small { display: block; overflow-wrap: anywhere; }
.manage-row small { color: var(--mut); }
.manage-row > * { min-width: 0; }
.manage-row > :first-child { flex: 1 1 150px; }
.manage-row:last-child { border-bottom: 0; }
.manage-error { color: var(--bad); }
.manage-token { overflow-wrap: anywhere; }
.manage-nav { margin: 14px 0; }
#scanDrafts:empty, #examWorkflow:empty, #examReport:empty { display: none; }
#scanDrafts .btn { margin: 6px 0; }
#scanFlags { margin-top: 12px; }
#lDet .manage-actions { margin: 12px 0; }
@media (max-width: 640px) {
  .manage-row { align-items: flex-start; flex-wrap: wrap; }
  .manage-fields > .field { flex-basis: 100%; }
}

pre.manage-token { white-space: pre-wrap; }
#ov { min-width: 0; }
/* Team access uses one roster beside one account profile. */
.team-nav { display:flex; gap:16px; flex-wrap:wrap; border-bottom:1px solid var(--border); margin-bottom:22px; }
.team-nav-button { min-height:42px; padding:8px 11px; white-space:normal; }
.team-nav .team-nav-button { position:relative; color:var(--mut); border-radius:5px 5px 0 0; }
.team-nav .team-nav-button[aria-pressed=true] { color:var(--ink); font-weight:600; }
.team-nav .team-nav-button[aria-pressed=true]::after { content:''; position:absolute; inset:auto 0 -2px; height:2px; background:var(--accent); }
.team-tool-nav { display:flex; gap:8px; flex-wrap:wrap; }
.team-tool-nav .team-nav-button[aria-pressed=true] { background:var(--active); }
.team-heading, .team-section-title, .team-profile-head, .team-save { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.team-heading { margin-bottom:16px; }
.team-heading p, .team-section-title p { margin:3px 0 0; }
.team-layout { display:grid; grid-template-columns:minmax(290px, .9fr) minmax(0, 1.6fr); gap:16px; align-items:start; }
.team-roster, .team-detail, .team-permissions, .team-role-grid article { border:1px solid var(--border); border-radius:8px; }
.team-roster, .team-detail { padding:16px; }
.team-search, .team-profile-fields label, .team-filters label, .team-dialog-body > label, .team-field-label { display:grid; gap:5px; font-weight:500; }
.team-filters, .team-profile-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.team-filters { margin-top:9px; }
.team-count { margin:10px 0 4px; color:var(--mut); font-variant-numeric:tabular-nums; }
.team-people { display:grid; gap:3px; max-height:420px; overflow:auto; padding:4px; margin:0 -4px; }
.team-person { display:grid; grid-template-columns:30px minmax(0, 1fr) auto; align-items:center; text-align:left; justify-content:stretch; gap:8px; padding:8px; white-space:normal; }
.team-person[aria-pressed=true] { background:var(--accent-soft); border-color:#f0d4c0; }
.team-person-name { display:grid; gap:1px; overflow-wrap:anywhere; }
.team-person-name strong { font-weight:600; }
.team-person-name small { color:var(--mut); font-size:12px; }
.team-avatar { display:grid; place-items:center; height:30px; width:30px; border:1px solid var(--border); border-radius:50%; background:var(--surface); font-size:12px; }
.team-badge { display:inline-flex; align-items:center; width:max-content; padding:3px 7px; border-radius:4px; background:var(--raised); color:var(--mut); font-size:12px; font-weight:600; }
.team-badge.active { background:var(--ok-soft); color:var(--ok); }
.team-badge.invited, .team-badge.suspended { background:var(--warn-soft); color:#78591b; }
.team-detail h3, .manage-dialog h3 { font-size:17px; overflow-wrap:anywhere; }
.team-detail h4, .manage-dialog h4 { margin:0 0 6px; font-size:14px; line-height:1.4; }
.team-profile-head { align-items:flex-start; }
.team-profile-head p { margin:2px 0 0; color:var(--mut); overflow-wrap:anywhere; }
.team-section { padding-top:13px; margin-top:13px; border-top:1px solid var(--rule); }
.team-section-title { flex-wrap:wrap; gap:6px 12px; }
.team-section-title h4 { margin:0; }
.team-profile-fields > div > p { margin:5px 0 0; font-size:13px; }
.team-profile-fields .team-badge { margin-top:5px; }
.team-specific-note { margin:6px 0 8px; padding:8px 10px; border-inline-start:2px solid var(--accent); background:var(--raised); }
.team-section [data-assignment] > :last-child { margin-bottom:0; }
.team-scope { font-size:13px; color:var(--accent); font-weight:600; font-variant-numeric:tabular-nums; }
.team-exam-note { margin:5px 0 10px; }
.team-exam-tools { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:6px 12px; margin:5px 0; }
.team-exam-tools label { display:flex; align-items:center; gap:7px; }
.team-exam-tools input, .team-exam input { width:17px; height:17px; min-height:0; margin:0; accent-color:var(--accent); flex:none; }
.team-exams { max-height:186px; overflow:auto; background:var(--raised); border:1px solid var(--border); border-radius:6px; }
.team-exam { display:flex; align-items:flex-start; gap:9px; padding:8px 11px; cursor:pointer; }
.team-exam + .team-exam { border-top:1px solid var(--border); }
.team-exam:hover { background:var(--surface); }
.team-exam input { margin-top:2px; }
.team-exam span { display:grid; overflow-wrap:anywhere; }
.team-exam small { color:var(--mut); font-size:12px; }
.team-save { border-top:1px solid var(--rule); padding-top:12px; margin-top:12px; }
.team-save p { color:var(--mut); margin:0; font-size:13px; }
.team-save .primary:disabled { color:#fff; background:#666b63; }
.team-security summary { cursor:pointer; font-weight:500; }
.team-action-list { display:flex; gap:7px; flex-wrap:wrap; margin-top:8px; }
.team-action-list button { white-space:normal; }
.team-danger { color:var(--bad); }
.team-notice { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; padding:10px 12px; border-radius:6px; border:1px solid #d9e8dc; background:var(--ok-soft); }
.team-notice.error { background:var(--bad-soft); border-color:#efceca; }
.team-notice > div:first-child { flex:1 1 220px; }
.team-notice p { margin:0; color:var(--mut); }
.team-link { display:flex; flex:1 1 260px; gap:6px; align-items:center; }
.team-inline-error { color:var(--bad); margin:6px 0 0; }
.team-empty, .team-loading { padding:12px; }
.team-empty p { color:var(--mut); margin:3px 0 0; }
.team-role-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.team-role-grid article { padding:13px; background:var(--raised); }
.team-role-grid p { margin:5px 0 8px; }
.team-role-grid strong { color:var(--accent); font-size:13px; }
.team-permissions { margin-top:14px; }
.team-permissions > .team-section-title { justify-content:flex-start; align-items:baseline; padding:13px; }
.team-matrix-scroll { overflow-x:auto; }
.team-matrix-filter { display:none; }
.team-matrix { width:100%; min-width:680px; border-collapse:collapse; text-align:left; }
.team-matrix th, .team-matrix td { padding:8px 10px; border-top:1px solid var(--rule); vertical-align:top; }
.team-matrix thead th { min-width:110px; }
.team-matrix tbody th[scope=row] { font-weight:500; width:33%; }
.team-matrix-group { background:var(--raised); }
.team-matrix td { color:var(--mut); font-size:13px; }
.manage-dialog { max-width:min(580px, calc(100vw - 28px)); width:100%; max-height:calc(100dvh - 28px); padding:0; border:1px solid var(--control); border-radius:8px; background:var(--surface); color:var(--ink); overflow:auto; }
.manage-dialog::backdrop { background:#25282566; }
.manage-dialog header, .manage-dialog footer { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:15px 16px; }
.manage-dialog header { border-bottom:1px solid var(--rule); }
.manage-dialog header p { margin:3px 0 0; }
.manage-dialog footer { justify-content:flex-end; border-top:1px solid var(--rule); }
.team-dialog-body { padding:14px 16px; }
.team-dialog-body > label { margin-top:9px; }
.team-dialog-body > p.mut { margin-top:5px; }
.manage-dialog .team-exams { max-height:190px; }
@media(max-width:1050px) { .team-role-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:975px) {
  .team-matrix-filter { display:grid; gap:5px; max-width:255px; padding:0 13px 12px; font-weight:500; }
  .team-matrix { min-width:0; }
  .team-matrix thead th { min-width:0; }
  .team-matrix tbody th[scope=row] { width:62%; }
  .team-matrix[data-role=admin] [data-policy-role]:not([data-policy-role=admin]),
  .team-matrix[data-role=lead] [data-policy-role]:not([data-policy-role=lead]),
  .team-matrix[data-role=operator] [data-policy-role]:not([data-policy-role=operator]),
  .team-matrix[data-role=viewer] [data-policy-role]:not([data-policy-role=viewer]) { display:none; }
}
@media(max-width:940px) { .team-layout { grid-template-columns:1fr; } .team-people { max-height:225px; } }
@media(max-width:480px) {
  .team-nav { gap:2px; margin-bottom:14px; }
  .team-nav-button { padding-inline:7px; font-size:13px; }
  .team-roster, .team-detail { padding:12px; }
  .team-heading { align-items:flex-start; }
  .team-heading button { flex:none; padding-inline:10px; min-height:42px; }
  .team-view input:not([type=checkbox]), .team-view select { font-size:16px; }
  .team-profile-fields { grid-template-columns:1fr; }
  .team-save, .team-link { flex-wrap:wrap; }
  .team-security button { min-height:42px; }
}

.student-dialog-body { padding:14px 16px; }
.student-dialog-body > p:last-child { margin-bottom:0; }
.student-dialog .manage-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:10px 12px; }
.student-dialog .field { margin:0; }
.student-dialog .field label { display:grid; gap:4px; }
.student-active { display:flex; align-items:center; gap:8px; margin-top:12px; }
.student-active input { width:17px; height:17px; min-height:0; margin:0; accent-color:var(--accent); }
.student-history { list-style:none; margin:0; padding:0; }
.student-history li { display:grid; gap:3px; padding:10px 0; overflow-wrap:anywhere; }
.student-history li + li { border-top:1px solid var(--rule); }
.student-history li span { color:var(--mut); }
.student-edit-error { color:var(--bad); margin:8px 0 0; }
.student-edit-error:empty { display:none; }
@media(max-width:500px) {
  .student-dialog .manage-fields { grid-template-columns:1fr; }
  .student-dialog .manage-fields input { font-size:16px; }
}

.qr-panel [hidden], .qr-result-page [hidden] { display:none; }
.qr-panel-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:8px; }
.qr-panel-heading h3 { margin:0; }
.qr-card-details { overflow-wrap:anywhere; }
.qr-card-details:empty { display:none; }
.qr-card-details p { color:var(--muted); margin:2px 0 8px; }
.qr-card-details ul { margin:0 0 12px; padding-inline-start:20px; }
.qr-preview { display:block; width:min(100%,520px); max-height:55dvh; margin:0 0 12px; background:var(--ink); border-radius:6px; object-fit:contain; }
.qr-actions { align-items:center; }
.qr-error { color:var(--bad); }
.qr-result-page { min-height:100dvh; padding:clamp(24px,7vh,72px) 18px; }
.qr-public-result { margin-inline:auto; max-width:470px; padding:24px; background:var(--surface); border:1px solid var(--border); border-radius:12px; }
.qr-public-brand { font-weight:600; color:var(--accent); margin-bottom:16px; }
.qr-public-result h1 { margin-bottom:8px; }
.qr-public-result p { overflow-wrap:anywhere; }
.qr-public-content { margin:18px 0; padding-top:15px; border-top:1px solid var(--rule); }
.qr-public-content p:last-child { margin-bottom:0; }
.qr-public-score { font-size:30px; font-weight:600; letter-spacing:-.025em; font-variant-numeric:tabular-nums; }

.upload-actions #qrOpen { min-height:42px; }
#t-scan.has-scan #qrOpen { min-height:34px; font-size:12px; padding:6px 10px; }
@media(max-width:480px) {
  #t-scan.has-scan .upload-actions { flex:1 0 100%; margin-left:0; justify-content:flex-start; }
}

/* Workspace hierarchy, shared controls and touch layouts. */
.startup-screen {
  min-height:100dvh;
  display:grid;
  place-content:center;
  justify-items:center;
  gap:14px;
  padding:24px;
  color:var(--muted);
  text-align:center;
}
.startup-screen p { margin:0; }
.startup-screen button { min-height:44px; }
.whatsapp-state { font-size:16px; font-weight:600; margin:0 0 6px; }
.whatsapp-qr { display:grid; gap:10px; justify-items:start; margin-block:14px; }
.whatsapp-qr img { display:block; width:min(100%,256px); height:auto; border:1px solid var(--border); border-radius:8px; }
.whatsapp-qr p { max-width:48ch; margin:0; }
.whatsapp-jobs small { display:block; }
.student-active:has([name=whatsappConsent]) { align-items:flex-start; margin-bottom:12px; }

:root {
  --dock-height: 64px;
  --mobile-gutter: clamp(14px, 4.2vw, 24px);
}

.mobile-nav, .topbar .mobile-brand, .drawer-close, #jumpToCard, .result-status-compact { display:none; }
.sidebar { height:100dvh; overflow-y:auto; overscroll-behavior:contain; }
.sidebar-bottom { padding-top:16px; }
.sidebar button[data-t][aria-selected=true] .icon { color:var(--accent); }
.workspace-label, .workspace-footer, .context-type { overflow-wrap:anywhere; }
.context-field label { flex:none; }
.page-heading { gap:20px; margin-bottom:24px; }
.page-heading h1 { font-size:clamp(24px, 2.2vw, 30px); line-height:1.2; letter-spacing:-.028em; }
.page-heading p { margin-top:7px; font-size:14px; max-width:60ch; }
#bNewEx, .auth-submit { background:var(--accent); border-color:var(--accent); color:white; }
#bNewEx:hover, .auth-submit:hover { background:#903907; border-color:#903907; }

.auth-layout { grid-template-columns:minmax(0, 1.04fr) minmax(0, .96fr); min-height:100dvh; }
.auth-story { color:#fff; background:#79340d; padding:clamp(26px, 5vw, 70px); }
.auth-story>.brand { color:inherit; }
.auth-story :is(.brand-mark,.brand-period) { color:#ffe0c8; }
.auth-story-content { max-width:520px; margin:clamp(40px, 7.5vh, 92px) auto 0; }
.auth-story h2 { font-size:clamp(36px, 4vw, 56px); line-height:1.05; }
.auth-story p { color:#ffeadb; max-width:35ch; margin:16px 0 26px; }
.auth-paper { margin:0; max-width:420px; max-height:340px; padding:15px 15px 0; border:0; border-radius:10px; }
.paper-caption { color:var(--ink); gap:12px; padding:13px 15px; }
.paper-caption span { text-align:end; }
.auth-main { padding:40px clamp(24px, 4vw, 68px) 28px; }
.auth-form-wrap { max-width:420px; }
.auth-form-wrap h1 { font-size:clamp(28px, 3.2vw, 38px); line-height:1.15; letter-spacing:-.03em; }
.auth-form-wrap>.mut { margin:10px 0 26px; }
.auth-form-wrap input, .auth-submit, #activateForm .primary { min-height:48px; font-size:16px; }
.auth-form-wrap .password-field>.icon-button { min-height:44px; width:44px; }
.auth-help { max-width:46ch; line-height:1.55; }
.auth-form-wrap:has(#loginForm.hide) .auth-help { display:none; }
.auth-status:empty { min-height:0; margin:0; }
.auth-footer { margin-top:28px; }

.overview-grid {
  grid-template-columns:minmax(0, 1fr) minmax(236px, .48fr);
  grid-template-areas:"exams focus" "exams guide";
  grid-template-rows:auto 1fr;
  align-items:start;
  gap:16px clamp(20px, 3vw, 40px);
}
.overview-main { grid-area:exams; }
.overview-focus {
  grid-area:focus;
  border:1px solid #f0d4c0;
  border-radius:12px;
  padding:18px;
  background:var(--accent-soft);
}
.overview-focus h2 { margin:0 0 12px; color:#8b3c0b; font-size:14px; }
.next-action { padding:0; border:0; }
.next-action h3 { margin:0 0 12px; font-size:18px; overflow-wrap:anywhere; }
.next-action .primary { min-height:42px; gap:12px; }
.key-readiness { display:flex; justify-content:space-between; gap:8px; margin-bottom:6px; font-size:13px; }
.key-readiness strong { font-variant-numeric:tabular-nums; }
.next-action .bubble-strip { margin:0 0 15px; }
.next-action .bubble-strip i.filled { background:var(--accent); }
.overview-guide { grid-area:guide; padding:10px 14px; border:1px solid var(--border); border-radius:10px; }
.overview-guide summary, .result-tools summary { cursor:pointer; font-weight:600; padding:7px 0; }
.overview-guide .workflow-list { margin-top:10px; }
.overview-grid:has(.overview-focus.hide) { grid-template-areas:"exams exams" "guide guide"; }
.metric-strip:empty { display:none; }
.metric-strip { margin-bottom:24px; padding-bottom:18px; }
.metric { display:flex; flex-direction:column; justify-content:space-between; }
.metric-value { font-variant-numeric:tabular-nums; }
.exam-name, .student-cell button { white-space:normal; overflow-wrap:anywhere; }
.exam-row { grid-template-columns:minmax(0,1fr) max-content 64px 30px; }
.exam-row .status-tag { white-space:normal; }
.exam-directory-heading .text-button { gap:6px; white-space:normal; }
.exam-directory-heading .icon { width:15px; height:15px; }
.exam-directory-filters { display:grid; grid-template-columns:minmax(0,1fr) minmax(125px, .45fr); gap:10px; }
.exam-directory-filters .exam-search { max-width:none; margin:0; }
.exam-directory-count { margin:9px 0 0; font-size:13px; }
.exam-row-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
#t-exams .exam-directory-heading { display:none; }
#t-exams .exam-directory-filters { max-width:660px; }
#t-exams .exam-row { grid-template-columns:minmax(0,1fr) max-content 64px max-content; }
#t-key > [hidden] { display:none; }
#newBox .field { max-width:560px; margin-bottom:16px; }
.exam-workflow-hint { margin:8px 0 0; }
.scan-save-actions .btn:has(input:disabled) { opacity:.6; cursor:not-allowed; }

.scan-result-header { margin:0 0 16px; padding-bottom:14px; border-bottom:1px solid var(--rule); }
.scan-result-header>div { display:flex; align-items:center; gap:10px 14px; flex-wrap:wrap; }
.scan-result-grid { grid-template-areas:"card summary"; }
.result-summary { grid-area:summary; }
.card-review { grid-area:card; }
.score-heading {
  background:var(--raised);
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px 18px;
  margin-bottom:12px;
}
.score-heading #sLine { margin:6px 0 0; }
.score-heading .score { gap:7px; }
.student-section > .field + .field { margin-top:10px; }
#t-scan.has-scan #scanStart { margin-top:24px; }
#scanFlags, #scanHint { overflow-wrap:anywhere; }

.results-toolbar { align-items:end; gap:12px; margin-bottom:16px; }
.results-toolbar>.search-field { flex:1 1 240px; max-width:none; }
.result-filters { display:grid; flex:1 1 384px; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.result-filter { display:grid; gap:5px; margin:0; font-size:13px; color:var(--muted); }
.result-filter select { max-width:none; min-width:0; width:100%; color:var(--ink); }
.result-filters select:last-child { max-width:none; }
.list-meta { align-items:center; }
.list-meta .inline-actions { margin-inline-start:auto; }
.results-table th.result-status-column, .results-table td.result-status-column { display:table-cell; }
.results-table .status-tag { white-space:normal; }
.results-table th, .results-table td { font-variant-numeric:tabular-nums; }
.result-tools { margin-top:22px; padding:10px 14px; border:1px solid var(--border); border-radius:10px; }
#examReport { display:flex; flex-wrap:wrap; gap:8px; padding:6px 0; }
#reportContent { flex:1 0 100%; }
.result-detail h2, .settings-content, .student-history li, .manage-row { overflow-wrap:anywhere; }
.team-heading { flex-wrap:wrap; }
.team-heading button { white-space:normal; }
.team-exam { min-height:44px; }
.team-person:focus-visible, .team-detail h3:focus-visible, #cardReview:focus-visible { scroll-margin:12px; }
.qr-result-page { padding-inline:max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
.qr-public-result { padding:clamp(18px, 5vw, 34px); }
.qr-public-brand { display:flex; align-items:center; gap:8px; font-size:20px; }
.qr-public-brand .brand-mark { width:19px; height:22px; }
.qr-public-result h1 { line-height:1.18; }
.qr-public-content { margin-block:18px; }
.qr-public-result button { min-height:44px; }

@media(max-width:1000px) {
  .overview-grid { grid-template-columns:1fr; grid-template-rows:auto; grid-template-areas:"focus" "exams" "guide"; }
  .overview-grid:has(.overview-focus.hide) { grid-template-areas:"exams" "guide"; }
  .overview-focus { padding:16px; }
  .scan-result-grid { grid-template-areas:"summary" "card"; }
  .result-summary { display:block; }
  .card-review { max-width:none; }
  #jumpToCard { display:inline-flex; }
}

@media(max-width:760px) {
  html {
    scroll-padding-top:64px;
    scroll-padding-bottom:calc(var(--dock-height) + env(safe-area-inset-bottom) + 16px);
  }
  .app-shell { padding-bottom:calc(var(--dock-height) + env(safe-area-inset-bottom)); }
  .topbar {
    position:sticky;
    z-index:20;
    top:0;
    height:auto;
    min-height:56px;
    padding:env(safe-area-inset-top) max(var(--mobile-gutter), env(safe-area-inset-right)) 0 max(var(--mobile-gutter), env(safe-area-inset-left));
    background:var(--ground);
    border-bottom:1px solid var(--border);
  }
  .topbar .breadcrumb { display:none; }
  .topbar .mobile-brand { display:inline-flex; font-size:25px; }
  .topbar .mobile-brand .brand-mark { width:23px; height:26px; }
  .topbar .icon-button { min-width:44px; min-height:44px; }
  .sidebar {
    width:min(320px, calc(100% - 32px));
    background:var(--surface);
    padding:calc(16px + env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }
  .sidebar>.brand { margin:8px 56px 17px 10px; }
  .drawer-close { display:inline-flex; position:absolute; top:calc(14px + env(safe-area-inset-top)); right:12px; width:44px; height:44px; }
  .mobile-nav {
    position:fixed;
    inset:auto 0 0;
    z-index:40;
    display:grid;
    grid-auto-columns:1fr;
    grid-auto-flow:column;
    gap:3px;
    min-height:var(--dock-height);
    padding:4px max(8px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background:var(--surface);
    border-top:1px solid var(--border);
  }
  .mobile-nav button {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    min-height:52px;
    padding:5px 2px;
    border:0;
    font-size:12px;
    text-align:center;
    white-space:normal;
    color:var(--muted);
  }
  .mobile-nav button[aria-current=page] { color:var(--accent); background:var(--accent-soft); font-weight:600; }
  .mobile-nav .icon { width:20px; height:20px; }
  .workspace-sheet {
    min-height:calc(100dvh - 56px - var(--dock-height));
    padding:22px max(var(--mobile-gutter), env(safe-area-inset-right)) 18px max(var(--mobile-gutter), env(safe-area-inset-left));
  }
  .page-heading { margin-bottom:18px; gap:10px; }
  .page-heading p { font-size:14px; max-width:42ch; }
  .page-heading>.primary { min-height:44px; padding-inline:11px; font-size:13px; }
  .workspace-sheet :is(button,.btn):not(.kq button) { min-height:44px; }
  .workspace-sheet :is(select,textarea,input:not([type=checkbox],[type=file])) { min-height:44px; font-size:16px; }
  .workspace-sheet details>summary { min-height:44px; align-content:center; }
  .manage-dialog :is(button,.btn) { min-height:44px; }
  .manage-dialog :is(select,textarea,input:not([type=checkbox],[type=file])) { min-height:44px; font-size:16px; }
  .workspace-sheet .search-field input { padding-inline-start:0; }
  .exam-context {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:"label state" "field refresh";
    gap:6px 8px;
    padding:10px;
    margin-bottom:18px;
  }
  .context-field { display:contents; }
  .context-field label { grid-area:label; margin:0; }
  .context-field select { grid-area:field; width:100%; }
  .exam-context>.icon-button { grid-area:refresh; width:44px; height:44px; margin:0; align-self:end; }
  .exam-context>.status-tag { grid-area:state; display:inline-flex; max-width:none; margin:0; justify-self:start; }
  .toast { bottom:calc(var(--dock-height) + env(safe-area-inset-bottom) + 10px); }
  .metric-strip { margin-bottom:18px; padding-bottom:14px; }
  .metric-label { font-size:13px; }
  .exam-row { grid-template-columns:minmax(0, 1fr) auto 42px; min-height:74px; gap:6px; }
  .exam-row .icon-button { width:42px; }
  .exam-row .exam-result-count { display:none; }
  #t-exams .exam-row { grid-template-columns:minmax(0,1fr) max-content; padding-block:10px; }
  #t-exams .exam-row-actions { grid-column:1/-1; justify-content:space-between; }
  #t-exams .exam-row-actions .icon-button { margin-inline-start:auto; }
  .overview-grid { gap:16px; }
  .overview-focus { padding:14px; }
  .next-action h3 { font-size:17px; }

  .auth-layout { background:var(--ground); }
  .auth-main { min-height:100dvh; padding:calc(24px + env(safe-area-inset-top)) var(--mobile-gutter) max(20px, env(safe-area-inset-bottom)); }
  .auth-form-wrap { max-width:460px; padding:clamp(18px, 5vw, 34px); border:1px solid var(--border); border-radius:16px; background:var(--surface); }
  .auth-mini-brand { margin-bottom:24px; }
  .auth-footer { text-align:center; }

  .upload-area { min-height:auto; align-items:flex-start; padding:18px; text-align:start; }
  .upload-icon { margin-bottom:9px; }
  .upload-area #scanHint { margin-bottom:14px; font-size:14px; text-align:start; }
  .upload-caption { display:none; }
  .upload-actions {
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    align-items:stretch;
    gap:8px;
    width:100%;
    max-width:none;
  }
  .upload-actions .camera-button { grid-column:1 / -1; }
  .upload-actions :is(.btn,#qrOpen) { width:100%; max-width:none; font-size:14px; white-space:normal; }
  #t-scan.has-scan .upload-actions { display:flex; flex-wrap:wrap; flex:1 0 100%; margin:0; }
  #t-scan.has-scan .upload-actions :is(.btn,#qrOpen) { min-height:44px; width:auto; font-size:13px; }
  #t-scan.has-scan .upload-actions .camera-button { display:inline-flex; }
  .scan-guide { grid-template-columns:60px minmax(0, 1fr); align-items:start; }
  .guide-paper { width:60px; }
  .score-heading { padding:14px; }
  .scan-save-actions { gap:8px; }
  .scan-save-actions :is(button,.btn) { font-size:14px; white-space:normal; }
  .score-table { overflow-x:auto; }
  .student-section { margin-top:16px; }
  .scan-result-header h2 { font-size:18px; }
  #jumpToCard { white-space:nowrap; }

  .result-filters { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .result-filter:last-child { grid-column:1 / -1; }
  .workspace-sheet:has(.exam-context:not(.hide)) #lTitle { display:none; }
  .results-table th.result-status-column, .results-table td.result-status-column { display:none; }
  .result-status-compact { display:block; margin-top:4px; }
  .results-table .student-cell button { font-size:14px; min-height:0; max-width:none; }
  .results-table td { height:auto; padding-block:10px; }
  .results-table .student-cell { align-items:flex-start; }
  .result-detail { padding:14px; }

  .keygrid, .keygrid.four-subjects, .keygrid.five-options { grid-template-columns:1fr; }
  .kq, .keygrid.five-options .kq {
    display:grid;
    grid-template-columns:minmax(22px,1fr) repeat(4, 44px);
    gap:6px;
    min-height:51px;
  }
  .keygrid.five-options .kq { grid-template-columns:minmax(22px,1fr) repeat(5, 44px); }
  .kq button, .keygrid.five-options .kq button { width:44px; height:44px; min-height:44px; font-size:14px; }
  .subject-group>h3 { font-size:15px; }
  .subject-group>h3>span { font-size:13px; }
  .subject-tabs { scroll-snap-type:x proximity; }
  .subject-tabs button { scroll-snap-align:start; font-size:14px; }
  .card-library .library-actions :is(a,button) { font-size:13px; }
}

@media(min-width:590px) and (max-width:760px) {
  .keygrid:not(.five-options), .keygrid.four-subjects:not(.five-options) { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .result-filters { grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .result-filter:last-child { grid-column:auto; }
}

@media(max-width:360px) {
  .page-heading { flex-wrap:wrap; }
  .page-heading>div { flex-basis:100%; }
  .results-table .student-cell>.avatar { display:none; }
  .team-nav { flex-wrap:nowrap; overflow-x:auto; }
  .team-nav-button { flex:none; }
  .card-library { grid-template-columns:1fr; }
  .library-card .library-preview { padding:12px clamp(30px, 16vw, 54px); }
}

@media(max-width:760px) and (max-height:500px) {
  :root { --dock-height:54px; }
  .topbar { position:static; }
  .mobile-nav button { flex-direction:row; min-height:44px; gap:6px; }
}

@media print {
  .mobile-nav, #jumpToCard, .result-tools, .list-meta .inline-actions { display:none !important; }
  .app-shell { padding-bottom:0; }
}

/* Keep the single-card workflow in view on a phone. */
#t-scan .scan-layout { display:block; }
#t-scan .upload-area { min-height:0; padding:32px 20px; }
#t-scan .upload-icon { margin-bottom:12px; }
#t-scan .upload-area #scanHint { margin-bottom:16px; }
#t-scan .upload-area.key-incomplete .upload-actions .btn { display:inline-flex; }
#t-scan:has(#qrPanel:not([hidden])) #scanStart { display:none; }
#scanDrafts > summary, .scan-identity > summary { cursor:pointer; padding-block:8px; font-weight:500; }
.scan-identity[open] > summary { margin-bottom:8px; }
#scanDelivery { margin-top:10px; }
#t-scan .scan-save-actions { flex-wrap:wrap; }
#t-scan .scan-save-actions button, #t-scan .scan-save-actions .btn { min-height:44px; }
@media(max-width:450px) {
  #t-scan .scan-save-actions #bConfirmScan { flex:1 0 100%; font-size:14px; }
}
@media(max-width:760px) {
  #t-scan .result-summary { display:flex; flex-direction:column; }
  #t-scan .score-table { order:1; margin-top:12px; }
  #t-scan .student-section { margin-top:12px; padding-top:12px; }
}
#scanWithoutQr > summary { cursor:pointer; padding-block:8px; font-weight:500; }
#scanWithoutQr p { margin:4px 0 10px; }

.status-tag.error { background:var(--bad-soft); color:var(--bad); }
.status-tag.error::before { background:var(--bad); }
.exam-extra-actions > summary, .student-add > summary, .student-import > summary, .flag-review > summary {
  cursor:pointer;
  min-height:44px;
  padding-block:10px;
  font-weight:600;
}
.exam-extra-actions, .student-add, .student-import, .flag-review {
  margin-block:10px;
  border-top:1px solid var(--rule);
}
.student-add > summary { color:var(--accent); }
.student-add form, .student-import form { margin-bottom:16px; }
.flag-review > label { display:flex; gap:8px; align-items:center; min-height:44px; }
.flag-review input { min-height:0; }
.qr-card-details li { margin:8px 0; }
.qr-card-details li button { margin-inline-start:8px; }
.whatsapp-job [data-wa=profile], .whatsapp-job [data-wa=retry] { margin:6px 8px 0 0; min-height:44px; }
[data-wa=next][hidden], [data-wa=previous][hidden] { display:none; }
#resultStatsLabel { margin:12px 0 4px; }
#scanApprovalHint:empty { display:none; }
#bCopy { min-width:44px; min-height:44px; }

/* A consistent, compact rhythm for repeated administrative tasks. */
:root { --control-height:38px; --control-radius:6px; }
.workspace-sheet :is(button,.btn):not(.kq button,.icon-button,.team-person) {
  border-radius:var(--control-radius);
  line-height:1.35;
  transition:background-color .14s ease,border-color .14s ease,color .14s ease;
}
.workspace-sheet :is(button,.btn):disabled { cursor:default; }
.workspace-sheet :is(button,.btn):focus-visible, details > summary:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.manage-actions { gap:8px; }
.manage-row { gap:8px; }
.management-panel { margin-block:16px; }
.management-panel h2 { margin-bottom:12px; }
#t-scan .upload-actions { align-items:center; }
#t-scan .upload-actions :is(.btn,#qrOpen) { margin:0; min-height:42px; }
#t-scan .upload-area { padding:24px; }
#t-scan .upload-icon { margin-bottom:8px; }
#t-scan .upload-area h2 { margin-bottom:8px; }
#scanWithoutQr, #scanDrafts { margin-block:12px; }
#scanWithoutQr:not([open]), #scanDrafts:not([open]) { padding-block:6px; }
#studentRosterRows .manage-row { align-items:center; }
#studentRosterRows .manage-row > :first-child { flex:1 1 100%; }
#studentRosterRows .manage-row > button { flex:none; }
#studentRosterRows .manage-row > :first-child + button { margin-inline-start:auto; }
.student-add > summary, .student-import > summary { font-weight:500; }
.flag-review label { line-height:1.5; }
#scanApprovalHint { max-width:62ch; }

@media(max-width:760px) {
  :root { --dock-height:56px; --mobile-gutter:14px; --control-height:40px; }
  body { font-size:13px; line-height:1.45; }
  .topbar { min-height:48px; }
  .topbar .mobile-brand { font-size:22px; }
  .topbar .mobile-brand .brand-mark { width:20px; height:23px; }
  .workspace-sheet { padding:16px 14px 20px; }
  .page-heading { margin-bottom:14px; gap:8px; align-items:flex-start; }
  .page-heading h1 { font-size:21px; line-height:1.25; }
  .page-heading p { font-size:12px; margin-top:4px; line-height:1.5; }
  .workspace-sheet h2 { font-size:16px; line-height:1.35; }
  .workspace-sheet h3 { font-size:14px; line-height:1.4; }
  .workspace-sheet :is(button,.btn):not(.kq button,.team-person) {
    min-height:40px; padding:8px 11px; font-size:13px; line-height:1.35;
  }
  .workspace-sheet .icon-button { min-width:40px; width:40px; padding:9px; }
  .workspace-sheet :is(input:not([type=checkbox],[type=file]),textarea) {
    min-height:40px; padding:8px 10px; font-size:16px; line-height:1.35;
  }
  .workspace-sheet select { min-height:40px; padding:8px 28px 8px 10px; font-size:14px; }
  .workspace-sheet label { font-size:12px; line-height:1.45; }
  .workspace-sheet .field { margin-bottom:12px; }
  .workspace-sheet .field label { margin-bottom:4px; }
  .workspace-sheet :is(.mut,.field-note) { font-size:12px; line-height:1.5; }
  .workspace-sheet details > summary { min-height:40px; padding-block:9px; font-size:13px; }
  .management-panel { padding:14px; margin-block:12px; border-radius:8px; }
  .management-panel h2 { margin-bottom:10px; }
  .exam-context { gap:4px 8px; padding:8px 10px; margin-bottom:14px; }
  .exam-context .context-field select { min-height:38px; font-size:14px; }
  .exam-context > .icon-button { height:38px; min-height:38px; width:38px; }
  .status-tag { font-size:11px; line-height:1.35; padding:3px 7px; }
  .metric-strip { margin-bottom:14px; padding-bottom:12px; }
  .metric { padding-inline:12px; }
  .metric-value { font-size:25px; }
  .metric-label { font-size:11px; }
  .overview-focus { padding:12px; }
  .next-action h3 { font-size:15px; }
  .exam-row { min-height:66px; padding-block:8px; }
  .exam-row .exam-name { text-align:start; padding-inline:0; font-size:13px; }
  .exam-row p { font-size:11px; line-height:1.4; }
  .exam-row .status-tag { font-size:11px; }
  #t-exams .exam-row-actions { grid-column:auto; flex-wrap:wrap; justify-content:flex-end; }
  #t-exams .exam-row { grid-template-columns:minmax(0,1fr) auto; }
  #t-exams .exam-row > .status-tag { grid-column:1; grid-row:2; justify-self:start; }
  #t-exams .exam-row-actions { grid-column:2; grid-row:1 / 3; }
  #t-scan .upload-area { padding:18px 14px; }
  #t-scan .upload-icon { margin-bottom:6px; }
  #t-scan .upload-icon > .icon { width:28px; height:28px; }
  #t-scan .upload-area h2 { font-size:17px; margin-bottom:6px; }
  #t-scan .upload-area #scanHint { font-size:12px; line-height:1.5; margin-bottom:12px; }
  #t-scan .upload-actions { gap:8px; }
  #t-scan .upload-actions :is(.btn,#qrOpen) { min-height:40px; font-size:13px; }
  #t-scan .scan-save-actions { margin-top:12px; gap:8px; }
  #t-scan .scan-save-actions :is(button,.btn) { min-height:40px; font-size:13px; }
  #t-scan .score-heading { padding:12px; }
  #t-scan .score-heading .score b { font-size:34px; }
  .scan-result-header { margin-bottom:12px; }
  .scan-result-header h2 { font-size:17px; }
  #scanWithoutQr, #scanDrafts { margin-block:10px; }
  .student-section h3 { margin-bottom:8px; }
  .manage-row { gap:6px; padding-block:10px; }
  .manage-row strong { font-size:13px; }
  .manage-row small { font-size:11px; line-height:1.5; }
  #studentRosterRows .manage-row > button { font-size:12px; padding:7px 9px; min-height:36px; }
  .student-add, .student-import { margin-block:6px; }
  .student-add > summary, .student-import > summary { font-size:12px; }
  .team-heading h2 { font-size:16px; }
  .team-nav-button { padding:8px; font-size:12px; }
  .results-toolbar { margin-bottom:12px; gap:8px; }
  .results-table .student-cell button { font-size:13px; padding-inline:0; text-align:start; }
  .results-table td { padding-block:8px; }
  .results-table .score-value { font-size:17px; }
  .result-detail h2 { font-size:17px; }
  .detail-actions, .detail-heading { gap:8px; }
  .subject-tabs { gap:16px; }
  .subject-tabs button { font-size:12px; }
  .keygrid, .keygrid.five-options, .keygrid.four-subjects { gap:16px; }
  .kq, .keygrid.five-options .kq { min-height:43px; gap:6px; grid-template-columns:minmax(20px,1fr) repeat(4,38px); }
  .keygrid.five-options .kq { grid-template-columns:minmax(20px,1fr) repeat(5,38px); }
  .kq button, .keygrid.five-options .kq button { width:38px; height:38px; min-height:38px; font-size:13px; }
  .workspace-footer { margin-top:24px; padding-top:12px; font-size:11px; }
  .mobile-nav button { min-height:52px; font-size:11px; gap:3px; }
  .mobile-nav .icon { width:18px; height:18px; }
  .toast { padding:10px 14px; font-size:12px; }
}
@media(prefers-reduced-motion:reduce) {
  .workspace-sheet :is(button,.btn) { transition:none; }
}
#studentsPanel form[data-form=search] {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:end;
}
#studentsPanel form[data-form=search] .field { margin:0; }
#studentsPanel form[data-form=search] button { margin:0; }
#studentsPanel form[data-form=search] { margin-bottom:12px; }
@media(max-width:760px) {
  .manage-dialog { padding:16px; border-radius:10px; }
  .manage-dialog :is(button,.btn) { min-height:40px; font-size:13px; padding:8px 11px; }
  .manage-dialog h3 { font-size:17px; }
  .manage-dialog :is(.mut,label) { font-size:12px; line-height:1.5; }
  .manage-dialog .field { margin-bottom:10px; }
  .manage-dialog :is(input:not([type=checkbox],[type=file]),textarea) { min-height:40px; font-size:16px; padding:8px 10px; }
  .manage-dialog select { min-height:40px; font-size:14px; }
}
