/* RankDeterminant Learn — design system (Brilliant-inspired: calm canvas, bold colour, friendly type) */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f1f0ea;
  --ink: #15171c;
  --ink-2: #454a55;
  --muted: #6b7180;
  --line: #e4e2da;
  --line-2: #d6d3c8;
  --brand: #1b3a5c;
  --brand-ink: #ffffff;
  --accent: #e0592a;
  --good: #1f9d63;
  --good-soft: #e3f5ec;
  --bad: #d64545;

  --math: #3a5ccc;   --math-soft: #e8edfb;
  --phy: #0f9488;    --phy-soft: #e0f3f1;
  --chem: #d9622b;   --chem-soft: #fbece4;

  /* lesson boxes (same colour language as the printed books) */
  --def: #1f6fb2;    --def-soft: #eaf3fb;
  --key: #6c3483;    --key-soft: #f3ecf7;
  --trick: #b87a06;  --trick-soft: #fdf5e2;
  --warn: #b03a2e;   --warn-soft: #fbecea;
  --ex: #0e7c66;     --ex-soft: #e7f5f1;
  --pyq: #7b3fa0;    --pyq-soft: #f2eaf8;
  --prac: #1b3a5c;   --prac-soft: #edf1f6;
  --note: #5b6270;   --note-soft: #f1f2f4;
  --easy: #2f9e44; --medium: #e08e0b; --hard: #d6336c;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 30, .06), 0 6px 24px rgba(20, 22, 30, .06);
  --shadow-lift: 0 2px 4px rgba(20, 22, 30, .08), 0 14px 36px rgba(20, 22, 30, .10);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --read: 1.0625rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318; --surface: #1a1d24; --surface-2: #22262f; --ink: #eef0f4; --ink-2: #c5cad4; --muted: #9aa1ae;
    --line: #2c313b; --line-2: #3a404c; --brand: #8fb4e6; --brand-ink: #0d1422;
    --good-soft: #15342a; --math-soft: #1f2a4a; --phy-soft: #133330; --chem-soft: #3a2518;
    --def-soft: #16283a; --key-soft: #2a1c33; --trick-soft: #33290f; --warn-soft: #3a1c1a; --ex-soft: #11302a;
    --pyq-soft: #2b1c36; --prac-soft: #1c2533; --note-soft: #23262d;
    --def: #6aa9e0; --key: #b98ad0; --trick: #e3b04b; --warn: #e5796e; --ex: #4cc3a4; --pyq: #b98ad0; --prac: #8fb4e6; --note: #aab1bd;
    --math: #7d98ee; --phy: #3cc2b4; --chem: #f08a58;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111318; --surface: #1a1d24; --surface-2: #22262f; --ink: #eef0f4; --ink-2: #c5cad4; --muted: #9aa1ae;
  --line: #2c313b; --line-2: #3a404c; --brand: #8fb4e6; --brand-ink: #0d1422;
  --good-soft: #15342a; --math-soft: #1f2a4a; --phy-soft: #133330; --chem-soft: #3a2518;
  --def-soft: #16283a; --key-soft: #2a1c33; --trick-soft: #33290f; --warn-soft: #3a1c1a; --ex-soft: #11302a;
  --pyq-soft: #2b1c36; --prac-soft: #1c2533; --note-soft: #23262d;
  --def: #6aa9e0; --key: #b98ad0; --trick: #e3b04b; --warn: #e5796e; --ex: #4cc3a4; --pyq: #b98ad0; --prac: #8fb4e6; --note: #aab1bd;
  --math: #7d98ee; --phy: #3cc2b4; --chem: #f08a58;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--math) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- top bar */
