/**
 * FancyMeds mobile checkout sheet — reusable DealCatcher-style fold-up.
 *
 * Contract:
 * - Sticky bar: #sticky-cta (hidden while sheet open)
 * - Backdrop: #buy-backdrop.buy-backdrop (blocks page; does not dismiss)
 * - Panel: .fm-sheet-panel (teleported to body while open)
 * - body.sheet-open while open
 * - Dismiss: sky header tap, dimmed backdrop (plan sheet only), Close/Esc
 *
 * Include on any page that mounts FancyMedsCheckoutWidget + sticky bar.
 * Blog JS opens ≤860; homepage sticky opens ≤1023. Desktop (≥1024) never
 * sets sheet-open — Edit/Buy scroll to #finder instead.
 */

.buy-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(11, 18, 32, 0.45);
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  touch-action: none;
}
.buy-backdrop.is-open {
  display: block !important;
  z-index: 95;
  pointer-events: auto;
  touch-action: none;
}

.fm-sheet-panel .mobile-sheet-chrome {
  display: none;
}
.fm-sheet-panel .sheet-handle {
  width: 2.75rem;
  height: 5px;
  border-radius: 999px;
  background: #c5cedd;
  margin: 0 auto 0.2rem;
}
.fm-sheet-panel .sheet-chrome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
}
.fm-sheet-panel .sheet-chrome-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink, #0b1220);
}
.fm-sheet-panel .sheet-dismiss {
  display: none;
}
.fm-sheet-panel .sheet-dismiss-icon {
  display: block;
  width: 22px;
  height: 22px;
}
.fm-sheet-panel .sheet-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--blue, #2060f0);
  padding: 0.7rem 0.55rem;
  min-height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.fm-sheet-panel .sheet-done:hover,
