/* LabMark - same look as the clickable prototype: warm neutral ground, deep teal accent. */
:root {
  --bg: #F6F5F1; --surface: #FFFFFF; --line: #E4E1D8; --line-strong: #D6D2C7; --soft: #EFEDE6;
  --ink: #1D1C1A; --muted: #5E5B53; --faint: #6B675E;
  --accent: #0B6E66; --accent-ink: #0A5A53; --accent-soft: #E3F1EF; --deep: #0C3B37;
  --ok: #1E6B34; --ok-soft: #E6F4EA; --warn: #8A4B08; --warn-soft: #FDF1DC; --bad: #9F1D35; --bad-soft: #FCE8EC;
  --radius: 14px;
  --sans: "IBM Plex Sans", system-ui, sans-serif; --serif: "Fraunces", Georgia, serif; --mono: "IBM Plex Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }      /* hidden stays hidden, whatever display a class gives it */
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--accent); } a:hover { color: #084E48; }
h1 { font: 500 32px/1.15 var(--serif); margin: 0; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); } .small { font-size: 13px; }

.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
        padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font: 600 21px var(--serif); color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--deep); color: #F3F1EA;
              display: grid; place-items: center; font: 600 16px var(--sans); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: 10px;
         text-decoration: none; color: #4A4740; font-weight: 500; }
