:root {
  --ink: #191f28;
  --body: #212121;
  --muted: #66717e;
  --line: #e6e8eb;
  --line-strong: #d5d8de;
  --bg: #f7f8f9;
  --violet: #6700e6;
  --chip: #eae5fb;
  --chip-text: #613dd6;
  color: var(--body);
  background: var(--bg);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { word-break: keep-all; overflow-wrap: break-word; }
button, textarea, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.app { height: 100%; display: flex; flex-direction: column; background: white; }
.top, .path { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; flex: 0 0 auto; }
.tabs a, .quiet {
  text-decoration: none; border-radius: 999px; padding: 8px 14px; min-height: 40px;
  display: inline-flex; align-items: center;
}
.tabs a { color: var(--muted); }
.tabs a.on { background: #212121; color: white; }
.lesson { margin: 0; flex: 1; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { height: 3px; background: var(--line); }
.meter span { display: block; height: 100%; width: 0; background: #212121; }
.quiet { color: var(--muted); font-size: 13px; }
.path { gap: 8px; overflow-x: auto; font-size: 14px; font-weight: 700; background: white; }
.path a, .path b { text-decoration: none; color: #98a2b3; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.path .num {
  width: 22px; height: 22px; border-radius: 99px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); font-size: 12px;
}
.path .now { color: var(--violet); }
.path .now .num { background: var(--chip); color: var(--chip-text); border-color: transparent; }
.path .done { color: var(--ink); }
.path .arrow { color: #d0d5dd; font-weight: 500; }
.workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.stage { flex: 1; min-height: 0; overflow: auto; padding: 28px 20px 12px; }
.exercise, .catalog, .memo { max-width: 760px; margin: 0 auto; }
.kicker { margin: 0 0 8px; color: var(--violet); font-size: 13px; font-weight: 700; }
h1 { margin: 0 0 8px; color: var(--ink); font-size: 32px; line-height: 1.3; letter-spacing: -0.03em; }
.lead, .feedback { margin: 0; line-height: 1.6; color: var(--muted); }
.quote {
  margin: 16px 0 0; padding: 12px 14px; background: white; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink);
}
.choices, .split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.choice, .split a, .catalog a.card {
  min-height: 56px; border: 1px solid var(--line-strong); background: white; border-radius: 12px;
  padding: 14px 16px; text-align: left; text-decoration: none; color: var(--ink); font-weight: 700;
}
.choice:hover, .split a:hover, .catalog a.card:hover { border-color: #b9b4c7; }
.choice:focus-visible, .next:focus-visible, textarea:focus-visible, .tabs a:focus-visible {
  outline: 2px solid var(--violet); outline-offset: 2px;
}
.choice:disabled { color: var(--muted); }
.feedback { margin-top: 16px; color: var(--ink); }
.feedback.bad { color: var(--body); }
.next, .start {
  display: inline-flex; align-items: center; justify-content: center; margin-top: 18px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: #212121;
  color: white; text-decoration: none; font-weight: 700;
}
.back { display: block; width: fit-content; margin-top: 12px; color: var(--muted); font-size: 14px; text-decoration: none; background: transparent; border: 0; padding: 0; }
.done-list { margin: 16px 0 0; padding-left: 18px; }
.done-list li { margin: 6px 0; line-height: 1.45; }
.band + .band { margin-top: 22px; }
.band h2 { margin: 0 0 10px; font-size: 15px; }
.cards { display: grid; gap: 8px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.two { grid-template-columns: 1.1fr 1.4fr; }
.catalog a.card { display: block; min-height: 108px; }
.catalog a.card span { display: block; margin-bottom: 6px; color: var(--chip-text); font-size: 12px; }
.catalog a.card small { display: block; margin-top: 6px; color: var(--muted); font-weight: 500; line-height: 1.45; }
.catalog a.card.stretch { background: var(--chip); border-color: transparent; }
.memo pre {
  white-space: pre-wrap; font: 14px/1.6 Pretendard, sans-serif; background: white;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
}
.composer {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0 20px 16px;
  padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: white;
}
textarea { border: 0; resize: none; min-height: 44px; max-height: 120px; padding: 10px; background: #f7f8f9; border-radius: 10px; }
#send { border: 0; border-radius: 999px; background: #212121; color: white; padding: 0 16px; font-weight: 700; }
#send:disabled { background: #d0d5dd; }
.err { color: #b42318; }
@media (max-width: 800px) {
  h1 { font-size: 26px; }
  .choices, .split, .cards.three, .cards.two { grid-template-columns: 1fr; }
  .stage { padding: 20px 16px 8px; }
  .composer { margin: 0 16px 12px; }
  .lesson { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
