* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f9fc;
  color: #1b1b1b;
}

.page {
  width: min(1100px, 94%);
  margin: 24px auto 40px;
}

.content-card {
  border: 1px solid #2f80ed;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.exercise-card {
  border-color: #4a90e2;
}

.card-header {
  background: #2f4d78;
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
}

.card-body {
  padding: 18px 18px 20px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.worked-question,
.worked-solution {
  grid-column: 1;
}

.worked-diagram {
  grid-column: 2;
  grid-row: 1 / span 2;
}

p {
  margin: 0 0 14px;
  line-height: 1.6;
  font-size: 20px;
}

.pill {
  display: inline-block;
  background: #29a7e8;
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  margin: 8px 0 14px;
  font-size: 18px;
}

.formula {
  font-family: "Times New Roman", serif;
  font-size: 33px;
  text-align: center;
  margin: 14px 0;
}

.answer {
  color: #163d75;
  font-weight: 700;
}

.exercise-title-wrap {
  margin: 24px 0 10px;
}

.exercise-title-wrap h2 {
  color: #2159c8;
  font-size: 30px;
  margin: 0;
}

.diagram-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.diagram {
  display: block;
  width: min(100%, 360px);
  height: auto;
  border: 1px dashed #c8d0db;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

.toggle-btn {
  background: #356ae6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  margin-top: 6px;
  font-size: 16px;
}

.toggle-btn:hover {
  background: #2957bc;
}

.hidden-answer {
  display: none;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #d7dfea;
}

.hidden-answer.show {
  display: block;
}

/* SVG styles */
.ground {
  fill: #c89a56;
  stroke: #a17235;
  stroke-width: 1;
}

.block-blue {
  fill: #8fd0ff;
  stroke: #1992e6;
  stroke-width: 2;
}

.block-pink {
  fill: #ffd0c2;
  stroke: #ff6b57;
  stroke-width: 2;
}

.block-yellow {
  fill: #fff49a;
  stroke: #00a0ff;
  stroke-width: 2;
}

.slope {
  fill: #fff3a2;
  stroke: #ff8c42;
  stroke-width: 2;
}

.slope-blue {
  fill: #b6e5ff;
  stroke: #1b9cff;
  stroke-width: 2;
}

.force-red {
  stroke: #ff2b2b;
  stroke-width: 2.4;
}

.force-blue {
  stroke: #0c8df0;
  stroke-width: 2.4;
}

.arrow-red {
  fill: #ff2b2b;
}

.arrow-blue {
  fill: #0c8df0;
}

.dashed {
  stroke: #ff2b2b;
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
}

.angle-arc {
  fill: none;
  stroke: #ff7a00;
  stroke-width: 1.8;
}

.label {
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  fill: #111;
}

.topic-html-content .momentum-worked-examples-page .content-card {
  border: 1px solid #2f80ed;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.topic-html-content .momentum-worked-examples-page .exercise-card {
  border-color: #4a90e2;
}

.topic-html-content .momentum-worked-examples-page .card-header {
  background: #2f4d78;
  color: #fff;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
}

.topic-html-content .momentum-worked-examples-page .card-body {
  padding: 12px 14px 14px;
}

.topic-html-content .momentum-worked-examples-page .two-col {
  gap: 14px;
}

.topic-html-content .momentum-worked-examples-page .worked-diagram {
  grid-row: 1;
}

.topic-html-content .momentum-worked-examples-page p,
.topic-html-content .momentum-worked-examples-page li {
  margin: 0 0 10px;
  line-height: 1.45;
  font-size: 18px;
  color: #1b1b1b;
}

.topic-html-content .momentum-worked-examples-page .toggle-btn {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 15px;
}

.topic-html-content .momentum-worked-examples-page .hidden-answer {
  margin-top: 10px;
}

.topic-html-content .momentum-worked-examples-page .formula {
  font-family: "Times New Roman", serif;
  font-size: 28px;
  text-align: center;
  margin: 10px 0;
}

.topic-html-content .momentum-worked-examples-page .answer {
  color: #163d75;
  font-weight: 700;
}

.topic-html-content .momentum-worked-examples-page .diagram {
  display: block;
  width: min(100%, 340px);
  height: auto;
  border: 1px dashed #c8d0db;
  border-radius: 6px;
  background: #ffffff;
  padding: 6px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .two-col > * {
    width: 100%;
    min-width: 0;
  }

  .diagram-wrap {
    width: 100%;
  }

  .diagram {
    width: min(100%, 320px);
  }

  .worked-question,
  .worked-solution,
  .worked-diagram {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    min-width: 0;
  }

  .worked-diagram {
    justify-content: center;
  }

  .card-header {
    font-size: 18px;
  }

  p {
    font-size: 18px;
  }

  .formula {
    font-size: 28px;
  }
}
/* ===== CASE grid: 2 rows × 2 columns ===== */
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.mini-diagram-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mini-title {
  font-size: 18px;
  font-weight: 400;
  color: #2f4d78;
  margin: 0 0 6px;
}

/* ===== Light block colors ===== */
.block-lightgreen {
  fill: #d9f4a7;
  stroke: #7fbf3f;
  stroke-width: 2;
}

.block-lightyellow {
  fill: #fff4a8;
  stroke: #d7b928;
  stroke-width: 2;
}

/* ===== Free-body diagram dot ===== */
.fbd-dot {
  fill: #ffd54f;
  stroke: #ff6f00;
  stroke-width: 1.5;
}

/* ===== Rope line ===== */
.rope-line {
  stroke: #555;
  stroke-width: 2;
  stroke-dasharray: 6 3;
}

.ground-lightgreen {
  fill: #a7d46f;
  stroke: #7ead4c;
  stroke-width: 1;
}

.ground-lightyellow {
  fill: #f2de72;
  stroke: #c8ad3f;
  stroke-width: 1;
}
.ground-soft {
  fill: #cfcfcf;
  stroke: #a5a5a5;
  stroke-width: 1;
}
.pulley-ring {
  fill: #fff3b0;
  stroke: #ff3b30;
  stroke-width: 2;
}

.pulley-core {
  fill: #ffcf33;
  stroke: #ff3b30;
  stroke-width: 1.2;
}

.rope-line-red {
  stroke: #ff4b4b;
  stroke-width: 2;
  fill: none;
}

@media (min-width: 901px) and (max-width: 1100px) {
  .page {
    width: min(1040px, 96%);
  }

  .content-card {
    margin-bottom: 18px;
  }

  .card-body {
    padding: 14px;
  }

  .two-col {
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.85fr);
    gap: 14px;
  }

  .case-grid {
    gap: 14px;
  }

  .diagram {
    width: min(100%, 320px);
    padding: 6px;
  }

  p {
    font-size: 18px;
    line-height: 1.5;
  }

  .formula {
    font-size: 28px;
  }

  .pill {
    font-size: 16px;
    padding: 8px 14px;
  }

  .label {
    font-size: 15px;
  }

  .worked-example-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .worked-question,
  .worked-solution,
  .worked-diagram {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    min-width: 0;
  }

  .worked-diagram {
    justify-content: center;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}
.slope-orange {
  fill: #f7941d;
  stroke: #2da8ff;
  stroke-width: 2;
}

.block-gray {
  fill: #a7adb3;
  stroke: #5f666d;
  stroke-width: 2;
}

.label-white {
  fill: #ffffff;
}
.platform-teal {
  fill: #93cfd1;
  stroke: #4fa6aa;
  stroke-width: 1.5;
}

.ground-teal {
  fill: #6fd3df;
  stroke: #3ca9b6;
  stroke-width: 1;
}

.practice-questions-content .exercise-title-wrap {
  margin-bottom: 24px;
}

.practice-question-card {
  margin-bottom: 24px;
}

.practice-question-layout {
  align-items: center;
}

.practice-question-layout.no-practice-image {
  grid-template-columns: 1fr;
}

.practice-question-layout.no-practice-image .practice-question-text {
  grid-column: 1;
  max-width: none;
}

.practice-question-text {
  font-size: 20px;
  line-height: 1.6;
}

.practice-question-parts {
  background: #fff8e8;
  border-left: 4px solid #f0b429;
  border-radius: 12px;
  margin-top: 14px;
  padding: 14px 16px;
}

.practice-questions-content .practice-question-text > ol {
  background: #fff8e8;
  border-left: 4px solid #f0b429;
  border-radius: 12px;
  margin: 14px 0 0;
  padding: 14px 16px 14px 44px;
}

.practice-questions-content .practice-question-text > ol li {
  margin: 0 0 8px;
}

.practice-questions-content .practice-question-text > ol li:last-child {
  margin-bottom: 0;
}

.practice-questions-content .toggle-btn,
.practice-questions-content .hidden-answer {
  display: none !important;
}

.practice-question-parts p {
  margin: 0 0 8px;
}

.practice-question-parts p:last-child {
  margin-bottom: 0;
}

.practice-diagram {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.practice-diagram .diagram {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.practice-question-image {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  object-fit: contain;
}

.practice-placeholder {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #b8c2cc;
  border-radius: 8px;
  background: #fbfdff;
  padding: 20px;
  color: #455a70;
  text-align: center;
}

.practice-parts {
  margin-top: 12px;
}

.practice-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.practice-questions-content .grid-line {
  stroke: #1aa0ff;
  stroke-width: 1;
}

.practice-questions-content .axis-line {
  stroke: #111;
  stroke-width: 2;
}

.practice-questions-content .vector-red {
  stroke: #f01828;
  stroke-width: 2;
  marker-end: url("#arrowRed");
}

.practice-questions-content .vector-blue {
  stroke: #0d64d8;
  stroke-width: 2;
  marker-end: url("#arrowBlue");
}

.practice-questions-content .vector-black {
  stroke: #111;
  stroke-width: 3;
  marker-end: url("#arrowBlack");
}

.practice-questions-content .label {
  font-size: 16px;
  font-weight: 700;
  fill: #0f2338;
}

.practice-questions-content .small-label {
  font-size: 13px;
  fill: #0f2338;
}

.practice-questions-content .red-label {
  fill: #f01828;
  font-weight: 700;
}

.practice-questions-content .blue-label {
  fill: #0d64d8;
  font-weight: 700;
}

.practice-questions-content .block {
  fill: #f2b66f;
  stroke: #9b621f;
  stroke-width: 2;
}

.practice-questions-content .surface {
  fill: #d8d8d8;
  stroke: #777;
  stroke-width: 2;
}

@media (max-width: 850px) {
  .practice-diagram {
    min-height: 180px;
  }
}