.nav a:has(.nav-sub) { flex-direction: column; align-items: flex-start; justify-content: center; padding-top: 4px; padding-bottom: 4px; }
.nav a .nav-sub { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.3; }
@media (max-width: 760px) { .nav a:has(.nav-sub) { flex-direction: row; align-items: center; gap: 6px; } }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side .user { margin-top: auto; padding: 0 8px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.main { flex: 1; min-width: 0; padding: 32px 40px; display: flex; flex-direction: column; gap: 22px; }
.crumbs { font-size: 14px; color: var(--muted); } .crumbs a { color: var(--muted); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
/* an image in a column layout would otherwise be stretched to the full width but not the height */
img.keep-ratio { align-self: flex-start; width: auto; height: auto; object-fit: contain; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
       border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
       font: 600 14px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--ink); border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #095C55; color: #fff; }
.btn.dark { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn.link { border: none; background: none; padding: 0; min-height: 0; color: var(--muted); font-weight: 500; text-decoration: underline; }

label, .field .label { font-size: 14px; font-weight: 500; }
input[type=text], input[type=number], input[type=email], input[type=password], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font: 15px var(--sans); color: var(--ink); background: var(--surface); }
textarea { line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid #9CC9C2; outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .help { font-size: 13px; color: var(--muted); font-weight: 400; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--bad); font-size: 13px; }
input[type=file] { font: 14px var(--sans); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
        background: var(--soft); color: #4A4740; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.accent { background: var(--accent-soft); color: var(--accent-ink); }

.msg { padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.promo { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 14px;
  background: var(--accent-soft, #E3F1EF); border: 1.5px solid var(--accent, #0B6E66); color: var(--ink); }
.promo-badge { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--accent, #0B6E66); color: #fff;
  display: flex; align-items: center; justify-content: center; font: 700 24px var(--sans); }
.promo .stack > strong:first-child { font-size: 18px; }
.leave-note { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 12px;
  background: var(--accent-soft, #E7F3F0); color: var(--ink, inherit); border: 1px solid var(--accent, #0B6B5E); }
.leave-note svg { flex: none; color: var(--accent, #0B6B5E); margin-top: 2px; }
.leave-note strong { display: block; font-size: 19px; line-height: 1.3; margin-bottom: 4px; }
.leave-note span { font-size: 15px; }
.msg.success { background: var(--ok-soft); color: var(--ok); } .msg.error { background: var(--bad-soft); color: var(--bad); }
.msg.info, .msg.warning { background: var(--warn-soft); color: var(--warn); }
.banner { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 16px; background: var(--deep); color: #F3F1EA; }
.banner .btn { background: #F3F1EA; color: var(--deep); border: none; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; background: var(--bg); padding: 9px 12px; }
table.list td { padding: 10px 12px; border-top: 1px solid var(--soft); vertical-align: top; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); }

.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--soft); }
.dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600;
       border: 2px solid var(--line-strong); color: var(--muted); flex-shrink: 0; }
.dot.done { border: none; background: var(--ok-soft); color: var(--ok); }
.dot.now { border-color: var(--accent); color: var(--accent); }

/* review */
.review { display: grid; grid-template-columns: 240px minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.review.wide-marks { grid-template-columns: 220px minmax(0, 1fr) 500px; }   /* assignments: marks by question */
/* smaller screens: the list of submissions goes across the top, the submission and its marks side by side below */
@media (max-width: 1500px) {
  .review { grid-template-columns: minmax(0, 1fr) 360px; }
  .review.wide-marks { grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); }
  .review > :first-child { grid-column: 1 / -1; }
  .review .list-tools { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .review .list-tools input[type=search] { flex: 1 1 240px; max-width: 360px; }
  .review .glist { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .review .gitem { flex: 0 0 220px; scroll-snap-align: start; }
}
@media (max-width: 900px) { .review, .review.wide-marks { grid-template-columns: 1fr; } }
.glist { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; }
.gitem { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line);
         background: var(--surface); text-decoration: none; color: var(--ink); }
.gitem.on { border-color: var(--accent); background: var(--accent-soft); }
.gitem:hover { color: var(--ink); border-color: var(--faint); }
.paper { background: var(--soft); border-radius: 16px; padding: 18px; }
.paper .page { background: #fff; padding: 26px 30px; box-shadow: 0 1px 2px rgba(29,28,26,.08), 0 8px 24px rgba(29,28,26,.06);
               font: 13px/1.6 Georgia, serif; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow-y: auto; }
pre.code { margin: 0; padding: 12px; background: var(--bg); border-radius: 8px; font: 12px/1.5 var(--mono); white-space: pre-wrap;
           overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; }
.flagbox { padding: 14px 16px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.flagbox.COPY { background: var(--bad-soft); } .flagbox.AI { background: var(--warn-soft); }
.flagbox strong { display: block; font-size: 14px; margin-bottom: 4px; }
.flagbox.COPY strong { color: var(--bad); } .flagbox.AI strong { color: var(--warn); }
.notes { margin: 0; padding-left: 18px; font-size: 13px; color: #4A4740; }
.task { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.task .chip { width: 66px; text-align: center; flex-shrink: 0; }
tr.not-chosen td { opacity: .55; }

.login { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.login .pitch { background: var(--deep); color: #F3F1EA; padding: 56px 64px; display: flex; flex-direction: column; gap: 28px; }
.login .pitch h1 { font-size: 46px; max-width: 520px; margin-top: 60px; }
.login .pitch p { color: #C9D6D2; font-size: 17px; max-width: 480px; }
.login .box { display: grid; place-items: center; padding: 40px 16px; }
.login .box .card { width: min(420px, 100%); padding: 36px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login .pitch { display: none; } }

/* waiting for the AI on the assignment page */
.prep-status { display: flex; align-items: center; gap: 10px; margin: 0; }
.prep-status[hidden] { display: none; }
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor;
           border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* next step, checklist, collapsible help */
.next { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px;
        border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; }
.btn.small-btn { min-height: 36px; padding: 0 14px; font-size: 13px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.checklist li.done span:last-child { color: var(--muted); text-decoration: line-through; }
.checklist li.now { font-weight: 600; }
details.more { font-size: 13px; color: var(--muted); }
details.more summary { cursor: pointer; color: var(--accent); width: fit-content; }
details.more[open] summary { margin-bottom: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* upload: drop zone, chosen files, cost */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; text-align: center;
            border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--bg); cursor: pointer; font-weight: 400; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-files { border-style: solid; }
.dropzone input[type=file] { max-width: 100%; margin-top: 6px; }
ul.files { margin: 0 0 4px; padding-left: 18px; max-height: 160px; overflow-y: auto; }
.cost { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.cost.bad, .cost.warn { background: var(--warn-soft); color: var(--warn); }
a.chip { text-decoration: none; } a.chip:hover { filter: brightness(.96); }

/* review: list tools, tabs, the report, who */
.list-tools select { min-height: 38px; padding: 6px 8px; font-size: 13px; }
.list-tools input[type=search] { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; font: 14px var(--sans); }
.gitem[hidden] { display: none; }
.tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tab { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; font: 600 13px var(--sans); cursor: pointer; color: var(--muted); }
.tab.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.report-view iframe { width: 100%; height: 75vh; border: 0; border-radius: 8px; background: #fff; }
.paper mark { background: #FFE58F; color: inherit; padding: 0 1px; }
.ocr-part { margin-top: 14px; padding-top: 10px; border-top: 2px dashed var(--line-strong); background: #F8FBFA; }
.ocr-part > strong { display: block; font: 600 12px var(--sans); color: var(--accent-ink); margin-bottom: 6px; }
ul.who { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
ul.who li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 14px; }
kbd { font: 12px var(--mono); padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.big { font: 500 28px/1.2 var(--serif); }
.card.empty { text-align: left; }
.disclaimer { border-left: 3px solid var(--line-strong); padding-left: 10px; }
.help-toc { line-height: 2; }
.help-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.help-dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: baseline; }
.help-dl dd { margin: 0; }
.video { position: relative; aspect-ratio: 16 / 9; max-width: 720px; border-radius: 10px; overflow: hidden; background: var(--soft); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.placeholder { display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); }

/* ---- accessibility: visible keyboard focus everywhere, a skip link */
a:focus-visible, summary:focus-visible, button:focus-visible, .gitem:focus-visible, .tab:focus-visible,
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 3px solid #9CC9C2; outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--deep); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- phones and small tablets: the side bar becomes a top bar, wide tables scroll sideways */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav a { min-height: 40px; white-space: nowrap; }
  .side .user { margin-top: 0; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 0 4px; }
  .main { padding: 20px 16px; gap: 16px; }
  h1 { font-size: 26px; }
  .head { align-items: flex-start; }
  .head > .row, .card.row { flex-wrap: wrap; }
  table.list { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .glist { max-height: 40vh; }
  .help-dl { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
}
main:focus { outline: none; }
/* a long marking scheme scrolls inside its card, its header row staying in view */
.scheme-scroll { max-height: 480px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.scheme-scroll table.list thead th { position: sticky; top: 0; z-index: 1; }
/* marks by question with the copied / AI shares: a note under its question, no line between them */
.q-integrity th, .q-integrity td { padding-left: 6px; padding-right: 6px; }
.q-integrity tr:has(+ .qnote) td { border-bottom: 0; }
/* copied pictures: this submission's next to the other one's */
.pic-pair { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.pic-pair.off { opacity: .6; }
.pic-pair figure { margin: 0; flex: 1 1 0; min-width: 0; display: grid; gap: 4px; }
.pic-pair img { width: 100%; max-height: 220px; object-fit: contain; background: #fff; border-radius: 6px; }
/* the upload box's grading options */
fieldset.options { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0; gap: 10px; }
fieldset.options legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.opt-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
/* "no tasks from the lab manual" - asked before a lab's reports are uploaded */
dialog#no-tasks { max-width: 560px; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
dialog#no-tasks::backdrop { background: rgba(20, 20, 20, .35); }
/* the review is done: what comes next */
.next-steps { border-color: #9CCFB4; background: #F3FAF6; }
.next-steps ol li { margin-bottom: 10px; }
/* the grading options as numbered steps */
.opt-steps { margin: 0; padding-left: 22px; display: grid; gap: 12px; font-size: 14px; }
.opt-steps li::marker { font-weight: 700; color: var(--accent, #0E6B5E); }
.opt-steps .help { display: block; font-size: 13px; margin-top: 2px; }
.opt-choices { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.opt-choices label { display: flex; gap: 6px; align-items: center; font-weight: normal; }
/* a closed dialog is hidden, whatever layout class it carries (.card/.stack set display) */
dialog:not([open]) { display: none !important; }
.next-steps li.step-done > strong { color: var(--muted); }
input.bad { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }
/* the model solution, formatted: question headings, typeset equations, drawings in place */
.solution-formatted .page { white-space: normal; font-family: var(--serif, Georgia, serif); font-size: 15.5px; line-height: 1.6; max-height: 70vh; overflow: auto; }
.solution-formatted h3 { font-family: var(--sans); font-size: 16px; margin: 18px 0 6px; }
.solution-formatted h3:first-child { margin-top: 0; }
.solution-formatted hr.q-sep { border: 0; border-top: 2px solid var(--line); margin: 20px 0 16px; }
.solution-formatted p { margin: 0 0 10px; }
.solution-formatted .tex.display { margin: 8px 0 12px; overflow-x: auto; }
.solution-formatted figure.drawing { margin: 10px 0 14px; text-align: center; }
.solution-formatted figure.drawing img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.solution-formatted figure.drawing figcaption { font-size: 13px; color: var(--muted); font-style: italic; }
