:root {
  --navy: #14285a; --gold: #c98d22; --gold-soft: #fbf3e4;
  --bg: #f6f5f1; --card: #ffffff; --ink: #1d2433; --muted: #5f6878; --line: #e3e1da;
  --accent: var(--navy); --aid: #fff8ea; --aid-line: #e7c98f; --danger: #b3261e;
  --fs: 18px; --radius: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Sinhala", "Noto Sans Tamil", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif", "Noto Serif Sinhala", "Noto Serif Tamil", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151d; --card: #1a202b; --ink: #e8e6e1; --muted: #a2a9b6; --line: #2b3342;
    --accent: #9fb4ea; --aid: #2a2416; --aid-line: #6b5528; --gold-soft: #2a2416; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151d; --card: #1a202b; --ink: #e8e6e1; --muted: #a2a9b6; --line: #2b3342;
  --accent: #9fb4ea; --aid: #2a2416; --aid-line: #6b5528; --gold-soft: #2a2416; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: calc(var(--fs) * 16 / 18)/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding-inline: 16px; }
main { flex: 1; padding-block: 20px 48px; outline: none; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(calc(var(--fs) * 1.42), calc(var(--fs) * 0.25 + 3vw), calc(var(--fs) * 1.96)); color: var(--accent); }
h2 { font-size: calc(var(--fs) * 19.2 / 18); }
img { max-width: 100%; height: auto; }

/* header */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { white-space: nowrap; flex: none; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.hdr-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
select.lang { max-width: 42vw; min-width: 0; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: calc(var(--fs) * 14 / 18); }
select.lang option { color: #111; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; padding: 10px; cursor: pointer; }
.menu-btn span { display: block; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; }
.nav { display: flex; gap: 18px; align-items: center; padding-bottom: 10px; flex-wrap: wrap; }
.nav:empty { display: none; }
.nav a, .nav .link { color: #dfe6f7; text-decoration: none; font-size: calc(var(--fs) * 15 / 18); }
.nav a:hover, .nav .link:hover { color: #fff; text-decoration: underline; }
@media (max-width: 640px) {
  .menu-btn { display: block; }
  .nav { display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 0 16px 12px; }
  .nav.open { display: flex; }
  .nav a, .nav .link { padding: 12px 4px; border-top: 1px solid rgba(255,255,255,.12); font-size: calc(var(--fs) * 16 / 18); text-align: start; }
}

/* basics */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-block: 14px; }
.narrow { max-width: 520px; margin-inline: auto; }
.muted, .hint { color: var(--muted); }
.hint { font-size: calc(var(--fs) * 14 / 18); margin: 4px 0 10px; }
.hint.warn { color: var(--gold); }
.center { text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 6px 0; text-decoration: underline; }
.alert { background: var(--gold-soft); border: 1px solid var(--aid-line); border-radius: 12px; padding: 12px 14px; margin-block: 12px; }
.alert.soft { font-size: calc(var(--fs) * 15 / 18); }
.pill { display: inline-block; font-size: calc(var(--fs) * 13 / 18); padding: 4px 10px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); border: 1px solid var(--aid-line); }
.busy { display: grid; place-items: center; padding: 60px 0 10px; }
.busy-msg { text-align: center; color: var(--muted); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* forms */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 600; font-size: calc(var(--fs) * 15 / 18); margin-top: 8px; }
input, textarea, select { font: inherit; font-size: max(16px, calc(var(--fs) * 16 / 18)); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input[type=range] { padding: 0; accent-color: var(--gold); }
input[type=radio] { width: auto; accent-color: var(--navy); }
fieldset { border: 0; padding: 0; margin: 10px 0; }
legend { font-weight: 700; margin-bottom: 8px; }
.role { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer; font-weight: 400 !important; }
.role span { display: flex; flex-direction: column; }
.role small { color: var(--muted); }
.form-msg { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; }
.auth { max-width: 460px; margin: 4vh auto; }
.auth h1 { font-size: calc(var(--fs) * 25.6 / 18); }
.google { width: 100%; margin-top: 8px; }
.google .g { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 800; display: grid; place-items: center; border: 1px solid #ddd; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 16px 0 4px; font-size: calc(var(--fs) * 14 / 18); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form .btn.primary { margin-top: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { min-height: 44px; padding: 8px 18px; border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }

/* home */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hello h1 { margin: 0; }
.continue { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; border-inline-start: 5px solid var(--gold); }
.continue small { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: calc(var(--fs) * 12 / 18); }
.continue b { font-size: calc(var(--fs) * 17.6 / 18); color: var(--accent); }
.module { padding: 0; }
.module summary { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; align-items: center; padding: 16px; cursor: pointer; list-style: none; }
.module summary::-webkit-details-marker { display: none; }
.mnum { width: 40px; height: 40px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.mtitle { display: flex; flex-direction: column; }
.mtitle small { color: var(--muted); }
.module .bar { grid-column: 2; }
.bar { display: block; height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.slist { list-style: none; margin: 0; padding: 0 8px 4px; border-top: 1px solid var(--line); }
.slist a { display: flex; gap: 12px; align-items: center; padding: 12px 8px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); min-height: 44px; }
.snum { color: var(--gold); font-weight: 700; min-width: 2.6em; font-variant-numeric: tabular-nums; }
.tick { margin-inline-start: auto; color: #2e7d32; font-weight: 700; }
.qlink { display: block; padding: 12px 16px 16px; font-weight: 600; }
.extras a { display: block; padding: 8px 0; }

/* reading */
.crumbs { font-size: calc(var(--fs) * 14 / 18); color: var(--muted); margin-bottom: 6px; }
.study { font-size: var(--fs); }
.study h1 { margin-top: 4px; }
.kicker { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: calc(var(--fs) * 13 / 18); margin: 0; }
.summary { font-family: var(--serif); font-style: italic; border-inline-start: 4px solid var(--gold); padding-inline-start: 14px; color: var(--muted); }
.prose, .study p, .study li, .study dd { font-family: var(--serif); line-height: 1.7; }
.study ul, .study ol { padding-inline-start: 1.4em; }
.study li { margin: .25em 0; }
.sec { margin-top: 1.6em; padding-bottom: 6px; border-bottom: 2px solid var(--gold); color: var(--accent); font-size: 1.25em; }
.nh { color: var(--accent); margin-top: 1.4em; font-size: 1.1em; }
.part { color: var(--gold); margin-top: 1.4em; }
.label { font-weight: 700; }
.points h2, .verses h2 { font-size: .8em; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-family: var(--sans); }
.aid { background: var(--aid); border: 1px solid var(--aid-line); border-inline-start: 5px solid var(--gold); }
.aid.tip { border-radius: 12px; padding: 10px 14px; margin: -6px 0 16px; font-size: .9em; }
.aid h2 { color: var(--gold); font-size: .85em; text-transform: uppercase; letter-spacing: .08em; }
.flow { border-collapse: collapse; width: 100%; font-size: .92em; }
.flow td { padding: 8px 6px; border-bottom: 1px solid var(--aid-line); vertical-align: top; font-family: var(--serif); }
.flow .tm { color: var(--gold); font-weight: 700; white-space: nowrap; font-family: var(--sans); }
.draw { font-size: .9em; color: var(--muted); margin-top: 4px; }
.sdiv { display: flex; gap: 10px; align-items: center; margin: 22px 0 8px; font-weight: 700; color: var(--accent); }
.sdiv .sn { background: var(--gold); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: .85em; }
.slide { display: grid; gap: 14px; }
.slide.has-pic { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
.slide h4 { color: var(--accent); font-family: var(--sans); font-size: 1em; }
.slide .pic img { border-radius: 10px; width: 100%; background: var(--line); min-height: 60px; }
.slide img.tbl { width: 100%; border-radius: 8px; background: var(--line); }
.slide ul { margin: 0; }
.slide li.l1 { margin-inline-start: 1.1em; list-style: circle; }
.slide li.l2 { margin-inline-start: 2.2em; list-style: square; }
img.broken { display: none; }
@media (max-width: 640px) { .slide.has-pic { grid-template-columns: 1fr; } }
.verses ul { columns: 2; column-gap: 24px; }
@media (max-width: 480px) { .verses ul { columns: 1; } }
.notes-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.saved { color: var(--muted); font-size: calc(var(--fs) * 13 / 18); }
.done-row { margin: 18px 0; }
.done-row .btn { width: 100%; }
.pager { display: flex; justify-content: space-between; gap: 12px; }
.pager .btn { flex: 1; max-width: 48%; }
.tnote { font-size: calc(var(--fs) * 14 / 18); color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.qh { margin-top: 1.4em; color: var(--accent); font-family: var(--sans); font-size: 1em; text-transform: uppercase; letter-spacing: .05em; }
.qq, .qs { margin: 10px 0 18px; }
.qs { padding-inline-start: 1.2em; }
.qn { color: var(--gold); font-weight: 700; font-family: var(--sans); }
.ans { border-radius: 12px; padding: 10px 14px; margin: 6px 0 10px; font-family: var(--serif); }
.gl dt { font-weight: 700; color: var(--accent); margin-top: 14px; font-family: var(--sans); }
.gl dd { margin: 2px 0 0; }

/* dashboard */
.big-stat { display: flex; gap: 20px; align-items: center; }
.ring { --p: 0; width: 96px; height: 96px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--card) 76%, transparent 77% 100%), conic-gradient(var(--gold) calc(var(--p) * 1%), var(--line) 0); }
.ring span { font-weight: 800; font-size: calc(var(--fs) * 19.2 / 18); color: var(--accent); font-family: var(--sans); }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 30% 3.2em; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: calc(var(--fs) * 15 / 18); }
.mrow a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow small { text-align: end; color: var(--muted); }
.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-family: var(--sans); }
.admin-list small { display: block; color: var(--muted); }
.row { display: flex; gap: 8px; }
.danger { border-color: #e7b7b3; }
.foot { color: var(--muted); font-size: calc(var(--fs) * 13 / 18); padding-block: 20px calc(20px + env(safe-area-inset-bottom)); }

/* reading only: no printing */
@media print {
  body * { display: none !important; }
  body::after { content: "Printing is not available for LIM Study."; display: block; padding: 40px; font: 16px sans-serif; }
}

.aid.soft { padding: 10px 14px; border-radius: 12px; font-size: .9em; margin-block: 10px; }

.notes-tools { display: grid; gap: 6px; }
.notes-tools label { font-weight: 600; font-size: calc(var(--fs) * 15 / 18); margin-top: 6px; font-family: var(--sans); }
.note-list .notes h2 { font-size: calc(var(--fs) * 16 / 18); font-family: var(--sans); }
.note-list .notes h2 a { text-decoration: none; }
.note-list .notes textarea { font-family: var(--sans); }
.notes .hint { font-family: var(--sans); }
.notes-link small { color: var(--accent); }

/* ---- My notes: Keep-style board ---- */
:root { --nc-default: var(--card); --nc-red: #fbe1dd; --nc-orange: #fde6cc; --nc-yellow: #fdf3c4; --nc-green: #e2f1d8; --nc-teal: #d5efeb; --nc-blue: #dbe7fb; --nc-purple: #ebe1f7; --nc-study: #eef1f8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --nc-red: #4a2521; --nc-orange: #4a3220; --nc-yellow: #47401f; --nc-green: #26392a; --nc-teal: #1f3a38; --nc-blue: #233350; --nc-purple: #382a4c; --nc-study: #222a3a; }
}
:root[data-theme="dark"] { --nc-red: #4a2521; --nc-orange: #4a3220; --nc-yellow: #47401f; --nc-green: #26392a; --nc-teal: #1f3a38; --nc-blue: #233350; --nc-purple: #382a4c; --nc-study: #222a3a; }
.nc-default { background: var(--nc-default); } .nc-red { background: var(--nc-red); } .nc-orange { background: var(--nc-orange); }
.nc-yellow { background: var(--nc-yellow); } .nc-green { background: var(--nc-green); } .nc-teal { background: var(--nc-teal); }
.nc-blue { background: var(--nc-blue); } .nc-purple { background: var(--nc-purple); } .nc-study { background: var(--nc-study); }

.notes-page h1 { margin-top: 4px; }
.notes-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-block: 14px; }
@media (max-width: 640px) { .notes-top { grid-template-columns: 1fr; } }
.take-note { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); font: inherit; font-size: calc(var(--fs) * 16 / 18); text-align: start; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.take-note:hover { border-color: var(--gold); }
.take-note .plus { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #fff; font-weight: 700; }
.board-h { font-size: calc(var(--fs) * 12 / 18); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; font-weight: 700; }
.kgrid { columns: 240px; column-gap: 12px; }
.kcard { display: block; width: 100%; break-inside: avoid; margin: 0 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font: inherit; text-align: start; cursor: pointer; position: relative; transition: box-shadow .15s; }
.kcard:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.kcard h3 { margin: 0 0 6px; font-size: calc(var(--fs) * 16 / 18); padding-inline-end: 20px; overflow-wrap: anywhere; }
.kcard p { margin: 0; font-size: calc(var(--fs) * 15 / 18); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .pin-mark { position: absolute; top: 10px; inset-inline-end: 10px; font-size: calc(var(--fs) * 13 / 18); }
.kcard .chip, .chip { display: inline-block; margin-top: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.06); font-size: calc(var(--fs) * 12 / 18); color: var(--muted); }
.empty { margin-top: 24px; }
.add-study summary { cursor: pointer; font-weight: 600; }
.add-study select { margin-top: 6px; }

.note-dlg { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: none; border-radius: 16px; background: transparent; color: var(--ink); }
.note-dlg::backdrop { background: rgba(10, 14, 25, .5); }
.ed-wrap { padding: 16px; border-radius: 16px; display: grid; gap: 10px; }
.ed-studyhead { font-size: calc(var(--fs) * 17 / 18); margin: 0; }
.ed-title, .ed-body { background: transparent; border: none; padding: 6px 2px; }
.ed-title { font-size: calc(var(--fs) * 19 / 18); font-weight: 700; }
.ed-body { min-height: 38vh; font-size: calc(var(--fs) * 16 / 18); }
.ed-title:focus-visible, .ed-body:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--gold); }
.ed-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-lbl { font-size: calc(var(--fs) * 13 / 18); color: var(--muted); width: 100%; }
.ed-link { background: var(--card); }
.ed-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid rgba(0,0,0,.08); padding-top: 10px; }
.ed-foot .grow { flex: 1; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.sw.nc-default { background: var(--card); background-image: linear-gradient(135deg, transparent 45%, var(--muted) 46%, var(--muted) 54%, transparent 55%); }
.sw[aria-checked="true"] { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: calc(var(--fs) * 14 / 18); }
.btn.danger { color: var(--danger); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; gap: 16px; align-items: center; padding: 12px 18px; border-radius: 10px; background: #1d2433; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.toast .link { color: #f2c46b; font-weight: 700; }

/* ---- Assignments ---- */
.assign-page h1 { margin-top: 4px; overflow-wrap: anywhere; }
.arow { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 14px 16px; margin-block: 8px; }
.arow:hover { border-color: var(--gold); }
.arow > div:first-child { display: grid; gap: 2px; min-width: 0; }
.arow small { color: var(--muted); font-size: calc(var(--fs) * 13 / 18); }
.arow-r { flex-shrink: 0; text-align: end; }
.apill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: calc(var(--fs) * 12.5 / 18); font-weight: 700; white-space: nowrap; }
.apill.todo { background: var(--gold-soft); color: #8a5a0b; }
.apill.draft { background: rgba(95,104,120,.14); color: var(--muted); }
.apill.wait { background: #dbe7fb; color: #1d4380; }
.apill.returned { background: #fde6cc; color: #8a4a0b; }
.apill.pass { background: #dff1d6; color: #23602a; }
.apill.fail, .apill.late { background: #fbe1dd; color: #9b2a1f; }
:root[data-theme="dark"] .apill.wait { background: #233350; color: #b9cdf3; }
:root[data-theme="dark"] .apill.pass { background: #26392a; color: #a8d9a1; }
:root[data-theme="dark"] .apill.fail, :root[data-theme="dark"] .apill.late { background: #4a2521; color: #f0b3aa; }
:root[data-theme="dark"] .apill.returned, :root[data-theme="dark"] .apill.todo { background: #4a3220; color: #f2c99a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .apill.wait { background: #233350; color: #b9cdf3; }
  :root:not([data-theme="light"]) .apill.pass { background: #26392a; color: #a8d9a1; }
  :root:not([data-theme="light"]) .apill.fail, :root:not([data-theme="light"]) .apill.late { background: #4a2521; color: #f0b3aa; }
  :root:not([data-theme="light"]) .apill.returned, :root:not([data-theme="light"]) .apill.todo { background: #4a3220; color: #f2c99a; }
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: center; }
.stat b { display: block; font-size: calc(var(--fs) * 24 / 18); color: var(--accent); }
.stat small { color: var(--muted); font-size: calc(var(--fs) * 13 / 18); }
.uname { display: grid; gap: 4px; }
.uname small { color: var(--muted); }
.uname b { font-size: calc(var(--fs) * 20 / 18); }
.mrow2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--gold); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.overview { border-collapse: collapse; width: 100%; font-size: calc(var(--fs) * 14 / 18); }
.overview th, .overview td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.overview thead th { font-size: calc(var(--fs) * 12.5 / 18); color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.overview tbody th, .overview tfoot th { text-align: start; position: sticky; inset-inline-start: 0; background: var(--card); }
.overview .c-pass { color: #23602a; font-weight: 700; } .overview .c-fail { color: var(--danger); font-weight: 700; }
.overview .c-none { color: var(--muted); } .overview .c-wait a { font-weight: 600; }
.overview tfoot { font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } .stats b { font-size: calc(var(--fs) * 20 / 18); } }
.import-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .import-grid { grid-template-columns: 1fr; } }
.import-grid > div { display: grid; gap: 6px; align-content: start; }
.import-grid .hint { margin: 0; }
.bank-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin-block: 8px; }
.bank-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px; font-size: calc(var(--fs) * 14 / 18); }
.bank-item input { width: auto; margin-top: 3px; }
.bank-item small { display: block; color: var(--muted); font-size: calc(var(--fs) * 12 / 18); }
.pagethumbs, .photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.pthumb { display: grid; gap: 6px; width: 140px; }
.pthumb img, .photos a img { width: 140px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 18px; }
.qedit { display: grid; gap: 8px; }
.qedit-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qedit-h select { width: auto; }
.qedit-h .grow, .grow { flex: 1; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: calc(var(--fs) * 14 / 18); }
.marks-in { width: 76px !important; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-block: 4px; }
.opt-row input[type=radio] { width: 20px; height: 20px; flex-shrink: 0; }
.mcq-edit { display: grid; gap: 4px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
.meta { color: var(--muted); font-size: calc(var(--fs) * 14 / 18); }
.instr { white-space: pre-wrap; background: var(--gold-soft); padding: 12px 14px; border-radius: 10px; }
.aqa { display: grid; gap: 8px; }
.aq { margin: 0; font-weight: 600; white-space: pre-wrap; }
.qmarks { color: var(--muted); font-weight: 400; font-size: .9em; }
.mcq { display: grid; gap: 6px; }
.mopt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.mopt input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.mopt:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.gnote { font-size: calc(var(--fs) * 14 / 18); padding: 8px 12px; border-radius: 8px; background: rgba(95,104,120,.1); }
.result { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.result .big { font-size: calc(var(--fs) * 30 / 18); font-weight: 800; }
.result.ok { border-color: #8fc98a; background: #f1faee; } .result.no { border-color: #e5a29a; background: #fdf1ef; } .result.ret { border-color: var(--aid-line); background: var(--aid); display: block; }
:root[data-theme="dark"] .result.ok { background: #1f2e22; } :root[data-theme="dark"] .result.no { background: #3a201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .result.ok { background: #1f2e22; } :root:not([data-theme="light"]) .result.no { background: #3a201d; } }
.orig { display: grid; gap: 10px; margin-top: 10px; }
.orig img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.student-ans { white-space: pre-wrap; padding: 10px 12px; border-inline-start: 3px solid var(--gold); background: var(--gold-soft); border-radius: 6px; font-family: var(--serif); }
.grade-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grade-row > input { flex: 1; min-width: 180px; }
.gsum { font-size: calc(var(--fs) * 18 / 18); margin-bottom: 6px; }
.mcq-review { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.mcq-review li { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.mcq-review li.right { border-color: #8fc98a; }
.mcq-review li.picked:not(.right) { border-color: var(--danger); }
.mcq-review small { color: var(--muted); }
.imgdlg { max-width: min(96vw, 1000px); border: none; border-radius: 12px; padding: 10px; background: var(--card); }
.imgdlg img { max-width: 100%; max-height: 80vh; display: block; margin-bottom: 8px; }
.imgdlg::backdrop { background: rgba(0,0,0,.6); }
.danger-zone summary { cursor: pointer; font-weight: 600; }
.assign-page .admin-list .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sticky-actions.compact { padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.sticky-actions.compact .row-btns { margin: 0; }
.sticky-actions.compact .gsum { margin: 0; }
.sticky-actions.compact .form-msg:empty { display: none; }
/* language picker inside a page card uses the normal field look (the header one is white-on-navy) */
#app select.lang { background: var(--card); color: var(--ink); border: 1px solid var(--line); width: 100%; max-width: none; }
.study .form p, .study .form .hint { font-family: var(--sans); }

/* =====================================================================
   Revamp: app shell (side menu on wide screens, bottom tabs on phones),
   search, dashboards, charts and badges. Colours stay LIM navy + gold.
   ===================================================================== */
:root { --side: 252px; --ok: #2f7d4a; --bad: #b3261e; --info: #2f5fb3; --flame: #c8641e; --gold-a: rgba(201,141,34,.16); }
:root[data-theme="dark"] { --ok: #6cc28a; --bad: #f08a7e; --info: #8fb0f0; --flame: #f0a05a; --gold-a: rgba(201,141,34,.22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #6cc28a; --bad: #f08a7e; --info: #8fb0f0; --flame: #f0a05a; --gold-a: rgba(201,141,34,.22); } }
.ic { width: 20px; height: 20px; flex: none; }

/* ---- shell ---- */
.search-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #e6ebf7; font: inherit; font-size: calc(var(--fs) * 14 / 18); cursor: pointer; }
.search-btn:hover { background: rgba(255,255,255,.14); }
.search-btn kbd, .pal-top kbd { margin-inline-start: auto; font: inherit; font-size: 12px; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); color: #c9d3ea; }
.tabs-bar { display: none; }
body:not(.signed) .search-btn { display: none; }

@media (min-width: 1024px) {
  body.signed { padding-inline-start: var(--side); }
  body.signed .top { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; border-inline-end: 1px solid rgba(255,255,255,.06); }
  body.signed .top .hdr { flex-direction: column; align-items: stretch; max-width: none; padding: 0; gap: 14px; min-height: 0; }
  body.signed .hdr-right { flex-direction: column; align-items: stretch; gap: 8px; }
  body.signed select.lang { max-width: none; width: 100%; }
  body.signed .top .nav { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 0; margin: 22px 0 0; max-width: none; flex: 1; }
  body.signed main.wrap, body.signed footer.wrap { max-width: 1180px; padding-inline: 32px; }
  body.signed .menu-btn { display: none; }
}
.nav-group { display: grid; gap: 2px; }
.nav-h { margin: 0 0 4px 12px; font-size: calc(var(--fs) * 12.5 / 18); color: rgba(255,255,255,.5); font-weight: 600; }
.nav-group a, .navlink { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #d3dbef; text-decoration: none; font: inherit; font-size: calc(var(--fs) * 15 / 18); border: 0; background: none; cursor: pointer; text-align: start; position: relative; }
.nav-group a:hover, .navlink:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-group a.on { background: var(--gold-a); color: #fff; font-weight: 600; }
.nav-group a.on::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav-group a.on .ic { color: var(--gold); }
.nav-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); }
.nav-me b { display: block; color: #fff; font-size: calc(var(--fs) * 14 / 18); }
.nav-me small { color: rgba(255,255,255,.6); font-size: calc(var(--fs) * 12.5 / 18); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex: none; }

@media (max-width: 1023.98px) {
  body.signed .top .nav { display: none !important; }
  body.signed .menu-btn { display: none; }
  body.signed .search-btn { padding: 8px; border-color: transparent; background: transparent; }
  body.signed .search-btn .sb-label, body.signed .search-btn kbd { display: none; }
  body.signed .search-btn .ic { width: 24px; height: 24px; }
  body.signed main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.signed .foot { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.signed .tabs-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 20; background: var(--navy); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1); }
  .tabs-bar a, .tabs-bar button { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; color: #b9c4de; text-decoration: none; font: inherit; font-size: calc(var(--fs) * 11.5 / 18); background: none; border: 0; border-radius: 10px; cursor: pointer; min-width: 0; }
  .tabs-bar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs-bar .ic { width: 22px; height: 22px; }
  .tabs-bar .on { color: #fff; }
  .tabs-bar .on .ic { color: var(--gold); }
}

/* bottom sheet ("More" on phones) */
.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border: 0; padding: 0; background: transparent; }
.sheet::backdrop { background: rgba(8,12,22,.55); }
.sheet-in { background: var(--card); color: var(--ink); border-radius: 18px 18px 0 0; padding: 10px 10px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 2px; }
.sheet-in a, .sheet-in button { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; text-align: start; cursor: pointer; }
.sheet-in a:hover, .sheet-in button:hover { background: var(--gold-a); }
.sheet-in .sheet-close { justify-content: center; color: var(--muted); margin-top: 4px; }

/* search palette */
.palette { border: 0; padding: 0; background: transparent; width: min(640px, calc(100vw - 24px)); margin: 10vh auto auto; }
.palette::backdrop { background: rgba(8,12,22,.6); }
.pal-box { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-top kbd { color: var(--muted); border-color: var(--line); }
.pal-in { border: 0 !important; background: transparent !important; padding: 6px 0 !important; font-size: max(16px, calc(var(--fs) * 17 / 18)) !important; }
.pal-in:focus-visible { outline: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 460px); overflow-y: auto; }
.pal-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal-list li.sel { background: var(--gold-a); }
.pal-list li .ic { color: var(--muted); }
.pal-list .pal-g { cursor: default; padding: 10px 12px 4px; font-size: calc(var(--fs) * 12.5 / 18); color: var(--muted); font-weight: 600; }
.pal-empty { color: var(--muted); cursor: default !important; }

/* ---- dashboards ---- */
.dash { display: grid; gap: 18px; }
.dash > h1 { margin: 4px 0 0; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; background: var(--navy); color: #fff; border-radius: 20px; padding: 28px 30px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(201,141,34,.12); pointer-events: none; }
.hero-date { margin: 0 0 6px; color: #e9c27a; font-size: calc(var(--fs) * 14 / 18); }
.hero-h { font-family: var(--serif); font-weight: 600; color: #fff; font-size: clamp(calc(var(--fs) * 1.6), calc(var(--fs) * .6 + 2.6vw), calc(var(--fs) * 2.5)); margin: 0 0 8px; letter-spacing: -.01em; }
.hero-sub { margin: 0; color: #cdd6ec; }
.verse { margin: 0; border-inline-start: 3px solid var(--gold); padding: 4px 0 4px 18px; position: relative; z-index: 1; }
.verse blockquote { margin: 0 0 8px; font-family: var(--serif); font-style: italic; font-size: calc(var(--fs) * 18.5 / 18); line-height: 1.55; color: #f4f1e8; }
.verse figcaption { color: #e9c27a; font-size: calc(var(--fs) * 13.5 / 18); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; padding: 22px 20px; gap: 18px; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; min-width: 0; }
a.tile:hover { border-color: var(--gold); }
.t-ic { grid-row: 1; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-a); color: var(--gold); }
.t-ic .ic { width: 18px; height: 18px; }
.t-v { grid-column: 1 / -1; font-size: calc(var(--fs) * 28 / 18); line-height: 1.15; margin-top: 10px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.t-l { grid-column: 1 / -1; color: var(--muted); font-size: calc(var(--fs) * 14 / 18); }
.t-s { grid-column: 1 / -1; color: var(--muted); font-size: calc(var(--fs) * 12.5 / 18); margin-top: 2px; }
.tile.t-flame { border-top-color: var(--flame); } .tile.t-flame .t-ic { color: var(--flame); background: color-mix(in srgb, var(--flame) 15%, transparent); }
.tile.t-blue { border-top-color: var(--info); } .tile.t-blue .t-ic { color: var(--info); background: color-mix(in srgb, var(--info) 15%, transparent); }
.tile.t-green { border-top-color: var(--ok); } .tile.t-green .t-ic { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.tile.t-red { border-top-color: var(--bad); } .tile.t-red .t-ic { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid2.g-wide { grid-template-columns: 1.1fr 1fr; }
@media (max-width: 900px) { .grid2, .grid2.g-wide { grid-template-columns: 1fr; } }
.dsec { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; min-width: 0; }
.dsec-h { font-size: calc(var(--fs) * 15 / 18); color: var(--muted); font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.dsec-h::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--gold); }
.more-link { display: inline-block; margin-top: 12px; font-weight: 600; }

.continue-big { display: flex; align-items: center; gap: 20px; background: var(--card); border: 1px solid var(--line); border-inline-start: 5px solid var(--gold); border-radius: 16px; padding: 20px; color: var(--ink); text-decoration: none; }
.continue-big:hover { border-color: var(--gold); }
.continue-big > div:last-child { display: grid; gap: 4px; min-width: 0; }
.continue-big small { color: var(--gold); font-weight: 700; }
.continue-big b { font-size: calc(var(--fs) * 21 / 18); }
.continue-big .btn { justify-self: start; margin-top: 8px; }
.ringw { position: relative; flex: none; display: grid; place-items: center; }
.ringw svg { position: absolute; inset: 0; }
.ring-bg { stroke: var(--line); } .ring-fg { stroke: var(--gold); transition: stroke-dashoffset .8s ease; }
.ring-t { font-weight: 800; font-size: calc(var(--fs) * 17 / 18); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .ring-fg { transition: none; } }

.att { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.att a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.att a:hover { border-color: var(--gold); }
.att a > span:last-child { display: grid; min-width: 0; }
.att a b { font-size: calc(var(--fs) * 13.5 / 18); }
.att a > span:last-child > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--gold-a); color: var(--gold); }
.att-bad .att-ic { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); } .att-bad b { color: var(--bad); }
.att-warn .att-ic { background: color-mix(in srgb, var(--flame) 15%, transparent); color: var(--flame); } .att-warn b { color: var(--flame); }
.att-next .att-ic { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.all-clear { display: flex; align-items: center; gap: 10px; margin: 0; }
.all-clear .ic { color: var(--ok); }

.mbars { display: grid; gap: 4px; }
.mbar { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(60px, 34%) 42px; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: calc(var(--fs) * 14 / 18); }
.mbar:hover { background: var(--gold-a); }
.mb-n { width: 26px; height: 26px; border-radius: 7px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: calc(var(--fs) * 12.5 / 18); }
.mb-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-c { text-align: end; color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-track { display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mb-track i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.mb-track.blue i { background: var(--info); }

.heat-wrap { overflow-x: auto; }
.heat { display: block; width: 100%; min-width: 260px; max-width: 760px; height: auto; }
.heat .hl0 { fill: var(--line); } .heat .hl1 { fill: rgba(201,141,34,.35); } .heat .hl2 { fill: rgba(201,141,34,.6); } .heat .hl3 { fill: rgba(201,141,34,.85); } .heat .hl4 { fill: var(--gold); }
.heat-m { fill: var(--muted); font-size: 10px; }
.heat-legend { display: flex; gap: 4px; align-items: center; justify-content: flex-end; color: var(--muted); font-size: calc(var(--fs) * 12 / 18); margin-top: 6px; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.heat-legend .hl0 { background: var(--line); } .heat-legend .hl1 { background: rgba(201,141,34,.35); } .heat-legend .hl2 { background: rgba(201,141,34,.6); } .heat-legend .hl3 { background: rgba(201,141,34,.85); } .heat-legend .hl4 { background: var(--gold); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: grid; justify-items: start; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.badge .b-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--navy); }
.badge b { font-size: calc(var(--fs) * 14.5 / 18); }
.badge small { color: var(--muted); font-size: calc(var(--fs) * 12.5 / 18); }
.badge.locked { opacity: .6; }
.badge.locked .b-ic { background: var(--line); color: var(--muted); }

.score-wrap { overflow-x: auto; }
.score { width: 100%; min-width: 280px; height: auto; }
.score .grid { stroke: var(--line); } .score .ax { fill: var(--muted); font-size: 11px; }
.score .passline { stroke: var(--muted); stroke-dasharray: 5 5; }
.score .sline { stroke: var(--gold); stroke-width: 2.5; }
.score .dot.ok { fill: var(--ok); } .score .dot.no { fill: var(--bad); }

.cls-cards { display: grid; gap: 10px; }
.cls-card { display: grid; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.cls-card:hover { border-color: var(--gold); }
.cls-card small { color: var(--muted); }
.cls-card .kv { display: flex; justify-content: space-between; font-size: calc(var(--fs) * 13.5 / 18); color: var(--muted); margin-top: 4px; }
.cls-card .kv b { color: var(--ink); }
.spread { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.spread-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.spread-card small { color: var(--muted); }
.bins { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; height: 90px; align-items: end; margin-top: 8px; }
.bin { display: grid; grid-template-rows: 1fr auto; height: 100%; align-items: end; text-align: center; }
.bin i { display: block; background: var(--gold); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bin small { font-size: 11px; color: var(--muted); }

.course-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.course-head h1 { margin: 0; }
.big-stat { display: flex; align-items: center; gap: 24px; }

/* reading pages stay at a comfortable line length inside the wider layout */
body.signed article.study { max-width: 780px; margin-inline: auto; }
body.signed .notes-page, body.signed .assign-page { max-width: 1000px; margin-inline: auto; }

@media (max-width: 640px) {
  .mbar { grid-template-columns: 30px minmax(0, 1fr) 44px; grid-template-rows: auto auto; row-gap: 6px; }
  .mbar .mb-n { grid-column: 1; grid-row: 1 / 3; }
  .mbar .mb-t { grid-column: 2; grid-row: 1; white-space: normal; }
  .mbar .mb-track { grid-column: 2; grid-row: 2; }
  .mbar .mb-c { grid-column: 3; grid-row: 1 / 3; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-v { font-size: calc(var(--fs) * 24 / 18); }
}

/* username suggestions when adding a student */
.uname-box { position: relative; }
.uname-list { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 15; list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); max-height: 280px; overflow-y: auto; }
.uname-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.uname-list li.sel, .uname-list li:hover { background: var(--gold-a); }
.uname-list small { margin-inline-start: auto; color: var(--muted); }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.uname-status { min-height: 1.3em; margin: 6px 0 2px; font-size: calc(var(--fs) * 14 / 18); color: var(--muted); }
.uname-status.ok { color: var(--ok); font-weight: 600; }
.uname-status.warn { color: var(--flame); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
