/* The course portal's styles. Each feature owns one section, marked with its name; edit only your own section.
   The house look (colours, type, buttons, tables) comes from ../styles.css: use its classes and custom properties
   (btn, card, admin-table, input, select, field-note, form-error, empty-note, notice) before adding new ones. */

/* ---- core (integrator): the portal's home, its tabs, and the forms the portal's pages share ---- */

.portal-home-slot:empty { display: none; }
.portal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.portal-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.portal-manage .portal-field { max-width: 32rem; margin: 0 0 16px; }
.portal-manage .portal-row-actions { margin: 0 0 12px; }
.portal-manage .portal-cards { margin-top: 0; }
.portal-cards a { text-decoration: none; }
/* The frame of the house look (house.css). The core's bar above a feature's page keeps its height even when it holds
   nothing, so that the band starts at the same height on every page. The home page, a week's page and the reader
   draw their own bar and frame. */
#portal-bar:is(:has(~ #portal-home:not([hidden])), :has(~ #portal-frame.is-own)) { display: none; }
#portal-frame.is-own { display: block; }
.me-identity { display: grid; gap: 0; text-align: right; }
.me-role { color: var(--ink-3); font-size: 11px; line-height: 1.3; }
.portal-form { display: grid; gap: 0.9rem; max-width: 40rem; margin-top: 0.75rem; }
.portal-inline { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; max-width: none; }
.portal-form > .btn { justify-self: start; }
.portal-field { display: grid; gap: 0.3rem; border: 0; padding: 0; margin: 0; }
.portal-field > span:first-child, .portal-field > legend { font-weight: 600; }
.portal-field textarea { min-height: 6rem; resize: vertical; }
.portal-check { display: flex; gap: 0.5rem; align-items: center; font-weight: normal; }

/* ---- course (course pages builder) ---- */

.course-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem 2rem; margin-top: 0.75rem; }
.course-group h3, .course-week h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.course-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.course-link { text-underline-offset: 3px; }
.course-download { color: var(--ink-3, inherit); font-size: 0.9em; }
.course-weeks { display: grid; gap: 1rem; margin-top: 0.75rem; }
.course-week { display: grid; gap: 0.6rem; }
.course-week-pages, .course-day-pages { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0; }
.course-days { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.course-day { display: grid; grid-template-columns: minmax(12rem, 22rem) 1fr; gap: 0.2rem 1rem; align-items: baseline; }
.course-day-name { font-weight: 600; }
.course-closed { opacity: 0.7; }
.course-closed .course-day-name { font-weight: normal; }
@media (max-width: 640px) {
  .course-day { grid-template-columns: minmax(0, 1fr); }
}

/* ---- attendance and quizzes (attendance and quizzes builder) ---- */

/* Check-in: the learner's box (home page and check-in page), and the staff page. */
.portal-home-slot[data-feature="attendance"] { margin-top: 22px; }
.portal-home-slot[data-feature="attendance"]:empty { display: none; }
/* The box is a house card (house.css); a learner's check-in page puts it under the opening paragraph. */
.att-box { gap: 10px; max-width: 40rem; }
.att-page .att-box { margin-top: 28px; }
.att-box-lede { color: var(--ink-2); margin: 0; }
.att-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.att-label { display: grid; gap: 0.3rem; flex: 1 1 11rem; font-weight: 600; font-size: 0.9rem; }
.att-code-input {
  width: 100%; height: 48px; font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
}
.att-submit { height: 48px; min-width: 7.5rem; }
.att-box .form-error { margin-top: 0.6rem; }
.att-box .field-note { display: block; margin-top: 0.5rem; }
.att-done { color: var(--ok); font-weight: 600; }
.att-closed { color: var(--ink-2); }
.att-history { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.35rem; }
.att-history-item { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; }
.att-history-item.absent > span:first-of-type { color: var(--danger); }
.att-cohort { max-width: 24rem; margin: 28px 0 0; }
.att-live { margin-top: 0.75rem; }
.att-code-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 650; }
.att-code {
  font-family: var(--mono); font-size: clamp(3rem, 14vw, 6.5rem); font-weight: 700; line-height: 1.05;
  letter-spacing: 0.06em; font-variant-numeric: tabular-nums; margin: 0.1rem 0 0.4rem; user-select: all;
}
.att-live:fullscreen {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: var(--surface); color: var(--ink); padding: 2rem; text-align: center;
}
.att-live:fullscreen .att-code { font-size: min(24vw, 40vh); }
.att-live:fullscreen .portal-row-actions [data-slot="full-screen"] { display: none; }
.att-count { font-weight: 600; }
.att-table-wrap { overflow-x: auto; }
.att-table th, .att-table td { white-space: nowrap; }
.att-table .att-day { text-align: center; padding: 4px 6px; }
.att-cell {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 8px;
  border: 1px solid transparent; background: transparent; font: inherit; color: inherit;
}
button.att-cell { cursor: pointer; }
button.att-cell:hover { background: var(--surface-2); border-color: var(--line); }
button.att-cell:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.att-mark { font-weight: 700; font-size: 1.05rem; }
.att-mark.present { color: var(--ok); }
.att-mark.absent { color: var(--danger); }
.att-mark.none { color: var(--ink-3); }
.att-mark.marked { box-shadow: 0 0 0 2px var(--warn); border-radius: 4px; padding: 0 3px; }
.att-key { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; margin-top: 0.6rem; }
.att-key .att-mark { margin-left: 0.4rem; }
.att-mark-panel { border-left: 4px solid var(--warn); padding-left: 1rem; }
.att-events { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: 0.3rem; }

