/*
 * Teach's own looks on top of the one shell (portal_shell.css; Package 81,
 * Package 75's boards 1 and 9). The sign-in gate keeps console.css.
 *
 * Colours come only from the shell's and the console's tokens (--canvas,
 * --surface, --raised, --sunken, --ink, --ink2, --line, --line2, --accent,
 * --on-accent, --accent-soft, --accent-ink, --signal, --warning, --danger,
 * --focus, ...), so both themes follow. The one exception board 9 draws is the
 * QR's white tile and its ink (#FFFFFF, #0B1512), in the class block.
 *
 * Each destination's script adds its looks only inside its own marked block
 * below; the blocks are kept apart by three unchanged comment lines, so five
 * builders can work in this file at once and their changes merge cleanly.
 */

/* ---- the frame ------------------------------------------------------------ */

/* The shell's type, as the Admin Portal's (console.css sets it for body.staff only). */
body.teach .pshell { font-size: 15px; line-height: 1.45; }

/* A destination: shown by teach.js, hidden the rest of the time. */
.pdest { display: flex; flex-direction: column; min-width: 0; }
.pdest[hidden] { display: none; }

/* The college switcher is a button (a menu of colleges): the shell draws its face. */
.pswitch-teach { color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.pswitch-teach:hover { background: var(--sunken); filter: none; }
.pswitch-teach:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* One college: a quiet label (admin.html's `pswitch single`), no chevron, nothing to press. */
.pswitch-teach.single { cursor: default; }
.pswitch-teach.single:hover { background: var(--raised); }

/* The person's disc on a phone: a button, so console.css's button padding is taken off. */
.pwho-disc { padding: 0; cursor: pointer; }
.pwho-disc:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The bar at the foot on a phone: five destinations share its width, so none is cut off on a narrow phone. */
@media (max-width: 767px) {
  #teachShell .pnav { flex: 1 1 0; min-width: 0; }
}

/* "Learn more" inside the help line: the words and the space round them are the target. */
.phelp .clink-in { padding: 10px 2px; margin: -10px 0; }

/* Show on board: a layer over the whole page (#class/{id}/board). teach_class.js draws inside it. */
.tboard-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow-y: auto;
  background: var(--canvas);
  color: var(--ink);
}
.tboard-layer[hidden] { display: none; }

/* Alerts on this device, in its sheet. */
.talerts { display: flex; flex-direction: column; gap: 12px; }
.talerts[hidden] { display: none; }
.talerts .csub { font-size: 14.5px; }

/* ---- shared pieces every destination uses ---------------------------------- */

/* The eyebrow over a card's title ("Next class · in 12 min", "Class code"). */
.teyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink2);
}

/* The phone is Teach's main width (board 9): a column that stays a phone's width on a desktop. */
.twidth { width: 100%; max-width: 680px; }

/* A big button that fills its line on a phone (Start, Start now, Close question): the shell's
   .cb .cb-primary .cb-lg, full width below 768 px. */
@media (max-width: 767px) {
  .tfull { width: 100%; flex: 1 1 auto; }
}

/* Board 9: on a phone, Home's "+ Class now" and a course's "⋯" sit top right beside the title,
   not on a line of their own (the shell puts a page's actions under its title on a phone). */
@media (max-width: 767px) {
  #dest-home .phead,
  #dest-courses .phead { display: flex; align-items: flex-start; gap: 10px; }
  #dest-home .phead .pacts,
  #dest-courses .phead .pacts { margin-top: 0; flex-wrap: nowrap; justify-content: flex-end; }
}

/* ==== home (teach_home.js) ==== */

