/* ============================================================
   Ebora Online Tutorial Services — Lessons
   Design tokens + app styles  (Modern EdTech)
   ============================================================ */

:root {
  /* Surfaces */
  --bg:          #F1F2F9;
  --surface:     #FFFFFF;
  --surface-2:   #FAFAFE;
  --line:        #E6E7F1;
  --line-soft:   #EFF0F7;

  /* Ink */
  --ink:         #1A1C2E;
  --ink-soft:    #4B4E66;
  --muted:       #888BA6;

  /* Brand */
  --brand:       #5B4FE9;
  --brand-ink:   #3B30B5;
  --brand-soft:  #ECEAFE;
  --brand-glow:  rgba(91,79,233,.28);

  /* Section accent system (color-coded lesson parts) */
  --c-obj:#0E9C97;     --c-obj-bg:#E1F6F4;
  --c-theory:#5B4FE9;  --c-theory-bg:#ECEAFE;
  --c-ex:#DD7B00;      --c-ex-bg:#FCEEDB;
  --c-formula:#3F4A8C; --c-formula-bg:#EAEDFB;
  --c-practice:#DB1B6E;--c-practice-bg:#FBE4EF;
  --c-quiz:#159A53;    --c-quiz-bg:#E1F5E9;
  --c-term:#7C3AED;    --c-term-bg:#F2EAFE;
  --c-ref:#5B6172;     --c-ref-bg:#EDEEF4;

  /* Radii + shadow */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --sh-sm: 0 1px 2px rgba(26,28,46,.06), 0 1px 3px rgba(26,28,46,.05);
  --sh:    0 4px 16px rgba(26,28,46,.07), 0 1px 4px rgba(26,28,46,.05);
  --sh-lg: 0 18px 50px rgba(26,28,46,.13);

  /* Type */
  --font-head: "Lexend", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --sidebar-w: 320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; }
a { color: inherit; }
::selection { background: var(--brand-glow); }

/* Scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #d3d5e6; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #bcbfd6; background-clip: content-box; }

/* ============================================================
   App layout
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: var(--sh-sm); }
.brand-text { line-height: 1.1; }
.brand-text .name { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: -.02em; }
.brand-text .sub { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }

.side-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 28px; }

.side-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--brand-ink);
  background: var(--brand-soft); border: none; cursor: pointer;
  padding: 8px 13px; border-radius: 999px; margin: 4px 4px 14px;
}
.side-back:hover { background: #e0ddfd; }

.side-subject {
  padding: 4px 8px 14px;
}
.side-subject .crumb { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.side-subject .title { font-family: var(--font-head); font-weight: 700; font-size: 19px; margin: 5px 0 2px; line-height: 1.18; }
.side-subject .meta { font-size: 12px; color: var(--muted); }

.toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.toc-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: 12px; cursor: pointer;
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .14s, color .14s;
}
.toc-item:hover { background: var(--surface-2); }
.toc-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; border-color: #ddd9fc; }
.toc-num {
  flex: 0 0 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  font-family: var(--font-head);
  background: #f0f1f8; color: var(--muted);
}
.toc-item.active .toc-num { background: var(--brand); color: #fff; }
.toc-item.done .toc-num { background: var(--c-quiz-bg); color: var(--c-quiz); }
.toc-label { flex: 1; line-height: 1.25; }

.side-progress { padding: 12px 12px 0; }
.progress-bar { height: 7px; border-radius: 999px; background: #e9eaf4; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #8b7bff); border-radius: 999px; transition: width .4s; }
.progress-label { font-size: 11.5px; color: var(--muted); margin-top: 7px; font-weight: 600; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 40px 120px; }

/* ============================================================
   Home / curriculum browse
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  margin: 28px 0 30px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(1200px 400px at 110% -30%, #7d6dff 0%, rgba(125,109,255,0) 55%),
    radial-gradient(800px 360px at -10% 120%, #00c4b3 0%, rgba(0,196,179,0) 50%),
    linear-gradient(135deg, #5B4FE9, #4a3fd0);
  color: #fff;
  padding: 44px 46px;
}
.hero h1 { font-size: 34px; margin: 0 0 10px; font-weight: 700; letter-spacing: -.025em; }
.hero p { font-size: 16px; line-height: 1.55; margin: 0; color: #ECEAFE; max-width: 560px; }
.hero .pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 16px;
}
.hero-stats { display: flex; gap: 28px; margin-top: 26px; }
.hero-stats .st .n { font-family: var(--font-head); font-weight: 700; font-size: 26px; }
.hero-stats .st .l { font-size: 12px; color: #d9d4fb; font-weight: 600; }

.group { margin: 34px 0; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.group-head h2 { font-size: 19px; margin: 0; }
.group-head .count { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.group-head .rule { flex: 1; height: 1px; background: var(--line); }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.subject-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 18px 16px; cursor: pointer; position: relative;
  transition: transform .14s, box-shadow .14s, border-color .14s;
  box-shadow: var(--sh-sm);
}
.subject-card.avail:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: #d8d4fb; }
.subject-card.locked { cursor: default; opacity: .72; }
.subject-card .ic {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  margin-bottom: 13px; color: #fff; font-size: 20px;
}
.subject-card h3 { font-size: 15.5px; margin: 0 0 5px; line-height: 1.25; }
.subject-card .desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; min-height: 34px; }
.subject-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 13px; font-size: 12px; font-weight: 600; }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.tag.live { background: var(--c-quiz-bg); color: var(--c-quiz); }
.tag.soon { background: #f0f1f6; color: var(--muted); }
.subject-card .units { color: var(--muted); margin-left: auto; }

/* ============================================================
   Lesson view
   ============================================================ */
