/* Shared teaching-site stylesheet. Designed for readable screen use and clean printing. */
:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --paper: #fffdf8;
  --ink: #202124;
  --muted: #64615a;
  --line: #dfd7c8;
  --accent: #2563eb;
  --accent-ink: #14306f;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #047857;
  --code: #f1eadf;
  --shadow: 0 18px 50px rgba(38, 30, 19, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, #fff7df 0, var(--bg) 38rem);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", "Noto Serif SC", serif;
  line-height: 1.65;
}
a { color: var(--accent); text-underline-offset: 3px; }
.site-shell, main.lesson {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}
.hero, .card, .lesson-card, .reference-card, .quiz, .callout {
  background: rgba(255, 253, 248, .92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.hero { padding: 34px; margin-bottom: 24px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-ink);
  font: 700 12px/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1, h2, h3 {
  line-height: 1.18;
  letter-spacing: -.02em;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(36px, 7vw, 76px); max-width: 12ch; }
h2 { font-size: clamp(26px, 4vw, 42px); margin-top: 1.4em; }
h3 { font-size: 22px; margin-top: 1.2em; }
p, li { font-size: 18px; }
.lead { font-size: 23px; max-width: 850px; color: #2f2d29; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .lesson-card, .reference-card { padding: 22px; }
.lesson-card h3, .reference-card h3 { margin-top: 0; }
.lesson-card { display: flex; flex-direction: column; gap: 8px; }
.lesson-card .time { color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 14px; }
.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 28px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.nav a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  text-decoration: none;
  color: var(--accent-ink);
}
.lesson-header {
  padding: 34px;
  margin-bottom: 24px;
}
.lesson-header h1 { max-width: 16ch; }
.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  font: 600 14px/1.3 ui-sans-serif, system-ui, sans-serif;
}
.meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf0;
  padding: 7px 11px;
}
.callout { padding: 18px 20px; margin: 18px 0; box-shadow: none; }
.callout strong { color: var(--accent-ink); }
.callout.warn { border-color: #f59e0b; background: #fffbeb; }
.callout.danger { border-color: #ef4444; background: #fff1f2; }
.callout.ok { border-color: #10b981; background: #ecfdf5; }
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid var(--line);
}
.timeline li { margin: 0 0 14px 18px; position: relative; }
.timeline li::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--accent);
  position: absolute;
  left: -26px; top: .55em;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 18px 0; background: var(--paper); }