/* Home: a column on a phone; from 1024 px the next class and later today beside Recent. */
.thome-cols { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 680px; }
.thome-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.thome-group { display: flex; flex-direction: column; gap: 8px; }
.thome-next { padding: 16px; gap: 10px; }
.thome-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.thome-title { font-size: 20px; }
.thome-row .ps-name { overflow-wrap: anywhere; }
.thome-link { min-height: 44px; min-width: 44px; padding: 0 6px; background: transparent; border: 0; font: inherit; cursor: pointer; }
.thome-empty-acts { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.thome-empty-acts .clink { display: inline-flex; align-items: center; min-height: 44px; }
.thome-sheet { display: flex; flex-direction: column; gap: 14px; }
.thome-sheet .cfield[hidden] { display: none; }
.thome-until { margin: 0; color: var(--ink); }
.thome-until[hidden] { display: none; }
.thome-line { text-align: center; }
.thome-note { color: var(--ink); }
@media (min-width: 1024px) {
  .thome-cols { max-width: none; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .thome-next { padding: 20px; gap: 12px; }
  .thome-title { font-size: 24px; }
  .thome-next .thome-go { width: auto; align-self: flex-start; }
}

/* ==== end home ==== */

/*
 * (between home and class)
 */

/* ==== class (teach_class.js) ==== */

/* The running class (board 9): one column on a phone; at a desktop's width
   (.tdesk) the strip and what is live on the left, the code, the door and the
   messages on the right. The QR's white tile and ink are set by the script
   (the two colours of their own board 9 draws), not here. */
.tclass { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 680px; min-width: 0; }
.tclass.tdesk { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; max-width: 1120px; }
.tclass-main, .tclass-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tclass button, .tboard button, .tcs button, .tends button { filter: none; }

/* The header's line: Ends 11:20 am · +10 · +15 (the code, small, while something is live). */
.tends { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }
.tends-at { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); margin-right: 2px; }
.tends .tends-plus { min-height: 44px; padding: 0 14px; font-variant-numeric: tabular-nums; }
.tcode-sm {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--sunken);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--display), sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

