/*
 * Booking dialog (Calendly inline widget).
 * Calendly switches to its two-column layout (calendar beside time slots) once
 * the iframe is at least ~900px wide; below that it stacks and five of six
 * slots fall below the fold. The desktop dialog is sized to clear that width
 * and the iframe height follows the viewport so the card is not clipped.
 */
.lr-booking {
  --lr-toolbar-h: 61px;
  --lr-edge: 32px;
  box-sizing: border-box;
  width: min(960px, calc(100% - var(--lr-edge)));
  max-width: none;
  max-height: calc(100dvh - var(--lr-edge));
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  font-family: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-synthesis-weight: none;
}

.lr-booking::backdrop { background: rgba(15, 23, 42, .6); }
.lr-booking [hidden] { display: none !important; }

.lr-booking__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  min-height: var(--lr-toolbar-h);
  padding: 12px 12px 12px 24px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.5;
}
.lr-booking__toolbar h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.lr-booking__close {
  display: grid;
  place-items: center;
  grid-column: 2;
  grid-row: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #dbe3ee;
  border-radius: 50%;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.lr-booking__close:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
/* Retry follows the status message, so the explanation reads first. */
.lr-booking__retry {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 16px 24px 20px;
  padding: 0 16px;
  border: 1px solid #2c4bff;
  border-radius: 999px;
  background: #fff;
  color: #2c4bff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.lr-booking__retry:hover { background: #f5f7fa; }

.lr-booking__status {
  margin: 0;
  padding: 12px 24px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.lr-booking__widget {
  width: 100%;
  height: min(700px, calc(100dvh - var(--lr-edge) - var(--lr-toolbar-h) - 2px));
  min-height: 320px;
  overflow: hidden;
}
.lr-booking__widget iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

.lr-booking :is(a, button):focus-visible {
  outline: 2px solid #2c4bff;
  outline-offset: 3px;
}
html.lr-booking-open { overflow: hidden; }

/* Tablets and small laptops (521-939px): Calendly cannot fit its side-by-side
   layout, so give it a narrow frame where it uses the compact date -> times
   flow, and enough height that every slot is visible without inner scrolling. */
@media (min-width: 521px) and (max-width: 939px) {
  .lr-booking { width: min(620px, calc(100% - 32px)); }
  .lr-booking__widget { height: min(780px, calc(100dvh - var(--lr-edge) - var(--lr-toolbar-h) - 2px)); }
}

/* Short desktop screens (e.g. 1280x720): Calendly's two-column page starts
   with ~66px of empty space above its card. Use a smaller edge and trim part
   of that space so the whole card fits without scrolling inside the frame. */
@media (min-width: 940px) and (max-height: 800px) {
  .lr-booking { --lr-edge: 16px; }
  .lr-booking__widget iframe {
    height: calc(100% + 40px) !important;
    margin-top: -40px;
  }
}

@media (max-width: 520px) {
  .lr-booking {
    /* --lr-toolbar-h stays 61px: 8px + 44px close button + 8px + 1px border,
       the same as desktop (12 + 36 + 12 + 1), so the widget fills the sheet exactly. */
    width: 100%;
    /* Full-screen sheet in every state, including the error state. */
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .lr-booking__toolbar { padding: 8px 8px 8px 16px; }
  .lr-booking__toolbar h2 { font-size: 18px; }
  .lr-booking__close { width: 44px; height: 44px; }
  .lr-booking__retry { min-height: 44px; margin-inline: 16px; }
  .lr-booking__status { padding: 12px 16px; }
  .lr-booking__widget { height: calc(100dvh - var(--lr-toolbar-h)); }
}
