/* Hintivo.ai, the classic design: navy bar, blue accent, lime highlight, rounded cards — how the portal
   looked before the pen-and-paper design. It is one side of the A/B test, and it is also the layout the
   pen-and-paper design (style.css) imports and restyles, so every layout rule lives here once.
   student_server.py picks which stylesheet a page links (SEED_ED_STUDENT_DESIGN, or ?design=classic). */
:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #182638;
  background: #f5f7fa;
  --ink: #182638;
  --accent: #184dce;
  --accent-hover: #133da8;
  --muted: #536279;
  --border: #dce4ee;
  --soft: #eef3ff;
  --red: #c42341;
  --lime: #e6fa9b;
  --navy: #132238;
  --shadow: 0 3px 12px #172a4810;
  --shadow-lift: 0 10px 28px #172a4822;
}
/* Course colors: --c for accents, --c-deep behind white text (4.5:1 or better), --c-soft for tints. */
.c-blue   { --c: #2f6fed; --c-deep: #1f55d0; --c-soft: #eaf1ff; }
.c-teal   { --c: #12a596; --c-deep: #0b6e66; --c-soft: #e3f6f3; }
.c-green  { --c: #3fa556; --c-deep: #23763a; --c-soft: #e8f6eb; }
.c-amber  { --c: #e8a90c; --c-deep: #8a5c00; --c-soft: #fdf4da; }
.c-orange { --c: #f07436; --c-deep: #b8481a; --c-soft: #fdeee5; }
.c-rose   { --c: #e2557f; --c-deep: #b02d58; --c-soft: #fcebf1; }
.c-violet { --c: #8466ea; --c-deep: #5b3cc4; --c-soft: #f0ecfd; }
.c-slate  { --c: #64758f; --c-deep: #3a4a62; --c-soft: #edf0f5; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f5f7fa; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #7195ff; outline-offset: 3px; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.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; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9em; background: #e9eef5; padding: 1px 5px; border-radius: 5px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: #fff; color: var(--accent); padding: 10px 14px; border-radius: 9px; font-weight: 650; }
.skip:focus { top: 12px; }

/* -- top bar -- */
.top { background: var(--navy); color: #fff; }
.top-inner, main { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.top-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.22rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; color: #fff; text-decoration: none; }
.brand-logo { display: block; height: 38px; width: auto; }    /* the server serves the light-coloured logo (hintivo-logo-navy.png) for this design */
.brand-tag { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--navy); background: var(--lime); border-radius: 99px; padding: 3px 9px; }
.top-add { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 8px 15px; border-radius: 99px; border: 0; background: var(--lime); color: var(--navy); font-weight: 700; font-size: .92rem; white-space: nowrap; box-shadow: 0 2px 8px #e6fa9b33; }
.top-add:hover { background: #f1ffc2; }
.top-add svg { width: 18px; height: 18px; stroke-width: 2.4; }
.account { display: flex; align-items: center; min-width: 0; }
/* The name opens the account menu: Settings, and Log out unless login is off. */
.account-button { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 9px 5px 5px; border: 1px solid transparent; border-radius: 99px; background: transparent; color: #d9e5f5; }
.account-button:hover, .account-button[aria-expanded="true"] { background: #20324a; border-color: #ffffff2e; }
.account-avatar { width: 32px; height: 32px; border-radius: 50%; background: #2f4a70; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .88rem; flex: none; }
.account-name { max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.account-button .chev { margin: 0; color: #9fb3cd; flex: none; }

main { padding: 34px 0 64px; outline: none; }
.loading { color: var(--muted); padding: 40px 0; }
.notice { max-width: 620px; padding: 30px 0; }
.notice h1 { font-size: 2rem; letter-spacing: -.04em; margin: 0 0 10px; }
.notice p { color: var(--muted); line-height: 1.55; margin: 0 0 20px; }

/* -- buttons -- */
.primary, .secondary, .danger { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 10px; font-weight: 675; text-decoration: none; white-space: nowrap; }
.primary { color: #fff; background: var(--accent); border: 1px solid transparent; box-shadow: 0 2px 6px #184dce33; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.secondary { border: 1px solid #b6c6e2; background: #fff; color: #1d3f8f; }
.secondary:hover:not(:disabled) { background: var(--soft); border-color: #6081dc; }
.danger { color: #fff; background: var(--red); border: 1px solid transparent; }
.danger:hover:not(:disabled) { background: #a51a34; }
.primary:disabled, .secondary:disabled, .danger:disabled { opacity: .6; }
.wide { width: 100%; }
.subtle { background: transparent; border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; font-size: .88rem; font-weight: 650; color: #2b3e5c; white-space: nowrap; }
.subtle:hover:not(:disabled) { background: #f0f4f9; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.danger-link { background: none; border: 0; padding: 8px 4px; color: var(--red); font-weight: 650; font-size: .88rem; }
.danger-link:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: #4a5b74; flex: none; }
.icon-btn:hover { background: #eef2f7; color: var(--ink); }
.icon-btn.danger:hover { background: #fdecef; color: var(--red); }

/* -- shared bits -- */
.section-label { color: #214eb5; font-size: .8rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; }
h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.08; font-weight: 760; letter-spacing: -.05em; margin: 0 0 10px; outline: none; }
.lead { margin: 0; color: var(--muted); line-height: 1.55; max-width: 62ch; font-size: 1.04rem; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.panel-title { display: flex; align-items: center; gap: 10px; }
.panel-title svg { color: #37537a; }
.panel-title h2 { font-size: 1.1rem; margin: 0; letter-spacing: -.02em; }
.count { min-width: 26px; padding: 2px 8px; border-radius: 99px; background: #eef2f7; color: #43536a; font-size: .8rem; font-weight: 700; text-align: center; }
.count:empty { display: none; }

/* -- home -- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.steps { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px; }
.steps strong { display: block; font-size: .96rem; margin-bottom: 3px; }
.steps small { display: block; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.step-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); font-weight: 750; font-size: .9rem; }
.step-dot svg { display: none; width: 17px; height: 17px; stroke-width: 2.4; }
.step-done { border-color: #bfe3c8 !important; background: #f4fbf5 !important; }
.step-done .step-dot { background: #2f9a4a; color: #fff; }
.step-done .step-dot svg { display: block; }
.step-done .step-n { display: none; }
.step-done strong { text-decoration: line-through; text-decoration-color: #2f9a4a88; }
.step-test .step-dot { background: #f1ecfd; color: #5b3cc4; }

.group-title { font-size: 1.05rem; letter-spacing: -.01em; color: #2b3e5c; margin: 0 0 14px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.course-card { display: flex; flex-direction: column; min-height: 214px; background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; text-align: left; padding: 0; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #c8d3e2; }
.card-band { position: relative; height: 92px; background: var(--c-deep); overflow: hidden; display: flex; align-items: flex-end; padding: 14px 18px; }
.card-band::before, .card-band::after { content: ""; position: absolute; border-radius: 50%; background: var(--c); }
.card-band::before { width: 150px; height: 150px; right: -40px; top: -70px; opacity: .9; }
.card-band::after { width: 70px; height: 70px; right: 72px; top: 34px; opacity: .55; }
.card-code { position: relative; z-index: 1; color: #fff; font-size: 1.3rem; font-weight: 780; letter-spacing: -.02em; text-shadow: 0 1px 2px #0003; }
.card-initials { font-size: 1.55rem; letter-spacing: .02em; }
.card-body { display: flex; flex-direction: column; gap: 5px; padding: 15px 18px 16px; flex: 1; }
.card-name { font-weight: 700; font-size: 1.06rem; line-height: 1.3; letter-spacing: -.015em; }
.card-meta { color: var(--muted); font-size: .88rem; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 6px; color: #5a6a81; font-size: .84rem; flex-wrap: wrap; }
.card-foot svg { width: 16px; height: 16px; color: var(--c-deep); }
.card-dot { color: #a3afc0; }
.add-card { align-items: center; justify-content: center; gap: 10px; border: 2px dashed #c2cfe0; background: #fafcff; box-shadow: none; color: #2b4a8a; font-weight: 700; font-size: 1rem; cursor: pointer; }
.add-card:hover { border-color: var(--accent); background: var(--soft); }
.add-plus { width: 46px; height: 46px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; color: var(--accent); }
.add-card:hover .add-plus { background: #fff; }
.add-plus svg { width: 24px; height: 24px; stroke-width: 2.2; }
.add-text { margin-top: 2px; }
.add-sub { font-size: .8rem; font-weight: 550; color: #6b7a90; margin-top: -6px; }
.just-added { animation: glow 2.4s ease-out 1; }
@keyframes glow {
  0%, 30% { box-shadow: 0 0 0 4px #e6fa9b, 0 0 0 7px var(--c), var(--shadow-lift); transform: translateY(-3px); }
  100% { box-shadow: var(--shadow); transform: none; }
}

.quick-add { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.quick-add input { flex: 1; min-width: 0; min-height: 52px; padding: 12px 16px; border: 2px solid #c4cfdd; border-radius: 12px; font-size: 1.05rem; background: #fff; }
.quick-add input:focus { border-color: var(--accent); outline: 3px solid #7195ff40; outline-offset: 0; }
.quick-add .primary { min-height: 52px; padding-inline: 20px; border-radius: 12px; }
.empty-home .quick-preview { min-height: 1.5em; margin: 12px auto 4px; font-size: .92rem; color: #2f6a3f; }
.empty-home .quick-preview.error { color: var(--red); }
.quick-more { font-size: .88rem; }

.empty-home { text-align: center; padding: 46px 28px 42px; max-width: 640px; margin: 0 auto; }
.empty-home h2 { font-size: 1.5rem; letter-spacing: -.03em; margin: 18px 0 8px; }
.empty-home p { color: var(--muted); line-height: 1.55; margin: 0 auto 22px; max-width: 46ch; }
.books { display: flex; justify-content: center; align-items: flex-end; gap: 7px; height: 92px; }
.books i { display: block; width: 30px; border-radius: 6px 6px 3px 3px; background: var(--c); box-shadow: inset -6px 0 0 #0000001a; }
.books i:nth-child(1) { height: 78px; }
.books i:nth-child(2) { height: 64px; }
.books i:nth-child(3) { height: 86px; }
.books i:nth-child(4) { height: 58px; transform: rotate(14deg); transform-origin: bottom left; margin-left: 4px; }

.past { margin-top: 34px; }
.past summary { cursor: pointer; font-weight: 700; color: #2b3e5c; padding: 6px 0; width: fit-content; }
.past .course-grid { margin-top: 14px; }
.past .course-card { opacity: .82; }
.storage { display: flex; align-items: center; gap: 10px; margin: 36px 0 0; color: var(--muted); font-size: .88rem; }
.meter { width: 120px; height: 7px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* -- one course -- */
.back { display: inline-flex; align-items: center; gap: 6px; color: #2b4a8a; font-weight: 650; text-decoration: none; margin-bottom: 14px; font-size: .94rem; }
.back:hover { text-decoration: underline; }
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 30px 32px 28px; border-radius: 20px; background: var(--c-deep); color: #fff; box-shadow: var(--shadow); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: var(--c); pointer-events: none; }
.hero::before { width: 320px; height: 320px; right: -80px; top: -170px; opacity: .85; }
.hero::after { width: 130px; height: 130px; right: 220px; bottom: -70px; opacity: .45; }
.hero-text, .hero-edit { position: relative; z-index: 1; }
.hero-code { margin: 0 0 8px; font-weight: 700; font-size: .92rem; letter-spacing: .03em; opacity: .92; }
.hero h1 { color: #fff; margin: 0; }
.hero-meta { margin: 10px 0 0; opacity: .92; }
.hero-edit { display: inline-flex; align-items: center; gap: 7px; color: #fff; background: #ffffff22; border: 1px solid #ffffff55; border-radius: 10px; padding: 9px 14px; font-weight: 650; white-space: nowrap; }
.hero-edit:hover { background: #ffffff38; }
.finished-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: #fff8e6; border: 1px solid #f2dc9b; color: #5e4500; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; margin-top: 24px; }

.drop-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); margin-bottom: 8px; }
.drop-icon svg { width: 26px; height: 26px; }

.uploads { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.uploads:not(:empty) { margin-top: 14px; }
.upload { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #f6f8fb; font-size: .9rem; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar { height: 7px; border-radius: 99px; background: #dfe6f0; overflow: hidden; }
.bar i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s ease; }
.upload-state { color: var(--muted); font-size: .84rem; min-width: 52px; text-align: right; }
.upload.failed { grid-template-columns: minmax(0, 1fr) auto auto; background: #fdecef; }
.upload.failed .upload-state { color: #9b1c33; text-align: left; }


.file-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .03em; background: #eef2f7; color: #4a5b74; }
.k-pdf { background: #fdecef; color: #b3203c; }
.k-image { background: #e9f6ec; color: #23763a; }
.k-doc { background: #e8f0ff; color: #1f55d0; }
.k-slides { background: #fdeee5; color: #b8481a; }
.k-sheet { background: #e3f6f3; color: #0b6e66; }
.k-text, .k-code { background: #f0ecfd; color: #5b3cc4; }
.k-archive { background: #fdf4da; color: #8a5c00; }


/* Recent work: this course's practice tests and homework problems, under its files */
.recent { grid-column: 1; padding: 18px 20px 16px; margin-top: 2px; }
.recent-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.recent-head h2 { flex: 1; display: flex; align-items: center; gap: 9px; margin: 0; font-size: 1.05rem; letter-spacing: -.02em; }
.recent-head h2 svg { width: 19px; height: 19px; color: #5a6a81; }
.recent-count { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.recent-item { gap: 12px; border-color: var(--border); }
.recent-item:hover { border-color: #b6c6e2; background: #f9fbfe; }
.recent-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.recent-icon svg { width: 17px; height: 17px; }
.recent-icon.k-test { background: #f0ecfd; color: #5b3cc4; }
.recent-icon.k-help { background: #fdf2e2; color: #a9671b; }
.recent-more { margin: 12px 0 0; font-size: .86rem; }

/* Common mistakes: one box each, folded to its name; open, what went wrong and what to remember */
.mistakes { padding: 18px 20px 16px; }
.mistakes-open { font-size: .86rem; white-space: nowrap; }
.mistakes-intro { margin: -4px 0 12px; color: var(--muted); font-size: .88rem; line-height: 1.5; max-width: 76ch; }
.mistake-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.mistake { border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.mistake summary { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; cursor: pointer; list-style: none; }
.mistake summary::-webkit-details-marker { display: none; }
.mistake summary:hover { background: #f9fbfe; }
.mistake summary:focus-visible { outline: 3px solid #9cb7f0; outline-offset: 1px; }
.mistake[open] { border-color: #e4dcfb; }
.mistake[open] summary { border-radius: 11px 11px 0 0; }
.mistake-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #fff3d6; color: #8a5c00; }
.mistake.is-repeated .mistake-mark { background: #fcebf1; color: #b02d58; }
.mistake-mark svg { width: 17px; height: 17px; }
.mistake-head { flex: 1; min-width: 0; display: grid; gap: 1px; }
.mistake-title { font-weight: 650; color: var(--ink); line-height: 1.4; }
.mistake-title p, .mistake-where .md, .mistake-where .md p { display: inline; margin: 0; }
.mistake-meta { font-size: .8rem; color: var(--muted); }
.mistake-count { flex: none; padding: 3px 10px; border-radius: 99px; background: #fcebf1; color: #9b1c48; font-weight: 750; font-size: .82rem; }
.mistake-chev { flex: none; display: grid; color: #7a889c; transition: transform .15s ease; }
.mistake-chev svg { width: 18px; height: 18px; }
.mistake[open] .mistake-chev { transform: rotate(180deg); }
.mistake-body { display: grid; gap: 10px; padding: 4px 16px 15px 56px; font-size: .93rem; color: #2b3e5c; }
.mistake-remember { padding: 10px 14px; border-radius: 10px; background: #f4fbdc; border: 1px solid #dcef9a; }
.mistake-label { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #4d6a00; }
.mistake-label svg { width: 14px; height: 14px; }
.mistake-where, .mistake-seen { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.5; }
.mistake-where { display: flex; gap: 7px; align-items: baseline; }
.mistake-where svg { flex: none; width: 15px; height: 15px; align-self: center; color: #5b3cc4; }
.mistake-seen { display: flex; gap: 7px; align-items: baseline; }
.mistake-seen > span { flex: none; }
.mistake-seen ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mistake-seen a { font-weight: 600; }
.test-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #7655e0, #2f6fed); color: #fff; box-shadow: 0 6px 16px #7655e055; flex: none; }
.test-icon svg { width: 26px; height: 26px; }
.ready { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; font-size: .9rem; color: #43536a; }
.ready li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.4; }
.ready svg { width: 18px; height: 18px; margin-top: 1px; color: #a3afc0; }
.ready li.done svg { color: #2f9a4a; stroke-width: 2.4; }
.ready strong { color: var(--ink); font-weight: 650; }

.drop-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #13223899; backdrop-filter: blur(2px); pointer-events: none; }
.drop-overlay > div { display: grid; justify-items: center; gap: 10px; padding: 40px 56px; border-radius: 20px; background: #fff; border: 3px dashed var(--accent); color: var(--ink); font-size: 1.15rem; box-shadow: var(--shadow-lift); }
.drop-overlay svg { width: 40px; height: 40px; color: var(--accent); }
.drop-overlay p { margin: 0; }

/* -- dialogs -- */
dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 60px #0f1d3340; color: var(--ink); }
dialog::backdrop { background: #13223880; }
.dialog-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 4px 24px; }
.dialog-head h2 { flex: 1; margin: 0; font-size: 1.3rem; letter-spacing: -.03em; }
.dialog-body { padding: 14px 24px 6px; }
.dialog-body h2 { margin: 6px 0 8px; font-size: 1.25rem; letter-spacing: -.02em; }
.dialog-body > p { color: #43536a; line-height: 1.5; margin: 0 0 12px; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 24px 22px; }
.dialog-extra { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.field { display: grid; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-weight: 650; font-size: .9rem; color: #2b3e5c; padding: 0; margin-bottom: 6px; }
.field > span { margin-bottom: 0; }
.field em { font-style: normal; font-weight: 500; color: #7a889c; font-size: .82rem; margin-left: 4px; }
.field input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #c4cfdd; border-radius: 10px; background: #fff; }
.field input:focus { border-color: var(--accent); outline: 3px solid #7195ff55; outline-offset: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.wide-first { grid-template-columns: minmax(0, 1fr) 9.5rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px #0000001a; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c-deep); }
.swatch:has(input:checked)::after { content: ""; position: absolute; left: 13px; top: 9px; width: 8px; height: 14px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.swatch:has(input:focus-visible) { outline: 3px solid #7195ff; outline-offset: 5px; }
.field small { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.small-link { font-size: .85rem; margin: -6px 0 16px; }
.preview-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 2px 0 18px; box-shadow: var(--shadow); transition: none; }
.preview-card .card-band { height: 66px; padding: 11px 16px; }
.preview-card .card-band::before { width: 120px; height: 120px; right: -30px; top: -60px; }
.preview-card .card-band::after { width: 54px; height: 54px; right: 64px; top: 30px; }
.preview-card .card-body { padding: 11px 16px 13px; gap: 3px; }
.preview-card .card-name { min-height: 1.3em; }
.preview-card .card-name.placeholder { color: #9aa7b8; font-weight: 600; }
.preview-card .card-meta { min-height: 1.2em; }
.added-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; padding: 9px 13px; border-radius: 10px; background: #eaf7ed; color: #1f6b33; font-weight: 600; font-size: .9rem; }
.added-note::before { content: "✓"; font-weight: 800; }
.form-error { margin: 4px 0 6px; padding: 10px 13px; border-radius: 9px; background: #fdecef; color: #9b1c33; font-size: .9rem; line-height: 1.45; }


/* -- the drive: a course's folders and files -- */
.drive-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 66px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; font-weight: 700; font-size: 1.02rem; }
.crumbs > svg { color: #37537a; margin-right: 4px; }
.crumb { color: #5a6a81; text-decoration: none; padding: 4px 8px; border-radius: 8px; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.crumb:hover { background: #eef2f7; color: var(--ink); }
.crumb.current { color: var(--ink); }
.crumb-sep { color: #a3afc0; }
.crumb.drop-target { background: var(--soft); outline: 2px dashed var(--accent); }
.drive-actions, .selection-bar { display: flex; align-items: center; gap: 8px; }
.selection-bar { flex: 1; justify-content: flex-end; }
.selection-count { margin-right: auto; font-weight: 700; color: var(--accent); }
.primary.small { min-height: 38px; padding: 7px 14px; font-size: .9rem; border-radius: 9px; }
.chev { width: 16px; height: 16px; margin-left: -3px; }
.danger-outline { color: var(--red); border-color: #f2b8c3; }
.danger-outline:hover:not(:disabled) { background: #fdecef; border-color: var(--red); }
.drive-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px 0; }
.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 180px; max-width: 340px; padding: 0 12px; border: 1px solid #c4cfdd; border-radius: 10px; background: #fff; cursor: text; }
.search:focus-within { border-color: var(--accent); outline: 3px solid #7195ff40; }
.search svg { color: #7a889c; width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; min-height: 38px; border: 0; outline: 0; background: transparent; }
.tidy { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; border: 1px solid #d9cdfa; background: linear-gradient(135deg, #f5f1ff, #eef4ff); color: #5b3cc4; font-weight: 700; font-size: .86rem; }
.tidy:hover { border-color: #a993ef; box-shadow: 0 2px 8px #7655e022; }
.tidy svg { width: 17px; height: 17px; }
.tidy-count { padding: 0 7px; border-radius: 99px; background: #5b3cc4; color: #fff; font-size: .74rem; line-height: 1.6; }
.drive-count { margin-left: auto; color: var(--muted); font-size: .84rem; }
.drive .uploads { padding: 0 18px; }
.drive .uploads:not(:empty) { margin-top: 12px; }
.drive-list { padding: 8px 10px 14px; }
.drive-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) 90px 112px 38px; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; }
.drive-header { padding-top: 2px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid #edf1f6; border-radius: 0; color: #5a6a81; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.drive-header .sort:first-of-type { grid-column: span 2; }
.sort { display: flex; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort:hover, .sort.on { color: var(--ink); }
.drive-row:not(.drive-header):hover { background: #f6f8fb; }
.drive-row.is-selected { background: var(--soft); }
.drive-row.drop-target { background: #e3ecff; outline: 2px dashed var(--accent); outline-offset: -2px; }
.drive-row.dragging { opacity: .45; }
.drive-row[draggable="true"] { cursor: grab; }
.row-check { display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer; }
.row-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.folder-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--c, #6d93dd); }
.folder-icon svg { width: 34px; height: 34px; }
/* Hintivo's own folder (Hintivo Exams): a sparkle on the folder, and its line says where it comes from. */
.folder-icon { position: relative; }
.folder-badge { position: absolute; right: -3px; bottom: -2px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px var(--c, #8466ea); }
.folder-icon .folder-badge svg { width: 11px; height: 11px; fill: var(--c, #8466ea); stroke: none; }
.drive-row.is-hintivo .row-sub { color: #5b3cc4; }
/* Inside a folder: the folder itself, open at the top of the list, with the way back. */
.drive-here { display: grid; grid-template-columns: 30px 34px minmax(0, 1fr); align-items: center; gap: 6px; margin: 2px 0 6px; padding: 8px 10px 8px 6px; border-radius: 10px; background: var(--c-soft, var(--soft)); }
.drive-here .folder-up { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink); }
.drive-here .folder-up:hover { background: #ffffffb3; }
.drive-here .folder-up svg { width: 18px; height: 18px; }
.drive-here .folder-icon { width: 30px; height: 30px; }
.drive-here .folder-icon > svg { width: 28px; height: 28px; }
.here-main { display: flex; flex-direction: column; min-width: 0; padding-left: 4px; }
.here-name { font-weight: 750; color: var(--ink); overflow-wrap: anywhere; }
.here-sub { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.drive-here.is-hintivo .here-sub { color: #5b3cc4; }
.drive-row .file-icon { width: 36px; height: 36px; margin-inline: 1px; font-size: .6rem; border-radius: 9px; }
.row-main { display: flex; flex-direction: column; min-width: 0; padding-left: 4px; }
.row-name { width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 650; text-decoration: none; cursor: pointer; }
.row-name:hover { color: var(--accent); text-decoration: underline; }
.row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .8rem; }
.row-size, .row-date { color: #5a6a81; font-size: .86rem; white-space: nowrap; }
.row-more { opacity: .55; }
.drive-row:hover .row-more, .row-more:focus-visible, .row-more[aria-expanded="true"] { opacity: 1; }
.rename-input { width: 100%; max-width: 420px; min-height: 34px; padding: 4px 10px; border: 2px solid var(--accent); border-radius: 8px; font-weight: 650; background: #fff; }
.drive-empty { display: grid; justify-items: center; gap: 6px; margin: 14px 18px 20px; padding: 30px 20px; border: 2px dashed #c2cfe0; border-radius: 14px; background: #fafcff; text-align: center; }
.drive-empty.first { padding: 44px 24px; }
.drive-empty h3 { margin: 6px 0 0; font-size: 1.12rem; }
.drive-empty p { margin: 0; max-width: 50ch; color: var(--muted); line-height: 1.5; }
.drop-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.drop-icon svg { width: 26px; height: 26px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.drop-overlay small { color: var(--muted); font-size: .85rem; }

/* menus (a row's ⋯, Upload) */
.menu { position: fixed; z-index: 70; display: grid; gap: 2px; min-width: 200px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 14px 36px #0f1d3330; }
.menu > button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: .92rem; font-weight: 550; color: var(--ink); }
.menu > button:hover, .menu > button:focus-visible { background: #f0f4f9; outline: none; }
.menu > button svg { width: 18px; height: 18px; color: #5a6a81; }
.menu > button.menu-danger, .menu > button.menu-danger svg { color: var(--red); }
.menu-swatches { display: flex; flex-wrap: wrap; gap: 7px; max-width: 220px; margin: 2px 0; padding: 9px 10px; border-block: 1px solid #edf1f6; }
.menu-swatch { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px #0000001a; }
.menu-swatch.no-color { position: relative; background: #fff; box-shadow: inset 0 0 0 2px #c4cfdd; }
.menu-swatch.no-color::after { content: ""; position: absolute; left: 3px; right: 3px; top: 10px; height: 2px; background: #c4cfdd; transform: rotate(-45deg); }
.menu-swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c, #8390a3); }

/* Move to… */
.folder-picker { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: 12px; }
.pick { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-weight: 550; cursor: pointer; }
.pick:hover { background: #f3f6fa; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { background: var(--soft); color: var(--accent); font-weight: 700; }
.pick:has(input:focus-visible) { outline: 3px solid #7195ff; }
.pick-indent { flex: none; width: calc((var(--depth, 0) - 1) * 18px); }
.pick svg { color: #6d93dd; }
.pick svg.tinted { color: var(--c); }
.pick.blocked { opacity: .45; cursor: not-allowed; }

/* -- Markdown and math (questions, answers, feedback) -- */
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md p { margin: 0 0 .65em; }
.md > :last-child, .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 .65em; padding-left: 1.4em; }
.md h3, .md h4, .md h5 { margin: .8em 0 .4em; font-size: 1em; }
.md code { font-size: .88em; }
.md pre { background: #f3f6fa; padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md .md-table { overflow-x: auto; margin: 0 0 .65em; }
.md table { border-collapse: collapse; font-size: .94em; }
.md th, .md td { border: 1px solid var(--border); padding: 5px 10px; text-align: left; }
.md th { background: #f3f6fa; }
.math-display { display: block; overflow-x: auto; overflow-y: hidden; margin: .5em 0; text-align: center; }
span.md > p { display: inline; margin: 0; }

/* -- setting up a test -- */
.setup-dialog { width: min(620px, calc(100% - 24px)); }
.setup-dialog .dialog-head { align-items: flex-start; padding-top: 22px; }
.setup-dialog .dialog-head > div { flex: 1; }
.dialog-sub { margin: 3px 0 0; color: var(--muted); font-size: .92rem; }
.choice-group { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.choice-group legend { font-weight: 700; font-size: .95rem; color: #2b3e5c; padding: 0; margin-bottom: 9px; }
.choice-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice-card, .segment { position: relative; cursor: pointer; }
.choice-card input, .segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-card .choice-text { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px; background: #fff; transition: border-color .12s ease, background .12s ease; }
.choice-text strong { font-size: .95rem; }
.choice-text small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.choice-card:hover .choice-text, .segment:hover .choice-text { border-color: #a9bbd8; }
.choice-card:has(input:checked) .choice-text, .segment:has(input:checked) .choice-text { border-color: var(--accent); background: var(--soft); }
.choice-card:has(input:focus-visible) .choice-text, .segment:has(input:focus-visible) .choice-text { outline: 3px solid #7195ff; outline-offset: 2px; }
.segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segment .choice-text { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border: 2px solid var(--border); border-radius: 11px; background: #fff; text-align: center; height: 100%; justify-content: center; }
.segment .choice-text strong { font-size: .9rem; }
.segment .choice-text small { font-size: .76rem; }
.field textarea { width: 100%; padding: 10px 12px; border: 1px solid #c4cfdd; border-radius: 10px; resize: vertical; min-height: 64px; line-height: 1.45; }
.field textarea:focus { border-color: var(--accent); outline: 3px solid #7195ff55; outline-offset: 0; }
.setup-files { border: 1px solid var(--border); border-radius: 12px; margin: 4px 0 12px; background: #fafcff; }
.setup-files summary { display: flex; align-items: center; gap: 9px; padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: .92rem; color: #2b3e5c; list-style: none; }
.setup-files summary::-webkit-details-marker { display: none; }
.setup-files summary svg { color: #37537a; }
.setup-change { margin-left: auto; color: var(--accent); font-size: .86rem; }
.setup-files[open] .setup-change { visibility: hidden; }
.setup-files-tools { display: flex; gap: 14px; padding: 0 14px 6px; font-size: .85rem; }
#setup-files { max-height: 240px; overflow-y: auto; padding: 0 14px 12px; }
.setup-group-title { margin: 10px 0 4px; font-size: .74rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #5a6a81; }
.setup-file { display: flex; align-items: center; gap: 9px; padding: 5px 2px; font-size: .9rem; cursor: pointer; }
.setup-file input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.setup-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-file small { margin-left: auto; color: #8390a3; font-size: .78rem; white-space: nowrap; }
.setup-file.unreadable { color: #8390a3; cursor: default; }
.setup-note { margin: 0 0 8px; padding: 10px 13px; border-radius: 10px; background: #fff8e6; color: #5e4500; font-size: .88rem; line-height: 1.45; }
.setup-time { margin: 0 auto 0 0; color: var(--muted); font-size: .85rem; }

/* Which exam, and the course's topics to check for it */
.setup-topics { border: 1px solid var(--border); border-radius: 12px; margin: 0 0 18px; padding: 11px 14px 12px; background: #fafcff; min-width: 0; }
.setup-topics-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.setup-topics-head strong { font-size: .95rem; color: #2b3e5c; }
.setup-topics-count { font-size: .82rem; color: var(--muted); }
.setup-topics-tools { margin-left: auto; display: flex; gap: 14px; font-size: .85rem; }
.setup-topics-reading { margin: 10px 0 6px; }
.setup-topics-failed { margin: 8px 0 6px; font-size: .88rem; color: #9b1c33; }
.setup-topic-list { display: grid; max-height: 250px; overflow-y: auto; margin: 6px 0 8px; }
.setup-topic-list:empty { display: none; }
.setup-topic { display: flex; align-items: center; gap: 9px; padding: 5px 2px; font-size: .9rem; cursor: pointer; }
.setup-topic input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.setup-topic-title { min-width: 0; line-height: 1.4; }
.setup-topic-title p { display: inline; margin: 0; }
.setup-topic small { margin-left: auto; padding-left: 10px; color: #8390a3; font-size: .78rem; white-space: nowrap; }
.setup-topic.is-later .setup-topic-title { color: #6b7a90; }
.setup-topic-add { display: flex; gap: 8px; margin-top: 4px; }
.setup-topic-add input { flex: 1; min-width: 0; padding: 7px 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; font: inherit; font-size: .9rem; color: var(--ink); }
.setup-topic-add input:focus { outline: 3px solid #9cb7f0; outline-offset: 1px; border-color: var(--accent); }
.setup-topics-source { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }

/* -- practice tests listed on the course page -- */
.test-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: #fff; border: 1px solid #e6e0f8; text-decoration: none; color: inherit; }
.test-item:hover { border-color: #b9a8f0; background: #fcfbff; }
.test-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.test-item-title { font-weight: 650; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-item-meta { font-size: .78rem; color: var(--muted); }
.test-item-status { flex: none; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #eef2f7; color: #43536a; white-space: nowrap; }
.s-ready .test-item-status { background: var(--soft); color: var(--accent); }
.s-started .test-item-status { background: #fff3d6; color: #7a5200; }
.s-writing .test-item-status, .s-grading .test-item-status { background: #f0ecfd; color: #5b3cc4; animation: pulse 1.6s ease-in-out infinite; }
.s-failed .test-item-status { background: #fdecef; color: #9b1c33; }
.test-item-status.score { font-size: .82rem; }
.score.high { background: #e3f5e8; color: #1f6b33; }
.score.mid { background: #fff3d6; color: #7a5200; }
.score.low { background: #fdeee5; color: #9a3c12; }
@keyframes pulse { 50% { opacity: .55; } }

/* -- Claude at work, and failures -- */
.working { max-width: 640px; margin: 10px auto 0; padding: 44px 36px 34px; text-align: center; }
.working h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin: 18px 0 10px; }
.working > p { color: #43536a; line-height: 1.55; margin: 0 auto 8px; max-width: 48ch; }
.orb { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: #fff; background: conic-gradient(from 0deg, #7655e0, #2f6fed, #12a596, #7655e0); animation: spin 6s linear infinite; box-shadow: 0 10px 30px #7655e044; }
.orb svg { width: 40px; height: 40px; animation: spin 6s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.dots { display: inline-flex; gap: 6px; margin: 14px 0 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #7655e0; animation: bounce 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-6px); opacity: 1; } }
.working-tip { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: 22px auto 0; padding: 13px 16px; border-radius: 12px; background: #fff8e6; color: #5e4500; font-size: .92rem; line-height: 1.45; max-width: 46ch; }
.working-tip svg { color: #c28a00; margin-top: 1px; }
.working.failed .orb { background: #fdecef; color: var(--red); animation: none; box-shadow: none; }
.working.failed .orb svg { animation: none; }
.working .result-actions { justify-content: center; margin-top: 18px; }

/* -- the cover page -- */
.cover { max-width: 760px; margin: 0 auto; overflow: hidden; }
.cover-band { position: relative; overflow: hidden; padding: 30px 32px 26px; background: var(--c-deep); color: #fff; }
.cover-band::before { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -140px; border-radius: 50%; background: var(--c); opacity: .85; }
.cover-band > * { position: relative; }
.eyebrow { margin: 0 0 8px; font-size: .84rem; font-weight: 700; letter-spacing: .04em; opacity: .9; }
.cover-band h1 { color: #fff; margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.cover-body { padding: 24px 32px 30px; }
.facts { list-style: none; margin: 0 0 20px; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.facts li { display: flex; flex-direction: column; min-width: 104px; padding: 12px 16px; border-radius: 12px; background: #f3f6fa; color: var(--muted); font-size: .85rem; }
.facts strong { font-size: 1.5rem; color: var(--ink); letter-spacing: -.02em; }
.cover-instructions { margin: 0 0 16px; color: #2b3e5c; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.topic-chip { padding: 5px 11px; border-radius: 99px; background: var(--c-soft); color: var(--c-deep); font-size: .84rem; font-weight: 650; }
.cover-notes { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; color: #43536a; font-size: .93rem; }
.cover-notes li { display: flex; gap: 10px; align-items: center; }
.cover-notes svg { color: var(--c-deep); }
.skipped { margin: 0 0 18px; padding: 10px 13px; border-radius: 10px; background: #fff8e6; color: #5e4500; font-size: .88rem; }
.primary.big { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; border-radius: 12px; }

/* -- answering -- */
.exam-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 -12px 20px; padding: 12px 16px; background: #ffffffee; backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.exam-bar-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.exam-bar-text > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-bar-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .85rem; }
.timer { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.timer svg { width: 15px; height: 15px; }
.timer.over { color: #9a6200; }
.timer-wrap { display: inline-flex; align-items: center; gap: 10px; }
.timer-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: 6px; background: none; color: var(--accent); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.timer-toggle:hover { text-decoration: underline; }
.timer-toggle:focus-visible { outline: 3px solid #9cb7f0; outline-offset: 1px; }
.timer-toggle svg { width: 15px; height: 15px; }
.save-state { color: #2f7a43; }
.save-state.error { color: var(--red); }
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.question-card { background: #fff; border: 1px solid var(--border); border-left: 4px solid #d4dde9; border-radius: 16px; padding: 20px 24px 22px; box-shadow: var(--shadow); }
.question-card.is-answered { border-left-color: #2f9a4a; }
.q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 750; font-size: .9rem; }
.q-topic { font-weight: 700; color: #2b3e5c; font-size: .9rem; }
.q-points { margin-left: auto; font-size: .82rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.q-prompt { margin-bottom: 16px; font-size: 1.02rem; }
.choices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.choice { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; background: #fff; }
.choice:hover { border-color: #a9bbd8; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.choice:has(input:focus-visible) { outline: 3px solid #7195ff; outline-offset: 2px; }
.letter { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #eef2f7; font-weight: 750; font-size: .82rem; color: #43536a; }
.choice:has(input:checked) .letter { background: var(--accent); color: #fff; }
.choice-text { flex: 1; min-width: 0; padding-top: 2px; }
textarea.answer { width: 100%; padding: 12px 14px; border: 1px solid #c4cfdd; border-radius: 12px; resize: vertical; line-height: 1.5; font-size: .98rem; background: #fcfdff; }
textarea.answer:focus { border-color: var(--accent); outline: 3px solid #7195ff55; outline-offset: 0; background: #fff; }
.answer-hint { margin: 6px 0 0; color: #7a889c; font-size: .8rem; }
.answer-preview { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: #f6f8fb; border: 1px dashed #c8d3e2; }
.preview-label { display: block; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #7a889c; margin-bottom: 4px; }
.photos { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.photo { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #f3f6fa; display: grid; place-items: center; font-size: .78rem; color: var(--muted); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-link { display: block; width: 100%; height: 100%; }
.photo-pdf { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; color: #b3203c; background: #fdecef; }
.photo-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #132238cc; color: #fff; display: grid; place-items: center; padding: 0; }
.photo-remove svg { width: 14px; height: 14px; }
.photo.pending { animation: pulse 1.2s ease-in-out infinite; }

/* -- a drawn answer, where the answer goes: its ink in a box drawn around it, as big as it is on the page
   (each picture is --share of the page's width; 24px is the box's padding and border), and a tap opens
   it again to keep working on -- */
.drawing-answer { container-type: inline-size; margin: 0 0 10px; }
.drawing-preview { display: block; width: fit-content; min-width: min(100%, 280px); max-width: 100%; margin: 0; padding: 10px; border: 2px solid #b9c8de; border-radius: 12px; background: #fff; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.drawing-preview:hover { border-color: var(--accent); box-shadow: 0 0 0 3px #7195ff2e; }
.drawing-preview:focus-visible { outline: 3px solid #7195ff88; outline-offset: 2px; }
.drawing-preview.is-static { cursor: default; box-shadow: none; }
.drawing-preview.is-static:hover { border-color: #b9c8de; }
.drawing-pages { display: grid; gap: 8px; justify-items: start; }
.drawing-pages > img, .drawing-pages > canvas { display: block; width: calc(var(--share, 1) * (100cqw - 24px)); max-width: 100%; height: auto; }
.drawing-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d9e1ec; color: var(--muted); font-size: .86rem; }
.drawing-label { font-weight: 700; color: var(--ink); }
.drawing-state { font-size: .82rem; }
.drawing-state:empty { display: none; }
.drawing-state.is-error { color: #b3203c; font-weight: 650; }
.drawing-action { margin-left: auto; color: var(--accent); font-weight: 650; }
/* Where "Next question" on the pad lands: marked for a moment. */
.question-card:focus { outline: none; }
.question-card.is-arriving { animation: arriving 1.6s ease-out; }
@keyframes arriving { from { outline: 3px solid #7195ffcc; outline-offset: 4px; } to { outline: 3px solid #7195ff00; outline-offset: 4px; } }
.type-too { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: .9rem; }
.type-too[hidden], textarea.answer[hidden], .answer-hint[hidden] { display: none; }

/* -- "Hold to clear": start a question over. It fills while held, and clears only when full (2 s). -- */
.hold-clear { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 32px; padding: 5px 11px; border-radius: 99px; border: 1px solid #e6c3ca; background: #fff; color: #9b2335; font: inherit; font-size: .8rem; font-weight: 650; white-space: nowrap; cursor: pointer;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.hold-clear[hidden] { display: none; }
.hold-clear:hover { border-color: #c96b7b; }
.hold-clear svg { width: 15px; height: 15px; }
.hold-clear > :not(.hold-fill) { position: relative; }
.hold-fill { position: absolute; inset: 0; background: #f9d3da; transform: scaleX(0); transform-origin: left center; }
.hold-clear.is-holding .hold-fill { transform: scaleX(1); transition: transform 2s linear; }
.secondary.small { min-height: 38px; padding: 7px 13px; font-size: .88rem; border-radius: 9px; }

/* -- "Draw your work": a big page to write on. The grid is only behind the canvas: it's never in the picture. -- */
dialog.draw-dialog { width: min(1180px, calc(100vw - 24px)); height: calc(100dvh - 24px); max-width: none; max-height: none; overscroll-behavior: contain; }
/* Only the writing surface takes every touch for itself (touch-action: none, on .draw-canvas). Not the pad
   around it: on an iPad, a button inside touch-action: none may never get a click from an Apple Pencil. */
dialog.draw-dialog button { touch-action: manipulation; }
/* A hand resting on the pad while the pen writes must not select anything: not inherited everywhere, so said everywhere. */
dialog.draw-dialog, dialog.draw-dialog * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.draw-frame { display: flex; flex-direction: column; height: 100%; }
.draw-frame .dialog-head { padding-bottom: 8px; }
.draw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 0 20px 10px 24px; }
.draw-group { display: inline-flex; align-items: center; gap: 4px; }
.draw-page { margin-left: auto; gap: 8px; }
.draw-tool, .draw-color, .draw-size { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 9px; border: 1px solid transparent; background: transparent; color: #4a5b74; }
.draw-tool:hover:not(:disabled), .draw-color:hover, .draw-size:hover { background: #eef2f7; }
.draw-tool[aria-pressed="true"], .draw-color[aria-pressed="true"], .draw-size[aria-pressed="true"] { background: var(--soft); border-color: #9db3e6; color: var(--accent); }
.draw-tool:disabled { opacity: .4; }
.draw-color span { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px #ffffff80; }
.draw-size span { width: 20px; border-radius: 99px; background: currentColor; }
.draw-problem { touch-action: pan-y; flex: none; max-height: min(26vh, 220px); overflow: auto; overscroll-behavior: contain; margin: 0 20px 10px; padding: 10px 14px; border-radius: 12px; background: var(--soft); border: 1px solid #d3def5; color: var(--ink); font-size: .98rem; line-height: 1.5; }
.draw-problem[hidden] { display: none; }
/* The exam's and the tutor's own frames for a problem: the strip is its frame here. */
.draw-problem .md { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; }
.draw-problem .md > :first-child { margin-top: 0; }
.draw-problem .md > :last-child { margin-bottom: 0; }
.draw-toggle[hidden] { display: none; }
.draw-area { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; margin: 0 20px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.draw-canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none;
  background-color: #fff; background-image: linear-gradient(#e8edf5 1px, transparent 1px), linear-gradient(90deg, #e8edf5 1px, transparent 1px); background-size: 28px 28px; }
.draw-canvas.is-erasing { cursor: cell; }
.draw-dialog .dialog-foot { padding: 12px 20px 16px; }
.draw-status { margin: 0 auto 0 0; color: var(--muted); font-size: .88rem; line-height: 1.4; }
.draw-status.is-error { color: #b3203c; }
@media (max-width: 640px) {
  dialog.draw-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .draw-tools { padding: 0 12px 8px; gap: 6px 8px; }
  .draw-page { margin-left: 0; }
  .draw-area { margin: 0 8px; }
  .draw-problem { margin: 0 8px 8px; max-height: 22vh; }
  .draw-tool, .draw-color, .draw-size { width: 34px; height: 34px; }
}
.exam-end { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding: 18px 22px; border-radius: 16px; background: #fff; border: 1px dashed #c2cfe0; }
.exam-end p { margin: 0 auto 0 0; color: var(--muted); }

/* -- results -- */
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; padding: 30px 32px; }
.score-ring { --p: 0; width: 168px; height: 168px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, #fff 78%, transparent 79% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), #e8edf3 0); }
.score-ring strong { font-size: 2.4rem; letter-spacing: -.04em; line-height: 1; }
.score-ring span { color: var(--muted); font-weight: 650; margin-top: 4px; }
.result-text .eyebrow { color: var(--c-deep); }
.result-text h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.result-summary { color: #43536a; margin: 0 0 18px; max-width: 64ch; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* View PDF and Download PDF on a test: on the cover, in the answering bar, and with the results. */
.pdf-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pdf-links a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.pdf-links svg { width: 16px; height: 16px; }
.pdf-links.compact { margin: 0; }
.result-text .pdf-links { margin-top: 12px; }
.exam-bar .pdf-links { margin-left: auto; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0 28px; }
.strengths, .review { padding: 20px 22px; }
.strengths h2, .review h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.05rem; }
.strengths h2 svg { color: #2f9a4a; stroke-width: 2.4; }
.review h2 svg { color: #5b3cc4; }
.strengths ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; color: #2b3e5c; }
.review ol { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.review-topic { display: block; font-weight: 700; color: var(--ink); }
.review-why { color: #43536a; font-size: .92rem; margin-top: 2px; }
.review-where { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; font-size: .84rem; color: #5b3cc4; font-weight: 600; }
.review-where svg { width: 15px; height: 15px; }
.results-title { margin-top: 6px; }
.verdict-correct { border-left-color: #2f9a4a; }
.verdict-partial { border-left-color: #e0a100; }
.verdict-incorrect { border-left-color: #e2557f; }
.verdict-blank { border-left-color: #a3afc0; }
.q-verdict { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.verdict-word { font-size: .85rem; font-weight: 650; color: var(--muted); }
.score-chip { padding: 4px 11px; border-radius: 99px; font-weight: 750; font-size: .86rem; white-space: nowrap; }
.score-chip.correct { background: #e3f5e8; color: #1f6b33; }
.score-chip.partial { background: #fff3d6; color: #7a5200; }
.score-chip.incorrect { background: #fcebf1; color: #9b1c48; }
.score-chip.blank { background: #eef2f7; color: #43536a; }
.choices.graded .choice { cursor: default; }
.choices.graded .is-correct { border-color: #2f9a4a; background: #f1faf3; }
.choices.graded .is-correct .letter { background: #2f9a4a; color: #fff; }
.choices.graded .is-wrong { border-color: #e2557f; background: #fdf3f6; }
.choices.graded .is-wrong .letter { background: #e2557f; color: #fff; }
.choice-tag { flex: none; font-size: .76rem; font-weight: 700; color: var(--muted); padding-top: 4px; }
.your-answer, .from-photos, .feedback { margin-top: 16px; }
.your-answer h3, .from-photos h3, .feedback h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .76rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #5a6a81; }
.your-answer > .md { padding: 10px 14px; border-radius: 10px; background: #f6f8fb; }
.from-photos .md { padding: 10px 14px; border-radius: 10px; background: #f6f8fb; font-size: .92rem; color: #43536a; }
.feedback { padding: 14px 16px; border-radius: 12px; background: linear-gradient(160deg, #f5f1ff, #fbfaff); border: 1px solid #e4dcfb; }
.feedback h3 { color: #5b3cc4; }
.feedback h3 svg { width: 15px; height: 15px; }
.next-step { margin: 10px 0 0; font-size: .93rem; color: #2b3e5c; }
.solution { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.solution summary { cursor: pointer; font-weight: 650; color: var(--accent); width: fit-content; }
.solution > .md { margin-top: 10px; }
.rubric { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; color: #43536a; }
.rubric li { display: flex; gap: 10px; align-items: baseline; }
.rubric-points { flex: none; min-width: 44px; font-weight: 750; color: #2b3e5c; font-size: .82rem; }
.source { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: .85rem; }
.source svg { width: 15px; height: 15px; }
.result-foot { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 0; color: var(--muted); font-size: .85rem; }
.muted { color: var(--muted); }

/* -- toasts -- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: grid; gap: 10px; width: min(480px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow-lift); font-size: .93rem; line-height: 1.45; animation: toast-in .2s ease; }
.toast svg { margin-top: 2px; color: var(--lime); }
.toast-error { background: #8f1730; }
.toast-error svg { color: #ffd1da; }
.toast-out { opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* -- login -- */
.login-main { width: min(1040px, calc(100% - 48px)); display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: 56px; align-items: center; padding: 64px 0 72px; }
.welcome h2 { font-size: clamp(1.9rem, 3.8vw, 2.6rem); line-height: 1.12; letter-spacing: -.045em; margin: 0 0 26px; max-width: 18ch; }
.welcome-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.welcome-list li { display: flex; gap: 14px; align-items: flex-start; color: #43536a; line-height: 1.5; }
.welcome-list strong { color: var(--ink); }
.welcome-list em { font-style: normal; font-weight: 650; color: #5b3cc4; }
.welcome-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--c-soft); color: var(--c-deep); }
.welcome-icon svg { width: 22px; height: 22px; }
.login-card { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 34px 30px 26px; box-shadow: var(--shadow-lift); }
.login-card h1 { font-size: 1.85rem; letter-spacing: -.04em; margin: 0 0 10px; }
.login-lead { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.login-message { margin: 0 0 18px; padding: 10px 13px; border-radius: 9px; background: #fdecef; color: #9b1c33; font-size: .9rem; line-height: 1.45; }
.providers { display: grid; gap: 10px; }
.provider { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 0 16px; border: 1px solid #c4ccd6; border-radius: 10px; background: #fff; color: #1f1f1f; font-weight: 600; text-decoration: none; }
.provider svg { width: 20px; height: 20px; stroke: none; }
.provider[href]:hover { background: #f4f7fb; border-color: #8c99ab; }
.provider[aria-disabled="true"] { color: #8390a3; background: #f6f8fb; cursor: not-allowed; }
.provider[aria-disabled="true"] svg { opacity: .45; }
.provider-off { padding: 2px 7px; border-radius: 99px; background: #e8edf3; font-size: .72rem; font-weight: 650; color: #56647a; white-space: nowrap; }
.demo { margin-top: 4px; }
.demo p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; text-align: center; }
.or { display: flex; align-items: center; gap: 12px; color: #8390a3; font-size: .84rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-note { margin: 14px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }
.login-signed-in p { margin: 0 0 18px; line-height: 1.5; }
.lock-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.login-switch { margin: 22px 0 0; font-size: .92rem; color: #43536a; }
.login-switch a { font-weight: 650; }
.login-fine { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; line-height: 1.45; }

/* -- smaller screens -- */
@media (max-width: 920px) {
  .course-layout { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .side { display: contents; }               /* Take a test from me above the files, tips below them */
  .recent, .mistakes { grid-column: auto; }
  .login-main { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .welcome h2 { max-width: none; }
}
@media (max-width: 680px) {
  .top-inner, main, .login-main { width: calc(100% - 32px); }
  .mistakes .recent-head { flex-wrap: wrap; row-gap: 4px; }
  .mistakes .recent-head h2 { flex-basis: 100%; }
  .mistake-body { padding: 4px 14px 14px; }
  .account-name { display: none; }
  .top-add { padding: 8px 11px; }
  .top-add span { display: none; }
  .top-add::after { content: "Add"; }
  .brand-tag { display: none; }
  .quick-add { flex-direction: column; }
  .drive-row { grid-template-columns: 30px 38px minmax(0, 1fr) 36px; }
  .row-size, .row-date, .drive-header .sort:not(:first-of-type) { display: none; }
  .drive-head, .drive-tools { padding-left: 12px; padding-right: 12px; }
  .drive-list { padding-inline: 4px; }
  .search { max-width: none; }
  .drive-count { margin-left: 0; }
  .choice-cards, .segments { grid-template-columns: 1fr; }
  .segment .choice-text { flex-direction: row; justify-content: space-between; text-align: left; gap: 8px; }
  .result-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 24px 20px; }
  .result-actions { justify-content: center; }
  .score-ring { width: 140px; height: 140px; }
  .question-card { padding: 16px 16px 18px; }
  .exam-bar { margin: 0 -4px 16px; flex-direction: column; align-items: stretch; }
  .exam-end { flex-direction: column; align-items: stretch; }
  .cover-band, .cover-body { padding-left: 20px; padding-right: 20px; }
  .exam-bar .pdf-links { display: none; }        /* the cover and the results have them; the bar stays one line */
  .working { padding: 32px 20px 26px; }
  .setup-time { display: none; }
  main { padding-top: 24px; }
  .hello { flex-direction: column; align-items: stretch; }
  .steps { grid-template-columns: 1fr; }
  .add-card { min-height: 96px; flex-direction: row; }
  .hero { flex-direction: column; align-items: flex-start; padding: 24px 22px; }
  .panel-head { padding: 12px 14px; }
  .upload { grid-template-columns: minmax(0, 1fr) 80px auto; }
  .field-row, .field-row.wide-first { grid-template-columns: 1fr; gap: 0; }
  .dialog-extra { width: 100%; justify-content: space-between; margin: 0 0 4px; }
  .login-card { padding: 26px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* Except "Hold to clear"'s fill: it's how long is left to hold, not decoration. */
  .hold-clear.is-holding .hold-fill { transition: transform 2s linear !important; }
}

/* -- Work through a problem: the card, the conversation, and writing back -- */
.help-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #e8a33d, #d9772b); color: #fff; box-shadow: 0 6px 16px #e8a33d55; flex: none; }
.help-icon svg { width: 26px; height: 26px; }
/* The panel sits under the file viewer on the course page. Its content keeps to a readable width
   however wide the column gets: the padding grows instead of the lines. */
.help-panel { margin-top: 18px; scroll-margin-top: 14px; }
.viewer[hidden] + .help-panel { margin-top: 0; }
.help-problem { padding: 16px max(22px, calc(50% - 460px)) 18px; border-radius: 16px 16px 0 0; background: linear-gradient(135deg, #fdf3e4 0%, #fff8ec 100%); border-bottom: 1px solid #f0dfbb; }
.help-problem-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.help-problem-head > div { flex: 1; min-width: 0; }
.help-problem-head .do-chip { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #e8a33d, #d9772b); box-shadow: 0 3px 9px #e8a33d55; }
.help-problem-head .do-chip svg { width: 21px; height: 21px; }
.help-problem-head .section-label { color: #8a5a10; font-size: .72rem; margin: 1px 0 2px; }
.help-problem-head h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1.25; outline: none; }
.problem-text { color: #2b3e5c; background: #fff; border: 1px solid #f0dfbb; border-radius: 10px; padding: 12px 14px; font-size: .95rem; }
.help-thread { display: grid; gap: 14px; padding: 18px max(22px, calc(50% - 460px)) 20px; }
.help-files { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; color: var(--muted); font-size: .86rem; }
.help-files svg { width: 16px; height: 16px; }

.help-turn { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: #fff; }
.help-turn.from-student { background: #f3f6fa; border-color: #e2e9f2; margin-left: 36px; }
.help-turn.from-tutor { border-color: #ddd3fb; box-shadow: 0 2px 10px #7655e014; margin-right: 36px; }
.help-turn-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
/* Who wrote a turn (and Claude's hint level): a row at its top. Claude's read of the student's work
   sits at the right of that row. */
.help-turn { position: relative; }
.help-byline { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.help-byline .help-who { margin: 0; flex: 1; }
.from-tutor > .track { position: absolute; top: 13px; right: 64px; }
.help-who { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; font-weight: 700; font-size: .82rem; letter-spacing: .02em; text-transform: uppercase; color: #6b7a90; }
.help-turn-head .help-who { margin: 0; flex: 1; }
.help-who svg { width: 16px; height: 16px; color: #7655e0; }
.track { font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.track-yes { background: #e6f7ed; color: #146c3a; }
.track-partly { background: #fdf3df; color: #8a5a10; }
.track-no { background: #fdecef; color: #9b1c33; }
.hint-pip { display: inline-flex; gap: 3px; }
.hint-pip i { width: 7px; height: 7px; border-radius: 50%; background: #dde4ee; }
.hint-pip i.on { background: #e8a33d; }
.next-step { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 12px 0 0; padding: 11px 13px; border-radius: 10px; background: #fdf6e8; border: 1px solid #f0dfbb; font-size: .95rem; line-height: 1.5; }
.next-step strong { font-size: .76rem; letter-spacing: .03em; text-transform: uppercase; color: #8a5a10; }
/* With an equation on a line of its own in it, the label goes above the step instead of beside it. */
.next-step:has(.math-display) { display: block; }
.next-step:has(.math-display) > strong { display: block; margin-bottom: 4px; }
.help-read, .help-stuck-note { display: flex; align-items: flex-start; gap: 7px; margin: 10px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.help-read svg, .help-stuck-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.help-turn.thinking p { margin: 0 0 8px; color: var(--muted); }
.failed-turn { border-color: #f3c9d2; background: #fdf6f7; }
.failed-turn p { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #9b1c33; }
.failed-turn svg { width: 18px; height: 18px; flex: none; }
.help-kept { color: var(--muted) !important; font-size: .88rem; }
.help-full { text-align: center; color: var(--muted); padding: 18px; }

.help-composer { padding: 16px 18px; position: sticky; bottom: 12px; box-shadow: 0 6px 24px #0f1d3318; }
.help-composer textarea { width: 100%; padding: 11px 13px; border: 1px solid #c4cfdd; border-radius: 10px; resize: vertical; min-height: 76px; line-height: 1.5; font: inherit; }
.help-composer textarea:focus { border-color: var(--accent); outline: 3px solid #7195ff55; }
.help-photos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.help-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.help-hint-note { margin: 10px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.45; }
.setup-files-note { margin: 0; padding: 0 14px 8px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
#help-files { max-height: 240px; overflow-y: auto; padding: 0 14px 12px; }

@media (max-width: 640px) {
  .help-turn.from-student { margin-left: 0; }
  .help-turn.from-tutor { margin-right: 0; }
  .help-problem, .help-thread { padding-left: 14px; padding-right: 14px; }
}

/* "Hide viewer", next to Course files while a problem is open. Amber, like everything about problems. */
.drive-title { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.drive-title .crumbs { flex: 1; }
.viewer-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 32px; padding: 5px 11px; border-radius: 99px; border: 1px solid #f0dfbb; background: #fdf6e8; color: #8a5a10; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.viewer-toggle svg { width: 16px; height: 16px; }
.viewer-toggle:hover { background: #fbebd4; border-color: #e5c48a; }
.viewer-toggle[aria-expanded="false"] { background: #8a5a10; border-color: #8a5a10; color: #fff; }
.viewer-toggle[aria-expanded="false"]:hover { background: #734a0c; }

/* With a problem open, the viewer stops following the page down (the problem is under it) and takes a
   fixed share of the height; with no file open it shrinks to one line saying where files open. */
.has-problem .viewer { position: static; max-height: none; }
.has-problem .viewer-body { flex: none; min-height: 0; height: min(90vh, 960px); }
.has-problem .viewer-frame { min-height: min(90vh, 960px); }
.has-problem .code-view, .has-problem .word-view { height: min(90vh, 960px); }
.has-problem .viewer:not(.has-file) .viewer-body { height: auto; background: #fff; }
.has-problem .viewer-empty { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 14px 18px; text-align: left; }
.has-problem .viewer-empty .drop-icon { grid-row: span 2; width: 40px; height: 40px; margin: 0; }
.has-problem .viewer-empty .drop-icon svg { width: 20px; height: 20px; }
.has-problem .viewer-empty h3 { margin: 0; font-size: .98rem; }
.has-problem .viewer-empty > p { margin: 2px 0 0; max-width: none; font-size: .86rem; }
.has-problem .viewer-guide { display: none; }
.recent-item.is-open { border-color: #e5c48a; background: #fdf8ee; }

/* the assignment / problem pickers in the "Work through a problem" dialog */
.field select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #c4cfdd; border-radius: 10px; background: #fff; font: inherit; color: var(--ink); }
.field select:focus { border-color: var(--accent); outline: 3px solid #7195ff55; }
.help-reading { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 10px 13px; border-radius: 10px; background: #f7f9fc; border: 1px solid var(--border); color: #43536a; font-size: .88rem; line-height: 1.45; }
.help-reading .dots { margin: 0; flex: none; }
.help-reading .dots i { width: 6px; height: 6px; }
.row-sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-sub > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-role { flex: none; font-size: .72rem; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: #f0f4f9; color: #6b7a90; white-space: nowrap; border: 1px dashed #d4dde8; }
.row-role.set { background: #eaf1fd; color: #2f5c9e; border: 1px solid #cfe0fa; }
@media (max-width: 760px) { .row-role { display: none; } }
.setup-pace { margin: -6px 0 14px; color: var(--muted); font-size: .85rem; line-height: 1.45; }

/* -- how far through the term, at the top of the course list -- */
.term { margin: 0 0 26px; padding: 15px 18px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.term-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.term-title { flex: 1; margin: 0; font-weight: 700; font-size: .98rem; letter-spacing: -.01em; color: var(--ink); }
.term-edit { font-size: .82rem; white-space: nowrap; }
.term-track { height: 9px; border-radius: 99px; background: #e8edf5; overflow: hidden; }
.term-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #5b8cf5); transition: width .5s ease; }
.term-track.is-done i { background: #9fb3cd; }
.term-note { margin: 8px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.45; }

/* -- a course: the files on the left, the one you're reading beside them -- */
.course-layout { grid-template-columns: 330px minmax(0, 1fr); align-items: start; }
/* The course page earns more width than the rest of the portal. */
main.wide { width: min(1560px, calc(100% - 48px)); }
/* Full width under both, and above the sticky viewer rather than behind it. */
.recent, .mistakes { grid-column: 1 / -1; position: relative; z-index: 1; }

/* The file list is narrower here, so it drops the columns it can do without. */
.drive { min-width: 0; display: flex; flex-direction: column; }
.drive .drive-row { grid-template-columns: 30px 34px minmax(0, 1fr) 30px; gap: 4px; padding: 5px 6px; }
.drive .row-size, .drive .row-date, .drive .drive-header .sort:not(:first-of-type) { display: none; }
.drive .row-role { display: none; }
.drive .row-sub { font-size: .76rem; }
.drive .drive-row .file-icon, .drive .drive-row .folder-icon { width: 30px; height: 30px; font-size: .54rem; }
.drive-row.is-open { background: var(--soft); box-shadow: inset 2px 0 0 var(--accent); }
.drive-row.is-open .row-name { color: var(--accent); font-weight: 700; }
/* Long names take two lines before they're cut: "SE 298 - Practice Final - ..." twice says nothing. */
.drive .row-name { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; line-height: 1.3; }

/* What to do with this course, under its files: the two things Claude does, each in its own colour
   (the same purple and amber their dialogs open with, so the one you picked is recognisable). */
.drive-do { display: grid; gap: 8px; margin-top: auto; padding: 14px 12px 12px; border-top: 1px solid var(--border); }
.drive-do-link { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid transparent; border-radius: 12px; text-align: left; font-size: .92rem; font-weight: 700; letter-spacing: -.01em; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.drive-do-link:hover { transform: translateY(-1px); }
.do-chip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; }
.do-chip svg { width: 17px; height: 17px; }
.do-label { flex: 1; min-width: 0; }
.do-go { width: 16px; height: 16px; flex: none; opacity: .45; transition: transform .12s ease, opacity .12s ease; }
.drive-do-link:hover .do-go { opacity: .9; transform: translateX(2px); }

.do-test { background: linear-gradient(135deg, #f3efff 0%, #eef3ff 100%); border-color: #ddd3fb; color: #4b32ad; }
.do-test .do-chip { background: linear-gradient(135deg, #7655e0, #2f6fed); box-shadow: 0 3px 9px #7655e055; }
.do-test:hover { background: linear-gradient(135deg, #ebe4ff 0%, #e4edff 100%); box-shadow: 0 6px 16px #7655e028; }

.do-help { background: linear-gradient(135deg, #fdf3e4 0%, #fff8ec 100%); border-color: #f0dfbb; color: #8a5a10; }
.do-help .do-chip { background: linear-gradient(135deg, #e8a33d, #d9772b); box-shadow: 0 3px 9px #e8a33d55; }
.do-help:hover { background: linear-gradient(135deg, #fbebd4 0%, #fdf2e2 100%); box-shadow: 0 6px 16px #d9772b28; }

/* The file being read. The sticky panel sits inside a plain cell that stretches to the row, because a
   sticky grid item is not reliably held inside its own grid area — it would slide down over the Recent
   work panel below. */
.viewer-col { align-self: stretch; min-width: 0; }
.viewer { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; position: sticky; top: 14px; max-height: calc(100vh - 28px); }
.viewer-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); background: #fbfcfe; flex: none; }
.viewer-kind { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: .58rem; font-weight: 800; letter-spacing: .03em; }
.viewer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.viewer-name { font-weight: 650; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-meta { font-size: .76rem; color: var(--muted); }
/* Tall for reading; it follows the page down, so it never grows past the screen (minus its header). */
.viewer-body { flex: 1; min-height: min(108vh, 1020px, calc(100vh - 90px)); overflow: auto; background: #f4f6fa; }
.viewer-frame { width: 100%; height: 100%; min-height: min(108vh, 1020px, calc(100vh - 90px)); border: 0; background: #f4f6fa; display: block; }
.viewer-image { display: grid; place-items: center; padding: 16px; min-height: 100%; }
.viewer-image img { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 12px #0f1d3326; }
.viewer-media { display: grid; place-items: center; padding: 20px; min-height: 100%; }
.viewer-video { max-width: 100%; border-radius: 10px; }
.viewer-audio { width: min(420px, 100%); }
.viewer-code { margin: 0; padding: 18px 22px; background: #fff; font-size: .86rem; line-height: 1.6; overflow-x: auto; min-height: 100%; }
.viewer-doc { padding: 24px 30px; background: #fff; min-height: 100%; }
.viewer-loading { padding: 24px; color: var(--muted); }
.viewer-cannot { display: grid; place-items: center; gap: 4px; text-align: center; padding: 48px 24px; align-content: center; min-height: 100%; }
.viewer-cannot h3 { margin: 10px 0 2px; font-size: 1.05rem; }
.viewer-cannot p { margin: 0 0 10px; color: var(--muted); font-size: .9rem; max-width: 34ch; line-height: 1.5; }

/* Changing a file: whether it's saved, in the header; a note above the file when there's something to know. */
.viewer-status { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.viewer-status svg { width: 14px; height: 14px; }
.viewer-status.is-saved { color: #23763a; }
.viewer-status.is-retrying, .viewer-status.is-failed { color: var(--red); }
.viewer-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 14px; font-size: .82rem; line-height: 1.45; color: #6b4a12; background: #fff7e6; border-bottom: 1px solid #f0dfbb; }
.viewer-note > svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.viewer-note.is-original { align-items: center; color: #34465f; background: var(--soft); border-bottom-color: var(--border); }
.link-btn { margin-left: auto; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Text and code: VS Code's Dark Modern (code-editor.mjs has the colours), as tall as a PDF. */
.code-view, .word-view { display: flex; flex-direction: column; height: min(108vh, 1020px, calc(100vh - 90px)); }
.code-view { background: #1f1f1f; }
.code-source { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.code-source .cm-editor { flex: 1; min-height: 0; }
.code-view .cm-editor.cm-focused { outline: none; }
.code-view .viewer-doc { display: none; flex: 1; min-height: 0; overflow: auto; }
.code-view.is-preview { background: #fff; }
.code-view.is-preview .viewer-doc { display: block; }
.code-view.is-preview .code-source { display: none; }
.code-tabs { flex: none; display: flex; padding: 0 6px; background: #181818; border-bottom: 1px solid #2b2b2b; }
.code-tab { padding: 8px 16px; border: 0; border-top: 2px solid transparent; background: transparent; color: #9d9d9d; font-size: .8rem; font-weight: 600; cursor: pointer; }
.code-tab:hover { color: #ccc; }
.code-tab[aria-selected="true"] { background: #1f1f1f; color: #fff; border-top-color: #0078d4; }
.code-view.is-preview .code-tabs { background: #f6f8fb; border-bottom-color: var(--border); }
.code-view.is-preview .code-tab { color: var(--muted); }
.code-view.is-preview .code-tab[aria-selected="true"] { background: #fff; color: var(--ink); border-top-color: var(--accent); }

/* Word documents: a page on a desk, with a few formatting buttons above it. */
.word-tools { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 6px 10px; background: #fbfcfe; border-bottom: 1px solid var(--border); }
.word-tool { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #34465f; font-size: .82rem; font-weight: 650; cursor: pointer; }
.word-tool:hover { background: #eef2f8; border-color: #dfe6f0; }
.word-tool.t-bold { font-weight: 850; }
.word-tool.t-italic { font-style: italic; font-family: Georgia, serif; }
.word-tool.t-underline { text-decoration: underline; }
.word-gap { width: 1px; height: 20px; margin: 0 4px; background: var(--border); }
.word-desk { flex: 1; min-height: 0; overflow: auto; padding: 24px 16px 48px; background: #eef1f5; }
.word-sheet { max-width: 816px; min-height: 100%; margin: 0 auto; padding: 56px 64px; background: #fff; color: #1b1b1b; box-shadow: 0 1px 3px #0f1d3326, 0 6px 24px #0f1d3314; font: 16px/1.5 "Liberation Serif", "Times New Roman", Georgia, serif; overflow-wrap: anywhere; outline: none; }
.word-sheet:focus-visible { box-shadow: 0 1px 3px #0f1d3326, 0 0 0 2px #2f6fed66; }
.word-sheet :is(h1, h2, h3, h4, h5, h6) { font-family: inherit; letter-spacing: normal; color: inherit; }   /* the document's, not the site's */
.word-sheet h1 { font-size: 1.7em; margin: .4em 0; }
.word-sheet h2 { font-size: 1.35em; margin: .6em 0 .3em; }
.word-sheet p { margin: 0 0 .6em; }
.word-sheet table { border-collapse: collapse; margin: .6em 0; }
.word-sheet td, .word-sheet th { border: 1px solid #c9ced6; padding: 4px 8px; vertical-align: top; overflow-wrap: normal; }
.word-sheet td p, .word-sheet th p { margin: 0; }
.word-sheet img { max-width: 100%; height: auto; }
.word-sheet a { color: #1f55d0; }

/* Nothing open: the empty panel earns its space by saying what this course has to work with. */
.viewer-empty { padding: 44px 32px; text-align: center; }
.viewer-empty h3 { margin: 12px 0 4px; font-size: 1.15rem; letter-spacing: -.02em; }
.viewer-empty > p { margin: 0 auto 28px; color: var(--muted); font-size: .92rem; max-width: 42ch; line-height: 1.55; }
.viewer-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; max-width: 620px; margin-inline: auto; text-align: left; }
.viewer-guide h4 { margin: 0 0 9px; font-size: .74rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #5a6a81; }
.viewer-guide ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.viewer-tips li { font-size: .88rem; line-height: 1.5; color: #43536a; padding-left: 14px; position: relative; }
.viewer-tips li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: #c3cfdf; }

@media (max-width: 1100px) {
  .course-layout { grid-template-columns: 290px minmax(0, 1fr); }
}
@media (max-width: 920px) {
  /* One column: the file list, then whatever is open, then the recent work. */
  .course-layout { grid-template-columns: minmax(0, 1fr); }
  .viewer { position: static; max-height: none; }
  .viewer-body, .viewer-frame { min-height: 90vh; }
  .code-view, .word-view { height: 90vh; }
  .word-desk { padding: 10px 6px 24px; }
  .word-sheet { padding: 28px 20px; }
  .viewer-empty { padding: 32px 20px; }
  .drive .drive-row { grid-template-columns: 30px 38px minmax(0, 1fr) 36px; gap: 6px; padding: 6px 8px; }
  .drive-do { grid-auto-flow: column; }
}

/* -- the document store, for administrators (#/admin) -- */
.admin-head { margin-bottom: 18px; }
.admin-head h1 { margin: 0 0 6px; font-size: 1.9rem; letter-spacing: -.03em; outline: none; }
.admin-lead { margin: 0; max-width: 72ch; color: var(--muted); line-height: 1.55; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-stat { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.admin-stat strong { font-size: 1.5rem; letter-spacing: -.02em; }
.admin-stat span { font-weight: 650; color: #2b3e5c; }
.admin-stat small { color: var(--muted); font-size: .8rem; }
.admin-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-list-panel { padding: 14px 12px 12px; display: grid; gap: 10px; }
.admin-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 6px; }
.admin-list-head h2 { margin: 0; font-size: 1.05rem; }
.admin-count { color: var(--muted); font-size: .82rem; }
.admin-search { max-width: none; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-height: calc(100vh - 180px); overflow-y: auto; }
.admin-item { display: grid; gap: 3px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.admin-item:hover { background: #f6f8fb; }
.admin-item.is-open { background: var(--soft); border-color: #c9d8f5; }
.admin-item-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-item-title { flex: 1; min-width: 0; font-weight: 650; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-meta, .admin-item-names { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-status { flex: none; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.st-ready { background: #e6f7ed; color: #146c3a; }
.st-new { background: #eef2f7; color: #5a6a81; }
.st-busy { background: #f0ecfd; color: #5b3cc4; }
.st-failed { background: #fdecef; color: #9b1c33; }
.admin-none { padding: 18px 8px; color: var(--muted); font-size: .9rem; text-align: center; }
.admin-reader { padding: 0; overflow: hidden; display: flex; flex-direction: column; position: sticky; top: 14px; max-height: calc(100vh - 28px); }
.admin-reader-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--border); background: #fbfcfe; flex-wrap: wrap; }
.admin-reader-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.admin-reader-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-reader-meta { font-size: .78rem; color: var(--muted); }
.admin-reader-body { overflow-y: auto; padding: 22px 28px 28px; min-height: 320px; }
.admin-summary { margin: 0 0 16px; padding: 10px 13px; border-radius: 10px; background: #f7f9fc; color: #43536a; font-size: .9rem; line-height: 1.5; }
.admin-reader-note { color: var(--muted); line-height: 1.55; max-width: 60ch; }
.admin-reader-empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 48px 20px; }
.admin-reader-empty h3 { margin: 10px 0 2px; }
.admin-reader-empty p { margin: 0; color: var(--muted); max-width: 44ch; line-height: 1.5; }
.admin-markdown { max-width: 80ch; }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-list { max-height: 320px; }
  .admin-reader { position: static; max-height: none; }
  .admin-reader-body { padding: 18px 16px; }
}

/* -- the dashboard, for administrators (#/admin/<tab>, dashboard.mjs): tabs, tables with real headers, CSS bars -- */
/* The line under the tabs is a shadow, so the chosen tab's underline sits on it and nothing overflows. */
.dash-tabs { display: flex; gap: 2px; margin: 0 0 20px; box-shadow: inset 0 -1px 0 var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.dash-tab { flex: none; padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; border-radius: 9px 9px 0 0; background: none; color: var(--muted); font-weight: 650; font-size: .95rem; white-space: nowrap; }
.dash-tab:hover { color: var(--ink); background: #eaf0f8; }
.dash-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.dash-tab:focus-visible { outline-offset: -3px; }
.dash-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.dash-panel:focus-visible { outline-offset: 6px; border-radius: 6px; }
.dash-group h2 { margin: 0 0 10px; font-size: 1.05rem; letter-spacing: -.01em; }
.dash-group .admin-stats { margin-bottom: 0; }
.dash-lead { margin: 0; }
.dash-note { margin: 8px 0 0; max-width: 92ch; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.dash-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dash-count { color: var(--muted); font-size: .88rem; }
.dash-loading, .dash-empty { margin: 0; padding: 14px 0; color: var(--muted); }
.dash-error { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fdecef; color: #9b1c33; }
.dash-notice { margin: 0; padding: 10px 14px; border: 1px solid #f1d78f; border-radius: 10px; background: #fff8e1; color: #5f4500; line-height: 1.5; }
/* A table scrolls sideways inside its frame on a narrow screen; the page itself never does. */
.dash-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dash-table caption { text-align: left; }
.dash-table th, .dash-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #edf1f6; }
.dash-table thead th { position: sticky; top: 0; z-index: 1; background: #f6f8fb; color: #4a5b74; font-size: .74rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.dash-table tbody th { font-weight: 600; min-width: 9rem; }
.dash-table tbody tr:last-child > * { border-bottom: 0; }
.dash-table tbody tr:hover { background: #f8fafd; }
.dash-table .dash-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-students td:nth-child(2), .dash-students td:nth-child(3) { min-width: 10rem; }
.dash-sort { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.dash-sort:hover { color: var(--accent); }
.dash-sort-mark { display: inline-block; min-width: .7em; }
.dash-name { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 650; text-align: left; text-decoration: underline; text-decoration-color: #b9caef; text-underline-offset: 3px; }
.dash-name:hover { text-decoration-color: currentColor; }
.dash-badge { display: inline-block; margin: 0 6px 0 0; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: #1d3f8f; font-size: .66rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; vertical-align: 1px; }
.dash-name + .dash-badge { display: table; margin: 4px 0 0; }
.dash-task { display: block; }
.dash-sub { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.dash-how { color: #43536a; line-height: 1.5; }
.dash-how strong { color: var(--ink); }
.dash-share { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; color: #43536a; font-size: .82rem; font-variant-numeric: tabular-nums; }
.dash-share-track { flex: 1; min-width: 50px; height: 6px; border-radius: 99px; background: #edf1f6; overflow: hidden; }
.dash-share-bar { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.dash-card { padding: 0; overflow: hidden; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.dash-card-head h2, .dash-card-head h3 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.dash-card .dash-table-wrap { border: 0; border-radius: 0; }
.dash-card > .dash-note, .dash-card > .dash-empty, .dash-card > .dash-typed, .dash-card > div > .dash-chart, .dash-card > .dash-chart { margin: 12px 18px; }
.dash-card > .dash-table-wrap + .dash-table-wrap { border-top: 1px solid var(--border); }
.dash-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 20px; align-items: start; }
.dash-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.dash-table .dash-date { white-space: nowrap; }
.dash-segments { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dash-segments button { padding: 6px 12px; border: 0; background: #fff; color: var(--muted); font-size: .85rem; font-weight: 650; }
.dash-segments button + button { border-left: 1px solid var(--border); }
.dash-segments button[aria-pressed="true"] { background: var(--soft); color: var(--accent); }
.dash-segments button:focus-visible { outline-offset: -3px; }
.dash-chart { margin: 0; }
.dash-chart-plot { position: relative; height: 180px; padding-top: 18px; border-bottom: 1px solid #c8d2e0; }
.dash-chart-plot::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; border-top: 1px dashed #dfe5ee; }
.dash-chart-top { position: absolute; top: 0; left: 0; color: var(--muted); font-size: .74rem; }
.dash-chart-bars { position: relative; height: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: var(--gap, 3px); align-items: end; }
.dash-bar { display: block; height: var(--h, 0%); border-radius: 3px 3px 0 0; background: var(--accent); }
.dash-bar:hover { background: var(--accent-hover); }
.dash-chart-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: .74rem; }
.dash-chart figcaption { margin-top: 6px; }
.dash-numbers { margin-top: 8px; font-size: .85rem; }
.dash-numbers summary, .dash-typed summary { cursor: pointer; color: var(--accent); font-weight: 650; font-size: .86rem; }
.dash-numbers .dash-table-wrap { margin-top: 8px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.dash-typed ul { margin: 8px 0 0; padding-left: 18px; columns: 2 200px; font-size: .86rem; line-height: 1.6; }
.dash-typed .dash-sub { display: inline; }
.dash-section-title { margin: 22px 0 0; font-size: 1.05rem; }
.dash-course { margin-top: 14px; }
.dash-course h3 { margin: 0; font-size: .98rem; }
.dash-course > .dash-sub { margin: 2px 0 8px; }
dialog.student-dialog { width: min(1000px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.student-dialog .dialog-head { align-items: flex-start; }
.student-dialog .dialog-head > div { flex: 1; min-width: 0; }
.student-dialog .dialog-body { padding-bottom: 26px; }
.student-dialog .admin-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.student-dialog .admin-stat strong { font-size: 1.2rem; }
.student-dialog .dash-pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
@media (max-width: 680px) {
  .dash-tab { padding: 9px 10px; font-size: .9rem; }
  .dash-table th, .dash-table td { padding: 8px 9px; }
  .dash-card-head { padding: 11px 14px; }
  .dash-card > .dash-note, .dash-card > .dash-empty, .dash-card > .dash-typed, .dash-card > div > .dash-chart, .dash-card > .dash-chart { margin: 10px 14px; }
  .dash-chart-plot { height: 140px; }
  .student-dialog .dialog-head, .student-dialog .dialog-body { padding-left: 16px; padding-right: 16px; }
}

/* Equations of any length sit on a line of their own (math.mjs); in a multiple-choice option, from the left. */
.choice .math-display { text-align: left; margin: .2em 0; }
