:root {
  --ink: #1d2733; --muted: #5b6b7c; --line: #d8e0e8;
  --accent: #2f6f4f; --accent-soft: #e7f2ec; --card: #ffffff;
  --bg: #f4f6f8; --warn: #8a6d1a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: #17352a; color: #fff; }
.brand { font-size: 20px; font-weight: 700; }
.who { font-size: 14px; opacity: 0.85; }
.wrap { max-width: 820px; margin: 22px auto 60px; padding: 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20,40,30,0.06); }
.card h2 { margin: 0 0 6px; font-size: 22px; }
.summary { color: var(--muted); margin: 4px 0 12px; }
.meta { color: var(--muted); font-size: 13px; }
.bar { height: 8px; background: #e6ebef; border-radius: 4px; overflow: hidden; margin: 10px 0 4px; }
.fill { height: 100%; background: var(--accent); }
.lessonlist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.lessonrow { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfd; cursor: pointer; font-size: 15px; }
.lessonrow:hover { border-color: var(--accent); background: var(--accent-soft); }
.ltitle { flex: 1; font-weight: 600; }
.donewhen { color: var(--muted); font-size: 12px; }
.nextup { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.back { background: none; border: none; color: var(--accent); font-size: 15px; cursor: pointer; padding: 4px 0 10px; font-weight: 600; }
.crumb { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.body h3 { margin: 18px 0 6px; font-size: 17px; }
.body h4 { margin: 14px 0 4px; font-size: 15px; }
.body p { line-height: 1.55; margin: 6px 0; }
.body li { line-height: 1.5; margin: 3px 0; }
.qhead { margin-top: 24px; }
.qblock { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.qprompt { margin: 0 0 8px; line-height: 1.5; }
textarea.answer, #chatbox { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; background: #fff; }
textarea.answer:focus, #chatbox:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.qrow { display: flex; align-items: center; gap: 12px; margin: 8px 0 6px; }
.save { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.save:disabled { opacity: 0.6; cursor: default; }
.saved { color: var(--muted); font-size: 13px; }
.finrow { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.finish { background: #fff; border: 2px solid var(--accent); color: var(--accent); border-radius: 9px; padding: 10px 18px; font-size: 15px; font-weight: 700; cursor: pointer; }
.chatnote { color: var(--muted); font-size: 14px; line-height: 1.5; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.msg.muse { background: var(--accent-soft); border-color: #cfe3d8; }
.msg.student { background: #fbfcfd; }
.mhead { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.mbody p { margin: 4px 0; line-height: 1.55; }
.loading { color: var(--muted); }