/* The code card: the code huge, Show on board, where a student without the app joins. */
.tcodecard { position: relative; align-items: stretch; gap: 10px; padding: 16px 16px 12px; container-type: inline-size; }
.tcodecard-head { display: flex; align-items: center; justify-content: center; min-height: 24px; }
.tcodecard-more { position: absolute; top: 4px; right: 4px; }
.tcodecard-line { text-align: center; overflow-wrap: anywhere; }
.tcodecard-board .tmark, .tboard-print .tmark, .tboard-exit .tmark, .tclass .tmark { display: inline-flex; }
.tcode {
  display: block;
  margin: 0;
  font-family: var(--display), sans-serif;
  font-weight: 800;
  /* Six characters fit their card at any width, 200% zoom included (K7Q4M2 is about 4.9 em). */
  font-size: min(58px, calc((100vw - 64px) / 5.2));
  font-size: min(58px, calc(100cqi / 5.2));
  letter-spacing: .1em;
  line-height: 1;
  text-align: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tcode-xl { font-size: min(84px, calc((100vw - 68px) / 3.6)); font-size: min(84px, calc(100cqi / 3.6)); letter-spacing: .14em; }
.tdesk .tcodecard .tcode { font-size: 46px; }

/* The strip: three buttons in a row, pinned while the page scrolls. */
.tpins {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 0;
  margin: -6px 0;
  background: var(--canvas);
}
.tpin {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  /* Grows with its pill's words (read round 2, #1). */
  height: auto;
  padding: 6px 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}
.tpin:hover { background: var(--sunken); }
.tpin:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* A pill's words are never cut (read round 2, #1): at 390 and 375 px "Nobody here yet", "None waiting" and
   "12 messages" wrap onto a second line and the pin grows with them (the row's three grow together). The
   shell's .cpill keeps its one line everywhere else; only the strip's pills wrap. */
.tpin .cpill {
  height: auto;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 8px;
  font-size: 13.5px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
  justify-content: center;
  overflow: visible;
  overflow-wrap: normal;
}
.tpins-mark { height: 0; margin: 0; }
@media (max-width: 767px) {
  /* Under the phone's top line (the person's disc floats there); once stuck, the band above it is the page's own. */
  .tpins { top: 50px; }
  .tpins.is-stuck { box-shadow: 0 -44px 0 0 var(--canvas); }
}
/* Too narrow for three across (a small phone at 200% zoom, 187 px): one under the other, whole words on one
   line, and in the page's flow, so three rows never stay pinned over half the screen. */
@media (max-width: 339px) {
  .tpins { grid-template-columns: minmax(0, 1fr); position: static; margin: 0; padding: 0; }
  .tpins.is-stuck { box-shadow: none; }
}

/* Ask · Attendance · Quiz: three big buttons; a row of small ones while something is live. */
.tbigs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tbig-cell { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.tbig {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 8px 4px;
  border-radius: 20px;
  background: var(--raised);
  border: 1px solid var(--line2);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
}
.tbig:hover { background: var(--sunken); }
.tbig:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tbig .ico { width: 28px; height: 28px; }
.tbig-w { overflow-wrap: anywhere; text-align: center; }
.tbig-sub { min-height: 44px; font-size: 13.5px; color: var(--ink2); }
.tbigs-row .tbig { flex-direction: row; min-height: 48px; padding: 0 6px; border-radius: 999px; gap: 5px; font-size: 14px; }
.tbigs-row .tbig .ico { width: 18px; height: 18px; }
.tbigs-row .tbig-w { overflow-wrap: normal; white-space: nowrap; }
@media (max-width: 400px) { .tbigs-row .tbig .tmark { display: none; } }
/* A full-width button in a column stays its own height (the shell's cb-wide grows along a row). */
.tclass .cb-wide, .tcs .cb-wide, .tnone .cb-wide, .tsched .cb-wide { flex: none; width: 100%; }
.tclass [data-tbusy="1"], .tcs [data-tbusy="1"], .tends [data-tbusy="1"] { opacity: .6; cursor: progress; }

/* End class: at the foot, outlined, red words, apart from the three. */
.tend {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line2);
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.tend:hover { background: var(--danger-soft); }
.tend:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tend-sm { width: auto; margin: 0 0 0 8px; min-height: 44px; font-size: 14px; }

/* What is live fills the screen under the strip. */
.tlives { display: flex; flex-direction: column; gap: 12px; }
.tlives:empty { display: none; }
.tlive { padding: 18px; gap: 12px; min-height: max(320px, calc(100dvh - 430px)); container-type: inline-size; }
.tlive > .cb-lg:last-child, .tlive > .tlive-acts:last-child { margin-top: auto; }
.tdesk .tlive { min-height: 380px; }
.tlive-q { font-size: 20px; }
.tlive-att { align-items: center; text-align: center; }
.tlive-att .tprog { width: 100%; }
.tlive-big { margin: 0; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.tlive-of, .tlive-left { font-variant-numeric: tabular-nums; }
.tlive-acts { display: flex; gap: 10px; width: 100%; }
.tlive-acts .cb { flex: 1 1 0; min-width: 0; padding: 0 12px; white-space: normal; }
.tbars { display: flex; flex-direction: column; gap: 8px; }
.tbar { display: grid; grid-template-columns: minmax(28px, auto) minmax(0, 1fr) 36px; align-items: center; gap: 10px; }
.tbar-l { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; max-width: 12em; }
.tbar-t { height: 14px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); overflow: hidden; }
.tbar-t span { display: block; height: 100%; background: var(--ink2); border-radius: 999px; }
.tbars-big .tbar-t { height: 30px; border-radius: 10px; }
.tbars-big .tbar-t span { border-radius: 9px; }
.tbar-n { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ttexts { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ttexts li { padding: 10px 12px; border-radius: 12px; background: var(--sunken); overflow-wrap: anywhere; }
.tprog { height: 12px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); overflow: hidden; }
.tprog span { display: block; height: 100%; background: var(--ink2); }
.tstats { display: flex; gap: 10px; }
.tstat { display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-width: 0; padding: 14px 16px; border-radius: 16px; background: var(--canvas); border: 1px solid var(--line); }
.tstat-v { font-family: var(--display), sans-serif; font-weight: 700; font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.tclass-note { text-align: center; }

/* At a desktop's width: the door and the messages, each a card on the right. */
.tside-card { padding: 14px 16px; gap: 8px; }
.tside-t { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.tside-t:focus { outline: none; }

/* "No class running", and a class not started yet. */
.tnone { padding: 8px; }
.tnone-acts { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 280px; }
.tsched { padding: 18px; gap: 10px; }
.tsched-t { font-size: 22px; }
.tsched-line { text-align: center; }

/* The strip's panels and the sheets (In class, Waiting, Messages, Ask, Quiz). */
.tcs { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.twait-row { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.twait-row + .twait-row { border-top: 1px solid var(--line); }
.twait-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.twait-who .ps-names, .tstu-head .ps-names { display: flex; flex-direction: column; min-width: 0; }
.twait-who .ps-name, .tstu-head .ps-name { font-weight: 700; overflow-wrap: anywhere; }
.twait-acts { display: flex; gap: 8px; }
.twait-acts .cb { flex: 1 1 0; min-width: 0; white-space: normal; }
.tcs .cinit, .tside-card .cinit { width: 32px; height: 32px; font-size: 12px; }
.tthread { align-items: flex-start; }
.tthread .ps-names { min-width: 0; }
.tthread-last { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.tthread-log { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.tmsg { display: flex; flex-direction: column; gap: 2px; max-width: 85%; padding: 10px 12px; border-radius: 16px; overflow-wrap: anywhere; }
.tmsg-in { align-self: flex-start; background: var(--sunken); color: var(--ink); }
.tmsg-out { align-self: flex-end; background: var(--accent-soft); color: var(--ink); }
.tmsg-at { font-size: 12px; color: var(--ink2); }
.tchecks { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.tstudents { background: transparent; }
.tstu { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; }
.tstu + .tstu { border-top: 1px solid var(--line); }
.tstu-head { display: flex; align-items: center; gap: 10px; }
.tstu-mark { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tstu-select { width: auto; min-width: 12em; min-height: 44px; padding: 8px 12px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--strong-line); color: var(--ink); font: inherit; }
.tstu-rec { font-weight: 600; }
.task-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.task-letters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.task-typed { display: flex; flex-direction: column; gap: 8px; }
.task-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.task-kind { white-space: normal; padding: 0 10px; }
.tcs-ask textarea { resize: vertical; }

/* Show on board: the code and the QR, full screen; stacked on a phone. */
.tboard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: center;
  gap: 56px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 80px 72px 60px;
  color: var(--ink);
}
.tboard-exit {
  position: absolute;
  top: 22px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--ink2);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.tboard-exit:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tboard-words { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; min-width: 0; container-type: inline-size; }
.tboard-eyebrow { font-size: 18px; }
.tboard-h { margin: 0; font-family: var(--display), sans-serif; font-weight: 800; font-size: clamp(34px, 6vw, 64px); letter-spacing: -0.03em; line-height: 1; color: var(--ink); overflow-wrap: anywhere; }
.tboard-h:focus { outline: none; }
.tcode-board { font-size: min(100px, calc((100vw - 580px) / 5.2)); font-size: min(100px, calc(100cqi / 5.2)); text-align: left; }
.tboard-p { margin: 0; font-size: clamp(17px, 2.2vw, 22px); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.tboard-ends { color: var(--ink2); }
.tboard-side { display: flex; flex-direction: column; align-items: stretch; gap: 14px; min-width: 0; }
.tqr { padding: 26px; border-radius: 30px; }
.tqr svg { display: block; width: 100%; height: auto; }
@media (max-width: 899px) {
  .tboard { grid-template-columns: minmax(0, 1fr); gap: 28px; align-content: start; padding: 84px 16px 32px; }
  .tboard-words { align-items: center; text-align: center; }
  .tcode-board { font-size: min(100px, calc((100vw - 32px) / 5.2)); font-size: min(100px, calc(100cqi / 5.2)); text-align: center; }
  .tboard-side { width: 100%; max-width: 380px; justify-self: center; }
  .tboard-exit { left: 16px; top: max(14px, env(safe-area-inset-top)); }
}

/* Printed as a door sign: the board view alone, in the day's colours (the script sets them). */
@media print {
  body.teach > :not(.pshell), body.teach .pshell > :not(#teachBoard) { display: none !important; }
  body.teach .pshell { display: block; min-height: 0; }
  body.teach #teachBoard { position: static; display: block !important; overflow: visible; }
  .tboard { min-height: 0; padding: 24px; gap: 32px; }
  .tboard-exit, .tboard-print { display: none !important; }
}

/* ==== end class ==== */

/*
 * (between class and results)
 */

/* ==== results (teach_results.js) ==== */

/* The class picker and the phone's Download sit in the header's actions. */
.tr-pick { flex: 1 1 260px; min-width: 0; max-width: 300px; }
.tr-select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line2);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.tr-select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* The picker is a button with the shell's menu under it: the class picked, then the chevron. */
.tr-picker { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; font-weight: 600; }
.tr-picker:hover:not(:disabled) { filter: none; background: var(--sunken); }
.tr-pick-words { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-picker .ico { flex: none; color: var(--ink2); }
.tr-download-phone { display: none; }

/* Tabs, then (from a desktop's width) the file line, the format and Download beside them. */
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tr-tabs button { min-height: 44px; padding: 0 16px; }
.tr-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tr-format { gap: 6px; }
.tr-note { margin: 0 0 12px; max-width: 62ch; }
.tr-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tr-retention { margin-top: 18px; }
.tr-none { padding: 8px 0; }
.tr-keep { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tr-purged { max-width: 680px; }

/* The three counts. */
.tr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tr-stat { gap: 4px; padding: 14px 16px; }
.tr-stat-v { font-family: var(--display, 'Bricolage Grotesque'), sans-serif; font-weight: 700; font-size: 28px; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }

/* Tables: a region that scrolls sideways when it must, by touch or the keyboard. */
.tr-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.tr-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tr-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--ink); }
.tr-table th, .tr-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tr-table thead th { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); background: var(--sunken); }
.tr-table tbody tr:last-child th, .tr-table tbody tr:last-child td { border-bottom: 0; }
.tr-table tbody th { font-weight: 700; }
.tr-student {
  min-height: 44px;
  padding: 0 4px;
  margin: -8px -4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.tr-student:hover { background: transparent; filter: none; text-decoration: underline; }
.tr-student:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tr-rows { display: none; }
.tr-line { min-height: 56px; }
.tr-quiz-table td[data-correct="true"] .tr-mark { color: var(--success); }
.tr-quiz-table td[data-correct="false"] .tr-mark { color: var(--danger); }
.tr-quiz { gap: 10px; }

/* A student's marks, in the sheet. */
.tr-marks { display: flex; flex-direction: column; gap: 12px; }
.tr-check { gap: 10px; padding: 14px 16px; }
.tr-check-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tr-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tr-choice { min-height: 44px; }
.tr-choice.is-on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* Questions: counts as bars. */
.tr-question { gap: 10px; padding: 14px 16px; }
.tr-q-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tr-prompt { margin: 0; color: var(--ink); }
.tr-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tr-bar-row { display: grid; grid-template-columns: minmax(48px, 22%) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tr-bar-label { font-weight: 600; overflow-wrap: anywhere; }
.tr-bar-track { display: block; height: 12px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.tr-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.tr-bar-count { font-size: 13.5px; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-text-list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* A phone: the picker takes its line, Download is the coral button in the header, the rows replace the table. */
@media (max-width: 767px) {
  .tr-pick { flex: 1 1 0; max-width: none; }
  .tr-download-phone { display: inline-flex; flex: none; padding: 0 18px; }
  .tr-download-desk { display: none; }
  .tr-bar { flex-direction: column; align-items: stretch; margin-bottom: 0; }
  .tr-tabs { display: flex; }
  .tr-tabs button { flex: 1 1 0; padding: 0 8px; }
  .tr-group { margin-left: 0; }
  .tr-format { flex: none; min-height: 44px; }
  .tr-note { margin: 4px 0 14px; font-size: 13px; }
  .tr-stats { gap: 8px; }
  .tr-stat { padding: 12px; }
  .tr-stat-v { font-size: 24px; }
  .tr-wide { display: none; }
  .tr-rows { display: flex; }
}

/* ==== end results ==== */

/*
 * (between results and courses)
 */

/* ==== courses (teach_courses.js, teach_quiz.js) ==== */

/* The pages: a phone-width column (.twidth), a gap between its parts. */
.tc-course, .tc-new, .tc-list, .tc-quiz { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 680px; }
.tc-panel { display: flex; flex-direction: column; gap: 14px; }
.tc-back { align-self: flex-start; margin-left: -4px; }
.tc-card { padding: 16px; }
.tc-fields, .tc-form { display: flex; flex-direction: column; gap: 14px; }
.tc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tc-status { min-height: 1.4em; }
.tc-nothing { padding: 4px 2px; }
.tc-next { display: inline-flex; color: var(--ink2); flex: none; }

/* The tabs (the shell's segment, scrolling sideways if a narrow phone cannot hold all four). */
.tc-tabs { max-width: 100%; overflow-x: auto; }
.tc-tab { min-height: 44px; padding: 0 14px; }

/* When it meets: the days as toggles (the shell's chips, pressed when on), then one From and Until for them all. */
.tc-meets { display: flex; flex-direction: column; gap: 10px; }
.tc-days { gap: 8px; }
.tc-daychip { min-width: 56px; justify-content: center; }
.tc-times input[type="time"] { width: 100%; min-width: 0; min-height: 44px; }
.tc-oneoff input, .tc-new input, .tc-new select, .tc-form input, .tc-card select, .tc-card input[type="text"] {
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--sunken);
  border: 1px solid var(--strong-line);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

/* One-off classes and the term. */
.tc-oneoff, .tc-upcoming { display: flex; flex-direction: column; gap: 12px; }
.tc-oneoff { margin-top: 6px; }
.tc-termhead { display: flex; flex-direction: column; gap: 2px; }
.tc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tc-stat { display: flex; flex-direction: column; gap: 2px; }
.tc-stat b { font-size: 26px; line-height: 1.1; color: var(--ink); }

/* The quiz editor: a question is a card; the picks wrap, never scroll. */
.tq { display: flex; flex-direction: column; gap: 14px; }
.tq-questions { display: flex; flex-direction: column; gap: 14px; }
.tq-question { margin: 0; min-width: 0; }
.tq-question > legend { padding: 0 4px; }
.tq-key { border: 0; padding: 0; margin: 0; min-width: 0; }
.tq-key > legend { padding: 0; margin-bottom: 6px; }
.tq-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.tq-pick { min-height: 44px; padding: 6px 14px; flex: 0 1 auto; }
.tq-status { min-height: 1.4em; }
.tq-bad { color: var(--danger); font-weight: 600; }
.tq-acts { display: flex; flex-direction: column; gap: 10px; }
.tq textarea, .tq select, .tq input[type="text"] { max-width: 100%; }

@media (max-width: 420px) {
  .tc-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ==== end courses ==== */

/*
 * (between courses and college)
 */

/* ==== college (teach_college.js) ==== */

/* The four parts, each its own address: chips that scroll sideways on a narrow phone. */
.tcol-tabs { margin: 0 0 14px; max-width: 100%; }
.tcol-tabs .cchips { padding: 2px 2px 4px; }
.tcol-body { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tcol-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tcol-pick { align-items: flex-start; max-width: 460px; }

/* Overview: the period, the four numbers, the two tables. */
.tcol-period { display: flex; gap: 12px; flex-wrap: wrap; }
.tcol-period .cfield { flex: 1 1 150px; max-width: 280px; min-width: 0; }
.tcol-picture { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tcol-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tcol-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-width: 0;
}
.tcol-stat b { font-family: var(--display, 'Bricolage Grotesque'), sans-serif; font-size: 28px; line-height: 1.1; color: var(--ink); }
.tcol-stat span { font-size: 13px; color: var(--ink2); }
.tcol-said { margin-top: -10px; }

/* Counts by building or by course: a table from 768 px, rows on a phone. */
.tcol-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.tcol-tablewrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tcol-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tcol-table th, .tcol-table td { padding: 12px 14px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.tcol-table thead th { border-top: 0; font-size: 12.5px; font-weight: 700; color: var(--ink2); letter-spacing: .02em; white-space: nowrap; }
.tcol-table th { text-transform: none; letter-spacing: 0; }
.tcol-table tbody th { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.tcol-table .tcol-num { text-align: right; font-variant-numeric: tabular-nums; }
.tcol-list { display: none; list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.tcol-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.tcol-item + .tcol-item { border-top: 1px solid var(--line); }
.tcol-itemhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcol-itemhead b { color: var(--ink); }

/* Instructors: a row that opens its courses; the menu for Remove beside it. */
.tcol-inst .crow { padding-right: 6px; }
.tcol-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 56px;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.tcol-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 10px; }
.tcol-chev { display: inline-flex; color: var(--ink2); flex: none; }
.tcol-toggle[aria-expanded="true"] .tcol-chev { transform: rotate(180deg); }
.tcol-courses { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 14px; }
.tcol-courses[hidden] { display: none; }
.tcol-courses-open { padding: 0; }
.tcol-course {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.tcol-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.tcol-select {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--sunken);
  border: 1px solid var(--strong-line);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
}
.tcol-mark { display: inline-flex; flex: none; }

/* The sheets: the invite, the remove, a class's records. */
.tcol-form { display: flex; flex-direction: column; gap: 14px; }
.tcol-foot { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; justify-content: flex-end; align-items: center; }
.tcol-foot select { flex: 1 1 160px; min-height: 48px; padding: 8px 12px; border-radius: 14px; background: var(--sunken); border: 1px solid var(--strong-line); color: var(--ink); font: inherit; }
.tcol-checks { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.tcol-checks legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.tcol-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--ink); }
.tcol-check input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.tcol-error { margin: 0; min-height: 0; font-size: 13.5px; font-weight: 600; color: var(--danger); }
.tcol-error:empty { display: none; }
.tcol-records { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tcol-records h3 { margin: 6px 0 0; }

/* Buildings and Record keeping. */
.tcol-foot-note { margin-top: 2px; }
.tcol-days { max-width: 280px; }
.tcol-classes { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 767px) {
  .tcol-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tcol-tablewrap { display: none; }
  .tcol-list { display: block; }
  .tcol-period .cfield { max-width: none; }
  .tcol-records .tcol-tablewrap { display: block; }
  .tcol-foot { justify-content: stretch; }
  .tcol-foot .cb { flex: 1 1 auto; }
}

/* ==== end college ==== */
