:root {
  --bg: #f1f5fc;
  --panel: #ffffff;
  --ink: #142641;
  --muted: #5c6b80;
  --line: #dfe4ee;
  --brand: #142641;
  --accent: #245ce5;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --ok-bg: #e8f6ed;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --note-bg: #fff6e0;
  --radius: 10px;
  --gold: #C9962B;
}
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11151d; --panel: #1a2030; --ink: #e8ecf4; --muted: #9aa5ba; --line: #2b3347;
    --brand: #0c1830; --accent: #5b8dff; --accent-ink: #0b1220;
    --ok: #5fd08a; --ok-bg: #16301f; --bad: #ff8a80; --bad-bg: #3a1a18; --note-bg: #3a3014;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11151d; --panel: #1a2030; --ink: #e8ecf4; --muted: #9aa5ba; --line: #2b3347;
  --brand: #0c1830; --accent: #5b8dff; --accent-ink: #0b1220;
  --ok: #5fd08a; --ok-bg: #16301f; --bad: #ff8a80; --bad-bg: #3a1a18; --note-bg: #3a3014;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; }
.loading { padding: 2rem; color: var(--muted); }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* top bar */
/* brand fonts: set here when white-labelling */
:root { --font-display: "Bodoni Moda", Georgia, serif; --font-tagline: "Cormorant Garamond", Georgia, serif; }
.topbar { background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem; }
.topbar a { color: var(--ink); text-decoration: none; }
.brand { display: flex; align-items: center; gap: .5rem; }
.brand .wordmark { font-family: var(--font-display); font-variation-settings: "wght" 680, "opsz" 14; font-size: 1.45rem; letter-spacing: -.5px; line-height: 1; white-space: nowrap; }
.wordmark .gold { color: var(--gold); }
.brand .product { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-left: .15rem; }
.crown { width: 1.6rem; height: 1.6rem; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.crown.big { width: 2.6rem; height: 2.6rem; }
.auth-brand { text-align: center; margin-bottom: 1.2rem; }
.brand-emblem { height: 2.7rem; width: auto; background: #fff; border-radius: 8px; padding: 2px; display: block; }
.brand-logo { display: block; width: min(100%, 460px); height: auto; margin: 0 auto; background: #fff; border-radius: 12px; }
.auth-brand .wordmark { font-family: var(--font-display); font-variation-settings: "wght" 680, "opsz" 14; font-size: 2.6rem; letter-spacing: -1px; line-height: 1.1; }
.auth-brand .tagline { font-family: var(--font-tagline); font-style: italic; font-weight: 500; font-size: 1.3rem; color: var(--accent); }
.auth h1 { text-align: center; font-size: 1.1rem; }
.auth .sub { text-align: center; }
.crumb { color: var(--muted); border-left: 1px solid var(--line); padding-left: 1rem; }
.spacer { flex: 1; }
.who em { opacity: .75; font-style: normal; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 0; }

/* layout */
.layout { display: grid; grid-template-columns: 310px 1fr; min-height: calc(100vh - 52px); }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 1rem; overflow-y: auto; }
.main { padding: 1.5rem clamp(1rem, 3vw, 2.5rem); max-width: 60rem; width: 100%; }
@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; }
  .topbar { flex-wrap: wrap; row-gap: .3rem; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 34vh; }
}

/* sidebar */
.side-title { font-weight: 700; margin: 0 0 .25rem; }
.side-sub { color: var(--muted); font-size: .85rem; margin-bottom: .75rem; }
.side-link { display: block; padding: .35rem .5rem; border-radius: 6px; text-decoration: none; color: var(--ink); }
.side-link:hover { background: var(--bg); }
.side-link.current { background: var(--accent); color: var(--accent-ink); }
details.chapter { margin: .4rem 0; }
details.chapter > summary { cursor: pointer; font-weight: 600; padding: .35rem .25rem; }
.sec { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .5rem .4rem 1rem; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .95rem; }
.sec:hover { background: var(--bg); }
.sec.current { background: var(--accent); color: var(--accent-ink); }
.sec .count { font-size: .8rem; opacity: .8; white-space: nowrap; }
.sec.done .count::before { content: "✔ "; color: var(--ok); }
.sec.current.done .count::before { color: var(--accent-ink); }

/* progress bar */
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ok); }

