/* Chapter-local layout. Palette and disclosure controls come from skrypt.css. */
.lecture-eight .source-links { flex: 0 0 160px; }
.lecture-eight pre.python-code {
  padding: 12px 15px;
  overflow-x: auto;
  white-space: pre;
  font: 14px/1.55 Consolas, "Liberation Mono", monospace;
}
.l8-figure { margin: 12px 0 18px; }
.l8-figure .source-illustration { margin-bottom: 4px; }

.l8-counter {
  margin-left: auto;
  color: var(--muted);
  font: 13px var(--ui);
  font-variant-numeric: tabular-nums;
}
.l8-demo .demo-explanation {
  block-size: auto;
  min-block-size: 74px;
  margin: 10px 0;
}
.prose .l8-demo :not(pre) > code { font-size: max(12px, .88em); }

.l8-gcd, .l8-move {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
}
.l8-stack, .l8-board {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font: 14px/1.45 var(--ui);
}
.l8-stack caption, .l8-board caption, .prose p.l8-label {
  color: var(--muted);
  font: 13px/1.4 var(--ui);
  text-align: left;
  margin: 0 0 6px;
}
.l8-stack th, .l8-stack td, .l8-board th, .l8-board td {
  padding: 7px 9px;
  border: 1px solid var(--line);
}
.l8-stack th, .l8-board th, .l8-board thead td { background: #edf2f9; }
.l8-stack th, .l8-stack td { text-align: left; vertical-align: top; }
.l8-stack th:first-child { white-space: nowrap; }
.l8-stack th small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.l8-stack th code { white-space: nowrap; }
.l8-stack .is-current, .l8-flow [aria-current="step"] {
  background: #e7effb;
  box-shadow: inset 3px 0 var(--accent);
  font-weight: 650;
}
.l8-console {
  min-height: calc(9 * 1.5em + 16px);
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font: 13px/1.5 Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.l8-console samp { font: inherit; }

.l8-move { grid-template-columns: minmax(0, 236px) minmax(0, 1fr); }
.l8-board { table-layout: fixed; text-align: center; }
.l8-board td[data-square] {
  height: 43px;
  font: 650 20px/1 Consolas, "Liberation Mono", monospace;
}
.l8-board td.is-available {
  outline: 2px dashed #74849b;
  outline-offset: -4px;
}
.l8-board td.is-selected {
  outline: 2px solid #9f5222;
  outline-offset: -3px;
  background: #fff1e4;
}
.prose .l8-board-status { margin: 6px 0 0; }
.prose .l8-flow {
  list-style: none;
  padding: 0;
  margin: 0;
}
.prose .l8-flow li {
  padding: 6px 10px;
  border: 1px solid var(--line);
  margin: 0 0 5px;
}
.prose .l8-flow p { margin: 1px 0 0; }

@media (max-width: 930px) {
  .l8-gcd { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .lecture-eight .source-links { flex-basis: 145px; }
}
