/* Exam mode + Set CBT questions (admin). */
#admin-loading, #gate{ text-align:center; padding:60px 10px; color:var(--text-secondary); font-size:14px; }
.crumb{ font-size:11.5px; color:var(--text-muted); margin:2px 2px 10px; letter-spacing:.2px; }
.help{ font-size:12px; color:var(--text-secondary); line-height:1.6; margin:0 2px 14px; }
.msg{ font-size:12.5px; margin:0 2px 12px; line-height:1.5; min-height:0; overflow-wrap:anywhere; }
.msg:empty{ display:none; }
.msg.error{ color:var(--danger); }
.msg.ok{ color:var(--success); }

.hub-list{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg, 14px);
  overflow:hidden; margin-bottom:16px;
}
.hub-row{
  display:flex; align-items:center; gap:12px; padding:14px 14px; border-bottom:1px solid var(--border);
  text-decoration:none; color:inherit;
}
.hub-row:last-child{ border-bottom:none; }
a.hub-row:hover, .hub-row .open:hover{ background:var(--surface-2, rgba(0,0,0,.03)); }
.hub-icon{
  width:42px; height:42px; border-radius:50%; background:var(--purple-tint); color:var(--purple);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; font-weight:800; font-size:14px;
}
.hub-icon svg{ width:19px; height:19px; }
.hub-text{ flex:1; min-width:0; }
.hub-title{ font-size:14.5px; font-weight:700; overflow-wrap:anywhere; }
.hub-sub{ font-size:11.5px; color:var(--text-secondary); margin-top:2px; line-height:1.45; }
.hub-chevron{ color:var(--text-muted); font-size:20px; flex-shrink:0; padding:0 2px; }
.hub-row .open{
  display:flex; align-items:center; gap:12px; flex:1; min-width:0; text-decoration:none; color:inherit;
  border-radius:12px; margin:-6px; padding:6px;
}

/* the status circle: tap it to put that scope on this mode */
.circle{
  width:30px; height:30px; border-radius:50%; flex-shrink:0; cursor:pointer;
  border:2px solid var(--border); background:var(--surface); color:#fff;
  display:flex; align-items:center; justify-content:center; padding:0;
  -webkit-tap-highlight-color: transparent;
}
.circle svg{ width:15px; height:15px; opacity:0; }
.circle.on{ background:var(--success); border-color:var(--success); }
.circle.on svg{ opacity:1; }
.circle.part{ border-color:var(--success); background:linear-gradient(90deg, var(--success) 50%, var(--surface) 50%); }
.circle:disabled{ opacity:.5; cursor:default; }
.circle:focus-visible{ outline:2px solid var(--purple); outline-offset:2px; }

.chip{ display:inline-block; font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:999px; margin-top:4px; }
.chip.on{ background:var(--success-tint); color:var(--success); }
.chip.off{ background:var(--surface-2, #eee); color:var(--text-muted); }
.chip.mode{ background:var(--purple-tint); color:var(--purple); }

a.btn{ text-decoration:none; display:inline-block; text-align:center; }
.btn{
  font-family:inherit; font-size:13px; font-weight:700; padding:11px 14px; border-radius:var(--radius-md, 12px);
  border:1px solid var(--border); background:var(--surface); color:var(--text-primary); cursor:pointer;
}
.btn:hover:not(:disabled){ border-color:var(--purple); color:var(--purple); }
.btn:disabled{ opacity:.5; cursor:default; }
.btn.main{ background:var(--purple); border-color:var(--purple); color:#fff; }
.btn.main:hover:not(:disabled){ color:#fff; opacity:.92; }
.btn.small{ font-size:11.5px; padding:6px 11px; border-radius:999px; }
.btn.danger{ color:var(--danger); }
.btn.wide{ width:100%; margin-bottom:10px; }

.panel{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg, 14px);
  padding:16px; margin-bottom:16px;
}
.panel-title{ font-size:14.5px; font-weight:700; margin-bottom:4px; }
.panel-sub{ font-size:12px; color:var(--text-secondary); line-height:1.5; margin-bottom:12px; }

/* big mode buttons */
.mode-card{
  display:flex; align-items:center; gap:14px; padding:18px 16px; margin-bottom:12px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg, 14px);
  text-decoration:none; color:inherit;
}
.mode-card:hover{ border-color:var(--purple); }
.mode-card .num{
  width:44px; height:44px; border-radius:50%; background:var(--purple-tint); color:var(--purple);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:16px; flex-shrink:0;
}

/* paper picker */
.pick{
  display:flex; align-items:center; gap:12px; padding:14px; margin-bottom:10px; cursor:pointer;
  background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius-md, 12px);
}
.pick input{ position:absolute; opacity:0; pointer-events:none; }
.pick .circle{ pointer-events:none; }
.pick.on{ border-color:var(--success); }
.pick .p-label{ font-size:14.5px; font-weight:700; flex:1; }
.pick .p-sub{ font-size:11.5px; color:var(--text-secondary); font-weight:500; margin-top:2px; }

.field{ display:block; width:100%; box-sizing:border-box; padding:11px 12px; margin-bottom:10px;
  border-radius:var(--radius-sm, 10px); border:1px solid var(--border); background:var(--surface-2, var(--surface));
  color:var(--text-primary); font-family:inherit; font-size:14px; }
textarea.field{ min-height:84px; resize:vertical; line-height:1.45; }
.field:focus{ outline:none; border-color:var(--purple); }
.lbl{ display:block; font-size:11.5px; font-weight:700; color:var(--text-secondary); margin:0 2px 5px; }

/* --- the < > control (same as the staff pages) --------------------- */
.step-nav{ display:flex; align-items:center; justify-content:center; gap:14px; margin:2px 0 16px; padding:10px 14px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md, 12px); }
.step-nav-btn{ width:32px; height:32px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); background:var(--surface-2, var(--surface)); color:var(--text-primary); cursor:pointer; }
.step-nav-btn svg{ width:16px; height:16px; }
.step-nav-btn:disabled{ opacity:.35; cursor:default; }
.step-nav-label{ font-size:12.5px; font-weight:700; color:var(--text-secondary); text-align:center; }

