:root{font-family:system-ui,sans-serif;color:#192d2a;background:#f4f7f5;line-height:1.5;font-synthesis:none;--ink:#192d2a;--muted:#4b635c;--accent:#155a46;--line:#d5e1db;--light:#eaf4ee}
*{box-sizing:border-box}body{margin:0}a{color:var(--accent)}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.55}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #438c74;outline-offset:3px}.wrap{width:min(1120px,calc(100% - 32px));margin-inline:auto}.top{background:white;border-bottom:1px solid var(--line)}.nav,.row{display:flex;align-items:center;justify-content:space-between;gap:12px}.nav{min-height:68px}.brand{color:var(--ink);text-decoration:none;font-weight:850;letter-spacing:.035em;display:inline-flex;align-items:center;gap:8px}.brand-mark{display:grid;place-items:center;width:33px;height:33px;border-radius:8px;background:var(--accent);color:white;font-size:22px;line-height:1}
main{padding-block:34px 64px}h1,h2,h3,p{margin:0 0 10px}h1{font-size:clamp(30px,5vw,48px);line-height:1.1;letter-spacing:-.035em}h2{font-size:23px;line-height:1.25}h3{font-size:17px}.muted,.hint{color:var(--muted)}.hint{font-size:.875rem}.hero{display:grid;grid-template-columns:1.15fr .85fr;align-items:center;gap:clamp(24px,6vw,80px);padding:44px 0}.hero h1{font-size:clamp(38px,6vw,68px);max-width:720px}.hero p{font-size:1.15rem;max-width:48ch;margin:18px 0 24px}.card{border:1px solid var(--line);border-radius:14px;padding:clamp(16px,3vw,24px);background:#fff}.hero .card{background:#e7f0eb}.hero .card th,.hero .card td{background:transparent}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--accent);border-radius:8px;padding:9px 14px;background:var(--accent);color:#fff;font-weight:650;text-decoration:none;white-space:nowrap}.button:hover:not(:disabled){filter:brightness(1.12)}.button.secondary{background:white;border-color:var(--line);color:var(--ink)}.button.small{padding:6px 10px;font-size:.875rem}.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.login{max-width:460px;margin:34px auto}.login .button{margin-top:12px}.workspace-head{margin-bottom:20px;align-items:flex-start}.workspace-head h1{font-size:clamp(28px,4vw,41px)}.workspace{display:grid;grid-template-columns:240px minmax(0,1fr);align-items:start;gap:14px}.stack{display:grid;gap:14px}.sidebar .button{width:100%;margin-bottom:8px}.sidebar-list{list-style:none;padding:0;margin:4px 0 0;display:grid;gap:5px}.sidebar-list button{width:100%;border:1px solid transparent;background:transparent;color:var(--ink);text-align:left;padding:8px;border-radius:7px;overflow-wrap:anywhere}.sidebar-list [aria-current=true],.sidebar-list button:hover{background:var(--light);border-color:var(--line)}.sidebar-list small{display:block;color:var(--muted)}
.fields{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px;margin:14px 0 8px}label{display:block;font-weight:650;font-size:.9rem}input,select,textarea{width:100%;border:1px solid #aabdb2;border-radius:8px;background:#fff;color:var(--ink);padding:8px 10px}label input,label select,label textarea{margin-top:4px}textarea{min-height:76px;resize:vertical}select{appearance:none;padding-right:32px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%234b635c' stroke-width='1.5'/%3E%3C/svg%3E") right 9px center/16px no-repeat}.drop{display:block;text-align:center;border:2px dashed #8eb1a1;padding:14px;border-radius:10px;background:var(--light);margin:12px 0}.drop.drag{border-color:var(--accent);background:#d6eee0}.drop input{border:none;width:auto;max-width:100%;padding:4px}.upload-actions{margin-top:12px}.secret{margin-top:12px}.status{min-height:1.5em;margin:8px 0 0;font-size:.9rem;color:var(--accent)}.status.error{color:#9d2e21}.table-scroll{overflow:auto}.table-scroll table{width:100%;border-collapse:collapse;text-align:left;font-size:.9rem;margin:8px 0}th,td{padding:9px 8px;border-bottom:1px solid var(--line);white-space:nowrap}th{background:#f4f7f5}.pill{font-size:.8rem;font-weight:700;background:var(--light);padding:3px 8px;border-radius:5px;display:inline-block}.pill.warn{background:#fff0d4;color:#784d0f}.pill.fail{background:#fbece9;color:#842d21}.file-cell{max-width:200px;overflow:hidden;text-overflow:ellipsis}.metrics{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.metrics span{background:var(--light);padding:4px 10px;border-radius:6px;font-size:.85rem}.section-head{align-items:flex-start;flex-wrap:wrap}.headline{margin-bottom:4px}.nav-user{font-size:.875rem;overflow:hidden;text-overflow:ellipsis;max-width:34vw}dialog{border:1px solid var(--line);border-radius:14px;width:min(900px,calc(100% - 24px));max-height:90vh;padding:20px;color:var(--ink)}dialog::backdrop{background:#14261fc0}.review-body{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:12px 0}.review-photo{max-height:58vh;overflow:auto;background:var(--light);padding:12px;border-radius:8px}.review-photo img{display:block;width:100%;height:auto}.marks{display:grid;grid-template-columns:repeat(auto-fit,minmax(64px,1fr));gap:6px;margin:12px 0}.marks select{padding-left:6px}.marks select[data-uncertain=true]{background-color:#fff0d4}.fineprint{margin-top:12px}
@media(max-width:760px){.hero,.workspace,.review-body{grid-template-columns:1fr}.hero{padding:18px 0 26px}.steps{grid-template-columns:1fr}.workspace-head{flex-wrap:wrap}.fields{grid-template-columns:1fr 1fr}.fields label:first-child{grid-column:1/-1}.sidebar-list{max-height:160px;overflow:auto}.review-photo{max-height:32vh}.nav-user{display:none}}
.omr-photo{overflow:auto;max-height:59vh;background:var(--light);border-radius:8px;margin:12px 0}.omr-photo canvas{display:block;width:100%;height:auto;cursor:crosshair}.omr-photo canvas[width="300"]{display:none}.review-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.omr-group{margin-top:18px}.omr-group h3{margin:0}.template-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:end;margin:12px 0}.template-controls label{flex:1;min-width:190px}.answer-sections label{margin-top:8px}.outline-note{margin-top:8px}.row-actions{min-width:182px}.needs-review{color:#785013}

/* Dashboard */
.dashboard{--ink:#172f2a;--muted:#4d655e;--accent:#145d48;--line:#d8e4dd;--light:#e9f3ee;width:min(1280px,calc(100% - 48px))}
.dashboard [id]{scroll-margin-top:20px}
.dashboard .workspace-head{margin-bottom:18px;align-items:center}
.dashboard .workspace-head h1{margin-bottom:5px}
.dashboard .workspace-head p{margin:0}
.guide-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,370px);align-items:center;gap:28px;padding:20px 24px;border-radius:18px;background:#133d33;color:#fff}
.guide-copy h2{font-size:clamp(23px,3vw,31px);letter-spacing:-.025em}
.guide-copy p{max-width:50ch;color:#e0eee7;margin:8px 0 17px}
.guide-card .button{background:#fff;color:#163a31;border-color:#fff}
.guide-card .guide-secondary{background:transparent;color:#fff;border-color:#91b1a3}
.guide-card video{display:block;width:100%;aspect-ratio:16/9;border-radius:11px;border:1px solid #71968a;background:#102d26;object-fit:contain}
.overview{margin:24px 0}
.overview-head{justify-content:flex-start;align-items:baseline;margin-bottom:10px;gap:10px;flex-wrap:wrap}
.overview-head h2{margin:0;font-size:20px}
.overview-head .hint{overflow-wrap:anywhere}
.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.stat-card{display:grid;gap:3px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:12px;border-top:3px solid #859ba2;min-width:0}
.stat-card>span{font-weight:700;font-size:.9rem}
.stat-card strong{font-size:clamp(24px,3.3vw,36px);line-height:1.12;letter-spacing:-.035em;font-variant-numeric:tabular-nums}
.stat-card small{color:var(--muted);font-size:.8rem}
.stat-done{border-top-color:#2a8c6f}.stat-review{border-top-color:#b77429}.stat-average{border-top-color:#5278a1}
.overview-charts{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:12px;margin-top:12px}
.overview-charts[hidden],.result-controls[hidden]{display:none}
.chart-card{padding:14px 16px}
.chart-card h3{margin:0}
.progress-number{color:var(--accent);font-variant-numeric:tabular-nums}
.chart-card progress{display:block;width:100%;height:11px;appearance:none;border:0;border-radius:8px;overflow:hidden;margin:11px 0 6px;color:#238269;background:#e8efec}
.chart-card progress::-webkit-progress-bar{background:#e8efec}
.chart-card progress::-webkit-progress-value{background:#238269}
.chart-card progress::-moz-progress-bar{background:#238269}
.review-link{display:inline-block;font-size:.875rem;font-weight:700}
.class-chart{display:grid;gap:3px;max-height:184px;overflow:auto;list-style:none;padding:0;margin:7px 0 0}
.class-chart li{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(82px,1fr) minmax(65px,.65fr);gap:6px;padding:5px 0;border-bottom:1px solid var(--line);font-size:.875rem}
.class-chart li>:last-child{text-align:right}
.class-chart .chart-table-head{color:var(--muted);font-weight:650}
.dashboard .workspace{grid-template-columns:225px minmax(0,1fr);gap:16px}
.dashboard .sidebar{position:sticky;top:16px;padding:13px}
.jump-menu{display:grid;gap:2px}
.jump-menu a{padding:7px 9px;border-radius:7px;text-decoration:none;color:var(--ink);font-size:.89rem;font-weight:650}
.jump-menu a:hover,.jump-menu a:focus-visible{background:var(--light);color:var(--accent)}
.history-area{border-top:1px solid var(--line);margin-top:10px;padding-top:13px}
.history-area input{font-size:.875rem}
.dashboard .sidebar-list{max-height:35vh;overflow:auto}
.dashboard .sidebar-list button{font-size:.875rem}
.exam-fields{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}
.dashboard .answer-sections{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(175px,100%),1fr));gap:10px;margin:10px 0}
.dashboard .answer-sections textarea{min-height:92px}
.dashboard .status:empty{display:none}
.result-controls{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr);gap:10px;margin-top:12px}
.empty-results{padding:16px;text-align:center;background:#f2f7f4;border-radius:10px;margin-top:14px;font-size:.92rem}
.empty-results p{margin-bottom:2px}
.omr-group h3{display:flex;gap:9px;align-items:baseline}
.omr-group h3 span{font-size:.8rem;font-weight:500;color:var(--muted)}
.pill.waiting{background:#edf0f2;color:#40535c}
@media(max-width:860px){
  .dashboard .workspace{grid-template-columns:1fr}
  .dashboard .sidebar{position:static}
  .jump-menu{display:flex;flex-wrap:wrap}
  .dashboard .sidebar-list{max-height:132px}
}
@media(max-width:650px){
  .dashboard{width:calc(100% - 24px);padding-block:20px 45px}
  .guide-card,.overview-charts{grid-template-columns:1fr}
  .guide-card{padding:16px;gap:14px}
  .guide-card video{max-width:460px;margin-inline:auto}
  .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .stat-card{padding:11px}
  .exam-fields label:first-child{grid-column:auto}
  .result-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .result-controls label:first-child{grid-column:1/-1}
}

.dashboard [data-panel][hidden]{display:none}
.dashboard .overview{margin:0}
.jump-menu [aria-current=page]{background:var(--light);color:var(--accent);box-shadow:inset 3px 0 var(--accent)}
.dashboard [data-panel] h2:focus{outline:none}
.dashboard .mobile-menu{display:none}
@media(max-width:860px){
  .dashboard .mobile-menu{display:inline-flex;justify-self:start}
}

@font-face {
  font-family:"Bricolage Grotesque";src:url("/bricolage-grotesque.woff2") format("woff2");
  font-style:normal;font-weight:400 800;font-display:swap;
}
@font-face {
  font-family:"Hanken Grotesk";src:url("/hanken-grotesk.woff2") format("woff2");
  font-style:normal;font-weight:400 800;font-display:swap;
}
:root{font-family:"Hanken Grotesk",system-ui,sans-serif}
h1,h2,h3,.brand{font-family:"Bricolage Grotesque",system-ui,sans-serif}
.admin-page{width:min(1260px,calc(100% - 40px))}
.admin-head{margin-bottom:22px}
.admin-head h1{margin-bottom:5px}
.admin-workspace{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);gap:16px;align-items:start}
.admin-form{display:grid;gap:12px;margin-top:12px}
.admin-form [readonly]{background:#f3f6f3}
.admin-directory input{max-width:360px}
.admin-directory table td,.admin-directory table th{padding-inline:10px}
.admin-page [hidden]{display:none}
@media(max-width:760px){
  .admin-page{width:calc(100% - 24px)}
  .admin-workspace{grid-template-columns:1fr}
  .nav .brand-mark{width:30px;height:30px;border-radius:8px}
  .nav .brand{font-size:1rem;white-space:nowrap}
  .nav .actions{gap:4px}
  .nav .actions .button{padding:5px 6px;line-height:1.35}
}

/* Teacher and super-admin workspaces */
.dashboard,.admin-page{
  --ink:#173429;--muted:#4e6659;--line:#d9e1d5;--accent:#205943;--light:#e7efdd;
}
body:has(.dashboard),body:has(.admin-page){background:#f4f6ed}
.dashboard .workspace-head,.admin-masthead{
  background:#1b4034;color:#f7f9eb;padding:25px 30px;border:1px solid #1c4032;
  border-radius:18px;margin-bottom:20px;position:relative;isolation:isolate;overflow:hidden
}
.dashboard .workspace-head::before,.admin-masthead::before{
  content:"";position:absolute;z-index:-1;right:-92px;top:-155px;width:430px;height:430px;border-radius:50%;
  background:repeating-radial-gradient(circle at center,#c4e38b24 0 1px,transparent 2px 24px);pointer-events:none
}
.dashboard .workspace-head h1,.admin-masthead h1{color:#fbfff5;margin:0 0 5px;letter-spacing:-.059em}
.dashboard .workspace-head p,.admin-masthead p{color:#dbebdc;margin:0}
.dashboard .workspace-head .button{
  background:#dcf0a9;border-color:#c5df8f;color:#1b372b
}
.dashboard .sidebar{background:#fbfcf5;border-radius:15px}
.jump-menu a{padding:9px 10px}
.jump-menu [aria-current=page]{background:#e2efd2;color:#204b36;box-shadow:inset 3px 0 #507b48}
.dashboard .guide-card{background:#e2ebd3;color:#1f402f;gap:20px;padding:18px 20px;border:1px solid #cbd8bc}
.dashboard .guide-copy p{color:#43604e}
.dashboard .guide-card .button{background:#235b45;color:white;border-color:#235b45}
.dashboard .guide-card .guide-secondary{background:#f7fbf0;color:#204635;border-color:#a4b99d}
.dashboard .guide-card video{border-color:#a6bba4}
.dashboard .stat-card{background:#fffef8}
.dashboard .stat-total{border-top-color:#648a7c}
.dashboard .stat-done{border-top-color:#60964a}
.dashboard .stat-review{border-top-color:#ba7d39}
.dashboard .stat-average{border-top-color:#68849c}
.dashboard .chart-card{background:#fdfef7}
.dashboard .workspace .card[id]:not(.chart-card){box-shadow:0 3px 12px #223f2e0a}
.admin-menu{display:flex;gap:9px;margin-bottom:15px}
.admin-files{min-height:250px}
#folder-path{display:flex;align-items:center;flex-wrap:wrap;gap:7px;border-bottom:1px solid var(--line);padding:7px 0 11px;margin-bottom:13px}
#folder-path button{color:#215740;border:0;background:#edf3e6;border-radius:5px;padding:2px 7px;font-weight:700}
#folder-path [aria-current]{font-weight:680}
.folder-grid{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(215px,100%),1fr));gap:10px}
.folder-grid button{width:100%;text-align:left;padding:13px;background:#f5f8ed;border:1px solid #d7e3ce;color:var(--ink);border-radius:10px;display:flex;gap:11px;align-items:center}
.folder-grid button:hover{background:#e7f0db}
.folder-grid strong,.folder-grid small{display:block;overflow-wrap:anywhere}
.folder-grid small{color:var(--muted)}
.folder-icon{width:25px;height:17px;background:#b8d088;border-radius:3px;position:relative;display:block;flex:none}
.folder-icon::before{content:"";position:absolute;top:-3px;left:0;width:10px;height:5px;border-radius:2px;background:#a4ba75}
@media(max-width:650px){
  .dashboard .workspace-head,.admin-masthead{padding:18px}
  .dashboard .workspace-head h1,.admin-masthead h1{font-size:31px}
  .dashboard .guide-card{padding:14px}
}

.explorer-layout{display:grid;grid-template-columns:minmax(155px,230px) minmax(0,1fr);gap:16px;margin-top:12px;align-items:start}
#explorer-tree{background:#f3f7eb;border:1px solid var(--line);border-radius:10px;padding:11px;max-height:55vh;overflow:auto}
#explorer-tree h3{margin:0 0 6px}
#explorer-tree ul{list-style:none;margin:4px 0;padding-left:9px;border-left:1px solid #c6d4bf}
#explorer-tree button,.file-link{display:block;text-align:left;color:#22543f;background:none;border:0;font-weight:700;overflow-wrap:anywhere}
#explorer-tree button{width:100%;padding:6px 7px;border-radius:5px}
#explorer-tree button:hover,#explorer-tree [aria-current]{background:#e0ebd6}
.explorer-tools{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(130px,1fr);gap:9px;margin-bottom:14px}
.file-link{padding:4px 0;text-decoration:underline;text-underline-offset:.25em}
.file-preview{padding:14px 15px;background:#f3f7eb;border:1px solid var(--line);border-radius:10px;margin-top:14px}
.file-preview dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 13px}
.file-preview dt{font-size:.85rem;color:var(--muted)}
.file-preview dd{margin:0;font-weight:650;overflow-wrap:anywhere}
@media(max-width:650px){
  .explorer-layout{grid-template-columns:1fr}
  #explorer-tree{max-height:175px}
  .file-preview dl{grid-template-columns:repeat(2,minmax(0,1fr))}
}