.lesson-top { padding-top: 28px; }
/* Lesson + subject pages keep a comfortable reading column; the home grid uses the full width. */
.content.read { max-width: 880px; }
.lesson-crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.lesson-crumb a { color: var(--brand-ink); text-decoration: none; cursor: pointer; }
.lesson-crumb a:hover { text-decoration: underline; }

.lesson-head {
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #ffffff, #f7f7fe);
  border: 1px solid var(--line);
  padding: 30px 32px; box-shadow: var(--sh-sm);
}
.lesson-head .kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.lesson-head h1 { font-size: 29px; margin: 9px 0 12px; letter-spacing: -.025em; line-height: 1.12; }
.lesson-head .intro { font-size: 15.5px; line-height: 1.62; color: var(--ink-soft); margin: 0; }
.lesson-head .head-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); }

/* Section block */
.section { margin-top: 34px; scroll-margin-top: 20px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: 0 0 36px; }
.section-head h2 { font-size: 20px; margin: 0; }
.section-head .lead { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Objectives */
.obj-card { background: var(--c-obj-bg); border: 1px solid #c9ece9; border-radius: var(--r); padding: 8px 6px; }
.obj-list { list-style: none; margin: 0; padding: 0; }
.obj-list li { display: flex; gap: 13px; padding: 12px 16px; font-size: 14.5px; line-height: 1.5; color: var(--ink); align-items: flex-start; }
.obj-list li + li { border-top: 1px solid #cfeeeb; }
.obj-check { flex: 0 0 22px; height: 22px; border-radius: 7px; background: var(--c-obj); color: #fff; display: grid; place-items: center; font-size: 12px; margin-top: 1px; }

/* Theory prose */
.prose { font-size: 15.5px; line-height: 1.72; color: var(--ink-soft); }
.prose p { margin: 0 0 15px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose h3 { color: var(--ink); font-size: 17px; margin: 26px 0 10px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .katex { font-size: 1.04em; }

/* Callout / note */
.note { display: flex; gap: 13px; background: var(--brand-soft); border: 1px solid #ddd9fc; border-radius: var(--r); padding: 15px 17px; margin: 18px 0; font-size: 14px; line-height: 1.55; color: var(--brand-ink); }
.note .ni { flex: 0 0 auto; font-size: 17px; }
.note.tip { background: var(--c-obj-bg); border-color:#c9ece9; color:#0a6f6b; }
.note.warn { background: #FCEFDB; border-color:#f3dcb4; color:#8a5200; }

/* Formula card */
.formula { background: var(--c-formula-bg); border: 1px solid #d6dbf6; border-radius: var(--r); padding: 18px 20px; margin: 18px 0; }
.formula .fname { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-formula); margin-bottom: 8px; }
.formula .feq { font-size: 18px; overflow-x: auto; padding: 4px 0; }
.formula .fwhere { font-size: 13px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }
.formula .fwhere b { color: var(--ink); }

/* Worked example */
.example { border: 1px solid #f1dcb8; border-radius: var(--r-lg); overflow: hidden; margin: 16px 0; background: var(--surface); box-shadow: var(--sh-sm); }
.example .ex-head { background: var(--c-ex-bg); padding: 13px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #f1dcb8; }
.example .ex-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-ex); background: #fff; padding: 4px 9px; border-radius: 6px; }
.example .ex-title { font-weight: 600; font-size: 14.5px; font-family: var(--font-head); }
.example .ex-body { padding: 18px 20px; font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.example .ex-body .given { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px; margin: 0 0 14px; font-size: 13.5px; }
.ex-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.ex-steps > li { position: relative; padding: 4px 0 16px 40px; }
.ex-steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 8px; background: var(--c-ex); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; font-family: var(--font-head);
}
.ex-steps > li:not(:last-child)::after { content:""; position:absolute; left:13px; top:30px; bottom:4px; width:2px; background:#f1dcb8; }
.ex-ans { margin-top: 6px; background: var(--c-quiz-bg); border: 1px solid #bfe6cd; border-radius: var(--r-sm); padding: 11px 15px; font-weight: 600; color: #0d6e3c; font-size: 14px; }

/* Video solution (Vimeo embed inside a worked example) */
.ex-vbadge { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--c-ex); padding: 4px 9px; border-radius: 6px; }
.ex-video { margin: 4px 0 14px; }
.ex-video-head { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-ex); background: #fff; padding: 5px 11px; border-radius: 6px; margin-bottom: 10px; border: 1px solid #f1dcb8; }
.ex-video-frame { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; border-radius: var(--r-sm); overflow: hidden; background: #000; box-shadow: var(--sh-sm); }
.ex-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Side-by-side video-solution card (figure thumbnail + click-to-play, member-gated) */
.ex-hasvid .ex-body.ex-vidgrid { display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: 18px; align-items: start; }
.ex-vidtext { min-width: 0; }
.ex-vidtext .given { margin-bottom: 12px; }
.ex-vidside { min-width: 0; }
.vcard { position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); box-shadow: var(--sh-sm); }
.vcard-thumb { display: block; width: 100%; padding: 0; border: 0; background: #0b0b12; cursor: pointer; position: relative; line-height: 0; }
.vcard-thumb img { display: block; width: 100%; height: auto; }
.vcard-thumb.noimg { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--c-ex), #b45e00); }
.vcard-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .03em; line-height: 1.2; }
.vcard .diff-badge { position: absolute; top: 9px; left: 9px; z-index: 2; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; padding: 3px 8px; border-radius: 6px; }
.diff-badge.diff-Easy { background: #159A53; }
.diff-badge.diff-Intermediate { background: #DD7B00; }
.diff-badge.diff-Hard { background: #DB1B6E; }
.vcard-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(17, 17, 27, .62); display: grid; place-items: center; transition: transform .14s ease, background .14s ease; pointer-events: none; }
.vcard-thumb:hover .vcard-play, .vcard-thumb:focus-visible .vcard-play { transform: translate(-50%, -50%) scale(1.08); background: var(--c-ex); }
.vcard-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-align: left; }
.vcard-frame { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; background: #000; }
.vcard-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vcard-lock { position: absolute; inset: 0; z-index: 3; background: rgba(11, 11, 18, .9); display: grid; place-items: center; padding: 14px; }
.vcard-lock-in { position: relative; text-align: center; color: #fff; max-width: 100%; }
.vcard-lock-in .lk { font-size: 26px; }
.vcard-lock-in b { display: block; font-size: 15px; margin: 4px 0 6px; font-family: var(--font-head); }
.vcard-lock-in p { font-size: 12px; line-height: 1.5; color: #d7d8e6; margin: 0 0 12px; }
.vcard-cta { display: block; background: var(--c-ex); color: #fff; font-weight: 700; font-size: 13px; padding: 9px 12px; border-radius: var(--r-sm); text-decoration: none; }
.vcard-cta:hover { filter: brightness(1.06); }
.vcard-login { display: inline-block; margin-top: 9px; color: #cdd0ee; font-size: 12px; text-decoration: underline; }
.vcard-dismiss { position: absolute; top: -6px; right: -4px; background: rgba(255, 255, 255, .14); color: #fff; border: 0; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; }
@media (max-width: 640px) {
  .ex-hasvid .ex-body.ex-vidgrid { grid-template-columns: 1fr; gap: 14px; }
  .vcard-thumb img { max-height: 60vh; width: 100%; object-fit: contain; background: #0b0b12; }
}

/* ---- Related Videos & Apps hub (final synthetic lesson) ---- */
.rel-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.appcard { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface); box-shadow: var(--sh-sm); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.appcard:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: var(--c-practice); }
.appcard-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 21px; background: var(--surface-2); border: 1px solid var(--line); }
.appcard-body { display: flex; flex-direction: column; min-width: 0; }
.appcard-title { font-family: var(--font-head); font-weight: 700; font-size: 14.5px; color: var(--ink); line-height: 1.25; }
.appcard-desc { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); margin-top: 4px; }
.appcard-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.appcard-type { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c-practice); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.appcard-open { font-size: 12px; font-weight: 700; color: var(--brand-ink); margin-left: auto; }

.rel-vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.rel-vcell { display: flex; flex-direction: column; gap: 7px; }
.rel-vtitle { font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); }
.rel-browse { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; background: var(--c-ex); color: #fff; font-weight: 700; font-size: 13.5px; padding: 11px 18px; border-radius: var(--r-sm); text-decoration: none; box-shadow: var(--sh-sm); transition: filter .12s ease; }
.rel-browse:hover { filter: brightness(1.06); }

/* Diagram figure */
.figure { margin: 18px 0; text-align: center; }
.figure .frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh-sm); }
.figure svg { max-width: 100%; height: auto; }
.figure figcaption { font-size: 12.5px; color: var(--muted); margin-top: 9px; font-weight: 600; }

/* ---- Shared diagram language (referenced by lesson SVGs) ---- */
.dgm { background: #fff; }
.dgm-grid-bg { fill: url(#dgm-grid); }
.dgm-body   { fill: #ECEAFE; stroke: #5B4FE9; stroke-width: 1.8; }
.dgm-body2  { fill: #E1F5E9; stroke: #159A53; stroke-width: 1.8; }
.dgm-body3  { fill: #FCEEDB; stroke: #DD7B00; stroke-width: 1.8; }
.dgm-fillmut{ fill: #EEF0F7; stroke: #C2C6D6; stroke-width: 1.6; }
.dgm-member { stroke: #5B4FE9; stroke-width: 3.6; stroke-linecap: round; fill: none; }
.dgm-member-c { stroke: #DB1B6E; stroke-width: 3.6; stroke-linecap: round; fill: none; }
.dgm-member-t { stroke: #159A53; stroke-width: 3.6; stroke-linecap: round; fill: none; }
.dgm-load   { stroke: #DD7B00; stroke-width: 3.4; fill: none; }
.dgm-react  { stroke: #5B4FE9; stroke-width: 3.4; fill: none; }
.dgm-fric   { stroke: #159A53; stroke-width: 3.4; fill: none; }
.dgm-res    { stroke: #DB1B6E; stroke-width: 3.2; fill: none; }
.dgm-dim    { stroke: #9AA0B4; stroke-width: 1.3; fill: none; }
.dgm-loa    { stroke: #BFC4D4; stroke-width: 1.5; stroke-dasharray: 6 4; fill: none; }
.dgm-ground { stroke: #1A1C2E; stroke-width: 2.4; fill: none; }
.dgm-hatch  { stroke: #A6ABBD; stroke-width: 1.3; fill: none; }
.dgm-axis   { stroke: #AEB3C4; stroke-width: 1.6; fill: none; }
.dgm-node   { fill: #1A1C2E; }
.dgm-node-o { fill: #fff; stroke: #1A1C2E; stroke-width: 1.8; }
.dgm-rt     { fill: none; stroke: #5B4FE9; stroke-width: 1.4; }
.dgm-t      { font-family: var(--font-body); font-weight: 700; fill: #1A1C2E; }
.dgm-t.sm   { font-weight: 600; }
.dgm-load-t { font-family: var(--font-body); font-weight: 700; fill: #C46A00; }
.dgm-react-t{ font-family: var(--font-body); font-weight: 700; fill: #4A3FD0; }
.dgm-fric-t { font-family: var(--font-body); font-weight: 700; fill: #0E7A45; }
.dgm-res-t  { font-family: var(--font-body); font-weight: 700; fill: #B01558; }
.dgm-mut    { font-family: var(--font-body); font-weight: 600; fill: #888BA6; }
.dgm-cap    { font-family: var(--font-body); font-weight: 700; fill: #5B4FE9; }

/* Practice problems */
.practice { border: 1px solid #f3cfe0; border-radius: var(--r); margin: 14px 0; background: var(--surface); overflow: hidden; box-shadow: var(--sh-sm); }
.practice .p-q { padding: 16px 18px; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.practice .p-q .qn { font-weight: 700; color: var(--c-practice); font-family: var(--font-head); margin-right: 6px; }
.p-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; border: none; background: var(--c-practice-bg); color: var(--c-practice); font-weight: 700; font-size: 12.5px; padding: 8px 14px; border-radius: 999px; margin: 0 18px 16px; font-family: var(--font-body); }
.p-toggle:hover { filter: brightness(.97); }
.p-sol { padding: 0 18px 16px; }
.p-sol-inner { background: var(--c-practice-bg); border: 1px dashed #f0bcd5; border-radius: var(--r-sm); padding: 14px 16px; font-size: 14px; line-height: 1.65; color: var(--ink-soft); }

/* Quiz */
.quiz { background: var(--c-quiz-bg); border: 1px solid #bfe6cd; border-radius: var(--r-lg); padding: 22px 24px; margin: 16px 0; }
.quiz-q { margin-bottom: 22px; }
.quiz-q:last-child { margin-bottom: 0; }
.quiz-q .qtext { font-weight: 600; font-size: 15px; line-height: 1.5; margin-bottom: 13px; font-family: var(--font-head); }
.quiz-q .qtext .qi { color: var(--c-quiz); font-weight: 700; margin-right: 7px; }
.opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: #fff; border: 1.5px solid #d4e9dc; border-radius: 12px; padding: 12px 15px;
  font-size: 14px; transition: border-color .12s, background .12s; text-align: left; font-family: var(--font-body);
}
.opt:hover { border-color: var(--c-quiz); }
.opt .mk { flex: 0 0 24px; height: 24px; border-radius: 7px; border: 1.5px solid #c4ddcc; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--muted); font-family: var(--font-head); }
.opt.correct { background: #d8f3e2; border-color: var(--c-quiz); color: #0c6b3b; font-weight: 600; }
.opt.correct .mk { background: var(--c-quiz); color: #fff; border-color: var(--c-quiz); }
.opt.wrong { background: #fde7ef; border-color: #e7679c; color: #97134f; }
.opt.wrong .mk { background: #db1b6e; color: #fff; border-color: #db1b6e; }
.opt:disabled { cursor: default; }
.q-explain { margin-top: 11px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); background: #fff; border: 1px solid #d4e9dc; border-radius: var(--r-sm); padding: 11px 14px; display: flex; gap: 9px; }
.q-explain b { color: var(--c-quiz); }

/* Glossary */
.glossary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.term { background: var(--c-term-bg); border: 1px solid #e3d5fb; border-radius: var(--r); padding: 14px 16px; }
.term dt { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--c-term); margin-bottom: 4px; }
.term dd { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

/* References */
.refs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.refs li { display: flex; gap: 13px; background: var(--c-ref-bg); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 16px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.refs .rn { flex: 0 0 28px; height: 28px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--c-ref); font-family: var(--font-head); font-size: 13px; }

/* Footer nav between lessons */
.lesson-nav { display: flex; gap: 14px; margin-top: 46px; }
.lnav {
  flex: 1; display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px;
  transition: border-color .14s, box-shadow .14s, transform .14s; box-shadow: var(--sh-sm);
}
.lnav:hover { border-color: #d8d4fb; box-shadow: var(--sh); transform: translateY(-2px); }
.lnav.next { text-align: right; align-items: flex-end; }
.lnav .dir { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lnav .t { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: var(--ink); }
.lnav.ghost { visibility: hidden; }

.complete-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: var(--brand); color: #fff; border: none; font-family: var(--font-body); font-weight: 700; font-size: 14px;
  padding: 13px 22px; border-radius: 999px; margin-top: 30px; box-shadow: 0 6px 18px var(--brand-glow);
  transition: transform .14s, box-shadow .14s;
}
.complete-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--brand-glow); }
.complete-btn.done { background: var(--c-quiz); box-shadow: 0 6px 18px rgba(21,154,83,.3); }

/* Mobile */
.menu-btn { display: none; }
@media (max-width: 920px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--sh-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-grid; place-items: center; position: fixed; top: 14px; left: 14px; z-index: 40; width: 46px; height: 46px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh); cursor: pointer; }
  .content { padding: 0 20px 100px; }
  .scrim { position: fixed; inset: 0; background: rgba(20,22,40,.4); z-index: 25; }
  .glossary { grid-template-columns: 1fr; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 26px; }
}
