/* Dark by default, in neutral grays. The Light/Dark button in the header sets
   data-theme="light" on <html> (see js/theme.js). */
:root {
  color-scheme: dark;
  --bg: #121417;
  --panel: #1a1d21;
  --text: #d8dde3;
  --muted: #8b949e;
  --line: #2c3137;
  --accent: #63e879;
  --accent-text: #0b1220;
  --code-bg: #0f1114;
  --row-hover: #1f2329;
  --pc-bg: #35291a;
  --cursor-bg: #173820;
  --cursor-edge: #63e879;
  --reg-a: #63e879;       /* the accumulator, F and the HL, IX, IY pointers */
  --reg-b: #6fa84a;       /* the counter: B, C, BC */
  --reg-de: #ff7b72;      /* the destination: D, E, DE */
  --reg-pc: #ffb347;      /* PC */
  --break: #ef5350;
  --break-cond: #ffb347;
  --changed: #ffb347;
  --error-bg: #3a1d1d;
  --error-text: #ff9b9b;
  --flag-on: #63e879;
  --tok-mn: #7cb7ff;
  --tok-reg: #e0b070;
  --tok-cond: #d08bd8;
  --tok-num: #9fd08c;
  --tok-str: #c3e88d;
  --tok-dir: #c792ea;
  --tok-comment: #6a737d;
  --selection: rgba(99, 232, 121, 0.30);
  --label: #75d98a;
  --arrow-fwd: #6fa84a;
  --arrow-back: #d0963f;
  --arrow-mid: #e07070;
  --arrow-hot: #63e879;
  --scroll-thumb: #3a434a;
  --scroll-thumb-hover: #4d5860;
  --mono: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --line: #d0d7de;
  --accent: #176b2b;
  --accent-text: #ffffff;
  --code-bg: #f6f8fa;
  --row-hover: #eef1f4;
  --pc-bg: #fff1d6;
  --cursor-bg: #ddf5e0;
  --cursor-edge: #176b2b;
  --reg-a: #176b2b;
  --reg-b: #176b2b;
  --reg-de: #cf222e;
  --reg-pc: #9a6700;
  --break: #cf222e;
  --break-cond: #bc4c00;
  --changed: #bc4c00;
  --error-bg: #ffebe9;
  --error-text: #a40e26;
  --flag-on: #176b2b;
  --tok-mn: #0550ae;
  --tok-reg: #953800;
  --tok-cond: #8250df;
  --tok-num: #116329;
  --tok-str: #0a3069;
  --tok-dir: #8250df;
  --tok-comment: #6e7781;
  --selection: rgba(23, 107, 43, 0.22);
  --label: #176b2b;
  --arrow-fwd: #176b2b;
  --arrow-back: #bc4c00;
  --arrow-mid: #cf222e;
  --arrow-hot: #176b2b;
  --scroll-thumb: #c9ced4;
  --scroll-thumb-hover: #a7afb8;
}

/* Scrollbars in the theme colours: dark on dark panels, light on light. */
* { box-sizing: border-box; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
::-webkit-scrollbar-thumb:vertical { min-height: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--sans);
}

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 1.25rem; }
h2 { font-size: 0.95rem; margin-bottom: 0.5rem; }
h2 small { color: var(--muted); font-weight: 400; }
h2.sub { margin-top: 0.75rem; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.controls { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.nav-link { color: var(--accent); font-weight: 600; }
.theme-toggle { margin-left: auto; }
.status { margin: 0; color: var(--muted); flex: 1 1 18rem; }
.status.error { color: var(--error-text); }

button {
  font: inherit;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--accent); color: var(--accent-text); }
button:disabled { opacity: 0.45; cursor: default; }
button.small { padding: 0.05rem 0.45rem; font-size: 13px; }
button.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
}
button.link-button:hover { background: none; color: var(--accent); }
button.remove { margin-left: 0.4rem; border-color: var(--line); color: var(--muted); }
:focus-visible { outline: 2px solid var(--changed); outline-offset: 1px; }

input, select {
  font: 13px var(--mono);
  padding: 0.15rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--text);
}
input:disabled { opacity: 0.6; }

