/* Math 54 (Pivot) components in the site's Bauhaus language. Tokens, header, layout, buttons, chips: ../bauhaus.css */

/* ---------- page typography ---------- */
.main h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); font-weight: 900; letter-spacing: -0.02em; margin: 0 0 8px; }
.main h2 { font-size: 1.45rem; font-weight: 900; margin: 36px 0 12px; }
.main h3 { font-size: 1.12rem; font-weight: 700; margin: 22px 0 8px; }
#main > p.muted:first-of-type, .ref > p.muted:first-of-type { font-size: 1.05rem; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.4em; }
.label.mixed { text-transform: none; letter-spacing: 0.02em; font-size: 0.78rem; }
.disp { margin: 0.2rem 0 1rem; }
.back { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 14px; text-decoration: none; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; font-size: 0.74rem; color: var(--ink); border-bottom: 3px solid var(--yellow); }
.back:hover { color: var(--red); }
.hint { color: var(--ink-2); font-size: 0.85rem; margin-top: 14px; }
sup { font-size: 0.72em; line-height: 0; vertical-align: super; }

/* ---------- sidebar (course map by week) ---------- */
.unit { margin-top: 14px; }
.unit-title .cnt { font-weight: 500; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.unit-title.now { border-bottom-color: var(--red); }
.unit-title.now > span:first-child { color: var(--ink); }
.unit-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 4px 0 6px; }
.unit-sub .chip { padding: 0 6px; border-width: 1.5px; }
.side a.lesson { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 7px 8px; border-left: 4px solid transparent; color: var(--ink); text-decoration: none; line-height: 1.25; }
.side a.lesson:hover { background: var(--white); color: var(--ink); }
.side a.lesson[aria-current="page"] { border-left-color: var(--red); background: var(--white); font-weight: 500; }
.side a.lesson:focus-visible { outline-offset: -3px; }
.side a.lesson .num { display: inline-block; min-width: 2.6em; margin-right: 6px; font-weight: 700; font-size: 0.78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.side .katex { font-size: 1em; white-space: nowrap; }
.meter.m4 i.on { background: var(--good); border-color: var(--good); }

/* ---------- home ---------- */
.hero h1 { margin-bottom: 6px; }
.hero .muted { font-size: 1.1rem; }
#main > .today { display: grid; gap: 18px; margin: 22px 0; }
@media (min-width: 720px) { #main > .today { grid-template-columns: 1.4fr 1fr; } }
.card { border: 3px solid var(--ink); background: var(--white); padding: 14px 18px; }
.card h2 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; }
.card .label { margin-bottom: 4px; }
.dayrow { display: grid; grid-template-columns: 5.4rem 1fr; gap: 10px; padding: 7px 0; border-top: 2px solid var(--rule); font-size: 0.95rem; }
.dayrow:first-of-type { border-top: 0; }
.dayrow .d { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.dayrow.today { background: var(--yellow-soft); margin: 0 -18px; padding-left: 18px; padding-right: 18px; box-shadow: inset 5px 0 0 var(--red); }
.dayrow.today .d { color: var(--ink); font-weight: 700; }
.dayrow .d small { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
.dayrow .c a { text-decoration: none; font-weight: 500; }
.dayrow .c a:hover { text-decoration: underline; }
.dayrow .c .chips, .week-marks, .unit-sub { margin-top: 0; }
.dayrow .c .chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.dayrow .c .chip, .week-marks .chip { padding: 0 7px; }
.deadline { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 2px solid var(--rule); font-size: 0.95rem; }
.deadline:first-of-type { border-top: 0; }
.deadline a { font-weight: 500; }
.deadline .in { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.deadline .in b { color: var(--ink); }
.deadline.soon .in b { color: var(--ink); background: var(--yellow); padding: 0 5px; }
.continue { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 16px 20px; border: 3px solid var(--ink); background: var(--blue-soft); margin: 22px 0; }
.continue .label { margin-bottom: 4px; color: var(--blue); }
.continue h2 { margin: 0; font-size: 1.25rem; }
.continue h2 a { color: inherit; text-decoration: none; }
.continue h2 a:hover { color: var(--blue); }
.continue p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.92rem; }
@media (max-width: 560px) { .continue { grid-template-columns: 1fr; } .continue .btn { width: 100%; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin: 18px 0 26px; }
.stats > span { display: block; border: 3px solid var(--ink); background: var(--white); padding: 10px 14px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--ink-2); }
.stats b { display: block; font-size: 1.9rem; font-weight: 900; line-height: 1.1; color: var(--ink); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.map { list-style: none; padding: 0; margin: 0; }
.map > li { margin-top: 34px; }
.map .unit-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 0 8px; border-top: 4px solid var(--ink); }
.map .unit-head h2 { margin: 0; font-size: 1.35rem; display: flex; align-items: center; gap: 12px; }
.map .unit-head h2::before { content: ""; width: 14px; height: 14px; background: var(--blue); flex: none; }
.map .unit-head.now h2::before { background: var(--red); }
.map .unit-head .when { color: var(--ink-2); font-size: 0.85rem; }
.map .unit-head .cnt { margin-left: auto; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.map .unit-head.now h2 { color: var(--red); }
.map .week-marks { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.map ol { list-style: none; padding: 0; margin: 8px 0 0; }
.map .row { display: grid; grid-template-columns: 3.4rem 1fr auto; align-items: center; gap: 14px; padding: 12px 14px; border: 2px solid var(--ink); background: var(--white); color: inherit; text-decoration: none; margin-bottom: -2px; }
.map .row:hover { box-shadow: var(--shadow-sm); position: relative; z-index: 1; color: inherit; transform: translate(-1px, -1px); }
.map .row .num { font-weight: 700; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.map .row .t { font-weight: 700; }
.map .row .b { display: block; color: var(--ink-2); font-size: 0.85rem; margin-top: 2px; }
.map .row .right { display: flex; align-items: center; gap: 12px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.map .row .state { min-width: 5.5rem; text-align: right; }
.map .row.m4 .state { color: var(--good); }
@media (max-width: 560px) { .map .row .right > span:first-child, .map .row .b { display: none; } .map .row .state { min-width: 0; } }

/* ---------- lesson ---------- */
.crumbs { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--red); }
.lesson-head { padding-bottom: 18px; border-bottom: 4px solid var(--ink); margin-bottom: 20px; }
.lesson-head h1 { display: block; }
.lesson-head h1 .num { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-right: 14px; background: var(--red); color: var(--white); font-size: 1.2rem; font-weight: 900; padding: 6px 12px; letter-spacing: 0; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; color: var(--ink-2); margin-top: 10px; }
.objectives { border-left: 10px solid var(--yellow); background: var(--white); padding: 14px 18px 6px; margin: 18px 0 26px; }
.objectives .label { display: block; margin-bottom: 4px; }
.objectives ul { margin: 0 0 6px; padding-left: 1.2em; }
.objectives li { margin: 2px 0; }
.prose { text-wrap: pretty; }
.prose h2 { font-size: 1.45rem; font-weight: 900; margin: 40px 0 14px; padding: 12px 0 0 28px; border-top: 4px solid var(--ink); display: block; position: relative; }
.prose h2::before { content: ""; position: absolute; left: 0; top: calc(12px + 0.55em); width: 16px; height: 16px; background: var(--red); transform: translateY(-50%); }
.prose h2:nth-of-type(3n+2)::before { background: var(--blue); border-radius: 50%; }
.prose h2:nth-of-type(3n)::before { background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prose p, .prose ul, .prose ol { margin-bottom: 1em; }
.prose li::marker { color: var(--red); font-weight: 700; }
.callout { background: var(--white); border-left: 10px solid var(--blue); padding: 14px 18px; margin: 20px 0; }
.callout > .label { display: block; margin-bottom: 4px; color: var(--ink-2); }
.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }
.callout .term { font-weight: 700; font-size: 1.12rem; margin-bottom: 6px; }
.callout.def { border-left-color: var(--ink); }
.callout.thm { border-left-color: var(--blue); border-top: 3px solid var(--ink); border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); box-shadow: var(--shadow-sm); }
.callout.thm .label { color: var(--blue); }
.callout.algo { border-left-color: var(--yellow); }
.callout.tip { border-left-color: var(--blue); background: var(--blue-soft); }
.callout.tip .label { color: var(--blue); }
.callout.warn { border-left-color: var(--red); background: var(--red-soft); }
.callout.warn .label { color: var(--red); }
.callout.note { border-left-color: var(--rule); background: var(--paper-2); }
.example { border: 3px solid var(--ink); background: var(--white); margin: 24px 0; }
.example .ex-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 3px solid var(--ink); background: var(--blue-soft); }
.example .ex-head .label { background: var(--blue); color: var(--white); padding: 2px 8px; }
.example .ex-head b { font-size: 1.05rem; }
.example .ex-problem { padding: 14px 18px 2px; }
.example .ex-solution { padding: 12px 18px 4px; border-top: 3px solid var(--ink); background: var(--yellow-soft); }
.example .ex-solution > .label { display: block; margin-bottom: 6px; }
/* Over-long inline math scrolls inside its own box instead of widening the page. */
.ex-problem, .ex-solution, .prob-body, .sol, .callout, .check .q, .objectives, .feedback, .drill .solution, .question, .missed li { min-width: 0; overflow-x: auto; }
.choice > span:last-child { min-width: 0; overflow-x: auto; }

/* inline checks, quiz choices */
.check { border: 3px solid var(--ink); border-left-width: 12px; border-left-color: var(--red); background: var(--white); padding: 14px 18px; margin: 22px 0; }
.check > .label { display: block; margin-bottom: 6px; }
.check .q { font-size: 1.05rem; margin-bottom: 10px; }
.choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.choice { min-width: 0; max-width: 100%; }
.choice { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--ink); background: var(--white); padding: 8px 12px; line-height: 1.4; }
.choice .letter { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--ink); font-weight: 700; font-size: 0.8rem; }
.choice:hover:not(:disabled) { background: var(--paper-2); }
.choice:disabled { cursor: default; }
.choice.correct { background: var(--good-soft); border-color: var(--good); }
.choice.correct .letter { background: var(--good); color: var(--white); border-color: var(--good); }
.choice.wrong { background: var(--red-soft); border-color: var(--red); }
.choice.wrong .letter { background: var(--red); color: var(--white); border-color: var(--red); }
.feedback { margin-top: 12px; padding: 12px 16px; border: 3px solid var(--ink); background: var(--white); }
.feedback.ok { border-color: var(--good); }
.feedback.no { border-color: var(--red); }
.feedback b { display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; }
.feedback.ok b { color: var(--good); }
.feedback.no b { color: var(--red); }
.feedback p { margin: 0 0 10px; }
.feedback p:last-child { margin-bottom: 0; }

/* practice problems */
.practice-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 12px; border-top: 4px solid var(--ink); }
.practice-head h2 { margin: 0; position: relative; padding-left: 28px; }
.practice-head h2::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 16px; height: 16px; background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: translateY(-50%); }
.practice-head .muted { margin-left: auto; font-size: 0.82rem; }
.prob { border: 3px solid var(--ink); background: var(--white); margin: 18px 0; }
.prob .prob-head { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 2px solid var(--rule); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--ink-2); }
.prob .prob-head .n { background: var(--ink); color: var(--white); padding: 2px 8px; }
.prob .prob-head .mark { margin-left: auto; }
.prob .prob-body { padding: 14px 18px 2px; }
.prob details { border-top: 2px solid var(--rule); }
.prob summary { cursor: pointer; padding: 10px 18px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; font-size: 0.78rem; color: var(--blue); list-style: none; display: flex; align-items: center; gap: 8px; }
.prob summary::-webkit-details-marker { display: none; }
.prob summary::before { content: ""; width: 0; height: 0; border-left: 8px solid var(--ink); border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform 120ms; }
.prob details[open] summary::before { transform: rotate(90deg); }
.prob .sol { padding: 4px 18px 10px; border-top: 2px solid var(--rule); background: var(--yellow-soft); }
.prob .sol .label { display: block; margin: 8px 0 6px; }
.selfmark { display: flex; gap: 10px; padding: 10px 18px 14px; background: var(--yellow-soft); }
.prob.solved { border-color: var(--good); }
.prob.solved .prob-head .mark { color: var(--good); }
.prob.review { border-color: var(--red); }
.prob.review .prob-head .mark { color: var(--red); }
.hwbox { border: 3px solid var(--ink); background: var(--yellow); padding: 14px 18px; margin: 30px 0; box-shadow: var(--shadow); }
.hwbox .label { color: var(--ink); }
.hwbox a { color: var(--ink); text-decoration-color: var(--ink); }
.hwbox h3 { margin: 4px 0 8px; font-size: 1.15rem; }
.hwbox p { margin: 0 0 6px; }
.hwbox .nums { font-weight: 900; font-size: 1.1rem; }
.cta { margin: 36px 0 16px; padding: 22px; border: 3px solid var(--ink); background: var(--white); text-align: center; }
.cta p { margin: 0 0 14px; color: var(--ink-2); }
.prevnext { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 18px; border-top: 4px solid var(--ink); }
.prevnext a { text-decoration: none; max-width: 48%; color: var(--ink); font-weight: 500; }
.prevnext a:hover { color: var(--red); }
.prevnext .label { display: block; color: var(--ink-2); }

