/* Styles for the lab hub (labs/index.html) and the lab pages (labs/labNN.html).
   Colours, fonts and the module navigation are copied from the guides
   (transformer/transformer_guide.html) so the labs look like the rest of the site. */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #f0f2f5;
    --bg-card: #fafbfc;
    --bg-code: #f7f8fa;
    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --text-muted: #8b949e;
    --border: #d1d9e0;
    --accent-purple: #7F77DD;
    --accent-purple-dim: #534AB7;
    --accent-blue: #378ADD;
    --accent-green: #1D9E75;
    --accent-orange: #EF9F27;
    --accent-red: #cf222e;
    --accent-teal: #0891b2;
    --accent-coral: #D85A30;
    --pass: #1a7f37;
    --pass-bg: #dafbe1;
    --todo: #9a6700;
    --todo-bg: #fff8c5;
    --fail: #cf222e;
    --fail-bg: #ffebe9;
    --font-sans: 'DM Sans', -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    --font-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    --modnav-h: 43px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); line-height: 1.7; font-size: 16px; }
a { color: var(--accent-blue); }
code, pre, kbd, textarea { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---- Module navigation (shared across guides) ---- */
.module-nav { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; padding: 10px 24px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); font-size: 14px; }
.module-nav a { color: var(--accent-blue); text-decoration: none; font-weight: 500; }
.module-nav a:hover { text-decoration: underline; }
.module-nav-step { color: var(--text-secondary); }
.module-nav-links { display: flex; gap: 6px 20px; flex-wrap: wrap; }
.module-nav-bottom { position: static; border-top: 1px solid var(--border); border-bottom: none; }

/* ---- Header ---- */
header.page-head { padding: 56px 0 40px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #f0f2f5 0%, var(--bg-primary) 100%); }
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent-purple-dim); margin-bottom: 6px; }
h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 14px;
     background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.subtitle { font-size: 1.12rem; color: var(--text-secondary); max-width: 820px; }
.subtitle + .subtitle { margin-top: 10px; }
.meta { margin-top: 20px; display: flex; gap: 10px 22px; flex-wrap: wrap; font-size: 0.9rem; color: var(--text-secondary); align-items: center; }
.meta b { color: var(--text-primary); font-weight: 600; }
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-primary); font-size: 0.86rem; font-weight: 500; text-decoration: none; color: var(--accent-blue); }
.pill:hover { border-color: var(--accent-blue); }
.pill.colab { color: #b06000; }

/* ---- Sections and text ---- */
section.block { padding: 40px 0; border-bottom: 1px solid var(--border); }
section.block:last-of-type { border-bottom: none; }
h2 { font-size: 1.55rem; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; letter-spacing: -0.01em; }
h2 .num { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px; background: var(--accent-purple-dim); color: #fff; font-size: 0.875rem; border-radius: 8px; flex-shrink: 0; }
h2 .num.given { background: var(--text-muted); }
h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 8px; }
h4 { font-size: 0.98rem; font-weight: 600; margin: 18px 0 8px; color: var(--accent-blue); }
p { margin-bottom: 14px; color: var(--text-secondary); }
.inline-code, p code, li code, td code, .doc code, .note code, .banner code, .way code, .md :not(pre) > code { font-family: var(--font-mono); background: var(--bg-tertiary); padding: 1px 6px; border-radius: 4px; font-size: 0.86em; color: var(--accent-teal); overflow-wrap: anywhere; }
section[id], article[id], div.step-group[id] { scroll-margin-top: 120px; }
.lead-list { margin: 0 0 14px 22px; color: var(--text-secondary); }
.lead-list li { margin-bottom: 6px; }
kbd { font-family: var(--font-mono); font-size: 0.78em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--bg-primary); color: var(--text-primary); white-space: nowrap; }

