/* CS101 lecture page: phone first, same look as the practice site. */
:root {
  --paper: #f2f4f6; --panel: #ffffff; --ink: #16202b; --ink-soft: #4d5967; --muted: #7a8591; --rule: #d3d9df;
  --action: #2b4c7e; --action-dark: #1f3a63; --correct: #2e7a48; --wrong: #b3322a; --accent: #f2c14e;
  --sans: "Ubuntu", "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
  --mono: "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
[hidden] { display: none !important; }
button {
  font: inherit; padding: 8px 16px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--panel); color: var(--ink); cursor: pointer; touch-action: manipulation;
}
button:disabled { opacity: .55; cursor: progress; }
button.primary { background: var(--action); border-color: var(--action); color: #fff; }
button.small { padding: 4px 10px; font-size: 14px; }
button.linklike { border: none; background: none; color: #b9c3cd; text-decoration: underline; padding: 0 0 0 8px; font-size: 13px; }
input[type=text], textarea {
  font: 15px/1.4 var(--mono); padding: 9px 10px; border: 1px solid var(--rule); border-radius: 6px; width: 100%; background: #fff;
}
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.muted { color: var(--muted); }
.err, .bad { color: var(--wrong); }
.ok { color: var(--correct); font-weight: 600; }
.bad { font-weight: 600; }

/* top bar */
.lbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px;
  padding: 8px 16px; background: var(--ink); color: #e9eef3;
}
.lbar-home { color: #fff; font-weight: 600; text-decoration: none; }
.lbar-lec { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.lbar-title { color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbar-date { font-size: 13px; color: #b9c3cd; }
.lbar-score { font: 600 20px/1 var(--mono); color: var(--accent); white-space: nowrap; }
.lbar-user { font-size: 13px; color: #b9c3cd; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lbar-guest { color: #1b2530; background: #f2c14e; border-radius: 10px; padding: 1px 8px; margin-right: 10px; font-weight: 600; font-size: 12px; }
.lbar-pending { font-size: 12px; color: #f2c14e; white-space: nowrap; }
.modal-back { position: fixed; inset: 0; z-index: 20; background: rgba(22, 32, 43, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 10px; padding: 20px; max-width: 440px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.modal p { margin: 0 0 10px; }

.lbar-link { color: var(--accent); margin-right: 10px; text-decoration: none; font-weight: 600; }
.instr { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--rule); }
.instr .reveal { color: #8a3b12; border-style: dashed; }
.answerbox { margin-top: 8px; padding: 8px 10px; background: #fff8e6; border-radius: 6px; }

/* layout */
.view { max-width: 780px; margin: 0 auto; padding: 16px 14px 60px; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 20px; }
.card.center { max-width: 460px; margin: 8vh auto 0; text-align: center; }
.card h1 { font-size: 22px; margin: 0 0 8px; }
.gsi { display: flex; justify-content: center; margin: 18px 0 6px; min-height: 44px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row input { flex: 1; }
h2 { font-size: 17px; margin: 20px 0 8px; color: var(--ink-soft); }

/* home: course title */
.welcome { margin: 10px 2px 6px; }
.welcome h1 { font-size: 24px; margin: 0; color: var(--ink); }
.welcome p { margin: 2px 0 0; color: var(--ink-soft); font-size: 17px; }

/* lecture list */
.llist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lcard {
  display: flex; flex-direction: column; gap: 2px; position: relative; padding: 12px 14px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--action); color: var(--ink); text-decoration: none;
}
.lcard .lt { font-weight: 600; color: var(--action-dark); padding-right: 50px; }
.lcard .lm { font-size: 13px; color: var(--muted); }
.lnum { display: inline-block; min-width: 2.6em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.lcard.active { border-left-color: var(--correct); background: #f1f9f4; }
.lcard.active .lt { color: var(--correct); }
.lcard.future { border-left-color: var(--rule); background: #f7f8f9; }
.lcard.future .lt { color: var(--muted); font-weight: 500; }
.badge { position: absolute; right: 12px; top: 12px; background: var(--correct); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }

/* lecture page: question nav (left; a strip at the top on phones) and the content */
.view.lecview { max-width: 1020px; }
.lecgrid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; }
.lqnav { position: sticky; top: calc(var(--barh, 52px) + 10px); background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-height: calc(100vh - var(--barh, 52px) - 30px); overflow-y: auto; }
.lqnav-head { flex-basis: 100%; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.qn { width: 36px; height: 32px; padding: 0; border-radius: 6px; font: 600 14px/1 var(--sans); font-variant-numeric: tabular-nums;
  background: #e3e7eb; border: 2px solid transparent; color: var(--ink); }
.qn.solved { background: var(--correct); color: #fff; }
.qn.penalty { background: #d9822b; color: #fff; }
.qn.wrong { background: var(--wrong); color: #fff; }
.qn.current { border-color: var(--ink); }
.lqnav-key { flex-basis: 100%; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.lqnav-key span { display: flex; align-items: center; gap: 5px; }
.k { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: #e3e7eb; }
.k.solved { background: var(--correct); } .k.penalty { background: #d9822b; } .k.wrong { background: var(--wrong); }
.lhead { margin: 4px 2px 18px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.lh-num { font-size: 14px; font-weight: 600; color: var(--action); letter-spacing: .02em; }
.lhead h1 { font-size: 30px; line-height: 1.2; margin: 2px 0 8px; }
.lh-desc { color: var(--ink-soft); font-size: 17px; }
.lh-desc p { margin: 0 0 6px; }
.try-chip { margin-left: auto; font-size: 12.5px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--rule); background: #f4f6f8; color: var(--ink-soft); white-space: nowrap; }
.try-chip.warn { background: #fff4d6; border-color: #ecd28c; color: #8a3b12; }
.try-chip.solved { background: #e5f3ea; border-color: #9cd0ae; color: var(--correct); }
.tutor { margin-top: 10px; }
button.linkbtn { border: none; background: none; padding: 0; color: var(--action-dark); text-decoration: underline; font-size: 14px; }

/* teaching text and questions */
.teach { margin: 18px 2px; }
.teach p { margin: 0 0 10px; }
.teach h3 { font-size: 19px; margin: 30px 0 8px; color: var(--action-dark); }
.teach ul, .teach ol { margin: 0 0 10px; padding-left: 24px; }
.teach pre, .qtext pre, pre.code { background: #e8ecf0; padding: 8px 12px; border-radius: 6px; overflow-x: auto; font: 14px/1.4 var(--mono); }
.teach code, .qtext code { font-family: var(--mono); background: #e8ecf0; padding: 0 3px; border-radius: 3px; }
.teach pre code, .qtext pre code { background: none; padding: 0; }
.teach table, .qtext table { max-width: 100%; }
.teach > div, .qtext > div { overflow-x: auto; }
.qcard { background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 6px; padding: 14px; margin: 14px 0 22px; }
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.qno { font-weight: 700; color: var(--action-dark); }
.qtype { font-size: 13px; color: var(--muted); }
.qbadge { font-size: 13px; font-weight: 600; }
.qbadge.right { color: var(--correct); }
.qbadge.wrong { color: var(--wrong); }
.qtext p { margin: 0 0 8px; }
.opts { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--action); background: #eef3fa; }
.opt input { margin-top: 4px; }
.answer { margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.feedback { margin-top: 8px; }
.feedback p { margin: 6px 0; }
.order { padding-left: 26px; margin: 8px 0; }
.order li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 8px; margin: 4px 0; background: #fbfcfd; }
.order code { flex: 1; font: 14px/1.4 var(--mono); white-space: pre; overflow-x: auto; }
.order .mv { display: flex; gap: 4px; }

/* code questions */
.editor .CodeMirror { height: auto; min-height: 120px; border: 1px solid var(--rule); border-radius: 6px; font: 15px/1.4 var(--mono); }
.keys { display: none; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.key { font-family: var(--mono); min-width: 38px; }
@media (pointer: coarse) { .keys { display: flex; } }
.tablewrap { overflow-x: auto; }
table.io { border-collapse: collapse; margin: 6px 0; font-size: 14px; }
table.io th, table.io td { border: 1px solid var(--rule); padding: 4px 8px; text-align: left; vertical-align: top; }
table.io th { background: #e8ecf0; }
table.io pre { margin: 0; font: 14px/1.35 var(--mono); white-space: pre-wrap; word-break: break-word; }
table.io tr.pass td { background: #e5f3ea; }
table.io tr.fail td { background: #fbe7e5; }
table.io td.mark { font-weight: 700; text-align: center; }
table.io td.hid { color: var(--ink-soft); font-style: italic; }
pre.err { background: #fbe7e5; padding: 8px 12px; border-radius: 6px; white-space: pre-wrap; font: 14px/1.4 var(--mono); }
.figs img { max-width: 100%; display: block; margin-top: 6px; }
.endnote { text-align: center; margin-top: 30px; font-size: 14px; }

@media (max-width: 800px) {
  .lecgrid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lqnav { top: var(--barh, 52px); z-index: 4; flex-wrap: nowrap; overflow-x: auto; max-height: none; border-radius: 0 0 8px 8px;
    margin: -12px -10px 0; padding: 6px 10px; border-top: none; }
  .lqnav-head, .lqnav-key { display: none; }
  .qn { flex-shrink: 0; }
  .qcard { scroll-margin-top: calc(var(--barh, 52px) + 54px); }
  .lhead h1 { font-size: 25px; }
}
.qcard { scroll-margin-top: calc(var(--barh, 52px) + 12px); }

@media (max-width: 600px) {
  body { font-size: 15px; }
  .lbar { padding: 6px 12px; }
  .lbar-home { font-size: 14px; }
  .lbar-user { order: 4; flex-basis: 100%; margin-left: 0; font-size: 12px; }   /* email on its own line */
  .lbar-score { font-size: 17px; }
  .view { padding: 12px 10px 50px; }
  .card { padding: 16px; }
  .qcard { padding: 12px; }
}

/* ---------------- instructor pages ---------------- */
.view.wide { max-width: 1200px; }
.inav { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.inav a { padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--action-dark); background: #e4eaf1; }
.inav a.on { background: var(--action); color: #fff; }
a.btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--panel); }
a.btn.primary { background: var(--action); border-color: var(--action); color: #fff; }
a.btn.small { padding: 4px 10px; font-size: 14px; }
button.danger { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.small { font-size: 13px; }
.activebox { background: #f1f9f4; border: 1px solid #9cd0ae; border-left: 5px solid var(--correct); border-radius: 8px; padding: 14px 16px; margin: 10px 0 18px; }
.ab-title { font-size: 20px; font-weight: 700; color: var(--correct); }
.ab-meta { color: var(--ink-soft); margin: 2px 0 8px; }
.ab-pass, .dh-pass { display: flex; align-items: baseline; gap: 12px; }
.ab-pass span, .dh-pass span { color: var(--ink-soft); }
.ab-pass b, .dh-pass b.pw { font: 700 38px/1.1 var(--mono); letter-spacing: .04em; color: var(--ink); background: #fff; padding: 2px 14px; border-radius: 6px; border: 1px solid var(--rule); }
table.grid { border-collapse: collapse; width: 100%; background: var(--panel); font-size: 14px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--rule); padding: 7px 8px; text-align: left; vertical-align: top; }
table.grid th { background: #e8ecf0; font-weight: 600; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tr.rowactive td { background: #f1f9f4; }
.bt { font-weight: 600; }
.heldlist { display: flex; flex-direction: column; gap: 2px; }
a.held { color: var(--action-dark); font-size: 13px; }
td.acts { white-space: nowrap; }
td.acts > * { margin: 0 4px 4px 0; }

/* dashboard */
.dhead { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; }
.dh-left { flex: 1; min-width: 220px; }
.dh-num { font-size: 13px; font-weight: 600; color: var(--action); }
.dh-title { font-size: 22px; font-weight: 700; }
.dh-lec { margin: 2px 0; }
.dh-acts { align-self: flex-start; }
.tile.wide { min-width: 170px; }
.t-of { font-size: 18px; color: var(--muted); font-weight: 600; }
.pbar { height: 8px; background: #e3e7eb; border-radius: 4px; margin: 5px 0 3px; overflow: hidden; }
.pbar span { display: block; height: 100%; background: var(--action); border-radius: 4px; }
.tiles { display: flex; gap: 10px; }
.tile { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 14px; min-width: 110px; background: #fbfcfd; }
.t-label { font-size: 13px; color: var(--ink-soft); }
.t-value { font: 700 30px/1.1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.t-sub { font-size: 12px; color: var(--muted); }
.toggle { font-size: 14px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.right, .seg.right { background: #2e7a48; }
.sw.wrong, .seg.wrong { background: #b3322a; }
.sw.none, .seg.none { background: #d3d9df; }
.qrow { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.qr-head { display: flex; gap: 10px; align-items: baseline; }
.qr-text { color: var(--ink-soft); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.qr-bar { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.bar { flex: 1; display: flex; gap: 2px; height: 16px; }
.seg { height: 100%; border-radius: 4px; min-width: 4px; }
.counts { font: 600 15px/1 var(--mono); white-space: pre; color: var(--ink); min-width: 150px; }
details summary { cursor: pointer; font-size: 14px; color: var(--action-dark); }
.guests { margin-top: 14px; }

/* attendance sheet */
.filter { max-width: 280px; font-family: var(--sans); }
.sheet { max-height: 75vh; overflow: auto; border: 1px solid var(--rule); border-radius: 6px; }
table.att th { position: sticky; top: 0; z-index: 2; }
table.att .sticky, table.att .sticky2 { position: sticky; background: var(--panel); z-index: 1; }
table.att th.sticky, table.att th.sticky2 { z-index: 3; background: #e8ecf0; }
table.att .sticky { left: 0; min-width: 80px; }
table.att .sticky2 { left: 80px; min-width: 190px; }
table.att th.lcol { text-align: center; min-width: 92px; }
td.cell { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.cell.p { background: #e5f3ea; color: #1f5a33; font-weight: 600; }
td.cell.a { color: var(--muted); }
table.att tr.guestrow td.sticky { font-style: italic; color: var(--muted); }
table.att tr.guestrow:first-of-type td, table.att tr:not(.guestrow) + tr.guestrow td { border-top: 2px solid #b8c0c8; }

@media (max-width: 600px) {
  .dh-title { font-size: 18px; }
  .ab-pass b, .dh-pass b.pw { font-size: 28px; }
  .tiles { width: 100%; }
  .tile { flex: 1; min-width: 0; padding: 6px 8px; }
  .t-value { font-size: 24px; }
  .counts { min-width: 0; font-size: 13px; }
}

table.grid a, table.att a { color: var(--action-dark); }

/* ---------------- one question per page, opened questions, Final submit (2026-10-10) ---------------- */
.qn.off { background: #f4f6f8; color: #aab3bc; border: 2px dashed #d3d9df; }
.qn:disabled { cursor: not-allowed; opacity: 1; }
.k.off { background: #f4f6f8; border: 1px dashed #aab3bc; }
.lqnav-part { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--action); margin-top: 4px; }
.lpage { min-height: 40vh; }
.lpage .qcard { margin-top: 10px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--rule); }
.pager .submit { margin-left: auto; }
.pager .submit:disabled { cursor: not-allowed; }
.lbanner p.banner { margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--rule); background: var(--panel); }
.banner.ok { background: #e5f3ea; border-color: #9cd0ae; color: #1f5a33; }
.banner.warn { background: #fff4d6; border-color: #ecd28c; color: #6b3a0c; font-weight: 600; }
.banner.wait { background: #eef3fa; border-color: #b9cbe3; color: var(--action-dark); }
.banner.info { background: #f4f6f8; }
.locked .qcard .actions button, .locked .qcard .keys button, .locked .qcard .order button { pointer-events: none; opacity: .45; }
.toast { position: fixed; z-index: 15; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; padding: 10px 12px 10px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); max-width: calc(100% - 32px); }
.toast button.small:not(.primary) { background: transparent; color: #fff; border-color: #6b7785; }
.modal h2 { margin: 0 0 10px; color: var(--ink); }
.modal { max-height: calc(100vh - 32px); overflow-y: auto; }
table.summary { border-collapse: collapse; width: 100%; font-size: 14px; margin: 4px 0 10px; }
table.summary th, table.summary td { border-bottom: 1px solid var(--rule); padding: 5px 8px; text-align: left; }
table.summary td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.summary tr.solved td:nth-child(2) { color: var(--correct); }
table.summary tr.penalty td:nth-child(2) { color: #a35a12; }
table.summary tr.wrong td:nth-child(2) { color: var(--wrong); }
table.summary tfoot td { font-weight: 700; border-bottom: none; }
.instr-open { display: flex; align-items: center; gap: 10px; margin: -4px 0 10px; padding: 6px 10px; border-radius: 6px; background: #fff8e6; border: 1px dashed #e3c47a; font-size: 14px; color: #6b3a0c; }
/* dashboard */
.dh-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font-size: 12.5px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--rule); background: #f4f6f8; color: var(--ink-soft); white-space: nowrap; }
.chip.ok { background: #e5f3ea; border-color: #9cd0ae; color: var(--correct); }
.qrow.closedq { background: #f7f8f9; }
.qrow.closedq .qr-text { color: var(--muted); }
.qr-head .chip, .qr-head button { flex-shrink: 0; }
h3.dpart { font-size: 16px; margin: 18px 0 4px; color: var(--action-dark); }
.lists { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.lists.bottom { margin-top: 16px; }
p.names { margin: 4px 0 6px 16px; font-size: 14px; }
.legend .toggle { margin-left: auto; }

/* ---------------- marks (2026-10-11) ---------------- */
.welcome .btn { margin-top: 10px; }
.mcat h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--ink); }
.mpct { font-size: 15px; font-weight: 600; color: var(--action-dark); }
table.marks td { vertical-align: top; }
table.marks td.num { white-space: nowrap; }
.lowalert { background: #fbe7e5; color: var(--wrong); border: 1px solid var(--wrong); border-radius: 8px; padding: 10px 14px; font-weight: 600; }
table.marksheet td.dropped, td.num.dropped { text-decoration: line-through; color: var(--muted); }
td.lscore { white-space: nowrap; }
table.marksheet td.missing { color: var(--muted); }
table.marksheet td.cat { background: #f4f7fb; }
table.marksheet td.total { font-weight: 700; background: #eef3fa; }
table.marksheet td.low { background: #fbe7e5; color: var(--wrong); font-weight: 600; }
table.marksheet td.exempt { color: var(--correct); }
table.marksheet th.sortable { cursor: pointer; white-space: nowrap; }
table.att th.lcol.manual { background: #eef0f2; }
table.marksheet td { white-space: nowrap; }
.marksbar { align-items: flex-start; }
.marksbar .filter { flex: 1 1 200px; padding: 7px 10px; font-size: 15px; }
details.colpick { position: relative; }
details.colpick summary { padding: 7px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); color: var(--ink); list-style-position: inside; }
.colpanel { position: absolute; z-index: 10; margin-top: 4px; width: min(340px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--rule);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: 10px; }
.colpanel .filter { max-width: none; width: 100%; box-sizing: border-box; }
.colbtns { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.collist { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; }
label.colopt { padding: 5px 2px; font-size: 14px; cursor: pointer; }
table.marksheet td.sname { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
table.marksheet th.sorted { color: var(--action-dark); }
.studentview { border: 2px dashed var(--rule); border-radius: 10px; padding: 4px 14px 10px; margin: 10px 0 20px; max-width: 760px; background: var(--paper); }
.svlabel { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 0; }
@media (max-width: 600px) {
  .sheet { max-height: none; -webkit-overflow-scrolling: touch; }
  table.marksheet td.sname { max-width: 120px; }
  table.marksheet th, table.marksheet td { padding: 6px 7px; font-size: 14px; }
}

/* ---------------- online labs (2026-10-13) ---------------- */
.labcard h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.labcard .actions label { display: flex; align-items: center; gap: 6px; }
.labcard input[type="datetime-local"], table.labtable input[type="datetime-local"] { font: inherit; font-size: 14px; padding: 4px 6px; }
table.labtable td.acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
table.labtable td.pw { font-family: var(--mono, monospace); font-size: 16px; font-weight: 600; color: var(--action-dark); }

/* team project */
input.ptitle { flex: 1 1 260px; min-width: 0; }
input.pct { width: 76px; text-align: right; }
.missing { color: var(--muted); }
.card textarea { width: 100%; box-sizing: border-box; margin-top: 8px; }
table.ptable td { vertical-align: top; }
table.ptable input.rub { width: 58px; text-align: right; }
table.ptable textarea { width: 100%; min-width: 160px; box-sizing: border-box; }
.ptools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
td.nowrap { white-space: nowrap; }
td.nowrap input.rub { width: 64px; text-align: right; }
.savebar { position: sticky; top: calc(var(--barh, 52px) + 4px); z-index: 4; display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; margin: 10px 0; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
input.err { border-color: #c0392b; background: #fdecea; }