.lx-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.lx-top-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.lx-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.01em; }
.lx-brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.lx-nav { display: flex; gap: 4px; margin-left: 12px; }
.lx-nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .93rem; }
.lx-nav a[aria-current="page"], .lx-nav a:hover { background: var(--surface-2); color: var(--ink); }
.lx-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lx-streak { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .9rem; padding: 6px 12px; border-radius: 999px; background: var(--trick-soft); color: var(--trick); }
.lx-icon-btn { border: 1px solid var(--line); background: var(--surface); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.lx-progress-bar { height: 3px; background: transparent; }
.lx-progress-bar i { display: block; height: 100%; width: 0; background: var(--good); transition: width .2s ease; }
@media (max-width: 720px) { .lx-nav { display: none; } }

/* ---------------------------------------------------------------- layout */
.lx-main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 80px; }
.lx-eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.lx-h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); line-height: 1.08; letter-spacing: -.025em; font-weight: 800; margin: 0 0 12px; }
.lx-h2 { font-size: 1.35rem; letter-spacing: -.015em; font-weight: 800; margin: 0 0 12px; }
.lx-lead { color: var(--ink-2); font-size: 1.08rem; max-width: 62ch; margin: 0; }
.lx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .15s ease; }
.lx-btn:active { transform: translateY(1px); }
.lx-btn-primary { background: var(--ink); color: var(--bg); box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 60%, #000); }
.lx-btn-good { background: var(--good); color: #fff; box-shadow: 0 3px 0 #147347; }
.lx-btn-ghost { background: var(--surface); border: 1.5px solid var(--line-2); color: var(--ink); }
.lx-btn-sm { padding: 8px 14px; border-radius: 10px; font-size: .9rem; }
.lx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }

/* ---------------------------------------------------------------- home: subjects + unit path */
.lx-home-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: end; margin-bottom: 26px; }
@media (max-width: 860px) { .lx-home-head { grid-template-columns: 1fr; } }
.lx-continue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.lx-continue-ring { flex: none; }
.lx-continue h3 { margin: 0 0 2px; font-size: 1rem; }
.lx-continue p { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
.lx-subject-tabs { display: flex; gap: 10px; margin: 0 0 22px; flex-wrap: wrap; }
.lx-subject-tab { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 800; }
.lx-subject-tab .sym { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.lx-subject-tab[aria-selected="true"] { border-color: currentColor; box-shadow: 0 3px 0 currentColor; }
.lx-subject-tab.math { color: var(--math); } .lx-subject-tab.math .sym { background: var(--math-soft); }
.lx-subject-tab.phy { color: var(--phy); } .lx-subject-tab.phy .sym { background: var(--phy-soft); }
.lx-subject-tab.chem { color: var(--chem); } .lx-subject-tab.chem .sym { background: var(--chem-soft); }
.lx-subject-tab span.t { color: var(--ink); }

.lx-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.lx-unit-card { --c: var(--math); --cs: var(--math-soft); position: relative; display: flex; flex-direction: column; gap: 10px; text-decoration: none; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 196px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.lx-unit-card.phy { --c: var(--phy); --cs: var(--phy-soft); } .lx-unit-card.chem { --c: var(--chem); --cs: var(--chem-soft); }
.lx-unit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--c); }
.lx-unit-card.soon { opacity: .72; box-shadow: none; }
.lx-unit-card.soon:hover { transform: none; border-color: var(--line); }
.lx-unit-top { display: flex; align-items: center; justify-content: space-between; }
.lx-unit-num { width: 44px; height: 44px; border-radius: 12px; background: var(--cs); color: var(--c); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.lx-unit-card h3 { margin: 0; font-size: 1.12rem; line-height: 1.25; letter-spacing: -.01em; }
.lx-unit-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.lx-unit-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.lx-meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.lx-meter i { display: block; height: 100%; background: var(--c, var(--good)); border-radius: 999px; width: 0; transition: width .5s ease; }

/* ---------------------------------------------------------------- unit page: chapter path */
.lx-unit-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); margin-bottom: 26px; position: relative; overflow: hidden; }
.lx-unit-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--math-soft); z-index: 0; }
.lx-unit-hero > * { position: relative; z-index: 1; }
.lx-crumbs { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 10px; flex-wrap: wrap; }
.lx-crumbs a { text-decoration: none; } .lx-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.lx-hero-stats { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.lx-hero-stats div { display: flex; flex-direction: column; }
.lx-hero-stats strong { font-size: 1.4rem; letter-spacing: -.02em; }
.lx-hero-stats span { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 640px) { .lx-unit-hero { grid-template-columns: 1fr; } }

.lx-chapter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.lx-chapter-head { display: flex; gap: 14px; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none; }
.lx-chapter-head::-webkit-details-marker { display: none; }
.lx-chapter-badge { width: 40px; height: 40px; border-radius: 12px; background: var(--math); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.lx-chapter-head h3 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.lx-chapter-head p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.lx-chapter-head .lx-chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
details[open] > .lx-chapter-head .lx-chev { transform: rotate(90deg); }
.lx-chapter-summary { padding: 0 18px 8px 72px; color: var(--ink-2); font-size: .92rem; margin: -6px 0 0; }
.lx-concepts { list-style: none; margin: 0; padding: 6px 18px 18px 18px; position: relative; }
.lx-concept { position: relative; padding-left: 54px; }
.lx-concept::before { content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 3px; background: var(--line); }
.lx-concept:first-child::before { top: 24px; } .lx-concept:last-child::before { bottom: calc(100% - 24px); }
.lx-concept.done::before { background: var(--good); }
.lx-concept-link { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 10px 12px; border-radius: 12px; }
.lx-concept-link:hover { background: var(--surface-2); }
.lx-node { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line-2); background: var(--surface); display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: var(--muted); z-index: 1; }
.lx-concept.done .lx-node { border-color: var(--good); background: var(--good); color: #fff; }
.lx-concept.current .lx-node { border-color: var(--math); color: var(--math); box-shadow: 0 0 0 5px var(--math-soft); }
.lx-concept-title { font-weight: 700; }
.lx-concept-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 640px) { .lx-concept-meta { display: none; } .lx-chapter-summary { padding-left: 18px; } }

/* ---------------------------------------------------------------- concept reader */
.lx-reader { display: grid; grid-template-columns: 260px minmax(0, 760px); gap: 40px; justify-content: center; }
@media (max-width: 1000px) { .lx-reader { grid-template-columns: minmax(0, 760px); } .lx-rail { display: none; } }
.lx-rail { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; padding-right: 6px; }
.lx-rail h4 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.lx-rail ol { list-style: none; margin: 0 0 18px; padding: 0; }
.lx-rail a { display: flex; gap: 8px; align-items: flex-start; text-decoration: none; padding: 6px 8px; border-radius: 8px; font-size: .88rem; color: var(--ink-2); line-height: 1.35; }
.lx-rail a:hover { background: var(--surface-2); }
.lx-rail a[aria-current="page"] { background: var(--math-soft); color: var(--ink); font-weight: 700; }
.lx-rail .dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); margin-top: 2px; }
.lx-rail .done .dot { background: var(--good); border-color: var(--good); }