/* Quizzes: the learner's list, a quiz, its review, and the staff page. */
.quiz-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; }
.quiz-item.card {
  flex-direction: row; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between;
}
.quiz-item-text { display: grid; gap: 0.25rem; flex: 1 1 14rem; min-width: 0; }
.quiz-item-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quiz-timer { color: var(--ink-3); font-size: 14.5px; margin: 12px 0 0; }
.quiz-page form { margin-top: 28px; }
.quiz-questions { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; counter-reset: none; }
.quiz-question {
  border: 1px solid var(--line); border-radius: var(--radius-sm, 10px); background: var(--surface); padding: 1rem;
}
.quiz-question fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.quiz-stem { font-weight: 600; line-height: 1.45; padding: 0; margin-bottom: 0.4rem; overflow-wrap: anywhere; }
.quiz-number { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.quiz-choose { margin: 0 0 0.4rem; }
.quiz-options { display: grid; gap: 0.45rem; margin-top: 0.5rem; }
.quiz-option {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0.6rem; align-items: start;
  padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg, var(--surface));
  cursor: pointer; min-height: 44px;
}
.quiz-option:hover { border-color: var(--line-strong, var(--line)); }
.quiz-option:has(input:checked) { border-color: var(--primary); background: var(--surface-2); }
.quiz-option:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.quiz-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.quiz-option input { margin: 0.2rem 0 0; accent-color: var(--primary); width: 1.1rem; height: 1.1rem; }
.quiz-letter { font-family: var(--mono); font-weight: 700; color: var(--ink-2); }
.quiz-option-text { overflow-wrap: anywhere; line-height: 1.45; }
.quiz-option-text code, .quiz-stem code, .quiz-rationale code {
  font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px;
}
.quiz-submit { margin-top: 1rem; height: 44px; }
.quiz-page form .form-error { margin-top: 1rem; }
.quiz-score { font-weight: 650; }
.quiz-score + p, .quiz-score ~ p[data-slot^="kind-"] { max-width: 44rem; margin: 8px 0 28px; }
.quiz-reviewed { border-left-width: 4px; }
.quiz-reviewed.is-right { border-left-color: var(--ok); }
.quiz-reviewed.is-wrong { border-left-color: var(--danger); }
.quiz-verdict { font-weight: 650; margin-bottom: 0.4rem; }
.quiz-reviewed.is-right .quiz-verdict { color: var(--ok); }
.quiz-reviewed.is-wrong .quiz-verdict { color: var(--danger); }
.quiz-review-options, .quiz-counts { list-style: none; padding: 0; margin: 0.25rem 0 0.6rem; display: grid; gap: 0.35rem; }
.quiz-review-option {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 0.6rem; align-items: start;
  padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 10px;
}
.quiz-review-option.right { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.quiz-review-option.chosen:not(.right) { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.quiz-review-option .quiz-tag { grid-column: 2; }
.quiz-tag {
  display: inline-block; font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-2); margin-right: 0.5rem;
}
.quiz-tag.right { color: var(--ok); }
.quiz-rationale { color: var(--ink-2); line-height: 1.5; }
.quiz-section { margin-top: 0.4rem; font-size: 0.95rem; }
.quiz-section a { color: var(--accent); text-underline-offset: 3px; }
.quiz-cohort { max-width: 24rem; margin: 28px 0 0; }
.quiz-table-wrap { overflow-x: auto; }
.quiz-table th, .quiz-table td { white-space: nowrap; }
.quiz-table thead .link-btn { font: inherit; text-transform: inherit; letter-spacing: inherit; }
.quiz-table small { display: block; color: var(--ink-3); font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.quiz-table tfoot td, .quiz-table tfoot th { border-top: 1px solid var(--line-strong, var(--line)); font-weight: 600; padding: 9px 12px; }
.quiz-none, .quiz-started { color: var(--ink-3); }
.quiz-stats h3 { margin: 1.25rem 0 0.6rem; font-size: 1rem; }
.quiz-count {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(4rem, 8rem) auto; gap: 0.5rem 0.6rem;
  align-items: center; padding: 0.35rem 0;
}
.quiz-count .quiz-tag { margin-left: 0.5rem; }
.quiz-bar { display: block; height: 0.6rem; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.quiz-bar-fill { display: block; height: 100%; background: var(--ink-3); border-radius: 99px; }
.quiz-count.right .quiz-bar-fill { background: var(--ok); }
.quiz-count-text { font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .quiz-count { grid-template-columns: auto minmax(0, 1fr); }
  .quiz-count .quiz-bar, .quiz-count .quiz-count-text { grid-column: 2; }
  .att-submit { flex: 1 1 100%; }
}

/* ---- questionnaires and consolidation (questionnaires builder) ---- */

.q-prose p { margin: 0 0 0.6rem; }
.q-prose p:last-child { margin-bottom: 0; }
.q-prose code, .q-option-text code, .q-item-text code, .q-result-options code, .c-links code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.q-list { display: grid; gap: 16px; margin-top: 28px; }
.q-row { display: flex; flex-direction: row; gap: 1rem; align-items: center; justify-content: space-between; }
.c-topic, .c-session { gap: 0.4rem; }
.q-row-heading { margin: 0 0 8px; }
.q-part > .q-prose { max-width: 44rem; }
.q-row-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0; color: var(--ink-2); font-size: 14px; }
.q-state-complete, .q-state-submitted, .q-state-saved { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.q-state-in-progress, .q-state-draft { background: var(--warn-soft); color: var(--ink); }

/* A scored part: one numbered question after another, comfortable to read and answer in one sitting. */
.q-questions { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1.1rem; }
.q-question { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.15rem; }
.q-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.q-legend { font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 0; margin-bottom: 0.4rem; }
.q-stem { font-size: 16px; line-height: 1.55; margin-bottom: 0.75rem; max-width: 70ch; }
.q-options { display: grid; gap: 0.45rem; }
.q-option { display: grid; grid-template-columns: auto auto 1fr; gap: 0.6rem; align-items: start; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; line-height: 1.45; }
.q-option:hover { border-color: var(--line-strong); }
.q-option:has(input:checked) { border-color: var(--ink-2); background: var(--surface-2); }
.q-option:has(input:disabled:not(:checked)) { opacity: 0.55; cursor: default; }
.q-option input { margin-top: 0.2rem; }
.q-option-id { font-weight: 650; color: var(--ink-2); min-width: 1.1em; }
.q-submit-bar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: flex-end; margin-top: 1rem; padding: 0.75rem 0; background: var(--bg); border-top: 1px solid var(--line); }
.q-submit-bar[hidden] { display: none; }
.q-submit-bar .field-note { margin-right: auto; }
.q-progress { font-weight: 600; font-variant-numeric: tabular-nums; }

/* A submitted scored part. */
.q-result-stats { margin: 0.75rem 0; max-width: 18rem; }
.q-result-head { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.4rem; }
.q-right .q-result-head .status-chip, .c-right { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.q-wrong .q-result-head .status-chip, .c-wrong { background: var(--accent-soft); color: var(--accent-soft-ink); }
.q-wrong { border-left: 4px solid var(--accent); }
.q-result-options { list-style: none; padding: 0; margin: 0 0 0.5rem; display: grid; gap: 0.3rem; }
.q-result-options li { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; padding: 0.35rem 0.6rem; border-radius: 8px; line-height: 1.45; }
.q-result-options li.q-key { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.q-result-options li.q-chosen:not(.q-key) { background: var(--accent-soft); }
.q-result-options li.q-chosen { font-weight: 600; }
.q-rationale { margin-top: 0.5rem; color: var(--ink-2); }
.q-reread { margin: 0.5rem 0 0; }
.q-reread a, .c-links a { color: var(--accent); }

/* Ratings and feedback. */
.q-scale-help { margin: 0.75rem 0; }
.q-scale-help summary { cursor: pointer; color: var(--ink-2); font-weight: 560; }
.q-scale-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.6rem 0 0; font-size: 14px; }
.q-scale-list dt { font-weight: 650; }
.q-scale-list dd { margin: 0; color: var(--ink-2); }
.q-groups { display: grid; gap: 1.25rem; margin-top: 1rem; }
.q-group-heading { font-size: 1.05rem; margin: 0 0 0.3rem; }
.q-items { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.q-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin: 0; background: var(--surface); min-width: 0; }
.q-item.q-missing { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.q-item-text { float: left; width: 100%; padding: 0; font-weight: 560; line-height: 1.45; margin-bottom: 0.45rem; }
.q-item-text + * { clear: both; }
.q-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.q-choices-list { display: grid; gap: 0.35rem; }
.q-choice { display: inline-flex; gap: 0.45rem; align-items: center; padding: 0.35rem 0.65rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; }
.q-choices-list .q-choice { border-radius: 9px; }
.q-choice:has(input:checked) { border-color: var(--ink-2); background: var(--surface-2); font-weight: 600; }
.q-other, .q-text { width: 100%; margin-top: 0.3rem; }
.q-text { height: auto; min-height: 5rem; padding: 0.5rem 0.65rem; resize: vertical; font: inherit; }

/* Staff. */
.q-cohort-pick { max-width: 22rem; margin: 28px 0 0; }
.house-section .q-cohort-pick { margin: 0 0 12px; }
.q-overview td { white-space: nowrap; }
.q-name { margin-left: 0; text-align: left; color: var(--ink); font-weight: 620; text-decoration: none; }
.q-name:hover { color: var(--ink); text-decoration: underline; }
.q-downloads { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.q-num { font-variant-numeric: tabular-nums; }
.q-up { color: var(--ok); font-weight: 650; }
.q-down { color: var(--accent); font-weight: 650; }
.q-group-row th { background: var(--surface-2); font-weight: 650; }
.q-preview-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.q-preview-items { display: grid; gap: 0.3rem; padding-left: 1.2rem; }
.c-detail { margin-top: 54px; border-top: 2px solid var(--line-strong); }
.q-detail-close { margin: -8px 0 16px; }
.q-answer-list { display: grid; grid-template-columns: minmax(12rem, 1fr) 2fr; gap: 0.4rem 1rem; margin: 0.4rem 0 1rem; font-size: 14px; }
.q-answer-list dd { margin: 0; }

/* The catch-up material. */
.c-comparison .stats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 0.75rem 0 1rem; }
.c-checks { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.5rem; }
.c-check { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.c-check .status-chip { margin-left: 0.4rem; }
.c-check .field-note { margin: 0.25rem 0 0; }
.c-topics, .c-sessions { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.c-topic-heading { margin: 0; }
.c-links { display: grid; gap: 0.3rem; padding-left: 1.2rem; margin: 0.5rem 0 0; }
.c-plain { display: grid; gap: 0.3rem; padding-left: 1.2rem; }
.c-reader { margin-top: 0.5rem; }
.c-reader section + section { margin-top: 1.5rem; }
.c-reader h2 { font-size: clamp(22px, 3vw, 28px); margin-top: 1.25rem; }
.c-reader .sec-n { color: var(--ink-3); margin-right: 0.6em; font-variant-numeric: tabular-nums; }
.c-reader .copy { display: none; } /* the course site's copy button needs its own script */
.c-reader figure.code { margin: 0 0 16px; }
.c-reader .ln { user-select: none; color: var(--ink-3); margin-right: 0.8em; }
.c-reader .table { overflow-x: auto; margin: 0 0 18px; }

@media (max-width: 640px) {
  .q-row, .c-check { flex-direction: column; align-items: stretch; }
  .q-answer-list, .q-scale-list { grid-template-columns: 1fr; }
}

/* ---- instructor (instructor's view builder) ---- */

.instructor-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin: 28px 0 0; }
.instructor-profile > .house-bar { margin-bottom: 16px; }
.instructor-toolbar .btn[hidden], .instructor-cohort[hidden] { display: none; }
.instructor-cohort { min-width: 14rem; }

/* The overview: a wide table that scrolls sideways inside its frame, with the learners' names kept in view. */
.instructor-grid-wrap {
  position: relative; /* keeps the cells' hidden labels inside the frame, so the page itself never scrolls sideways */
  overflow-x: auto; margin-top: 0.75rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.instructor-grid-wrap[hidden] { display: none; }
.instructor-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13.5px; }
.instructor-grid th, .instructor-grid td {
  padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; white-space: nowrap;
  background: var(--surface);
}
.instructor-grid thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650;
}
.instructor-grid tbody tr:last-child > * { border-bottom: 0; }
.instructor-grid tbody tr:hover > * { background: var(--surface-2); }
.instructor-grid .instructor-name-col {
  position: sticky; left: 0; z-index: 1; text-align: left; min-width: 12rem; max-width: 18rem; white-space: normal;
  border-right: 1px solid var(--line);
}
.instructor-grid thead .instructor-name-col { z-index: 3; }
.instructor-name-col small { display: block; color: var(--ink-3); font-size: 12px; font-weight: normal; }
/* A learner's name opens their page: a link that is a row's title, so ink, underlined on hover (house.css, links). */
.instructor-open {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 620; color: var(--ink); cursor: pointer;
  text-align: left; text-decoration: none; text-underline-offset: 3px;
}
.instructor-open:hover { text-decoration: underline; }
.instructor-open:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.instructor-day { min-width: 3.4rem; }
.instructor-grid td.instructor-day { line-height: 1.25; }
.instructor-day .instructor-mark, .instructor-day .instructor-score { display: block; }
.instructor-grid .num, .instructor-score { font-variant-numeric: tabular-nums; }
.instructor-mark { display: inline-block; min-width: 1.1em; font-weight: 700; }
.instructor-mark.present { color: var(--ok); }
.instructor-mark.no-check-in { color: var(--warn); }
.instructor-mark.absent { color: var(--danger); }
.instructor-mark.excused { color: var(--ink-2); }
.instructor-mark.missing, .instructor-missing { color: var(--ink-3); }
/* A register kept by date: one mark for each date it was held, in one cell, with the count below (integrator). */
.instructor-checkins { white-space: nowrap; }
.instructor-strip { display: block; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.instructor-checkins small { display: block; color: var(--ink-3); font-size: 12px; }
.instructor-score { font-size: 12.5px; }
.instructor-high { color: var(--ok); }
.instructor-low { color: var(--danger); }
.instructor-state.not_started, .instructor-state.closed { color: var(--ink-3); }
.instructor-pair { font-variant-numeric: tabular-nums; }
.instructor-badge {
  display: inline-block; margin: 3px 4px 0 0; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 560;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.instructor-badge.live { color: var(--ok); }
.instructor-badge.warn { background: var(--warn-soft); color: var(--ink); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.instructor-slowed { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-2); white-space: normal; }
.instructor-legend-list { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; display: grid; gap: 0.35rem; }
.instructor-legend-list .instructor-mark, .instructor-legend-list .instructor-score { width: 2.8rem; text-align: center; }

/* A learner's page. */
.instructor-flags:empty { display: none; }
.instructor-block h3 { margin: 1.1rem 0 0.4rem; font-size: 1rem; }
.instructor-block > .field-note { margin-bottom: 0.6rem; max-width: 68ch; }
.instructor-answers { display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; gap: 0.45rem 1.25rem; margin: 0.4rem 0 0; }
.instructor-answers dt { font-weight: 600; }
.instructor-answers dd { margin: 0; }
.instructor-table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.instructor-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.instructor-table th, .instructor-table td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.instructor-table thead th {
  border-top: 0; background: var(--surface-2); white-space: nowrap;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 650;
}
.instructor-table tbody th { font-weight: 600; }
.instructor-table th small { display: block; color: var(--ink-3); font-size: 12px; font-weight: normal; }
.instructor-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.instructor-table td.up { color: var(--ok); }
.instructor-table td.down { color: var(--danger); }
.instructor-subhead th { background: var(--bg); font-size: 13px; }
.instructor-wrong { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.instructor-wrong p { margin: 0; }
.instructor-section { font-size: 13px; font-weight: normal; margin: 0.2rem 0 0; }
.instructor-section a, .instructor-mount .instructor-table a { color: var(--accent); text-underline-offset: 2px; }
.instructor-mount code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 0 4px; border-radius: 5px; }
.instructor-check { margin-bottom: 0.75rem; }
.instructor-check p { margin: 0.2rem 0; }
.instructor-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 0.6rem 0 1rem; }
.instructor-figure {
  display: grid; gap: 0.3rem; padding: 0.8rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.instructor-figure strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.instructor-talk { border-top: 1px solid var(--line); padding-top: 0.75rem; margin-top: 0.75rem; }
.instructor-talk:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.instructor-points { padding-left: 1.1rem; display: grid; gap: 0.45rem; }
.instructor-verdict { font-weight: 650; }
.instructor-verdict.met { color: var(--ok); }
.instructor-verdict.partly { color: var(--warn); }
.instructor-verdict.not_met { color: var(--danger); }
.instructor-verdict.unjudged { color: var(--ink-3); }
.instructor-quote { margin: 0.15rem 0 0; font-style: italic; color: var(--ink-2); }
.instructor-transcript { margin-top: 0.5rem; }
.instructor-transcript dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; }
.instructor-transcript dt { font-weight: 600; }
.instructor-transcript dd { margin: 0; white-space: pre-wrap; }
.instructor-raw {
  white-space: pre-wrap; overflow: auto; font-family: var(--mono); font-size: 12px;
  background: var(--surface-2); padding: 0.75rem; border-radius: var(--radius-sm);
}
.instructor-generated { margin-top: 2rem; }

@media (max-width: 640px) {
  .instructor-answers { grid-template-columns: 1fr; }
  .instructor-answers dd { margin-bottom: 0.4rem; }
  .instructor-grid .instructor-name-col { min-width: 9rem; }
}

/* A learner's page printed for a meeting: the page alone, in black on white, without the app around it. */
@media print {
  body:has(.instructor-mount) .topbar,
  body:has(.instructor-mount) .chatbar,
  body:has(.instructor-mount) .portal-tabs,
  body:has(.instructor-mount) .toast,
  .instructor-actions,
  .instructor-transcript { display: none !important; }
  body:has(.instructor-mount) .wrap { max-width: none; padding: 0; }
  .instructor-mount, .instructor-mount * { color: #000 !important; background: transparent !important; box-shadow: none !important; }
  .instructor-mount a { text-decoration: none; }
  .instructor-grid-wrap { overflow: visible; max-height: none; border: 0; }
  .instructor-grid .instructor-name-col, .instructor-grid thead th { position: static; }
  .instructor-grid th, .instructor-grid td { border-bottom: 1px solid #999; }
  .instructor-table th, .instructor-table td { border-top: 1px solid #999; }
  .instructor-block h2, .instructor-block h3 { break-after: avoid; }
  .instructor-table tr, .instructor-grid tr, .instructor-figure, .instructor-wrong li, .instructor-points li,
  .instructor-check, .instructor-answers { break-inside: avoid; }
  .instructor-figure { border: 1px solid #999; }
  .instructor-profile .house-band { border: 2px solid #000; }
}

/* ---- programme (the programme's timeline and week pages): app/static/portal/programme.js ---- */

/* The home page (house.css's parts): each part of the programme a numbered section, each week a card of day rows,
   and the items between the weeks as rows. A week that isn't open is the course's empty day card: dashed, no shadow. */
.programme-about { margin: 22px 0 0; }
.programme-items { display: grid; gap: 16px; }
.programme-week { gap: 12px; outline-offset: 4px; }
.programme-week-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.programme-week:not(.is-open) { background: none; box-shadow: none; border-style: dashed; animation: none; }
.programme-week:not(.is-open) .house-card-title { color: var(--ink-3); }
.programme-week .house-rows { border-top-color: var(--line); }
.programme-week .house-row:last-child { border-bottom: 0; padding-bottom: 0; }
.programme-item.is-open > a { font-weight: 600; }
.programme-item:not(.is-open) > span:first-child { color: var(--ink-3); }
.programme-more { display: flex; flex-wrap: wrap; gap: 4px 16px; flex-basis: 100%; margin: 0; font-size: 14.5px; }
/* A week's page: its own pages as pills under the band, each section's links as pills, and a consultancy day's
   practice conversations under its pills. */
.programme-week-pages { margin-top: 22px; }
.house-section > .programme-week-pages { margin: 0 0 20px; }
.house-section > .programme-links { margin-top: 16px; }
.house-section > .house-rows + .programme-links { margin-top: 20px; }
.house-section > .programme-links:empty { display: none; }
.programme-week-page .house-row { scroll-margin-top: calc(var(--topbar-h) + 16px); outline-offset: 4px; }
.programme-day-practice { display: grid; gap: 6px; margin-top: 4px; }
.programme-day-practice .house-list > li { padding: 8px 2px; }
.programme-day-practice .house-list > li:first-child { border-top-color: var(--line); }
@media (max-width: 640px) {
  .programme-week { padding: 18px 18px 20px; }
}
/* A day's quiz named in the address (#portal/quizzes/day-3) stands out in the list. */
.quiz-item.is-named { border-color: var(--accent, #b43e26); box-shadow: 0 0 0 2px var(--accent-soft, transparent); }

/* ---- reading (the reader): app/static/portal/reading.js ---- */

/* The reader is the house look's frame (house.css) around a course page: the breadcrumb bar with the page's actions,
   the page's contents in the rail, and in the main column the day's materials as pills, the page in its frame and the
   previous and next links. The course page keeps its own look inside the frame. A deck has no rail. */
.course-reader { display: block; width: 100%; height: 75vh; border: 0; color-scheme: light dark; }
.portal-reading { min-width: 0; }
.reading-tabs { margin: 0 0 16px; }
/* The trainer's materials: the course's disclosure pill, filled while it is open. */
.reading-staff { margin: 0 0 16px; }
.reading-staff summary { display: inline-flex; align-items: center; padding: 4px 12px; border: 1px solid var(--line-strong);
  border-radius: 999px; font-size: 13px; font-weight: 620; color: var(--ink-2); cursor: pointer; list-style: none; }
.reading-staff summary::-webkit-details-marker { display: none; }
.reading-staff[open] summary { background: var(--band); border-color: var(--band); color: var(--band-ink); }
.reading-staff summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.reading-staff .reading-tabs { margin: 12px 0 0; }
/* The previous and next links: the course's pager, a rule and then each link's kind over its title. */
.reading-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin: 48px 0 0;
  padding-top: 22px; border-top: 1px solid var(--line); }
.reading-pager a { display: grid; gap: 4px; max-width: 46%; color: var(--ink); text-decoration: none; }
.reading-pager a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.reading-pager a > span { font-size: 11.5px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3); }
.reading-pager a > strong { font-weight: 600; }
.reading-pager a[rel="next"] { margin-left: auto; text-align: right; }
/* Expanded: the page alone, full window, with the bar kept in view. */
.reading-expanded { position: fixed; inset: 0; z-index: 2000; overflow: auto; background: var(--bg);
  padding: 1.5rem max(1rem, calc((100vw - 1000px) / 2)); }
.reading-expanded .reading-toolbar { position: sticky; top: -1.5rem; z-index: 1; margin-bottom: 16px; padding-top: 1rem;
  background: var(--bg); }
.reading-expanded .course-reader { height: calc(100dvh - 5rem) !important; }
.reading-expanded .house-rail { display: none; }
.reading-expanded .house-layout { grid-template-columns: minmax(0, 1fr); }
.reading-expanded .house-layout > .house-main { grid-column: 1; }
@media (max-width: 640px) {
  .reading-pager a { max-width: 100%; }
}
