/* CS336 交互式图解 · 共享样式（各讲通用） */
:root {
  --bg: #f5f4ef; --panel: #ffffff; --panel2: #faf9f6; --ink: #1d2129; --muted: #5d6573; --line: #e2e0d8;
  --accent: #2f6fde; --accent-soft: #e9f0fd; --warm: #d9652a; --warm-soft: #fcefe6;
  --good: #1d8f58; --good-soft: #e4f5ec; --bad: #cc3a52; --bad-soft: #fcebee; --purple: #6a50c9; --purple-soft: #efebfb;
  --code: #f0efe9; --shadow: 0 1px 2px rgba(20,20,30,.04), 0 4px 18px rgba(20,20,30,.05);
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", monospace;
  --tok-l: 90%; --tok-s: 78%; --tok-b: 58%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b; --panel: #1c1f26; --panel2: #20242c; --ink: #e5e8ee; --muted: #9ba4b4; --line: #2f343e;
    --accent: #79a6f5; --accent-soft: #1f2a3f; --warm: #f0915c; --warm-soft: #3a2619;
    --good: #4cc68b; --good-soft: #17301f; --bad: #f07186; --bad-soft: #3a1c23; --purple: #a592f0; --purple-soft: #29223f;
    --code: #252932; --shadow: none; --tok-l: 26%; --tok-s: 45%; --tok-b: 52%;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.78 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; }
b, strong { font-weight: 650; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }
p { margin: .55em 0; }
ul, ol { margin: .5em 0; padding-left: 1.4em; }
li { margin: .2em 0; }
button, select, input, textarea { font: inherit; color: inherit; }

.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); padding: 22px 16px 40px; background: var(--panel2); }
.sidebar .brand { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.sidebar .brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.progress { margin: 14px 0 12px; }
.progress .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--good); transition: width .4s; }
.progress .txt { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.toc { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px; align-items: baseline; padding: 5px 8px; border-radius: 7px; color: var(--ink); font-size: 14px; line-height: 1.45; }
.toc a:hover { background: var(--accent-soft); text-decoration: none; }
.toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.toc .t { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.toc a.done .n { color: var(--good); }
.toc .grp { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; margin: 14px 8px 4px; }
.sidebar .legend { margin-top: 18px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar .legend div { margin: 3px 0; }

main { min-width: 0; padding: 34px 44px 120px; max-width: 1000px; width: 100%; margin: 0 auto; }
.hero { padding: 6px 0 22px; }
.hero .kicker { color: var(--warm); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.hero h1 { font-size: 32px; margin: 6px 0 6px; }
.hero .sub { color: var(--muted); font-size: 15px; }
.takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 6px; }
.takeaways div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.65; box-shadow: var(--shadow); }
.takeaways b { display: block; color: var(--accent); font-size: 13px; margin-bottom: 4px; }

.unit { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px 22px; margin: 0 0 26px; box-shadow: var(--shadow); }
.unit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 4px; }
.unit-head .meta { color: var(--muted); font-size: 13px; }
.unit h2 { font-size: 23px; margin-top: 2px; }
.unit h3 { font-size: 17px; margin: 22px 0 6px; }
.lead { font-size: 17px; color: var(--muted); border-left: 3px solid var(--warm); padding: 2px 0 2px 12px; margin: 12px 0 14px; }

.quote { margin: 18px 0 8px; padding: 12px 16px; background: var(--warm-soft); border-radius: 10px; font-size: 15px; position: relative; }
.quote .qm { font-size: 12px; color: var(--warm); font-weight: 600; margin-bottom: 2px; }
.quote p { margin: 0; }
.src { margin-top: 14px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 16px; border-top: 1px dashed var(--line); padding-top: 10px; }
.src b { color: var(--ink); font-weight: 600; }
.done-btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.done-btn:hover { border-color: var(--good); }
.done-btn.on { background: var(--good-soft); border-color: var(--good); color: var(--good); }

.widget { border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); margin: 16px 0; overflow: hidden; }
.widget > .wh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 600; background: var(--panel); }
.widget > .wh .tag { font-weight: 500; color: var(--muted); font-size: 12px; }
.widget > .wb { padding: 14px 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { font-size: 13px; color: var(--muted); margin-top: 8px; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 14px; line-height: 1.5; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 13px; cursor: pointer; font-size: 14px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
input[type=text], textarea, select { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 10px; font-size: 14.5px; }
textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: 14px; }
input[type=text] { font-family: var(--mono); }
input[type=range] { accent-color: var(--accent); }
label.inl { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 5px 11px; min-width: 92px; }
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.stat.hi { border-color: var(--accent); background: var(--accent-soft); }

.toks { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; min-height: 52px; }
.tok { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid var(--line); background: var(--panel2); border-radius: 6px; padding: 1px 6px 0; min-width: 24px; font-family: var(--mono); line-height: 1.3; transition: background .25s, border-color .25s, transform .25s; }
.tok b { font-weight: 500; font-size: 14px; white-space: pre; }
.tok i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.tok.m { background: hsl(var(--h) var(--tok-s) var(--tok-l)); border-color: hsl(var(--h) 55% var(--tok-b)); }
.tok.hl { outline: 2px solid var(--warm); outline-offset: 1px; transform: translateY(-2px); }
.tok.unk { background: var(--bad-soft); border-color: var(--bad); }
.tok.new { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.tok-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 3px; }
.more { font-size: 12.5px; color: var(--muted); align-self: center; padding: 0 6px; }

table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.t td:first-child { white-space: nowrap; }
table.t th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--panel); }
table.t tr.best td { background: var(--warm-soft); font-weight: 600; }
table.t tr.cur td { background: var(--accent-soft); }
table.t tr.zero td { color: var(--muted); }
table.t td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.callout { border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 15px; }
.callout.key { background: var(--accent-soft); }
.callout.warn { background: var(--bad-soft); }
.callout.ok { background: var(--good-soft); }
.callout .ct { font-weight: 650; font-size: 13px; margin-bottom: 2px; }
.callout.key .ct { color: var(--accent); } .callout.warn .ct { color: var(--bad); } .callout.ok .ct { color: var(--good); }
.codebox { font-family: var(--mono); font-size: 13px; background: var(--code); border-radius: 8px; padding: 10px 14px; white-space: pre; overflow-x: auto; line-height: 1.6; margin: 10px 0; }
.formula { font-family: var(--mono); background: var(--code); border-radius: 8px; padding: 9px 14px; margin: 10px 0; text-align: center; font-size: 15.5px; overflow-x: auto; }
.formula sub, .formula sup { font-size: .72em; }

.stairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin: 8px 0; }
.stairs .st { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.stairs .st .y { font-family: var(--mono); color: var(--warm); font-weight: 650; }
.stairs .st:nth-child(1) { min-height: 90px; } .stairs .st:nth-child(2) { min-height: 130px; } .stairs .st:nth-child(3) { min-height: 170px; border-color: var(--accent); }
.stairs .depth { font-size: 12px; color: var(--muted); margin-top: 6px; }

.bars { margin: 10px 0; }
.bar-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; margin: 8px 0; font-size: 14px; }
.stack { display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.stack div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; transition: flex-basis .7s ease; white-space: nowrap; overflow: hidden; }
.stack .mlp { background: var(--accent); } .stack .att { background: var(--warm); }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0; }
.kcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.kcard h4 { font-size: 16px; margin-bottom: 4px; }
.kcard .badge { display: inline-block; font-size: 12px; border-radius: 999px; padding: 1px 9px; margin-bottom: 6px; }
.badge.ok { background: var(--good-soft); color: var(--good); } .badge.no { background: var(--bad-soft); color: var(--bad); }
.kcard p { font-size: 14px; margin: 4px 0; }

.sorter .item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.sorter .item:last-child { border-bottom: 0; }
.sorter .fb { grid-column: 1 / -1; font-size: 13px; }
.sorter .fb.ok { color: var(--good); } .sorter .fb.bad { color: var(--bad); }
.sorter .seg button { padding: 3px 10px; font-size: 13px; }
.sorter .seg button.right { background: var(--good); color: #fff; }
.sorter .seg button.wrong { background: var(--bad); color: #fff; }

.timeline { position: relative; margin: 10px 0 4px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-era { font-size: 12.5px; font-weight: 650; color: var(--purple); margin: 14px 0 4px -22px; padding-left: 22px; letter-spacing: .03em; }
.tl-item { position: relative; padding: 4px 0 4px 6px; font-size: 14.5px; cursor: pointer; border-radius: 6px; }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--purple); }
.tl-item:hover { background: var(--purple-soft); }
.tl-item .yr { font-family: var(--mono); color: var(--purple); font-weight: 650; margin-right: 8px; }
.tl-item .d { display: none; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.tl-item.open .d { display: block; }
.tl-item.open::before { background: var(--purple); }

.eras { margin-top: 10px; }
.era-panel { margin-top: 10px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 92px; }
.era-panel .big { font-size: 19px; font-weight: 650; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.tabs button { border: 1px solid var(--line); background: var(--panel); border-radius: 9px 9px 0 0; border-bottom: 0; padding: 7px 14px; cursor: pointer; font-size: 14.5px; }
.tabs button.on { background: var(--panel2); color: var(--accent); font-weight: 650; border-color: var(--accent); }
.tabpanel { border: 1px solid var(--line); border-radius: 0 12px 12px 12px; padding: 14px 18px; background: var(--panel2); }
.tabpanel h4 { font-size: 15.5px; margin: 12px 0 4px; }
.tabpanel .q { font-size: 16.5px; font-weight: 600; }
.chipline { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { font-size: 12.5px; background: var(--purple-soft); color: var(--purple); border-radius: 999px; padding: 1px 10px; }

.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.flow .fs { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; background: var(--panel); transition: all .3s; }
.flow .fs.mem { border-style: dashed; }
.flow .fs.act { background: var(--warm); color: #fff; border-color: var(--warm); transform: translateY(-2px); }
.flow .fs.doneS { opacity: .55; }
.flow .arr { color: var(--muted); font-size: 13px; }

.quiz .qq { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 12px 0; background: var(--panel); }
.quiz .qt { font-weight: 600; margin-bottom: 8px; }
.quiz .qt .qn { color: var(--accent); margin-right: 6px; font-family: var(--mono); }
.quiz .opt { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--panel2); border-radius: 8px; padding: 6px 12px; margin: 5px 0; cursor: pointer; font-size: 14.5px; }
.quiz .opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz .opt.right { background: var(--good-soft); border-color: var(--good); }
.quiz .opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.quiz .opt:disabled { cursor: default; }
.quiz .exp { display: none; font-size: 14px; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); }
.quiz .qq.answered .exp { display: block; }
.score { font-weight: 650; }

.flips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.flip { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); cursor: pointer; min-height: 74px; }
.flip .front { font-weight: 650; font-size: 15.5px; }
.flip .front small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.flip .back { display: none; font-size: 14px; line-height: 1.7; }
.flip.on { background: var(--panel2); border-color: var(--accent); }
.flip.on .front small { display: none; }
.flip.on .back { display: block; margin-top: 6px; }
.flip .back .warn { color: var(--bad); }

.errata li { margin: 8px 0; }
.svgbox svg { width: 100%; height: auto; display: block; }
.svgbox text { font-family: var(--sans); fill: var(--muted); font-size: 11px; }
.kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--panel); }
.ok-t { color: var(--good); font-weight: 650; } .bad-t { color: var(--bad); font-weight: 650; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 22px 16px 80px; }
  .takeaways, .cards3, .grid3, .grid2, .flips, .stairs { grid-template-columns: 1fr; }
  .unit { padding: 20px 18px; }
}