/* cards + headings */
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
.sub { color: var(--muted); margin: 0 0 1.25rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.problem-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: .5rem; }
.problem-num { font-weight: 700; }
.badge { font-size: .8rem; padding: .15rem .6rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.prompt { font-size: 1.1rem; margin: .25rem 0 1rem; }

/* answer controls */
.answer-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
input[type=text], input[type=password] { font: inherit; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-width: 14rem; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .4rem; }
.choices { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.choices label { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--bg); }
.choices label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.btn { padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.feedback { margin-top: .9rem; padding: .6rem .9rem; border-radius: 8px; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback.note { background: var(--note-bg); }

/* login */
.auth { max-width: 26rem; margin: 8vh auto; padding: 0 1rem; }
.auth .card { padding: 1.5rem; }
.auth label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
.auth input { width: 100%; }
.auth .btn { width: 100%; margin-top: 1.2rem; }
.tabs { display: flex; gap: .5rem; margin-bottom: .5rem; }
.tab { flex: 1; padding: .5rem; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; }
.tab[aria-selected=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.error { color: var(--bad); margin-top: .8rem; }

/* course list + gradebook */
.course-list { display: grid; gap: .8rem; }
.course-item { display: block; text-decoration: none; color: inherit; }
.course-item:hover { border-color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { border: 1px solid var(--line); padding: .45rem .7rem; text-align: left; white-space: nowrap; }
th { background: var(--bg); font-size: .85rem; }
td.num { text-align: center; }

/* ---------- editor ---------- */
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 12rem; min-width: 8rem; }
.muted { color: var(--muted); }
.field { margin: 1rem 0; }
.field > label, .card > label, dialog.modal label { display: block; font-weight: 600; margin-bottom: .3rem; }
textarea, select { font: inherit; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); max-width: 100%; }
.field textarea, .field input[type=text] { width: 100%; }
.row input[type=text] { min-width: 0; }
input.tiny { width: 3rem; text-align: center; }
input.num { width: 5rem; }
input.wide { width: 9rem; }
.pform h2, dialog.modal h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
fieldset.block, details.block, div.block { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin: 1rem 0; }
fieldset.block legend { font-weight: 600; padding: 0 .3rem; }
details.block > summary { cursor: pointer; font-weight: 600; }
.linkbtn { background: none; border: 0; color: var(--accent); padding: .2rem 0; text-decoration: underline; }
.linkbtn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.linkbtn.indent { margin-left: 1rem; }
.icon { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; width: 1.9rem; height: 1.9rem; line-height: 1; padding: 0; }
.icon:hover:not(:disabled) { border-color: var(--accent); }
.icon:disabled { opacity: .35; cursor: default; }
.btn.full { width: 100%; margin-top: .75rem; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-outline { background: transparent; color: var(--bad); border-color: var(--bad); }
.danger-zone { border-color: var(--bad); }
.tip { background: var(--note-bg); }
.code { font-size: 1.4rem; letter-spacing: .12em; font-weight: 700; }
.check { display: flex; gap: .4rem; align-items: center; margin-top: .6rem; }
.json { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.snippet { margin: .25rem 0 .75rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }

/* outline (left column of the editor) */
.outline-title { margin-top: 1rem; }
.o-chapter { margin: .8rem 0; }
.o-head { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.o-title { font-weight: 600; flex: 1 1 100%; }
.o-section { display: flex; align-items: center; gap: .25rem; margin-top: .25rem; }
.o-link { flex: 1; display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .95rem; min-width: 0; }
.o-link:hover { background: var(--bg); }
.o-section.current .o-link { background: var(--accent); color: var(--accent-ink); }
.o-link .count { opacity: .75; font-size: .8rem; }

/* live preview while writing a problem */
.preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin: 1rem 0; }
.okline { color: var(--ok); }
.errors { color: var(--bad); margin: .3rem 0; padding-left: 1.2rem; }
.sample { border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .6rem; }
.sample .prompt { margin: .2rem 0 .5rem; }
.preview-choices { list-style: none; padding: 0; margin: 0 0 .4rem; display: grid; gap: .25rem; }
.preview-choices li { display: flex; gap: .5rem; }
.preview-choices .mark { width: 1.2rem; color: var(--ok); }
.preview-choices li.right { font-weight: 600; }

/* dialogs and messages */
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); padding: 1.25rem; width: min(28rem, calc(100vw - 2rem)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .45); }
dialog.modal input[type=text] { width: 100%; }
.flash { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); padding: .6rem 1rem; border-radius: 8px; background: var(--brand); color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); max-width: calc(100vw - 2rem); z-index: 10; }
.flash.bad { background: var(--bad); }
.flash[hidden] { display: none; }

/* math drawn by mathfallback.js when KaTeX is not available */
.tex { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, "Times New Roman", serif; font-size: 1.08em; }
.tex .op { margin: 0 .16em; }
.tex .rel { margin: 0 .28em; }
.tex sup, .tex sub { font-size: .7em; line-height: 0; }
.tex .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .15em; }
.tex .frac .num { border-bottom: 1.5px solid currentColor; padding: 0 .25em .05em; }
.tex .frac .den { padding: .05em .25em 0; }
.tex .sqrt .rad { border-top: 1.5px solid currentColor; padding: 0 .1em; margin-left: .05em; }

/* several answer boxes in one problem */
.multi { margin-top: .4rem; }
.multi-row { display: flex; align-items: center; gap: .6rem; margin: .45rem 0 .1rem; }
.multi-label { min-width: 5.5rem; text-align: right; }
.multi-row input { flex: 1; max-width: 22rem; }
.multi-hint { margin-left: 6.1rem; }
.multi input.ok { border-color: var(--ok); background: var(--ok-bg); }
.multi input.bad { border-color: var(--bad); background: var(--bad-bg); }
.multi-pick { display: flex; flex-wrap: wrap; gap: .5rem; padding: 3px; border-radius: 12px; }
.multi-pick button { font: inherit; padding: .5rem 1rem; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
.multi-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); font-weight: 700; }
.multi-pick.ok { background: var(--ok-bg); }
.multi-pick.bad { background: var(--bad-bg); }
.part-block { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: .6rem 0; background: var(--bg); }
.preview-choices .lbl { display: inline-block; min-width: 4rem; }

