:root {
  --bg: #ffffff;
  --fg: #1b1b1f;
  --muted: #5f6368;
  --line: #d8d8de;
  --accent: #57068c;
  --ok: #1e7b34;
  --bad: #b3261e;
  --warn: #8a5a00;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --fg: #ececf1;
    --muted: #a0a0aa;
    --line: #34343a;
    --accent: #c79bf2;
    --ok: #7fd18f;
    --bad: #f28b82;
    --warn: #f2c46d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
}
main { max-width: 42rem; margin: 0 auto; padding: 0 16px 6rem; }
a { color: var(--accent); }
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; text-decoration: none; }
.who, .muted { color: var(--muted); font-size: 0.9rem; }
h1 { font-size: 1.4rem; margin: 1rem 0 0.5rem; }
h2 { font-size: 1.15rem; margin-top: 1.5rem; }
.notice { padding: 8px 12px; border-left: 4px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.error { padding: 8px 12px; border-left: 4px solid var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.list { list-style: none; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.list .download { margin-left: auto; }
.stack { display: grid; gap: 12px; margin: 12px 0; }
.stack label { display: grid; gap: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 1rem 0 0.25rem; }
input, select, button { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); min-height: 44px; }
button { cursor: pointer; background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
button.primary { width: 100%; margin: 8px 0; }
button.secondary { background: none; color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.crumb { margin: 12px 0 0; }
.summary { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
details { margin: 1rem 0; }
summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
tr.dropped td { color: var(--muted); }
.badge { font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.badge.open, .badge.unmarked { color: var(--warn); }
.badge.confirmed { color: var(--ok); }
.sheet { list-style: none; padding: 0; margin: 0; }
.sheet li { border-bottom: 1px solid var(--line); }
fieldset { border: 0; margin: 0; padding: 10px 0; }
legend { padding: 0; font-weight: 600; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.choice { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; text-transform: capitalize; }
.choice:has(input:checked) { border-width: 2px; font-weight: 600; }
.choice.present:has(input:checked) { border-color: var(--ok); color: var(--ok); }
.choice.absent:has(input:checked) { border-color: var(--bad); color: var(--bad); }
.choice.excused:has(input:checked) { border-color: var(--warn); color: var(--warn); }
fieldset:disabled .choice { opacity: 0.6; }
form.inline { display: inline; }
button.link { background: none; border: 0; color: var(--accent); padding: 0 0 0 0.5rem; min-height: 0; font-weight: 400; text-decoration: underline; }
.signin { display: grid; gap: 12px; margin-top: 2rem; }
.signin button { width: 100%; }
.hidden { display: none !important; }
label.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 8px; background: var(--accent); color: var(--bg); font-weight: 600; cursor: pointer; }
label.button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); }
label.button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.uploads { list-style: none; padding: 0; margin: 8px 0; color: var(--muted); }
/* Setup steps on the course page */
.steps { padding-left: 1.4rem; }
.steps li { margin: 0 0 1rem; }
.steps li.done::marker { color: var(--ok); }
.upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.upload input[type="file"] { flex: 1 1 14rem; min-width: 0; }
.files { display: grid; gap: 0 1.5rem; }
@media (min-width: 40rem) { .files { grid-template-columns: 1fr 1fr; } }
.file h2 { margin-bottom: 0.25rem; }

/* People: students, roster photos, unmatched faces */
.people { list-style: none; padding: 0; margin: 0; }
.people li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.people li > div { min-width: 0; flex: 1; }
.people img, .person img, .gallery img, .face img, img.roster { border-radius: 6px; object-fit: cover; background: var(--line); flex: none; }
.people form { margin: 4px 0; }
.people select { max-width: 100%; }
.nophoto { width: 48px; height: 70px; border-radius: 6px; border: 1px dashed var(--line); flex: none; }
.person { display: flex; gap: 16px; align-items: flex-start; }
.person form { margin: 8px 0; }
.gallery { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.gallery li { display: grid; gap: 2px; justify-items: start; }
.gallery button.link { padding: 0; }

/* The attendance sheet */
.photos { margin-bottom: 1rem; }
.photos h2 { margin-bottom: 0.25rem; }
.photo-list summary { font-weight: 400; color: var(--muted); }
.students { list-style: none; padding: 0; margin: 0; }
.student { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.student fieldset { padding-bottom: 0; }
.student legend .roster { width: 34px; height: 50px; }
.roster.none { border: 1px dashed var(--line); border-radius: 6px; flex: none; }
.badge.seen { color: var(--ok); }
.faces { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.face { width: 72px; display: grid; gap: 4px; }
.face img { width: 72px; height: 72px; display: block; }
.face.uncertain img { outline: 2px dashed var(--warn); outline-offset: 1px; }
.face.confirmed img { outline: 2px solid var(--ok); outline-offset: 1px; }
.face:has(input[value="no"]:checked) img { opacity: 0.3; }
.keep { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.keep label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-weight: 600; }
.keep input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; cursor: pointer; }
.keep label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.keep .yes:has(input:checked) { border: 2px solid var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.keep .no:has(input:checked) { border: 2px solid var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.kept { font-size: 0.8rem; color: var(--ok); }
.note { margin: 4px 0 0; font-size: 0.85rem; color: var(--warn); }
.unmatched .people li { align-items: center; }
.unmatched select { flex: 1; min-width: 0; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.75rem 0; }
.jump a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 0.9rem; }
h2.group { margin: 1.75rem 0 0.25rem; padding-top: 0.5rem; border-top: 2px solid var(--fg); scroll-margin-top: 8px; }
h2.group + .muted { margin: 0 0 0.25rem; }
.savebar { position: sticky; bottom: 0; padding: 8px 0 12px; background: var(--bg); }
.savebar .tally { margin: 0 0 6px; text-align: center; }
.savebar button { width: 100%; box-shadow: 0 2px 8px rgb(0 0 0 / 0.2); }
