/* ---------- All sizes ---------- */
#bbbm .bbbm-dialog, #bbbm .bbbm-head, #bbbm .bbbm-body, #bbbm .bbbm-rail, #bbbm .bbbm-cal,
#bbbm details.bbbm-more { background: #fff !important; }
#bbbm .bbbm-step, #bbbm .bbbm-sub, #bbbm .bbbm-mini, #bbbm .bbbm-tz { display: none !important; }
#bbbm .bbbm-facts { display: none !important; }
#bbbm h2.bbbm-title { margin: 0 !important; }

/* ---------- Desktop: header, benefit strip, calendar. Nothing else. ---------- */
#bbbm .bbbm-strip { display: none; }
@media (min-width: 861px) {
  #bbbm .bbbm-dialog { height: min(840px, calc(100dvh - 24px)) !important; }
  #bbbm .bbbm-head { display: flex !important; align-items: center; gap: 18px; padding: 12px 72px 10px 28px !important; border-bottom: 1px solid var(--line) !important; }
  #bbbm h2.bbbm-title { font-size: 24px !important; line-height: 1.2 !important; }
  #bbbm .bbbm-rate { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
  #bbbm .bbbm-rate svg { width: 13px; height: 13px; color: var(--gold); fill: currentColor; }
  #bbbm .bbbm-rate b { color: var(--ink); font-weight: 600; }
  #bbbm .bbbm-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 0; padding: 10px 28px; list-style: none; border-bottom: 1px solid var(--line); }
  #bbbm .bbbm-strip li { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
  #bbbm .bbbm-strip svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; color: var(--green); }
  #bbbm .bbbm-body { display: flex !important; flex-direction: column; }
  #bbbm .bbbm-rail { display: none !important; }
  #bbbm .bbbm-cal { flex: 1 1 auto !important; }
}

/* ---------- Phones and tablets ---------- */
@media (max-width: 860px) {
  #bbbm .bbbm-rate { display: none; }
  #bbbm .bbbm-head { padding: calc(12px + env(safe-area-inset-top, 0px)) 60px 12px 16px !important; border-bottom: 1px solid var(--line) !important; }
  #bbbm h2.bbbm-title { font-size: 20px !important; line-height: 1.2 !important; }
  #bbbm .bbbm-x { top: calc(4px + env(safe-area-inset-top, 0px)) !important; }

  /* One page scroll instead of a scroll trapped inside HubSpot's frame. */
  #bbbm .bbbm-body { overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

  /* Calendar frame sized to the month view, so no dead navy block. HubSpot doesn't report its height on phones. */
  #bbbm .bbbm-cal { flex: 0 0 auto !important; height: 590px !important; /* fits a six-week month at phone width */ }

  /* Benefits and rating under the calendar, using the popup's existing panel. */
  #bbbm details.bbbm-more { display: block !important; padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)) !important; border-top: 1px solid var(--line) !important; }
  #bbbm details.bbbm-more > summary { display: none !important; }
  #bbbm details.bbbm-more h3 { font-size: 13px !important; margin: 16px 0 8px !important; }
  #bbbm details.bbbm-more li { font-size: 14.5px; line-height: 1.45; }
  #bbbm details.bbbm-more .bbbm-later { font-size: 13px; color: var(--muted); }

  /* Once the visitor taps into the calendar, it takes the full screen so the time list isn't squeezed. */
  #bbbm.bbbm-picking .bbbm-body { overflow: hidden !important; }
  #bbbm.bbbm-picking .bbbm-cal { flex: 1 1 auto !important; height: auto !important; }
  #bbbm.bbbm-picking details.bbbm-more { display: none !important; }
}

/* Tablets (640-860px): HubSpot shows calendar and times side by side from about 640px. Its card is about
   680px tall there, so the frame matches it and the benefits sit straight underneath. */
@media (min-width: 640px) and (max-width: 860px) {
  #bbbm .bbbm-body, #bbbm.bbbm-picking .bbbm-body { overflow-y: auto !important; }
  #bbbm .bbbm-cal, #bbbm.bbbm-picking .bbbm-cal { flex: 0 0 auto !important; height: 690px !important; }
  #bbbm.bbbm-picking details.bbbm-more { display: block !important; }
}
