/* ---- learn: topic pages (.u1.lt) and question pages (.lq) ---- */
.lt-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* breadcrumb */
.lt-crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 14px; color: var(--muted); }
.lt-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.lt-crumbs li + li::before { content: "›"; margin: 0 8px; color: #8A98A3; }
.lt-crumbs a { color: var(--accent-dark); text-decoration: none; }
.lt-crumbs a:hover { text-decoration: underline; }
.lt-crumbs [aria-current] { color: var(--text); overflow-wrap: anywhere; }

/* hero */
.u1 .lt-hero { padding: 48px 0 44px; }
.u1 .lt-hero .wrap { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); align-items: start; gap: 48px; }
.u1 .lt-hero h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -0.03em; margin: 6px 0 12px; overflow-wrap: break-word; }
.u1 .lt-hero h1 .lt-code, .lt-code { font-family: var(--mono); font-weight: 500; color: var(--accent); letter-spacing: 0; font-size: 0.62em; vertical-align: 0.18em; margin-right: 0.2em; }
.lt-sub { font-size: 17px; color: var(--muted); }
.lt-fresh { font-size: 14px; color: var(--muted); margin-top: 6px; }
.lt-answer { margin-top: 24px; background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 16px; padding: 20px 24px; box-shadow: 0 10px 30px -18px rgba(14, 27, 42, 0.35); }
.lt-answer p { font-size: 18px; line-height: 1.6; color: var(--ink); }
.lt-answer p + p { margin-top: 10px; }
.lt-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.u1 .lt-hero .actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.lt-keys { background: var(--ink); color: var(--on-dark); border-radius: 24px; padding: 26px 26px 22px; }
.lt-keys h2 { color: #fff; font-size: 22px; margin-bottom: 12px; }
.lt-keys ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.lt-keys li { position: relative; padding-left: 26px; font-size: 16px; line-height: 1.5; color: var(--on-dark); }
.lt-keys li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.lt-keys .katex { color: #fff; }

/* sections after the lesson */
.u1.lt .chapter { padding-top: 80px; }
.u1.lt .lt-extra { padding: 64px 0 48px; }
.lt-head { margin-bottom: 28px; }
.lt-head h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.08; letter-spacing: -0.02em; margin-top: 6px; }
.lt-extra .stepper { max-width: 820px; }
.stepper li.lt-final { background: #E3F0EC; color: var(--u-ink, #0E1B2A); }
.lt-mistake { max-width: 820px; border-radius: 18px; padding: 20px 24px; background: #FDF1EF; color: #7A231F; font-size: 17px; }
.lt-mistake b { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.lt-mistake p { color: #7A231F; }
.lt-faq { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.lt-faq .ans p + p { margin-top: 8px; }

/* video */
.lt-video { position: relative; max-width: 860px; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #0E1B2A; }
.lt-video iframe, .lt-video-btn, .lt-video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lt-video img { object-fit: cover; }
.lt-video.is-vertical { aspect-ratio: 9 / 16; max-width: 340px; }
/* a video placed under a lesson block */
.concept-video-wrap { min-width: 0; }
.concept-video { margin: -40px 0 72px; }
.concept-video .lt-video { margin: 0 auto; box-shadow: 0 18px 40px rgba(14, 27, 42, 0.14); }
.lt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform 0.2s; }
.lt-video-btn:hover .lt-play, .lt-video-btn:focus-visible .lt-play { transform: translate(-50%, -50%) scale(1.1); }
.lt-transcript { max-width: 860px; margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; background: var(--white); }
.lt-transcript summary { cursor: pointer; font-weight: 600; }
.lt-transcript div { margin-top: 10px; max-height: 420px; overflow-y: auto; }

/* question lists */
.lt-qlist { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.lt-qlist a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--text); text-decoration: none; line-height: 1.45; }
.lt-qlist a:hover, .lt-qlist a:focus-visible { border-color: var(--accent); background: #F7FBFA; }
.lt-qnum { font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 2px; }
.lt-qtext { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lt-go { color: var(--accent); }
.lt-glossary { margin-top: 36px; }
.lt-glossary h3 { font-size: 18px; margin-bottom: 10px; }
.lt-glossary ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lt-glossary a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--tint); color: var(--accent-dark); text-decoration: none; font-size: 14px; }
.lt-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; max-width: 900px; }
.lt-pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--white); min-width: 0; }
.lt-pager a:hover { border-color: var(--accent); }
.lt-pager small { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lt-pager span { font-weight: 600; overflow-wrap: anywhere; }
.lt-next { text-align: right; grid-column: 2; }

/* topic list on the unit page */
.u1-topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.u1-topics a { display: flex; gap: 12px; align-items: baseline; height: 100%; padding: 16px 18px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; }
.u1-topics a:hover, .u1-topics a:focus-visible { border-color: var(--accent); background: #F7FBFA; }
.u1-topics .lt-code { font-size: 13px; vertical-align: 0; flex: none; }

/* question page */
.lq { max-width: 860px; }
.lq-top { margin-bottom: 22px; }
.lq h1 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.12; margin-top: 6px; overflow-wrap: break-word; }
.lq-of { color: var(--muted); font-weight: 500; }
.lq-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.lq-stem { font-size: 20px; line-height: 1.5; font-weight: 600; color: var(--ink); padding: 0; margin-bottom: 16px; max-width: 100%; white-space: normal; }
.lq-choices { display: flex; flex-direction: column; gap: 10px; }
.lq-choice { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--white); line-height: 1.45; }
.lq-choice:hover { border-color: #7B8C97; }
.lq-choice:has(input:checked) { border-color: var(--accent); background: #F7FBFA; }
.lq-choice:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.lq-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.lq-letter { font-family: var(--mono); font-weight: 500; color: var(--muted); }
.lq-text { min-width: 0; overflow-wrap: anywhere; }
.lq-choice.right { border-color: var(--accent); background: var(--tint); }
.lq-choice.wrong { border-color: var(--error); background: #FBE9E7; }
.lq-choice input:disabled { cursor: default; }
.lq-actions { display: flex; gap: 12px; margin-top: 6px; }
.lq-feedback { padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.lq-feedback.ok { background: var(--tint); color: var(--accent-dark); }
.lq-feedback.no { background: #FBE9E7; color: var(--error); }
.lq-answer { margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); padding: 14px 20px; }
.lq-answer summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); }
.lq-answer-body { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.lq-answer-body h2 { font-size: 18px; font-family: var(--body); font-weight: 700; }
.lq-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.lq .katex { font-size: 1.05em; }
.lq .katex-display { overflow-x: auto; overflow-y: hidden; }
.lq-group { margin-top: 36px; }
.lq-group-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
.lq-group-head h2 { font-size: 22px; }
.lq-group-links { font-size: 14px; }

@media (max-width: 900px) {
  .u1 .lt-hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 600px) {
  .u1 .lt-hero { padding: 28px 0 32px; }
  .lt-answer { padding: 16px 18px; }
  .lt-answer p { font-size: 17px; }
  .u1.lt .chapter { padding-top: 56px; }
  .u1.lt .lt-extra { padding: 44px 0 32px; }
  .lt-pager { grid-template-columns: 1fr; }
  .lt-next { grid-column: 1; }
  .lq-stem { font-size: 18px; }
  .lq-choice { padding: 10px 12px; gap: 10px; }
}

/* ---- study guide: book notes on topic pages and the study-guide pages (.bk) ---- */
.bk-body { max-width: 860px; font-size: 17px; line-height: 1.65; color: var(--text); }
.bk-body > * + * { margin-top: 14px; }
.bk-body h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; margin-top: 40px; }
.bk-body h3 { font-size: 22px; line-height: 1.25; margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); }
.bk-body h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.bk-body h4 { font-size: 18px; margin-top: 26px; }
.bk-body ul, .bk-body ol { padding-left: 1.4em; }
.bk-body li + li { margin-top: 6px; }
.bk-body li > p + p { margin-top: 6px; }
.bk-body strong { color: var(--ink); }
.bk-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.bk-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.bk-body th, .bk-body td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; vertical-align: top; }
.bk-body th { background: #F2F6F5; font-weight: 600; }
.bk-body tr:nth-child(even) td { background: #FAFCFB; }
.bk-frq { border: 1px solid var(--line); border-radius: 16px; background: var(--white); padding: 18px 22px; }
.bk-frq + .bk-frq { margin-top: 18px; }
.bk-frq > * + * { margin-top: 12px; }
.bk-sol { border-top: 1px dashed var(--line); padding-top: 12px; }
.bk-sol > summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.bk-sol > summary::-webkit-details-marker { display: none; }
.bk-sol > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 15px; line-height: 1; }
.bk-sol[open] > summary::before { content: "−"; }
.bk-sol > * + * { margin-top: 12px; }
.bk-sol[open] { background: #F7FBFA; margin: 4px -22px -18px; padding: 12px 22px 18px; border-radius: 0 0 16px 16px; }
.bk-tip, .bk-more { max-width: 860px; color: var(--muted); font-size: 15px; }
.bk-tip { margin: -12px 0 20px; }
.bk-more { margin-top: 28px; }

/* study-guide pages */
.bk-page .lq-top { margin-bottom: 8px; }
.bk-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; padding: 0; list-style: none; }
.bk-toc a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--text); text-decoration: none; font-size: 14px; }
.bk-toc a:hover, .bk-toc a:focus-visible { border-color: var(--accent); }
.bk-part { padding-top: 48px; scroll-margin-top: 80px; }
.bk-part > h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 18px; }
.bk-topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; max-width: 1000px; }
.bk-topics a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--text); text-decoration: none; }
.bk-topics a:hover, .bk-topics a:focus-visible { border-color: var(--accent); background: #F7FBFA; }
.bk-topics b { display: block; font-weight: 600; line-height: 1.35; }
.bk-topics span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.bk-key { margin-top: 22px; }
.bk-key > summary { cursor: pointer; font-weight: 600; font-size: 18px; color: var(--accent-dark); min-height: 44px; display: flex; align-items: center; }
.bk-key > div { margin-top: 12px; }
.bk-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.bk-unit { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); color: var(--text); text-decoration: none; }
.bk-unit:hover, .bk-unit:focus-visible { border-color: var(--accent); }
.bk-unit small { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.bk-unit b { font-size: 19px; line-height: 1.25; }
.bk-unit span { font-size: 14px; color: var(--muted); }
.bk-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; max-width: 1000px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .bk-body { font-size: 16px; }
  .bk-frq { padding: 14px 16px; }
  .bk-sol[open] { margin: 4px -16px -14px; padding: 12px 16px 14px; }
}
.lq-stem { white-space: pre-line; }

/* unit page: the full review video near the top */
.unit-video { padding-top: 56px; padding-bottom: 56px; }
.unit-video-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.unit-video-text h2 { margin: 8px 0 12px; }
.unit-video-text p { color: var(--muted, #4A5966); }
.unit-video .lt-video { max-width: none; box-shadow: 0 18px 40px rgba(14, 27, 42, 0.14); }
@media (max-width: 860px) { .unit-video-grid { grid-template-columns: 1fr; gap: 22px; } }
.lt-teach { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