th, td { border: 1px solid var(--line); padding: 11px 13px; vertical-align: top; }
th { text-align: left; background: #f0eadf; font-family: ui-sans-serif, system-ui, sans-serif; }
pre, code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: var(--code);
  border-radius: 7px;
}
code { padding: .12em .32em; font-size: .92em; }
pre { overflow-x: auto; padding: 16px; border: 1px solid var(--line); }
pre code { padding: 0; background: transparent; }
.checklist { padding-left: 1.2em; }
.checklist li { margin: .4em 0; }
.quiz { padding: 20px; margin: 24px 0; box-shadow: none; }
.quiz h3 { margin-top: 0; }
.quiz .options { display: grid; gap: 10px; margin: 14px 0; }
.quiz button {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffaf0;
  cursor: pointer;
  font: 600 16px/1.35 ui-sans-serif, system-ui, sans-serif;
}
.quiz button.correct { border-color: var(--ok); background: #ecfdf5; }
.quiz button.wrong { border-color: var(--danger); background: #fff1f2; }
.quiz .feedback { min-height: 1.4em; font-weight: 700; }
.kbd {
  font-family: ui-sans-serif, system-ui, sans-serif;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  background: #fff;
}
.footer-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 42px;
  padding-top: 22px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
@media (max-width: 760px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .site-shell, main.lesson { padding: 24px 16px 52px; }
  .hero, .lesson-header { padding: 24px; }
}
@media print {
  body { background: white; }
  .site-shell, main.lesson { max-width: none; padding: 0; }
  .hero, .card, .lesson-card, .reference-card, .quiz, .callout { box-shadow: none; break-inside: avoid; }
  .nav, .footer-links, script { display: none !important; }
  a { color: inherit; }
}

/* Visual teaching components */
.visual {
  background: rgba(255, 253, 248, .95);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin: 22px 0;
  box-shadow: var(--shadow);
}
.visual h3 { margin-top: 0; }
.visual-caption {
  color: var(--muted);
  font: 600 14px/1.45 ui-sans-serif, system-ui, sans-serif;
  margin-top: 12px;
}
.flowline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 12px 0;
}
.flow-node {
  flex: 1 1 130px;
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fffaf0;
  font-family: ui-sans-serif, system-ui, sans-serif;
  position: relative;
}
.flow-node strong { display: block; color: var(--accent-ink); margin-bottom: 3px; }
.flow-node small { color: var(--muted); display: block; line-height: 1.35; }
.flow-node::after {
  content: "→";
  color: var(--accent);
  font-weight: 900;
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.flow-node:last-child::after { content: ""; }
.flow-node.green { background: #ecfdf5; border-color: #10b981; }
.flow-node.yellow { background: #fffbeb; border-color: #f59e0b; }
.flow-node.red { background: #fff1f2; border-color: #ef4444; }
.flow-node.blue { background: #eff6ff; border-color: #60a5fa; }
.editor-frame {
  display: grid;
  grid-template-columns: 1fr 1.45fr 1fr;
  gap: 10px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.editor-pane {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffaf0;
  min-height: 190px;
  padding: 14px;
}
.editor-pane h4 { margin: 0 0 10px; color: var(--accent-ink); }
.fake-row {
  display: block;
  border: 1px solid #eadfcd;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 6px 0;
  background: #fffdf8;
  font-size: 14px;
}
.fake-row.indent { margin-left: 18px; }
.fake-scene {
  height: 132px;
  border: 1px dashed #b9aa92;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(135deg, #fff 0 49%, #f3eadb 49% 51%, #fff 51%);
}
.swimlanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.lane {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fffdf8;
}
.lane h4 {
  margin: 0;
  padding: 10px 12px;
  background: #f0eadf;
  font: 800 15px/1.2 ui-sans-serif, system-ui, sans-serif;
  color: var(--accent-ink);
}
.lane ul { margin: 0; padding: 12px 22px 14px; }
.lane li { font-size: 16px; margin: 6px 0; }
.risk-lights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.risk-card {
  border-radius: 16px;
  padding: 16px;
  border: 2px solid var(--line);
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.risk-card h4 { margin: 0 0 8px; }
.risk-card ul { padding-left: 18px; margin: 8px 0 0; }
.risk-card li { font-size: 15px; }
.risk-card.green { background: #ecfdf5; border-color: #10b981; }
.risk-card.yellow { background: #fffbeb; border-color: #f59e0b; }
.risk-card.red { background: #fff1f2; border-color: #ef4444; }
.compare-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.compare-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fffdf8;
}
.compare-card h4 { margin: 0 0 8px; color: var(--accent-ink); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: #fffaf0;
  font: 700 13px/1 ui-sans-serif, system-ui, sans-serif;
}
.big-arrow {
  font-size: 28px;
  color: var(--accent);
  align-self: center;
  justify-self: center;
  font-weight: 900;
}
.decision-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.decision-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fffaf0;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.decision-box strong { color: var(--accent-ink); }
@media (max-width: 760px) {
  .editor-frame, .swimlanes, .risk-lights, .compare-cards, .decision-grid { grid-template-columns: 1fr; }
  .flow-node::after { content: "↓"; right: 50%; top: auto; bottom: -20px; transform: translateX(50%); }
}
@media print {
  .visual, .flow-node, .editor-pane, .lane, .risk-card, .compare-card, .decision-box { box-shadow: none; break-inside: avoid; }
}