.lx-concept-head { margin-bottom: 22px; }
.lx-concept-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.lx-filter { position: sticky; top: 60px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 10px 0; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.lx-filter span { font-size: .8rem; font-weight: 700; color: var(--muted); margin-right: 4px; }
.lx-filter button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: .82rem; font-weight: 700; cursor: pointer; }
.lx-filter button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.lx-prose { font-size: var(--read); line-height: 1.72; }
.lx-prose p { margin: 0 0 14px; }
.lx-prose ul, .lx-prose ol { margin: 6px 0 14px; padding-left: 1.3em; }
.lx-prose li { margin: 4px 0; }
.lx-prose ol.rd-roman { list-style: lower-roman; }
.lx-prose ol.rd-methods { list-style: none; padding-left: 0; counter-reset: m; }
.lx-prose ol.rd-methods > li { counter-increment: m; }
.lx-prose ol.rd-methods > li::before { content: "Method " counter(m) ". "; font-weight: 800; }
.lx-prose strong { font-weight: 800; }
.lx-section-heading { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; margin: 30px 0 10px; }
.rd-table-wrap { overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rd-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.rd-table td, .rd-table th { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.rd-table tr:first-child td { font-weight: 800; background: var(--surface-2); }
.rd-table tr:last-child td { border-bottom: 0; }
.rd-pyq-tag { display: inline-block; background: var(--pyq-soft); color: var(--pyq); font-weight: 800; font-size: .78rem; border-radius: 6px; padding: 1px 7px; }
.rd-diff { font-size: .7rem; font-weight: 800; padding: 1px 6px; border-radius: 5px; color: #fff; }
.rd-easy { background: var(--easy); } .rd-medium { background: var(--medium); } .rd-hard { background: var(--hard); }
.rd-inline-ans { font-weight: 800; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* lesson blocks */
.lx-block { --c: var(--note); --cs: var(--note-soft); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin: 18px 0; box-shadow: var(--shadow); overflow: hidden; }
.lx-block-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--cs); color: var(--c); font-weight: 800; font-size: .92rem; }
.lx-block-head .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--c); color: #fff; font-size: .8rem; flex: none; }
.lx-block-head .ttl { color: var(--ink); }
.lx-block-head .kind { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.lx-block-body { padding: 14px 18px 4px; }
.lx-block.definition { --c: var(--def); --cs: var(--def-soft); }
.lx-block.keyresult { --c: var(--key); --cs: var(--key-soft); }
.lx-block.trick { --c: var(--trick); --cs: var(--trick-soft); }
.lx-block.warn { --c: var(--warn); --cs: var(--warn-soft); }
.lx-block.note { --c: var(--note); --cs: var(--note-soft); }
.lx-block.definition, .lx-block.keyresult, .lx-block.trick, .lx-block.warn { border-left: 5px solid var(--c); }

.rd-figure, .lx-figure { margin: 22px 0; text-align: center; }
.rd-figure img, .lx-figure img { background: #fff; border-radius: 12px; padding: 12px; border: 1px solid var(--line); max-height: 460px; }
.rd-figure figcaption, .lx-figure figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }

/* problems */
.lx-problem { --c: var(--ex); --cs: var(--ex-soft); border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 20px 0; box-shadow: var(--shadow); overflow: hidden; }
.lx-problem.is-pyq { --c: var(--pyq); --cs: var(--pyq-soft); }
.lx-problem-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lx-problem-head .num { font-weight: 800; color: var(--c); }
.lx-problem-head .kind { font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.lx-problem-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.lx-tag-pyq { background: var(--pyq-soft); color: var(--pyq); font-weight: 800; font-size: .75rem; border-radius: 999px; padding: 3px 10px; }
.lx-tag-pattern { background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: .75rem; border-radius: 999px; padding: 3px 10px; }
.lx-diff { font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 3px 10px; color: #fff; }
.lx-diff.easy { background: var(--easy); } .lx-diff.medium { background: var(--medium); } .lx-diff.hard { background: var(--hard); }
.lx-problem-q { padding: 14px 18px 6px; }
.lx-problem-actions { display: flex; gap: 8px; align-items: center; padding: 6px 18px 16px; flex-wrap: wrap; }
.lx-solution { border-top: 1px dashed var(--line-2); background: var(--cs); padding: 14px 18px 6px; display: none; }
.lx-problem.open .lx-solution { display: block; animation: lxReveal .25s ease; }
.lx-solution-label { font-weight: 800; color: var(--c); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.lx-answer { display: inline-flex; gap: 8px; align-items: baseline; border: 2px solid var(--c); border-radius: 10px; padding: 6px 12px; margin: 0 0 14px; background: var(--surface); font-weight: 700; }
.lx-answer b { color: var(--c); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.lx-assess { display: none; gap: 8px; align-items: center; padding: 0 18px 16px; background: var(--cs); flex-wrap: wrap; }
.lx-problem.open .lx-assess { display: flex; }
.lx-assess span { font-weight: 700; font-size: .9rem; color: var(--ink-2); margin-right: 4px; }
.lx-assess button { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 800; cursor: pointer; font-size: .88rem; }
.lx-assess button[data-r="got"][aria-pressed="true"] { background: var(--good); color: #fff; border-color: var(--good); }
.lx-assess button[data-r="miss"][aria-pressed="true"] { background: var(--medium); color: #fff; border-color: var(--medium); }
.lx-problem.result-got { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.lx-problem.hidden-by-filter { display: none; }
@keyframes lxReveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* practice set */
.lx-practice { border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--prac); margin: 26px 0; overflow: hidden; box-shadow: var(--shadow); }
.lx-practice-head { background: var(--prac); color: #fff; padding: 12px 18px; display: flex; align-items: center; gap: 10px; font-weight: 800; }
.lx-practice-head small { margin-left: auto; font-weight: 700; opacity: .85; }
.lx-practice ol { margin: 0; padding: 14px 18px 6px 44px; }
.lx-practice li { margin: 0 0 12px; padding-left: 4px; }
.lx-practice-foot { padding: 0 18px 16px; }
.lx-practice-answers { display: none; background: var(--prac-soft); border-top: 1px dashed var(--line-2); padding: 14px 18px; }
.lx-practice.open .lx-practice-answers { display: block; animation: lxReveal .25s ease; }

/* end of concept */
.lx-finish { margin: 38px 0 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 22px; text-align: center; box-shadow: var(--shadow); }
.lx-finish h3 { margin: 0 0 4px; font-size: 1.25rem; }
.lx-finish p { color: var(--muted); margin: 0 0 16px; }
.lx-finish-stats { display: flex; justify-content: center; gap: 22px; margin: 0 0 16px; }
.lx-finish-stats strong { display: block; font-size: 1.5rem; }
.lx-finish-stats span { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.lx-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.lx-pager a { flex: 1; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.lx-pager a:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.lx-pager small { display: block; color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.lx-pager .next { text-align: right; }
.lx-done-burst { animation: lxPop .5s ease; }
@keyframes lxPop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

.lx-empty { text-align: center; color: var(--muted); padding: 60px 16px; }
.lx-loading { display: grid; place-items: center; min-height: 40vh; color: var(--muted); }
.lx-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; transition: all .25s; z-index: 50; pointer-events: none; }
.lx-toast.show { opacity: 1; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .lx-top, .lx-rail, .lx-filter, .lx-problem-actions, .lx-assess, .lx-pager, .lx-finish { display: none !important; } .lx-solution, .lx-practice-answers { display: block !important; } }

[hidden] { display: none !important; }
@media (max-width: 640px) {
  .lx-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lx-filter::-webkit-scrollbar { display: none; }
  .lx-filter button { flex: none; }
  .lx-main { padding-top: 18px; }
}

/* ---------------------------------------------------------------- AI tutor panel */
.lx-tutor-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--ink); color: var(--bg); font-weight: 800; box-shadow: var(--shadow-lift); cursor: pointer; }
.lx-tutor-fab .spark { color: #ffd166; }
.lx-tutor { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 60; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(0,0,0,.12); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease; }
.lx-tutor.open { transform: none; }
.lx-tutor-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lx-tutor-head h2 { margin: 0; font-size: 1rem; }
.lx-tutor-head p { margin: 0; color: var(--muted); font-size: .8rem; }
.lx-tutor-head button { margin-left: auto; }
.lx-tutor-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.lx-tutor-msg { padding: 10px 12px; border-radius: 14px; font-size: .95rem; line-height: 1.6; max-width: 94%; white-space: pre-wrap; }
.lx-tutor-msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.lx-tutor-msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.lx-tutor-msg.error { background: var(--warn-soft); color: var(--warn); }
.lx-tutor-msg a { color: var(--math); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lx-tutor-suggest { display: flex; flex-direction: column; gap: 6px; }
.lx-tutor-suggest button { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 12px; font-weight: 600; cursor: pointer; }
.lx-tutor-suggest button:hover { border-color: var(--math); }
.lx-tutor-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.lx-tutor-form textarea { flex: 1; resize: none; font: inherit; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 9px 12px; background: var(--surface); color: var(--ink); min-height: 44px; max-height: 140px; }
.lx-tutor-form textarea:focus { outline: none; border-color: var(--math); }
.lx-tutor-note { font-size: .74rem; color: var(--muted); padding: 0 16px 10px; margin: 0; }
.lx-ask-inline { border: 0; background: none; color: var(--math); font-weight: 800; font-size: .85rem; cursor: pointer; padding: 0; }
@media print { .lx-tutor, .lx-tutor-fab { display: none !important; } }

/* account button injected by /course/platform.js */
.lx-top .topbar-actions { display: flex; align-items: center; gap: 8px; }
.lx-top .ea-dashboard-link { display: none !important; }
.lx-top .ea-account-button { border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 800; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }

/* locked unit */
.lx-lock { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1.5px dashed var(--line-2); border-radius: 20px; padding: 22px; margin: 0 0 22px; }
.lx-lock-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--trick-soft); display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.lx-lock h2 { margin: 0 0 6px; font-size: 1.2rem; }
.lx-lock p { margin: 0 0 14px; color: var(--ink-2); max-width: 60ch; }
.lx-lock .lx-btn { margin-right: 8px; }

/* practice sets */
.lx-set-head { max-width: 820px; margin: 0 auto 18px; }
.lx-set-score { display: flex; gap: 10px; margin-top: 12px; }
.lx-set-score span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .88rem; color: var(--ink-2); }
.lx-set-score strong { color: var(--ink); }
.lx-set { max-width: 820px; margin: 0 auto; display: grid; gap: 14px; }
.lx-set-item .lx-problem { margin: 0; }
.lx-set-from { margin: 0 0 6px; font-size: .84rem; font-weight: 700; color: var(--muted); }
.lx-set-from a { color: var(--ink-2); }
.lx-set-note { max-width: 820px; margin: 14px auto; color: var(--muted); }
.lx-set ~ .lx-finish { max-width: 820px; margin: 22px auto 0; }

/* days-to-go chip */
.lx-days { font-weight: 800; font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: var(--math-soft); color: var(--math); text-decoration: none; white-space: nowrap; }
.lx-streak, .lx-days { white-space: nowrap; }
@media (max-width: 900px) { .lx-days:not([hidden]) + .lx-streak { display: none; } }
@media (max-width: 560px) {
  .lx-brand > span:last-child { display: none; }
  .lx-days { font-size: .74rem; padding: 5px 9px; }
  .lx-top-in { gap: 8px; }
}

/* Today's free concepts */
.lx-today { margin: 0 0 26px; }
.lx-today-head { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.lx-today-head .lx-h2 { margin: 0; }
.lx-today-head p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; min-width: 260px; }
.lx-today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .lx-today-grid { grid-template-columns: 1fr; } }
.lx-today-card { --c: var(--math); --cs: var(--math-soft); display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; background: var(--surface); border: 1.5px solid var(--line); border-top: 5px solid var(--c); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.lx-today-card.phy { --c: var(--phy); --cs: var(--phy-soft); } .lx-today-card.chem { --c: var(--chem); --cs: var(--chem-soft); }
.lx-today-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.lx-today-subj { align-self: flex-start; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--c); background: var(--cs); border-radius: 999px; padding: 3px 10px; }
.lx-today-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.lx-today-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.lx-today-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.lx-today-go { margin-top: auto; font-weight: 800; color: var(--c); }
.lx-chip-free { background: var(--trick-soft) !important; color: var(--trick) !important; }
.lx-free-today { background: var(--trick-soft); border: 1.5px solid color-mix(in srgb, var(--trick) 35%, transparent); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; }
.lx-free-today a { font-weight: 700; }

/* Report a problem (Learn and tests) */
.lx-report, .dt-report { background: none; border: 0; padding: 4px 8px; border-radius: 8px; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.lx-report:hover, .dt-report:hover, .lx-report:focus-visible, .dt-report:focus-visible { color: var(--warn); background: var(--warn-soft); }
.rp-dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(460px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
.rp-dialog::backdrop { background: rgba(10, 12, 18, .45); }
.rp-form { display: grid; gap: 12px; padding: 20px; }
.rp-form h2 { margin: 0; font-size: 1.2rem; }
.rp-form p { margin: 0; color: var(--ink-2); }
.rp-what { font-size: .88rem; color: var(--muted) !important; }
.rp-form fieldset { border: 1.5px solid var(--line); border-radius: 12px; margin: 0; padding: 10px 12px; display: grid; gap: 6px; }
.rp-form legend { font-weight: 800; font-size: .85rem; padding: 0 4px; }
.rp-form fieldset label { display: flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }
.rp-form input[type="radio"] { width: 16px; height: 16px; accent-color: var(--math); }
.rp-details { display: grid; gap: 6px; font-weight: 700; font-size: .85rem; }
.rp-details textarea { font: inherit; font-weight: 400; font-size: .92rem; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 8px 10px; background: var(--surface); color: var(--ink); resize: vertical; }
.rp-details textarea:focus { outline: none; border-color: var(--math); }
.rp-error { color: var(--bad) !important; font-weight: 700; font-size: .88rem; }
.rp-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Tutor: questions left */
.lx-tutor-usage { font-size: .74rem; font-weight: 700; color: var(--muted); padding: 0 16px 8px; margin: 0; }
.lx-tutor-usage.low { color: var(--warn); }
.lx-tutor-msg.limit { background: var(--trick-soft); color: var(--ink); }
/* Recent questions from other pages: dimmed, under a small label with the page and when */
.lx-tutor-msg.earlier { opacity: .72; }
.lx-tutor-when { margin: 6px 0 -2px; font-size: .72rem; font-weight: 700; color: var(--muted); text-align: center; }
.lx-tutor-suggest .lx-tutor-when { margin: 4px 0 2px; }
.lx-tutor-head .lx-tutor-clear { margin-left: auto; border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 700; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.lx-tutor-head .lx-tutor-clear:hover { color: var(--ink); background: var(--surface-2); }
.lx-tutor-head .lx-tutor-clear:not([hidden]) + button { margin-left: 4px; }

/* Lesson video at the top of a concept page (poster first; the video loads on play) */
.lx-video-slot { margin: 6px 0 22px; }
.lx-video-poster { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); cursor: pointer; aspect-ratio: 16 / 9; }
.lx-video-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lx-video-poster .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(21, 23, 28, .78); color: #fff; font-size: 30px; padding-left: 6px; box-sizing: border-box; }
.lx-video-poster .lbl { position: absolute; left: 12px; bottom: 12px; background: rgba(21, 23, 28, .82); color: #fff; font-weight: 700; font-size: .9rem; border-radius: 999px; padding: 6px 12px; }
.lx-video-poster:hover .play { background: var(--accent); }
.lx-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; }
.lx-video-note { margin: 8px 2px 0; font-size: .8rem; color: var(--muted); }