/* ===== 以下为多讲共用的扩展组件 ===== */
.sidebar .back { display: inline-block; font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.sidebar .back:hover { color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 28px; }
.pager a { flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 16px; color: var(--ink); box-shadow: var(--shadow); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a small { display: block; color: var(--muted); font-size: 12.5px; }
.pager a.next { text-align: right; }
.pager span { flex: 1; }

/* 通用折线图（CS.chart） */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax { stroke: var(--muted); opacity: .45; }
.chart .grid { stroke: var(--line); }
.chart text { font-family: var(--sans); fill: var(--muted); font-size: 11px; }
.chart .lbl { fill: var(--ink); font-size: 11.5px; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.chart .legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* 通用矩阵/网格（CS.matrix） */
.mat { display: inline-grid; gap: 2px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.mat .c { width: 22px; height: 22px; border-radius: 3px; background: var(--panel2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: var(--muted); transition: background .3s, border-color .3s; }
.mat .c.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mat .c.warm { background: var(--warm); border-color: var(--warm); color: #fff; }
.mat .c.good { background: var(--good); border-color: var(--good); color: #fff; }
.mat .c.soft { background: var(--accent-soft); border-color: var(--accent); }
.mat .c.wsoft { background: var(--warm-soft); border-color: var(--warm); }
.mat .c.off { opacity: .25; }
.mat-cap { font-size: 12px; color: var(--muted); text-align: center; margin-top: 3px; }
.mats { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }

/* 通用步进器（CS.stepper） */
.stepper { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.stepper input[type=range] { flex: 1; min-width: 140px; }
.stepper .cnt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }

/* 时间线式调度图（流水线并行等） */
.gantt { font-family: var(--mono); font-size: 11.5px; }
.gantt .gr { display: grid; align-items: center; gap: 2px; margin: 2px 0; }
.gantt .gl { font-family: var(--sans); color: var(--muted); font-size: 12px; }
.gantt .gc { height: 24px; border-radius: 3px; display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; }
.gantt .gc.f { background: var(--accent); } .gantt .gc.b { background: var(--warm); } .gantt .gc.idle { background: var(--panel2); border: 1px dashed var(--line); }
.gantt .gc.c { background: var(--purple); } .gantt .gc.g { background: var(--good); }

/* 课程总目录 */
.lec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lec { display: block; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 14px 16px; color: var(--ink); box-shadow: var(--shadow); }
.lec:hover { border-color: var(--accent); text-decoration: none; }
.lec .no { font-family: var(--mono); color: var(--warm); font-weight: 650; font-size: 13px; }
.lec h3 { font-size: 16.5px; margin: 2px 0 4px; }
.lec p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.6; }
.lec .pg { height: 4px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.lec .pg i { display: block; height: 100%; background: var(--good); }
.lec .st { font-size: 12px; color: var(--muted); margin-top: 4px; }
.lec.todo { opacity: .55; pointer-events: none; box-shadow: none; }
.unit-grp { font-size: 13px; color: var(--purple); font-weight: 650; letter-spacing: .04em; margin: 24px 0 8px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); }
.hint { font-size: 12.5px; color: var(--muted); }
.pill { display: inline-block; font-size: 12px; border-radius: 999px; padding: 0 9px; background: var(--accent-soft); color: var(--accent); margin: 0 2px; }
.pill.warm { background: var(--warm-soft); color: var(--warm); } .pill.good { background: var(--good-soft); color: var(--good); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 1000px) { .lec-grid { grid-template-columns: 1fr; } .pager { flex-direction: column; } }

/* Deployment compatibility: contain wide tables on narrow screens. */
@media (max-width: 1000px) {
  main table { display: block; max-width: 100%; overflow-x: auto; }
  main, .unit, .widget, .grid2 > *, .grid3 > * { min-width: 0; }
  .src { overflow-wrap: anywhere; }
  .unit-head { flex-wrap: wrap; }
  .unit-head > div { min-width: 0; }
}
