/* 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; }
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; }

/* 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 var(--line-2); 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); }
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; }
.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, 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(260px, 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: 2fr 1.5fr 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: 1fr 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 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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: 1fr 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 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: 1fr 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: 1fr 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: 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; }
}

/* 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: #a3a3a3; 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; }
.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 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: #c4c4c4; }
.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 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 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 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(150px, 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, 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: 1fr; }
  .qmap { position: static; grid-template-columns: repeat(8, 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: 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: 1fr; }
  .sp-tasks { position: static; max-height: none; }
  .sb-top { grid-template-columns: 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(300px, 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: 1fr auto 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: 1fr 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 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: 1fr 1fr; gap: 24px; }
.move-grid h3 { font-size: 14px; margin: 0 0 4px; }
@media (max-width: 760px) { .move-grid { grid-template-columns: 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 { margin-top: 2px; }
.course-rail { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow-y: auto; }
.course-rail .upcoming { margin: 0; padding: 14px; }
.course-rail .up-row { grid-template-columns: 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; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 12px; padding-bottom: 6px; }
  .course-nav nav { flex-direction: row; }
  .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: 1fr 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: 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: 2fr 2fr 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; }
.applet-builder { display: grid; gap: 10px; }
@media (max-width: 760px) { .form-grid.three { grid-template-columns: 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: 1fr 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: 1fr 1fr 1fr; }
@media (max-width: 760px) { .seg-three { grid-template-columns: 1fr; } .card-buttons { grid-template-columns: 1fr; } }
.card-buttons.one { grid-template-columns: 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(220px, 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 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; }
