/* Scoped to the Risk and Return / Capital Structure pages that load this file.
   em widths track the article's type size; intrinsic SVG viewBoxes preserve shape. */
.chapter .inline-image {
  width: min(100%, 30em);
  max-width: 100% !important;
  height: auto;
  margin: 1.3em auto 1.7em;
  object-fit: contain;
}
.chapter img[src$="/3.svg"],
.chapter .normal-image { width: min(100%, 24em); }
.chapter .correlation-image { width: min(100%, 32em); }
.chapter .gm-motorola-table-image,
.chapter .gm-ibm-mot-table-image { width: min(100%, 28em); }
.chapter .inline-image-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25em;
  margin: 1.4em 0 1.8em;
}
.chapter .inline-image-row .inline-image {
  flex: 0 1 auto;
  min-width: 0;
  width: min(100%, 27em);
  max-width: 100% !important;
  height: auto;
  margin: 0;
}
.chapter .inline-image-row .matrix-image-small { width: min(100%, 22em); }
.chapter .mm-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(21em, 1fr));
  align-items: start;
  width: min(56em, calc(100vw - var(--ea-sidebar, 18rem) - 2rem));
  max-width: none;
  gap: 1em;
  overflow-x: auto;
  scrollbar-width: thin;
  margin: 1.6em 0 2em 50%;
  transform: translateX(-50%);
}
.chapter .mm-figure-card { min-width: 0; margin: 0; }
.chapter .mm-figure-image {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  object-fit: contain;
  margin: 0;
}
@media (max-width: 980px) {
  .chapter .mm-figure-grid { width: calc(100vw - 2rem); }
}
.chapter .tax-diagram { width: min(100%, 28em); max-width: 100%; height: auto; }
/* A single SVG preserves the dashed guide across the two larger plots. */
.chapter .finance-market-panels {
  display: block;
  width: min(68em, calc(100vw - var(--ea-sidebar, 18rem) - 2rem));
  max-width: none;
  overflow-x: auto;
  scrollbar-width: thin;
  margin: 1.5em 0 2em 50%;
  transform: translateX(-50%);
}
.chapter .finance-market-panels img {
  display: block;
  width: 100%;
  min-width: 60em;
  max-width: none;
  height: auto;
}
@media (max-width: 980px) {
  .chapter .finance-market-panels { width: calc(100vw - 2rem); }
}
@media (max-width: 600px) {
  .chapter .inline-image { margin-block: 1.1em 1.5em; }
}

/* Mathematical course figures */
.chapter .course-table-wrap {
  width: fit-content; max-width: 100%; margin: 1.3em auto 1.7em;
  overflow-x: auto; scrollbar-width: thin;
}
.chapter table.course-table {
  width: auto; min-width: 26em; border-collapse: collapse;
  color: #111; background: #fff; font: .9em/1.28 Arial, Helvetica, sans-serif;
  font-variant-numeric: tabular-nums; border-top: 1px solid #999; border-bottom: 1px solid #999;
}
.chapter .course-table th, .chapter .course-table td {
  padding: .1em .65em; border: 0; background: #fff; text-align: right; white-space: nowrap;
}
.chapter .course-table thead th { color: #333399; font-weight: 400; text-align: center; border-bottom: 1px solid #aaa; }
.chapter .course-table .course-spanner th { border: 0; padding-top: .1em; padding-bottom: .2em; }
.chapter .course-table .course-spanner th:last-child { border-bottom: 1px solid #aaa; }
.chapter .course-table tbody th { text-align: left; color: #333399; font-weight: 400; }
.chapter .course-table .course-weight { color: #333399; font-weight: 700; text-align: center; }
.chapter .course-table .course-covariance { color: #d93232; }
.chapter .course-table sub { font-size: .72em; }
.chapter .course-matrices { margin: 1.4em 0 1.8em; }
.chapter .course-matrix-wrap { margin-block: 1.1em; }
.chapter table.course-matrix { width: auto; border: 1px solid #999; border-collapse: collapse; background: #fff; font-size: .91em; line-height: 1.25; }
.chapter .course-matrix th, .chapter .course-matrix td { padding: .22em .6em; border: 0; background: #fff; text-align: center; font-weight: 400; white-space: nowrap; }
.chapter .course-matrix thead th, .chapter .course-matrix thead td { border-bottom: 1px solid #999; }
.chapter .course-matrix th:first-child, .chapter .course-matrix td:first-child { border-right: 1px solid #999; }
.course-visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.chapter .course-figure-note { max-width: 30em; margin: -1em auto 1.8em; color: #666; font: .74em/1.45 Arial, Helvetica, sans-serif; text-align: center; }
.chapter .mit-derivation { margin: 2.3em 0; color: #111; font: .96em/1.65 Arial, Helvetica, sans-serif; }
.chapter .mit-derivation h3 { font: 700 1.1em/1.3 Arial, Helvetica, sans-serif; color: #333399; margin: 0 0 1.2em; }
.chapter .mit-derivation p { font: inherit; margin: .8em 0; }
.chapter .mit-derivation .formula-block { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: .15em 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 1em; color: #111; scrollbar-width: thin; }
.chapter .mit-derivation .formula-highlight { color: #333399; }
.chapter .mit-derivation mjx-container { max-width: 100%; }
.chapter .mit-derivation .formula-highlight mjx-container { color: #333399; }
@media(max-width:600px) {
 .chapter .course-table th, .chapter .course-table td { padding-inline: .42em; }
 .chapter .course-table { min-width: 24em; }
 .chapter .course-matrix th, .chapter .course-matrix td { padding-inline: .4em; }
}
