/* ===== Section navigation, phones and tablets (shared by the three open hubs, 25 Sep 2026) =====
   Apple pattern: a scope bar attached to the navigation bar. One row, pinned flush under the
   top bar, same bar material and one hairline. Capsules are 32pt to the eye with a 44pt hit
   area (the row height). "All sections" is a trailing list button that opens a sheet. "Next"
   lives only at the foot of the page. Desktop keeps each hub's own strip. */
@media (max-width: 1023px) {
  html:root:root:root:root #main > nav.section-nav {
    position: sticky !important; top: var(--cbn-top, 54px) !important; z-index: 60 !important;
    display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 4px !important;
    height: 44px !important; min-height: 44px !important; box-sizing: border-box !important;
    margin: 0 -16px 12px !important; padding: 0 4px 0 16px !important;
    background: var(--hig-bar-bg) !important; border: 0 !important; border-radius: 0 !important;
    border-bottom: 0.5px solid var(--hig-separator) !important; box-shadow: none !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  html:root:root:root:root #main > nav.section-nav::before,
  html:root:root:root:root #main > nav.section-nav::after,
  html:root:root:root:root #main > nav.section-nav .sn-label,
  html:root:root:root:root #main > nav.section-nav .sn-num,
  html:root:root:root:root #main > nav.section-nav .cbx-next,
  html:root:root:root:root #main > nav.section-nav .sn-collapse-all { display: none !important; }

  html:root:root:root:root #main > nav.section-nav .sn-links {
    flex: 1 1 auto !important; min-width: 0 !important; height: 44px !important;
    display: flex !important; align-items: center !important; gap: 8px !important;
    overflow-x: auto !important; overflow-y: hidden !important; scrollbar-width: none !important;
    padding: 0 12px 0 0 !important; margin: 0 !important; border: 0 !important; background: none !important;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent) !important;
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent) !important;
    scroll-padding-inline: 16px;
  }
  html:root:root:root:root #main > nav.section-nav .sn-links::-webkit-scrollbar { display: none; }

  html:root:root:root:root #main > nav.section-nav .sn-link {
    flex: 0 0 auto !important; position: relative !important;
    height: 32px !important; min-height: 32px !important; max-height: 32px !important;
    margin: 0 !important; padding: 0 12px !important; box-sizing: border-box !important;
    display: inline-flex !important; align-items: center !important; gap: 0 !important;
    border: 0 !important; border-radius: 999px !important; box-shadow: none !important;
    background: var(--hig-fill3) !important; color: var(--hig-label) !important;
    font: 500 0.9375rem/1 var(--hig-font, -apple-system, system-ui, sans-serif) !important;
    letter-spacing: -0.01em !important; white-space: nowrap !important;
  }
  /* the hit area is the full 44pt row */
  html:root:root:root:root #main > nav.section-nav .sn-link::after { content: "" !important; position: absolute !important; left: -4px !important; right: -4px !important; top: -6px !important; bottom: -6px !important; width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important; transform: none !important; margin: 0 !important; background: none !important; border: 0 !important; }
  html:root:root:root:root #main > nav.section-nav .sn-link.is-here,
  html:root:root:root:root #main > nav.section-nav .sn-link.active.is-here {
    background: var(--hig-label) !important; color: var(--hig-bg) !important; font-weight: 600 !important;
  }
  html:root:root:root:root #main > nav.section-nav .sn-link:not(.is-here).active { background: var(--hig-fill3) !important; color: var(--hig-label) !important; }

  /* All sections: a trailing 44pt list button */
  html:root:root:root:root #main > nav.section-nav .cbx-jump {
    flex: 0 0 44px !important; width: 44px !important; height: 44px !important; min-height: 44px !important;
    margin: 0 !important; padding: 0 !important; position: relative !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    border: 0 !important; border-radius: 999px !important; box-shadow: none !important; background: transparent !important;
    color: var(--hig-tint-text) !important; font-size: 0 !important; line-height: 0 !important; overflow: hidden !important;
  }
  html:root:root:root:root #main > nav.section-nav .cbx-jump > * { display: none !important; }
  html:root:root:root:root #main > nav.section-nav .cbx-jump::before {
    content: "" !important; display: block !important; width: 22px !important; height: 22px !important;
    background: currentColor !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11'/%3E%3Ccircle cx='4.5' cy='6' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='18' r='1.2' fill='black' stroke='none'/%3E%3C/svg%3E") center / 22px 22px no-repeat !important;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11'/%3E%3Ccircle cx='4.5' cy='6' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='18' r='1.2' fill='black' stroke='none'/%3E%3C/svg%3E") center / 22px 22px no-repeat !important;
  }
  html:root:root:root:root #main > nav.section-nav .cbx-jump::after { display: none !important; }
  html:root:root:root:root #main > nav.section-nav .cbx-jump[aria-expanded="true"] { background: var(--hig-fill3) !important; }

  /* the section list opens as a sheet from the bottom edge */
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel:not([hidden]) {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    z-index: 200 !important; width: auto !important; max-width: none !important; max-height: 72vh !important;
    overflow-y: auto !important; overscroll-behavior: contain;
    display: flex !important; flex-direction: column !important; gap: 0 !important;
    margin: 0 !important; padding: 28px 0 calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
    background: var(--hig-grouped-bg2, var(--hig-bg)) !important; color: var(--hig-label) !important;
    border: 0 !important; border-radius: 14px 14px 0 0 !important;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.32), 0 -8px 30px rgba(0, 0, 0, 0.18) !important;
  }
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel:not([hidden])::before {
    content: "" !important; position: absolute !important; top: 8px !important; left: 50% !important;
    width: 36px !important; height: 5px !important; margin-left: -18px !important; border-radius: 3px !important;
    background: var(--hig-label3) !important; opacity: 0.6;
  }
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel > button {
    display: flex !important; align-items: center !important; gap: 12px !important; width: 100% !important;
    min-height: 48px !important; margin: 0 !important; padding: 0 44px 0 20px !important; box-sizing: border-box !important;
    border: 0 !important; border-bottom: 0.5px solid var(--hig-separator) !important; border-radius: 0 !important;
    background: transparent !important; color: var(--hig-label) !important; text-align: left !important;
    font: 400 1.0625rem/1.25 var(--hig-font, -apple-system, system-ui, sans-serif) !important; position: relative !important;
  }
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel > button:last-child { border-bottom: 0 !important; }
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel > button .jn {
    flex: 0 0 auto; min-width: 22px; color: var(--hig-label3) !important; font-variant-numeric: tabular-nums;
    font: 400 0.9375rem/1 var(--hig-font, -apple-system, system-ui, sans-serif) !important; background: none !important; padding: 0 !important;
  }
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel > button.is-here { font-weight: 600 !important; }
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel > button.is-here::after {
    content: "" !important; position: absolute !important; right: 18px !important; top: 50% !important;
    width: 16px !important; height: 16px !important; margin-top: -8px !important; background: var(--hig-tint-text) !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E") center / 16px no-repeat !important;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E") center / 16px no-repeat !important;
  }
  html:root:root:root:root #main > nav.section-nav .cbx-jump-panel .sn-collapse-all { display: none !important; }

  /* a section heading lands just below the bars */
  html:root:root:root:root #main section.block { scroll-margin-top: calc(var(--cbn-top, 54px) + 56px); }

  /* section disclosure: a plain chevron, no box */
  html:root:root:root:root #main section.block .sec-toggle {
    background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--hig-label3) !important;
  }
}