.fm-sheet-panel .sheet-done:focus-visible {
  background: var(--sky, #f2f6fc);
}
.fm-sheet-panel .sheet-chrome-title.is-visually-hidden,
.fm-sheet-panel .sheet-done.is-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fm-sheet-up {
  from {
    transform: translateY(110%);
  }
  to {
    transform: translateY(0);
  }
}

/*
 * Sheet surface — phone + tablet (≤1023). Desktop never opens sheet-open
 * (JS mq gate). Blog stays ≤860 via its own FancyMedsMobileCheckoutSheet mq.
 */
@media (max-width: 1023px) {
  html.fm-sheet-lock,
  html.fm-sheet-lock body {
    overflow: hidden !important;
    scroll-behavior: auto !important;
  }
  body.sheet-open {
    overflow: hidden;
    /* Do not set touch-action: none on body — iOS Safari blocks taps on the
       fixed sheet and sticky bar even when children set pan-y/manipulation. */
  }

  /*
   * Flush to viewport bottom. Critical: override sticky-rail `top`
   * (e.g. top: var(--nav-offset)) or the sheet floats with a content gap.
   * Flex column: chrome stays put, form scrolls, CTA sticks to the sheet floor.
   */
  body.sheet-open .fm-sheet-panel {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    max-height: min(72vh, 560px);
    max-height: min(72dvh, 560px);
    margin: 0 !important;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    border-radius: 16px 16px 0 0;
    border: none;
    box-shadow: 0 -12px 40px rgba(11, 18, 32, 0.18);
    background: var(--paper, #fff);
    padding: 0 0 max(0.65rem, env(safe-area-inset-bottom, 0px));
    animation: fm-sheet-up 0.22s ease;
    touch-action: pan-y;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  body.sheet-open .fm-sheet-panel button,
  body.sheet-open .fm-sheet-panel a,
  body.sheet-open .fm-sheet-panel [role="switch"],
  body.sheet-open .fm-sheet-panel .fv4-summary,
  body.sheet-open .fm-sheet-panel .fv4-field,
  body.page-pdp.sheet-open aside.buy-box button,
  body.page-pdp.sheet-open aside.buy-box a,
  body.page-pdp.sheet-open aside.buy-box [role="switch"],
  body.page-pdp.sheet-open aside.buy-box .fv4-summary,
  body.page-pdp.sheet-open aside.buy-box .fv4-field {
    touch-action: manipulation;
  }

  /*
   * Unified sheet header — one sky UVP block (Patel: single promise, no duplicate chrome).
   * Grabber + “See your price” + promo toggle + shipping live in .rail-price-head.
   * Dismiss: tap sky header (.rail-price-head). Hidden #sheet-done for Esc/a11y only.
   */
  body.sheet-open .fm-sheet-panel .mobile-sheet-chrome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    display: block;
    flex: none;
    height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    overflow: hidden;
    pointer-events: none;
  }
  body.sheet-open .fm-sheet-panel .sheet-done {
    display: none !important;
  }
  body.sheet-open .fm-sheet-panel .sheet-chrome-row {
    display: none !important;
  }
  body.sheet-open .fm-sheet-panel .sheet-handle {
    display: none;
  }
  body.sheet-open .fm-sheet-panel .sheet-dismiss {
    display: none !important;
  }
  body.sheet-open .fm-sheet-panel .finder.finder-v4 > .rail-price-head {
    position: sticky;
    top: 0;
    z-index: 4;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.35rem 1rem 0;
    border-bottom: 1px solid var(--line, #dce3ee);
    border-radius: 16px 16px 0 0;
    background: var(--sky, #f2f6fc);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }
  body.sheet-open .fm-sheet-panel .rail-price-head::before {
    content: "";
    display: block;
    width: 2.75rem;
    height: 5px;
    margin: 0 auto 0.55rem;
    border-radius: 999px;
    background: #c5cedd;
  }
  body.sheet-open .fm-sheet-panel .rail-price-head-row {
    padding: 0.55rem 0 0.12rem;
    gap: 0.5rem 0.75rem;
  }
  body.sheet-open .fm-sheet-panel .rail-price-head .rail-label {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }

  body.sheet-open .fm-sheet-panel .finder.finder-v4 {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    box-shadow: none;
    border-radius: 0;
  }

  body.sheet-open .fm-sheet-panel .finder-v4.is-rate-check {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.sheet-open .fm-sheet-panel .finder-v4.is-rate-check .fv4-promo,
  body.sheet-open .fm-sheet-panel .finder-v4.is-rate-check .fv4-stepper {
    flex: 0 0 auto;
  }
  body.sheet-open .fm-sheet-panel .finder-v4.is-rate-check .fv4-rate-panel {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-rate-card {
    padding: 0.75rem 1rem 0.85rem;
  }
  body.sheet-open .fm-sheet-panel .finder-v4.is-rate-check .fv4-rate-card[data-rate-step="ask"] {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-rate-card h3 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-rate-card > p {
    font-size: 0.82rem;
    line-height: 1.4;
  }
  body.sheet-open .fm-sheet-panel .fv4-rate-card > p.lead {
    display: none;
  }
  body.sheet-open .fm-sheet-panel .fv4-rate-options {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 0.35rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-rate-actions {
    position: static;
    flex: 0 0 auto;
    z-index: 2;
    margin: 0;
    padding: 0.55rem 1rem env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid var(--line, #dce3ee);
  }

  /*
   * Sheet header matches in-page rail — keep “See your price”; only trim redundant notes.
   */
  body.sheet-open .fm-sheet-panel .rail-note {
    display: none !important;
  }

  body.sheet-open .fm-sheet-panel .fv4-promo {
    margin-top: 0;
    font-size: 0.82rem;
    font-weight: 550;
    padding: 0.12rem 0 0.65rem;
    text-align: left;
    background: transparent;
    border-bottom: 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-promo-extra {
    display: none;
  }
  body.sheet-open .fm-sheet-panel .fv4-stepper {
    display: none;
  }
  body.sheet-open .fm-sheet-panel .fv4-type-blurb {
    display: none;
  }
  body.sheet-open .fm-sheet-panel .fv4-status-row,
  body.sheet-open .fm-sheet-panel .fv4-cta-secondary {
    display: none !important;
  }
  /* Match desktop V4 dose chrome: inverted month-bar + hairline rates */
  body.sheet-open .fm-sheet-panel .fv4-month-bar {
    display: block;
  }
  body.sheet-open .fm-sheet-panel .finder-v4[data-show-compare="true"] .fv4-compare {
    display: flex;
  }
  /* Sheet already scrolls — don't nest-clip inverted month-bars */
  body.sheet-open .fm-sheet-panel .finder-v4[data-layout="wide"] .fv4-higher-list.is-open {
    max-height: none;
    overflow: visible;
  }
  body.sheet-open .fm-sheet-panel .fv4-schedule {
    font-size: 0.64rem;
    line-height: 1.3;
  }
  body.sheet-open .fm-sheet-panel .fv4-dose-card {
    --fv4-card-pad-y: 0.5rem;
    --fv4-card-pad-x: 0.6rem;
    gap: 0.2rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-body {
    padding: 0.32rem 1rem 0.5rem;
    gap: 0.4rem;
  }

  /* Keep Buy now reachable while scrolling the sheet.
   * Solid full-bleed dock: cancel .fv4-body's 1rem so the bar hits the sheet
   * edges. Do not fade or add a second 1rem — that inset the button 32px and
   * made it look like it was floating over the higher-dose list.
   * Panel overflow-x is hidden, so this does not widen scrollWidth. */
  body.sheet-open .fm-sheet-panel .fv4-cta-row {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0.4rem -1rem 0;
    padding: 0.55rem 1rem env(safe-area-inset-bottom, 0px);
    background: #fff;
    box-sizing: border-box;
  }

  /*
   * Compact type scale — match homepage #hero-plan-teaser density.
   * Scoped to the open sheet only; desktop ≥1024 in-hero V4 stays full size.
   * Home/blog: .fm-sheet-panel. PDP sticky sheet: #plan-picker.fm-sheet-panel
   * (in-page on the fold when closed; teleports on sticky Edit/Buy).
   */
  body.sheet-open .fm-sheet-panel .sheet-chrome-title,
  body.page-pdp.sheet-open aside.buy-box .sheet-chrome-title {
    font-size: 0.84rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-left,
  body.sheet-open .fm-sheet-panel .fv4-main,
  body.page-pdp.sheet-open aside.buy-box .fv4-left,
  body.page-pdp.sheet-open aside.buy-box .fv4-main {
    gap: 0.22rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-main,
  body.page-pdp.sheet-open aside.buy-box .fv4-main {
    gap: 0.28rem;
  }

  /* Settings rows: label left, value just left of chevron (fold teaser) */
  body.sheet-open .fm-sheet-panel .fv4-field[hidden],
  body.sheet-open .fm-sheet-panel .fv4-field.is-kayak[hidden],
  body.page-pdp.sheet-open aside.buy-box .fv4-field[hidden],
  body.page-pdp.sheet-open aside.buy-box .fv4-field.is-kayak[hidden] {
    display: none !important;
  }
  body.sheet-open .fm-sheet-panel .fv4-field,
  body.sheet-open .fm-sheet-panel .fv4-field.is-kayak,
  body.page-pdp.sheet-open aside.buy-box .fv4-field,
  body.page-pdp.sheet-open aside.buy-box .fv4-field.is-kayak {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 1.55rem 0.28rem 0.55rem;
    min-height: 44px;
    box-sizing: border-box;
  }
  body.sheet-open .fm-sheet-panel .fv4-field > label,
  body.sheet-open .fm-sheet-panel .fv4-field.is-kayak > label,
  body.page-pdp.sheet-open aside.buy-box .fv4-field > label,
  body.page-pdp.sheet-open aside.buy-box .fv4-field.is-kayak > label {
    flex: 0 0 5rem;
    margin: 0;
    font-size: 0.62rem;
    line-height: 1.2;
  }
  body.sheet-open .fm-sheet-panel .fv4-field select,
  body.page-pdp.sheet-open aside.buy-box .fv4-field select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 1.2rem;
    font-size: 0.84rem;
    text-align: right;
  }
  body.sheet-open .fm-sheet-panel .fv4-dd-trigger,
  body.page-pdp.sheet-open aside.buy-box .fv4-dd-trigger {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-dd-copy,
  body.page-pdp.sheet-open aside.buy-box .fv4-dd-copy {
    width: 100%;
    align-items: flex-end;
    padding-right: 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-dd-trigger.has-med-pill .fv4-dd-copy,
  body.page-pdp.sheet-open aside.buy-box .fv4-dd-trigger.has-med-pill .fv4-dd-copy {
    width: auto;
    flex: 1 1 auto;
    min-width: max-content;
    align-items: flex-start;
  }
  body.sheet-open .fm-sheet-panel .fv4-field.is-kayak:has(.fv4-dd-trigger.has-med-pill),
  body.page-pdp.sheet-open aside.buy-box .fv4-field.is-kayak:has(.fv4-dd-trigger.has-med-pill) {
    padding-right: 0.55rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-dd-value,
  body.page-pdp.sheet-open aside.buy-box .fv4-dd-value {
    width: 100%;
    font-size: 0.84rem;
    text-align: right;
  }
  body.sheet-open .fm-sheet-panel .fv4-dd-trigger.has-med-pill .fv4-dd-value,
  body.page-pdp.sheet-open aside.buy-box .fv4-dd-trigger.has-med-pill .fv4-dd-value {
    width: auto;
    text-align: left;
    overflow: visible;
    text-overflow: unset;
  }
  body.sheet-open .fm-sheet-panel .fv4-summary.has-med-pill,
  body.sheet-open .fm-sheet-panel .fv4-summary:has(> .fv4-dd-med-pill),
  body.page-pdp.sheet-open aside.buy-box .fv4-summary.has-med-pill,
  body.page-pdp.sheet-open aside.buy-box .fv4-summary:has(> .fv4-dd-med-pill) {
    justify-content: flex-start;
    gap: 0.45rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-summary.has-med-pill .fv4-summary-copy,
  body.sheet-open .fm-sheet-panel .fv4-summary:has(> .fv4-dd-med-pill) .fv4-summary-copy,
  body.page-pdp.sheet-open aside.buy-box .fv4-summary.has-med-pill .fv4-summary-copy,
  body.page-pdp.sheet-open aside.buy-box .fv4-summary:has(> .fv4-dd-med-pill) .fv4-summary-copy {
    flex: 1 1 auto;
    min-width: max-content;
  }
  body.sheet-open .fm-sheet-panel .fv4-summary.has-med-pill .fv4-summary-chevron,
  body.sheet-open .fm-sheet-panel .fv4-summary:has(> .fv4-dd-med-pill) .fv4-summary-chevron,
  body.page-pdp.sheet-open aside.buy-box .fv4-summary.has-med-pill .fv4-summary-chevron,
  body.page-pdp.sheet-open aside.buy-box .fv4-summary:has(> .fv4-dd-med-pill) .fv4-summary-chevron {
    margin-left: 0;
  }
  body.sheet-open .fm-sheet-panel .fm-state-field .fv4-dd-value,
  body.page-pdp.sheet-open aside.buy-box .fm-state-field .fv4-dd-value {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  body.sheet-open .fm-sheet-panel .fv4-field.is-kayak .fv4-dd-chevron,
  body.page-pdp.sheet-open aside.buy-box .fv4-field.is-kayak .fv4-dd-chevron {
    right: 0.55rem;
    width: 0.45rem;
    height: 0.45rem;
  }
  @media (max-width: 360px) {
    body.sheet-open .fm-sheet-panel .fv4-dd-trigger > .fv4-dd-med-pill,
    body.sheet-open .fm-sheet-panel .fv4-summary > .fv4-dd-med-pill,
    body.page-pdp.sheet-open aside.buy-box .fv4-dd-trigger > .fv4-dd-med-pill,
    body.page-pdp.sheet-open aside.buy-box .fv4-summary > .fv4-dd-med-pill {
      display: none;
    }
  }

  body.sheet-open .fm-sheet-panel .fv4-dose-head,
  body.page-pdp.sheet-open aside.buy-box .fv4-dose-head {
    gap: 0.4rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-dose-head strong,
  body.page-pdp.sheet-open aside.buy-box .fv4-dose-head strong {
    font-size: 0.78rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-month-bar,
  body.page-pdp.sheet-open aside.buy-box .fv4-month-bar {
    padding: 0.28rem 0.65rem;
    font-size: 0.68rem;
    margin-bottom: 0.12rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-mg,
  body.page-pdp.sheet-open aside.buy-box .fv4-mg {
    font-size: 0.92rem;
    letter-spacing: -0.03em;
  }
  body.sheet-open .fm-sheet-panel .fv4-price .amt,
  body.page-pdp.sheet-open aside.buy-box .fv4-price .amt {
    font-size: 1.15rem;
    letter-spacing: -0.03em;
  }
  body.sheet-open .fm-sheet-panel .fv4-price .sub,
  body.page-pdp.sheet-open aside.buy-box .fv4-price .sub {
    font-size: 0.62rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-price-col,
  body.page-pdp.sheet-open aside.buy-box .fv4-price-col {
    min-width: 4.25rem;
    gap: 0.08rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-dose-main,
  body.page-pdp.sheet-open aside.buy-box .fv4-dose-main {
    column-gap: 0.45rem;
    row-gap: 0.2rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-compare,
  body.page-pdp.sheet-open aside.buy-box .fv4-compare {
    margin-top: 0.55rem;
    padding: 0.32rem 0 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-afford.fv4-works-out,
  body.page-pdp.sheet-open aside.buy-box .fv4-afford.fv4-works-out {
    gap: 0.16rem 0.35rem;
    font-size: 0.6875rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-whisper,
  body.page-pdp.sheet-open aside.buy-box .fv4-whisper {
    font-size: 0.68rem;
    min-height: 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-num,
  body.page-pdp.sheet-open aside.buy-box .fv4-num {
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.05;
  }
  body.sheet-open .fm-sheet-panel .fv4-sfx,
  body.page-pdp.sheet-open aside.buy-box .fv4-sfx {
    font-size: 0.58rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-inline-rates .fv4-cell,
  body.page-pdp.sheet-open aside.buy-box .fv4-inline-rates .fv4-cell {
    padding: 0.04rem 0.35rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-vdiv,
  body.page-pdp.sheet-open aside.buy-box .fv4-vdiv {
    min-height: 0.85rem;
    margin: 0 0.04rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-val-line,
  body.page-pdp.sheet-open aside.buy-box .fv4-val-line {
    gap: 0.06rem;
  }

  body.sheet-open .fm-sheet-panel .fv4-higher,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher {
    padding: 0.32rem 0.55rem;
    min-height: 44px;
    gap: 0.45rem;
    box-sizing: border-box;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-q,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-q {
    font-size: 0.78rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-action,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-action {
    font-size: 0.68rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher .chev,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher .chev {
    width: 0.45rem;
    height: 0.45rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-list,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-list {
    gap: 0.28rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-callout,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-callout {
    padding: 0.4rem 0.55rem;
    font-size: 0.64rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-heading,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-heading {
    font-size: 0.64rem;
  }

  /* Higher-dose ladder: inverted tops stay, stacked cards shrink */
  body.sheet-open .fm-sheet-panel .fv4-higher-opt,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt {
    --fv4-card-pad-y: 0.42rem;
    --fv4-card-pad-x: 0.55rem;
    gap: 0.16rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-month-bar,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-month-bar {
    padding: 0.24rem 0.55rem;
    font-size: 0.64rem;
    margin-bottom: 0.08rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-mg,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-mg {
    font-size: 0.82rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-price .amt,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-price .amt {
    font-size: 1.05rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-schedule,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-schedule {
    font-size: 0.62rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-price .sub,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-price .sub {
    font-size: 0.58rem;
    margin-top: 0.04rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-compare,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-compare {
    margin-top: 0.35rem;
    padding-top: 0.28rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-num,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-num {
    font-size: 0.78rem;
    font-weight: 650;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-whisper,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-whisper {
    font-size: 0.62rem;
    min-height: 0;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-sfx,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-sfx {
    font-size: 0.54rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-inline-rates .fv4-cell,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-inline-rates .fv4-cell {
    padding: 0.01rem 0.28rem;
  }
  body.sheet-open .fm-sheet-panel .fv4-higher-opt .fv4-vdiv,
  body.page-pdp.sheet-open aside.buy-box .fv4-higher-opt .fv4-vdiv {
    min-height: 0.78rem;
  }

  body.sheet-open .fm-sheet-panel .fv4-cta,
  body.page-pdp.sheet-open aside.buy-box .fv4-cta {
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 800;
    border-radius: 8px;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-body {
    padding: 0.32rem 1rem 0.5rem;
    gap: 0.4rem;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-dose-card {
    --fv4-card-pad-y: 0.5rem;
    --fv4-card-pad-x: 0.6rem;
    gap: 0.2rem;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-schedule {
    font-size: 0.64rem;
    line-height: 1.3;
  }

  body.sheet-open .sticky-cta {
    display: none !important;
  }

  /* Chat must not peek through the sheet edge */
  body.sheet-open chat-widget,
  body.sheet-open [data-fm-ghl-chat],
  body.sheet-open #chat-widget-container {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* PDP buy-rail sheet — same Close + compact chrome as home.
     Scope to aside#plan-picker so blog's inner .buy-box is not double-constrained. */
  body.page-pdp.sheet-open aside#plan-picker.buy-box,
  body.page-pdp.sheet-open aside.buy-box.fm-sheet-panel#plan-picker {
    z-index: 100;
    bottom: 0 !important;
    max-height: min(72vh, 560px) !important;
    max-height: min(72dvh, 560px) !important;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 0 max(0.65rem, env(safe-area-inset-bottom, 0px)) !important;
    border: none !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -12px 40px rgba(11, 18, 32, 0.18) !important;
    background: #fff !important;
  }
  body.page-pdp.sheet-open aside.buy-box .mobile-sheet-chrome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    display: block;
    height: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    overflow: hidden;
    pointer-events: none;
  }
  body.page-pdp.sheet-open aside.buy-box .sheet-done {
    display: none !important;
  }
  body.page-pdp.sheet-open aside.buy-box .sheet-chrome-row {
    display: none !important;
  }
  body.page-pdp.sheet-open aside.buy-box .sheet-handle {
    display: none;
  }
  body.page-pdp.sheet-open aside.buy-box .sheet-dismiss {
    display: none !important;
  }
  body.page-pdp.sheet-open aside#plan-picker .finder.finder-v4 > .rail-price-head {
    position: sticky;
    top: 0;
    z-index: 4;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0.35rem 1rem 0 !important;
    border-bottom: 1px solid var(--line, #dce3ee) !important;
    border-radius: 16px 16px 0 0 !important;
    background: var(--sky, #f2f6fc) !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }
  body.page-pdp.sheet-open aside#plan-picker .rail-price-head::before {
    content: "";
    display: block;
    width: 2.75rem;
    height: 5px;
    margin: 0 auto 0.55rem;
    border-radius: 999px;
    background: #c5cedd;
  }
  body.page-pdp.sheet-open aside.buy-box .rail-price-head-row {
    padding: 0.55rem 0 0.12rem;
  }
  body.page-pdp.sheet-open aside.buy-box .finder.finder-v4 {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-stepper,
  body.page-pdp.sheet-open aside.buy-box .fv4-type-blurb,
  body.page-pdp.sheet-open aside.buy-box .fv4-status-row,
  body.page-pdp.sheet-open aside.buy-box .fv4-promo-extra {
    display: none !important;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-month-bar {
    display: block;
  }
  body.page-pdp.sheet-open aside.buy-box .finder-v4[data-show-compare="true"] .fv4-compare {
    display: flex;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-promo {
    font-size: 0.82rem;
    font-weight: 550;
    padding: 0.12rem 0 0.65rem;
    text-align: left;
    background: transparent;
    border-bottom: 0;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-cta-row,
  body.page-pdp.sheet-open aside.buy-box .fv4-rate-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0.4rem -1rem 0;
    padding: 0.55rem 1rem env(safe-area-inset-bottom, 0px);
    background: #fff;
    box-sizing: border-box;
  }
  body.page-pdp.sheet-open aside.buy-box .finder-v4.is-rate-check {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.page-pdp.sheet-open aside.buy-box .finder-v4.is-rate-check .fv4-rate-panel,
  body.page-pdp.sheet-open aside.buy-box .finder-v4.is-rate-check .fv4-rate-card[data-rate-step="ask"] {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-rate-options {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }
  body.page-pdp.sheet-open aside.buy-box .fv4-rate-actions {
    position: static;
    flex: 0 0 auto;
    border-top: 1px solid var(--line, #dce3ee);
  }

  /*
   * Checkout (Buy now) — grow past the plan-picker 72vh/560 cap so Review /
   * Payment / Shipping fields sit on screen. Plan picker stays on the short
   * sheet. Keyboard uses --fm-sheet-vvh from visualViewport.
   */
  body.sheet-open.fm-checkout-open .fm-sheet-panel,
  body.page-pdp.sheet-open.fm-checkout-open aside#plan-picker.buy-box,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box.fm-sheet-panel#plan-picker {
    max-height: calc(100dvh - 8px) !important;
  }
  body.sheet-open.fm-checkout-open.fm-sheet-keyboard .fm-sheet-panel,
  body.page-pdp.sheet-open.fm-checkout-open.fm-sheet-keyboard aside#plan-picker.buy-box,
  body.page-pdp.sheet-open.fm-checkout-open.fm-sheet-keyboard aside.buy-box.fm-sheet-panel#plan-picker {
    max-height: var(--fm-sheet-vvh, 92dvh) !important;
    height: var(--fm-sheet-vvh, auto) !important;
  }
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder.finder-v4,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder.finder-v4 {
    scroll-padding-bottom: 5.75rem;
  }
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout .fv4-co-lead,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout .fv4-co-lead {
    display: none;
  }

  /* Pin Review CTA like Payment / Shipping — Continue must stay in the thumb zone. */
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="review"] .fv4-co-actions,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-actions,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-actions,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="review"] .fv4-co-actions,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-actions,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 0.55rem;
    padding: 0.5rem 0 max(0.45rem, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 22%);
  }

  /* Payment / Shipping: one-line recap. Full card stays on Review. */
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem 0.65rem;
    margin: 0 0 0.65rem;
    padding: 0.45rem 0.7rem;
  }
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="payment"] [data-co-recap-detail],
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="shipping"] [data-co-recap-detail],
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-note,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-note,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="payment"] .fv4-dd-med-pill,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-dd-med-pill,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="payment"] [data-co-recap-detail],
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="shipping"] [data-co-recap-detail],
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-note,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-note,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="payment"] .fv4-dd-med-pill,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-dd-med-pill {
    display: none !important;
  }
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-main strong,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-main strong,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-main strong,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-main strong {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    font-size: 0.82rem;
    line-height: 1.25;
  }
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-price,
  body.sheet-open.fm-checkout-open .fm-sheet-panel .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-price,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-price,
  body.page-pdp.sheet-open.fm-checkout-open aside.buy-box .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-price {
    font-size: 1.02rem;
    align-self: center;
  }

  /* Same compact recap if checkout paints before the sheet class lands. */
  .finder-v4.is-checkout [data-co-panel="payment"] [data-co-recap-detail],
  .finder-v4.is-checkout [data-co-panel="shipping"] [data-co-recap-detail],
  .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-note,
  .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-note,
  .finder-v4.is-checkout [data-co-panel="payment"] .fv4-dd-med-pill,
  .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-dd-med-pill {
    display: none !important;
  }
  .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap,
  .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap {
    align-items: center;
    gap: 0.25rem 0.65rem;
    margin-bottom: 0.65rem;
    padding: 0.45rem 0.7rem;
  }
  .finder-v4.is-checkout [data-co-panel="payment"] .fv4-co-recap-main strong,
  .finder-v4.is-checkout [data-co-panel="shipping"] .fv4-co-recap-main strong {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    font-size: 0.82rem;
  }
}
