/* The student pages, after a Moodle 4 assignment's "Edit submission" page: a breadcrumb bar, the activity title with
   its icon, the dates box, a collapsible "Add submission" section with the file manager in a two-column form, the
   submission status table, and a Moodle modal. Colours are sampled from the reference screenshot (see the report).
   Light only: phones in dark mode get the same light page, not a half-inverted one. */

:root {
  color-scheme: light;
  --text: #1d2125;
  --muted: #5c636a;           /* 6.1:1 on white */
  --line: #dee2e6;
  --head-bg: #f8f9fa;         /* the dates box, the status table's header column */
  --crumb-bg: #eaecef;        /* the breadcrumb bar */
  --crumb-sep: #6a737b;       /* the breadcrumb slashes: 4.1:1 on the bar */
  --primary: #a6192e;         /* links, Save changes, the chevron: 7.5:1 on white */
  --primary-hover: #8a1526;
  --primary-soft: #f7e7ea;    /* the chevron button's disc: the chevron on it is 6.3:1 */
  --secondary: #6c757d;       /* Cancel, the file manager's toolbar buttons: white on it is 4.7:1 */
  --secondary-hover: #5c636a;
  --secondary-active: #545b62;
  --fm-line: #d1d7dc;         /* the file manager's border */
  --dash: #b8b8b8;            /* the drop area's dashes */
  --drop-icon: #adb5bd;       /* the drop area's arrow (decorative) */
  --success-bg: #d7f0dc;
  --notice-bg: #fcefdc;
  --notice-line: #f0ad4e;
  --error: #ca3120;           /* 5.1:1 on white */
  --error-bg: #f4d6d2;
  --assessment: #ff007a;      /* the activity icon */
  --focus: rgba(166, 25, 46, .75);
  --band: #4f5d73;            /* the gallery's band pips and the topics note: a calm slate, 6.6:1 on white */
  --band-off: #d5dbe1;
  --code-bg: #f6f7f9;
  --mono: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius: .5rem;
  --radius-sm: .375rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
          "Liberation Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* .btn and other display rules would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font: 400 1rem/1.5 var(--font);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

code { font-size: .875em; color: #c02d2e; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: absolute; left: 1rem; top: .75rem; z-index: 10; padding: .5rem .75rem; background: #fff; color: var(--primary); }

/* -- chrome -------------------------------------------------------------------------------------- */

.navbar {
  display: flex; align-items: center;
  height: 60px; padding: 0 1rem;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
  position: relative; z-index: 2;
}
.navbar { justify-content: space-between; gap: 1rem; }
.navbar-brand { color: var(--text); font-size: 1.17rem; font-weight: 400; }
.navbar-brand:hover { color: var(--text); text-decoration: none; }
.navbar-teacher {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .875rem;
  border: 1px solid var(--primary); border-radius: var(--radius-sm); font-weight: 700; white-space: nowrap;
}
.navbar-teacher:hover { background: var(--primary-soft); text-decoration: none; }

.page { max-width: 64rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

h1, h2, h3 { font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: 2.25rem; margin: 0; }
h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }

/* The breadcrumb: a grey rounded bar as wide as its crumbs, maroon links, grey slashes, the page in dark text. */
.breadcrumb { display: flex; max-width: 100%; margin: 0 0 1.5rem; }
.breadcrumb ol {
  list-style: none; display: flex; flex-wrap: wrap; align-items: center;
  margin: 0; padding: .625rem 1rem;
  background: var(--crumb-bg); border-radius: var(--radius);
  font-size: 1rem; line-height: 1.5;
}
.breadcrumb li { display: inline-flex; align-items: center; }
/* The slash ends a crumb, so a wrapped line on a phone starts with a crumb, not a slash. */
.breadcrumb li:not(:last-child)::after {
  content: "/"; content: "/" / "";
  padding: 0 .5rem; color: var(--crumb-sep);
}
.breadcrumb [aria-current] { color: var(--text); }

.activity-header { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin: 0 0 1rem; }
.btn.btn-tour {
  margin-left: auto; min-height: 44px;
  background: #fff; border-color: var(--primary); color: var(--primary); font-weight: 700;
}
.btn.btn-tour:hover { background: var(--primary-soft); border-color: var(--primary-hover); color: var(--primary-hover); }
.activity-icon { flex: none; width: 24px; height: 32px; color: var(--assessment); }

/* The dates box. */
.activity-info {
  margin: 0 0 1.5rem; padding: 1rem 1rem 2rem;
  background: var(--head-bg); border-radius: var(--radius);
}
.activity-info p { margin: 0 0 .25rem; }
.activity-info p:last-child { margin-bottom: 0; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }

/* -- the form: a collapsible section, two-column rows ---------------------------------------------- */

.mform { margin: 0; }
.fsection { margin: 2.25rem 0 0; }
.fsection-head { display: flex; align-items: center; gap: .875rem; margin: 0 0 .75rem; }
.fsection-head h2 { margin: 0; font-size: 1.75rem; }

/* The chevron button: a 44px target round a 32px pale disc; the chevron turns when the section is closed. */
.collapse-toggle {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -6px -6px -6px -6px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--primary); cursor: pointer;
}
.chevron {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft);
  transition: transform .15s ease-in-out;
}
.collapse-toggle:hover .chevron { background: #f0d3d9; }
.collapse-toggle[aria-expanded="false"] .chevron, details:not([open]) .chevron { transform: rotate(-90deg); }

/* The same header on a native disclosure (the feedback page). */
summary.fsection-head { cursor: pointer; list-style: none; }
summary.fsection-head::-webkit-details-marker { display: none; }
summary.fsection-head:hover .chevron { background: #f0d3d9; }

.form-row { display: grid; grid-template-columns: 25% 75%; margin: 0 0 1rem; }
.form-label { padding: .375rem 1.5rem 0 1.375rem; }
.form-field { min-width: 0; }
.form-help { margin: .375rem 0 .5rem; }

/* -- the file manager ------------------------------------------------------------------------------- */

.fm-limits { margin: 0 0 .25rem; text-align: right; }

.filemanager { position: relative; border: 1px solid var(--fm-line); border-radius: var(--radius-sm); background: #fff; }
.fm-toolbar {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .25rem .25rem 0;
}
.fm-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 1.75rem; margin: 0;
  border-radius: var(--radius-sm); background: var(--secondary); color: #fff; cursor: pointer;
}
.fm-btn:hover { background: var(--secondary-hover); }
/* View modes: shown as Moodle shows them, but inert. */
.fm-views { display: inline-flex; border-radius: var(--radius-sm); overflow: hidden; pointer-events: none; cursor: default; }
.fm-view {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.875rem; height: 1.75rem; background: var(--secondary); color: #fff;
}
.fm-view.is-current { background: var(--secondary-active); }
.fm-path {
  display: flex; align-items: center; gap: .625rem;
  padding: .25rem .625rem .125rem; border-bottom: 1px solid var(--line);
  color: var(--primary);
}
.fm-path svg { color: #000; }

.fm-content { position: relative; padding: .5rem; }
.fm-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem;
  min-height: 6.5rem; padding: 1.25rem 1rem .75rem;
  border: 2px dashed var(--dash); text-align: center;
}
.fm-drop-icon { width: 40px; height: 40px; color: var(--drop-icon); }
.fm-drop-text { color: var(--text); }
/* The real file input covers the whole area: a tap opens the picker and a dropped file lands on it. */
.fm-content input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}
.fm-content:focus-within { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius-sm); }
.filemanager:hover .fm-drop, .filemanager.is-dragover .fm-drop { border-color: var(--secondary); background: var(--head-bg); }