/* ---- Maths, rendered from the lab docstring ---- */
.maths .para { margin-bottom: 12px; color: var(--text-secondary); }
.maths .label { font-weight: 600; color: var(--text-primary); margin: 18px 0 6px; }
.math-pre, .doc-pre { font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.6; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 6px 0 14px; overflow-x: auto; white-space: pre; color: var(--text-primary); }
.math-pre .sh, .doc-pre .sh { color: var(--accent-teal); }
ol.msteps { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 12px; }
ol.msteps > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; background: var(--bg-primary); border: 1px solid var(--border); border-left: 3px solid var(--accent-purple); border-radius: 0 8px 8px 0; padding: 12px 16px 6px 12px; }
ol.msteps .sn { grid-row: 1 / span 3; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-purple-dim); color: #fff; font-size: 0.78rem; font-weight: 700; }
ol.msteps .st { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
ol.msteps .math-pre { margin: 4px 0 8px; background: var(--bg-secondary); }
ol.msteps p { margin-bottom: 8px; }
.formula { font-family: var(--font-mono); font-size: 0.86rem; color: var(--text-primary); }

/* ---- Read alongside ---- */
ul.readlist { list-style: none; display: grid; gap: 8px; margin: 6px 0 10px; }
ul.readlist li { padding-left: 18px; position: relative; color: var(--text-secondary); font-size: 0.95rem; }
ul.readlist li::before { content: "→"; position: absolute; left: 0; color: var(--accent-purple); }
ul.readlist li a { font-weight: 500; overflow-wrap: anywhere; }
.readlabel { font-size: 0.85rem; color: var(--text-muted); margin: 10px 0 2px; }

/* ---- Notes and banners ---- */
.note { padding: 14px 18px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); font-size: 0.93rem; margin: 14px 0; }
.note p:last-child { margin-bottom: 0; }
.banner { margin: 24px 0 0; padding: 16px 20px; border-radius: 10px; border: 1px solid rgba(239, 159, 39, 0.5); background: rgba(239, 159, 39, 0.1); color: var(--text-primary); font-size: 0.95rem; }
.banner.ok { border-color: rgba(29, 158, 117, 0.45); background: rgba(29, 158, 117, 0.08); }
.banner.err { border-color: rgba(207, 34, 46, 0.4); background: rgba(207, 34, 46, 0.07); }
.banner h3 { font-size: 1.02rem; margin-bottom: 6px; }
.banner p { color: var(--text-secondary); margin-bottom: 8px; font-size: 0.93rem; }
.banner ol, .banner ul { margin: 4px 0 6px 22px; color: var(--text-secondary); font-size: 0.93rem; }
.banner li { margin-bottom: 4px; }
.banner pre { font-family: var(--font-mono); font-size: 0.85rem; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; margin: 6px 0 10px; overflow-x: auto; }
.cmd { font-family: var(--font-mono); font-size: 0.85rem; background: var(--bg-tertiary); border-radius: 4px; padding: 1px 6px; color: var(--accent-teal); overflow-wrap: anywhere; }