/* live equation preview under answer boxes */
.live { margin: .4rem 0 .2rem; min-height: 2.2rem; padding: .35rem .75rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent, #6d4ae0); border-radius: 9px; max-width: 34rem; box-sizing: border-box; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.live[hidden] { display: none; }
.live-label { color: var(--muted); font-size: .85rem; }
.live-body { font-size: 1.25rem; line-height: 1.5; max-width: 100%; overflow-x: auto; white-space: nowrap; }
.live.soft { border-left-color: var(--muted); }
.live.soft .live-body { color: var(--muted); font-size: .9rem; }
.multi-live { margin-left: 6.1rem; }
.multi-inline { display: flex; flex-wrap: wrap; align-items: center; column-gap: .5rem; }
.multi-inline .multi-label { min-width: 0; }
.multi-inline .multi-row input[type=text], body.kids .multi-inline .multi-row input[type=text] { flex: none; width: 5.5rem; min-width: 0; }
.multi-inline .multi-live { margin-left: 0; }
.multi-inline > .hint { flex-basis: 100%; }

/* pictures drawn from a problem's numbers */
.figure-box { margin: .25rem 0 1rem; }
svg.figure { width: 100%; max-width: 440px; height: auto; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: block; }
.figure .fig-frame { fill: none; stroke: var(--line); }
.figure .fig-grid { stroke: var(--line); stroke-width: 1; }
.figure .fig-axis { stroke: var(--muted); stroke-width: 1.2; }
.figure .fig-tick, .figure .fig-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.figure .fig-label { font-size: 12px; }
.figure .fig-curve { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.figure .fig-seg { stroke: var(--ink); stroke-width: 2; }
.figure .fig-tick-mark { stroke: var(--ink); stroke-width: 2; }
.figure .fig-arc-mark { fill: none; stroke: var(--accent); stroke-width: 2; }
.figure .fig-circle { fill: none; stroke: var(--ink); stroke-width: 2; }
.figure .fig-pic { fill: none; stroke: #8a8f98; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.figure .fig-pic.pic-white { fill: var(--panel); }
.figure .fig-pic.pic-red { fill: #f3b0b2; stroke: #c9595d; }
.figure .fig-pic.pic-yellow { fill: #fbe6a2; stroke: #c9a227; }
.figure .fig-pic.pic-dark { fill: #c9ccd2; }
.figure .fig-pic.pic-green { fill: #bfe3cc; stroke: #5e9e77; }
.figure .fig-pic.pic-brick { fill: #f1d2c2; stroke: #c48a72; }
.figure .fig-pic.pic-mortar { stroke: #c48a72; stroke-width: 1; }
.figure .fig-pic.pic-wood { stroke: #a0785a; stroke-width: 2.2; }
.figure .fig-pic.pic-grass { stroke: #5e9e77; }
.figure .fig-pic.pic-water { stroke: #6a9fd8; }
.figure .fig-pic.pic-dash { stroke: #ffffff; stroke-dasharray: 6 5; stroke-width: 2; }
.figure .fig-pic.pic-window { stroke: #6a9fd8; stroke-width: 2; }
.figure .fig-pic.pic-rail { stroke: #a0785a; stroke-width: 1.8; }
.figure .fig-par-mark { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.figure .fig-right-mark { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.figure .fig-region { fill: var(--accent); fill-opacity: .2; stroke: none; }
.figure .fig-region.c-blue { fill: #3e63dd; fill-opacity: .18; }
.figure .fig-outline { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.figure .fig-outline.c-blue { stroke: #3e63dd; }
.figure .fig-area { fill: var(--accent); fill-opacity: .22; stroke: none; }
.figure .fig-bar { fill: var(--accent); fill-opacity: .55; stroke: var(--ink); stroke-width: 1; }
.figure .fig-box { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.figure .fig-mark { stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.figure .fig-dot { fill: var(--ink); }
.figure .fig-dot.open { fill: var(--panel); stroke: var(--ink); stroke-width: 2; }
.figure .fig-text { fill: var(--ink); font-size: 13px; font-family: inherit; }
img.problem-img { max-width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
img.problem-img.thumb { max-width: 240px; margin: .4rem 0; }
svg.figure.figure-small { max-width: 320px; }
.figure .plane-axis { stroke: var(--ink); stroke-width: 1.4; }
.figure .fig-axisname { fill: var(--ink); font-size: 14px; font-style: italic; font-family: Georgia, 'Times New Roman', serif; }
.figure .plane-backing { fill: var(--panel); stroke: none; }
.figure .plane-label { paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
.figure .plane-num { paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
svg.figure3d { cursor: grab; touch-action: none; user-select: none; max-width: 480px; }
.figure .fig-patch { fill: var(--accent); stroke: var(--panel); stroke-width: .6; stroke-linejoin: round; }
.figure .fig-tick3 { fill: var(--muted); font-size: 9px; font-family: inherit; }
.figure .fig-tickdot { fill: var(--muted); }

/* picture colors, emoji and tap-to-count */
.figure .fig-bar.c-red { fill: #e5484d; fill-opacity: .8; }
.figure .fig-box.c-red { stroke: #e5484d; stroke-width: 2.4; }
.figure .fig-dot.c-red { fill: #e5484d; }
.figure .fig-dot.open.c-red { fill: var(--panel); stroke: #e5484d; }
.figure .fig-seg.c-red, .figure .fig-curve.c-red { stroke: #e5484d; stroke-width: 3; }
.figure .fig-bar.c-orange { fill: #f08a24; fill-opacity: .8; }
.figure .fig-box.c-orange { stroke: #f08a24; stroke-width: 2.4; }
.figure .fig-dot.c-orange { fill: #f08a24; }
.figure .fig-dot.open.c-orange { fill: var(--panel); stroke: #f08a24; }
.figure .fig-seg.c-orange, .figure .fig-curve.c-orange { stroke: #f08a24; stroke-width: 3; }
.figure .fig-bar.c-yellow { fill: #f5c518; fill-opacity: .8; }
.figure .fig-box.c-yellow { stroke: #f5c518; stroke-width: 2.4; }
.figure .fig-dot.c-yellow { fill: #f5c518; }
.figure .fig-dot.open.c-yellow { fill: var(--panel); stroke: #f5c518; }
.figure .fig-seg.c-yellow, .figure .fig-curve.c-yellow { stroke: #f5c518; stroke-width: 3; }
.figure .fig-bar.c-green { fill: #30a46c; fill-opacity: .8; }
.figure .fig-box.c-green { stroke: #30a46c; stroke-width: 2.4; }
.figure .fig-dot.c-green { fill: #30a46c; }
.figure .fig-dot.open.c-green { fill: var(--panel); stroke: #30a46c; }
.figure .fig-seg.c-green, .figure .fig-curve.c-green { stroke: #30a46c; stroke-width: 3; }
.figure .fig-bar.c-teal { fill: #12a594; fill-opacity: .8; }
.figure .fig-box.c-teal { stroke: #12a594; stroke-width: 2.4; }
.figure .fig-dot.c-teal { fill: #12a594; }
.figure .fig-dot.open.c-teal { fill: var(--panel); stroke: #12a594; }
.figure .fig-seg.c-teal, .figure .fig-curve.c-teal { stroke: #12a594; stroke-width: 3; }
.figure .fig-bar.c-blue { fill: #3e63dd; fill-opacity: .8; }
.figure .fig-box.c-blue { stroke: #3e63dd; stroke-width: 2.4; }
.figure .fig-dot.c-blue { fill: #3e63dd; }
.figure .fig-dot.open.c-blue { fill: var(--panel); stroke: #3e63dd; }
.figure .fig-seg.c-blue, .figure .fig-curve.c-blue { stroke: #3e63dd; stroke-width: 3; }
.figure .fig-bar.c-purple { fill: #8e4ec6; fill-opacity: .8; }
.figure .fig-box.c-purple { stroke: #8e4ec6; stroke-width: 2.4; }
.figure .fig-dot.c-purple { fill: #8e4ec6; }
.figure .fig-dot.open.c-purple { fill: var(--panel); stroke: #8e4ec6; }
.figure .fig-seg.c-purple, .figure .fig-curve.c-purple { stroke: #8e4ec6; stroke-width: 3; }
.figure .fig-bar.c-pink { fill: #e93d82; fill-opacity: .8; }
.figure .fig-box.c-pink { stroke: #e93d82; stroke-width: 2.4; }
.figure .fig-dot.c-pink { fill: #e93d82; }
.figure .fig-dot.open.c-pink { fill: var(--panel); stroke: #e93d82; }
.figure .fig-seg.c-pink, .figure .fig-curve.c-pink { stroke: #e93d82; stroke-width: 3; }
.figure .fig-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; user-select: none; }
.figure .fig-hit { fill: transparent; cursor: pointer; }
.figure .fig-badge { fill: var(--accent); stroke: #fff; stroke-width: 2; pointer-events: none; }
.figure .fig-badge-text { fill: #fff; font-weight: 800; font-family: inherit; pointer-events: none; }
.tap-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.tap-wrap svg.figure { flex-basis: 100%; }
.tap-note { font-weight: 700; color: var(--accent); }
.tap-reset { font: inherit; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }

/* friendly look for the early-years course */
body.kids { --bg: #fff8e6; --accent: #6a4be8; --line: #f0dfb8; font-family: "Trebuchet MS", "Segoe UI", "Comic Sans MS", system-ui, sans-serif; font-size: 18px; }
body.kids .card { border-radius: 18px; border: 2px solid #f4d98a; border-top: 8px solid var(--accent); box-shadow: 0 3px 0 #f0dfb8; }
body.kids .prompt { font-size: 1.6rem; line-height: 1.5; font-weight: 600; }
body.kids .problem-num { font-size: 1.2rem; color: var(--accent); }
body.kids input[type=text] { font-size: 1.4rem; padding: .6rem .9rem; border-radius: 14px; border: 2px solid #f4d98a; min-width: 9rem; }
body.kids .btn { font-size: 1.15rem; padding: .65rem 1.4rem; border-radius: 999px; }
body.kids .choices label { font-size: 1.3rem; padding: .8rem 1rem; border-radius: 16px; border: 2px solid #f4d98a; background: #fff; }
body.kids .feedback { font-size: 1.25rem; font-weight: 700; border-radius: 16px; }
body.kids .feedback.ok::before { content: "\1F389  "; }
body.kids .feedback.bad::before { content: "\1F642  "; }
body.kids h1 { color: var(--accent); }
body.kids svg.figure { max-width: 520px; border: 2px solid #f4d98a; border-radius: 16px; }

/* drag-and-drop answer controls */
.wd-piece.wd-c-red { --c: #e5484d; }
.wd-piece.wd-c-orange { --c: #f08a24; }
.wd-piece.wd-c-yellow { --c: #f5c518; }
.wd-piece.wd-c-green { --c: #30a46c; }
.wd-piece.wd-c-teal { --c: #12a594; }
.wd-piece.wd-c-blue { --c: #3e63dd; }
.wd-piece.wd-c-purple { --c: #8e4ec6; }
.wd-piece.wd-c-pink { --c: #e93d82; }

.wd { margin: .25rem 0 .5rem; }
.wd-help { color: var(--muted); font-size: .95rem; margin-bottom: .5rem; }
.wd-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .5rem; }
.wd-total { font-weight: 700; color: var(--accent); min-height: 1.4em; }
.wd-note { color: var(--bad); font-size: .9rem; min-height: 1.2em; }
.wd-clear { font: inherit; font-size: .9rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.wd-palette { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .9rem; padding: .7rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); }
.wd-box { min-height: 110px; margin-top: .6rem; padding: .6rem; border: 2px dashed var(--accent); border-radius: 14px; background: var(--panel); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; }
.wd-box.wd-tens { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); align-content: start; align-items: center; justify-items: center; container-type: inline-size; }
.wd-box.wd-tens .wd-emoji { font-size: min(34px, 8cqi); }
.wd-box.wd-tens .wd-block { width: min(34px, 8cqi); height: min(34px, 8cqi); }
.wd-piece { --c: var(--accent); border: 2px solid rgba(0,0,0,.35); background: var(--c); cursor: grab; padding: 0; touch-action: none; user-select: none; font: inherit; color: #fff; font-weight: 800; }
.wd-piece.in-box { cursor: pointer; }
.wd-hundred { width: 58px; height: 58px; border-radius: 4px; }
.wd-ten { width: 14px; height: 58px; border-radius: 3px; }
.wd-one { width: 14px; height: 14px; border-radius: 3px; }
.wd-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wd-cap { font-size: .9rem; font-weight: 700; line-height: 1; }
.wd-coin { width: 46px; height: 46px; border-radius: 50%; font-size: .85rem; color: #3a2f00; }
.wd-emoji { background: transparent; border: none; font-size: 34px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.wd-ghost { position: fixed; z-index: 50; transform: translate(-50%, -50%); pointer-events: none; opacity: .85; }
.wd-clock, .wd-numline { width: 100%; max-width: 420px; display: block; touch-action: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.wd-clock { max-width: 300px; cursor: pointer; }
.wd-face { fill: var(--panel); stroke: #8e4ec6; stroke-width: 4; }
.wd-num { fill: var(--ink); font-size: 15px; font-family: inherit; }
.wd-tick { stroke: var(--muted); stroke-width: 1; }
.wd-hand { stroke-linecap: round; }
line.wd-hour { stroke: #e5484d; stroke-width: 7; }
line.wd-min { stroke: #3e63dd; stroke-width: 4; }
circle.wd-knob { fill-opacity: .3; stroke-width: 2; }
circle.wd-knob.wd-hour { fill: #e5484d; stroke: #e5484d; }
circle.wd-knob.wd-min { fill: #3e63dd; stroke: #3e63dd; }
.wd-pin { fill: var(--ink); }
.wd-strip { display: flex; max-width: 460px; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.wd-cell { flex: 1; height: 56px; border: none; border-right: 2px solid var(--ink); background: var(--panel); cursor: pointer; }
.wd-cell:last-child { border-right: none; }
.wd-cell.on { background: #30a46c; }
.wd-axis { stroke: var(--ink); stroke-width: 2; }
.wd-numline { cursor: pointer; }
.wd-dot { fill: #e5484d; stroke: #fff; stroke-width: 3; }

/* sticker trail */
.trail-note { margin: .3rem 0 .8rem; color: var(--muted); }
.trail-path { display: grid; gap: 14px; }
.trail-row { display: flex; justify-content: space-between; gap: 6px; position: relative; }
.trail-row.back { flex-direction: row-reverse; }
.trail-row::before { content: ""; position: absolute; left: 20px; right: 20px; top: 50%; border-top: 4px dotted #f0c96a; z-index: 0; }
.stop { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; background: #fff; border: 3px dashed #e8d9ab; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.stop.got { border: 3px solid var(--accent); background: #f4efff; }
.stop.next { border: 3px dashed var(--accent); color: var(--accent); font-weight: 800; font-size: 24px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .stop.next { animation: none; } }

/* ---- block pieces, drawn coins, circles, grid, sorting boxes, cuts, number-line marker ---- */
.wd-block { width: 34px; height: 34px; border-radius: 6px; }
.wd-piece.wd-realcoin { width: auto; height: auto; background: transparent; border: none; border-radius: 50%; display: inline-flex; }
.wd-coinimg { display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.wd-pile { min-height: 60px; }
.wd-binrow { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .7rem; }
.wd-bin { width: 118px; min-height: 118px; border: 3px solid var(--accent); border-radius: 50%; background: var(--panel); display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 1px; padding: .5rem; }
.wd-bin .wd-emoji { font-size: 22px; }
.wd-grid { display: grid; gap: 3px; margin-top: .4rem; touch-action: none; user-select: none; }
.wd-gcell { aspect-ratio: 1 / 1; min-height: 34px; border: 2px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; padding: 0; font-size: 22px; line-height: 1; }
.wd-gcell.on { background: var(--accent); border-color: var(--accent); }
.wd-gcell.on.sq { border-radius: 3px; }
.wd-gcell.wd-c-red.on { background: #e5484d; border-color: #e5484d; } .wd-gcell.wd-c-orange.on { background: #f08a24; border-color: #f08a24; }
.wd-gcell.wd-c-yellow.on { background: #f5c518; border-color: #f5c518; } .wd-gcell.wd-c-green.on { background: #30a46c; border-color: #30a46c; }
.wd-gcell.wd-c-teal.on { background: #12a594; border-color: #12a594; } .wd-gcell.wd-c-blue.on { background: #3e63dd; border-color: #3e63dd; }
.wd-gcell.wd-c-purple.on { background: #8e4ec6; border-color: #8e4ec6; } .wd-gcell.wd-c-pink.on { background: #e93d82; border-color: #e93d82; }
.wd-gcell:has(.x) , .wd-gcell { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.wd-sortrow { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .7rem; }
.wd-sortbox { flex: 1 1 140px; min-height: 120px; border: 2px dashed var(--accent); border-radius: 14px; background: var(--panel); padding: .5rem; }
.wd-sortbox.ready { background: rgba(110,80,230,.08); cursor: pointer; }
.wd-sortlabel { font-weight: 700; color: var(--accent); margin-bottom: .3rem; }
.wd-sortitems { display: flex; flex-wrap: wrap; gap: 6px; }
.wd-thing { font: inherit; padding: .4rem .7rem; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: grab; touch-action: none; user-select: none; }
.wd-thing.picked { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,80,230,.25); }
.wd-orderwrap { display: inline-block; margin-top: .7rem; }
.wd-orderrow { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-matchlist { display: grid; gap: 8px; }
.wd-matchrow { display: flex; align-items: center; gap: .8rem; }
.wd-matchname { min-width: 8.5rem; text-align: right; font-weight: 700; font-size: 1.15rem; }
.wd-orderends { display: flex; justify-content: space-between; margin-top: 4px; font-weight: 700; color: var(--accent); font-size: .9rem; }
.wd-slot { width: 60px; height: 60px; border: 2px dashed var(--accent); border-radius: 12px; background: var(--panel); display: flex; align-items: center; justify-content: center; }
.wd-tile { width: 52px; height: 52px; border-radius: 10px; border: 2px solid var(--accent); background: #fff; color: var(--accent); font: inherit; font-size: 1.6rem; font-weight: 800; cursor: grab; touch-action: none; user-select: none; padding: 0; }
.wd-cutsvg { width: 100%; max-width: 300px; display: block; }
.wd-cutfill { fill: #f5c518; opacity: .55; } .wd-cutline { stroke: var(--ink); stroke-width: 2; } .wd-cutedge { fill: none; stroke: var(--ink); stroke-width: 3; }
.wd-step { min-width: 44px; min-height: 44px; font-size: 1.3rem; }
.wd-half { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 3; } .wd-halftext { fill: var(--muted); font-size: 11px; }
.wd-markpin { fill: #e93d82; } .wd-marktext { fill: #e93d82; font-size: 14px; font-weight: 700; }
.wd-piece { min-width: 0; }
.wd-palette .wd-piece, .wd-box .wd-piece { min-height: 0; }

/* math tools palette */
.mathpad { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .2rem; padding: .5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); max-width: 34rem; }
.mathpad[hidden] { display: none; }
.mp-key { min-width: 2.9rem; min-height: 2.75rem; padding: 0 .55rem; font: inherit; font-size: 1.05rem; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; touch-action: manipulation; }
.mp-key:hover { border-color: var(--accent, #6d4ae0); }
.mp-key:active { background: var(--accent-soft, #ece6ff); }
.mp-wide { min-width: 4rem; }
.mp-hide { margin-left: auto; color: var(--muted); }
.mathpad.mp-fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; max-width: none; border-radius: 12px 12px 0 0; box-shadow: 0 -4px 14px rgba(0,0,0,.15); }

/* worked example */
.example { margin-top: .9rem; padding: .8rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent, #6d4ae0); border-radius: 10px; background: var(--panel); }
.ex-title { font-weight: 600; color: var(--muted); font-size: .9rem; margin-bottom: .4rem; }
.ex-prompt { margin-bottom: .5rem; }
.ex-steps { margin: .6rem 0 .8rem; }
.ex-step { margin: 0 0 1.1rem; line-height: 1.6; }
.ex-answer { font-weight: 600; }

/* MathLive math box (see mathfield.js): replaces the plain answer box in the courses switched on there */
.mf-hidden-input { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; padding: 0 !important; border: 0 !important; }
math-field.mf { display: block; box-sizing: border-box; width: 100%; max-width: 34rem; min-height: 3rem; padding: .35rem .7rem; font-size: 1.35rem; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 10px; --caret-color: var(--accent, #245ce5); --selection-background-color: var(--accent-soft, #dbe6ff); --contains-highlight-background-color: transparent; }
math-field.mf:focus-within { border-color: var(--accent, #245ce5); outline: none; }
math-field.mf.ok { border-color: var(--ok, #1a7f37); }
math-field.mf.bad { border-color: var(--bad, #c62828); }
math-field.mf::part(menu-toggle) { display: none; }
.multi-row math-field.mf { flex: 1; min-width: 8rem; }
.multi-inline .multi-row math-field.mf { flex: none; width: 7rem; min-width: 0; font-size: 1.15rem; }
@media (prefers-color-scheme: dark) { math-field.mf { background: var(--panel); } }
/* MathLive's on-screen keyboard: never wider than the screen, even if something on the page is */
.ML__keyboard { width: 100vw !important; max-width: 100vw !important; }
.ML__keyboard { --keycap-max-width: 74px; --keycap-height: 48px; }
/* wide display math (proof tables) scrolls sideways on narrow screens instead of running past the card */
.prompt .katex-display, .ex-prompt .katex-display { overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; }
/* test mode (diagnostics) */
.btn.small { padding: .2rem .55rem; font-size: .8rem; min-height: 0; }
.check-row { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.test-score strong { font-size: 1.15rem; }
.badge[hidden] { display: none; }
/* printable worksheets (instructors): built in #print-root, shown only when printing */
.print-panel { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin: -.3rem 0 1rem; }
.print-panel .hint { flex-basis: 100%; }
#print-root { display: none; }
@media print {
  @page { margin: 0.6in; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing { background: #fff !important; padding: 0 !important; }
  body.printing #print-root { display: block; color: #000; font-size: 11.5pt; line-height: 1.4; }
  #print-root .ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; border-bottom: 1.5px solid #000; padding-bottom: .4rem; margin-bottom: .8rem; }
  #print-root .ws-course { font-size: 10pt; color: #444; }
  #print-root h1 { font-size: 16pt; margin: .1rem 0 0; }
  #print-root .ws-name { text-align: right; font-size: 10.5pt; }
  #print-root .ws-name > div { margin-top: .3rem; }
  #print-root .ws-name .ws-blank { width: 2in; }
  #print-root .ws-meta { font-size: 9pt; color: #555; }
  #print-root .ws-blank { display: inline-block; width: 1.4in; border-bottom: 1px solid #000; height: 1em; vertical-align: baseline; }
  #print-root .ws-list { padding-left: 1.6em; margin: 0; columns: 2; column-gap: .45in; }
  #print-root .ws-item { break-inside: avoid; page-break-inside: avoid; margin: 0 0 .8rem; padding-left: .2em; }
  #print-root .ws-prompt { margin-bottom: .3rem; }
  #print-root .ws-fig svg.figure { max-width: 3.1in; width: 100%; height: auto; }
  #print-root .ws-fig svg.figure-small { max-width: 2.4in; }
  #print-root .ws-fig img { max-width: 3.1in; }
  #print-root .ws-fig svg.gt-svg { max-width: 3.1in; width: 100%; height: auto; border: 1px solid #999; }
  #print-root .ws-choices { margin: .2rem 0 0 1.2em; padding: 0; }
  #print-root .ws-part { margin: .25rem 0; }
  #print-root .ws-inline-choices > span { margin-right: 1.2em; white-space: nowrap; }
  #print-root .ws-answer, #print-root .ws-note { margin: .4rem 0 0; }
  #print-root .ws-work { height: .6in; }
  #print-root .ws-key { break-before: page; page-break-before: always; }
  #print-root .ws-key h2 { font-size: 14pt; margin: 0; }
  #print-root .ws-key ol { columns: 2; column-gap: .45in; }
  #print-root .ws-key li { margin: .25rem 0; break-inside: avoid; }
}

/* graphing answers (public/graphtool.js) */
.gt { margin: .25rem 0 .5rem; }
.gt-help { color: var(--muted); font-size: .92rem; margin-bottom: .4rem; }
.gt-svg { width: 100%; max-width: 440px; height: auto; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.gt-static .gt-svg { cursor: default; }
.gt-svg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gt-grid { stroke: var(--line); stroke-width: 1; }
.gt-axis { stroke: var(--muted); stroke-width: 1.4; }
.gt-arrowhead { fill: var(--muted); }
.gt-num { fill: var(--muted); font-size: 10.5px; font-family: inherit; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.gt-axname { fill: var(--muted); font-size: 12px; font-style: italic; font-family: Georgia, serif; }
.gt-curve { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.gt-curve.gt-dash { stroke-dasharray: 9 7; }
.gt-curve.gt-c1, .gt-pt.gt-c1 { stroke: #d9480f; }
.gt-shade { fill: var(--accent); fill-opacity: .16; stroke: none; }
.gt-asym { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 5 5; }
.gt-pt { fill: var(--panel); stroke: var(--accent); stroke-width: 3; }
.gt-pt.gt-c1 { fill: var(--panel); }
.gt-pt.sel, .gt-end.sel { stroke-width: 4.5; }
.gt-cursor { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.gt-bar { stroke: var(--accent); stroke-width: 6; stroke-linecap: butt; }
.gt-nl .gt-arrowhead { fill: var(--muted); }
.gt-end { fill: var(--panel); stroke: var(--accent); stroke-width: 3; }
.gt-end.closed { fill: var(--accent); }
.gt-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.gt-btn { padding: .35rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: .9rem; }
.gt-btn.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.gt-read { color: var(--muted); font-size: .88rem; margin-top: .45rem; }
.gt-note { color: #b42318; font-size: .9rem; }
.gt-note:empty { display: none; }

/* section progress in the sidebar: green correct, red tried but not correct yet, gray not tried */
.sec { flex-wrap: wrap; }
.sec > span:first-child { flex: 1 1 auto; }
.sec-prog { flex-basis: 100%; display: flex; align-items: center; gap: .45rem; margin-top: .3rem; }
.sec-bar { flex: 1; display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: #d4d9e1; }
.sec-bar > span { display: block; height: 100%; }
.sec-bar .right { background: #1f9d55; }
.sec-bar .wrong { background: #d93a2f; }
.sec-bar .rest { background: #d4d9e1; }
.sec-pct { font-size: .75rem; opacity: .85; white-space: nowrap; }
.sec.current .sec-bar { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.sec.done .sec-pct::after { content: " ✔"; }
/* course home (students): crown bubbles, navy pie fill, gold crown when a section is complete */
.crown-chapter .cc-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: .6rem; }
.cc-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.crown-bubble { display: flex; flex-direction: column; align-items: center; width: 64px; text-decoration: none; color: var(--ink); border-radius: 10px; padding: .25rem 0; }
.crown-bubble:hover, .crown-bubble:focus-visible { background: var(--bg); }
.cb-pic svg { width: 56px; height: 56px; display: block; }
.cb-track { fill: #e3e7ee; stroke: #c9d0db; stroke-width: 1; }
.cb-fill { fill: #1b2f5e; }
.cb-hole { fill: #fff; }
.cb-crown { fill: none; stroke: #6b7486; stroke-width: 1.7; stroke-linejoin: round; }
.crown-bubble.done .cb-crown { fill: #f2c230; stroke: #f7d867; }
.cb-num { font-size: .82rem; font-weight: 600; margin-top: .15rem; }
.cb-pct { font-size: .72rem; color: var(--muted); }
.crown-bubble.done .cb-pct { color: #9a7300; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .cb-track { fill: #2a3346; stroke: #3a4560; }
  .cb-fill { fill: #3d63c9; }
  .cb-hole { fill: var(--panel); }
  .crown-bubble.done .cb-pct { color: #f2c230; }
}
/* My courses (students): crown badge with overall progress, crowns and % complete, and a Continue link */
.course-card { display: flex; flex-direction: column; gap: .55rem; }
.course-card .cc-main { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink); }
.course-card .cc-badge svg { width: 68px; height: 68px; display: block; }
.course-card.done .cb-crown { fill: #f2c230; stroke: #f7d867; }
.course-card .cc-text { display: flex; flex-direction: column; gap: .15rem; }
.course-card .cc-text strong { font-size: 1.1rem; }
.course-card .cc-next { font-weight: 600; text-decoration: none; color: var(--accent); padding-left: calc(68px + .9rem); }
.course-card .cc-next:hover { text-decoration: underline; }
/* most-missed problems (instructors) */
.ins-bar { display: inline-block; width: 60px; height: 7px; border-radius: 4px; background: #f3c9c4; vertical-align: middle; overflow: hidden; }
.ins-bar > span { display: block; height: 100%; background: #1f9d55; }
.ins-table td { vertical-align: top; }
.ins-table .ins-prompt { display: inline; }
.ins-secs { display: grid; gap: .35rem; margin-top: .5rem; }
.ins-sec { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ins-sec-num { margin-left: auto; white-space: nowrap; }
/* diagnostic: sections to practice */
.practice-next { margin-top: .6rem; }
.practice-next ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.practice-next li { margin: .2rem 0; }
.practice-cell { min-width: 9rem; }
.ins-table td:nth-child(2) { max-width: 26rem; white-space: normal; }
