/* Keep registration links visible while reading, without clipping the TOC. */
.broker-index-page .broker-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 108px);
  max-height: calc(100dvh - 108px);
}

.broker-sidebar .toc-card {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 96px;
  padding: 16px;
}

.broker-sidebar .toc-card h2 { flex: none; }
.broker-toc-links { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b4c9df transparent; }
.broker-toc-links a { padding: 1px 0; }
.broker-toc-links a:focus-visible { outline: 2px solid #0878ee; outline-offset: -2px; }

.broker-register-card {
  flex: none;
  padding: 16px;
  border: 1px solid #cbdff1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(20, 50, 87, .07);
}

.broker-register-card h2 {
  margin: 0 0 12px;
  color: #102541;
  font-size: 16px;
  line-height: 1.4;
}

.broker-register-links { display: grid; gap: 8px; }
.broker-register-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #0868cc;
  border-radius: 7px;
  color: #fff;
  background: #0868cc;
  text-decoration: none;
  line-height: 1.35;
}

.broker-register-links a:hover { background: #0757ab; border-color: #0757ab; }
.broker-register-links a:focus-visible { outline: 3px solid #073b70; outline-offset: 3px; }
.broker-register-links a strong { min-width: 0; font-size: 14px; font-weight: 800; }
.broker-register-links a > span { flex: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.broker-register-links i { font-style: normal; }
.broker-register-mobile-name { display: none; }
.broker-register-disclosure { margin: 10px 0 0; color: #52657a; font-size: 12px; line-height: 1.5; }

.broker-sidebar .broker-sidebar-disclaimer { flex: none; margin: 0; padding: 12px 14px; }
.broker-sidebar-disclaimer summary { color: #52657a; font-size: 12px; font-weight: 700; line-height: 1.5; cursor: pointer; }
.broker-sidebar-disclaimer summary:focus-visible { outline: 2px solid #0878ee; outline-offset: 3px; }
.broker-sidebar-disclaimer p { margin: 10px 0 0; max-height: 100px; overflow-y: auto; line-height: 1.55; }

@media (max-width: 1080px), (max-height: 640px) {
  .broker-index-page {
    --broker-register-bar-space: 126px;
    padding-bottom: calc(var(--broker-register-bar-space) + env(safe-area-inset-bottom, 0px));
  }

  .broker-index-page :is(a, button, input, select, textarea, summary, [id]) {
    scroll-margin-bottom: calc(var(--broker-register-bar-space) + env(safe-area-inset-bottom, 0px));
  }

  .broker-register-card {
    position: fixed;
    inset: auto 0 0;
    z-index: 90;
    margin: 0;
    padding: 10px max(14px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: 0 -5px 20px rgba(20, 50, 87, .1);
  }

  .broker-register-card h2,
  .broker-register-links,
  .broker-register-disclosure { max-width: 1120px; margin-left: auto; margin-right: auto; }
  .broker-register-card h2 { margin-bottom: 7px; font-size: 14px; }
  .broker-register-links { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .broker-register-links a { flex-direction: column; justify-content: center; gap: 1px; padding: 6px 4px; text-align: center; }
  .broker-register-links a > span { font-size: 12px; }
  .broker-register-desktop-name { display: none; }
  .broker-register-mobile-name { display: inline; }
  .broker-register-disclosure { margin-top: 7px; line-height: 1.4; }
}

@media (max-width: 1080px) {
  .broker-index-page .broker-sidebar { max-height: none; }
  .broker-toc-links { overflow-y: visible; }
}

@media (min-width: 1081px) and (max-height: 640px) {
  .broker-index-page .broker-sidebar { max-height: calc(100vh - 234px); max-height: calc(100dvh - 234px); }
}

@media (max-width: 600px) {
  .broker-index-page { --broker-register-bar-space: 180px; }
  .broker-register-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media print {
  .broker-index-page { padding-bottom: 0; }
  .broker-index-page .broker-register-card { display: none; }
  .broker-index-page .broker-sidebar { position: static; max-height: none; }
  .broker-toc-links { overflow: visible; }
}

/* Readable worked example and methodology for the cost index. */
.broker-index-page .article-hero { align-items: start; }
.broker-index-page .bpi-example-panel {
  padding: 28px;
  border-top: 4px solid #087f72;
  background: linear-gradient(180deg, #f0f9f6 0, #fff 180px);
}

.broker-index-page .bpi-example-panel p { margin: 0; padding: 0; color: #52657a; font-size: 16px; line-height: 1.6; }
.broker-index-page .bpi-eyebrow,
.broker-index-page .bpi-example-panel .bpi-eyebrow {
  margin: 0 0 12px;
  color: #07695f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.broker-index-page .bpi-example-panel h2 { margin: 0 0 16px; color: #102541; font-size: clamp(24px, 2.2vw, 29px); line-height: 1.25; letter-spacing: -.025em; }
.bpi-example-costs { display: grid; gap: 0; margin: 22px 0; }
.bpi-example-costs > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-top: 1px solid #dce9e5; }
.bpi-example-costs > div:last-child { padding-bottom: 0; }
.bpi-example-costs dt { color: #52657a; font-size: 15px; line-height: 1.5; }
.bpi-example-costs dt span { white-space: nowrap; }
.bpi-example-costs dd { flex: none; margin: 0; color: #102541; font-size: 20px; font-weight: 800; line-height: 1.4; font-variant-numeric: tabular-nums; }
.bpi-example-result { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; padding: 20px; border-radius: 12px; background: #123b49; color: #fff; }
.bpi-example-result > div > span { display: block; font-size: 14px; line-height: 1.4; color: #e0efec; }
.bpi-example-result > div > strong { display: block; margin-top: 6px; font-size: 46px; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.bpi-example-result small { font-size: 25px; }
.broker-index-page .bpi-example-result p { color: #e0efec; font-size: 14px; line-height: 1.5; }
.bpi-example-result p b { display: inline-block; margin-bottom: 4px; font-size: 23px; line-height: 1.3; color: #fff; }
.broker-index-page .bpi-example-panel .bpi-example-scope { margin: 18px 0 12px; font-size: 14px; line-height: 1.65; }
.bpi-example-link { display: inline-block; padding: 5px 0; color: #075bb2; font-size: 15px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.bpi-example-link:focus-visible { outline: 3px solid #0878ee; outline-offset: 4px; }

.broker-index-page .bpi-method-section h2 { font-size: clamp(27px, 3vw, 36px); line-height: 1.2; }
.bpi-formula { display: flex; align-items: center; gap: 22px; margin: 22px 0 16px; padding: 24px; border-radius: 12px; background: #123b49; color: #fff; }
.bpi-formula-label { flex: none; font-size: 16px; font-weight: 650; }
.bpi-formula-fraction { display: grid; flex: 1; min-width: 0; gap: 12px; text-align: center; font-size: 18px; line-height: 1.5; }
.bpi-formula-fraction > span:first-child { padding-bottom: 12px; border-bottom: 1px solid #9dbbbd; }
.bpi-formula-multiplier { flex: none; white-space: nowrap; font-size: 20px; font-weight: 750; }
.bpi-unit-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin: 0 0 18px; }
.bpi-unit-guide > div { padding: 16px 18px; border: 1px solid #d2e3ed; border-radius: 10px; background: #f7fbff; }
.bpi-unit-guide strong { display: block; margin-bottom: 6px; color: #102541; font-size: 20px; line-height: 1.4; }
.bpi-unit-guide span { display: block; color: #52657a; font-size: 14px; line-height: 1.6; }
.broker-index-page .bpi-method-note { margin: 0 0 24px; font-size: 16px; line-height: 1.7; }

.bpi-worked-example { padding: 22px; border: 1px solid #cfe3dc; border-radius: 12px; background: #f3faf7; }
.broker-index-page .bpi-worked-example h3 { margin: 0 0 10px; color: #102541; font-size: 21px; line-height: 1.4; }
.broker-index-page .bpi-worked-example > p { margin: 0 0 18px; font-size: 16px; line-height: 1.65; }
.broker-index-page .bpi-calculation-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.broker-index-page .bpi-calculation-steps > li { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 14px; margin: 0; padding: 18px 0; border-top: 1px solid #d6e7e0; }
.broker-index-page .bpi-calculation-steps > li:last-child { padding-bottom: 0; }
.bpi-step-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #deeee7; color: #07695f; font-size: 13px; font-weight: 800; }
.bpi-calculation-steps strong { color: #102541; font-size: 16px; line-height: 1.5; }
.broker-index-page .bpi-calculation-steps p { margin: 7px 0 0; font-size: 18px; line-height: 1.65; }
.bpi-calculation-steps b { white-space: nowrap; color: #07695f; }
.bpi-calculation-note { display: block; margin-top: 6px; color: #52657a; font-size: 14px; line-height: 1.6; }
.broker-index-page .bpi-method-details { margin: 20px 0 0; padding: 0; border: 1px solid #d4e2ee; border-radius: 10px; background: #fff; }
.bpi-method-details summary { padding: 18px; color: #075bb2; font-size: 16px; font-weight: 750; line-height: 1.5; cursor: pointer; }
.bpi-method-details summary:focus-visible { outline: 3px solid #0878ee; outline-offset: -3px; border-radius: 10px; }
.broker-index-page .bpi-method-details ol { margin: 0; padding: 0 24px 20px 42px; }
.broker-index-page .bpi-method-details li { margin: 0; padding: 9px 0; font-size: 16px; line-height: 1.7; }

@media (max-width: 760px) {
  .broker-index-page .bpi-example-panel { padding: 24px; }
  .bpi-formula { flex-direction: column; gap: 18px; padding: 22px 20px; }
  .bpi-formula-label { align-self: flex-start; }
  .bpi-formula-fraction { flex: auto; width: 100%; font-size: 17px; }
  .bpi-worked-example { padding: 20px 18px; }
}

@media (max-width: 420px) {
  .broker-index-page .bpi-example-panel { padding: 24px 20px; }
  .bpi-example-costs > div { gap: 12px; }
  .bpi-example-costs dd { font-size: 18px; }
  .bpi-example-result { padding: 18px; gap: 18px; }
  .bpi-example-result > div > strong { font-size: 40px; }
  .broker-index-page .bpi-calculation-steps > li { grid-template-columns: 1fr; gap: 10px; }
  .broker-index-page .bpi-calculation-steps p { font-size: 17px; }
}
