html.ib-tool-hierarchy .ib-calc-title,
html.ib-tool-hierarchy .ib-tool-title,
html.ib-tool-hierarchy .ib-article-title,
html.ib-tool-hierarchy .ib-reviews h2 {
  font-size: var(--ib-font-size-3xl) !important;
  font-weight: 700;
  line-height: 1.25;
}

html.ib-tool-hierarchy .ib-calc-title,
html.ib-tool-hierarchy .ib-tool-title {
  margin: 0;
}

html.ib-tool-hierarchy .ib-article-title span {
  font-size: inherit !important;
}

html.ib-tool-hierarchy .ib-tool-title,
html.ib-tool-hierarchy .ib-page-disclaimer {
  width: calc(100% - 32px);
  max-width: var(--ib-shell, 1180px);
  margin-inline: auto;
}

html.ib-tool-hierarchy .ib-page-disclaimer {
  margin-block: 24px;
  padding: 10px 12px;
  border: 1px solid var(--ib-black-a10);
  border-radius: var(--ib-radius-sm);
  background: var(--ib-black-a04);
  color: var(--ib-ink-muted);
  font-size: var(--ib-font-size-xs);
  line-height: 1.65;
  text-align: center;
}

html.ib-tool-hierarchy .breadcrumb {
  margin-top: 0 !important;
}

/* Round 7 M2 (spec 3.x item 17): the breadcrumb is the Text 2 line above the H1 (Breadcrumb placement "header");
   the old bar under the page goes. The BreadcrumbList JSON-LD in the head is untouched. */
body #ib-main ~ .breadcrumb { display: none !important; }

/* Round 8 N2: in-text links in the page content (sources, related guides, body copy, FAQ, tables) are Blue text, no underline. */
html:not(.embed-mode) body #seo-content a:not(.ib-mk-plain):not(.ib-cta-btn):not(.v2-cta) {
  color: var(--ib-ui-blue-text) !important;
  text-decoration: none !important;
  border-bottom: 0 !important;
}

/* Round 8 N3: content boxes (worked example, tables, FAQ rows, plotter gate) sit on the Card surface, not a light fill. Embeds stay light. */
html:not(.embed-mode):not(.ib-embed-light) body #seo-content :is(.example-box, .table-wrap, .faq-item),
html:not(.embed-mode):not(.ib-embed-light) body .cp-main > .cp-gate {
  background: var(--ib-ui-card-surface) !important;
  border: 1px solid var(--ib-ui-card-surface-line) !important;
  border-radius: var(--ib-radius-2xl) !important;
}

/* Round 7 M3: the embed line's link is an in-text link: Blue text, no underline. */
body #ib-main > p.embed-promo a {
  color: var(--ib-ui-blue-text) !important;
  text-decoration: none !important;
  border-bottom: 0 !important;
}

/* Embed view only: the title gets the same 24px top gap as the side gutter. */
html.embed-mode .ib-calc-titlewrap > h1 { padding-top: 24px; }
html.embed-mode #seo-content, html.embed-mode #ib-main > #seo-content { display:none !important; }
@media (max-width:759px) {
  html.embed-mode .ib-calc-titlewrap {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
    transform: none;
  }
}
/* Embed view only, 768px+: the normal page keeps a 24px outer inset and the 806px
   calc column (the rail takes the rest at 1100). Without the rail the embed grew to
   the full viewport, which made the visual syringe 177px wider at 1100 and 29px at 800. */
@media (min-width:760px){
  html.embed-mode .ib-trt-beam-page{box-sizing:border-box;width:calc(100% - 48px);max-width:806px;margin-inline:auto}
  /* Round 8 N1 (spec 3.12, as the guide title block): calculator breadcrumb stays in the page for search engines, hidden on screen. */
  html:not(.embed-mode) #ib-main nav[aria-label=breadcrumb] {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* I1496: desktop explainer uses the shell width in two columns */
@media (min-width: 1024px) {
  #ib-main > #seo-content.static-page {
    max-width: var(--ib-shell, 1180px);
    padding-inline: clamp(18px, 3vw, 36px);
    column-count: 2;
    column-gap: clamp(32px, 4vw, 56px);
  }

  #ib-main > #seo-content > :is(p:first-child, h1, .quick-answer) {
    column-span: all;
  }

  #ib-main > #seo-content :is(.example-box, .table-wrap, .faq-item, li) {
    break-inside: avoid;
  }

  #ib-main > #seo-content :is(h1, h2, h3) {
    break-after: avoid;
  }

  /* C2 batch 2 follow-up: the 620-unit titration chart spans both columns, so its
     ticks render at 16px (scale 1) instead of 9-11px in a single column. */
  #ib-main > #seo-content > svg {
    column-span: all;
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
  }

  /* Tighter cell padding so SEO tables fit their column at desktop widths (F16) */
  #ib-main > #seo-content .table-wrap th,
  #ib-main > #seo-content .table-wrap td {
    padding-left: 6px;
    padding-right: 6px;
  }

  #ib-main > #seo-content .table-wrap th {
    overflow-wrap: anywhere;
    letter-spacing: 0.3px;
  }
}

/* I309 (r3): on the phone prerender pages the SEO h1 showed above the calculator until React mounted; React then sets
   html.ib-seo-open and drops that h1, so the calculator jumped up 66px (CLS 0.073). The mounted page has no h1 there,
   so the prerender hides it too. */
@media (max-width: 759px) {
  html:has(.ib-pep-flow):not(.ib-seo-open) #ib-main > #seo-content > h1 { display: none !important; }

  html.ib-tool-hierarchy:has(.ib-pep-flow):not(.ib-seo-open) #seo-content > .ib-article-title {
    display: block !important;
    order: -1;
    margin: 12px 16px 4px;
    font-size: var(--ib-font-size-3xl) !important;
    line-height: 1.25;
  }
}