/* ---------- quiz ---------- */
.quiz .kicker, .result .kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.74rem; font-weight: 700; color: var(--ink-2); }
.result .kicker { margin-bottom: 6px; }
.progress { display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; font-weight: 700; color: var(--ink-2); margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.progress .timer { color: var(--ink); }
.progress .timer.low { color: var(--red); }
.question { font-size: 1.25rem; line-height: 1.5; margin: 22px 0 16px; text-wrap: pretty; }
.result { text-align: center; margin: 24px 0; padding: 22px; border: 3px solid var(--ink); background: var(--white); box-shadow: var(--shadow); }
.result .score { font-size: 3.4rem; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.result .score.pass { color: var(--good); }
.result .score.fail { color: var(--red); }
.result .verdict { margin-top: 8px; color: var(--ink-2); }
.missed { list-style: none; padding: 0; margin: 0; }
.missed li { padding: 14px 0; border-top: 2px solid var(--rule); }
.missed .q { font-size: 1.05rem; }
.missed .ans { color: var(--good); font-weight: 500; margin: 4px 0; }
.missed .why { color: var(--ink-2); margin: 0; }
table.plain { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; background: var(--white); border: 3px solid var(--ink); }
table.plain td, table.plain th { padding: 8px 12px; border-bottom: 2px solid var(--rule); text-align: left; vertical-align: top; }
table.plain tr:last-child td { border-bottom: 0; }
table.plain td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.plain th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; background: var(--ink); color: var(--white); border-bottom: 0; }

/* ---------- practice hub and drills ---------- */
.tools { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 640px) { .tools { grid-template-columns: 1fr 1fr; } }
.tool { display: block; padding: 16px 18px; border: 3px solid var(--ink); background: var(--white); color: inherit; text-decoration: none; }
.tool:hover { box-shadow: var(--shadow); transform: translate(-2px, -2px); color: inherit; }
.tool h2 { margin: 0 0 4px; font-size: 1.1rem; }
.tool p { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.tool .glyph { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px; background: var(--blue); color: var(--white); font-weight: 900; font-size: 1.15rem; margin-bottom: 10px; }
.tools .tool:nth-child(3n+2) .glyph { background: var(--red); }
.tools .tool:nth-child(3n) .glyph { background: var(--yellow); color: var(--ink); }
.tool .stat { display: block; margin-top: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; font-weight: 700; color: var(--ink-2); }
.drill .prompt { font-size: 1.12rem; margin: 18px 0; padding: 16px 20px; border: 3px solid var(--ink); background: var(--white); }
.drill .prompt .katex-display { margin: 0.4em 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0 16px; }
.fields { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 16px 0; }
.field { display: inline-flex; align-items: center; gap: 8px; }
.field label { font-size: 1.05rem; }
.field input, .grid input { width: 4.8rem; padding: 8px 8px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; }
.field input:focus, .grid input:focus { outline: none; box-shadow: 3px 3px 0 var(--blue); border-color: var(--blue); }
input.ok { border-color: var(--good) !important; background: var(--good-soft); }
input.no { border-color: var(--red) !important; background: var(--red-soft); }
.grid { display: inline-grid; gap: 6px; padding: 8px 10px; border-left: 4px solid var(--ink); border-right: 4px solid var(--ink); margin: 8px 0; }
.grid input { width: 5rem; }
.drill .verdict-line { margin: 12px 0; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; font-size: 0.82rem; }
.verdict-line.ok { color: var(--good); }
.verdict-line.no { color: var(--red); }
.drill .solution { border: 3px solid var(--ink); background: var(--yellow-soft); padding: 12px 16px; margin: 16px 0; }
.drill .solution .label { display: block; margin-bottom: 4px; }
.seg { display: inline-flex; border: 2px solid var(--ink); }
.seg button { border: 0; background: var(--white); padding: 6px 12px; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

/* ---------- schedule ---------- */
.sched-wrap { overflow-x: auto; margin: 16px 0; border: 3px solid var(--ink); background: var(--white); }
table.sched { border-collapse: collapse; width: 100%; min-width: 720px; table-layout: fixed; font-size: 0.82rem; }
table.sched th, table.sched td { border: 2px solid var(--rule); padding: 8px 8px; vertical-align: top; text-align: left; overflow-wrap: break-word; hyphens: auto; }
table.sched th { background: var(--ink); color: var(--white); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; font-weight: 700; border-color: var(--ink); }
table.sched td.wk { background: var(--paper-2); font-weight: 700; width: 6rem; }
table.sched th:first-child { width: 6rem; }
table.sched td.wk small { display: block; font-weight: 400; color: var(--ink-2); }
table.sched td .d { color: var(--ink-2); font-variant-numeric: tabular-nums; display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-bottom: 2px; }
table.sched td.today { outline: 3px solid var(--red); outline-offset: -3px; }
table.sched td.holiday { background: var(--paper-2); color: var(--ink-2); }
table.sched td.exam { background: var(--red-soft); }
table.sched td.quiz { background: var(--blue-soft); }
table.sched td.past { color: var(--ink-2); }
table.sched td a { text-decoration: none; font-weight: 500; }
table.sched td a:hover { text-decoration: underline; }
table.sched td .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
table.sched td .chip { font-size: 0.66rem; padding: 0 6px; white-space: normal; line-height: 1.5; text-align: left; }
.hwlist { list-style: none; padding: 0; margin: 0; border: 3px solid var(--ink); background: var(--white); }
.hwlist li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 2px solid var(--rule); font-size: 0.95rem; }
.hwlist li:first-child { border-top: 0; }
.hwlist .due { color: var(--ink-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; white-space: nowrap; }
.hwlist li.done { color: var(--ink-2); background: var(--paper-2); }
.hwlist li.done .t { text-decoration: line-through; }

/* ---------- grades ---------- */
.gradeform { display: grid; gap: 14px; margin: 16px 0; }
@media (min-width: 640px) { .gradeform { grid-template-columns: repeat(2, 1fr); } }
.gradeform label { display: grid; gap: 4px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; color: var(--ink-2); }
.gradeform input { padding: 9px 12px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); font-size: 1.05rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.gradeform input:focus { outline: none; border-color: var(--blue); box-shadow: 3px 3px 0 var(--blue); }
.gradeform small { color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 0.82rem; }
.grade-out { display: grid; gap: 14px; margin: 18px 0; }
@media (min-width: 640px) { .grade-out { grid-template-columns: 1fr 1fr 1fr; } }
.grade-out .card { text-align: center; }
.grade-out .big { font-size: 2.2rem; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.grade-out .card.best { border-color: var(--blue); box-shadow: 5px 5px 0 var(--blue); }

/* ---------- reference ---------- */
.ref h2 { margin-top: 36px; padding: 12px 0 0 28px; border-top: 4px solid var(--ink); position: relative; }
.ref h2::before { content: ""; position: absolute; left: 0; top: calc(12px + 0.55em); width: 16px; height: 16px; background: var(--blue); border-radius: 50%; transform: translateY(-50%); }
.cards { display: grid; gap: 14px; }
@media (min-width: 760px) { .cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cards .card { margin: 0; font-size: 0.98rem; }
.cards .card h3 { margin: 0 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--blue); }
.cards .card h3 .katex { font-size: 1.25em; }
.cards .card p:last-child, .cards .card ul:last-child { margin-bottom: 0; }
.cards .card .katex-display { margin: 0.35em 0; }
.search { width: 100%; padding: 10px 14px; border: 3px solid var(--ink); background: var(--white); color: var(--ink); font: inherit; margin: 8px 0 18px; }
.search:focus { outline: none; box-shadow: 4px 4px 0 var(--blue); }
.search { -webkit-appearance: none; appearance: none; border-radius: 0; }
.search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* ---------- exams ---------- */
.option { border: 3px solid var(--ink); background: var(--white); padding: 16px 20px; margin: 18px 0; }
.option h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.2rem; }
.option p { color: var(--ink-2); margin: 0 0 8px; font-size: 0.92rem; }
.option .cover { font-size: 0.85rem; margin: 6px 0 12px; }
.option .cover a { text-decoration: none; font-weight: 500; }
.option .cover a:hover { text-decoration: underline; }
.cover .sep { color: var(--rule); }
.exam-opts { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.exam-opts label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; }
.empty h1 { margin-bottom: 8px; color: var(--ink); }

/* ---------- small screens ---------- */
#main.wide table.plain td:first-child { white-space: nowrap; width: 1%; }
#main.wide table.plain td:last-child { white-space: normal; text-align: left; }
/* The calendar wants the full width: at laptop widths drop the sidebar on the wide page instead of cropping Friday. */
@media (min-width: 901px) { .wrap:has(> #main.wide) { grid-template-columns: 1fr; } .wrap:has(> #main.wide) #side { display: none; } }
.sched-wrap { scrollbar-width: thin; }
@media (max-width: 600px) {
  .drill .prompt { padding: 12px; font-size: 1rem; }
  .grid { gap: 4px; padding: 6px; }
  .grid input { width: min(5rem, calc((100vw - 92px) / 4)); padding-left: 4px; padding-right: 4px; }
  table.plain td:last-child { white-space: normal; }
  .hwlist li { grid-template-columns: auto 1fr; }
  .hwlist .due { grid-column: 2; white-space: normal; }
  .lesson-head h1 { font-size: 1.5rem; }
  .question { font-size: 1.12rem; }
  .dayrow.today { margin: 0; padding-left: 0; padding-right: 0; }
}
