@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap');

:root {
  --navy: #0b1f3a; --navy-2: #132c4f; --ink: #1b2433; --muted: #5d6878; --line: #e3e0d8;
  --paper: #f7f5f0; --card: #ffffff; --teal: #0f8b8d; --teal-soft: #e3f3f2;
  --amber: #e2a03f; --amber-soft: #fbf1df; --red: #c0392b; --red-soft: #fbe9e7;
  --green: #1e8e5a; --green-soft: #e4f4ec; --blue-soft: #e8eef8;
  --radius: 14px; --shadow: 0 1px 2px rgba(11,31,58,.06), 0 6px 24px rgba(11,31,58,.06);
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--ui); color: var(--ink); background: var(--paper); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* top bar */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
.topbar .in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.brand .mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--amber), #f3c97a); color: var(--navy);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 18px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: #a9b7cc; letter-spacing: 1.4px; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.topbar .nav a { color: #d6deea; text-decoration: none; font-size: 14px; margin-left: 18px; }
.topbar .nav a:hover { color: #fff; }
.userchip { font-size: 13px; color: #a9b7cc; }
.linkbtn { background: none; border: 0; color: #d6deea; cursor: pointer; font-size: 14px; padding: 0; margin-left: 18px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
.narrow { max-width: 760px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px;
  padding: 11px 18px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: #0c7577; }
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-amber:hover { background: #d18f2e; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-danger { background: #fff; color: var(--red); border-color: #efc4be; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .pad { padding: 22px; }
.eyebrow { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--teal); font-weight: 700; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.25; }
h1 { font-size: clamp(28px, 4vw, 38px); margin: 6px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 70%, #1d3d63 100%); color: #fff; border-radius: 20px; padding: 32px;
  position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(226,160,63,.35), transparent 70%); }
.hero h1 { color: #fff; }
.hero p { color: #c9d4e4; max-width: 680px; }
.hero .eyebrow { color: var(--amber); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.stat b { display: block; font-size: 24px; font-family: var(--serif); }
.stat span { font-size: 12px; color: #a9b7cc; text-transform: uppercase; letter-spacing: 1px; }

.progress { height: 8px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; }
.progress.light { background: #ece8df; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #37b3a8); border-radius: 99px; width: 0; transition: width .6s; }
.hero .progress > i { background: linear-gradient(90deg, var(--amber), #f5cf8a); }

/* course grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.course-card { display: flex; flex-direction: column; overflow: hidden; }
.course-card .band { height: 8px; background: linear-gradient(90deg, var(--teal), var(--amber)); }
.course-card h3 { margin: 6px 0 6px; font-size: 21px; }
.course-card .foot { margin-top: auto; padding: 16px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; }
.badge.draft { background: var(--amber-soft); color: #93621a; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.lock { background: #eef0f3; color: var(--muted); }

/* outline */
.module { margin-top: 22px; }
.module-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.module-head h2 { font-size: 20px; margin: 0; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 15px 22px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover:not(.locked) { background: #fbfaf7; }
.lesson-row.locked { color: #98a1ad; cursor: not-allowed; }
.dot { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700;
  border: 2px solid var(--line); color: var(--muted); background: #fff; }
.dot.done { background: var(--green); border-color: var(--green); color: #fff; }
.dot.prog { border-color: var(--teal); color: var(--teal); }
.lesson-row .t { font-weight: 600; }
.lesson-row .meta { font-size: 13px; color: var(--muted); }
.lesson-row .right { margin-left: auto; text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* lesson layout */
.lesson-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
.lesson-layout > *, .admin-grid > *, .editor > * { min-width: 0; }
.md { overflow-wrap: break-word; }
.side { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.side .lesson-row { padding: 11px 14px; gap: 10px; }
.side .dot { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; }
.side .lesson-row .t { font-size: 14px; font-weight: 500; }
.side .lesson-row.current { background: var(--teal-soft); }
.side-mod { padding: 12px 14px 6px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.side-toggle { display: none; }

article.lesson { padding: clamp(22px, 4vw, 48px); }
.lesson-meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }
.pill { font-size: 13px; padding: 5px 11px; border-radius: 99px; background: #f1efe9; color: var(--muted); }

/* rendered lesson content */
.md { font-family: var(--serif); font-size: 19px; line-height: 1.72; color: #222b38; }
.md h2 { font-size: 26px; margin: 38px 0 12px; padding-top: 6px; }
.md h3 { font-size: 21px; margin: 28px 0 8px; }
.md h4 { font-family: var(--ui); font-size: 12.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--teal); margin: 34px 0 4px; }
.md h4 + h2, .md h4 + h3 { margin-top: 2px; }
.md h2 { border-top: 2px solid var(--navy); padding-top: 14px; }
.md > h2:first-child, .md > h4:first-child + h2 { border-top: 0; padding-top: 0; }
.md h4:has(+ h2) { border-top: 2px solid var(--navy); padding-top: 16px; }
.md h4 + h2 { border-top: 0; padding-top: 0; }
.md > h4:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.md p { margin: 0 0 16px; }
.md ul, .md ol { margin: 0 0 18px; padding-left: 26px; }
.md li { margin: 6px 0; }
.md strong { color: var(--navy); }
.md th strong { color: inherit; }
.md code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: #f1efe9; padding: 2px 6px; border-radius: 5px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.md img { max-width: 100%; border-radius: 10px; }
.md .tbl { overflow-x: auto; margin: 6px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-family: var(--ui); font-size: 15px; line-height: 1.5; }
.md th { background: var(--navy); color: #fff; text-align: left; font-weight: 600; padding: 11px 14px; }
.md td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.md tr:nth-child(even) td { background: #faf9f6; }
.callout { border-radius: 12px; padding: 16px 18px 16px 18px; margin: 22px 0; border-left: 5px solid; font-size: 17px; }
.callout .ct { font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; margin-bottom: 4px; }
.callout p:last-child { margin-bottom: 0; }
.callout .cttl { font-family: var(--ui); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--navy); margin-left: 10px; }
.callout ul, .callout ol { margin-bottom: 8px; }
.callout .tbl { background: #fff; }
.callout.key { background: #f1f5f9; border-color: var(--teal); } .callout.key .ct { color: var(--teal); }
.callout.takeaways { background: #eaf5f5; border-color: var(--teal); } .callout.takeaways .ct { color: var(--teal); }
.callout.trap { background: #fcefef; border-color: #b4232d; } .callout.trap .ct { color: #b4232d; }
.callout.control { background: #f3f8f0; border-color: #3d6b2f; } .callout.control .ct { color: #3d6b2f; }
.callout.memory { background: #fcf6e7; border-color: #c98a12; } .callout.memory .ct { color: #9a6a08; }
.callout.example { background: #f9f7f0; border-color: #7a5c12; } .callout.example .ct { color: #7a5c12; }
.callout.distinction { background: #eef6f6; border-color: #0f7c7c; } .callout.distinction .ct { color: #0f7c7c; }
.callout.principle { background: #f1f5f9; border-color: var(--navy); } .callout.principle .ct { color: #0f7c7c; }
.callout.context { background: #f3f0fa; border-color: #6a4bb0; } .callout.context .ct { color: #6a4bb0; }
.callout.exam { background: #edf3fb; border-color: #2156a5; } .callout.exam .ct { color: #2156a5; }
.callout.red { background: #fff5ee; border-color: #c2410c; } .callout.red .ct { color: #c2410c; }
.callout.reg { background: #f3f8f0; border-color: #3d6b2f; } .callout.reg .ct { color: #3d6b2f; }
.callout.case { background: #f1f4f8; border-color: var(--navy); } .callout.case .ct { color: var(--navy); }
.callout.note { background: #f3f2ee; border-color: #9aa3ae; } .callout.note .ct { color: var(--muted); }
.callout.quote { background: #fff; border-color: var(--line); font-style: italic; }

/* quiz */
.quiz-box { margin-top: 36px; border: 2px solid var(--navy); border-radius: 16px; overflow: hidden; }
.quiz-head { background: var(--navy); color: #fff; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.quiz-head h2 { color: #fff; margin: 0; font-size: 22px; }
.quiz-body { padding: 22px; }
.q { padding: 18px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; }
.q .stem { font-weight: 600; margin-bottom: 4px; }
.q .hint { font-size: 12px; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; cursor: pointer; background: #fff; }
.opt:hover { border-color: var(--teal); }
.opt input { margin-top: 4px; accent-color: var(--teal); width: 17px; height: 17px; flex: 0 0 auto; }
.opt .k { font-weight: 700; color: var(--navy); min-width: 18px; }
.opt.sel { border-color: var(--teal); background: var(--teal-soft); }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt .why { display: block; font-size: 14px; color: var(--muted); margin-top: 5px; }
.verdict { font-size: 13px; font-weight: 700; margin-left: 8px; }
.verdict.ok { color: var(--green); } .verdict.no { color: var(--red); }
.explain { background: #f6f5f1; border-radius: 10px; padding: 12px 14px; font-size: 15px; margin-top: 10px; }
.result-banner { border-radius: 14px; padding: 22px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.result-banner.pass { background: var(--green-soft); } .result-banner.fail { background: var(--red-soft); }
.score-big { font-family: var(--serif); font-size: 44px; font-weight: 700; line-height: 1; }
.pass .score-big { color: var(--green); } .fail .score-big { color: var(--red); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid #d5d1c7; border-radius: 9px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.field textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; } .row > * { flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.field.check input { width: auto; flex: 0 0 auto; accent-color: var(--teal); }
.md > :first-child { margin-top: 0; }

.alert { padding: 13px 16px; border-radius: 10px; margin: 12px 0; font-size: 15px; }
.alert.err { background: var(--red-soft); color: #8e2a1f; }
.alert.ok { background: var(--green-soft); color: #13603d; }
.alert.info { background: var(--amber-soft); color: #6e4a12; }
.center-screen { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 99; box-shadow: var(--shadow); font-size: 14px; }

/* tables (admin) */
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.dtable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll-x { overflow-x: auto; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--amber); }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor textarea { font-family: ui-monospace, Menlo, monospace; font-size: 14px; min-height: 520px; line-height: 1.5; }
.preview { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff; max-height: 600px; overflow: auto; }
.preview .md { font-size: 16px; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; cursor: pointer; }
.list-item.on { border-color: var(--teal); background: var(--teal-soft); }
.admin-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }

/* certificate */
.cert-page { background: #e9e6df; min-height: 100vh; padding: 28px 12px; }
.cert { width: 100%; max-width: 1050px; aspect-ratio: 1.414; margin: 0 auto; background: #fffdf8; position: relative; padding: 4.2%;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); font-family: var(--serif); color: var(--navy); }
.cert .frame { position: absolute; inset: 2.2%; border: 2px solid var(--navy); }
.cert .frame::after { content: ''; position: absolute; inset: 8px; border: 1px solid var(--amber); }
.cert .inner { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; gap: 1.3vw; padding: 0 6%; }
.cert .org { font-family: var(--ui); font-weight: 700; letter-spacing: .35em; text-transform: uppercase; font-size: clamp(9px, 1.15vw, 13px); color: var(--teal); }
.cert .title { font-size: clamp(22px, 4.4vw, 50px); font-weight: 700; letter-spacing: .02em; }
.cert .lead { font-family: var(--ui); font-size: clamp(9px, 1.25vw, 14px); color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.cert .name { font-size: clamp(24px, 4.8vw, 54px); font-style: italic; border-bottom: 1px solid var(--amber); padding: 0 4% .3vw; }
.cert .course { font-size: clamp(14px, 2.2vw, 25px); font-weight: 600; }
.cert .foot { display: flex; justify-content: space-between; width: 100%; margin-top: 2vw; font-family: var(--ui); font-size: clamp(8px, 1.05vw, 12px); color: var(--muted); }
.cert .foot b { display: block; color: var(--navy); font-size: clamp(9px, 1.2vw, 14px); }
.cert .seal { width: clamp(54px, 9vw, 104px); height: clamp(54px, 9vw, 104px); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6d38f, var(--amber) 60%, #b97d22);
  display: grid; place-items: center; color: var(--navy); font-weight: 700; font-size: clamp(8px, 1.1vw, 13px); letter-spacing: .1em; box-shadow: inset 0 0 0 4px rgba(255,255,255,.35); }
.no-print { }
@media print {
  @page { size: A4 landscape; margin: 0; }
  .no-print { display: none !important; }
  .cert-page { background: #fff; padding: 0; }
  .cert { box-shadow: none; max-width: none; width: 297mm; height: 210mm; aspect-ratio: auto; }
}

@media (max-width: 900px) {
  .lesson-layout, .admin-grid, .editor { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; display: none; }
  .side.open { display: block; }
  .side-toggle { display: inline-flex; margin-bottom: 14px; }
  .topbar .nav a.hide-sm { display: none; }
  .md { font-size: 18px; }
}
@media (max-width: 560px) {
  .wrap { padding: 18px 14px 48px; }
  .hero { padding: 22px; border-radius: 16px; }
  .brand small { display: none; }
  .lesson-row { padding: 13px 16px; }
  .lesson-row .right { display: none; }
  .quiz-body { padding: 16px; }
  .topbar .nav a { margin-left: 12px; }
}

/* small-screen polish */
.topbar .nav { display: flex; align-items: center; flex-wrap: nowrap; }
.topbar .nav a, .topbar .linkbtn { white-space: nowrap; }
.actions .btn { white-space: normal; text-align: center; max-width: 100%; }
@media (max-width: 560px) { .stats { gap: 18px 26px; } .brand span:not(.mark) { font-size: 15px; line-height: 1.2; } }
@media screen and (max-width: 700px) {
  .cert { aspect-ratio: auto; padding: 26px 16px; }
  .cert .inner { gap: 10px; padding: 26px 10px; }
  .cert .foot { flex-direction: column; align-items: center; gap: 12px; }
  .cert .foot > div { text-align: center !important; }
}

/* topic checks inside a lesson */
.topic-check { margin: 30px 0 8px; font-family: var(--ui); font-size: 16px; line-height: 1.55; }
.tc-box { border: 1.5px solid var(--teal); border-radius: 14px; overflow: hidden; background: #fff; }
.tc-head { background: var(--teal-soft); padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tc-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--teal); }
.tc-title { font-weight: 700; color: var(--navy); font-size: 15px; }
.tc-body { padding: 14px 18px; }
.tc-body .q:first-child { padding-top: 4px; }
.topic-check h3 { font-family: var(--ui); font-size: 16px; }
.topic-check .alert { font-size: 14px; }
.topic-check, #quizArea { scroll-margin-top: 84px; }

/* study coach: plan, today, strengths and weaknesses */
.coach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.coach .card { padding: 22px; }
.coach .wide { grid-column: 1 / -1; }
.coach h2 { font-size: 21px; margin: 2px 0 10px; }
.coach .kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--teal); }
.bignum { font-family: var(--serif); font-size: 46px; font-weight: 700; color: var(--navy); line-height: 1; }
.bignum small { font-family: var(--ui); font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; letter-spacing: .3px; }
.chip.on_track, .chip.ahead, .chip.complete { background: var(--green-soft); color: var(--green); }
.chip.behind { background: var(--red-soft); color: var(--red); }
.chip.revision, .chip.exam_passed { background: var(--amber-soft); color: #93621a; }
.plan-line { margin: 12px 0 6px; font-size: 14px; color: var(--muted); }
.plan-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.plan-form .field { margin: 0; }
.plan-form .btn { grid-column: 1 / -1; }
.todo { list-style: none; margin: 6px 0 14px; padding: 0; }
.todo li { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
.todo a { display: flex; gap: 12px; align-items: center; padding: 11px 13px; text-decoration: none; color: inherit; }
.todo a:hover { border-color: var(--teal); background: #fbfaf7; }
.todo .t { font-weight: 600; }
.todo .s { font-size: 12.5px; color: var(--muted); }
.todo .s.late { color: var(--red); font-weight: 600; }
.todo .go { margin-left: auto; color: var(--teal); font-weight: 700; }
.goal-row { display: flex; justify-content: space-between; font-size: 14px; margin: 4px 0 6px; }
.streak { font-size: 14px; color: var(--muted); margin-top: 10px; }

.meter { display: inline-flex; gap: 4px; vertical-align: middle; }
.meter i { width: 22px; height: 8px; border-radius: 4px; background: #e8e5dd; }
.meter.weak i.f { background: var(--red); }
.meter.developing i.f { background: var(--amber); }
.meter.proficient i.f { background: var(--teal); }
.meter.advanced i.f { background: var(--green); }
.lvl { font-size: 12.5px; font-weight: 700; }
.lvl.weak { color: var(--red); } .lvl.developing { color: #93621a; } .lvl.proficient { color: var(--teal); }
.lvl.advanced { color: var(--green); } .lvl.not_started { color: var(--muted); }
.dom { border-top: 1px solid var(--line); padding: 16px 0; }
.dom:first-of-type { border-top: 0; padding-top: 6px; }
.dom-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.dom-name { flex: 1 1 260px; }
.dom-name b { display: block; color: var(--navy); }
.dom-name span { font-size: 13px; color: var(--muted); }
.dom-score { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.dom-score .small { color: var(--muted); }
.dom details { margin-top: 10px; }
.dom summary { cursor: pointer; font-size: 13px; color: var(--teal); font-weight: 600; }
.chap { display: flex; gap: 12px; align-items: center; padding: 8px 0 8px 4px; font-size: 14px; border-bottom: 1px dashed var(--line); }
.chap:last-child { border-bottom: 0; }
.chap .n { flex: 1; }
.chap .meter i { width: 14px; height: 6px; }
.legend { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.due { font-size: 12.5px; color: var(--muted); }
.due.late { color: var(--red); font-weight: 600; }
.due.today { color: var(--teal); font-weight: 700; }

/* timed pre-assessment */
.timerbar { position: sticky; top: 56px; z-index: 20; background: var(--navy); color: #fff; border-radius: 12px; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; box-shadow: var(--shadow); }
.timerbar .clock { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 700; }
.timerbar.low { background: #8e2a1f; }
.timerbar .sp { flex: 1; }
.timerbar .small { color: #c9d4e4; }
.assess-card { padding: clamp(20px, 4vw, 36px); }
.assess-card ul { padding-left: 22px; }
.assess-card li { margin: 6px 0; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 16px 0; }
.res-grid div { background: #f6f5f1; border-radius: 12px; padding: 14px; }
.res-grid b { display: block; font-family: var(--serif); font-size: 26px; color: var(--navy); }
.res-grid span { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }

@media (max-width: 760px) {
  .coach { grid-template-columns: minmax(0, 1fr); }
  .plan-form { grid-template-columns: minmax(0, 1fr); }
  .coach .card { padding: 18px; }
  .timerbar { top: 52px; }
}