@media (max-width: 759px) {
  /* I1197: the step card's gaps are halved (I1250: Back / forward moved to the top row, no bottom bar) */
  .ib-pep-flow .ib-pep-flow-stage {
    gap: 6px;
  }

  .ib-pep-flow .ib-pep-flow-stage .ib-trt-weekdays {
    margin: 2px 0;
  }

  .ib-pep-flow .ib-pep-flow-stage .ib-trt-frequency-summary {
    margin-top: 5px;
  }

  .ib-pep-flow .ib-pep-flow-stage .ib-trt-interval-presets {
    margin-top: 4px;
  }

  html.ib-trt-page .ib-pep-flow .ib-pep-flow-stage .ib-qp-preset {
    height: 44px;
    min-height: 44px;
  }

  /* Mob-01 phone result (moved from ib-calc-share.css, which only loads on the share-enabled calculators, so every
     calculator page gets these).
     Mob-01 (design answer, 22 Nov): phone "Share this result" is a full-width glass button 10 under Track this dose (and its save hint). Desktop keeps the slotted pill above. */
  .ib-share:not(.is-slotted) { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; margin-top: 10px; }
  .ib-share:not(.is-slotted) .ib-share-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-sizing: border-box; width: 100%; height: 48px; margin: 0; padding: 0 16px;
    border-radius: var(--ib-radius-2xl);
    background: var(--ib-share-mob-bg);
    border: 1px solid var(--ib-share-mob-line);
    color: var(--ib-white);
    font-family: inherit; font-size: var(--ib-font-size-lg); font-weight: 600; line-height: 1;
    cursor: pointer;
  }
  .ib-share:not(.is-slotted) .ib-share-btn svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--ib-white); }
  .ib-share:not(.is-slotted) .ib-share-btn:focus-visible { outline: 2px solid var(--ib-ui-focus-on-blue); outline-offset: 2px; }
  .ib-share:not(.is-slotted) .ib-share-msg { text-align: center; }
  .ib-share:not(.is-slotted) .ib-share-msg:empty { display: none; }

  /* Mob-01 K1/K2 (design review of r3, 22 Nov; spec 644-646): phone result "Track this dose" is full width, 52 tall,
   r16, an 18px bookmark icon 8 from the text, 16/700; locked it keeps its size at 40% opacity. The save hint under it
   is centred 13/400 Text 3, 8 below Track; Share stays 10 below the hint. */
  body #root .ib-pep-flow-stage .ib-pep-flow-save.ib-pep-flow-save {
    display: flex !important; align-items: center; justify-content: center; gap: 8px;
    box-sizing: border-box; width: 100% !important; height: 52px !important; min-height: 52px !important;
    border-radius: var(--ib-radius-2xl) !important;
    font-size: var(--ib-font-size-xl) !important; font-weight: 700 !important;
  }
  body #root .ib-pep-flow-stage .ib-pep-flow-save.ib-pep-flow-save:disabled { opacity: 0.4; }
  /* After a save it reads "Saved" like desktop's Save (teal fill, white label, bookmark at 50%), full opacity. */
  body #root .ib-pep-flow-stage .ib-pep-flow-save.ib-pep-flow-save.is-saved {
    opacity: 1; background: var(--ib-navy-cta) !important; border-color: transparent !important;
    color: var(--ib-card-white) !important; box-shadow: none !important; cursor: default;
  }
  body #root .ib-pep-flow-stage .ib-pep-flow-save.ib-pep-flow-save.is-saved > svg { opacity: 0.5; }
  body #root .ib-pep-flow-stage .ib-pep-flow-save.ib-pep-flow-save > svg {
    flex: 0 0 auto; width: 18px !important; height: 18px !important; margin: 0 !important;
  }
  body #root .ib-pep-flow-stage .ib-pep-flow-save + .ib-caption {
    margin-top: 8px !important; text-align: center;
    font-size: var(--ib-font-size-md) !important; font-weight: 400 !important; line-height: 1.35;
    color: var(--ib-ui-text-3) !important;
  }
  /* "Saved to your schedules · Set start day →" sits 10 below Track (the stage here is a plain block). */
  body #root .ib-pep-flow-stage .ib-pep-flow-save + .ib-save-status { margin-top: 10px; }

  /* Mob-01 L1 (round 5, 22 Nov): the phone result stage is not a card itself; the result sits in .ib-pep-flow-resultcard
     (solid card, .07 line, r20, padding 18) and Track, the hint, Share and the Publish card sit outside it, Track 14 below
     the card edge (32 from the last result line). Every calculator's phone result renders through PhoneStageResult. */
  body #root .ib-pep-flow .ib-pep-flow-stage:has(> [data-tour="calc-result"]) {
    background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important;
  }
  body #root .ib-pep-flow .ib-pep-flow-resultcard {
    box-sizing: border-box; padding: 18px;
    background: var(--ib-ui-solid-card); border: 1px solid var(--ib-ui-card-surface-line); border-radius: var(--ib-radius-3xl);
  }
  body #root .ib-pep-flow .ib-pep-flow-resultcard > :last-child { margin-bottom: 0 !important; }
  body #root .ib-pep-flow .ib-pep-flow-resultcard + * { margin-top: 14px !important; }
}

/* I1234: no box of its own on the quick-picker input; the wrapper shows focus instead (overrides the global input:focus-visible outline in ib-tw.css) */
.ib-qp-input:focus,
.ib-qp-input:focus-visible {
  outline: none !important;
  box-shadow: none;
}

.ib-qp-box:has(.ib-qp-input:focus-visible) {
  outline: 2px solid var(--ib-action-navy);
  outline-offset: 2px;
}

