:root {
  color-scheme: dark;
  --page: #111216;
  --panel: #191b21;
  --line: #30323d;
  --text: #eeedf3;
  --muted: #a7a8b5;
  --accent: #ffc278;
  --green: #9bdbb5;
  font: 15px/1.55 system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.topbar { display: flex; align-items: center; gap: 24px; min-height: 66px; padding: 0 32px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 750; }
.brand-icon { font: bold 14px ui-monospace, monospace; padding: 8px; border-radius: 7px; background: var(--accent); color: #20160e; }
.top-progress { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
progress { width: 85px; height: 6px; accent-color: var(--accent); }
.header-link { font-size: .85rem; text-decoration: none; }
.layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); max-width: 1680px; margin: auto; min-height: calc(100vh - 66px); }
.sidebar { border-right: 1px solid var(--line); padding: 26px 15px; }
.sidebar h2 { font-size: .95rem; margin: 0 9px 18px; }
.sidebar h3 { color: var(--muted); font-size: .74rem; font-weight: 700; margin: 18px 9px 5px; text-transform: uppercase; letter-spacing: .06em; }
.lesson { display: flex; align-items: baseline; gap: 8px; width: 100%; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 6px 9px; text-align: left; font-size: .85rem; }
.lesson:hover, .lesson.active { background: #26232a; color: var(--text); }
.lesson.active .lesson-mark { color: var(--accent); }
.lesson-mark { color: var(--green); }
main { padding: clamp(22px, 4vw, 58px); min-width: 0; }
.eyebrow, .section-label { color: var(--accent); font-size: .73rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1 { font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1.04; letter-spacing: -.055em; margin: 13px 0 16px; }
.intro { color: var(--muted); max-width: 70ch; margin-bottom: 12px; font-size: 1.03rem; }
.docs { display: inline-block; font-size: .9rem; }
.workspace { margin-top: 31px; display: grid; align-items: start; grid-template-columns: minmax(200px, .75fr) minmax(0, 1.55fr); gap: 17px; }
.exercise, .workbench { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
.exercise { padding: 20px; }
.exercise h2 { font-size: 1.08rem; line-height: 1.35; margin: 7px 0 12px; }
.exercise p { color: var(--muted); }
.quiz { border-top: 1px solid var(--line); margin-top: 23px; padding-top: 19px; }
.option { background: #20222a; border: 1px solid var(--line); border-radius: 7px; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px; font-size: .86rem; }
.option:hover, .option.incorrect { border-color: var(--accent); }
.option.correct { border-color: var(--green); color: var(--green); }
.feedback { color: var(--muted); min-height: 1.5em; font-size: .8rem; }
.editor-bar, .terminal-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.editor-bar label, .terminal-bar label { margin-right: auto; font: .85rem ui-monospace, monospace; }
.subtle, .primary, .lesson-navigation button { border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; background: #22242d; font-size: .82rem; white-space: nowrap; }
.subtle:hover, .lesson-navigation button:hover { border-color: var(--accent); }
.primary { background: var(--accent); color: #26190b; font-weight: 750; border-color: var(--accent); }
#source, .output, .command { font: .88rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
#source { display: block; width: 100%; min-height: 250px; resize: vertical; background: #14151b; border: 0; padding: 14px; tab-size: 4; border-radius: 0; }
.terminal-bar { border-top: 1px solid var(--line); }
.passed { color: var(--green); font-size: .75rem; }
.output { margin: 0; padding: 12px 14px; background: #101116; color: #c4c7d5; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 90px; max-height: 275px; overflow: auto; }
.command { display: flex; gap: 9px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.command span { color: var(--accent); }
.command input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 3px; }
.lesson-navigation { display: flex; margin-top: 17px; }
.lesson-navigation .next { margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 1050px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 650px) {
  .topbar { padding: 0 15px; gap: 12px; }
  progress { display: none; }
  .layout { display: flex; flex-direction: column; }
  .sidebar { padding: 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar h2 { margin-bottom: 5px; }
  .sidebar nav { display: flex; gap: 14px; overflow: auto; white-space: nowrap; max-height: 135px; }
  .sidebar h3 { margin-top: 3px; }
  main { padding: 22px 14px; }
}
.solution { color: var(--muted); font-size: .85rem; }
.solution summary { cursor: pointer; color: var(--accent); }
.solution pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .8rem/1.5 ui-monospace, monospace; background: #14151b; padding: 10px; border-radius: 6px; }