/* A chosen file: Moodle's file tile in place of the empty drop area. The input still covers the rest of the area. */
.filemanager.has-file .fm-drop { display: none; }
.fm-files { position: relative; z-index: 1; display: flex; min-height: 6.5rem; padding: .5rem; pointer-events: none; }
.fm-file {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .375rem;
  width: 8rem; padding: .75rem .5rem .5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  text-align: center; pointer-events: auto;
}
.fm-file-icon { width: 32px; height: 40px; color: var(--secondary); }
.fm-file-name { font-size: .875rem; line-height: 1.3; overflow-wrap: anywhere; }
.fm-file-remove {
  position: absolute; top: -.75rem; right: -.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
  color: #fff;
}
.fm-file-remove svg {
  box-sizing: content-box; width: 12px; height: 12px; padding: 5px;
  border-radius: 50%; background: var(--secondary);
}
.fm-file-remove:hover svg { background: var(--primary); }

.fm-types { margin: .25rem 0 0; }
.fm-types p { margin: 0 0 1rem; }
.fm-types ul { list-style: none; margin: 0; padding: 0; }
.fm-types li { line-height: 1.5; }
.ext { color: var(--muted); font-size: .875rem; }

/* A chosen sample: the file tile, a little wider for a title. */
.fm-file-sample { width: 10rem; }

