/* WorkbookLab brand: navy #171539, lavender #c3add3, warm paper #faf8f4. ("--blue" is the accent.) */
:root {
  --ink: #171539; --ink-2: #3a3854; --muted: #66647a; --line: #e8e5df; --line-2: #d6d2ca;
  --bg: #faf8f4; --surface: #fff; --blue: #3b3486; --blue-soft: #f1edf7; --lavender: #c3add3; --navy: #171539;
  --green: #15803d; --green-soft: #f0fdf4; --red: #b91c1c; --red-soft: #fef2f2; --amber: #92400e; --amber-soft: #fffbeb;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3, .logo, .tabs, .top nav { font-family: "DM Sans", Inter, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -0.01em; }
.exam-home .exam-title { font-size: 22px; margin: 0 0 2px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #f3f4f6; padding: 1px 4px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .right { text-align: right; }
.ok { color: var(--green); } .full { width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* header */
.top { display: flex; align-items: center; gap: 24px; height: 54px; padding: 0 20px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; }
.logo { color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.logo svg { width: 30px; height: 18px; flex: none; }
.logo:hover { text-decoration: none; }
.logo.dark { color: var(--ink); margin-bottom: 18px; }
.logo-mark { color: #93c5fd; font-size: 16px; }
.logo.dark .logo-mark { color: var(--blue); }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { color: #d9d3e6; padding: 6px 11px; border-radius: 6px; font-weight: 500; }
.top nav a.on, .top nav a:hover { color: #fff; background: rgba(195, 173, 211, .18); text-decoration: none; }
.top nav a.on { box-shadow: inset 0 -2px 0 var(--lavender); border-radius: 6px 6px 0 0; }
.who { display: flex; gap: 12px; align-items: center; color: #d9d3e6; font-size: 13px; }
.top-links { display: contents; }
.top-menu-btn { display: none; margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: #fff; cursor: pointer; align-items: center; justify-content: center; }
.top-menu-btn:hover, .top-menu-btn[aria-expanded="true"] { background: rgba(195, 173, 211, .18); }
.top-menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* Narrow screens: the links fold into a menu under the bar instead of pushing the page wider. */
@media (max-width: 980px) {
  .top { gap: 8px; padding: 0 8px 0 14px; }
  .top-menu-btn { display: inline-flex; }
  .top-links { display: none; }
  .top.menu-open .top-links { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy);
    padding: 6px 12px 14px; box-shadow: 0 10px 24px rgba(23, 21, 57, .35); max-height: calc(100vh - 54px); overflow-y: auto; }
  .top.menu-open nav { flex-direction: column; gap: 2px; }
  .top.menu-open nav a { padding: 12px 12px; font-size: 16px; border-radius: 8px; }
  .top.menu-open nav a.on { box-shadow: inset 3px 0 0 var(--lavender); border-radius: 8px; }
  .top.menu-open .who { margin: 8px 0 0; padding: 12px 12px 0; border-top: 1px solid rgba(255, 255, 255, .15); justify-content: space-between; font-size: 15px; }
  .top.menu-open .who span { display: inline; }
}

/* layout */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 20px 48px; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 220px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.spinner { padding: 40px; text-align: center; color: var(--muted); }

/* controls */
input, select, textarea { font: inherit; color: inherit; border: 1px solid #8a8698; border-radius: 6px; padding: 7px 9px; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
/* date inputs: focus sits in the day/month fields inside, so :focus alone doesn't show the ring */
input[type=date]:focus-within, input[type=time]:focus-within, input[type=datetime-local]:focus-within { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 1px; }
input.compact { padding: 4px 6px; font-size: 13px; width: 100%; }
textarea.code { width: 100%; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.btn { font: inherit; font-weight: 600; border-radius: 6px; padding: 7px 14px; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px; justify-content: center; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { border-color: var(--muted); }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--muted); padding: 2px 6px; border-radius: 4px; }
.icon-btn:hover:not(:disabled) { background: #f3f4f6; color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); cursor: pointer; font: inherit; }
.link-btn.light { color: #d9d3e6; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > select, .field > input, .field > textarea { max-width: 100%; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.span-all { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* badges, pills, notes */
.badge { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #f3f4f6; color: var(--ink-2); vertical-align: 1px; }
.badge-reading { background: var(--blue-soft); color: var(--blue); }
.badge-module { background: #f5f3ff; color: #6d28d9; }
.badge-html { background: #ecfeff; color: #0e7490; }
.badge-file { background: var(--amber-soft); color: var(--amber); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f3f4f6; color: var(--ink-2); white-space: nowrap; }
.pill-ok { background: var(--green-soft); color: var(--green); }
.pill-warn { background: var(--amber-soft); color: var(--amber); }
.note { padding: 10px 12px; border-radius: 6px; margin: 10px 0; font-size: 13px; }
.note-error { background: var(--red-soft); color: var(--red); }
.note-ok { background: var(--green-soft); color: var(--green); }

/* tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fafafa; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-hidden td { opacity: .55; }
.order { white-space: nowrap; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.gradebook th, .gradebook td { white-space: nowrap; }
.gb-head { max-width: 160px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.gb-cell { text-align: center; }
.gb-done { background: var(--green-soft); }
.gb-part { background: var(--amber-soft); }
.sticky { position: sticky; left: 0; background: #fff; z-index: 1; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab-on { color: var(--ink); border-bottom-color: var(--ink); }

/* course cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); }
.card:hover { border-color: var(--line-2); text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-subject { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); }
.card-title { font-size: 16px; font-weight: 700; margin: 4px 0; }
.card-code { margin-top: 10px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; color: var(--muted); }
.join-code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.join-code strong { color: var(--ink); font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; margin-left: 4px; }
.join { display: flex; gap: 6px; }
.join input { width: 140px; font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; }

/* student assignment list */
.assignments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.assignment-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; color: var(--ink); }
.assignment-card:hover { border-color: var(--line-2); text-decoration: none; }
.a-title { font-weight: 600; margin-bottom: 2px; }

/* modal */
.shade { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,.2); outline: none; }
.modal-wide { max-width: 1100px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafafa; border-radius: 0 0 10px 10px; }
.modal-foot .muted { margin-right: auto; }
.assign-box { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 12px; background: #fafafa; border: 1px solid var(--line); border-radius: 6px; padding: 12px 12px 0; margin-top: 14px; }
.pick-list { list-style: none; padding: 0; margin: 12px 0 0; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.pick-list li + li { border-top: 1px solid var(--line); }
.pick-list button { width: 100%; text-align: left; border: 0; background: #fff; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.pick-list button:hover { background: #f9fafb; }
.drop { border: 2px dashed var(--line-2); border-radius: 8px; padding: 36px; text-align: center; display: flex; flex-direction: column; gap: 6px; cursor: pointer; background: #fafafa; }
.drop-over { border-color: var(--blue); background: var(--blue-soft); }

/* reading editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.editor-pane { display: flex; flex-direction: column; gap: 8px; }
.editor-pane textarea { min-height: 460px; flex: 1; }
.editor-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.editor-preview { border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; max-height: 600px; overflow-y: auto; background: #fff; }
.preview-label { margin-bottom: 6px; }
.format-help summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.format-help ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }

/* player */
.player { min-height: 100vh; display: flex; flex-direction: column; }
.player-full { height: 100vh; }
.player-bar { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.player-bar .back { margin: 0; }
.player-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.player-title strong, .player-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title h1 { font-size: inherit; font-weight: 700; margin: 0; line-height: inherit; min-width: 0; }
.player-title .muted { white-space: nowrap; }
.frame { flex: 1; width: 100%; border: 0; background: #fff; min-height: 600px; }
.file-bar { padding: 8px 16px; background: #fafafa; border-bottom: 1px solid var(--line); }
.tools-row { padding-top: 0; }
.item-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }

/* reading */
.reader { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 32px 32px; }
.editor-preview .reader { border: 0; padding: 0; }
.reader-progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 16px; position: sticky; top: 0; background: #fff; padding: 8px 0; z-index: 2; }
.bar { flex: 1; height: 6px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); transition: width .3s; }
.prose { font-size: 15.5px; line-height: 1.65; }
.prose h1 { font-size: 26px; margin: 4px 0 14px; }
.prose h2 { font-size: 19px; margin: 26px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 12px; }
.prose table { border-collapse: collapse; margin: 10px 0 16px; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose th { background: #fafafa; }
.callout { background: #f9fafb; border-left: 3px solid var(--line-2); padding: 10px 14px; margin: 12px 0; color: var(--ink-2); font-size: 14px; }
.callout p:last-child { margin: 0; }
.check { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; position: relative; background: #fff; }
.check-solved { border-color: #bbf7d0; background: #fcfffd; }
.check-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); margin-bottom: 4px; }
.check-solved .check-tag { color: var(--green); }
.check .prose p:last-child { margin-bottom: 8px; }
.options { display: grid; gap: 6px; }
.option { text-align: left; font: inherit; font-size: 14.5px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; cursor: pointer; }
.option:hover:not(:disabled) { border-color: var(--muted); }
.option:disabled { cursor: default; }
.option-wrong { border-color: #fecaca; background: var(--red-soft); color: #7f1d1d; text-decoration: line-through; text-decoration-color: rgba(127,29,29,.4); }
.option-right { border-color: var(--green); background: var(--green-soft); }
.numeric { display: flex; gap: 6px; align-items: center; }
.numeric input { width: 160px; }
.affix { color: var(--muted); font-weight: 600; }
.feedback { margin: 10px 0 0; font-size: 14px; }
.feedback-no { color: var(--red); }
.feedback-ok { color: var(--green); }
.hint { margin: 10px 0 0; font-size: 14px; color: var(--amber); background: var(--amber-soft); padding: 6px 10px; border-radius: 6px; }
.check .link-btn { margin-top: 10px; font-size: 13px; }

/* charts */
.chart { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-title { text-align: center; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.chart-source { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* weeks (course modules) */
.week { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.week-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafafa; flex-wrap: wrap; }
.week-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.week-desc { padding: 8px 16px 0; margin: 0; }
.week .assignments { padding: 10px 12px 12px; }
.week .assignment-card { border-color: var(--line); }
.week-locked .assignments { opacity: .6; }
.week-teacher .table { border: 0; border-radius: 0; }
.week-actions { margin-left: auto; display: flex; gap: 6px; }
.release { display: flex; align-items: center; gap: 8px; }
.release input { width: 200px; }
.title-btn { color: var(--ink); font-weight: 700; font-size: 16px; }
.card-locked { cursor: default; color: var(--muted); background: #fafafa; }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.sec { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: #f3f4f6; color: var(--ink-2); vertical-align: 1px; }
.sec-reading { background: var(--blue-soft); color: var(--blue); }
.sec-assignment { background: #fef3c7; color: #92400e; }
.sec-exam { background: #fee2e2; color: #991b1b; }
.sec-resource { background: #ecfdf5; color: #047857; }
.nowrap { white-space: nowrap; }
.pill-bad { background: var(--red-soft); color: var(--red); }
.card-foot { margin-top: 10px; }
.grade-total { display: flex; justify-content: space-between; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.big-num { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.settings-grid fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 2px; margin: 0; }
.settings-grid legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.gb-ungraded { background: #fafafa; color: var(--muted); }
.gb-missing { background: var(--red-soft); color: var(--red); }
.gb-flags .late { color: var(--red); font-weight: 600; }
.notice { padding: 10px 16px; background: #f3f4f6; color: var(--ink-2); font-size: 14px; border-bottom: 1px solid var(--line); }
.notice-warn { background: var(--amber-soft); color: var(--amber); }
.notice-bad { background: var(--red-soft); color: var(--red); }

.pick-week { margin-bottom: 12px; }
.pick-week-head { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; }

/* bulk edit */
.bulk-bar { position: sticky; top: 56px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.bulk-bar .btn-secondary { background: #1f2937; color: #fff; border-color: #374151; }
.bulk-bar .btn-primary { background: #fff; color: var(--ink); }
.bulk-bar .link-btn { color: #d1d5db; margin-left: auto; }
.compact-select { padding: 4px 8px; font-size: 13px; }
.row-selected td { background: var(--blue-soft); }
.bulk-field { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0 0 10px; }
.bulk-field legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.rel-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.rel-row input[type=number] { width: 72px; }
.copy-preview { margin-top: 12px; }

/* finish panel */
.finish { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 18px 20px; border: 1px solid #bbf7d0; background: var(--green-soft); border-radius: var(--radius); }
.finish-text { display: flex; flex-direction: column; gap: 2px; }
.finish-text strong { color: var(--green); font-size: 16px; }
.finish-text span { color: var(--ink-2); }
.finish-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.finish-compact { margin: 0; border-radius: 0; border-width: 0 0 1px; padding: 10px 16px; }
.reader-foot { margin-top: 16px; font-size: 13px; }

/* autosave confirmation */
.saved { display: block; font-size: 11px; font-weight: 600; color: var(--green); margin-top: 2px; animation: fadein .15s ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* panels, LMS page */
.page-narrow-wide { max-width: 1080px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.panel h2 { margin-bottom: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.copy-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px; align-items: start; margin: 6px 0; }
.copy-row input, .copy-row textarea { width: 100%; font: 12px ui-monospace, Menlo, monospace; background: #fafafa; }
.copy-label { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-top: 7px; }
.form-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.add-platform { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 12px; background: #fafafa; }
.steps { margin: 0; padding-left: 18px; color: var(--ink-2); }
.steps li { margin: 4px 0; }
.bad { color: var(--red); }
.pick-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; }
.pick-row:hover { background: #f9fafb; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: 100%; max-width: 380px; }
.login-card h1 { margin-bottom: 14px; }
.seg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin-bottom: 12px; }
.seg button { font: inherit; font-weight: 600; padding: 8px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.seg button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.demo { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

@media (max-width: 760px) {
  .form-grid, .form-grid.two, .assign-box, .editor, .copy-row, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .week-actions { margin-left: 0; }
  .reader { padding: 18px 16px 24px; }
  .top { gap: 12px; padding: 0 12px; }
  .who span { display: none; }
  .player-title .muted { display: none; }
  .player-bar { gap: 8px; }
  .player-title { flex-basis: 100%; order: 3; }
  .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
  .gradebook th, .gradebook td { display: table-cell !important; }
  .monitor .table th, .monitor .table td { display: table-cell !important; }   /* every column and button; the table scrolls */
}

/* Per-student panel */
.gb-click { cursor: pointer; position: relative; }
.gb-click:hover, .gb-click:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.gb-excused { background: #f5f5f4; color: var(--muted); }
.gb-star { position: absolute; top: 2px; right: 4px; font-size: 11px; color: #d97706; }
.panel-h { font-size: 14px; margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
.table-compact td, .table-compact th { padding: 6px 8px; }
.quick-row { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.modal-foot .spacer { flex: 1; }
.modal-foot .saved { display: inline; margin: 0; font-size: 13px; }

/* Canvas-style modules */
.caret { background: none; border: 0; font-size: 14px; width: 22px; cursor: pointer; color: var(--muted); padding: 0; }
.grip { cursor: grab; color: #707070; font-size: 14px; padding: 0 4px; user-select: none; }
.week-unpub { border-style: dashed; }
.week-unpub .week-head h2 .title-btn { color: var(--muted); }
.pub { background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); white-space: nowrap; }
.pub-on { color: var(--green); border-color: #bbf7d0; background: #f0fdf4; }
td .pub span { font-weight: 500; }
.row-header td { background: #fafafa; }
.text-header-t { font-size: 14px; }
.text-header { list-style: none; font-weight: 700; font-size: 14px; padding: 10px 4px 4px; color: var(--ink, #111); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.drop-line td, li.drop-line { box-shadow: inset 0 2px 0 var(--blue); }
.drop-line.week-head { box-shadow: inset 0 3px 0 var(--blue); }
.drop-here { outline: 2px dashed var(--blue); outline-offset: 2px; }
tr[draggable="true"] { cursor: default; }
.toolbar .spacer, .spacer { flex: 1; }
.toolbar-right { justify-content: flex-end; }
.cat-chip { background: #eef2ff; color: #3730a3; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600; }
.cat-chip-ec { background: #fef3c7; color: #92400e; }

/* Gradebook categories */
.gb-cat { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #4f46e5; font-weight: 700; }
.gb-catcol { background: #f8fafc; text-align: center; white-space: nowrap; }
/* Frozen gradebook columns: student name on the left; category and Total columns on the right.
   .table's overflow:hidden and collapsed borders break position:sticky, so the gradebook undoes both. */
.table.gradebook { overflow: visible; border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.gradebook .sticky { z-index: 2; box-shadow: inset -1px 0 0 var(--line), 4px 0 6px -4px rgba(15,23,42,.12); }
.gradebook th.sticky { background: #fafafa; }
.gradebook .gb-catcol { width: 116px; min-width: 116px; max-width: 116px; box-sizing: border-box; white-space: normal; overflow-wrap: anywhere; }
.gradebook .gb-total { width: 110px; min-width: 110px; max-width: 110px; box-sizing: border-box; background: #fff; }
.gradebook th.gb-total { background: #fafafa; }
.gradebook .gb-pin-r { position: sticky; right: var(--r, 0px); z-index: 2; }
.gradebook .gb-pin-edge { box-shadow: inset 1px 0 0 var(--line), -4px 0 6px -4px rgba(15,23,42,.12); }
@media (max-width: 760px) {   /* not enough room to pin the right-hand columns on a phone */
  .gradebook .gb-pin-r { position: static; box-shadow: none; }
}
.gb-dropped { text-decoration: line-through; color: var(--muted); background: repeating-linear-gradient(135deg, #fff, #fff 6px, #f5f5f5 6px, #f5f5f5 12px); }
.row-dropped td { color: var(--muted); }
.row-dropped td:not(:first-child) { text-decoration: line-through; }
.cats .seg { margin-bottom: 14px; }
.cats .seg button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 14px; }
.cats .seg button span { font-size: 11px; font-weight: 400; color: var(--muted); }
.cats-table input, .cats-table select { width: 100%; }
.cat-ec td { background: #fffbeb; }
.cat-note { color: #92400e; margin-top: 3px; }
.pct-input { display: flex; align-items: center; gap: 4px; }
.pct-input input { width: 70px; }
.ok-text { color: var(--green); } .warn-text { color: #b45309; }
.saved.inline { display: inline; margin: 0 8px; font-size: 13px; }
details.help { margin-top: 12px; font-size: 13px; color: var(--muted); }
details.help summary { cursor: pointer; font-weight: 600; color: var(--ink, #111); }
.cat-summary { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; margin-top: 8px; }
.cat-summary > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 120px; background: #fff; }
.cat-summary strong { font-size: 18px; }
.grade-total { flex-wrap: wrap; }
.list-group { margin: 18px 0; }
.list-group h2 { font-size: 16px; margin-bottom: 8px; }

/* Due this week, assignments list, calendar */
.upcoming { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px 16px; margin-bottom: 18px; }
.upcoming-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.upcoming-head h2 { font-size: 16px; margin: 0; }
.up-list { list-style: none; margin: 0; padding: 0; }
.up-list li + li { border-top: 1px solid var(--line); }
.up-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 4px; color: inherit; text-decoration: none; }
a.up-row:hover { background: #f8fafc; }
.up-when { display: flex; flex-direction: column; font-size: 13px; }
.up-when span { color: var(--muted); font-size: 12px; }
.up-title { font-weight: 600; }
.up-overdue { border-left: 3px solid var(--red); padding-left: 8px; margin-bottom: 8px; }
.up-empty { margin: 4px 0; }
.seg-small button { padding: 5px 12px; font-size: 13px; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { font-size: 18px; margin: 0 6px; min-width: 170px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: #f8fafc; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; }
.cal-day { background: #fff; min-height: 104px; padding: 4px 5px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.cal-out { background: #fafafa; }
.cal-out .cal-num { color: #6f6f6f; }
.cal-num { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cal-today .cal-num { background: var(--blue); color: #fff; }
.cal-picked { box-shadow: inset 0 0 0 2px #93c5fd; }
.cal-ev { font-size: 11.5px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: #1e3a8a; background: #dbeafe; }
.cal-ev.cal-done { background: #dcfce7; color: #166534; text-decoration: line-through; }
.cal-ev.cal-missing { background: #fee2e2; color: #991b1b; }
.cal-ev.cal-started { background: #fef3c7; color: #92400e; }
.cal-ev.cal-locked, .cal-ev.cal-hidden { background: #f3f4f6; color: #6b7280; }
.cal-time { font-weight: 700; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; }
.cal-dots i.cal-done { background: #22c55e; } .cal-dots i.cal-missing { background: #ef4444; } .cal-dots i.cal-started { background: #f59e0b; }
.cal-daylist { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px 16px; }
.cal-daylist h3 { font-size: 15px; margin: 0 0 6px; }
.sync-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.sync-link { display: flex; gap: 6px; margin: 10px 0; }
.sync-link input { flex: 1; font-size: 12px; }
@media (max-width: 720px) {
  .cal-day { min-height: 54px; }
  .cal-ev, .cal-more { display: none; }
  .cal-dots { display: flex; }
  .up-row { grid-template-columns: 84px minmax(0, 1fr); }
  .up-row .pill { grid-column: 2; justify-self: start; }
}

/* Several classes at once; resource order */
.course-picker { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.course-picker legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.course-picker label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.res-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.res-list li + li { border-top: 1px solid var(--line); }
.res-list .res-remove { margin-left: auto; color: var(--red); }
.res-list li[draggable] { cursor: grab; }
.res-main { flex: 1; min-width: 0; }
.res-list .order { display: flex; }
.cats-table td { vertical-align: top; }
.cats-table .pct-input input { width: 60px; }

/* Brand touches */
code { background: #f1eef4; }
.tabs button.on, .tabs a.on { color: var(--navy); }
.card { background: var(--surface); }
.page-head h1 { font-size: 26px; letter-spacing: -0.02em; }
.tab-on { color: var(--navy); border-bottom-color: var(--lavender); border-bottom-width: 3px; }

/* Questions */
.q-prompt { margin-bottom: 10px; }
.q-prompt img, .prose img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.q-choices { display: flex; flex-direction: column; gap: 6px; }
.q-choice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 12px; cursor: pointer; background: #fff; flex-wrap: wrap; }
.q-choice:hover { border-color: var(--lavender); }
.q-choice.picked { border-color: var(--blue); background: var(--blue-soft); }
.q-choice.right { border-color: #86efac; background: var(--green-soft); }
.q-choice.wrong { border-color: #fca5a5; background: var(--red-soft); }
.q-choice input { margin-top: 3px; }
.q-letter { font-weight: 700; color: var(--muted); min-width: 14px; }
.q-ctext { flex: 1; min-width: 0; }
.q-ctext p { margin: 0; }
.q-mark { color: var(--green); font-weight: 700; }
.q-cfb { flex-basis: 100%; font-size: 13px; color: var(--ink-2); padding-left: 38px; }
.q-tf { flex-direction: row; }
.q-tf .q-choice { flex: 1; }
.q-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-num { width: 160px; }
.q-text { width: min(420px, 100%); }
input.right, .q-num.right { border-color: #86efac; background: var(--green-soft); }
input.wrong, .q-num.wrong { border-color: #fca5a5; background: var(--red-soft); }
.q-key { color: var(--green); font-size: 13px; font-weight: 600; }
.q-block { display: block; margin-top: 6px; color: var(--ink-2); font-weight: 400; }
.q-essay { width: 100%; resize: vertical; }
.q-match, .q-table { border-collapse: collapse; width: 100%; }
.q-match td, .q-table td, .q-table th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.q-table th { font-weight: 500; width: 45%; }
.q-match tr.right td, .q-table tr.right td, .q-table tr.right th { background: var(--green-soft); }
.q-match tr.wrong td, .q-table tr.wrong td, .q-table tr.wrong th { background: var(--red-soft); }
.q-feedback { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--lavender); background: #faf7fc; border-radius: 0 6px 6px 0; font-size: 13.5px; }
.q-feedback p { margin: 0; }
.q-comment { margin-top: 10px; padding: 8px 12px; background: var(--amber-soft); border-radius: 6px; font-size: 13.5px; }

/* Question bank */
.page-wide { max-width: 1280px; }
.bank { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.bank-folders { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.bank-folders button { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; font: inherit; padding: 7px 12px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.bank-folders button span { color: var(--muted); font-size: 12px; }
.bank-folders button:hover { background: var(--blue-soft); }
.bank-folders button.on { background: var(--navy); color: #fff; }
.bank-folders button.on span { color: var(--lavender); }
.bank-folders .add { color: var(--blue); font-weight: 600; }
.qlist .qtitle { font-weight: 600; text-align: left; color: var(--ink); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.import-list li { margin-bottom: 4px; }
.skipped { max-height: 200px; overflow: auto; }
.qedit { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.qedit-form textarea { width: 100%; }
.qedit-preview { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; align-self: start; position: sticky; top: 0; }
.upper { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-bottom: 8px; }
.qedit-answers { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.ae-choice { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 6px; }
.ae-choice.right { background: var(--green-soft); }
.ae-fields { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ae-fields input { width: 100%; }
.ae-fb { font-size: 12.5px; }
.ae-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.ae-row input, .ae-row textarea { flex: 1; }
.ae-part { border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.ae-num { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.ae-num .field { width: 110px; margin: 0; }
.file-btn { cursor: pointer; }
.pick-qs { list-style: none; padding: 0; margin: 0; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-qs li + li { border-top: 1px solid var(--line); }
.pick-qs label { display: flex; gap: 10px; padding: 8px 12px; cursor: pointer; }
.pick-qs label span { display: flex; flex-direction: column; }

/* Exam builder */
.eb-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.eb-parts { list-style: none; padding: 0; margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.eb-part { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.eb-part + .eb-part { border-top: 1px solid var(--line); }
.eb-main { flex: 1; min-width: 0; }
.eb-pool { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.eb-pool input { width: 64px; }
.eb-pts { display: flex; gap: 4px; align-items: center; }
.eb-pts input { width: 64px; }
.eb-options { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0; }

/* Taking an exam */
.exam-home { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.exam-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 16px 0; }
.exam-facts div { background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.exam-facts dt { font-size: 12px; color: var(--muted); }
.exam-facts dd { margin: 0; font-weight: 600; }
.exam-take { min-height: 100vh; }
.exam-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--navy); color: #fff; }
.exam-title { flex: 1; font-family: "DM Sans", Inter, sans-serif; font-size: 16px; }
.save-state { font-size: 12.5px; color: #d9d3e6; }
.save-state.error { color: #fecaca; font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 6px; }
.timer.low { background: #fde68a; color: #78350f; }
.exam-bar .btn-primary { background: var(--lavender); color: var(--navy); }
.exam-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; max-width: 1040px; margin: 0 auto; padding: 22px 20px 60px; }
.qmap { position: sticky; top: 70px; align-self: start; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.qmap button { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; padding: 6px 0; font: inherit; font-weight: 600; cursor: pointer; position: relative; }
.qmap button.done { background: var(--blue-soft); border-color: var(--lavender); }
.qmap button.flag::after { content: ""; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: #d97706; }
.qmap button.here { outline: 2px solid var(--navy); }
.qmap-key { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.qmap-key span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--lavender); background: var(--blue-soft); }
.qmap-key span.flag { background: #d97706; border-color: #d97706; border-radius: 50%; margin-left: 6px; }
.exam-q { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; scroll-margin-top: 70px; }
.exam-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.exam-q-head strong { font-family: "DM Sans", Inter, sans-serif; }
.flag-btn { margin-left: auto; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.flag-btn.on { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.review-q.is-right { border-left: 4px solid #22c55e; }
.review-q.is-wrong { border-left: 4px solid #ef4444; }
.review-q.is-pending { border-left: 4px solid #f59e0b; }
.exam-q-head .pill { margin-left: auto; }
.grade-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.grade-box input[type=number] { width: 80px; }
.grade-comment { flex: 1; min-width: 200px; }
.exam-score { text-align: right; }
.gb-pending { position: absolute; top: 2px; left: 4px; font-size: 11px; color: #b45309; }
@media (max-width: 760px) {
  .bank, .qedit, .exam-layout { grid-template-columns: minmax(0, 1fr); }
  .qmap { position: static; grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .bank-folders { position: static; max-height: none; }
}

/* Videos */
.video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.video-wrap .video-frame, .video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-progress { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.video-progress .bar { position: relative; flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: visible; }
.video-progress .bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 99px; }
.video-progress .bar i { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--navy); }
.mark-done { display: inline-flex; gap: 8px; align-items: center; }
.player-status .mark-done .btn { padding: 4px 10px; font-size: 13px; }

/* Syllabus */
.syl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.syl-intro textarea { width: 100%; }
.syl-files { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.syl-files li { display: flex; gap: 12px; align-items: center; }
.syl-files a:first-child { font-weight: 600; }
.danger-text { color: var(--red); }
.syl-sum { margin: 22px 0 8px; font-size: 18px; }
.syl-table td { vertical-align: top; }
.syl-date { white-space: nowrap; background: #fff; }
.syl-past td:not(.syl-date) { background: #f3f1ec; }
.syl-past td:not(.syl-date) a { color: var(--ink-2); }
.grade-setup { margin-bottom: 14px; }
.q-prompt img { max-height: 380px; width: auto; display: block; margin: 8px 0; }

/* Spreadsheet: WorkbookLab's own look (navy and lavender), not a copy of any office app */
.grid-wrap { overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; max-height: 70vh; outline: none; position: relative; }
.grid-wrap:focus-visible { box-shadow: 0 0 0 3px var(--blue-soft); border-color: var(--blue); }
.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; font: 13px/1.2 Inter, -apple-system, sans-serif; user-select: none; }
.grid th { position: sticky; background: #f4f1f8; color: #5a5770; font-weight: 600; font-size: 11.5px; border-right: 1px solid #e3dfea; border-bottom: 1px solid #e3dfea; z-index: 2; }
.grid thead th { top: 0; height: 24px; text-align: center; }
.grid tbody th { left: 0; text-align: center; padding: 0 4px; }
.grid th.corner { left: 0; z-index: 3; }
.grid th.hl { background: #e4dcef; color: var(--navy); }
.grid td { height: 26px; padding: 0 6px; border-right: 1px solid #eeebe6; border-bottom: 1px solid #eeebe6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; position: relative; background: #fff; }
.grid td.lock { color: #2f2d45; }
.grid td.b { font-weight: 700; }
.grid td.i { font-style: italic; }
.grid td.f-lav { background: #f1eaf7; } .grid td.f-navy { background: var(--navy); color: #fff; } .grid td.f-yellow { background: #fff7d6; }
.grid td.f-green { background: #e8f6ec; } .grid td.f-gray { background: #f1f0ee; } .grid td.f-blue { background: #e8f0fb; }
.grid td.sel { background-image: linear-gradient(rgba(59, 52, 134, .09), rgba(59, 52, 134, .09)); }
.grid td.act { box-shadow: inset 0 0 0 2px var(--blue); }
.grid td.m-answer { box-shadow: inset 0 0 0 1.5px #a58cc0; background-color: #fbf8fe; }
.grid td.m-answer::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #a58cc0 transparent transparent; }
.grid td.m-right { box-shadow: inset 0 0 0 2px #22c55e; background-color: #f0fdf4; }
.grid td.m-wrong { box-shadow: inset 0 0 0 2px #ef4444; background-color: #fef2f2; }
.grid td.act.m-answer, .grid td.act.m-right, .grid td.act.m-wrong { box-shadow: inset 0 0 0 2px var(--blue); }
.grid td.err { color: var(--red); }
.grid tr.freeze td { position: sticky; top: 24px; z-index: 1; }
.cell-input { position: absolute; inset: 0; width: 100%; height: 100%; border: 2px solid var(--blue); border-radius: 0; padding: 0 5px; font: inherit; background: #fff; z-index: 4; box-shadow: none; }
.cell-input:focus { box-shadow: 0 2px 8px rgba(23, 21, 57, .2); }
.fbar { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; margin-bottom: 6px; overflow: hidden; }
.fbar-ref { min-width: 64px; padding: 6px 10px; font-weight: 700; border-right: 1px solid var(--line); background: #f4f1f8; color: var(--navy); font-size: 13px; text-align: center; }
.fbar-fx { padding: 0 8px; font-style: italic; color: var(--muted); font-family: Georgia, serif; }
.fbar input { flex: 1; border: 0; border-radius: 0; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 7px 8px; }
.fbar input:focus { box-shadow: none; }
.fbar-err { color: var(--red); font-size: 12px; padding: 0 10px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sheet-player { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; padding: 16px 20px 32px; max-width: 1500px; margin: 0 auto; }
.sp-tasks { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; align-self: start; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.sp-tasks ol { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.sp-tasks li { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.sp-tasks li.ok { border-color: #86efac; background: #f7fdf9; }
.sp-tasks li.no { border-color: #fecaca; }
.sp-tasks li p { margin: 6px 0 4px; }
.sp-task-head { display: flex; align-items: center; gap: 8px; }
.sp-task-head strong { flex: 1; font-family: "DM Sans", Inter, sans-serif; }
.sp-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.sp-tasks li.ok .sp-dot { background: var(--green); }
.sp-refs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip-ref { border: 1px solid #c9b8da; background: #fbf8fe; color: var(--navy); border-radius: 4px; font: 11.5px ui-monospace, Menlo, monospace; padding: 1px 6px; cursor: pointer; }
.chip-ref.right { border-color: #86efac; background: #f0fdf4; } .chip-ref.wrong { border-color: #fca5a5; background: #fef2f2; }
.sp-hint { background: var(--amber-soft); padding: 6px 8px; border-radius: 6px; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sp-score { margin: 10px 0 4px; }
.sp-instr { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sp-msg { background: var(--red-soft); color: var(--red); padding: 5px 10px; border-radius: 6px; font-size: 13px; margin-bottom: 6px; }
.sp-keys { margin-top: 10px; color: var(--muted); }
.sp-sheet { min-width: 0; }
.sheet-builder .grid-wrap { max-height: 56vh; }
.sb-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.sb-top textarea { width: 100%; }
.sb-size { display: flex; gap: 8px; align-items: flex-end; }
.sb-size .field { width: 80px; margin: 0; }
.sb-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.tb { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; width: 32px; height: 30px; cursor: pointer; font: inherit; }
.tb.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.sb-answer { border: 1px solid #c9b8da; background: #fbf8fe; border-radius: 10px; padding: 10px 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin: 10px 0; }
.sb-answer .field { margin: 0; min-width: 160px; }
.sb-tasks { margin-top: 12px; }
.sb-task { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.sb-task textarea { width: 100%; }
.sb-task .pts { width: 70px; flex: none; }
@media (max-width: 900px) {
  .sheet-player { grid-template-columns: minmax(0, 1fr); }
  .sp-tasks { position: static; max-height: none; }
  .sb-top { grid-template-columns: minmax(0, 1fr); }
}

/* Certificates */
.access-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f3dca3; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.access-bar.ok { background: var(--green-soft); border-color: #bbf7d0; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.cert-card { position: relative; display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 20px 16px; color: inherit; overflow: hidden; border-top: 6px solid var(--navy); }
.cert-card:hover { text-decoration: none; box-shadow: 0 6px 20px rgba(23, 21, 57, .08); }
.cert-card h2 { font-size: 18px; padding-right: 50px; }
.cert-card.locked { opacity: .82; }
.cert-ribbon { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; }
.cert-ribbon svg { width: 26px; height: 16px; }
.c-lavender { border-top-color: #a58cc0; } .c-lavender .cert-ribbon { background: #7c62a0; }
.c-green { border-top-color: #15803d; } .c-green .cert-ribbon { background: #15803d; }
.c-gold { border-top-color: #b8860b; } .c-gold .cert-ribbon { background: #a77a0a; }
.c-blue { border-top-color: #1d4ed8; } .c-blue .cert-ribbon { background: #1d4ed8; }
.cert-skills { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.cert-skills li { background: var(--blue-soft); color: var(--navy); border-radius: 999px; padding: 2px 9px; font-size: 12px; }
.cert-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 8px; }
.meter { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.meter.big { height: 12px; margin: 12px 0 4px; }
.cert-hero { position: relative; display: flex; gap: 16px; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--navy); border-radius: 14px; padding: 22px 80px 18px 22px; margin-bottom: 14px; }
.cert-hero h1 { margin-bottom: 6px; }
.req-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.req-list li { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.req-list li.done { border-color: #bbf7d0; background: #f7fdf9; }
.req-list li.done .sp-dot { background: var(--green); }
.req-main { flex: 1; min-width: 0; }
.form-grid.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cert-toggles { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
/* the certificate */
.award-page { max-width: 1000px; }
.award { background: #fff; border: 2px solid var(--navy); padding: 14px; border-radius: 6px; aspect-ratio: 11 / 8.5; box-shadow: 0 10px 30px rgba(23, 21, 57, .12); }
.award-inner { height: 100%; border: 1px solid #c3add3; outline: 6px solid #f4eff8; outline-offset: -12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px 48px; background: radial-gradient(circle at 50% 40%, #fff 0, #fff 55%, #fbf8fe 100%); }
.award-logo { display: flex; align-items: center; gap: 10px; font: 700 22px "DM Sans", Inter, sans-serif; color: var(--navy); }
.award-logo svg { width: 40px; height: 24px; }
.award-kicker { text-transform: uppercase; letter-spacing: .25em; font-size: 13px; color: #7c62a0; margin: 26px 0 18px; font-weight: 600; }
.award-small { color: var(--muted); margin: 4px 0; font-size: 15px; }
.award-name { font: 600 46px/1.15 "DM Sans", Georgia, serif; color: var(--navy); margin: 6px 0 10px; border-bottom: 2px solid #c3add3; padding: 0 30px 8px; }
.award-title { font: 600 26px "DM Sans", Inter, sans-serif; color: var(--blue); margin: 6px 0 10px; }
.award-skills { color: var(--ink-2); font-size: 13.5px; max-width: 80%; }
.award-foot { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; margin-top: auto; padding-top: 24px; gap: 20px; }
.award-foot > div { display: flex; flex-direction: column; font-size: 13px; }
.award-foot > div span { color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line-2); padding-top: 4px; margin-top: 4px; }
.award-dots svg { width: 60px; height: 36px; }
@media print {
  .top, .no-print, .back { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .award { box-shadow: none; width: 100%; }
  @page { size: letter landscape; margin: 0.4in; }
}
@media (max-width: 720px) { .form-grid.four { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .award-name { font-size: 30px; } .award-inner { padding: 20px; } }
.get-access { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code-block { background: #f6f4fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-x: auto; }

/* ---------- joining a class: code, confirm, pay ---------- */
.join-page { min-height: calc(100vh - 54px); display: flex; justify-content: center; padding: 48px 16px; }
.join-box { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; box-shadow: 0 1px 2px rgba(23,21,57,.04), 0 8px 24px rgba(23,21,57,.06); align-self: flex-start; }
.join-box h1 { font-family: "DM Sans", Inter, sans-serif; font-size: 26px; margin: 0 0 6px; }
.join-box form { display: grid; gap: 14px; }
.join-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 20px 0 22px; }
.join-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.join-steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--line); color: var(--muted); flex: none; }
.join-steps li.on { color: var(--ink); font-weight: 600; border-color: var(--navy); }
.join-steps li.on span { background: var(--navy); color: #fff; }
.join-steps li.done { border-color: var(--lavender); }
.join-steps li.done span { background: var(--lavender); color: var(--navy); }
.code-input { font-family: ui-monospace, Menlo, monospace; font-size: 22px !important; letter-spacing: .14em; text-align: center; padding: 12px !important; }
.join-q { font-size: 17px; margin: 0 0 12px; }
.class-card { border: 1px solid var(--lavender); background: var(--blue-soft); border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
.class-card-title { font-family: "DM Sans", Inter, sans-serif; font-size: 20px; font-weight: 700; margin: 2px 0 10px; }
.class-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 14px; }
.class-card dt { color: var(--muted); } .class-card dd { margin: 0; }
.join-actions { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 16px; }
.join-actions .btn-primary { flex: 1; }
.pay-btn { padding: 12px !important; font-size: 15px !important; margin-top: 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.big-check { width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 28px; display: grid; place-items: center; margin: 0 auto 12px; }
.join-box.center .btn { margin-top: 12px; }
.card-waiting { border-style: dashed; }
.card-pending { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--blue); }
.row-pending td { background: var(--amber-soft); }
.pending-cell { display: inline-flex; gap: 8px; align-items: center; }
.badge-warn { background: #fef3c7; color: var(--amber); }
.sub-head { font-size: 14px; margin: 22px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.price-row { display: flex; align-items: center; gap: 14px; min-height: 36px; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.money { display: inline-flex; align-items: center; gap: 4px; }
.money input { width: 110px; }
@media (max-width: 520px) { .join-box { padding: 22px 18px; } .join-steps li { font-size: 0; gap: 0; justify-content: center; } }
.top .who { margin-left: auto; }
.terms { margin: 4px 0 16px; }
.terms h3 { font-size: 14px; margin: 0 0 6px; }
.terms-box { max-height: 170px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.terms-box h4 { font-size: 12.5px; margin: 10px 0 2px; color: var(--ink); }
.terms-box p { margin: 0 0 6px; }
.agree { margin-top: 10px; font-weight: 600; }
.mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; }
.move-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.move-grid h3 { font-size: 14px; margin: 0 0 4px; }
@media (max-width: 760px) { .move-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- upload assignments ---------- */
.drop-sm { padding: 18px; }
.file-chip { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin-bottom: 8px; }
.sheet-picks, .type-picks, .pairs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0; align-items: center; }
.sheet-picks .field-label, .pairs .field-label { width: 100%; }
.pair-row { display: flex; gap: 10px; align-items: center; width: 100%; flex-wrap: wrap; }
.key-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); display: grid; gap: 10px; }
.seg-left { max-width: 420px; }
.upload-player .prose { margin-bottom: 18px; }
.starter-row, .upload-step { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 16px 18px; margin-bottom: 12px; }
.starter-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.upload-step { display: grid; gap: 10px; }
.sub-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; background: var(--surface); }
.sub-card.latest { border-color: var(--lavender); }
.sub-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.auto-result { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.fix-list { width: 100%; margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.fix-list code { font-weight: 600; margin-right: 6px; }
.teacher-comment { margin-top: 8px; padding: 8px 10px; background: var(--blue-soft); border-radius: 6px; }
.teacher-comment p { margin: 2px 0 0; white-space: pre-wrap; }
.submissions .pts { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.submissions .pts input { width: 70px; }
.submissions textarea { width: 100%; min-width: 160px; resize: vertical; }
.row-earlier td { background: var(--bg); font-size: 13px; }

/* ---------- course layout: collapsible side menu, page, right rail (like Canvas) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-course { max-width: 1480px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.page-course.has-rail { grid-template-columns: 200px minmax(0, 1fr) 300px; }
.page-course.nav-shut { grid-template-columns: 52px minmax(0, 1fr); }
.page-course.nav-shut.has-rail { grid-template-columns: 52px minmax(0, 1fr) 300px; }
.course-nav { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 6px; }
.course-nav nav { display: flex; flex-direction: column; gap: 2px; }
.course-nav a, .nav-toggle { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; }
.course-nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.course-nav a:hover, .nav-toggle:hover { background: var(--blue-soft); color: var(--navy); }
.course-nav a.on { background: var(--navy); color: #fff; }
.nav-toggle { border: 0; background: none; cursor: pointer; font: inherit; width: 40px; justify-content: center; padding: 8px; margin-bottom: 4px; }
.nav-back { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 12px !important; color: var(--muted) !important; font-size: 13px !important; }
.nav-shut .nav-label { display: none; }
.nav-shut .course-nav a { justify-content: center; padding: 9px 0; }
.course-main { min-width: 0; }
.course-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; margin: -4px 0 16px; min-height: 40px; }
.course-title { display: flex; align-items: baseline; gap: 2px 14px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.course-title h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
.course-home-link { color: inherit; text-decoration: none; }
.course-home-link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.course-meta { color: var(--muted); font-size: 15px; white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.head-actions .content-bar { flex-wrap: nowrap; }
@media (max-width: 760px) { .course-head { flex-wrap: wrap; } .head-actions { margin-left: 0; } }
.head-actions:empty { display: none; }
.head-actions .content-bar { margin: 0; }
.course-rail { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow-y: auto; }
@media (max-width: 1100px) { .course-rail { position: static; max-height: none; overflow: visible; } }   /* stacked: no box-in-a-box scrolling */
.course-rail .upcoming { margin: 0; padding: 14px; }
.course-rail .up-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "what pill" "when when"; gap: 2px 8px; padding: 9px 2px; }
.course-rail .up-what { grid-area: what; }
.course-rail .up-when { grid-area: when; flex-direction: row; gap: 6px; font-size: 12px; color: var(--muted); }
.course-rail .up-when strong { font-weight: 600; color: var(--ink-2); }
.course-rail .up-row > .pill, .course-rail .up-row > span:last-child { grid-area: pill; align-self: start; }
.course-rail .up-title { font-size: 13.5px; line-height: 1.35; }
@media (max-width: 1180px) {
  .page-course.has-rail { grid-template-columns: 200px minmax(0, 1fr); }
  .page-course.nav-shut.has-rail { grid-template-columns: 52px minmax(0, 1fr); }
}
.rail-inline { margin-bottom: 18px; }
@media (max-width: 760px) {
  .page-course, .page-course.has-rail, .page-course.nav-shut, .page-course.nav-shut.has-rail { display: block; }
  .course-nav { position: static; flex-direction: row; border-bottom: 1px solid var(--line); margin-bottom: 12px; padding-bottom: 8px; }
  .course-nav nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .course-nav a { padding: 7px 10px; gap: 7px; font-size: 13.5px; }
  .nav-toggle, .nav-back { display: none !important; }
  .nav-shut .nav-label { display: inline; }
}

/* ---------- teacher modules, Canvas style ---------- */
.content-bar { gap: 8px; margin-bottom: 14px; }
.content-bar .ico { width: 15px; height: 15px; fill: none; stroke: var(--green); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.mod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.mod-unpub { border-style: dashed; }
.mod-unpub .mod-title { color: var(--muted); }
.mod-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; background: #f5f4f1; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; min-height: 48px; }
.mod-title { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 2px; font: inherit; font-family: "DM Sans", Inter, sans-serif; font-size: 16px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; min-width: 0; }
.mod-title span:last-child { overflow-wrap: anywhere; }
.caret-i { color: var(--muted); font-size: 12px; width: 12px; }
.mod-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; flex: none; }
.mod-desc { margin: 0; padding: 8px 16px 0 40px; }
.mod-items { list-style: none; margin: 0; padding: 0; }
.mod-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; border-top: 1px solid var(--line); border-left: 3px solid var(--green); min-height: 52px; }
.mod-items .mod-row:first-child { border-top: 0; }
.mod-row.row-hidden { border-left-color: var(--line-2); }
.mod-row.row-hidden .mod-link { color: var(--muted); }
.mod-row.row-selected { background: var(--blue-soft); }
.mod-row:hover { background: #fbfaf8; }
.mod-row.row-selected:hover { background: var(--blue-soft); }
.mod-row .sel { display: none; margin: 0 2px 0 4px; }
.selecting .mod-row .sel, .mod-row.row-selected .sel { display: inline-block; }
.mod-row .grip { opacity: 0; }
.mod-row:hover .grip, .mod-head .grip { opacity: 1; }
.mod-text { border-left-color: var(--line-2); }
.mod-text-t { font-weight: 700; font-size: 15px; color: var(--ink-2); padding-left: 4px; }
.mod-main { min-width: 0; flex: 1; }
.mod-link { font-weight: 600; color: var(--ink); display: inline-block; }
.mod-link:hover { color: var(--blue); text-decoration: underline; }
.mod-meta { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 12.5px; color: var(--muted); }
.mod-meta span + span::before { content: "|"; margin-right: 8px; color: var(--line-2); }
.mod-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; border-top: 0; }
.kind-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: var(--green); }
.row-hidden .kind-ico { color: var(--muted); }
.kind-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pub-dot { width: 26px; height: 26px; border-radius: 50%; border: 0; background: #d4d4d4; display: grid; place-items: center; cursor: pointer; margin: 0 4px; flex: none; }
.pub-dot.on { background: var(--green); }
.pub-dot svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.menu { position: relative; display: inline-flex; }
.icon-only { width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-only:hover, .icon-only[aria-expanded="true"] { background: rgba(23, 21, 57, .07); }
.icon-only svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 0; }
.icon-only svg path { fill: none; stroke-width: 2; stroke-linecap: round; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 28px rgba(23, 21, 57, .14); padding: 4px; display: flex; flex-direction: column; }
.menu-pop button { text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 6px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.menu-pop button:hover:not(:disabled) { background: var(--blue-soft); }
.menu-pop button:disabled { color: #b5b3bf; cursor: default; }
.menu-pop button.danger { color: var(--red); }
.mod .drop-line { box-shadow: inset 0 2px 0 var(--blue); }
.mod.drop-here { outline: 2px dashed var(--blue); outline-offset: 2px; }
/* the right column for teachers: needs grading above coming up */
.rail-stack { display: grid; gap: 14px; }
.to-grade { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px; }
.to-grade h2 { font-size: 16px; margin: 0 0 6px; display: flex; justify-content: space-between; align-items: baseline; }
.to-grade ul { list-style: none; margin: 0; padding: 0; }
.to-grade li + li { border-top: 1px solid var(--line); }
.to-grade a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; color: inherit; text-decoration: none; align-items: center; }
.to-grade a:hover .tg-title { color: var(--blue); text-decoration: underline; }
.tg-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.tg-count { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; min-width: 24px; padding: 1px 8px; text-align: center; flex: none; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; background: #fff; min-width: 260px; }
.search-box svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-box input { border: 0; outline: 0; padding: 8px 0; font: inherit; width: 100%; background: transparent; }
.mod-meta .no-mod { color: var(--amber); font-weight: 600; }
.loose-note { margin-top: 4px; }
@media (max-width: 760px) { .search-box { min-width: 0; width: 100%; } }
.seg-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 6px 0 14px; }
.seg-cards button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 10px 14px; gap: 2px; }
.seg-cards button span { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.4; }
.seg-cards button.on span { color: #d9d3e6; }
.lms-note { line-height: 1.55; }
@media (max-width: 640px) { .seg-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- page builder and pages ---------- */
.page-builder { display: grid; gap: 10px; }
.pb-mode { max-width: 220px; justify-self: end; }
.pb-block { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px 4px; }
.pb-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.pb-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pb-add { display: flex; justify-content: center; padding: 4px 0 6px; }
.pb-add-open { flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
.pb-plus { width: 26px; height: 26px; border-radius: 50%; border: 1px dashed var(--line-2); background: #fff; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.pb-plus:hover { border-color: var(--blue); color: var(--blue); }
.pb-preview { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 18px 24px; }
.rt { border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--bg); border-bottom: 1px solid var(--line); }
.rt-bar button { border: 0; background: none; padding: 4px 8px; border-radius: 5px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); }
.rt-bar button:hover { background: var(--blue-soft); }
.rt-area { min-height: 90px; padding: 10px 12px; outline: none; }
.rt-area:empty::before { content: attr(data-placeholder); color: #a5a3b3; }
.heading-edit { display: flex; gap: 8px; align-items: center; }
.h-input { flex: 1; font-family: "DM Sans", Inter, sans-serif; font-weight: 700; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; }
.h-input.h2 { font-size: 22px; } .h-input.h3 { font-size: 17px; }
.img-edit img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; margin-bottom: 8px; }
.form-grid.three { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
.callout-edit { display: grid; gap: 6px; }
.callout-edit select { max-width: 160px; }
.code-area { width: 100%; font-size: 13px; line-height: 1.5; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px; background: #fbfaf7; resize: vertical; }
.page-view { font-size: 16px; line-height: 1.65; }
.page-view h2 { font-family: "DM Sans", Inter, sans-serif; font-size: 26px; margin: 28px 0 8px; }
.page-view h3 { font-size: 19px; margin: 22px 0 6px; }
.pv-text { margin: 8px 0; }
.pv-img { margin: 18px auto; text-align: center; }
.pv-img img { max-width: 100%; border-radius: 8px; }
.pv-img.size-half { max-width: 50%; } .pv-img.size-wide { max-width: 80%; } .pv-img.size-full { max-width: 100%; }
.pv-img figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.pv-video { position: relative; padding-top: 56.25%; margin: 18px 0; border-radius: 10px; overflow: hidden; background: #000; }
.pv-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pv-callout { border-left: 4px solid var(--blue); background: var(--blue-soft); border-radius: 0 8px 8px 0; padding: 10px 16px; margin: 16px 0; }
.pv-callout.tone-tip { border-color: var(--green); background: var(--green-soft); }
.pv-callout.tone-warn { border-color: #d97706; background: var(--amber-soft); }
.pv-callout-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.code-frame { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 12px 0; display: block; }
.pv-question { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; margin: 18px 0; background: #fff; }
.pv-question.is-right { border-color: #86efac; background: #f7fdf9; }
.pv-question.is-wrong { border-color: #fca5a5; }
.pv-q-foot { display: flex; gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.applet-wrap { padding: 12px 16px 24px; }
.applet-instr { max-width: 860px; margin: 0 auto 12px; }
.applet-note { max-width: 860px; margin: 0 auto 10px; }
.applet-frame { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: block; }
/* the accounting lab's Expand, when the browser's own full screen isn't allowed: the frame covers the window */
.applet-frame.applet-frame-full { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 10000; border: 0; border-radius: 0; }
html.applet-full-open, html.applet-full-open body { overflow: hidden; }
.applet-builder { display: grid; gap: 10px; }
@media (max-width: 760px) { .form-grid.three { grid-template-columns: minmax(0, 1fr); } .pv-img.size-half, .pv-img.size-wide { max-width: 100%; } }

/* ---------- classwork switches ---------- */
.switches { display: grid; gap: 12px; }
.switches-off { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.switches.is-open { border-color: #86efac; background: #f7fdf9; }
.switch-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.big-switch { width: 64px; height: 34px; border-radius: 999px; border: 0; background: #d4d4d4; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.big-switch .knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.big-switch.on { background: var(--green); }
.big-switch.on .knob { left: 33px; }
.code-show { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.code-big { font-family: ui-monospace, Menlo, monospace; font-size: 44px; font-weight: 800; letter-spacing: .08em; color: var(--navy); }
.code-bar { width: 160px; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.code-bar span { display: block; height: 100%; background: var(--navy); transition: width 1s linear; }
.code-bar.wide { width: 50vw; height: 10px; }
.code-full { position: fixed; inset: 0; z-index: 100; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; cursor: pointer; }
.code-full-label { font-size: 28px; color: var(--lavender); text-transform: uppercase; letter-spacing: .2em; }
.code-full-code { font-family: ui-monospace, Menlo, monospace; font-size: min(17vw, 240px); font-weight: 800; letter-spacing: .2em; padding-left: .2em; line-height: 1; }
.code-full .code-bar span { background: var(--lavender); }
.code-full-count { font-size: 22px; color: #d9d3e6; }
.pass-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 4px; color: var(--ink-2); cursor: pointer; }
.pass-switch input:checked + span { color: var(--green); font-weight: 600; }
.mod { position: relative; }
.file-drop-hint { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(241, 237, 247, .88); border-radius: var(--radius); font-weight: 700; color: var(--navy); pointer-events: none; font-size: 16px; }
.pick-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.pick-head input { flex: 1; }
.pick-head .seg { margin: 0; flex: none; }
.pick-list .pill { margin-left: 6px; }

/* ---------- daily classwork cards ---------- */
.day-list { display: grid; gap: 16px; max-width: 900px; }
.day-summary { margin: 0; }
.day-tools { margin-bottom: 0; }
.day-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; box-shadow: 0 1px 2px rgba(23,21,57,.04); }
.day-card.is-done { border-color: #bbf7d0; }
.day-card.is-hidden { border-style: dashed; opacity: .75; }
.day-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.day-card h2 { font-family: "DM Sans", Inter, sans-serif; font-size: 21px; margin: 2px 0 0; }
.day-card h2 a { color: var(--ink); }
.day-num { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.day-due { background: var(--bg); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; text-transform: uppercase; }
.day-status { display: flex; gap: 12px; align-items: center; margin: 10px 0 14px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.day-pill { font-size: 13px; font-weight: 700; }
.day-pill.tone-ok { color: var(--green); } .day-pill.tone-bad { color: var(--red); } .day-pill.tone-bad-soft { color: #c2410c; }
.day-grade { border: 0; background: var(--blue-soft); color: var(--navy); font-weight: 700; border-radius: 999px; padding: 3px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.card-buttons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.card-buttons .btn { padding: 12px; font-size: 15px; justify-content: center; text-align: center; }
.btn-dark { background: #111; color: #fff; border: 0; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-dark:hover { background: #000; }
.btn-closed { background: #f6dede; color: #7f1d1d; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; padding: 12px; font-size: 15px; }
.card-code { margin-bottom: 10px; width: 100%; }
.switch-btn { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; padding: 10px; }
.switch-btn.on { border-color: #86efac; background: #f0fdf4; color: var(--green); }
.mini-switch { width: 38px; height: 22px; border-radius: 999px; background: #d4d4d4; position: relative; flex: none; }
.mini-switch span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch-btn.on .mini-switch { background: var(--green); }
.switch-btn.on .mini-switch span { left: 18px; }
.res-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: 900px; }
.res-list li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; gap: 10px; align-items: center; }
.res-list a { color: var(--ink); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.seg-three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .seg-three { grid-template-columns: minmax(0, 1fr); } .card-buttons { grid-template-columns: minmax(0, 1fr); } }
.card-buttons.one { grid-template-columns: minmax(0, 1fr); }
.prior-toggle { border: 1px dashed var(--line-2); background: #fff; border-radius: 10px; padding: 12px; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; }
.prior-toggle:hover { border-color: var(--blue); background: var(--blue-soft); }

/* Daily: homework cards (slimmer, one button) */
.day-card.is-hw { padding: 14px 22px; }
.hw-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.hw-main { min-width: 0; }
.day-card.is-hw h2 { font-size: 18px; }
.hw-kind { color: var(--muted); font-weight: 600; }
.hw-due { background: var(--bg); border-radius: 999px; padding: 2px 10px; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--ink); }
.hw-status { display: flex; gap: 12px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.hw-status:empty { display: none; }
.hw-btn { flex: none; }
.hw-btn .btn { min-width: 110px; }
.day-card.is-hw, .day-card.is-hw-upload { border-left: 4px solid #a5b4fc; }
.day-card.is-hw.is-done, .day-card.is-hw-upload.is-done { border-left-color: #86efac; }
.pill-lms { background: #fef3c7; color: #92400e; }
.menu-pop .menu-check { display: flex; gap: 10px; align-items: flex-start; }
.menu-check .box { width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; margin-top: 2px; flex: none; }
.menu-check .box.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.menu-check small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .hw-row { flex-direction: column; align-items: stretch; } .hw-btn .btn { width: 100%; } }
.day-pill.tone-todo { color: var(--muted); }

/* Public LMS setup page for IT admins */
.it-page { min-height: 100vh; background: var(--bg); }
.it-hero { margin: 8px 0 20px; }
.it-hero h1 { margin: 4px 0 10px; }
.it-hero .lead { font-size: 17px; line-height: 1.55; max-width: 760px; }
.it-facts { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; padding: 0; margin: 14px 0 0; }
.it-facts li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 14px; }
.it-tab { margin-top: 14px; }
.it-steps { padding-left: 22px; display: grid; gap: 12px; line-height: 1.55; }
.it-steps .copy-row { margin: 8px 0 4px; }
.it-path { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.it-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 18px; }
.it-grid h3 { font-size: 15px; margin: 0 0 6px; }
.it-grid ul { padding-left: 18px; margin: 0; line-height: 1.55; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.panel-attn { border-color: #fcd34d; background: #fffbeb; }
.lti-req { border-top: 1px solid var(--line); padding: 12px 0; }
.lti-req:first-of-type { border-top: 0; }
.lti-req-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
@media (max-width: 560px) { .it-path { white-space: normal; } }

/* Upload builder: checks, different numbers */
.opt-group { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; display: grid; gap: 8px; }
.opt-row { display: flex !important; gap: 10px; align-items: flex-start; }
.opt-row input { margin-top: 4px; }
.opt-row small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.vary-detail { margin-left: 26px; display: grid; gap: 10px; }
.vary-detail .field { max-width: 320px; }
.vary-sample td { font-size: 13px; vertical-align: top; }
.vary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--blue); }
.chip.chip-off { text-decoration: line-through; color: var(--muted); background: var(--bg); }
.copy-flag { color: #b42318; font-size: 12.5px; font-weight: 600; margin-top: 3px; }
.copy-flag.weak { color: var(--muted); font-weight: 500; }
.copy-box ul { margin: 6px 0; padding-left: 18px; }
.note-warn { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 12px 14px; }
.file-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 6px 0 0; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.file-details dt { color: var(--muted); }
.file-details dd { margin: 0; }
.marked-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-top: 6px; }
.feature-results { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.submissions { overflow-x: auto; }
.submissions .table td:nth-child(2) { min-width: 230px; }
.submissions .table td:nth-child(5) textarea { min-width: 160px; }

/* Checkpoints */
.cp-builder .cp-head { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.cp-group { margin-top: 8px; }
.cp-group-title { text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: 11px; margin: 6px 0 2px; }
.cp-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.cp-row.off .cp-label { color: var(--muted); }
.cp-label { font-weight: 600; }
.cp-vals { flex: 1; min-width: 200px; }
.cp-alias { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; }
.cp-review { padding: 8px 4px 12px; }
.cp-table tr.cp-look td { background: #fffbeb; }
.cp-table tr.cp-wrong td { background: #fef2f2; }
.cp-icon { display: inline-block; width: 16px; font-weight: 700; }
.cp-look .cp-icon { color: #b45309; } .cp-wrong .cp-icon { color: var(--red); } .cp-right .cp-icon { color: var(--green); }
.cp-actions { white-space: nowrap; }
.btn.is-on-ok { background: #dcfce7; border-color: #86efac; }
.btn.is-on-bad { background: #fee2e2; border-color: #fca5a5; }
.look-btn { background: #fef3c7; border-radius: 999px; padding: 1px 8px; color: #92400e !important; font-weight: 700; }
.cp-checks { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; font-size: 13px; }
.cp-indent { padding-left: 34px !important; color: var(--muted); }
.cart-item { margin-bottom: 12px; }
.cart-item-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.add-class { margin: 4px 0 14px; display: block; text-align: center; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); padding: 10px 2px; margin-bottom: 8px; font-size: 16px; }
.cart-total strong { font-size: 20px; }
.code-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.code-row input { flex: 1; }
.name-edit { display: inline-flex; gap: 6px; align-items: center; }
.name-edit input { padding: 4px 8px; font-size: 13px; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; width: 170px; }

/* ---------- courses dashboard ---------- */
.dash { max-width: 1360px; }
.dash-head { align-items: center; margin-bottom: 20px; }
.dash-head h1 { font-size: 28px; letter-spacing: -0.02em; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.dash-rail { position: sticky; top: 74px; }
.dash-rail .up-more { display: block; padding: 10px 2px 2px; font-weight: 600; }
.ccards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }              /* two across; one on phones */
.ccard { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(23, 21, 57, .04); transition: box-shadow .18s ease, transform .18s ease; }
.ccard:hover { box-shadow: 0 10px 28px rgba(23, 21, 57, .10); transform: translateY(-2px); }
.ccard-cover { position: relative; display: block; height: 150px; background: var(--cc); overflow: hidden; }
.ccard-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.18)); pointer-events: none; }
.ccard-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccard-cover .cover-dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.ccard-busy { position: absolute; inset: auto 10px 10px auto; z-index: 1; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.ccard-menu { position: absolute; top: 10px; right: 10px; z-index: 2; }
.ccard-menu .icon-only { background: rgba(255,255,255,.92); border-radius: 50%; width: 32px; height: 32px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.ccard-menu .menu-pop { right: 0; left: auto; }
.ccard-body { display: block; padding: 14px 18px 4px; color: var(--ink); }
.ccard-body:hover { text-decoration: none; }
.ccard-body:hover .ccard-title { color: var(--cc); }
.ccard-subject { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--cc); }
.ccard-title { font-size: 18px; line-height: 1.25; margin: 4px 0 4px; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .15s; }
.ccard-meta { color: var(--muted); font-size: 13px; }
.ccard-school { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.ccard-school::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; opacity: .7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 10 12 5l9 5-9 5z M7 12v5c3 2 7 2 10 0v-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 10 12 5l9 5-9 5z M7 12v5c3 2 7 2 10 0v-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.ccard-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 18px 16px; margin-top: auto; }
.ccard-foot .chip { border: 0; cursor: default; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f2f0ec; color: var(--ink-2); }
.ccard-foot .chip-red { background: var(--red-soft); color: var(--red); }
.ccard-foot .chip-green { background: var(--green-soft); color: var(--green); }
.ccard-foot .chip-amber { background: var(--amber-soft); color: var(--amber); }
.ccard-foot .chip-blue { background: var(--blue-soft); color: var(--blue); }
.ccard-swatches { margin-left: auto; display: none; gap: 4px; }
.ccard:hover .ccard-swatches, .ccard:focus-within .ccard-swatches { display: inline-flex; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); padding: 0; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.ccard-pending { border-style: dashed; }
.ccard .error { margin: 0 18px 14px; }
.dash-empty { padding: 40px; text-align: center; }
.dash-archived { margin-top: 28px; }
.dash-archived summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .dash-rail { position: static; } }
@media (max-width: 640px) { .ccards { grid-template-columns: minmax(0, 1fr); } .ccard-cover { height: 120px; } }

/* full-page calendar: the whole month fits on screen */
.page-cal { max-width: 1360px; padding-top: 18px; padding-bottom: 16px; }
.cal-title { font-size: 26px; letter-spacing: -0.02em; margin: 0 12px 0 0; }
.cal-fit .cal-bar { justify-content: flex-start; margin-bottom: 12px; }
.cal-fit .cal-sync { margin-left: auto; }
.cal-fit .cal-day { min-height: 0; height: max(72px, calc((100vh - 182px) / var(--weeks))); overflow: hidden; }
@media (max-width: 760px) { .cal-fit .cal-day { height: auto; min-height: 56px; } .cal-title { width: 100%; } }

/* ---------- course packs ---------- */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.pack-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.pack-card-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 22px; }
.pack-card .card-title { font-size: 19px; }
.pack-desc { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.pack-card .card-foot { margin-top: auto; padding-top: 10px; }
.pack-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chapter-h { font-size: 16px; display: flex; gap: 8px; align-items: baseline; margin: 0; }
.pack-items { list-style: none; margin: 8px 0 0; padding: 0; }
.pack-items li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.pack-items li:first-child { border-top: 0; }
.pack-items .spacer { flex: 1; }
.pack-items.compact li { padding: 4px 0; border: 0; }
.chapter-toggle { border: 0; background: none; font: inherit; font-weight: 700; font-size: 16px; color: var(--ink); cursor: pointer; padding: 0; text-align: left; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.chapter-toggle .caret { width: 12px; color: var(--muted); }
.pack-ch .panel-head { margin-bottom: 0; gap: 10px; flex-wrap: wrap; }
.pack-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.pack-empty h2 { color: var(--ink); margin-bottom: 6px; }
.pack-empty p { max-width: 520px; margin: 0 auto 14px; }
.pack-edit td { padding: 6px 10px; }
.pack-edit td:first-child { width: 45%; }
.pack-edit select { max-width: 220px; }
.pack-edit .num-input { width: 64px; display: inline-block; }
.pick-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; }
.pick-check:hover { background: #f9fafb; }
.pick-check input { margin-top: 3px; }
.pack-res .toolbar select { max-width: 260px; }

/* ---------- library: categories and chapters ---------- */
.lib-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.lib-cats button { font: 600 13px "DM Sans", Inter, sans-serif; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.lib-cats button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.lib-count { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.lib-cats button.on .lib-count { background: rgba(255,255,255,.18); color: #fff; }
.lib-groups { display: grid; gap: 10px; }
.lib-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lib-group > summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 12px 16px; cursor: pointer; list-style: none; }
.lib-group > summary::-webkit-details-marker { display: none; }
.lib-group > summary::before { content: "▸"; color: var(--muted); }
.lib-group[open] > summary::before { content: "▾"; }
.lib-group > summary strong { font: 700 15px "DM Sans", Inter, sans-serif; }
.lib-group .table { margin: 0; border-top: 1px solid var(--line); }
.lib-kind { width: 110px; }
.lib-used { width: 120px; white-space: nowrap; }
@media (max-width: 640px) { .lib-kind, .lib-used { display: none; } }
.lib-subjects { display: flex; gap: 0; border-bottom: 1px solid var(--line-2); margin: 2px 0 12px; overflow-x: auto; }
.lib-subjects button { font: 700 14px "DM Sans", Inter, sans-serif; padding: 9px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.lib-subjects button.on { color: var(--ink); border-bottom-color: var(--ink); }

/* Student class page: Classwork / Homework tabs with a to-do count */
.day-list > .tabs { margin-bottom: 0; }
.day-list > .tabs .tab { font-size: 15px; padding: 10px 16px; display: inline-flex; align-items: center; gap: 8px; }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #c2410c; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.tab-count.quiet { background: var(--line); color: var(--ink-2); }

/* ---------- phones and tablets: nothing may push the page wider than the screen ---------- */
html, body { max-width: 100%; }
.player > .page { width: 100%; }
.starter-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }       /* long Excel file names wrap */
.starter-row .btn { flex: none; }
.day-list { grid-template-columns: minmax(0, 1fr); }
.day-card h2, .up-what, .up-title, .mod-link, .ccard-title { overflow-wrap: anywhere; }                                 /* auto side margins would otherwise size it to its content */
.page, .player > *, .course-main { min-width: 0; }            /* flex/grid children may shrink to the screen */
img, video, iframe, canvas { max-width: 100%; }
select { max-width: 100%; }
@media (max-width: 900px) {
  body { overflow-wrap: break-word; }
  /* Titles, links and buttons may break inside an overlong word (file names) instead of sticking out. */
  h1, h2, h3, a, .btn { overflow-wrap: anywhere; }
  .starter-row { flex-wrap: wrap; }
  .table a, .table td { overflow-wrap: break-word; }          /* tables swipe instead of crushing words */
  .btn { min-width: min-content; }                              /* a button never squeezes below its longest word */
  .check form, .numeric, .toolbar, .tools-row { flex-wrap: wrap; }
  .mod-head { flex-wrap: wrap; }
  .mod-title { flex: 1 1 160px; }
  .btn, button { white-space: normal; }
  .btn { max-width: 100%; text-align: center; }
  input, textarea { max-width: 100%; }
  .table, .q-table, .q-match, .prose table { display: block; max-width: 100%; overflow-x: auto; }   /* wide tables swipe inside their box */
  .table.gradebook { display: table; max-width: none; overflow: visible; }   /* already swipes inside .table-scroll; a block table breaks the frozen name column */
  pre, code { white-space: pre-wrap; }
}
.settings-page > .tabs { margin-bottom: 18px; }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check-row input { margin-top: 3px; }
.res-list .res-acts { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.res-list .res-acts .danger { color: var(--red); }
.lib-book { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; background: var(--card, #fff); }
@media (max-width: 600px) { .lib-book { flex-direction: column; align-items: flex-start; } }

/* journal entry questions */
.q-je-entry { margin: 10px 0 14px; }
.q-je-label { font-weight: 600; margin-bottom: 4px; }
.q-je-table { border-collapse: collapse; width: 100%; max-width: 640px; table-layout: fixed; }
.q-je-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted, #666); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.q-je-table th.n, .q-je-table td.n { text-align: right; }
.q-je-table td { padding: 3px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.q-je-table th:nth-child(2), .q-je-table th:nth-child(3) { width: 26%; }
.q-je-table select, .q-je-table .q-num { width: 100%; min-width: 0; box-sizing: border-box; }
.q-je-table .q-num { text-align: right; }
.q-je-table td.q-je-cr { padding-left: 28px; }
.q-je-table tr.right td { background: var(--green-soft); }
.q-je-table tr.wrong td { background: var(--red-soft); }
.q-je-table tr.right td:first-child, .q-je-table tr.wrong td:first-child { position: relative; }
.q-je-table tr.right td:first-child::after, .q-je-table tr.wrong td:first-child::after { position: absolute; left: -2px; top: 50%; transform: translateY(-50%); font-weight: 700; font-size: 12px; }
.q-je-table tr.right td:first-child::after { content: "✓"; color: #15803d; }
.q-je-table tr.wrong td:first-child::after { content: "✗"; color: #b91c1c; }
.q-je-key { margin-top: 4px; max-width: 520px; }
.q-je-key td { border-bottom: 1px dotted var(--line); }
.je-ed-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.je-ed-table th { text-align: left; font-size: 12px; font-weight: 600; }
.je-ed-table th:nth-child(2), .je-ed-table th:nth-child(3) { width: 22%; }
.je-ed-table th:nth-child(4) { width: 2.2em; }
.je-ed-table td { padding: 2px 4px 2px 0; }
.je-ed-table input { width: 100%; min-width: 0; box-sizing: border-box; }
.je-ed .je-rows { width: 3em; }
@media (max-width: 560px) {
  .q-je-table td.q-je-cr { padding-left: 12px; }
  .q-je-table th:nth-child(2), .q-je-table th:nth-child(3) { width: 30%; }
}
/* ---- Accessibility (WCAG 2.1 AA, plus 2.2's 24 px targets) ---- */
/* click targets at least 24 px */
.link-btn { min-height: 24px; }
.back { line-height: 24px; }
.icon-btn { min-width: 24px; min-height: 24px; }
.caret { width: 24px; min-height: 24px; }
.cal-ev { min-height: 24px; padding-top: 4px; padding-bottom: 4px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }
/* the formula bar input shows focus: the whole bar gets the ring */
.fbar:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
/* "Skip to main content": hidden until it gets keyboard focus */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 1000; background: #fff; color: var(--navy); padding: 8px 14px; border-radius: 6px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

/* The browse-only demo account (demo / workbooklab): everything opens, nothing to edit. */
.browse-banner { background: #efeaf9; color: #2b2150; font-size: 13px; text-align: center; padding: 8px 16px; border-bottom: 1px solid #ddd3f0; }
.browse-only .head-actions, .browse-only .mod-tools, .browse-only .ccard-menu, .browse-only .tools-row,
.browse-only .page-head .toolbar, .browse-only .bulk-bar, .browse-only .mod-head > .menu, .browse-only .mod-row .menu,
.browse-only .grip { display: none !important; }

/* a textbook spreadsheet case assigned from the bank (Question.jsx CaseSheet) */
.q-case iframe { width: 100%; height: 760px; border: 1px solid var(--line, #d8d6e0); border-radius: 8px; background: #fff; resize: vertical; display: block; }
.q-case p { margin: 6px 0 0; }
.qedit-preview .q-case iframe { height: 620px; }

/* parts laid out as a diagram (Question.jsx FlowInput): boxes left to right, arrows between; stacked on phones */
.q-flow { display: flex; align-items: stretch; gap: 0; margin: 12px 0; overflow-x: auto; }
.q-flow-box { flex: 1 1 0; min-width: 170px; border: 1.5px solid var(--ink, #1d1b2e); border-radius: 8px; padding: 8px 10px; background: var(--card, #fff); }
.q-flow-title { font-weight: 700; text-align: center; border-bottom: 1px solid var(--line, #d8d6e0); padding-bottom: 5px; margin-bottom: 6px; }
.q-flow-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 3px 0; font-size: 0.92em; }
.q-flow-row b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-flow-in { flex-wrap: wrap; }
.q-flow-in label { flex: 1 1 auto; }
.q-flow-in .q-num { width: 7.5em; text-align: right; }
.q-flow-in.right .q-num { border-color: var(--good, #2e7d4f); }
.q-flow-in.wrong .q-num { border-color: var(--bad, #b3261e); }
.q-flow-in .q-key { flex-basis: 100%; text-align: right; font-size: 0.85em; }
.q-flow-link { flex: 0 0 74px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; font-size: 0.78em; color: var(--muted, #5d5a6e); padding: 0 4px; }
.q-flow-link svg { width: 40px; height: 16px; color: var(--ink, #1d1b2e); }
.q-flow-wrap { container-type: inline-size; }
.q-flow-row em { color: var(--muted, #5d5a6e); font-size: 0.85em; text-align: right; }
@container (max-width: 760px) {
  .q-flow { flex-direction: column; overflow: visible; }
  .q-flow-box { min-width: 0; }
  .q-flow-link { flex-basis: auto; flex-direction: row; gap: 6px; padding: 4px 0; }
  .q-flow-link svg { transform: rotate(90deg); }
}
@media (max-width: 720px) {
  .q-flow { flex-direction: column; overflow: visible; }
  .q-flow-box { min-width: 0; }
  .q-flow-link { flex-basis: auto; flex-direction: row; gap: 6px; padding: 4px 0; }
  .q-flow-link svg { transform: rotate(90deg); }
}

/* ---------- secure exams (fullscreen lock, warnings, live monitor) ---------- */
.eb-secure { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.eb-secure.on { border-color: var(--blue); background: var(--blue-soft); }
.secure-fields { margin: 10px 0 4px; display: grid; gap: 6px; }
.secure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.secure-note { margin: 12px 0; }
.secure-rules { margin: 10px 0 16px; padding-left: 20px; line-height: 1.55; }
.secure-check { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; display: grid; gap: 6px; }
.secure-check legend { font-weight: 600; padding: 0 4px; }
.secure-locked { border-left: 4px solid var(--red); padding-left: 16px; }
.secure-locked.reopened { border-left-color: var(--green); }
.exam-take.secure { user-select: none; -webkit-user-select: none; }
.exam-take.secure input, .exam-take.secure textarea { user-select: text; -webkit-user-select: text; }
.se-warn { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.14); }
.se-warn.bad { background: var(--red); color: #fff; }
.se-alert { margin: 10px 20px 0; }
.exam-layout.se-hidden { filter: blur(14px); pointer-events: none; }
.se-overlay { position: fixed; inset: 0; z-index: 2147483000; background: rgba(23,21,57,.78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.se-overlay-box { background: #fff; color: var(--ink); border-radius: 12px; padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.se-overlay-box h2 { margin: 0 0 6px; font-size: 19px; }
.se-overlay-box p { margin: 6px 0 16px; }
.se-trap { position: absolute !important; left: 0 !important; top: 0 !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: .01 !important; z-index: 5; white-space: nowrap; }
.se-trap button, .se-trap p { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; font-size: 1px; line-height: 1px; background: transparent; color: transparent; overflow: hidden; cursor: default; }
.secure-fieldset .link-btn { display: inline-block; margin-top: 6px; }
.monitor-link-row { display: flex; align-items: center; gap: 12px; padding-bottom: 0; }

.monitor .page-head { align-items: flex-start; }
.mon-updated { text-align: right; }
.mon-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.mon-chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.mon-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.mon-chip.bad:not(.on) { border-color: var(--red); color: var(--red); font-weight: 600; }
.mon-chip.ghost { cursor: default; color: var(--muted); border-style: dashed; }
.mon-table td { vertical-align: top; }
.mon-table tr.flagged td { background: var(--amber-soft); }
.mon-table tr.is-locked td { background: var(--red-soft); }
.mon-table tr.is-open td { box-shadow: inset 0 0 0 9999px rgba(59,52,134,.05); }
.mon-table .bad { color: var(--red); font-weight: 700; }
.mon-acts { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.mon-pill { white-space: nowrap; display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
td > .mon-pill:first-child { margin-left: 0; }
.mon-pill.live { background: var(--green-soft); color: var(--green); }
.mon-pill.stale { background: var(--amber-soft); color: var(--amber); }
.mon-pill.locked { background: var(--red); color: #fff; }
.mon-pill.done { background: var(--blue-soft); color: var(--blue); }
.mon-pill.acc { background: #eef6ff; color: #1d4ed8; }
.mon-pill.ai-likely { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
.mon-pill.ai-possible { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); }
.mon-news { margin: 6px 0; }
.mon-waiting { margin: 14px 0; }
.mon-waiting ul { margin: 8px 0; padding-left: 20px; columns: 2; }
.mon-log { margin-top: 20px; padding-top: 6px; border-top: 1px solid var(--line); }
.mon-log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mon-log-head h2 { font-size: 17px; margin: 10px 0; }
.mon-log tr.major td { background: var(--red-soft); color: var(--red); font-weight: 600; }
.mon-help { margin-top: 16px; max-width: 780px; }
@media (max-width: 760px) { .mon-waiting ul { columns: 1; } .mon-updated { text-align: left; } }

/* on-screen calculator (exams) */
.calc { position: fixed; right: 20px; bottom: 20px; width: 260px; background: #fff; border: 1px solid #9ca3af; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.22); z-index: 60; overflow: hidden; color: var(--ink); }
.calc-head { display: flex; align-items: center; gap: 4px; background: var(--navy); color: #fff; padding: 6px 6px 6px 12px; cursor: move; user-select: none; touch-action: none; }
.calc-title { flex: 1; font-weight: 600; font-size: 14px; }
.calc-hbtn { width: 28px; height: 26px; border: 0; border-radius: 5px; background: rgba(255,255,255,.14); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.calc-hbtn:hover { background: rgba(255,255,255,.28); }
.calc.is-min .calc-body { display: none; }
.calc-body { padding: 10px; }
.calc-expr { min-height: 19px; max-height: 57px; overflow-y: auto; font-size: 14px; line-height: 19px; color: #374151; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; user-select: none; }
.calc-num { border: 0; background: transparent; font: inherit; color: var(--ink); padding: 0 1px; margin: 0; cursor: pointer; border-bottom: 1px dashed #6b7280; border-radius: 2px; line-height: inherit; }
.calc-num:hover { background: var(--blue-soft); }
.calc-edit { font: inherit; text-align: center; border: 1px solid var(--blue); border-radius: 3px; padding: 0 2px; margin: 0 1px; background: #fff; user-select: text; }
.calc-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.calc-disp { font-size: 26px; font-weight: 700; text-align: right; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-keys button { height: 40px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; font-size: 17px; font-weight: 600; color: var(--ink); cursor: pointer; }
.calc-keys button:hover { background: #f3f4f6; }
.calc-keys button.is-op { background: #f5f3f8; }
.calc-keys button.is-eq { background: var(--navy); color: #fff; border-color: var(--navy); }
.calc-use { width: 100%; margin-top: 8px; }
.exam-bar .calc-toggle { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }

/* one-time look at results */
.once-note { margin-top: 14px; }
.once-note p { margin: 0 0 10px; }
.once-review { position: relative; }
.once-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; background: var(--navy); color: #fff; border-radius: 8px; }
.once-bar .muted { color: #d9d4ec; flex: 1; }
.once-bar .btn-primary { background: var(--lavender); color: var(--navy); }
.answer-edit-btn { display: inline-block; margin-top: 6px; }
.answer-edit { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--blue); border-radius: 8px; background: var(--blue-soft); }

/* spreadsheet questions (question bank type "sheet") */
.q-sheet { margin-top: 8px; }
.q-sheet-steps { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.q-sheet-steps .sp-refs { display: inline-flex; gap: 4px; margin-left: 6px; flex-wrap: wrap; }
.q-sheet-grid { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.qedit.qedit-sheet { grid-template-columns: 1fr; }
.ae-sheet { display: grid; gap: 8px; }

/* ---- a certificate as a card on the Courses page ---- */
.ccard-cert { --cc: var(--navy); }
.ccard-cert.c-lavender { --cc: #7c62a0; } .ccard-cert.c-green { --cc: #15803d; } .ccard-cert.c-gold { --cc: #a77a0a; } .ccard-cert.c-blue { --cc: #1d4ed8; }
.ccard-cert-mark { position: absolute; right: 16px; bottom: 14px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .55); display: grid; place-items: center; }
.ccard-cert-mark svg { width: 28px; height: 17px; }
.ccard-cert .ccard-foot .meter { flex: 1 1 80px; max-width: 160px; }

/* ---- teacher: the class against each certificate ---- */
.class-certs > p.muted { max-width: 760px; margin: 0 0 14px; }
.cc-cert { border-top: 5px solid var(--navy); margin-bottom: 18px; }
.cc-cert.c-lavender { border-top-color: #7c62a0; } .cc-cert.c-green { border-top-color: #15803d; } .cc-cert.c-gold { border-top-color: #a77a0a; } .cc-cert.c-blue { border-top-color: #1d4ed8; }
.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cc-head h2 { margin: 0 0 2px; font-size: 18px; }
.cc-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; margin: 14px 0 12px; }
.cc-big strong { display: block; font-size: 28px; line-height: 1.1; }
.cc-big span { font-size: 12px; color: var(--muted); }
.cc-stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); }
.cc-stack span { display: block; height: 100%; }
.cc-keys { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.cc-keys .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cc-keys .chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.cc-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.cc-s-earned { background: #15803d; } .cc-s-working { background: #3b3486; } .cc-s-enrolled { background: #a58cc0; }
.cc-s-not_enrolled { background: #d6d2ca; } .cc-s-locked { background: #d97706; }
.pill.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill.pill-muted { background: transparent; color: var(--muted); border: 1px solid var(--line-2); }
.cc-table td { vertical-align: top; }
.cc-prog { min-width: 220px; }
.cc-meter { display: flex; align-items: center; gap: 8px; max-width: 260px; }
.cc-reqs { margin-top: 4px; }
.cc-reqs summary { cursor: pointer; color: var(--blue); }
.cc-reqs ul { list-style: none; padding: 4px 0 0; margin: 0; display: grid; gap: 3px; font-size: 13px; }
.cc-reqs li.done > span:first-child { color: var(--green); font-weight: 700; }
@media (max-width: 640px) { .cc-summary { grid-template-columns: 1fr; } .cc-prog { min-width: 0; } }

.my-certs { margin: 4px 0 26px; }
.my-certs h2 { margin: 0 0 2px; font-size: 19px; }
.my-certs-filters { margin: 12px 0 0; flex-wrap: wrap; gap: 10px 16px; }
.my-certs-filters label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.my-certs-filters select, .my-certs-filters input { font: inherit; font-size: 14px; color: var(--ink); }
/* secure exams: plugin screens (start, locked, submitted, results, one-time look, preview toasts) */
.se-card .exam-title { margin-bottom: 2px; }
.se-gate { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); font-weight: 600; padding: 10px 12px; border-radius: 6px; margin: 0 0 12px; }
.se-err { color: var(--red); font-weight: 600; margin: 8px 0; }
.se-alert-text { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); padding: 10px 12px; border-radius: 6px; font-weight: 600; }
.se-score { font-size: 20px; font-weight: 700; margin: 10px 0 4px; }
.se-warnbar { background: #fef2f2; border: 1px solid #fecaca; border-top: 0; color: var(--red); font-weight: 600; padding: 8px 16px; font-size: 14px; }
.exam-take.secure .timer.low { color: #fca5a5; }
.se-closeview { position: fixed; top: 16px; right: 20px; z-index: 2147483500; background: #b91c1c; color: #fff; border: 0; border-radius: 8px; padding: 12px 22px; font-size: 16px; font-weight: 800; letter-spacing: .05em; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }
.se-closeview:hover { background: #991b1b; }
.se-closeview:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.se-review.is-once { user-select: none; -webkit-user-select: none; }
.se-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 2147483600; max-width: min(680px, 92vw); text-align: center; }
.secure-results-set { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin-top: 6px; display: grid; gap: 6px; }
.secure-results-set legend { font-weight: 600; padding: 0 4px; }

/* live monitor: plugin admin.js layout (summary, results grid, question dialog, copying check, edit answers) */
.monitor .mon-summary { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0 14px; font-size: 14px; }
.monitor .mon-summary .bad { color: var(--red); }
.mon-dist { display: inline-block; width: 90px; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.mon-dist > span { display: block; height: 100%; background: var(--blue); }
.mon-results { margin-top: 22px; }
.mon-results h2, .mon-log h2, .mon-ans h2 { font-size: 17px; margin: 12px 0 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
table.mon-res { border-collapse: collapse; font-size: 13px; }
table.mon-res th, table.mon-res td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; white-space: nowrap; }
table.mon-res .stu { text-align: left; position: sticky; left: 0; background: var(--surface); }
table.mon-res tr.key td { background: #eef2ff; font-weight: 600; }
table.mon-res td.ok { color: var(--green); }
table.mon-res td.no { background: #fef2f2; color: var(--red); font-weight: 600; }
table.mon-res td.blank { color: var(--muted); }
table.mon-res td.ov, table.mon-res td.ovp { background: #fef9c3; }
table.mon-res tr.pct td.low { color: var(--red); font-weight: 700; }
table.mon-res tr.avg td, table.mon-res tr.pct td, table.mon-res tr.qual td { background: #f8fafc; }
table.mon-res td.q-bad { color: var(--red); font-weight: 700; }
table.mon-res td.q-weak { color: var(--amber); font-weight: 600; }
table.mon-res td.q-good { color: var(--green); font-weight: 600; }
.mon-res .qbtn, .mon-res .cellbtn { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0 2px; }
.mon-res .qbtn { color: var(--blue); font-weight: 700; text-decoration: underline; }
.mon-qdlg { max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px 20px; }
.mon-qdlg fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
.mon-qdlg legend { font-weight: 600; padding: 0 4px; }
.mon-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.mon-row.key { font-weight: 600; }
.mon-tag { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.mon-tb { color: var(--muted); font-size: 12px; margin-left: 6px; }
.mon-ia { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 14px; }
.mon-verdict { margin-top: 8px; font-weight: 600; }
.mon-verdict.bad { color: var(--red); } .mon-verdict.weak { color: var(--amber); } .mon-verdict.good { color: var(--green); }
.mon-flag { font-weight: 600; color: var(--amber); } .mon-flag.ok { color: var(--green); }
.mon-qtext { white-space: pre-wrap; }
.mon-copy { border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px 10px; margin: 10px 0; }
.mon-copy tr.hi td { background: #fef2f2; } .mon-copy tr.mid td { background: #fffbeb; }
.mon-m { display: inline-block; margin: 0 6px 4px 0; padding: 1px 6px; border-radius: 4px; background: #f1f5f9; font-size: 12px; }
.mon-m.rare { background: #fee2e2; font-weight: 600; }
.mon-ans { border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px 10px; margin: 14px 0; }
.mon-ans tr.changed td { background: #fef9c3; }
.mon-ans .ok { color: var(--green); font-weight: 700; } .mon-ans .no { color: var(--red); font-weight: 700; }
.monitor .table-scroll { position: relative; }

.drills-cert { display: grid; gap: 14px; margin-top: 14px; }
.drills-cert .panel h2 { margin: 0 0 6px; font-size: 18px; }
.drills-cert .panel .btn { margin-top: 10px; }
.drills-sittings { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.drills-sittings li { padding: 7px 10px; border-left: 3px solid var(--line-2); background: var(--paper, #faf8f4); border-radius: 4px; }
.drills-sittings li.ok { border-left-color: var(--green); }