.hint { margin: 0.4rem 0 0; color: var(--muted); font-size: 12px; }
.warning { margin: 0.4rem 0 0; padding: 0.3rem 0.5rem; border-radius: 4px; background: var(--error-bg); color: var(--error-text); font-size: 13px; }
.muted { color: var(--muted); }

/* Three columns: program | code | machine. The borders between them can be dragged. */
.workspace {
  display: grid;
  grid-template-columns: min(var(--left, 420px), 28vw) 8px minmax(320px, 1fr) 8px min(var(--right, 420px), 28vw);
  padding: 0.75rem;
  align-items: start;
}
.splitter {
  align-self: stretch;
  cursor: col-resize;
  border-radius: 4px;
  margin: 0 1px;
}
.splitter:hover, .splitter.dragging, .splitter:focus-visible { background: var(--line); }

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  min-width: 0;
}
.editor-panel, .code-panel { position: sticky; top: 0.75rem; }
/* The code column: the code view above the memory view, each with its own scroll bar. */
.code-panel { display: flex; flex-direction: column; height: calc(100vh - 6rem); min-height: 520px; }
.memory-section { display: flex; flex-direction: column; flex: 1 1 42%; min-height: 0; margin-top: 0.6rem; }
.memory-section h2 { margin: 0 0.4rem 0 0; }
.machine-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; min-width: 0; }
.card-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }



/* Left column: the lesson above the editor. */
.editor-panel { display: flex; flex-direction: column; gap: 0.5rem; height: calc(100vh - 6rem); min-height: 520px; }
.lesson { display: flex; flex-direction: column; flex: 1 1 45%; min-height: 0; gap: 0.4rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.lesson.collapsed { flex: 0 0 auto; }
.lesson.collapsed .lesson-body { display: none; }
.lesson-bar { display: flex; gap: 0.3rem; align-items: center; }
.lesson-bar select { flex: 1; min-width: 0; font: 14px var(--sans); }
.lesson-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.2rem 0.5rem 0.5rem 0;
  font-size: 14.5px;
  line-height: 1.5;
}
.lesson-text h1 { font-size: 1.15rem; margin: 0.3rem 0 0.5rem; }
.lesson-text h2 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.lesson-text p, .lesson-text ul, .lesson-text ol { margin: 0.4rem 0; }
.lesson-text code { font: 13px var(--mono); background: var(--code-bg); padding: 0 0.2rem; border-radius: 3px; }
.lesson-text pre { margin: 0.5rem 0; padding: 0.5rem; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; overflow: auto; }
.lesson-text pre code { padding: 0; background: none; }
.lesson-text table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0.5rem 0; font-size: 13.5px; }
/* Wide tables scroll on their own, so the lesson text never scrolls sideways. */
.table-scroll { max-width: 100%; overflow-x: auto; margin: 0.5rem 0; }
.lesson-body .idioms { font-size: 13px; }
.lesson-body .idioms td.note { min-width: 14rem; }
.lesson-text th, .lesson-text td { padding: 0.2rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; }
.lesson-text a { color: var(--accent); }
.exercise {
  margin: 0.75rem 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
}
.exercise.active { border-left-color: var(--accent); }
.exercise h3 { font-size: 0.95rem; }
.exercise .goal { margin: 0.3rem 0; }
.exercise-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.check-results { margin: 0.5rem 0 0; padding: 0; list-style: none; font: 13px/1.5 var(--mono); }
.check-results .pass { color: var(--tok-num); }
.check-results .fail { color: var(--error-text); }
.hint-text { margin: 0.4rem 0 0; color: var(--muted); }
.solution pre { margin: 0.4rem 0; padding: 0.4rem; font: 13px var(--mono); border: 1px solid var(--line); border-radius: 4px; overflow: auto; }
.program-bar { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: baseline; }
.program-bar h2 { margin: 0; }
.context { color: var(--muted); font-size: 13px; }