/* -- the sample gallery: five band groups of four cards --------------------------------------------- */

.gallery { margin: 1.5rem 0 0; scroll-margin-top: 1rem; }
.gallery:focus, .fsection:focus { outline: none; }
.gallery-head h2 { margin: 0 0 .375rem; font-size: 1.75rem; }
.gallery-lead { margin: 0; }
/* The keyboard hint: only while a sketch's radio has keyboard focus, so touch use stays uncluttered. */
.gallery-keys { display: none; margin: .375rem 0 0; color: var(--band); font-size: .875rem; font-weight: 700; }
.gallery:has(.gallery-choices input:focus-visible) .gallery-keys { display: block; }
.gallery-skip, .back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.gallery-choices { min-width: 0; margin: .5rem 0 0; padding: 0; border: 0; }

.band { margin: 0 0 .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.band-summary {
  display: flex; align-items: center; gap: .875rem;
  min-height: 56px; padding: .5rem .75rem .5rem 1rem;
  list-style: none; cursor: pointer; border-radius: var(--radius);
}
.band-summary::-webkit-details-marker { display: none; }
.band-summary:hover .chevron { background: #f0d3d9; }
.band[open] > .band-summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.band-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.band-name { font-weight: 700; font-size: 1.125rem; line-height: 1.3; }
.band-stage { color: var(--muted); font-size: .875rem; }
/* Where the band sits in the unit: filled pips, one per band. A position, never a mark. */
.band-tag { flex: none; display: inline-flex; align-items: flex-end; gap: 3px; }
.pip { width: 5px; height: 16px; border-radius: 2px; background: var(--band-off); }
.pip.is-on { background: var(--band); }
.band-body { padding: .75rem 1rem 1rem; }
.band-blurb { margin: 0 0 .25rem; }
.band-topics { margin: 0; color: var(--band); font-size: .875rem; font-weight: 700; }

.cards {
  list-style: none; margin: .75rem 0 0; padding: 0;
  display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
}
.card {
  display: flex; flex-direction: column; gap: .375rem; min-width: 0;
  padding: .875rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
/* A card showing its code takes the whole row, so the code has room to read. */
.card:has(.card-code[open]) { grid-column: 1 / -1; }
.card.is-selected, .card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.card-title { margin: 0; font-size: 1.0625rem; }
.card-summary { flex: 1; margin: 0; font-size: .9375rem; }
.card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .625rem;
  margin: 0; color: var(--muted); font-size: .8125rem;
}
.badge {
  display: inline-block; padding: .0625rem .5rem;
  border: 1px solid var(--band-off); border-radius: 999px; background: #eef1f4; color: #3d4650;
}
/* The two controls: one above the other in a narrow grid card; side by side once the card is wide enough (a phone's
   single column, or a desktop card showing its code). Open, the code spans the card below the row: the disclosure
   covers both columns and the Use button sits over its top-right corner, beside its summary. */
.card { container-type: inline-size; }
.card-actions { display: grid; grid-template-columns: 100%; gap: .5rem; margin-top: .25rem; }
.card-code { min-width: 0; }
.card-code > summary { width: 100%; min-height: 44px; list-style: none; }
.card-code > summary::-webkit-details-marker { display: none; }
@container (min-width: 15rem) {
  .card-actions { grid-template-columns: 6.75rem minmax(0, 1fr); }
  .card-code { grid-column: 1; grid-row: 1; }
  .card-code[open] { grid-column: 1 / -1; grid-row: 1 / span 2; }
  .card-code > summary { width: 6.75rem; }
  .btn.card-use { grid-column: 2; grid-row: 1; align-self: start; position: relative; z-index: 1; }
}
.btn.btn-quiet { background: #fff; border-color: var(--secondary); color: var(--text); }
.btn.btn-quiet:hover { background: var(--head-bg); color: var(--text); }
.btn.card-use {
  gap: .5rem; min-height: 44px; white-space: nowrap;
  background: #fff; border-color: var(--primary); color: var(--primary); font-weight: 700;
}
.btn.card-use:hover { background: var(--primary-soft); color: var(--primary-hover); }
.card-use input { flex: none; width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--primary); cursor: pointer; }
.card-use-on { display: none; }
.btn.card-use:has(input:checked) { background: var(--primary); color: #fff; }
.card-use:has(input:checked) input { accent-color: #fff; }
.card-use:has(input:checked) .card-use-off { display: none; }
.card-use:has(input:checked) .card-use-on { display: inline; }
.card-use:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-use input:focus-visible { outline: none; }

.code-files { display: grid; gap: .75rem; margin-top: .5rem; }
.code-file { min-width: 0; margin: 0; }
.code-file figcaption { margin: 0 0 .25rem; color: var(--muted); font: 700 .8125rem/1.4 var(--mono); }
pre.code {
  max-height: 24rem; margin: 0; padding: .75rem; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--code-bg);
  color: var(--text); font: .8125rem/1.5 var(--mono); white-space: pre; tab-size: 2;
}
pre.code code { color: inherit; font: inherit; }

.back-row { margin: -.5rem 0 .5rem; }

/* -- the public-upload tick box --------------------------------------------------------------------- */

.agree {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem 1rem;
  background: var(--notice-bg); border-left: 4px solid var(--notice-line); border-radius: var(--radius-sm);
}
.agree input { flex: none; width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--primary); cursor: pointer; }
.agree label { cursor: pointer; }

/* -- buttons ------------------------------------------------------------------------------------------ */

.form-actions { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.form-error {
  margin: 0 0 .75rem; padding: .75rem 1rem;
  background: var(--error-bg); border-left: 4px solid var(--error); border-radius: var(--radius-sm);
  color: #6c1a11; font-weight: 700;
}
.form-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions { margin: 1.5rem 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: .375rem .75rem;
  border: 1px solid var(--secondary); border-radius: var(--radius-sm);
  background: var(--secondary); color: #fff;
  font: inherit; line-height: 1.5; text-align: center; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--secondary-hover); border-color: var(--secondary-hover); color: #fff; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.form-buttons .btn { min-height: 44px; padding: .5rem 1rem; font-size: 1.0625rem; }
.btn:disabled { opacity: .65; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--primary); border-color: var(--primary); }

.finished {
  margin: 1.5rem 0; padding: .75rem 1.25rem;
  background: var(--primary-soft); border-left: 4px solid var(--primary); border-radius: var(--radius-sm);
  font-weight: 700;
}

/* -- the submission status table --------------------------------------------------------------------- */

.summary-title { margin-top: 2.5rem; }
.status { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.status th, .status td {
  padding: .75rem; text-align: left; vertical-align: top;
  border-top: 1px solid var(--line);
}
.status tr:last-child th, .status tr:last-child td { border-bottom: 1px solid var(--line); }
.status th { width: 25%; background: var(--head-bg); font-weight: 400; }
.status td.submitted, .status td.graded { background: var(--success-bg); }
.status .last { display: inline-block; margin-left: .75rem; }
.file-number { margin-left: .5rem; color: var(--muted); font-size: .875rem; }

/* In-line progress while a job runs in the background. */
#job-progress { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
#job-status { font-weight: 700; }
#show-progress { background: var(--primary); border-color: var(--primary); }
#show-progress:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* -- the feedback page's section: the heading, with the disclosure's chevron beside it ------------------ */

.fsection-disclosure { position: relative; }
.fsection-title {
  display: flex; align-items: center; min-height: 44px; margin: 0 0 .75rem; padding-left: 46px;
  font-size: 1.75rem;
}
.fsection-toggle {
  position: absolute; top: 0; left: -6px;
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; color: var(--primary); list-style: none; cursor: pointer;
}
.fsection-toggle::-webkit-details-marker { display: none; }
.fsection-toggle:hover .chevron { background: #f0d3d9; }

/* What the feedback covers: the sample and its band, or all topics for an upload. */
.judged {
  margin: 0 0 1rem; padding: .75rem 1rem;
  background: var(--head-bg); border-left: 4px solid var(--band); border-radius: var(--radius-sm);
}
.judged p { margin: 0; }
.judged-sample { font-weight: 700; }

/* -- the feedback panel -------------------------------------------------------------------------------- */

.feedback-panel {
  margin: 0 0 1rem; padding: 1rem 1.125rem 1.125rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.feedback-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 0 0 .875rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line);
}
.feedback-panel-head h3 { margin: 0; font-size: 1rem; font-weight: 400; }
.feedback-open {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -.5rem -.75rem -.5rem 0; border-radius: var(--radius-sm);
  color: var(--primary);
}
.feedback-open:hover { background: var(--primary-soft); color: var(--primary-hover); }
.feedback-body { border: 1px solid #b5b5b5; }

/* The frame runs no script, so it cannot size itself to its content. It is about one screen tall: at least 44rem
   on a laptop, so a summary and two lists of feedback show without scrolling inside it, but never taller than the
   screen, so a 1280x720 projector shows no scrollbar inside a scrollbar. */
.feedback-frame {
  display: block; width: 100%; border: 0;
  height: 80vh; height: calc(100svh - 6rem);
  min-height: 32rem; min-height: min(44rem, calc(100svh - 6rem));
  background: #fff;
}

/* -- landing --------------------------------------------------------------------------------------- */

.landing { max-width: 40rem; margin: 1.5rem auto 0; text-align: center; }
.landing h1 { margin-bottom: .5rem; }
.lead { font-size: 1.125rem; margin: 0 0 1.5rem; }
.doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.door {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  min-height: 5.5rem; padding: 1rem;
  border: 1px solid var(--primary); border-radius: var(--radius);
  background: var(--primary); color: #fff; font-size: 1.25rem; font-weight: 700;
}
.door:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.landing-note { margin: 1.25rem 0 0; color: var(--muted); font-size: .875rem; }

/* -- the waiting pop-up (a Moodle modal) ----------------------------------------------------------- */

.wait {
  width: calc(100% - 2rem); max-width: 30rem; max-height: calc(100% - 2rem);
  padding: 0; border: 1px solid rgba(0, 0, 0, .2); border-radius: var(--radius);
  background: #fff; color: var(--text);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
  overflow: auto;
}
.wait::backdrop { background: rgba(0, 0, 0, .5); }
.wait:focus, .wait:focus-visible { outline: none; }
.wait-header { padding: 1rem; border-bottom: 1px solid var(--line); }
.wait-header h2 { margin: 0; font-size: 1.40625rem; }
.wait-body { padding: 1rem; }
.wait-footer {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem;
  padding: .75rem 1rem; border-top: 1px solid var(--line);
}
.wait-footer .btn { background: var(--primary); border-color: var(--primary); }
.wait-footer .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.wait-progress { display: flex; align-items: center; gap: .75rem; min-height: 2.5rem; }
.wait-line { margin: 0; font-weight: 700; font-size: 1.0625rem; }
.spinner {
  flex: none; width: 1.75rem; height: 1.75rem;
  border: .25rem solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
/* After an error there is nothing to wait for. */
.wait:has(#wait-error:not([hidden])) .wait-progress,
.wait:has(#wait-error:not([hidden])) .wait-stat { display: none; }

.wait-error {
  margin: 0; padding: .75rem 1rem;
  background: var(--error-bg); border-left: 4px solid var(--error); border-radius: var(--radius-sm);
  color: #6c1a11; font-weight: 700;
}

.wait-stat {
  margin: 1rem 0 0; padding: 1rem;
  background: var(--head-bg); border-radius: var(--radius);
  text-align: center; overflow-wrap: anywhere;
}
.wait-stat strong {
  display: block; font-size: 2.5rem; line-height: 1.1; color: var(--primary);
  animation: stat-in .4s ease-out;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stat-in { from { opacity: 0; transform: translateY(.35rem); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-color: var(--primary); border-right-color: var(--primary-soft); }
  .wait-stat strong { animation: none; }
  .chevron { transition: none; }
}

/* -- phones and touch ------------------------------------------------------------------------------ */

@media (max-width: 767.98px), (pointer: coarse) {
  .btn { min-height: 44px; }
  .agree input { margin-top: .1rem; width: 1.5rem; height: 1.5rem; }
  .fm-btn { width: 2.75rem; height: 2.75rem; }
  .fm-view { height: 2.75rem; }
  .breadcrumb li, .breadcrumb a { display: inline-flex; align-items: center; min-height: 2.75rem; }
}

@media (max-width: 767.98px) {
  .page { padding: 1rem 1rem 2.5rem; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; margin-top: 1.5rem; }
  .breadcrumb ol { padding: .125rem .75rem; }
  .fsection-head h2, .gallery-head h2, .fsection-title { font-size: 1.5rem; }
  .navbar { padding: 0 .75rem; }
  .navbar-brand { font-size: 1.0625rem; }
  .navbar-teacher { padding: 0 .625rem; }
  .gallery { margin-top: 1rem; }
  .band-body { padding: .625rem .75rem .75rem; }
  .card { padding: .75rem; }
  .card-actions .btn { padding-left: .5rem; padding-right: .5rem; font-size: .9375rem; }

  /* Rows stack, label above control, as Moodle does on a phone. */
  .form-row { grid-template-columns: 100%; }
  .form-label { padding: 0 0 .375rem; font-weight: 700; }
  .form-label:empty { display: none; }
  .fm-limits { text-align: left; }
  .form-buttons .btn { flex: 1 1 100%; }
  .form-actions .form-buttons { gap: .625rem; }

  /* The status table stacks: label above value. */
  .status th, .status td { display: block; width: 100%; }
  .status td { border-top: 0; }
  .status th { padding: .5rem .75rem; }
  .status tr:last-child th { border-bottom: 0; }
  .status .last { display: block; margin: .5rem 0 0; }

  .feedback-panel { padding: .75rem; }
  .feedback-frame { min-height: 32rem; min-height: min(32rem, calc(100svh - 6rem)); }
  .wait-footer .btn { flex: 1 1 100%; }
}

@media (max-width: 575.98px) {
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 4.5rem; }
}