/* ===== Page switcher: the bar leads with the page you are on ===== */
.cbn-page { display: none; }
@media (max-width: 1023px) {
  html:root:root:root:root #main > nav.section-nav .cbn-page {
    flex: 0 0 auto; position: relative; display: inline-flex; align-items: center; gap: 4px;
    height: 32px; margin: 0 4px 0 0; padding: 0 10px 0 12px; box-sizing: border-box;
    border: 0; border-radius: 999px; background: transparent; color: var(--hig-tint-text);
    font: 600 0.9375rem/1 var(--hig-font, -apple-system, system-ui, sans-serif); letter-spacing: -0.01em; white-space: nowrap;
    max-width: 44vw; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--hig-separator);
  }
  html:root:root:root:root #main > nav.section-nav .cbn-page::after { content: ""; position: absolute; left: -4px; right: -4px; top: -6px; bottom: -6px; }
  html:root:root:root:root #main > nav.section-nav .cbn-page svg { flex: 0 0 auto; }
  /* a hairline between the page and its sections */
  html:root:root:root:root #main > nav.section-nav .cbn-page + .sn-label + .sn-links,
  html:root:root:root:root #main > nav.section-nav .cbn-page ~ .sn-links { border-left: 0.5px solid var(--hig-separator) !important; padding-left: 8px !important; }

  .cbn-scrim { position: fixed; inset: 0; z-index: 210; background: rgba(0, 0, 0, 0.32); }
  .cbn-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 211; max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--hig-grouped-bg2, var(--hig-bg)); color: var(--hig-label);
    border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 16px);
    font-family: var(--hig-font, -apple-system, system-ui, sans-serif);
  }
  .cbn-sheet::before { content: ""; display: block; width: 36px; height: 5px; margin: 0 auto 4px; border-radius: 3px; background: var(--hig-label3); opacity: 0.6; }
  .cbn-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 8px 20px; }
  .cbn-sheet__t { font: 600 1.0625rem/1.25 var(--hig-font, -apple-system, system-ui, sans-serif); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cbn-sheet__x { flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; background: none; color: var(--hig-tint-text); font: 600 1.0625rem/1 var(--hig-font, -apple-system, system-ui, sans-serif); cursor: pointer; }
  .cbn-sheet__list { list-style: none; margin: 0 16px; padding: 0; background: var(--hig-bg); border-radius: 12px; overflow: hidden; }
  .cbn-sheet__list li + li a { border-top: 0.5px solid var(--hig-separator); }
  .cbn-sheet__list a {
    display: flex; align-items: center; min-height: 48px; padding: 0 44px 0 16px; position: relative; box-sizing: border-box;
    color: var(--hig-label); text-decoration: none; font: 400 1.0625rem/1.25 var(--hig-font, -apple-system, system-ui, sans-serif);
  }
  .cbn-sheet__list a.is-on { font-weight: 600; }
  .cbn-sheet__list a.is-on::after {
    content: ""; position: absolute; right: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--hig-tint-text);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E") center / 16px no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E") center / 16px no-repeat;
  }
  .cbn-sheet__list a:focus-visible { outline: 3px solid var(--hig-tint-text); outline-offset: -3px; }
}

/* Method disclosures on phones: the row shows its title only (Apple disclosure rows); the teaser
   beside it was squeezing the title into a narrow column. The body still opens in full. */
@media (max-width: 767px) {
  html:root:root:root:root #main .cbx-acc__sum { display: none !important; }
  html:root:root:root:root #main .cbx-acc__t { flex: 1 1 auto !important; min-width: 0 !important; }
}

/* 11pt floor for the small captions on finance cards and story cards */
html:root:root:root:root #main :is(.sh-kpi__label, .sh-kpi__source, .cbx-story__eyebrow, .cbx-story__src, .num > small) { font-size: max(11px, 0.6875rem) !important; }

/* A bar with nothing to navigate stays hidden: no page switcher and fewer than two sections
   (the home pages: AU marks it .rf-empty, NZ draws a single-chip strip). Without this the rule
   above forced an empty 44px band under the top bar. */
@media (max-width: 1023px) {
  html:root:root:root:root #main > nav.section-nav.rf-empty:not(:has(.cbn-page)),
  html:root:root:root:root #main > nav.section-nav:not(:has(.cbn-page)):not(:has(.sn-link ~ .sn-link)) { display: none !important; }
}
