.lesson-shell {
  width: min(100% - 32px, 1120px);
}

.lesson-hero {
  margin-top: 34px;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid rgba(123, 135, 255, 0.42);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(123, 135, 255, 0.13), rgba(19, 23, 32, 0.97)), #131720;
}

.lesson-hero .eyebrow {
  margin-top: 0;
}

.lesson-hero h1 {
  max-width: 980px;
  font-size: clamp(2.5rem, 6.2vw, 5.4rem);
}

.lesson-hero .lede {
  max-width: 820px;
}

.lesson-hero-news {
  border-color: rgba(66, 211, 146, 0.42);
  background:
    radial-gradient(circle at 88% 12%, rgba(66, 211, 146, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(123, 135, 255, 0.1), rgba(19, 23, 32, 0.97)), #131720;
}

.lesson-hero-buybacks {
  border-color: rgba(241, 184, 106, 0.48);
  background:
    radial-gradient(circle at 88% 12%, rgba(241, 184, 106, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(123, 135, 255, 0.1), rgba(19, 23, 32, 0.97)), #131720;
}

.lesson-hero-research {
  border-color: rgba(79, 195, 247, 0.48);
  background:
    radial-gradient(circle at 88% 12%, rgba(79, 195, 247, 0.17), transparent 34%),
    linear-gradient(145deg, rgba(123, 135, 255, 0.1), rgba(19, 23, 32, 0.97)), #131720;
}

.lesson-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid #252b38;
  border-radius: 12px;
  background: rgba(11, 13, 18, 0.5);
}

.lesson-meta span {
  padding: 13px 15px;
  color: #a5adbd;
  font-size: 0.78rem;
}

.lesson-meta span + span {
  border-left: 1px solid #252b38;
}

.lesson-meta strong {
  display: block;
  margin-bottom: 2px;
  color: #747e91;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-body > section {
  padding: clamp(24px, 4vw, 42px);
}

.lesson-body h2 {
  margin: 4px 0 16px;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.lesson-body h3 {
  margin: 28px 0 8px;
  color: #f4f5f8;
  font-size: 1.12rem;
}

.lesson-body p,
.lesson-body li {
  font-size: 0.98rem;
  line-height: 1.75;
}

.lesson-body strong {
  color: #f4f5f8;
}

.lesson-label {
  display: block;
  color: #7b87ff;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.short-answer {
  border-color: rgba(66, 211, 146, 0.42);
  background: linear-gradient(145deg, rgba(66, 211, 146, 0.08), rgba(19, 23, 32, 0.98));
}

.source-ladder,
.formula-grid,
.mistake-grid,
.next-grid,
.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.source-ladder article,
.formula-grid article,
.mistake-grid article,
.example-grid article {
  padding: 18px;
  border: 1px solid #252b38;
  border-radius: 11px;
  background: #10131a;
}

.source-ladder article p,
.formula-grid article p,
.mistake-grid article p,
.example-grid article p {
  margin: 7px 0 0;
  font-size: 0.84rem;
  line-height: 1.6;
}

.example-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.example-grid article {
  display: flex;
  flex-direction: column;
}

.example-grid h3 {
  margin-top: 10px;
  font-size: 1.02rem;
}

.example-grid a {
  margin-top: auto;
  padding-top: 12px;
}

.example-ticker {
  color: #f1b86a;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filing-example-grid {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.filing-example {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid #252b38;
  border-radius: 14px;
  background: #10131a;
}

.filing-example > header {
  display: flex;
  gap: 14px;
  align-items: center;
}

.filing-example > header .example-ticker {
  display: grid;
  min-width: 54px;
  min-height: 54px;
  place-items: center;
  border: 1px solid rgba(241, 184, 106, 0.4);
  border-radius: 12px;
  background: rgba(241, 184, 106, 0.08);
}

.filing-example > header h3,
.filing-example > header p {
  margin: 0;
}

.filing-example > header p {
  color: #747e91;
  font-size: 0.78rem;
}

.filing-example .formula-grid code {
  color: #f4f5f8;
  font-weight: 800;
}

.example-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.example-links a {
  min-height: 44px;
  align-content: center;
  padding: 9px 12px;
  border: 1px solid #252b38;
  border-radius: 8px;
  background: #0b0d12;
  text-decoration: none;
}

.example-links a:hover {
  border-color: rgba(123, 135, 255, 0.65);
}

.evidence-question {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid rgba(79, 195, 247, 0.28);
  border-radius: 11px;
  background: rgba(79, 195, 247, 0.06);
}

.evidence-question > span {
  color: #8bd9fb;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evidence-question p {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.6;
}

.lens-block {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  padding: 28px 0;
  border-top: 1px solid #252b38;
}

.lens-block:last-child {
  padding-bottom: 0;
}

.lens-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(123, 135, 255, 0.45);
  border-radius: 13px;
  background: rgba(123, 135, 255, 0.1);
  color: #bec4ff;
  font-size: 0.75rem;
  font-weight: 850;
}

.lens-block h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.formula-panel code {
  display: block;
  margin-top: 9px;
  color: #d9ddff;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.lesson-table-wrap {
  max-width: 100%;
  margin-top: 20px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.lesson-table-wrap:focus-visible {
  outline: 3px solid rgba(123, 135, 255, 0.72);
  outline-offset: 4px;
}

.worked-table,
.worksheet-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

.buyback-table {
  min-width: 1220px;
}

.buyback-worksheet {
  min-width: 940px;
}

.research-worksheet {
  min-width: 1480px;
}

.research-example-grid article ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.research-example-grid article li {
  font-size: 0.82rem;
  line-height: 1.55;
}

.buyback-example-grid {
  grid-template-columns: 1fr;
}

.worked-table th,
.worked-table td,
.worksheet-table th,
.worksheet-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #252b38;
  text-align: right;
  vertical-align: top;
}

.news-worksheet {
  min-width: 760px;
}

.news-worksheet th:first-child {
  width: 150px;
}

.worked-table thead th,
.worksheet-table thead th {
  color: #747e91;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.worked-table th:first-child,
.worked-table td:first-child,
.worksheet-table th,
.worksheet-table td {
  text-align: left;
}

.worked-table tbody th a {
  color: #f4f5f8;
  text-decoration: none;
}

.worked-table small {
  display: block;
  margin-top: 3px;
  color: #747e91;
  font-size: 0.68rem;
}

.worked-table td {
  color: #f4f5f8;
  font-size: 0.82rem;
  font-weight: 700;
}

.worksheet-panel {
  border-color: rgba(123, 135, 255, 0.45);
}

.worksheet-table th:first-child {
  width: 100px;
  color: #f4f5f8;
}

.worksheet-table td {
  color: #a5adbd;
  font-size: 0.8rem;
  line-height: 1.55;
}

.print-note {
  margin-top: 18px;
  padding: 14px;
  border-left: 3px solid #7b87ff;
  background: #10131a;
  font-size: 0.84rem !important;
}

.tree-steps,
.review-checklist {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: lesson-step;
}

.tree-steps li,
.review-checklist li {
  position: relative;
  min-height: 68px;
  padding: 17px 17px 17px 58px;
  border-top: 1px solid #252b38;
  counter-increment: lesson-step;
}

.tree-steps li::before,
.review-checklist li::before {
  position: absolute;
  top: 16px;
  left: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: rgba(123, 135, 255, 0.12);
  color: #aeb6ff;
  content: counter(lesson-step, decimal-leading-zero);
  font-size: 0.65rem;
  font-weight: 850;
}

.tree-steps span {
  display: block;
  margin-top: 4px;
  color: #a5adbd;
  font-size: 0.88rem;
  line-height: 1.55;
}

.review-checklist li {
  color: #a5adbd;
}

.practice-panel {
  border-color: rgba(241, 184, 106, 0.42);
  background: rgba(241, 184, 106, 0.06);
}

.lesson-faq details {
  border-top: 1px solid #252b38;
}

.lesson-faq summary {
  min-height: 58px;
  align-content: center;
  color: #f4f5f8;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 750;
}

.lesson-faq details p {
  max-width: 880px;
  margin: 0 0 18px;
}

.next-grid a {
  display: block;
  min-height: 118px;
  padding: 18px;
  border: 1px solid #252b38;
  border-radius: 11px;
  background: #10131a;
  color: inherit;
  text-decoration: none;
}

.next-grid a:hover {
  border-color: rgba(123, 135, 255, 0.65);
}

.next-grid span {
  display: block;
  margin-top: 7px;
  color: #a5adbd;
  font-size: 0.82rem;
  line-height: 1.55;
}

.lesson-disclaimer {
  border-style: dashed !important;
  background: transparent !important;
}

.lesson-disclaimer p {
  margin: 0;
  color: #747e91;
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .lesson-hero {
    padding: 24px 20px;
  }

  .lesson-meta,
  .source-ladder,
  .formula-grid,
  .mistake-grid,
  .next-grid,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .lesson-meta span + span {
    border-top: 1px solid #252b38;
    border-left: 0;
  }

  .lens-block {
    grid-template-columns: 1fr;
  }

  .lesson-body p,
  .lesson-body li {
    font-size: 0.92rem;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }

  .back-link,
  .breadcrumbs,
  .page-nav,
  .lesson-hero,
  .lesson-body > section:not(.worksheet-panel),
  .privacy-choices {
    display: none !important;
  }

  .lesson-shell,
  .lesson-body,
  .worksheet-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    color: #000;
    background: #fff;
  }

  .worksheet-table th,
  .worksheet-table td,
  .worksheet-table thead th,
  .worksheet-panel h2,
  .worksheet-panel p,
  .lesson-label {
    color: #000;
  }

  .research-worksheet {
    min-width: 0;
    table-layout: fixed;
  }

  .research-worksheet th,
  .research-worksheet td,
  .research-worksheet thead th {
    padding: 4px;
    font-size: 6.5pt;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
}
