:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #5c6670;
  --line: #d8dde3;
  --paper: #f4f7fb;
  --surface: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --grid: rgba(37, 99, 235, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.lesson-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
}

.lesson-sidebar {
  padding: 36px 32px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.lesson-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-sidebar h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
}

.lesson-goal,
.lesson-list li {
  color: var(--muted);
  line-height: 1.6;
}

.lesson-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.lesson-list li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.lesson-stage,
.embed-stage {
  min-height: 100svh;
  padding: 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

.embed-stage {
  min-height: 680px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.path-d-field {
  flex: 1 1 320px;
  min-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}

.toolbar label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.stage-canvas {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--surface);
  overflow: hidden;
}

.stage-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}

.readout {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}
