/* Course portal: same look as the course list (../index.html). */
:root {
  --bg: #f4f6fb; --surface: #fff; --surface-2: #eef2fa; --ink: #0e1a3a; --ink-2: #4a5678; --line: #dbe1ef;
  --navy: #0b2a6b; --gold: #fbd117; --accent-ink: #1d3e99;
  --ok-bg: #e5f6ec; --ok-ink: #135c33; --err-bg: #fdecec; --err-ink: #8f1d1d; --danger: #b42318;
  --font-head: "Poppins", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06102b; --surface: #0b1c45; --surface-2: #10265a; --ink: #e9efff; --ink-2: #a8b6da; --line: #1c3672; --accent-ink: #9fbcff;
    --ok-bg: #0f3a26; --ok-ink: #a8e8c2; --err-bg: #4a1414; --err-ink: #ffc9c9; --danger: #ff8a80; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06102b; --surface: #0b1c45; --surface-2: #10265a; --ink: #e9efff; --ink-2: #a8b6da; --line: #1c3672; --accent-ink: #9fbcff;
  --ok-bg: #0f3a26; --ok-ink: #a8e8c2; --err-bg: #4a1414; --err-ink: #ffc9c9; --danger: #ff8a80; color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: clamp(26px, 4vw, 34px); }
p { margin: 0 0 12px; }
a { color: var(--accent-ink); }
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.topbar { background: var(--navy); color: #fff; border-bottom: 4px solid var(--gold); }
.topbar-in { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { width: 32px; height: auto; display: block; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.brand > span { display: flex; flex-direction: column; }
.brand-school { font: 700 11px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.brand-sub { font: 600 15px var(--font-head); }
.spacer { flex: 1; }
.tlink { color: #fff; text-decoration: none; font: 600 15px var(--font-body); background: none; border: 0; padding: 6px 4px; cursor: pointer; }
.tlink:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
/* Student view (view-as.php): professors see the portal as a student */
.viewas-bar { background: var(--gold); color: #1a1a1a; }
.viewas-in { max-width: 1120px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: 15px; }
form.inline { display: inline; margin: 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 16px 56px; flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card.narrow { max-width: 480px; margin: 12px auto; }
.lede { color: var(--ink-2); }
.aside { color: var(--ink-2); font-size: 15px; margin: 18px 0 0; }
.muted { color: var(--ink-2); font-size: 15px; }
.eyebrow { font: 700 12px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.page-title { margin-bottom: 6px; }
.section-title { font-size: 20px; margin: 32px 0 12px; }
.card .section-title { margin-top: 24px; }

.form { display: grid; gap: 14px; margin-top: 8px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.form small, .opt { font-weight: 400; color: var(--ink-2); font-size: 14px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=datetime-local], .form input[type=file], .form select, .form textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent-ink); outline: 2px solid var(--gold); outline-offset: 0; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 400; grid-column: 1 / -1; }
.form-inline { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 16px var(--font-head); padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent-ink); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: #12388c; }
:root[data-theme="dark"] .btn-primary { background: var(--gold); color: #0b2a6b; border-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { background: var(--gold); color: #0b2a6b; border-color: var(--gold); } }
.btn-small { padding: 6px 12px; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 15px; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--danger); }

.msg { border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 16px; }
.msg ul { margin: 0; padding-left: 18px; }
.msg-error { background: var(--err-bg); color: var(--err-ink); }
.msg-ok { background: var(--ok-bg); color: var(--ok-ink); }

.badge { display: inline-block; font: 600 13px var(--font-body); padding: 2px 10px; border-radius: 999px; margin-right: 6px; }
.badge-open { background: var(--surface-2); color: var(--ink-2); }
.badge-ungraded { background: transparent; color: var(--ink-2); border: 1px dashed currentColor; padding: 1px 9px; }
.rules-table tr.is-ungraded .num-input { opacity: .55; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge-lock { background: var(--gold); color: #0b2a6b; }
.lock { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 2px; position: relative; margin-top: 4px; }
.lock::before { content: ""; position: absolute; left: 1px; top: -8px; width: 6px; height: 6px; border: 2px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; }

.course-list { display: grid; gap: 16px; }
.course-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.course-row h2 { font-size: 20px; margin: 0; }
.status { margin: 6px 0 0; }
.course-admin-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.course-admin-head h3 { font-size: 20px; margin: 0; }
.remove-form { margin: 12px 0 0; }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }

table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 10px; }
.card, details.students { overflow-x: auto; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font: 600 13px var(--font-head); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
td form { margin: 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; word-break: break-word; }

footer { border-top: 1px solid var(--line); }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 18px 16px 24px; color: var(--ink-2); font-size: 15px; }

/* ---------- activities ---------- */
.card.wide { max-width: 760px; }
.crumbs { font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.instructions { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.form textarea { resize: vertical; font: inherit; }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.note-cell { max-width: 280px; word-break: break-word; }
.badge-late { background: #ffe8c2; color: #7a4a00; }
.badge-missing { background: var(--err-bg); color: var(--err-ink); }
.act-line { margin: 0 0 8px; }

/* ---------- study pet ---------- */
.pet-hero { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 24px; align-items: center; }
@media (max-width: 680px) { .pet-hero { grid-template-columns: 1fr; text-align: center; } .pet-hero .eyebrow { justify-content: center; } }
.pet-stage { display: grid; place-items: center; border-radius: 16px; padding: 12px; background: radial-gradient(circle at 50% 60%, var(--surface-2), transparent 70%); }
.pet-stage svg { max-width: 100%; height: auto; }
.pet-stage-sick { filter: saturate(.7); }
.pet-speech { position: relative; background: var(--surface-2); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin: 10px 0 16px; text-align: left; }
.meters { display: grid; gap: 4px; }
.meter { margin-bottom: 10px; text-align: left; }
.meter-head { display: flex; justify-content: space-between; font-size: 15px; }
.meter-head span { color: var(--ink-2); }
.meter-bar { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin: 4px 0 2px; }
.meter-bar i { display: block; height: 100%; border-radius: 6px; transition: width .4s; }
.meter-energy i { background: #2fb67c; }
.meter-happy i { background: var(--gold); }
.meter-xp i { background: #8b6cff; }
.meter small { color: var(--ink-2); font-size: 13.5px; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 16px; }
.pet-grid .section-title { margin-top: 0; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 140px; align-items: end; margin: 12px 0; }
.week-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.week-bar i { display: block; width: 100%; max-width: 34px; background: #2fb67c; border-radius: 6px 6px 2px 2px; }
.week-val { font-size: 12px; color: var(--ink-2); }
.week-day { font-size: 13px; color: var(--ink-2); }
.events { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.events li { display: grid; gap: 1px; }
.care { padding-left: 18px; margin: 0 0 8px; display: grid; gap: 8px; }
.colors { display: flex; flex-wrap: wrap; gap: 12px; }
.form .swatch { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }
.swatch span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); }
.pet-mini { display: flex; gap: 16px; align-items: center; text-decoration: none; color: inherit; padding: 14px 20px; }
.pet-mini:hover { border-color: var(--gold); }
.pet-mini > span { display: grid; gap: 2px; }
.pet-mini-msg { font-weight: 600; }
.pet-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.badge-mood-happy { background: var(--ok-bg); color: var(--ok-ink); }
.badge-mood-okay, .badge-mood-egg { background: var(--surface-2); color: var(--ink-2); }
.badge-mood-sad { background: #ffe8c2; color: #7a4a00; }
.badge-mood-sick { background: var(--err-bg); color: var(--err-ink); }

/* pet animation */
.pet-happy .pet-body { animation: petBounce 1.6s ease-in-out infinite; transform-origin: 60px 106px; transform-box: view-box; }
.pet-sad .pet-body, .pet-sick .pet-body { animation: petSway 3.2s ease-in-out infinite; transform-origin: 60px 106px; transform-box: view-box; }
.pet-egg .pet-body { animation: petWobble 2.4s ease-in-out infinite; transform-origin: 60px 104px; transform-box: view-box; }
.pet-sparkle { animation: petTwinkle 1.4s ease-in-out infinite; transform-origin: 100px 47px; transform-box: view-box; }
@keyframes petBounce { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes petSway { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes petWobble { 0%, 70%, 100% { rotate: 0deg; } 78% { rotate: -6deg; } 86% { rotate: 6deg; } 94% { rotate: -3deg; } }
@keyframes petTwinkle { 0%, 100% { opacity: .2; scale: .7; } 50% { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .pet-svg * { animation: none !important; } }

/* ---------- landing page (home.php) ---------- */
/* Shared bits used by the top bar and forms. */
.tbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; cursor: pointer; }
.tbtn:hover { background: rgba(255,255,255,.1); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn-block { width: 100%; }
.land-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-left: 4px solid var(--gold); border-radius: 8px; padding: 10px 12px; font-size: 15px; margin: 0 0 14px; }
.land-note .lock { flex: none; margin-top: 8px; color: var(--accent-ink); }

/* Password field with Show/Hide. */
.form .field { display: grid; gap: 4px; }
.form .field > label { font-weight: 600; font-size: 15px; }
.pw-field { position: relative; }
.form .pw-field input { padding-right: 70px; }
.pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); background: none; border: 0; border-radius: 6px; padding: 6px 10px; font: 600 14px var(--font-body); color: var(--accent-ink); cursor: pointer; }
.pw-toggle:hover { background: var(--surface-2); }
.form .caps { color: #7a4a00; font-weight: 600; }
.caps[hidden] { display: none; }
:root[data-theme="dark"] .form .caps { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form .caps { color: var(--gold); } }

/* Split screen: navy and gold panel | sign-in panel. */
body.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); min-height: 100vh; min-height: 100dvh; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--gold); color: #0b2a6b; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }

.auth-visual { position: relative; overflow: hidden; color: #fff; background: #0b2a6b;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px clamp(24px, 5vw, 64px); }
/* Navy and gold artwork in place of a photo: two soft glows and fine diagonal lines. */
.auth-art { position: absolute; inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(251,209,23,.42) 0, rgba(251,209,23,0) 34%),
    radial-gradient(circle at 12% 62%, rgba(58,98,214,.75) 0, rgba(58,98,214,0) 48%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 2px, transparent 2px 26px),
    #0b2a6b; }
.auth-visual::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(6,16,43,.6) 0%, rgba(6,16,43,0) 22%, rgba(6,16,43,0) 38%, rgba(6,16,43,.75) 68%, rgba(6,16,43,.97) 100%); }
.auth-visual::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--gold); z-index: 2; }
.auth-visual > :not(.auth-art) { position: relative; z-index: 2; }
.auth-pitch { margin-top: auto; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 44px; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.auth-brand > span { display: flex; flex-direction: column; line-height: 1.15; }
.auth-school { font: 600 14px var(--font-head); letter-spacing: .04em; }
.auth-campus { font: 800 20px var(--font-head); color: var(--gold); letter-spacing: .02em; }
.auth-pitch { max-width: 560px; }
.auth-kicker { display: inline-block; background: var(--gold); color: #0b2a6b; font: 700 12px var(--font-head); letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; }
.auth-title { font: 800 clamp(38px, 5.2vw, 64px)/1.05 var(--font-head); letter-spacing: -.015em; margin: 14px 0 12px; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.auth-lede { color: #d6e0f7; font-size: 18px; margin: 0 0 18px; max-width: 480px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-points li { font-size: 14.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(4px); }
.auth-caption { margin: 0; font-size: 13px; color: #b9c7ea; letter-spacing: .02em; }

.auth-panel { background: var(--surface); display: flex; flex-direction: column; padding: 28px clamp(24px, 4vw, 56px) 24px; min-width: 0; }
.auth-panel-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.auth-mini-logo { display: none; }
.auth-theme { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; }
.auth-theme:hover { color: var(--ink); border-color: var(--accent-ink); }
.auth-box { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }
.auth-h1 { font-size: clamp(28px, 3.2vw, 34px); margin: 0 0 4px; }
.auth-sub { color: var(--ink-2); margin: 0 0 22px; }
.auth-form { gap: 16px; margin: 0; }
.auth-form input[type=email], .auth-form input[type=password], .auth-form input[type=text] { padding: 12px 14px; }
.auth-form .btn-primary { margin-top: 6px; padding: 12px 18px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; color: var(--ink-2); font-size: 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-help { color: var(--ink-2); font-size: 14.5px; margin: 16px 0 0; text-align: center; }
.auth-forgot { justify-self: end; font-size: 14.5px; font-weight: 600; color: var(--accent-ink); }
.auth-steps { margin: 0 0 22px; padding-left: 22px; display: grid; gap: 8px; color: var(--ink-2); }
.auth-steps b { color: var(--ink); }
.auth-foot { color: var(--ink-2); font-size: 13px; text-align: center; margin: 0; }

@media (max-width: 900px) {
  body.auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-visual { min-height: 260px; padding: 20px 16px 26px; gap: 18px; }
  .auth-visual::before { background: linear-gradient(180deg, rgba(6,16,43,.55) 0%, rgba(6,16,43,.35) 40%, rgba(6,16,43,.92) 100%); }
  .auth-title { font-size: clamp(32px, 9vw, 44px); margin: 10px 0 6px; }
  .auth-lede { font-size: 16px; margin: 0; }
  .auth-points, .auth-caption { display: none; }
  .auth-panel { padding: 16px 16px 20px; }
  .auth-panel-top { position: absolute; top: 16px; right: 16px; }
  .auth-theme { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(6,16,43,.35); }
  .auth-box { margin: 0 auto; padding: 24px 0 32px; }
  .auth-foot { margin-top: auto; }
}

/* Small screens: brand on its own row, links on the next (portal top bar). */
@media (max-width: 600px) {
  .topbar-in .spacer { flex-basis: 100%; height: 0; }
  .topbar-in { gap: 4px 14px; }
  .tlink { font-size: 14.5px; }
  .topbar-in .tbtn { margin-left: auto; width: 34px; height: 34px; }
}

/* ---------- professor dashboard: course cards ---------- */
.pcourse { display: grid; gap: 12px; }
.pcourse-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; }
.pcourse-head h3 { font-size: 21px; margin: 0; }
.pcourse-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 15px; }
.pcourse-facts .badge { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.pcourse-tools { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.pcourse-tools .tool { margin: 0; }
.pcourse-tools .tool[open] { flex-basis: 100%; order: 2; }
.tool > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--font-head); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 14px; }
.tool > summary::-webkit-details-marker { display: none; }
.tool > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.tool[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.tool > summary:hover, .tool[open] > summary { border-color: var(--accent-ink); }
.tool-body { margin-top: 10px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.tool-body > .muted { margin: 0 0 4px; }
.tool-body .msg { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .tool > summary::after { transition: none; } }
.tool-body .form input { background: var(--surface); }

/* ---------- activity requirements and grades */
.badge-wait { background: #fff4c2; color: #6b4e00; }
:root[data-theme="dark"] .badge-late, :root[data-theme="dark"] .badge-wait, :root[data-theme="dark"] .badge-mood-sad { background: #3d3203; color: #fde68a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-late, :root:not([data-theme="light"]) .badge-wait, :root:not([data-theme="light"]) .badge-mood-sad { background: #3d3203; color: #fde68a; } }
.score { font-family: var(--font-head); }
.req-box { border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 12px 0; }
.req-box p { margin: 0 0 4px; }
.req-box p:last-child { margin: 0; }
.req-grade, .req-submit { border-color: var(--gold); }
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.rules-table, .grade-table, .req-table { min-width: 640px; }
.rules-table select, .grade-table textarea, .score-input, .num-input {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.rules-table select:focus, .grade-table textarea:focus, .score-input:focus, .num-input:focus { border-color: var(--accent-ink); outline: 2px solid var(--gold); outline-offset: 0; }
.num-input, .score-input { width: 88px; }
.grade-table textarea { width: 100%; min-width: 180px; resize: vertical; }
.grade-table td { vertical-align: top; }
.rules-table .group-row th { background: var(--surface-2); color: var(--ink); font: 700 13px var(--font-head); letter-spacing: .06em; text-transform: uppercase; padding-top: 14px; }
.rules-form .btn, .grade-form .btn { margin-top: 14px; }
.bulk-form { align-items: end; padding: 10px 0; border-top: 1px solid var(--line); }
.bulk-label { align-self: center; }
.post-activity { margin: 22px 0; }
.post-activity summary { cursor: pointer; }
.ai-use { border: 1px solid var(--line) !important; border-radius: 12px; padding: 12px 14px !important; display: grid; gap: 8px; }
.ai-use legend { padding: 0 6px; }
.ai-use p { margin: 0; font-size: 14.5px; }
.ai-details summary { cursor: pointer; color: var(--accent-ink); }
.req-table .row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.form input[type=number] { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.form input[type=number]:focus { border-color: var(--accent-ink); outline: 2px solid var(--gold); outline-offset: 0; }

/* ---------- professor dashboard: cards */
.stat-cards { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.stat-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; border-left: 5px solid var(--navy); }
.stat-card a { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.stat-num { font: 700 32px/1.1 var(--font-head); }
.stat-label { color: var(--ink-2); font-size: 15px; }
.stat-alert { border-left-color: var(--gold); }
.stat-alert .stat-num { color: #8a5a00; }
:root[data-theme="dark"] .stat-card { border-left-color: var(--accent-ink); }
:root[data-theme="dark"] .stat-alert { border-left-color: var(--gold); }
:root[data-theme="dark"] .stat-alert .stat-num { color: var(--gold); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stat-card { border-left-color: var(--accent-ink); }
  :root:not([data-theme="light"]) .stat-alert { border-left-color: var(--gold); }
  :root:not([data-theme="light"]) .stat-alert .stat-num { color: var(--gold); }
}

.pcourse-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.pcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.pcard-cover { position: relative; display: block; aspect-ratio: 5 / 2; overflow: hidden; background: linear-gradient(135deg, #0b2a6b, #1d3e99); }
.pcard-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-lock { position: absolute; top: 12px; left: 12px; }
.pcard-lock .badge { margin: 0; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.pcard-lock .badge-open { background: #fff; color: #0b2a6b; }
.pcard-body { padding: 18px 20px 20px; display: grid; gap: 14px; }
.pcard-body h3 { font-size: 22px; margin: 0; }
.pcard-body h3 a { color: inherit; text-decoration: none; }
.pcard-body h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.pcard-body .eyebrow { margin-bottom: 2px; }
.pcard-note { font-size: 14px; margin: 4px 0 0; }
.mini-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini-stats li { background: var(--surface-2); border-radius: 12px; padding: 10px 8px; text-align: center; min-width: 0; }
.mini-stats li > a { display: block; color: inherit; text-decoration: none; }
.mini-stats b { display: block; font: 700 22px/1.2 var(--font-head); }
.mini-stats span { display: block; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.mini-stats .is-alert { background: var(--gold); }
.mini-stats .is-alert b, .mini-stats .is-alert span { color: #0b2a6b; }
@media (max-width: 420px) { .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pcard-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pcard .pcourse-tools { padding-top: 14px; }

.person-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.person form { margin-left: auto; }
.person-text { display: flex; flex-direction: column; min-width: 0; font-size: 15px; }
.person-text .muted { font-size: 14px; overflow-wrap: anywhere; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; font: 700 14px var(--font-head); }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }
.avatar-add { background: var(--gold); color: #0b2a6b; font-size: 26px; }
:root[data-theme="dark"] .avatar:not(.avatar-add) { background: var(--accent-ink); color: #06102b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar:not(.avatar-add) { background: var(--accent-ink); color: #06102b; } }

.prof-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.prof-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; }
.prof-card .badge { margin: 0 0 0 4px; font-size: 12px; }
.prof-delete { margin-left: auto; }
.add-card { display: block; border-style: dashed; }
.add-card[open] { grid-column: 1 / -1; }
.add-card > summary { list-style: none; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.add-card > summary::-webkit-details-marker { display: none; }
.add-card .form { margin-top: 14px; max-width: 520px; }

/* Open and close weeks (weeks.php) */
.weeks-bulk { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.weeks-table { min-width: 560px; }
.weeks-table td { vertical-align: middle; }
.weeks-table .week-closed td { background: var(--surface-2); }
.week-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.week-switch input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-ink); cursor: pointer; }
.weeks-order .check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; max-width: 70ch; }
.weeks-order .check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent-ink); cursor: pointer; }
.weeks-order p { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 0 30px; }

/* ---------- student progress (class-progress.php) ---------- */
.pbar { display: inline-block; vertical-align: middle; width: 96px; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent-ink); border-radius: 4px; }
.stat-card .pbar { width: 100%; margin-top: 8px; }
.pbar-num { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.prog-table { min-width: 640px; }
.prog-table .group-row th { background: var(--surface-2); color: var(--ink); font: 700 13px var(--font-head); letter-spacing: .06em; text-transform: uppercase; padding-top: 14px; }
.prog-table td.num { font-variant-numeric: tabular-nums; }
.prog-table td.nowrap, .prog-table .nowrap { white-space: nowrap; }
.prog-table .badge { white-space: nowrap; }
.prog-table td:nth-child(3) { white-space: nowrap; }
.act-table { min-width: 900px; }
.act-table td:first-child { min-width: 220px; }
.act-table td:nth-child(2) { min-width: 150px; }
.students-table { min-width: 980px; }
.students-table td:first-child { white-space: nowrap; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover, .sort-link.is-on { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.sort-link.is-on::after { content: " ▲"; font-size: 10px; }
th[aria-sort="descending"] .sort-link.is-on::after { content: " ▼"; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; }
.chip:hover { border-color: var(--accent-ink); }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.prog-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-top: 16px; }
.prog-split .section-title { margin-top: 0; }
.week-bars-14 { grid-template-columns: repeat(14, 1fr); gap: 4px; }
.week-chips { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.week-chip { display: grid; padding: 6px 12px; border-radius: 10px; font-size: 14px; line-height: 1.3; border: 1px solid var(--line); }
.week-chip span { color: var(--ink-2); font-size: 13px; }
.week-chip.is-open { background: var(--ok-bg); border-color: transparent; }
.week-chip.is-open span { color: var(--ok-ink); }
.week-chip.is-closed { background: var(--surface-2); }

/* The student × activity grid: one small square per cell, a glyph in each (never color alone). */
.grid-card { padding: 16px; }
.grid-table { width: auto; margin: 0; font-size: 13px; border-collapse: separate; border-spacing: 0; }
.grid-table th, .grid-table td { padding: 2px; border-bottom: 0; text-align: center; }
.grid-table .gname { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 2px 12px 2px 0; white-space: nowrap; font: 600 14px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--ink); }
.grid-table .gname a { color: inherit; text-decoration: none; }
.grid-table .gname a:hover { text-decoration: underline; }
.grid-table .gweek { font-size: 12px; color: var(--ink); border-bottom: 1px solid var(--line); padding: 4px 2px; white-space: nowrap; }
.grid-table .gcol { font: 600 11px var(--font-body); letter-spacing: 0; text-transform: none; white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 0; height: 52px; }
.grid-table .gfirst { padding-left: 10px; }
.gcell { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; font: 700 13px/1 var(--font-body); text-decoration: none; color: var(--ink-2); background: var(--surface-2); }
a.gcell:hover, a.gcell:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.gcell.s-done { background: var(--ok-bg); color: var(--ok-ink); }
.gcell.s-late { background: #ffe8c2; color: #7a4a00; }
.gcell.s-waiting { background: #fff4c2; color: #6b4e00; }
.gcell.s-failed, .gcell.s-missing { background: var(--err-bg); color: var(--err-ink); }
.gcell.s-open { background: var(--surface-2); color: var(--ink); }
.gcell.s-optional { background: transparent; border: 1px solid var(--line); }
.gcell.s-locked { background: transparent; border: 1px dashed var(--line); }
:root[data-theme="dark"] .gcell.s-late, :root[data-theme="dark"] .gcell.s-waiting { background: #3d3203; color: #fde68a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gcell.s-late, :root:not([data-theme="light"]) .gcell.s-waiting { background: #3d3203; color: #fde68a; } }
.grid-legend { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); }
.grid-legend li { display: inline-flex; align-items: center; gap: 6px; }
@media print { .topbar, footer, .filter-row { display: none; } .card { border: 0; padding: 0; } }

/* ---------- sections (sections.php) ---------- */
.section-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); margin-top: 18px; }
.section-card { display: flex; flex-direction: column; gap: 14px; }
.section-card h2 { font-size: 24px; margin: 0; }
.section-card .muted { margin: 4px 0 0; }
.section-card .tool { margin: 0; border-top: 1px solid var(--line); padding-top: 10px; }
.section-card .tool-body { margin-top: 10px; }
.mini-stats.mini-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-tools { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-top: 16px; }
.section-tools .section-title { margin-top: 0; }
.section-tools .form .btn { justify-self: start; }
.roster-table { min-width: 420px; font-size: 14px; }
.roster-table .badge { white-space: nowrap; margin: 0; }
.section-select { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.section-select:focus { border-color: var(--accent-ink); outline: 2px solid var(--gold); outline-offset: 0; }
form.card > .btn { margin-top: 14px; }
.section-chips { margin: 0 0 16px; }

/* ---------- lab monitor (lab.php, lab.js) ---------- */
.lab { --ph-prep: #64748b; --ph-dis: #c2410c; --ph-asm: #1d48ad; --ph-post: #15803d; --ph-clean: #b88a00; --warn: #9a5b00; }
:root[data-theme="dark"] .lab { --ph-prep: #94a3b8; --ph-dis: #fb923c; --ph-asm: #7ea2ff; --ph-post: #4ade80; --ph-clean: #fbd117; --warn: #ffc46b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lab { --ph-prep: #94a3b8; --ph-dis: #fb923c; --ph-asm: #7ea2ff; --ph-post: #4ade80; --ph-clean: #fbd117; --warn: #ffc46b; } }
.lab .ph-prep { background: var(--ph-prep); } .lab .ph-dis { background: var(--ph-dis); } .lab .ph-asm { background: var(--ph-asm); }
.lab .ph-post { background: var(--ph-post); } .lab .ph-clean { background: var(--ph-clean); }
.lab-sections { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.lab-sections a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 15px; }
.lab-sections a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }
.lab-tally { display: flex; flex-wrap: wrap; gap: 12px 28px; background: var(--navy); color: #c9d4f2; border-radius: 12px; padding: 14px 20px; margin-bottom: 14px; }
.lab-tally b { display: block; font: 600 30px/1.1 var(--font-head); color: var(--gold); white-space: nowrap; }
.lab-tally .is-alert b { color: #ff9b91; }
.lab-tally span { font-size: 14px; }
.lab-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lab-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-2); }
.lab-legend i, .lab-grp h3 i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.lab-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lab-status { font-size: 14px; color: var(--ink-2); }
.lab-status:empty { display: none; }
.lab-status.is-bad { color: var(--danger); font-weight: 600; }
.lab-copybox { width: 100%; margin-bottom: 12px; font: 13px/1.4 ui-monospace, Consolas, monospace; }
.lab-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.lab-tile { display: flex; flex-direction: column; gap: 5px; text-align: left; font: inherit; color: var(--ink); border: 2px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.lab-tile:hover { border-color: var(--ink-2); }
.lab-tile.is-on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.lab-tile.is-flag { border-color: var(--danger); }
.lab-th { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; min-width: 0; }
.lab-tn { font: 600 15px/1.3 var(--font-head); overflow-wrap: anywhere; }
.lab-pill { font-size: 12px; font-weight: 700; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.lab-pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.lab-pill.bad { background: var(--err-bg); color: var(--err-ink); }
.lab-segs { display: grid; gap: 2px; height: 12px; }
.lab-segs i { background: var(--line); border-radius: 1px; }
.lab-tx { font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.lab-tx b { color: var(--ink); font-weight: 600; }
.lab-idle { color: var(--warn); font-weight: 600; }
.lab-flag { color: var(--danger); font-weight: 700; font-size: 13px; }
.lab-panel { margin-top: 28px; border-top: 3px solid var(--navy); padding-top: 16px; scroll-margin-top: 12px; }
:root[data-theme="dark"] .lab-panel { border-top-color: var(--gold); }
.lab-ph h2 { margin: 0; font-size: 24px; flex: 1; min-width: 0; }
.lab-nav { display: flex; gap: 10px; align-items: center; }
.lab-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px 36px; margin-top: 12px; }
.lab-grp h3 { font-size: 16px; margin: 18px 0 4px; }
.lab-grp:first-child h3 { margin-top: 0; }
.lab-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 0 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; font-size: 16px; line-height: 1.4; }
.lab-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--navy); cursor: pointer; }
:root[data-theme="dark"] .lab-row input { accent-color: var(--gold); }
.lab-row time { font-size: 13px; color: var(--ink-2); white-space: nowrap; padding-top: 2px; }
.lab-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.lab-card h3 { font-size: 17px; margin-bottom: 2px; }
.lab-card > .muted { font-size: 14px; margin: 0 0 6px; }
.lab-q { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.35; }
.lab-seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.lab-seg button { border: 0; background: none; padding: 0 10px; min-width: 40px; height: 36px; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink-2); }
.lab-seg button + button { border-left: 1px solid var(--line); }
.lab-seg button.y { background: var(--ok-bg); color: var(--ok-ink); font-weight: 700; }
.lab-seg button.x { background: var(--err-bg); color: var(--err-ink); font-weight: 700; }
.lab-seg button.s { background: var(--navy); color: #fff; font-weight: 700; }
.lab-result { margin: 10px 0 0; font: 600 16px var(--font-head); }
.lab-result.ok { color: var(--ok-ink); } .lab-result.bad { color: var(--danger); }
.lab-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.lab-photos .lab-row { grid-template-columns: 26px 1fr; font-size: 15px; }
.lab-card textarea { width: 100%; min-height: 80px; font: 16px/1.4 var(--font-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.btn-danger-ghost { color: var(--danger); background: transparent; }
.btn-danger-ghost.is-armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.lab-note { font-size: 14px; margin-top: 24px; }
@media (max-width: 760px) { .lab-cols { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .lab-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lab-photos { grid-template-columns: 1fr; } .lab-tally { gap: 10px 20px; } .lab-tally b { font-size: 24px; } }

/* OpenLearning pages (openlearning.php) */
.ol-checks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.ol-checks li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ol-checks .muted { flex-basis: 100%; margin-left: 0; }
.msg-inline-error { flex-basis: 100%; color: var(--err-ink); background: var(--err-bg); border-radius: 6px; padding: 6px 10px; }
.ol-link-form select { max-width: 100%; }
.ol-howto ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-width: 80ch; }
.ol-table td { vertical-align: top; }
.ol-table td:first-child { width: 36px; }
.ol-table input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent-ink); cursor: pointer; }
.ol-table .row-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.ol-preview { margin-top: 6px; }
.ol-preview summary { cursor: pointer; color: var(--accent-ink); font-size: 14px; }
.ol-preview-body { margin-top: 8px; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); max-width: 70ch; font-size: 15px; }
.ol-preview-body h3 { font-size: 16px; margin: 12px 0 4px; }
.ol-preview-body ul { margin: 0; padding-left: 20px; }
.ol-preview-title { font: 600 18px var(--font-head); margin: 0 0 6px; }

/* Student passwords (resets.php). */
.reset-made { border-left: 5px solid var(--gold); margin-bottom: 8px; }
.reset-made h2 { margin: 0 0 6px; font-size: 20px; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.copy-row input { flex: 1 1 320px; min-width: 0; font: 15px ui-monospace, Consolas, monospace; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.reset-search { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-top: 0; }
@media (max-width: 560px) { .reset-search { grid-template-columns: 1fr; } }
.reset-mail-off { background: #fff4c2; color: #6b4e00; }
:root[data-theme="dark"] .reset-mail-off { background: #3a3000; color: #ffe08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .reset-mail-off { background: #3a3000; color: #ffe08a; } }

/* ---------- grades: where the work was done ---------- */
.where-input { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%; min-width: 170px; }
.where-input:focus { border-color: var(--accent-ink); outline: 2px solid var(--gold); outline-offset: 0; }
.where-fill { margin: 8px 0 12px; max-width: 640px; }
.where-fill input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; }

/* ---------- attendance ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.att-counts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.att-table { min-width: 640px; }
.att-choice { border: 0; padding: 0; margin: 0; display: inline-flex; flex-wrap: wrap; gap: 4px; }
.att-opt { position: relative; cursor: pointer; }
.att-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.att-opt span { display: inline-block; font: 600 14px var(--font-body); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.att-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.att-opt:hover span { border-color: var(--accent-ink); }
.att-present input:checked + span { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }
.att-late input:checked + span { background: #ffe8c2; color: #7a4a00; border-color: #7a4a00; }
.att-absent input:checked + span { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-ink); }
.att-excused input:checked + span, .att-none input:checked + span { background: var(--surface-2); color: var(--ink); border-color: var(--ink-2); }
:root[data-theme="dark"] .att-late input:checked + span { background: #3d3203; color: #fde68a; border-color: #fde68a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .att-late input:checked + span { background: #3d3203; color: #fde68a; border-color: #fde68a; } }
.att-notjoined { margin-top: 16px; }
.pbar-alert i { background: var(--danger); }