/* --- the white sheet: set questions / a student's submitted paper --- */
.sheet-doc{ background:#fff; color:#1a1a1a; border-radius:var(--radius-md, 12px); padding:22px 20px; margin-bottom:16px;
  box-shadow:0 1px 3px rgba(0,0,0,.25); }
.sheet-doc h2{ font-size:18px; margin:0 0 2px; }
.sheet-doc .d-sub{ font-size:12px; color:#555; margin:0 0 14px; line-height:1.55; }
.sheet-doc .d-score{ display:flex; gap:10px; flex-wrap:wrap; margin:0 0 16px; }
.sheet-doc .d-score span{ font-size:12px; font-weight:700; padding:5px 11px; border-radius:999px; background:#f1f1f5; color:#333; }
.sheet-doc .d-score span.big{ background:#e4f5ee; color:#137a3c; }
.sheet-doc .d-score span.warn{ background:#faf0de; color:#8a5a0b; }
.dq{ padding:14px 0; border-top:1px solid #e5e5e5; break-inside:avoid; }
.dq:first-of-type{ border-top:none; }
.dq-head{ display:flex; gap:10px; align-items:flex-start; }
.dq-num{ font-weight:800; min-width:26px; color:#1a1a1a; }
.dq-text{ font-size:14.5px; font-weight:600; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; flex:1; }
.dq-mark{ flex-shrink:0; font-size:11px; font-weight:800; padding:3px 9px; border-radius:999px; }
.dq-mark.ok{ background:#e4f5ee; color:#137a3c; }
.dq-mark.no{ background:#fbeaea; color:#b3261e; }
.dq-mark.blank{ background:#f1f1f5; color:#777; }
.dq img{ display:block; max-width:100%; max-height:260px; margin:10px 0 4px 36px; border-radius:8px; border:1px solid #ddd; }
.dq-opts{ list-style:none; margin:10px 0 0 36px; padding:0; }
.dq-opts li{ display:flex; align-items:center; gap:10px; padding:7px 10px; margin-bottom:5px; border-radius:9px; border:1px solid #e3e3e3; font-size:13.5px; line-height:1.4; }
.dq-opts .tick{ width:22px; height:22px; border-radius:50%; flex-shrink:0; border:1.5px solid #bbb; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; color:#fff; }
.dq-opts .L{ font-weight:800; width:14px; flex-shrink:0; }
.dq-opts .note{ margin-left:auto; font-size:11px; font-weight:800; white-space:nowrap; }
.dq-opts li.picked .tick{ background:#b3261e; border-color:#b3261e; }
.dq-opts li.picked{ border-color:#b3261e; background:#fdf3f3; }
.dq-opts li.right .note{ color:#137a3c; }
.dq-opts li.right.picked .tick, .dq-opts li.key .tick{ background:#137a3c; border-color:#137a3c; }
.dq-opts li.right.picked{ border-color:#137a3c; background:#eef9f3; }
.dq-opts li.key{ border-color:#137a3c; background:#eef9f3; }
.print-btn{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; box-sizing:border-box; padding:13px;
  border-radius:var(--radius-md, 12px); border:1px solid var(--border); background:var(--surface); color:var(--text-primary);
  font-family:inherit; font-size:14px; font-weight:700; cursor:pointer; margin-bottom:12px; }
.print-btn:hover{ border-color:var(--purple); color:var(--purple); }
.print-btn svg{ width:16px; height:16px; }
.sheet-doc .d-stamp{ display:none; }
@media print{
  .topbar, footer, .crumb, .help, .msg, .step-nav, .print-btn, #ai-fab, .ai-fab{ display:none !important; }
  body, main{ background:#fff !important; }
  .sheet-doc{ box-shadow:none; padding:0; border-radius:0; }
  .sheet-doc.step-hidden{ display:block !important; page-break-before:always; }
}
.step-hidden{ display:none; }
@page{ size:A4 portrait; margin:12mm; }
.dq-opts li.picked .note{ color:#b3261e; }
.dq-opts li.right.picked .note, .dq-opts li.key .note{ color:#137a3c; }