/* ---- Run bar (sticky, under the module nav) ---- */
.runbar { position: sticky; top: var(--modnav-h); z-index: 45; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.runbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.rb-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rb-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--text-secondary); min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.dot.ok { background: var(--accent-green); }
.dot.busy { background: var(--accent-orange); animation: pulse 1s ease-in-out infinite; }
.dot.off { background: var(--accent-red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .dot.busy { animation: none; } html { scroll-behavior: auto; } }
.saved { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.saved.dirty { color: var(--todo); font-weight: 600; }

.btn { font: 500 0.85rem var(--font-sans); padding: 6px 12px; background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover:not(:disabled) { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent-purple-dim); border-color: var(--accent-purple-dim); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #3f3793; color: #fff; }
.btn.green { background: var(--accent-green); border-color: var(--accent-green); color: #fff; }
.btn.green:hover:not(:disabled) { background: #13795a; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover:not(:disabled) { border-color: var(--border); }
.btn:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }

/* ---- Check results ---- */
.check-panel { border-top: 1px solid var(--border); background: var(--bg-primary); max-height: min(48vh, 460px); overflow-y: auto; box-shadow: 0 6px 12px rgba(31, 35, 40, 0.08); }
.check-panel .container { padding-top: 12px; padding-bottom: 14px; }
.cp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.cp-head h3 { margin: 0; font-size: 1rem; }
.cp-head .sp { flex: 1; }
ul.steps { list-style: none; display: grid; gap: 6px; }
ul.steps li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
ul.steps .name { font-weight: 500; color: var(--text-primary); font-size: 0.92rem; overflow-wrap: anywhere; }
ul.steps .msg { grid-column: 2; font-size: 0.86rem; color: var(--text-secondary); overflow-wrap: anywhere; }
ul.steps .msg a { font-weight: 500; }
ul.steps pre.msg { font-family: var(--font-mono); font-size: 0.8rem; white-space: pre-wrap; background: var(--fail-bg); border-radius: 6px; padding: 8px 10px; margin-top: 4px; color: var(--text-primary); }
.badge { display: inline-flex; align-items: center; justify-content: center; font: 700 0.7rem var(--font-sans); letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; background: var(--bg-tertiary); color: var(--text-secondary); white-space: nowrap; }
.badge.PASS { background: var(--pass-bg); color: var(--pass); }
.badge.TODO { background: var(--todo-bg); color: var(--todo); }
.badge.FAIL { background: var(--fail-bg); color: var(--fail); }
.badge.given { background: var(--bg-tertiary); color: var(--text-muted); }
.badge.write { background: #EEEDFE; color: var(--accent-purple-dim); }
details.raw { margin-top: 10px; font-size: 0.85rem; }
details.raw summary { cursor: pointer; color: var(--text-secondary); }
details.raw pre { font-family: var(--font-mono); font-size: 0.78rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 10px; margin-top: 6px; overflow-x: auto; white-space: pre; }

/* ---- Cells ---- */
.step-group { padding: 34px 0 10px; border-top: 1px solid var(--border); }
.step-group > h2 { margin-bottom: 14px; }
article.cell { margin: 0 0 28px; padding: 18px 20px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); }
article.cell.todo { border-left: 3px solid var(--accent-purple); }
article.cell.given { background: var(--bg-primary); }
article.cell.scratch { border-style: dashed; }
article.cell.running { box-shadow: 0 0 0 2px rgba(239, 159, 39, 0.35); }
.cell-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.cell-head h3 { margin: 0; font-size: 1.02rem; min-width: 0; overflow-wrap: anywhere; }
.cell-head h3 code { font-family: var(--font-mono); font-size: 0.95rem; color: var(--accent-purple-dim); background: none; padding: 0; }
.cell-head .sp { flex: 1; }
.doc { font-size: 0.95rem; }
.doc p { margin-bottom: 10px; }
.doc .doc-label { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.doc ol, .doc ul { margin: 0 0 10px 22px; color: var(--text-secondary); }
.doc ol li { margin-bottom: 4px; }
.doc .doc-pre { margin-top: 2px; }
.doc h4 { margin-top: 14px; }
.doc h4 code { color: var(--accent-blue); background: none; padding: 0; font-size: 0.92rem; }

.hints { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; align-items: flex-start; }
.hints .hint-for { width: 100%; font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
details.hint { border: 1px dashed var(--border); border-radius: 8px; background: var(--bg-primary); min-width: 0; }
details.hint[open] { flex: 1 1 100%; border-style: solid; border-color: rgba(127, 119, 221, 0.5); }
details.hint > summary { cursor: pointer; padding: 4px 12px; font-size: 0.85rem; font-weight: 600; color: var(--accent-purple-dim); list-style: none; user-select: none; }
details.hint > summary::-webkit-details-marker { display: none; }
details.hint > summary::before { content: "▸ "; }
details.hint[open] > summary::before { content: "▾ "; }
.hint-pre { font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; padding: 2px 14px 10px; color: var(--text-primary); }
html.js details.hint.locked { display: none; }

/* editor: a transparent textarea over a highlighted <pre> */
.editor { position: relative; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-code); overflow: hidden; }
.editor:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 1px var(--accent-blue); }
.editor pre.hl, .editor textarea { margin: 0; border: 0; padding: 12px 14px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.55; tab-size: 4; -moz-tab-size: 4; white-space: pre; letter-spacing: normal; word-spacing: normal; text-transform: none; text-indent: 0; overflow-wrap: normal; word-break: normal; }
.editor pre.hl { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; color: var(--text-primary); }
.editor textarea { position: relative; display: block; width: 100%; min-height: 4.2em; resize: none; overflow-x: auto; overflow-y: hidden; background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--text-primary); outline: none; }
.editor textarea::selection { background: rgba(55, 138, 221, 0.28); }
html:not(.js) .editor pre.hl { display: none; }
html:not(.js) .editor textarea { color: var(--text-primary); -webkit-text-fill-color: var(--text-primary); }
.editor textarea[readonly] { cursor: default; }
.hl .kw { color: #8250df; }
.hl .bi { color: var(--accent-teal); }
.hl .fn { color: #0550ae; font-weight: 600; }
.hl .str { color: #0a7a55; }
.hl .ds { color: #57606a; }
.hl .num { color: #b35900; }
.hl .cm { color: var(--text-muted); font-style: italic; }
.hl .dec { color: var(--accent-coral); }
.hl .self { color: #953800; }
.hl .todo { color: var(--fail); font-weight: 600; }

.cell-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.cell-actions .info { font-size: 0.82rem; color: var(--text-muted); margin-left: 4px; }
.cell-actions .sp { flex: 1; }
details.given-code > summary { cursor: pointer; font-size: 0.88rem; color: var(--accent-blue); font-weight: 500; margin: 2px 0 8px; }

.output { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary); overflow: hidden; }
.output .out-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; font-size: 0.78rem; color: var(--text-muted); background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.output .out-head .sp { flex: 1; }
.output pre { margin: 0; padding: 10px 12px; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
.output pre.stderr { color: #9a6700; background: #fffbea; }
.output pre.error { color: var(--fail); background: var(--fail-bg); }
.output pre.result { color: var(--accent-purple-dim); }
.output pre.okmsg { color: var(--pass); }
.solution { margin-top: 12px; border: 1px solid rgba(29, 158, 117, 0.45); border-radius: 8px; overflow: hidden; }
.solution .sol-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; background: rgba(29, 158, 117, 0.08); font-size: 0.85rem; color: var(--text-secondary); }
.solution .sol-head .sp { flex: 1; }
.solution pre { margin: 0; padding: 12px 14px; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; white-space: pre; overflow-x: auto; background: var(--bg-code); }

/* ---- Hub ---- */
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 8px 0 16px; }
.way { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--bg-card); min-width: 0; }
.way { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 10px; align-items: start; }
.way .n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-blue); color: #fff; font-size: 0.8rem; font-weight: 700; align-items: center; justify-content: center; margin-top: 2px; }
.way p { margin-bottom: 8px; }
.way p:last-child { margin-bottom: 0; }
.way b:first-child { color: var(--text-primary); }
.way p, .way li { font-size: 0.9rem; }
.way pre { font-family: var(--font-mono); font-size: 0.8rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin: 6px 0 10px; overflow-x: auto; white-space: pre; }
.hubbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); margin: 6px 0 16px; }
.hubbar .sp { flex: 1; }
.labgrid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.labcard { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--bg-card); min-width: 0; }
.labcard .lbody { flex: 1; min-width: 0; }
.labcard .lnum { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-purple-dim); color: #fff; display: flex; align-items: center; justify-content: center; font: 700 1rem var(--font-mono); }
.labcard h3 { font-size: 1.02rem; margin: 0; }
.labcard h3 a { color: var(--text-primary); text-decoration: none; }
.labcard h3 a:hover { color: var(--accent-blue); text-decoration: underline; }
.labcard .what { font-size: 0.88rem; color: var(--text-secondary); margin: 4px 0 6px; }
.labcard .readwith { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }
.labcard .readwith a { overflow-wrap: anywhere; }
.labcard .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.84rem; }
.labcard .row a { text-decoration: none; font-weight: 500; }
.labcard .row a:hover { text-decoration: underline; }
.labcard .status { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-muted); margin-top: 8px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent-green); transition: width 0.3s; }
.labcard.st-FAIL .bar > span { background: var(--accent-red); }
.labcard.st-TODO .bar > span { background: var(--accent-orange); }
.md ol.labgrid { margin: 0 0 18px; }
.md .labcard h3 { margin: 0 0 2px; font-size: 1.05rem; }
.md .labcard p { margin-bottom: 6px; }
.labcard .row a.open { font-weight: 700; }
.md table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 6px 0 16px; }
.md th, .md td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.md th { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-secondary); }
.md td { color: var(--text-secondary); }
.md pre { font-family: var(--font-mono); font-size: 0.82rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 6px 0 14px; overflow-x: auto; white-space: pre; }
.md ol, .md ul { margin: 0 0 14px 24px; color: var(--text-secondary); }
.md li { margin-bottom: 6px; }
.md li > p { margin-bottom: 6px; }
.md h3 { margin-top: 18px; }
.table-scroll { overflow-x: auto; }

