.tm-chapter-five-lesson {
  color: #071833;
  font-size: clamp(18px, 1.75vw, 25px);
  line-height: 1.85;
}

.tm-chapter-five-lesson,
.tm-chapter-five-lesson * {
  box-sizing: border-box;
}

.tm-ch5-chapter-intro,
.tm-ch5-lesson-banner {
  overflow: hidden;
  margin: 0 0 clamp(24px, 4vw, 48px);
  padding: clamp(24px, 4.5vw, 56px);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: clamp(26px, 4vw, 44px);
  background:
    radial-gradient(circle at 10% 0%, rgba(249, 115, 22, 0.18), transparent 34%),
    radial-gradient(circle at 88% 20%, rgba(236, 72, 153, 0.15), transparent 36%),
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.98) 55%, rgba(240, 253, 244, 0.9));
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
}

.tm-ch5-chapter-intro span,
.tm-ch5-lesson-banner span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 18px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.13);
  color: #0f8f98;
  font-size: 0.72em;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tm-ch5-chapter-intro h2,
.tm-ch5-lesson-banner h2 {
  margin: 0;
  color: #082567;
  font-size: clamp(32px, 5.8vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.tm-ch5-chapter-intro p,
.tm-ch5-lesson-banner p {
  max-width: 820px;
  margin: 22px 0 0;
  color: #516178;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.65;
}

.tm-ch5-container {
  width: min(100%, 1120px);
  max-width: 100%;
  margin: 0 auto;
}

.tm-chapter-five-lesson .question-block,
.tm-chapter-five-lesson .problem-block {
  position: relative;
  display: flex;
  gap: clamp(16px, 2.8vw, 34px);
  align-items: flex-start;
  width: 100%;
  margin: clamp(18px, 3.2vw, 36px) 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(20, 184, 166, 0.12);
  border-radius: clamp(20px, 3vw, 32px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    radial-gradient(circle at 0% 0%, rgba(249, 115, 22, 0.09), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(236, 72, 153, 0.08), transparent 32%);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.06);
}

.tm-chapter-five-lesson .problem-block {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.tm-chapter-five-lesson .q-number {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45em;
  height: 2.45em;
  padding: 0 0.45em;
  border-radius: 18px;
  background: linear-gradient(135deg, #0b54bd, #6d5df6);
  color: #ffffff;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.tm-chapter-five-lesson .q-content,
.tm-chapter-five-lesson .text-section {
  flex: 1 1 auto;
  min-width: 0;
}

.tm-chapter-five-lesson .text-section > div:first-child {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 2vw, 24px);
}

.tm-chapter-five-lesson .text-section > div:first-child > .q-number {
  margin-top: 0.08em;
}

.tm-chapter-five-lesson .problem-block .text-section > div:first-child {
  position: relative;
  display: block;
  min-height: 2.45em;
  padding-left: calc(2.45em + clamp(14px, 2vw, 24px));
  font-size: clamp(18px, 1.7vw, 25px);
  line-height: 1.75;
}

.tm-chapter-five-lesson .problem-block .text-section > div:first-child > .q-number {
  position: absolute;
  top: 0.08em;
  left: 0;
  margin-top: 0;
}

.tm-chapter-five-lesson .text-section > .sub-questions,
.tm-chapter-five-lesson .text-section > .sub-questions-1,
.tm-chapter-five-lesson .text-section > .sub-questions-2,
.tm-chapter-five-lesson .text-section > .sub-questions-3,
.tm-chapter-five-lesson .text-section > .sub-questions-list {
  width: auto;
  margin-left: calc(2.45em + clamp(14px, 2vw, 24px));
}

.tm-chapter-five-lesson .problem-block .text-section > .sub-questions,
.tm-chapter-five-lesson .problem-block .text-section > .sub-questions-1,
.tm-chapter-five-lesson .problem-block .text-section > .sub-questions-2,
.tm-chapter-five-lesson .problem-block .text-section > .sub-questions-3,
.tm-chapter-five-lesson .problem-block .text-section > .sub-questions-list {
  margin-left: calc(2.45em + clamp(14px, 2vw, 24px));
}

.tm-chapter-five-lesson .challenge-title,
.tm-chapter-five-lesson .bold-text {
  color: #0b54bd;
  font-weight: 850;
}

.tm-chapter-five-lesson .sub-questions,
.tm-chapter-five-lesson .sub-questions-1,
.tm-chapter-five-lesson .sub-questions-2,
.tm-chapter-five-lesson .sub-questions-3,
.tm-chapter-five-lesson .sub-questions-list {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: 1fr !important;
  gap: clamp(12px, 1.8vw, 20px);
  align-items: start;
  width: 100%;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.tm-chapter-five-lesson .sub-q-item,
.tm-chapter-five-lesson .sub-questions-list > div,
.tm-chapter-five-lesson .sub-questions-list > li {
  display: flex !important;
  flex-direction: row !important;
  gap: clamp(12px, 1.8vw, 22px);
  align-items: baseline;
  min-width: 0;
  width: 100% !important;
  padding: clamp(13px, 1.8vw, 18px) clamp(16px, 2.2vw, 24px);
  border: 1px solid rgba(8, 37, 103, 0.08);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.78);
}

.tm-chapter-five-lesson .sub-q-label {
  flex: 0 0 2.3em;
  display: inline-flex;
  justify-content: center;
  min-width: 2.3em;
  margin-right: 0;
  color: #0b54bd;
  font-weight: 900;
}

.tm-chapter-five-lesson .svg-container,
.tm-chapter-five-lesson .svg-section {
  width: 100%;
  max-width: 100%;
  margin: clamp(14px, 2.8vw, 30px) auto;
  padding: clamp(18px, 2.4vw, 30px);
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(8, 37, 103, 0.08);
  border-radius: clamp(18px, 2.5vw, 28px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.tm-chapter-five-lesson .svg-container svg,
.tm-chapter-five-lesson .svg-section svg {
  display: block;
  width: min(100%, 760px);
  min-width: min(100%, 320px);
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.tm-chapter-five-lesson .svg-container svg path[stroke],
.tm-chapter-five-lesson .svg-section svg path[stroke],
.tm-chapter-five-lesson .svg-container svg polyline[stroke],
.tm-chapter-five-lesson .svg-section svg polyline[stroke] {
  vector-effect: non-scaling-stroke;
}

.tm-chapter-five-lesson .tm-explicit-grid line {
  shape-rendering: crispEdges;
}

.tm-chapter-five-lesson .tm-grid-02 line {
  vector-effect: non-scaling-stroke;
}

.tm-chapter-five-lesson .problem-block .svg-section svg {
  width: min(100%, 720px);
}

.tm-chapter-five-lesson table {
  width: 100%;
  border-collapse: collapse;
}

.tm-chapter-five-lesson mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.08em;
}

.tm-chapter-five-lesson svg text {
  font-family: inherit;
}

.tm-chapter-five-lesson .axis-label,
.tm-chapter-five-lesson .equation-label {
  font-weight: 750;
}

@media (max-width: 920px) {
  .tm-chapter-five-lesson .problem-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .tm-chapter-five-lesson {
    font-size: 18px;
  }

  .tm-chapter-five-lesson .question-block,
  .tm-chapter-five-lesson .problem-block {
    flex-direction: column;
    padding: 18px;
  }

  .tm-chapter-five-lesson .sub-q-item,
  .tm-chapter-five-lesson .sub-questions-list > div,
  .tm-chapter-five-lesson .sub-questions-list > li {
    gap: 10px;
    padding: 13px 14px;
  }

  .tm-chapter-five-lesson .text-section > .sub-questions,
  .tm-chapter-five-lesson .text-section > .sub-questions-1,
  .tm-chapter-five-lesson .text-section > .sub-questions-2,
  .tm-chapter-five-lesson .text-section > .sub-questions-3,
  .tm-chapter-five-lesson .text-section > .sub-questions-list {
    margin-left: 0;
  }

  .tm-chapter-five-lesson .problem-block .text-section > div:first-child {
    padding-left: 0;
  }

  .tm-chapter-five-lesson .problem-block .text-section > div:first-child > .q-number {
    position: static;
    margin: 0 0 14px;
  }

  .tm-chapter-five-lesson .svg-container,
  .tm-chapter-five-lesson .svg-section {
    margin-inline: -4px;
  }
}