/* Editor: a gutter with line numbers next to a plain textarea. */
.editor {
  display: flex;
  flex: 1 1 55%;
  min-height: 200px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
  overflow: hidden;
}
.gutter, #source, .highlight { margin: 0; padding: 0.5rem; font: 14px/1.5 var(--mono); tab-size: 8; }
.gutter {
  min-width: 3.5em;
  text-align: right;
  color: var(--muted);
  border-right: 1px solid var(--line);
  overflow: hidden;
  user-select: none;
}
.gutter .bad { color: var(--error-text); background: var(--error-bg); font-weight: 700; }
/* Syntax colours: a <pre> with coloured text lies under the textarea, whose own
   text is transparent; both scroll together (js/editor.js). */
.code-area { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.highlight {
  position: absolute;
  inset: 0;
  overflow: hidden;
  white-space: pre;
  color: var(--text);
  pointer-events: none;
}
#source {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  white-space: pre;
  overflow: auto;
}
#source::selection { background: var(--selection); color: transparent; }
/* The suggestion list under the caret (js/completion_view.js). */
.completion {
  position: fixed;
  z-index: 20;
  margin: 0;
  padding: 2px;
  min-width: 14rem;
  max-width: 32rem;
  max-height: 16rem;
  overflow-y: auto;
  list-style: none;
  font: 13px/1.4 var(--mono);
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.completion[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.completion li { display: flex; gap: 0.8rem; padding: 2px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.completion li.selected { background: var(--cursor-bg); box-shadow: inset 2px 0 0 var(--cursor-edge); }
.completion-name { color: var(--tok-mn); font-weight: 600; }
.completion-detail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.hl-mnemonic { color: var(--tok-mn); font-weight: 600; }
.hl-directive { color: var(--tok-dir); font-weight: 600; }
.hl-register { color: var(--tok-reg); }
.hl-condition { color: var(--tok-cond); }
.hl-number { color: var(--tok-num); }
.hl-string { color: var(--tok-str); }
.hl-label { color: var(--label); font-weight: 600; }
.hl-comment { color: var(--tok-comment); font-style: italic; }

.errors { margin: 0.5rem 0 0; padding: 0; list-style: none; max-height: 9rem; overflow: auto; }
.errors li { margin-top: 0.25rem; }
.error-button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 4px;
  background: var(--error-bg);
  color: var(--error-text);
  font: 13px/1.4 var(--mono);
}
.error-button:hover:not(:disabled) { background: var(--error-text); color: var(--error-bg); }
.error-more { color: var(--muted); font-size: 13px; }

/* Code view. */
.code-tools { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.4rem; }
.check { display: inline-flex; gap: 0.3rem; align-items: center; font-size: 13px; color: var(--muted); }
.listing {
  position: relative;
  flex: 1 1 58%;
  min-height: 160px;
  overflow: auto;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 13px var(--mono);
}
.listing:focus-visible { outline-offset: -2px; }
.code-rows { position: relative; padding-left: var(--arrow-width, 24px); }
.arrows { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.arrows path { fill: none; stroke-width: 1.4; }
.arrows path.fwd { stroke: var(--arrow-fwd); }
.arrows path.back { stroke: var(--arrow-back); }
.arrows path.cond { stroke-dasharray: 3 2; }
.arrows path.mid { stroke: var(--arrow-mid); stroke-dasharray: 1 2; }
.arrows path.hot { stroke-width: 2.4; stroke: var(--arrow-hot); }
.arrows polygon { fill: var(--arrow-fwd); }
.arrows polygon.back { fill: var(--arrow-back); }
.arrows polygon.mid { fill: var(--arrow-mid); }
.arrows polygon.hot { fill: var(--arrow-hot); }

.code-row, .label-row { height: 20px; line-height: 20px; white-space: pre; }
.code-row {
  display: grid;
  grid-template-columns: 1.6em 3.8em 8.2em minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
  padding-right: 0.5rem;
  cursor: default;
}
.label-row { padding-left: 1.6em; color: var(--label); font-weight: 600; }
.label-refs { margin-left: 0.8em; color: var(--muted); font-weight: 400; font-size: 13px; }
.code-row:hover { background: var(--row-hover); }
.code-row.cursor { background: var(--cursor-bg); box-shadow: inset 2px 0 0 var(--cursor-edge); }
.code-row.pc { background: var(--pc-bg); }
.code-row .bp {
  padding: 0;
  height: 20px;
  border: 0;
  background: none;
  color: transparent;
  font-size: 12px;
  line-height: 20px;
}
.code-row:hover .bp { color: var(--muted); }
.code-row .bp.on { color: var(--break); }
.code-row .bp.on.cond { color: var(--break-cond); }
.code-row .bp:hover:not(:disabled) { background: none; color: var(--break); }
.code-row .addr { color: var(--muted); }
.code-row.ran .addr { color: var(--cursor-edge); font-weight: 600; }
.code-row .bytes { color: var(--muted); overflow: hidden; }
.code-row .bytes input { width: 8em; padding: 0 2px; font-size: 12px; }
.code-row.data .text { color: var(--muted); font-style: italic; }
.tok-mn { color: var(--tok-mn); font-weight: 600; }
.tok-reg { color: var(--tok-reg); }
.tok-cond { color: var(--tok-cond); }
.tok-num { color: var(--tok-num); }
.tok-mem { text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.tok-link { color: var(--tok-num); text-decoration: underline; cursor: pointer; }

.explain { margin-top: 0.5rem; font-size: 14px; min-height: 6rem; }
.explain p { margin: 0.2rem 0 0; }
.explain-title { font: 600 14px var(--mono); }
.explain-bytes, .flags-text { color: var(--muted); font-size: 13px; }
.explain-name { font-weight: 600; }
.ref-link { display: inline-block; margin-top: 0.3rem; color: var(--accent); font-size: 13px; }

/* Registers. */
.reg-bytes { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0.25rem; font: 14px var(--mono); }
.byte-reg { display: flex; flex-direction: column; align-items: center; padding: 0.1rem; border: 1px solid var(--line); border-radius: 4px; }
.byte-reg { border-top: 3px solid var(--reg-color, var(--line)); }
.byte-reg .reg-name { color: var(--reg-color, var(--muted)); font-size: 12px; font-weight: 700; }
.byte-reg.changed { border-color: var(--changed); border-top-color: var(--reg-color, var(--changed)); }
.byte-reg.changed .reg-value { color: var(--changed); font-weight: 700; }
.reg-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.3rem 0.6rem; margin-top: 0.5rem; }
.reg { display: flex; align-items: center; gap: 0.3rem; font: 13px var(--mono); }
.reg .reg-name { color: var(--muted); min-width: 2.2em; }
.reg-input { width: 4.2em; font-size: 13px; }
.reg { border-left: 3px solid var(--reg-color, transparent); padding-left: 0.3rem; border-radius: 3px; }
.reg .reg-name { color: var(--reg-color, var(--muted)); font-weight: 700; }
.reg-a { --reg-color: var(--reg-a); }
.reg-b { --reg-color: var(--reg-b); }
.reg-de { --reg-color: var(--reg-de); }
.reg-pc { --reg-color: var(--reg-pc); }
.reg-input.changed { border-color: var(--changed); color: var(--changed); font-weight: 700; }

.flags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.flag {
  min-width: 2.4em;
  padding: 0.05rem 0.3rem;
  font: 13px var(--mono);
  border-color: var(--line);
  color: var(--muted);
}
.flag.on { background: var(--flag-on); border-color: var(--flag-on); color: var(--accent-text); }
.cpu-info { margin: 0.5rem 0 0; color: var(--muted); font-size: 13px; }

.console {
  margin: 0;
  padding: 0.5rem;
  min-height: 3em;
  max-height: 10em;
  overflow: auto;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 13px/1.45 var(--mono);
  white-space: pre-wrap;
  word-break: break-all;
}

.mini-list { margin: 0; padding: 0; list-style: none; font: 13px/1.6 var(--mono); max-height: 11em; overflow: auto; }
.mini-form { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.addr-input, .value-input { width: 5.5em; }
.cond-text { color: var(--break-cond); }

/* Memory. */
.mem-tools { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-bottom: 0.4rem; }
.pointers { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; }
.memory {
  position: relative;
  flex: 1;
  min-height: 120px;
  padding: 0 0.5rem;
  overflow: auto;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 13px/1.5 var(--mono);
  white-space: pre;
}
.mem-spacer { position: relative; }
.mem-rows { position: absolute; left: 0; right: 0; }
.mem-row { display: flex; gap: 0.35em; height: 20px; line-height: 20px; }
.mem-addr { color: var(--muted); margin-right: 0.4em; }
.mem-byte { cursor: text; }
.mem-byte.changed { color: var(--changed); font-weight: 700; }
.mem-byte.marked { outline: 1px solid var(--accent); border-radius: 2px; }
.mem-text { margin-left: 0.6em; color: var(--muted); }
.byte-input { width: 2.4em; padding: 0 2px; font-size: 13px; }

/* The reference page. */
.search { display: inline-flex; gap: 0.4rem; align-items: center; color: var(--muted); font-size: 14px; }
.search input { width: 16rem; font-size: 14px; }

.reference {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  max-width: 76rem;
  margin: 0 auto;
}
.reference-page .top { position: sticky; top: 0; z-index: 10; }
.toc {
  position: sticky;
  top: calc(var(--header-h, 4rem) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--header-h, 4rem) - 2rem);
  overflow: auto;
  font-size: 14px;
}
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc-group { margin-top: 0.5rem; font-weight: 600; }
.toc-mnemonics { display: flex; flex-wrap: wrap; gap: 0.1rem 0.5rem; font: 400 13px var(--mono); }

.ref-body section { margin-bottom: 1.5rem; scroll-margin-top: calc(var(--header-h, 4rem) + 0.75rem); }
.ref-body h2 { font-size: 1.15rem; margin: 0.5rem 0; }
.group > h2 { padding-bottom: 0.3rem; border-bottom: 2px solid var(--accent); }
.instruction {
  padding: 0.7rem;
  margin: 0.75rem 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: calc(var(--header-h, 4rem) + 0.75rem);
}
.instruction h3 { display: flex; gap: 0.75rem; align-items: baseline; font-size: 1.05rem; }
.instruction p { margin: 0.3rem 0; }
.anchor { color: var(--tok-mn); font-family: var(--mono); text-decoration: none; }
.anchor:hover { text-decoration: underline; }
.ref-name { color: var(--muted); font-weight: 400; }

.ref-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ref-table th, .ref-table td { padding: 0.25rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ref-table th { color: var(--muted); font-weight: 600; }
.ref-table code, .ref-body code { font-family: var(--mono); font-size: 13px; }
.forms { margin-top: 0.4rem; }
.forms td:nth-child(3), .forms td:nth-child(4), .forms th:nth-child(3), .forms th:nth-child(4) { text-align: right; width: 4rem; }
.forms tr.undocumented td { color: var(--muted); }
.idioms td.num { text-align: right; white-space: nowrap; }
.idioms td.note { color: var(--muted); font-size: 13px; }
.idioms code { white-space: nowrap; }
.hide-undocumented .forms tr.undocumented { display: none; }
.tag {
  display: inline-block;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 11px var(--sans);
}

@media (max-width: 800px) {
  .reference { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; }
  .ref-table { display: block; overflow-x: auto; }
}

/* One column on narrow screens. Last in the file, so it wins over the rules above. */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .splitter { display: none; }
  .editor-panel, .code-panel { position: static; }
  .editor-panel { height: auto; min-height: 0; }
  .lesson { flex: none; }
  .lesson-body { flex: none; max-height: 60vh; }
  .editor { flex: none; height: 60vh; }
  .code-panel { height: auto; min-height: 0; }
  .listing { flex: none; height: 50vh; }
  .memory-section { flex: none; }
  .memory { flex: none; height: 40vh; }
}

/* Short screens: keep the lesson readable. */
@media (max-height: 760px) {
  .lesson-body { min-height: 12rem; }
}

.program-bar select { max-width: 11rem; font: 13px var(--sans); }

/* Same accent for native controls (check boxes). The link back to the list of projects looks like the
   brand of the lesson pages of z80_home. */
:root { accent-color: var(--accent); }
.site-home { color: var(--accent); font-size: 14px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.site-home:hover { text-decoration: underline; text-underline-offset: 3px; }