footer.page-foot { padding: 30px 0 40px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
footer.page-foot a { color: var(--accent-blue); text-decoration: none; }

@media (max-width: 768px) {
    .module-nav { position: static; }
    .runbar { top: 0; }
    .runbar-inner { gap: 6px 10px; padding-top: 6px; padding-bottom: 6px; }
    .runbar .btn { padding: 5px 9px; font-size: 0.8rem; }
    .runbar .long { display: none; }
    .rb-status { width: 100%; }
    .rb-status .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    section[id], article[id], div.step-group[id] { scroll-margin-top: 100px; }
    h1 { font-size: 1.9rem; }
    header.page-head { padding: 36px 0 28px; }
    .container { padding: 0 16px; }
    .module-nav { padding: 8px 16px; gap: 4px 14px; }
    article.cell { padding: 14px 12px 12px; }
    .editor pre.hl, .editor textarea { font-size: 12.5px; padding: 10px; }
    ol.msteps > li { grid-template-columns: 28px minmax(0, 1fr); padding: 10px 10px 4px 8px; gap: 2px 8px; }
    ol.msteps .sn { width: 24px; height: 24px; font-size: 0.72rem; }
    .labgrid { grid-template-columns: minmax(0, 1fr); }
    .labcard { padding: 14px; gap: 12px; }
    .labcard .lnum { flex-basis: 36px; width: 36px; height: 36px; font-size: 0.9rem; }
    ul.steps li { grid-template-columns: minmax(0, 1fr); }
    ul.steps .msg { grid-column: 1; }
    .ways { grid-template-columns: minmax(0, 1fr); }
}
