/*
  BokaTid embed calendar - base styles
  This file is meant to be included by customers via <link rel="stylesheet">.
  Theme is controlled by variables and optional theme files.
*/

.bt-cal {
  --bt-font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* If your site has a fixed header, set this to the header height (e.g. 64px)
     on the calendar container or :root to avoid the embed being too tall. */
  /* Neutral defaults (works even without a theme file) */
  --bt-bg: #ffffff;
  --bt-text: #111827;
  --bt-muted: #6b7280;
  --bt-border: #e5e7eb;
  --bt-border-strong: #cccccc;
  --bt-surface: #ffffff;
  --bt-surface-muted: #f7f7f7;
  --bt-danger-bg: #fff5f5;
  --bt-danger-border: #ffd6d6;
  --bt-danger-text: #8a1f1f;
  --bt-success-bg: color-mix(in srgb, #22c55e 10%, var(--bt-surface));
  --bt-success-border: color-mix(in srgb, #22c55e 48%, var(--bt-border));
  --bt-success-text: color-mix(in srgb, #22c55e 72%, var(--bt-text));
  --bt-primary: #2563eb;
  --bt-primary-contrast: #ffffff;

  font-family: var(--bt-font);
  background: var(--bt-bg);
  color: var(--bt-text);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  cursor: default;
}

/*
  Optional: Fit the whole widget to the viewport height.
  Enable by passing `rootClassName: 'bt-cal--fitViewport'` to init(), or by adding the class to the root element.

  This is useful when the host page has a fixed header and you want the calendar to avoid pushing content below the fold.
*/
.bt-cal.bt-cal--fitViewport {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--bt-embed-offset-top, 0px));
  height: calc(100dvh - var(--bt-embed-offset-top, 0px));
  max-height: calc(100vh - var(--bt-embed-offset-top, 0px));
  max-height: calc(100dvh - var(--bt-embed-offset-top, 0px));
  overflow: hidden;
}

/* In flex-column layouts, don't let the header chrome (bar/day strip) shrink and clip text. */
.bt-cal.bt-cal--fitViewport .bt-cal__bar,
.bt-cal.bt-cal--fitViewport .bt-cal__dayStrip {
  flex: 0 0 auto;
}

.bt-cal.bt-cal--fitViewport .bt-cal__grid,
.bt-cal.bt-cal--fitViewport .bt-cal__services,
.bt-cal.bt-cal--fitViewport .bt-cal__tabView {
  flex: 1 1 auto;
  min-height: 0;
}

.bt-cal.bt-cal--fitViewport .bt-cal__grid {
  overflow: auto;
}

/* Sessions layout: make the active view fill available height above the bottom menu */
.bt-cal.bt-cal--sessions {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: calc(100vh - var(--bt-embed-offset-top, 0px));
  min-height: calc(100dvh - var(--bt-embed-offset-top, 0px));
}

.bt-cal.bt-cal--sessions .bt-cal__bar,
.bt-cal.bt-cal--sessions .bt-cal__dayStrip {
  flex: 0 0 auto;
}

.bt-cal.bt-cal--sessions .bt-cal__bottomNav {
  flex: 0 0 auto;
}

.bt-cal.bt-cal--sessions .bt-cal__grid.bt-cal__grid--agenda,
.bt-cal.bt-cal--sessions .bt-cal__tabView,
.bt-cal.bt-cal--sessions .bt-cal__services {
  flex: 1 1 auto;
  overflow: auto;
}

.bt-cal.bt-cal--sessions .bt-cal__grid.bt-cal__grid--agenda {
  padding-bottom: 6px;
}

.bt-cal.bt-cal--sessions .bt-cal__tabView {
  padding-bottom: 0;
}

.bt-cal.bt-cal--accountView > .bt-cal__bar,
.bt-cal.bt-cal--accountView > .bt-cal__dayStrip,
.bt-cal.bt-cal--accountView > .bt-cal__filtersPanel,
.bt-cal.bt-cal--accountView > .bt-cal__servicePicker,
.bt-cal.bt-cal--accountView > .bt-cal__weekResourcePicker,
.bt-cal.bt-cal--accountView > .bt-cal__adminTargetPicker,
.bt-cal.bt-cal--accountView > .bt-cal__selectedRow,
.bt-cal.bt-cal--accountView > .bt-cal__services,
.bt-cal.bt-cal--accountView > .bt-cal__filters,
.bt-cal.bt-cal--accountView > .bt-cal__msg,
.bt-cal.bt-cal--accountView > .bt-cal__grid,
.bt-cal.bt-cal--accountView > .bt-cal__selectedFooter {
  display: none !important;
}

.bt-cal * { box-sizing: border-box; }

.bt-cal__visuallyHidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bt-cal button:not(:disabled),
.bt-cal a[href],
.bt-cal [role="button"]:not([aria-disabled="true"]),
.bt-cal select,
.bt-cal input[type="checkbox"],
.bt-cal input[type="radio"] {
  cursor: pointer;
}

.bt-cal button:disabled {
  cursor: not-allowed;
}

.bt-cal.bt-cal--closed {
  min-height: clamp(260px, 45vh, 520px);
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 56px);
  overflow: visible;
}

.bt-cal__closedState {
  width: min(680px, 100%);
  padding: clamp(20px, 4vw, 36px);
  border-left: 5px solid var(--bt-danger-text);
  background: var(--bt-danger-bg);
  color: var(--bt-text);
}

.bt-cal__closedLabel {
  color: var(--bt-danger-text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.bt-cal__closedTitle {
  margin: 7px 0 10px;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.15;
  letter-spacing: 0;
}

.bt-cal__closedMessage {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.bt-cal__closedPeriod {
  margin: 18px 0 0;
  color: var(--bt-muted);
  font-size: 13px;
  font-weight: 700;
}

.bt-cal__bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bt-cal__barSide { min-width: 120px; }

.bt-cal__title {
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.bt-cal__titleRange { font-size: 16px; letter-spacing: 0.5px; }
.bt-cal__titleWeek { font-size: 12px; color: var(--bt-muted); font-weight: 600; margin-top: 2px; }

/* Sessions/resource grid: compact one-row header (prev/title/filter/lang/next) */
.bt-cal.bt-cal--sessions .bt-cal__bar,
.bt-cal.bt-cal--resourceGrid .bt-cal__bar {
  margin-bottom: 4px;
  flex-wrap: nowrap;
}

.bt-cal.bt-cal--sessions .bt-cal__barSide,
.bt-cal.bt-cal--resourceGrid .bt-cal__barSide {
  min-width: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bt-cal.bt-cal--sessions .bt-cal__title,
.bt-cal.bt-cal--resourceGrid .bt-cal__title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.bt-cal.bt-cal--sessions .bt-cal__titleRange,
.bt-cal.bt-cal--resourceGrid .bt-cal__titleRange {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-cal.bt-cal--sessions .bt-cal__titleWeek,
.bt-cal.bt-cal--resourceGrid .bt-cal__titleWeek {
  min-width: 0;
  margin-top: 0;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-cal__btn {
  border: 1px solid var(--bt-border-strong);
  background: var(--bt-surface);
  color: var(--bt-text);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
}

.bt-cal__btn:disabled { opacity: 0.5; cursor: not-allowed; }

.bt-cal__nav {
  border: none;
  background: transparent;
  color: var(--bt-primary);
  padding: 6px 4px;
  cursor: pointer;
  font-weight: 600;
}

.bt-cal__languageSelect {
  width: 142px;
  max-width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 30px 0 10px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 6px;
  background-color: var(--bt-surface);
  color: var(--bt-text);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-cal__languageSelect:focus-visible {
  outline: 2px solid var(--bt-primary);
  outline-offset: 2px;
}

.bt-cal__languagePicker {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 42px;
  height: 36px;
}

.bt-cal__languagePicker .bt-cal__languageSelect {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.bt-cal__languageFlag {
  display: grid;
  width: 42px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--bt-border-strong);
  border-radius: 10px;
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  line-height: 1;
}

.bt-cal__languageFlag svg {
  display: block;
  width: 27px;
  height: 19px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bt-text) 12%, transparent);
}

.bt-cal__languagePicker:hover .bt-cal__languageFlag {
  border-color: var(--bt-primary);
  background: color-mix(in srgb, var(--bt-primary) 7%, var(--bt-surface-muted));
}

.bt-cal__languagePicker:focus-within .bt-cal__languageFlag {
  outline: 2px solid var(--bt-primary);
  outline-offset: 2px;
}

.bt-cal__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.bt-cal__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}

.bt-cal__field label { font-size: 12px; color: var(--bt-muted); }

.bt-cal__field select,
.bt-cal__field input {
  padding: 6px 8px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 6px;
  background: var(--bt-surface);
  color: var(--bt-text);
}

.bt-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  border: 1px solid var(--bt-border);
}

/* Sessions mode: agenda/list view */
.bt-cal__grid.bt-cal__grid--agenda {
  display: block;
  grid-template-columns: none;
  border-radius: 12px;
  background: var(--bt-surface);
  padding-bottom: 72px;
}

.bt-cal__dayStrip {
  display: flex;
  gap: 8px;
  padding: 10px 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: var(--bt-embed-offset-top, 0px);
  z-index: 20;
  background: var(--bt-surface, var(--bt-bg));
  border-bottom: 1px solid var(--bt-border);
}

/* Hide scrollbars where supported (still scrollable). */
.bt-cal__dayStrip { scrollbar-width: none; }
.bt-cal__dayStrip::-webkit-scrollbar { display: none; }

/* In fit-viewport mode the grid scrolls internally, so the day strip is always visible without sticky.
   Disabling sticky here avoids rare browser layering issues where the scroll layer can paint above it. */
.bt-cal.bt-cal--fitViewport .bt-cal__dayStrip {
  position: relative;
  top: auto;
}

.bt-cal__weekChip {
  border: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
  color: var(--bt-muted);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.bt-cal__weekChip--inList {
  margin: 10px auto 4px;
  max-width: 92%;
  justify-content: center;
}

.bt-cal__edgeHint {
  appearance: none;
  display: flex;
  margin: 10px auto;
  padding: 8px 10px;
  border: 1px dashed var(--bt-border-strong);
  border-radius: 999px;
  background: var(--bt-surface-muted);
  color: var(--bt-muted);
  font-weight: 700;
  font-size: 12px;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 92%;
  cursor: pointer;
}

.bt-cal__edgeHint:disabled {
  opacity: 0.55;
  cursor: default;
}

.bt-cal__dayChip {
  border: 1px solid var(--bt-border);
  background: var(--bt-surface);
  color: var(--bt-text);
  border-radius: 12px;
  padding: 8px 10px;
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: auto;
  overflow: visible;
}

.bt-cal__dayChip.is-active {
  border-color: var(--bt-primary);
  box-shadow: inset 0 -3px 0 var(--bt-primary);
}

.bt-cal__dayChip.is-active .bt-cal__dayChipDate {
  color: var(--bt-primary);
}

.bt-cal__dayChipName {
  font-size: 12px;
  color: var(--bt-muted);
  font-weight: 700;
  width: 100%;
  max-width: 100%;
  text-align: center;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.bt-cal__dayLabel { display: none; }

/* Day strip weekday name strategy:
   Full -> 3 letters -> 2 letters -> 1 letter, then reduce font-size as last resort.
   JS toggles one of these classes on the root.
*/
.bt-cal__dayLabel--full { display: inline; }
.bt-cal.bt-cal--dayName-3 .bt-cal__dayLabel { display: none; }
.bt-cal.bt-cal--dayName-3 .bt-cal__dayLabel--short { display: inline; }

.bt-cal.bt-cal--dayName-2 .bt-cal__dayLabel { display: none; }
.bt-cal.bt-cal--dayName-2 .bt-cal__dayLabel--mini2 { display: inline; }

.bt-cal.bt-cal--dayName-1 .bt-cal__dayLabel { display: none; }
.bt-cal.bt-cal--dayName-1 .bt-cal__dayLabel--initial { display: inline; }

.bt-cal.bt-cal--dayName-xs .bt-cal__dayChipName { font-size: 9px; }
.bt-cal__dayChipDate {
  font-size: 14px;
  font-weight: 800;
  width: 100%;
  text-align: center;
  line-height: 1;
}

/* Mobile/tablet: make day strip fully visible (no horizontal scroll) */
@media (max-width: 768px) {
  .bt-cal__dayStrip {
    gap: 4px;
    padding: 8px 4px;
  }

  .bt-cal__dayChip {
    padding: 7px 4px;
    border-radius: 10px;
  }

  .bt-cal__dayChipName { font-size: 11px; }
  .bt-cal__dayChipDate { font-size: 13px; }
}

@media (max-width: 520px) {
  .bt-cal__dayChip { padding: 6px 3px; }
  .bt-cal__dayChipName { font-size: 10px; }
  .bt-cal__dayChipDate { font-size: 12px; }
}

@media (max-width: 520px) {
  .bt-cal.bt-cal--dayName-xs .bt-cal__dayChipName { font-size: 8px; }
}

.bt-cal__agendaDay { padding: 8px 8px 14px; }

.bt-cal__agendaDayHeader {
  padding: 8px 6px;
  font-weight: 800;
  border-bottom: 1px solid var(--bt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bt-cal__agendaEmpty { padding: 12px 6px; color: var(--bt-muted); }

.bt-cal__gridEmpty {
  grid-column: 1 / -1;
  padding: 14px 10px 10px;
  color: var(--bt-muted);
  text-align: center;
  font-weight: 700;
}

.bt-cal__agendaCard {
  width: 100%;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: center;
  padding: 0;
  margin-top: 10px;
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  background: var(--bt-surface);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}

.bt-cal__agendaCard:disabled { opacity: 0.55; cursor: not-allowed; }
.bt-cal__agendaCard.is-rule-limited:disabled {
  opacity: 1;
  border-color: color-mix(in srgb, #d48b16 45%, var(--bt-border));
  background: color-mix(in srgb, #f4b942 9%, var(--bt-surface));
}

.bt-cal__agendaLeft { display: flex; flex-direction: column; gap: 2px; }
.bt-cal__agendaTime { font-weight: 900; font-size: 14px; }
.bt-cal__agendaMeta { font-size: 12px; color: var(--bt-muted); font-weight: 700; }

.bt-cal__agendaMid { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* New sessions card layout (image left, time overlay, info right) */
.bt-cal__agendaMedia {
  position: relative;
  width: 96px;
  height: 100%;
  min-height: 76px;
  background: var(--bt-surface-muted);
}

.bt-cal__agendaMedia img,
.bt-cal__agendaMedia .bt-cal__agendaImgPh {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bt-cal__agendaTimeBadge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.bt-cal__agendaInfo {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
}
.bt-cal__agendaTitle { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-cal__agendaSub { font-size: 12px; color: var(--bt-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Agenda metadata 2-column layout */
.bt-cal__agendaMeta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.bt-cal__agendaMetaCol {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bt-cal__agendaMetaItem {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--bt-muted);
}

.bt-cal__agendaMetaItem svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.bt-cal__agendaRight {
  width: 86px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
}

.bt-cal__agendaRight img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bt-cal__agendaImgPh { width: 100%; height: 100%; background: var(--bt-surface-muted); }

/* Optional visual session layouts: `sessionLayout: "cards" | "carousel"`. */
.bt-cal__eventCollection {
  padding: 12px 2px 4px;
}

.bt-cal__eventCollection--cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.bt-cal__eventCollection--carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: none;
}

.bt-cal__eventCollection--carousel::-webkit-scrollbar {
  display: none;
}

.bt-cal__eventCollectionControls {
  display: flex;
  gap: 7px;
}

.bt-cal__eventCollectionNav {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--bt-border);
  border-radius: 999px;
  background: var(--bt-surface);
  color: var(--bt-text);
}

.bt-cal__eventCollectionNav:hover,
.bt-cal__eventCollectionNav:focus-visible {
  border-color: var(--bt-primary);
  color: var(--bt-primary);
}

.bt-cal__eventCollectionNav svg {
  width: 18px;
  height: 18px;
}

.bt-cal__eventCard {
  min-width: 0;
  min-height: clamp(260px, 31vw, 340px);
  display: grid;
  grid-template-columns: minmax(260px, 42%) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--bt-border);
  border-radius: 18px;
  background: var(--bt-surface);
  color: var(--bt-text);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--bt-text) 10%, transparent);
  scroll-snap-align: start;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.bt-cal__eventCard:hover,
.bt-cal__eventCard:focus-within {
  border-color: color-mix(in srgb, var(--bt-primary) 68%, var(--bt-border));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--bt-text) 15%, transparent);
  transform: translateY(-2px);
}

.bt-cal__eventCard.is-unavailable {
  opacity: 0.7;
}

.bt-cal__eventCard.is-rule-limited {
  opacity: 1;
  border-color: color-mix(in srgb, #d48b16 45%, var(--bt-border));
  background: color-mix(in srgb, #f4b942 9%, var(--bt-surface));
}

.bt-cal__eventMedia {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 260px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--bt-primary) 26%, transparent), transparent 44%),
    var(--bt-surface-muted);
}

.bt-cal__eventMediaStage,
.bt-cal__eventMediaSlide,
.bt-cal__eventMediaSlide img,
.bt-cal__eventMediaSlide video,
.bt-cal__eventMediaStage > .bt-cal__agendaImgPh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bt-cal__eventMediaSlide {
  visibility: hidden;
  opacity: 0;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.bt-cal__eventMediaSlide.is-active {
  visibility: visible;
  opacity: 1;
}

.bt-cal__eventMediaSlide img,
.bt-cal__eventMediaSlide video {
  display: block;
  object-fit: cover;
  transition: transform 320ms ease;
}

.bt-cal__eventCard:hover .bt-cal__eventMediaSlide.is-active img,
.bt-cal__eventCard:hover .bt-cal__eventMediaSlide.is-active video {
  transform: scale(1.025);
}

.bt-cal__eventMedia::after {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 44%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.48), transparent);
  pointer-events: none;
  content: "";
}

.bt-cal__eventMediaNav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(8, 15, 23, 0.7);
  color: #fff;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.bt-cal__eventMediaNav:hover,
.bt-cal__eventMediaNav:focus-visible {
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

.bt-cal__eventMediaNav--previous { left: 10px; }
.bt-cal__eventMediaNav--next { right: 10px; }

.bt-cal__eventMediaNav svg {
  width: 20px;
  height: 20px;
}

.bt-cal__eventMediaDots {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.bt-cal__eventMediaDot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  transition: width 160ms ease, background-color 160ms ease;
}

.bt-cal__eventMediaDot.is-active {
  width: 22px;
  background: #fff;
}

.bt-cal__eventContent {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.bt-cal__eventEyebrow {
  margin-bottom: 6px;
  color: var(--bt-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.bt-cal__eventTitle {
  margin: 0;
  color: var(--bt-text);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.bt-cal__eventDescription {
  display: -webkit-box;
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--bt-muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.bt-cal__eventFacts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.bt-cal__eventFact {
  max-width: 100%;
  overflow: hidden;
  padding: 6px 9px;
  border: 1px solid var(--bt-border);
  border-radius: 999px;
  background: var(--bt-surface-muted);
  color: var(--bt-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-cal__eventFact--availability {
  border-color: color-mix(in srgb, var(--bt-primary) 42%, var(--bt-border));
  color: var(--bt-primary);
}

.bt-cal__eventFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.bt-cal__eventPrice {
  min-width: 0;
  color: var(--bt-text);
  font-size: 14px;
}

.bt-cal__eventPrice:empty {
  display: none;
}

.bt-cal__eventAction {
  min-height: 42px;
  margin-left: auto;
  padding: 10px 15px;
  border: 1px solid color-mix(in srgb, var(--bt-primary) 76%, var(--bt-border));
  border-radius: 999px;
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.bt-cal__eventAction:hover:not(:disabled),
.bt-cal__eventAction:focus-visible {
  filter: brightness(1.04);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--bt-primary) 28%, transparent);
}

.bt-cal__eventAction:disabled {
  background: var(--bt-surface-muted);
  color: var(--bt-muted);
  border-color: var(--bt-border);
}

.bt-cal__eventStarted {
  max-width: 240px;
  margin-left: auto;
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}

.bt-cal__status--started {
  white-space: normal;
}

@media (prefers-reduced-motion: reduce) {
  .bt-cal__eventCard,
  .bt-cal__eventMediaSlide,
  .bt-cal__eventMediaSlide img,
  .bt-cal__eventMediaSlide video {
    scroll-behavior: auto;
    transition: none;
  }
}

@media (max-width: 768px) {
  .bt-cal__agendaDayHeader { top: 54px; }
  .bt-cal__agendaCard { grid-template-columns: 88px 1fr; }
  .bt-cal__agendaMedia { width: 88px; min-height: 72px; }

  .bt-cal__eventCollection--cards {
    grid-template-columns: 1fr;
  }

  .bt-cal__eventCollection--carousel {
    grid-auto-columns: min(88vw, 340px);
    gap: 12px;
  }

  .bt-cal__eventCard {
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }

  .bt-cal__eventMedia {
    height: auto;
    min-height: 178px;
    aspect-ratio: 4 / 3;
  }

  .bt-cal__eventContent {
    padding: 15px;
  }

  .bt-cal__eventFooter {
    flex-wrap: wrap;
  }

  .bt-cal__eventStarted {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
    font-size: 14px;
    text-align: left;
  }
}

.bt-cal__day {
  border-left: 1px solid var(--bt-border);
  border-radius: 0;
  padding: 0;
  background: var(--bt-surface);
  min-height: 96px;
  min-width: 0;
}

.bt-cal__day:first-child { border-left: none; }

.bt-cal__dayTitle {
  font-weight: 600;
  padding: 10px 6px 6px;
  text-align: center;
}

.bt-cal__dayTitleName { font-size: 13px; line-height: 1.1; color: var(--bt-muted); font-weight: 600; white-space: nowrap; }

.bt-cal__dayTitleDate {
  font-size: 18px;
  line-height: 1.1;
  color: var(--bt-muted);
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
}

.bt-cal__day--hasSlots .bt-cal__dayTitleName { color: var(--bt-text); }
.bt-cal__day--hasSlots .bt-cal__dayTitleDate { color: var(--bt-text); }

.bt-cal__slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 4px;
  border-top: none;
}

.bt-cal__slot:first-of-type { margin-top: 6px; }

.bt-cal__time { font-variant-numeric: tabular-nums; white-space: nowrap; }

.bt-cal__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--bt-text);
}

.bt-cal__status { font-size: 12px; color: var(--bt-muted); white-space: nowrap; }

.bt-cal__book {
  border: 1px solid var(--bt-primary);
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bt-cal__book:disabled { opacity: 0.5; cursor: not-allowed; }
.bt-cal__book.is-rule-limited:disabled {
  opacity: 1;
  border-color: color-mix(in srgb, #d48b16 45%, var(--bt-border));
  background: color-mix(in srgb, #f4b942 9%, var(--bt-surface));
}

.bt-cal__bookTime { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bt-cal__bookMeta {
  font-size: 11px;
  color: var(--bt-muted);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-cal__bookPrice { font-size: 12px; color: var(--bt-muted); font-weight: 600; }

@media (max-width: 768px) {
  .bt-cal__barSide { min-width: auto; }

  .bt-cal__titleRange { font-size: 14px; }
  .bt-cal__titleWeek { font-size: 11px; }

  .bt-cal__filters { gap: 8px; margin: 8px 0 10px; }
  .bt-cal__field { min-width: 150px; }

  /* Mobile: keep 7 columns visible without horizontal scrolling */
  .bt-cal__grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow-x: hidden;
    overflow-y: visible;
  }

  .bt-cal__dayTitle { padding: 8px 4px 4px; }
  .bt-cal__dayTitleName { font-size: 12px; }
  .bt-cal__dayTitleDate { font-size: 16px; }

  .bt-cal__slot { padding: 4px 3px; }
  .bt-cal__book { padding: 6px 4px; border-radius: 9px; }
  .bt-cal__bookTime { font-size: 13px; }
  .bt-cal__bookMeta { font-size: 10px; }
  .bt-cal__bookPrice { font-size: 11px; }
}

@media (max-width: 480px) {
  /* Ultra-compact: still readable, but prioritizes showing full week */
  .bt-cal__bar { gap: 6px; flex-wrap: wrap; }
  .bt-cal__title {
    order: 3;
    flex-basis: 100%;
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }
  .bt-cal__nav { padding: 4px 2px; font-size: 12px; }
  .bt-cal__languageSelect {
    width: 120px;
    height: 34px;
    padding-left: 8px;
    font-size: 12px;
  }

  .bt-cal__titleRange {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    letter-spacing: 0.25px;
  }

  .bt-cal__titleWeek {
    min-width: 0;
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .bt-cal__filters { gap: 6px; margin: 8px 0 10px; }
  .bt-cal__field { min-width: 130px; }

  .bt-cal__dayTitle { padding: 6px 2px 3px; }
  .bt-cal__dayTitleName { font-size: 11px; }
  .bt-cal__dayTitleDate { font-size: 14px; }

  .bt-cal__slot { padding: 3px 2px; }
  .bt-cal__book { padding: 5px 2px; border-radius: 8px; }
  .bt-cal__bookTime { font-size: 11px; }

  .bt-cal__bookPrice { display: none; }
  .bt-cal__bookPrice--amount {
    display: block;
    font-size: 10px;
    line-height: 1.1;
    white-space: normal;
  }

  /* Sessions: keep header on one row (no wrap) */
  .bt-cal.bt-cal--sessions .bt-cal__bar { flex-wrap: nowrap; }
  .bt-cal.bt-cal--sessions .bt-cal__title,
  .bt-cal.bt-cal--resourceGrid .bt-cal__title {
    order: 0;
    flex-basis: auto;
    gap: 4px;
  }

  .bt-cal.bt-cal--sessions .bt-cal__barSide,
  .bt-cal.bt-cal--resourceGrid .bt-cal__barSide { gap: 4px; }

  .bt-cal.bt-cal--sessions .bt-cal__languagePicker,
  .bt-cal.bt-cal--timebased .bt-cal__languagePicker,
  .bt-cal.bt-cal--resourceGrid .bt-cal__languagePicker { width: 42px; }

  .bt-cal.bt-cal--sessions .bt-cal__titleRange,
  .bt-cal.bt-cal--resourceGrid .bt-cal__titleRange { font-size: 12px; }

  .bt-cal.bt-cal--sessions .bt-cal__titleWeek,
  .bt-cal.bt-cal--resourceGrid .bt-cal__titleWeek { font-size: 9px; }
}

.bt-cal__msg {
  padding: 10px;
  border-radius: 10px;
  background: var(--bt-surface-muted);
  border: 1px solid var(--bt-border);
}

.bt-cal__msg--error {
  background: var(--bt-danger-bg);
  border-color: var(--bt-danger-border);
  color: var(--bt-danger-text);
}

.bt-cal__selectedRow {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  background: var(--bt-surface);
  margin: 10px 0;
}

.bt-cal__selectedText {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-cal__selectedChange {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--bt-border-strong);
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.bt-cal__selectedChange svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.bt-cal__selectedChange--employee {
  border-color: var(--bt-primary);
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

.bt-cal__selectedChange:hover,
.bt-cal__selectedChange:focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid color-mix(in srgb, var(--bt-primary) 28%, transparent);
  outline-offset: 1px;
}

.bt-cal__selectedFooter {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--bt-border);
  background: var(--bt-surface);
  position: sticky;
  bottom: 0;
}

.bt-cal__selectedFooterInfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bt-cal__selectedFooterCount {
  font-weight: 800;
}

.bt-cal__selectedFooterNames {
  font-size: 12px;
  color: var(--bt-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-cal__selectedFooterActions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
}

.bt-cal__selectedFooterBtn {
  border: none;
  background: transparent;
  color: var(--bt-primary);
  padding: 8px 6px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .bt-cal__selectedRow { display: none !important; }
  .bt-cal__selectedFooter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--bt-text) 8%, transparent);
  }

  .bt-cal__selectedFooterActions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .bt-cal__selectedFooterBtn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 8px;
    border: 1px solid var(--bt-border-strong);
    border-radius: 8px;
    background: var(--bt-surface-muted);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bt-cal__selectedFooterBtn:first-child {
    border-color: color-mix(in srgb, var(--bt-primary) 62%, var(--bt-border));
    background: color-mix(in srgb, var(--bt-primary) 10%, var(--bt-surface));
  }
  .bt-cal__grid { padding-bottom: 64px; }
}

/* Step 1: service selection */
.bt-cal__services {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  background: var(--bt-surface);
  overflow: hidden;
}

.bt-cal__servicesHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
}

.bt-cal__servicesTitle { font-weight: 700; }

.bt-cal__servicesContinue {
  border: 1px solid var(--bt-primary);
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.bt-cal__servicesContinue:disabled { opacity: 0.5; cursor: not-allowed; }

.bt-cal__servicesList {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
  max-height: none;
  overflow: visible;
}

.bt-cal__servicesEmpty {
  padding: 10px;
  color: var(--bt-muted);
  text-align: center;
}

.bt-cal__employeePreviewHost:empty { display: none; }

.bt-cal__employeePreview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  background: var(--bt-surface-muted);
}

.bt-cal__employeeAvatar {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--bt-primary) 55%, var(--bt-border));
  border-radius: 50%;
  color: var(--bt-primary);
  background: var(--bt-surface);
  font-size: 17px;
  font-weight: 800;
}

.bt-cal__employeeAvatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bt-cal__employeeAvatar.has-image .bt-cal__employeeInitials { visibility: hidden; }
.bt-cal__employeePreviewCopy { display: flex; min-width: 0; flex-direction: column; }
.bt-cal__employeePreviewName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-cal__employeePreviewTitle { margin-top: 2px; color: var(--bt-muted); font-size: 12px; }
.bt-cal__employeeAutoMessage { padding: 8px 10px; color: var(--bt-muted); font-size: 13px; }

.bt-cal__serviceGroup {
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bt-surface);
  flex: 0 0 auto;
}

.bt-cal__serviceGroupSummary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--bt-border);
  font-weight: 700;
  list-style: none;
}

.bt-cal__serviceGroupSummary::-webkit-details-marker { display: none; }
.bt-cal__serviceGroupCount { color: var(--bt-muted); font-weight: 700; }

.bt-cal__serviceGroupBody {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

/* Ordinary booking pages use the page's own scroll, so a short service list
   never hides its last row inside an unexpected nested scrollbar. The
   explicit fitViewport variant keeps one single, controlled scroll surface. */
.bt-cal.bt-cal--fitViewport .bt-cal__servicesList {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.bt-cal__serviceScrollNav {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--bt-border);
  background: color-mix(in srgb, var(--bt-surface-muted) 88%, var(--bt-surface));
}

.bt-cal__serviceScrollNav[hidden] { display: none; }

.bt-cal__serviceScrollButton {
  min-width: min(220px, 46%);
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 999px;
  color: var(--bt-text);
  background: var(--bt-surface);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.bt-cal__serviceScrollButton:not(:disabled):hover,
.bt-cal__serviceScrollButton:not(:disabled):focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid color-mix(in srgb, var(--bt-primary) 28%, transparent);
  outline-offset: 1px;
}

.bt-cal__serviceScrollButton:disabled {
  opacity: 0.42;
}

.bt-cal__service {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--bt-border);
}

.bt-cal__service:last-child { border-bottom: none; }

.bt-cal__serviceImg {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bt-surface-muted);
  flex: 0 0 54px;
}

.bt-cal__serviceImg img,
.bt-cal__serviceImg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bt-cal__serviceImgPh { width: 100%; height: 100%; }

.bt-cal__serviceMain { flex: 1; min-width: 0; }

.bt-cal__serviceName {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-cal__serviceMeta {
  margin-top: 4px;
  color: var(--bt-muted);
  font-size: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bt-cal__serviceDesc {
  margin-top: 4px;
  color: var(--bt-muted);
  font-size: 12px;
  white-space: normal;
  line-height: 1.4;
}

.bt-cal__serviceReadMore {
  margin-top: 3px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--bt-primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.bt-cal__serviceReadMore:hover,
.bt-cal__serviceReadMore:focus-visible {
  filter: brightness(0.9);
}

.bt-cal__serviceDescTitlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bt-cal__serviceDescClose {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--bt-border-strong);
  background: var(--bt-surface);
  color: var(--bt-text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.bt-cal__serviceLongText {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.bt-cal__serviceToggle {
  border: 1px solid var(--bt-primary);
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.bt-cal__serviceToggle.is-selected {
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

/* Simple modal (used for composite employee picking) */
.bt-cal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2147483640;
}

.bt-cal__dialog {
  width: min(560px, 100%);
  background: var(--bt-surface);
  border: 1px solid var(--bt-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.bt-cal__dialogTitle {
  padding: 12px 14px;
  font-weight: 800;
  background: var(--bt-surface-muted);
  border-bottom: 1px solid var(--bt-border);
}

.bt-cal__dialogBody {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow: auto;
}

.bt-cal__dialogRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bt-cal__dialogRowName {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-cal__dialogSelect {
  padding: 8px 10px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 10px;
  background: var(--bt-surface);
  color: var(--bt-text);
}

.bt-cal__dialogActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--bt-border);
  background: var(--bt-surface);
}

.bt-cal__dialogBtn {
  border: 1px solid var(--bt-border-strong);
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.bt-cal__dialogBtn--primary {
  border-color: var(--bt-primary);
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

.bt-cal__dialogBtn--final {
  min-width: 220px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.14);
}

.bt-cal__dialogBtn--final:hover,
.bt-cal__dialogBtn--final:focus-visible {
  filter: brightness(0.96);
}

.bt-cal__confirmFinalStep {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 12px;
  background: var(--bt-surface-muted);
}

.bt-cal__confirmFinalStepTitle {
  font-weight: 800;
}

.bt-cal__confirmPrice {
  margin-top: 8px;
  color: var(--bt-text);
  font-size: 16px;
  font-weight: 800;
}

.bt-cal__confirmFinalStepHelp {
  margin-top: 4px;
  color: var(--bt-muted);
  font-size: 13px;
}

.bt-cal__legalNotice {
  margin: 8px 0 0;
  color: var(--bt-muted);
  font-size: 12px;
  line-height: 1.45;
}

.bt-cal__legalNotice a {
  color: currentColor;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.bt-cal__legalNotice a:hover,
.bt-cal__legalNotice a:focus-visible {
  color: var(--bt-primary);
}

.bt-cal__paymentChoices {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bt-border);
}

.bt-cal__bookingPriceSummary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 8px;
  background: var(--bt-surface-muted);
}

.bt-cal__bookingPriceLabel {
  font-size: 14px;
  font-weight: 700;
}

.bt-cal__bookingPriceAmount {
  font-size: 18px;
  text-align: right;
  white-space: nowrap;
}

.bt-cal__bookingPriceHint {
  grid-column: 1 / -1;
  color: var(--bt-muted);
  font-size: 12px;
  line-height: 1.4;
}

.bt-cal__bookingPriceRetry {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 4px;
  padding: 6px 10px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 6px;
  background: var(--bt-surface);
  color: var(--bt-text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.bt-cal__bookingPriceRetry:hover,
.bt-cal__bookingPriceRetry:focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid var(--bt-primary);
  outline-offset: 1px;
}

@media (max-width: 420px) {
  .bt-cal__bookingPriceSummary { grid-template-columns: 1fr; }
  .bt-cal__bookingPriceAmount { text-align: left; }
}

.bt-cal__paymentChoicesTitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 800;
}

.bt-cal__paymentChoicesHelp {
  margin: 4px 0 10px;
  color: var(--bt-muted);
  font-size: 13px;
  line-height: 1.4;
}

.bt-cal__paymentChoicesList {
  display: grid;
  gap: 8px;
}

.bt-cal .bt-cal__paymentChoice {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 8px;
  background: var(--bt-surface);
  color: var(--bt-text);
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.bt-cal__paymentChoice:hover,
.bt-cal__paymentChoice:focus-within {
  border-color: var(--bt-primary);
  outline: 2px solid color-mix(in srgb, var(--bt-primary) 24%, transparent);
  outline-offset: 1px;
}

.bt-cal__paymentChoice.is-selected {
  border-color: var(--bt-primary);
  background: var(--bt-surface-muted);
}

.bt-cal__paymentChoice.is-disabled {
  opacity: 0.64;
  cursor: not-allowed;
}

.bt-cal__paymentChoice.is-disabled:hover,
.bt-cal__paymentChoice.is-disabled:focus-within {
  border-color: var(--bt-border-strong);
  outline: 0;
}

.bt-cal .bt-cal__paymentChoice input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.bt-cal__paymentChoiceIndicator {
  width: 18px;
  height: 18px;
  border: 2px solid var(--bt-border-strong);
  border-radius: 50%;
  background: var(--bt-surface);
}

.bt-cal__paymentChoice.is-selected .bt-cal__paymentChoiceIndicator {
  border-color: var(--bt-primary);
  box-shadow: inset 0 0 0 4px var(--bt-surface), inset 0 0 0 9px var(--bt-primary);
}

.bt-cal__paymentChoiceCopy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.bt-cal__paymentChoiceCopy strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.bt-cal__paymentChoiceCopy small {
  color: var(--bt-muted);
  font-size: 12px;
  line-height: 1.35;
}

.bt-cal__paymentChoiceAmount {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.bt-cal__giftCard {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--bt-border);
  border-radius: 8px;
  background: var(--bt-surface);
}

.bt-cal__giftCard.is-applied {
  border-color: var(--bt-success-border);
  background: var(--bt-success-bg);
}

.bt-cal__giftCardTitle {
  margin: 0;
  color: var(--bt-text);
  font-size: 14px;
  font-weight: 800;
}

.bt-cal__giftCardHelp {
  margin: 3px 0 10px;
  color: var(--bt-muted);
  font-size: 12px;
  line-height: 1.4;
}

.bt-cal__giftCardField {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.bt-cal__giftCardField label {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--bt-text);
  font-size: 13px;
}

.bt-cal .bt-cal__giftCardField input {
  width: 100%;
  min-width: 0;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 6px;
  background: var(--bt-surface);
  color: var(--bt-text);
}

.bt-cal .bt-cal__giftCardField input[aria-invalid="true"] {
  border-color: var(--bt-danger-text);
  outline: 2px solid color-mix(in srgb, var(--bt-danger-text) 18%, transparent);
  outline-offset: 1px;
}

.bt-cal .bt-cal__giftCardField input[readonly] {
  background: var(--bt-surface-muted);
}

.bt-cal__giftCardAction {
  flex: 0 0 auto;
  min-width: 108px;
}

.bt-cal__giftCardStatus {
  min-height: 18px;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
}

.bt-cal__giftCardStatus.is-success {
  color: var(--bt-success-text);
  font-weight: 700;
}

.bt-cal__giftCardStatus.is-error {
  color: var(--bt-danger-text);
  font-weight: 700;
}

.bt-cal__giftCardSummary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--bt-success-border);
  font-size: 13px;
}

.bt-cal__giftCardSummary dt,
.bt-cal__giftCardSummary dd {
  margin: 0;
}

.bt-cal__giftCardSummary dd {
  text-align: right;
  font-weight: 800;
}

.bt-cal__checkoutChoiceDialog {
  max-width: 620px;
}

.bt-cal__checkoutChoiceSummary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--bt-border);
  border-radius: 8px;
  background: var(--bt-surface-muted);
}

.bt-cal__checkoutChoiceSummary strong,
.bt-cal__checkoutChoiceSummary span {
  min-width: 0;
}

.bt-cal__checkoutChoiceSummary span {
  color: var(--bt-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.bt-cal__checkoutChoiceList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.bt-cal__checkoutChoiceBtn {
  min-width: 0;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 18px;
  border: 2px solid var(--bt-border-strong);
  border-radius: 10px;
  background: var(--bt-surface);
  color: var(--bt-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bt-cal__checkoutChoiceBtn strong {
  font-size: 16px;
  line-height: 1.2;
}

.bt-cal__checkoutChoiceBtn span {
  color: var(--bt-muted);
  font-size: 13px;
  line-height: 1.4;
}

.bt-cal__checkoutChoiceBtn:hover,
.bt-cal__checkoutChoiceBtn:focus-visible {
  border-color: var(--bt-primary);
  outline: 3px solid color-mix(in srgb, var(--bt-primary) 24%, transparent);
  outline-offset: 2px;
}

.bt-cal__checkoutChoiceBtn--login {
  border-color: var(--bt-primary);
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

.bt-cal__checkoutChoiceBtn--login span {
  color: inherit;
}

.bt-cal__authDivider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.bt-cal__authDivider::before,
.bt-cal__authDivider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bt-border);
}

.bt-cal__externalAuth {
  margin-top: 14px;
}

.bt-cal__externalAuthTitle,
.bt-cal__guestDetailsTitle {
  margin: 0;
  color: var(--bt-text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
}

.bt-cal__externalAuthHelp {
  margin: 4px 0 12px;
  color: var(--bt-muted);
  font-size: 13px;
  line-height: 1.4;
}

.bt-cal__authProviders {
  display: grid;
  gap: 8px;
  width: 100%;
}

.bt-cal__authProviders[hidden] {
  display: none;
}

.bt-cal__authProvider {
  display: flex;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  overflow: hidden;
}

.bt-cal__authProvider > div {
  max-width: 100%;
}

.bt-cal__guestDetailsTitle {
  margin-bottom: 10px;
}

.bt-cal__existingAccount {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bt-border);
  color: var(--bt-muted);
  font-size: 13px;
}

.bt-cal__textButton {
  padding: 0;
  border: 0;
  color: var(--bt-primary);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.bt-cal__textButton:hover,
.bt-cal__textButton:focus-visible {
  filter: brightness(0.88);
}

.bt-cal__googleButtonWrap {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.bt-cal__googleButtonWrap > div {
  max-width: 100%;
}

.bt-cal__crossSell {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--bt-border);
}

.bt-cal__crossSellHeading {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
}

.bt-cal__crossSellHelp {
  margin: 4px 0 10px;
  color: var(--bt-muted);
  font-size: 13px;
}

.bt-cal__crossSellList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 8px;
}

.bt-cal__crossSellItem {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: minmax(64px, auto) 36px;
  gap: 8px 10px;
  padding: 8px;
  border: 1px solid var(--bt-border);
  border-radius: 8px;
  background: var(--bt-surface);
}

.bt-cal__crossSellItem.is-selected {
  border-color: var(--bt-primary);
  background: var(--bt-surface-muted);
}

.bt-cal__crossSellImage {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bt-surface-muted);
}

.bt-cal__crossSellImage--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bt-muted);
  font-size: 24px;
  font-weight: 800;
}

.bt-cal__crossSellContent {
  min-width: 0;
  align-self: center;
}

.bt-cal__crossSellName {
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.25;
}

.bt-cal__crossSellVariant,
.bt-cal__crossSellDescription {
  margin-top: 2px;
  color: var(--bt-muted);
  font-size: 12px;
  line-height: 1.3;
}

.bt-cal__crossSellDescription {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bt-cal__crossSellPrice {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
}

.bt-cal__crossSellToggle {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 6px;
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.bt-cal__crossSellToggle:hover,
.bt-cal__crossSellToggle:focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid var(--bt-primary);
  outline-offset: 1px;
}

.bt-cal__crossSellToggle.is-selected {
  border-color: var(--bt-primary);
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

.bt-cal__dialogBtn--choice:hover,
.bt-cal__dialogBtn--choice:focus-visible {
  outline: 2px solid var(--bt-primary);
  outline-offset: -2px;
  background: var(--bt-surface);
}

.bt-cal__dialogBtn--choice.is-selected {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--bt-primary);
  outline-offset: -2px;
  background: var(--bt-surface);
  color: var(--bt-text);
}

@media (max-width: 520px) {
  .bt-cal__dialogBtn--final {
    width: 100%;
    min-width: 0;
  }

  .bt-cal__paymentChoice {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .bt-cal__paymentChoiceAmount {
    grid-column: 2;
    white-space: normal;
  }

  .bt-cal__giftCardField {
    align-items: stretch;
    flex-direction: column;
  }

  .bt-cal__giftCardAction {
    width: 100%;
  }

  .bt-cal__checkoutChoiceSummary {
    align-items: flex-start;
    flex-direction: column;
  }

  .bt-cal__checkoutChoiceSummary span {
    text-align: left;
  }

  .bt-cal__checkoutChoiceList {
    grid-template-columns: 1fr;
  }

  .bt-cal__checkoutChoiceBtn {
    min-height: 96px;
  }

  .bt-cal__accountDialog .bt-cal__dialogActions {
    flex-wrap: wrap;
  }

  .bt-cal__accountDialog .bt-cal__dialogBtn--final {
    order: -1;
    flex-basis: 100%;
  }
}

/* Subscription list in confirm dialog */
.bt-cal__subscriptionList {
  display: grid;
  gap: 8px;
}

.bt-cal__subscriptionItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  cursor: pointer;
  background: var(--bt-surface);
}

.bt-cal__subscriptionContent {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.bt-cal__subscriptionTitle {
  font-weight: 800;
}

.bt-cal__subscriptionDesc {
  color: var(--bt-muted);
  font-size: 13px;
}

.bt-cal__subscriptionMeta {
  color: var(--bt-muted);
  font-size: 13px;
}

.bt-cal__subscriptionToggle {
  white-space: nowrap;
}

/* Icon button (used in header/filter panel) */
.bt-cal__iconBtn {
  border: 1px solid var(--bt-border-strong);
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  line-height: 1;
  font-size: 18px;
}

.bt-cal__iconBtn.bt-cal__iconBtn--activeFilter::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--bt-primary);
  box-shadow: 0 0 0 2px var(--bt-surface-muted);
}

.bt-cal__iconBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bt-cal__iconBtn svg { display: block; }

/* Resource grid (courts) */
.bt-cal--resourceGrid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bt-cal__dateStrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px;
}

.bt-cal__dateChip {
  border: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.bt-cal__dateChip.is-active {
  border-color: var(--bt-primary);
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

.bt-cal__servicePicker {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  gap: 6px;
}

.bt-cal__servicePicker[hidden] {
  display: none !important;
}

.bt-cal__servicePickerLabel {
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 800;
}

.bt-cal__servicePicker .bt-cal__filterSelect {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 8px;
  background: var(--bt-surface);
  color: var(--bt-text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.bt-cal__servicePicker .bt-cal__filterSelect:focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid var(--bt-primary);
  outline-offset: 1px;
}

/* Resource availability: weekly matrix */
.bt-cal--resourceWeek .bt-cal__bar {
  display: grid;
  grid-template-columns: minmax(270px, auto) minmax(180px, 1fr) minmax(150px, auto);
  gap: 14px;
  margin-bottom: 12px;
}

.bt-cal--resourceWeek .bt-cal__barSide--date {
  display: grid;
  grid-template-columns: 36px minmax(150px, 190px) 36px;
  gap: 6px;
}

.bt-cal--resourceWeek .bt-cal__barSide--date .bt-cal__iconBtn,
.bt-cal--resourceWeek .bt-cal__barSide--date .bt-cal__datePicker {
  height: 36px;
}

.bt-cal__weekResourcePicker[hidden] {
  display: none !important;
}

.bt-cal__adminTargetPicker[hidden] {
  display: none !important;
}

.bt-cal__adminTargetPicker {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.2fr);
  gap: 16px 22px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--bt-primary) 34%, var(--bt-border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--bt-primary) 6%, var(--bt-surface));
  box-shadow: inset 4px 0 0 var(--bt-primary);
}

.bt-cal__adminTargetHeader {
  align-self: center;
}

.bt-cal__adminTargetHeading {
  margin: 0;
  color: var(--bt-text);
  font-size: 16px;
}

.bt-cal__adminTargetHelp {
  margin: 5px 0 0;
  color: var(--bt-muted);
  font-size: 12px;
  line-height: 1.45;
}

.bt-cal__adminTargetControls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bt-cal__adminTargetField {
  display: grid;
  gap: 5px;
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 800;
}

.bt-cal__adminTargetField input,
.bt-cal__adminTargetField select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 10px;
  background: var(--bt-surface);
  color: var(--bt-text);
  font: inherit;
  font-weight: 650;
}

.bt-cal__adminTargetField input:focus-visible,
.bt-cal__adminTargetField select:focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid var(--bt-primary);
  outline-offset: 2px;
}

.bt-cal__adminTargetStatus {
  grid-column: 1 / -1;
  margin: -5px 0 0;
  color: color-mix(in srgb, var(--bt-primary) 78%, var(--bt-text));
  font-size: 12px;
  font-weight: 750;
}

.bt-cal__bookingTargetNotice {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 4px solid var(--bt-primary);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bt-primary) 8%, var(--bt-surface));
  color: var(--bt-text);
  font-size: 13px;
  font-weight: 800;
}

.bt-cal__weekResourcePicker {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(220px, 1fr);
  grid-template-areas:
    "label hint"
    "select hint";
  align-items: end;
  gap: 5px 18px;
  padding: 14px 16px;
  border: 1px solid var(--bt-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bt-surface-muted) 76%, var(--bt-surface));
}

.bt-cal__weekResourcePickerLabel {
  grid-area: label;
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bt-cal__weekResourcePicker .bt-cal__filterSelect {
  grid-area: select;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 10px;
  background: var(--bt-surface);
  color: var(--bt-text);
  font: inherit;
  font-weight: 750;
}

.bt-cal__weekResourcePicker .bt-cal__filterSelect:focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid var(--bt-primary);
  outline-offset: 2px;
}

.bt-cal__weekScrollHint {
  grid-area: hint;
  align-self: center;
  margin: 0;
  color: var(--bt-muted);
  font-size: 13px;
  line-height: 1.45;
}

.bt-cal__resourceGrid.bt-cal__resourceGrid--week {
  display: grid;
  gap: 10px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.bt-cal__weekLegend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  min-height: 22px;
}

.bt-cal__weekLegendItem {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 700;
}

.bt-cal__weekLegendItem i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--bt-surface-muted);
  box-shadow: 0 0 0 1px var(--bt-border-strong);
}

.bt-cal__weekLegendItem i.is-available {
  background: color-mix(in srgb, var(--bt-primary) 72%, #22c55e);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bt-primary) 12%, transparent);
}

.bt-cal__weekLegendItem i.is-booked {
  background: color-mix(in srgb, var(--bt-muted) 54%, var(--bt-surface));
}

.bt-cal__weekMatrixScroller {
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--bt-border);
  border-radius: 16px;
  background: var(--bt-surface);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--bt-text) 7%, transparent);
  scrollbar-color: color-mix(in srgb, var(--bt-primary) 52%, var(--bt-muted)) var(--bt-surface-muted);
}

.bt-cal__weekMatrixScroller:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bt-primary) 62%, transparent);
  outline-offset: 3px;
}

.bt-cal__weekTimeline {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 78px repeat(7, minmax(132px, 1fr));
  width: 100%;
  min-width: 1060px;
  background: var(--bt-surface);
}

.bt-cal__weekTimelineCorner,
.bt-cal__weekMatrixDayHeading {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 66px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--bt-border);
  border-left: 1px solid var(--bt-border);
  background: color-mix(in srgb, var(--bt-surface-muted) 88%, var(--bt-surface));
  color: var(--bt-text);
  text-align: center;
}

.bt-cal__weekTimelineCorner {
  left: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  border-left: 0;
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bt-cal__weekMatrixDayHeading.is-today {
  color: var(--bt-primary);
  background: color-mix(in srgb, var(--bt-primary) 9%, var(--bt-surface));
}

.bt-cal__weekMatrixWeekday,
.bt-cal__weekMatrixDate {
  display: block;
}

.bt-cal__weekMatrixWeekday {
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bt-cal__weekMatrixDate {
  margin-top: 3px;
  color: var(--bt-muted);
  font-size: 12px;
  font-weight: 650;
}

.bt-cal__weekTimelineTime {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: var(--bt-week-step-height);
  padding: 5px 7px 0;
  border-top: 1px solid var(--bt-border);
  background: color-mix(in srgb, var(--bt-surface-muted) 90%, var(--bt-surface));
  color: var(--bt-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
}

.bt-cal__weekTimelineDay {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: calc(var(--bt-week-row-count) * var(--bt-week-step-height));
  border-left: 1px solid var(--bt-border);
  background: var(--bt-surface);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--bt-week-step-height) - 1px),
    var(--bt-border) calc(var(--bt-week-step-height) - 1px),
    var(--bt-border) var(--bt-week-step-height)
  );
}

.bt-cal__weekTimelineDay.is-today {
  background-color: color-mix(in srgb, var(--bt-primary) 3%, var(--bt-surface));
}

.bt-cal--resourceWeekMobileDay .bt-cal__weekMatrixScroller {
  overflow-x: hidden;
}

.bt-cal--resourceWeekMobileDay .bt-cal__weekTimeline {
  grid-template-columns: 70px minmax(0, 1fr);
  min-width: 0;
}

.bt-cal__weekMatrixSlot {
  position: relative;
  z-index: 2;
  width: auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 3px;
  margin: 3px;
  padding: 8px;
  border: 1px solid var(--bt-border);
  border-radius: 9px;
  background: var(--bt-surface-muted);
  color: var(--bt-text);
  font: inherit;
  line-height: 1.25;
  text-align: left;
  overflow: hidden;
}

button.bt-cal__weekMatrixSlot.is-available {
  border-color: color-mix(in srgb, var(--bt-primary) 58%, var(--bt-border));
  background: color-mix(in srgb, var(--bt-primary) 9%, var(--bt-surface));
  box-shadow: inset 3px 0 0 var(--bt-primary);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button.bt-cal__weekMatrixSlot.is-available:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--bt-primary) 14%, var(--bt-surface));
  box-shadow: inset 3px 0 0 var(--bt-primary), 0 8px 18px color-mix(in srgb, var(--bt-primary) 15%, transparent);
}

button.bt-cal__weekMatrixSlot.is-available:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bt-primary) 58%, transparent);
  outline-offset: 2px;
}

.bt-cal__weekMatrixSlot.is-booked {
  color: color-mix(in srgb, var(--bt-muted) 86%, var(--bt-text));
  background: color-mix(in srgb, var(--bt-muted) 8%, var(--bt-surface));
}

.bt-cal__weekMatrixSlot.is-mine {
  border-color: color-mix(in srgb, #7c3aed 48%, var(--bt-border));
  background: color-mix(in srgb, #7c3aed 10%, var(--bt-surface));
  box-shadow: inset 3px 0 0 #7c3aed;
}

.bt-cal__weekMatrixSlot.is-blocked {
  color: var(--bt-muted);
  background-color: var(--bt-surface-muted);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 6px,
    color-mix(in srgb, var(--bt-border) 64%, transparent) 6px,
    color-mix(in srgb, var(--bt-border) 64%, transparent) 8px
  );
}

.bt-cal__weekMatrixSlot.is-rule-limited {
  border-color: color-mix(in srgb, #d48b16 50%, var(--bt-border));
  background: color-mix(in srgb, #f4b942 12%, var(--bt-surface));
  box-shadow: inset 3px 0 0 #d48b16;
  color: var(--bt-text);
}

.bt-cal__weekMatrixSlotName {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 820;
}

.bt-cal__weekMatrixSlotTime {
  color: color-mix(in srgb, var(--bt-text) 78%, var(--bt-muted));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.bt-cal__weekTimelineDay.has-multiple-lanes .bt-cal__weekMatrixSlotTime {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  white-space: normal;
}

.bt-cal__weekTimelineDay.has-multiple-lanes .bt-cal__weekMatrixSlotTimeStart::after {
  content: '–';
}

.bt-cal__weekTimelineDay.has-multiple-lanes .bt-cal__weekMatrixSlotTimeSeparator {
  display: none;
}

button.bt-cal__weekMatrixSlot.is-available .bt-cal__weekMatrixSlotTime {
  color: color-mix(in srgb, var(--bt-primary) 82%, var(--bt-text));
}

.bt-cal__weekMatrixSlotMeta,
.bt-cal__weekMatrixSlotCapacity {
  overflow: hidden;
  color: var(--bt-muted);
  font-size: 11px;
  text-overflow: ellipsis;
}

.bt-cal__weekMatrixSlotStatus {
  color: inherit;
  font-size: 11px;
  font-weight: 750;
}

button.bt-cal__weekMatrixSlot.is-available .bt-cal__weekMatrixSlotStatus {
  color: color-mix(in srgb, var(--bt-primary) 84%, var(--bt-text));
}

.bt-cal__weekMatrixSlot.is-short {
  justify-content: center;
  gap: 1px;
  padding: 4px 5px;
}

.bt-cal__weekMatrixSlot.is-short .bt-cal__weekMatrixSlotTime {
  font-size: 10px;
  line-height: 1;
}

.bt-cal__weekMatrixSlot.is-short .bt-cal__weekMatrixSlotName {
  font-size: 11px;
  line-height: 1.1;
}

.bt-cal__weekMatrixSlot.is-short .bt-cal__weekMatrixSlotMeta,
.bt-cal__weekMatrixSlot.is-short .bt-cal__weekMatrixSlotCapacity,
.bt-cal__weekMatrixSlot.is-short .bt-cal__weekMatrixSlotStatus {
  display: none;
}

.bt-cal__weekMatrixSlot.is-compact {
  gap: 0;
  padding: 1px 3px;
}

.bt-cal__weekMatrixSlot.is-compact .bt-cal__weekMatrixSlotTime {
  font-size: 9px;
  line-height: 0.95;
  letter-spacing: 0;
}

.bt-cal__weekMatrixSlot.is-compact .bt-cal__weekMatrixSlotName {
  display: none;
}

.bt-cal__weekTimelineDay.has-multiple-lanes .bt-cal__weekMatrixSlot {
  padding-inline: 5px;
}

.bt-cal__weekTimelineDay.has-multiple-lanes .bt-cal__weekMatrixSlot.is-compact {
  padding-inline: 3px;
}

.bt-cal__weekTimelineDay.has-multiple-lanes .bt-cal__weekMatrixSlotMeta,
.bt-cal__weekTimelineDay.has-multiple-lanes .bt-cal__weekMatrixSlotCapacity {
  display: none;
}

.bt-cal__weekMatrixEmpty {
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 36px 20px;
  border: 1px dashed var(--bt-border-strong);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bt-surface-muted) 70%, var(--bt-surface));
  color: var(--bt-muted);
  text-align: center;
}

.bt-cal__weekMatrixEmpty strong {
  color: var(--bt-text);
  font-size: 18px;
}

.bt-cal__weekMatrixLoginBtn {
  justify-self: center;
  margin-top: 8px;
  min-width: 140px;
}

.bt-cal__iconBtn[hidden] {
  display: none !important;
}

.bt-cal__resourceGrid {
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bt-surface);
}

.bt-cal__resourceGridHeader,
.bt-cal__resourceGridBody {
  display: grid;
}

.bt-cal__resourceGridHeader {
  overflow: hidden;
}

.bt-cal__resourceGridCorner {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bt-surface-muted);
  border-right: 1px solid var(--bt-border);
}

.bt-cal__resourceGridColHeader {
  padding: 10px 8px;
  font-weight: 800;
  text-align: center;
  background: var(--bt-surface-muted);
  border-left: 1px solid var(--bt-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-cal__resourceGridBody {
  max-height: 70vh;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: var(--bt-surface);
}

.bt-cal.bt-cal--fitViewport .bt-cal__resourceGrid {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.bt-cal.bt-cal--fitViewport .bt-cal__resourceGridBody {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
}

/* Internal scrolling remains intentional for long session agendas and the
   legacy resource timetable. Give those surfaces an unmistakable scrollbar. */
.bt-cal__grid.bt-cal__grid--agenda,
.bt-cal__resourceGridBody,
.bt-cal.bt-cal--fitViewport .bt-cal__servicesList {
  scrollbar-width: auto;
  scrollbar-color: color-mix(in srgb, var(--bt-primary) 72%, var(--bt-text)) var(--bt-surface-muted);
}

.bt-cal__grid.bt-cal__grid--agenda::-webkit-scrollbar,
.bt-cal__resourceGridBody::-webkit-scrollbar,
.bt-cal.bt-cal--fitViewport .bt-cal__servicesList::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.bt-cal__grid.bt-cal__grid--agenda::-webkit-scrollbar-track,
.bt-cal__resourceGridBody::-webkit-scrollbar-track,
.bt-cal.bt-cal--fitViewport .bt-cal__servicesList::-webkit-scrollbar-track {
  background: var(--bt-surface-muted);
}

.bt-cal__grid.bt-cal__grid--agenda::-webkit-scrollbar-thumb,
.bt-cal__resourceGridBody::-webkit-scrollbar-thumb,
.bt-cal.bt-cal--fitViewport .bt-cal__servicesList::-webkit-scrollbar-thumb {
  border: 3px solid var(--bt-surface-muted);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bt-primary) 72%, var(--bt-text));
}

.bt-cal__resourceGridTime {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
}

.bt-cal__resourceGridTimeRow {
  height: var(--bt-grid-hour-height, 64px);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--bt-muted);
  border-top: 1px solid var(--bt-border);
}

.bt-cal__resourceGridCol {
  position: relative;
  border-left: 1px solid var(--bt-border);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--bt-grid-hour-height, 64px) - 1px),
    var(--bt-border) calc(var(--bt-grid-hour-height, 64px) - 1px),
    var(--bt-border) var(--bt-grid-hour-height, 64px)
  );
}

.bt-cal__resourceGridItem {
  position: absolute;
  left: 6px;
  right: 6px;
  border: 1px solid var(--bt-primary);
  background: rgba(37, 99, 235, 0.12);
  color: var(--bt-text);
  border-radius: 10px;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.bt-cal__resourceGridItem.is-compact {
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
}

.bt-cal__resourceGridItem.is-compact .bt-cal__resourceGridItemTitle {
  display: none;
}

.bt-cal__resourceGridItem.is-compact .bt-cal__resourceGridItemMeta {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.bt-cal__resourceGridItem.is-blocked {
  opacity: 0.5;
  cursor: not-allowed;
}

.bt-cal__resourceGridItemTitle {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
}

.bt-cal__resourceGridItemMeta {
  font-size: 12px;
  color: var(--bt-muted);
}

/* Shared calendar chrome: previous, date, next, filter and language. */
.bt-cal--resourceMatchi .bt-cal__bar,
.bt-cal--sessions .bt-cal__bar,
.bt-cal--timebased .bt-cal__bar {
  display: grid;
  grid-template-columns: minmax(250px, auto) minmax(150px, 1fr) minmax(250px, auto);
  gap: 12px;
}

.bt-cal__resourceGridItem.is-rule-limited {
  border-color: color-mix(in srgb, #d48b16 50%, var(--bt-border));
  background: color-mix(in srgb, #f4b942 12%, var(--bt-surface));
  color: var(--bt-text);
  cursor: not-allowed;
}

.bt-cal__resourceGridItemStatus {
  margin-top: 3px;
  color: color-mix(in srgb, #9a5c00 80%, var(--bt-text));
  font-size: 11px;
  font-weight: 750;
}

.bt-cal--resourceMatchi .bt-cal__barSide--date,
.bt-cal--sessions .bt-cal__barSide--date,
.bt-cal--timebased .bt-cal__barSide--date {
  display: grid;
  grid-template-columns: 36px minmax(150px, 190px) 36px;
  gap: 6px;
}

.bt-cal__barSide--actions {
  justify-self: end;
}

.bt-cal__datePicker {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--bt-surface);
  color: var(--bt-text);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
}

.bt-cal__datePicker:focus-visible,
.bt-cal__categoryPicker .bt-cal__filterSelect:focus-visible,
.bt-cal__categoryTab:focus-visible {
  border-color: var(--bt-primary);
  outline: 2px solid var(--bt-primary);
  outline-offset: 1px;
}

.bt-cal__categoryPicker {
  min-width: 0;
}

.bt-cal--resourceMatchi .bt-cal__primaryFilters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 16px;
  align-items: end;
  padding: 0 16px;
}

.bt-cal__categoryPickerLabel {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bt-cal__categoryTabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bt-cal__categoryTabs::-webkit-scrollbar {
  display: none;
}

.bt-cal__categoryTab {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 999px;
  padding: 8px 18px;
  background: var(--bt-surface);
  color: var(--bt-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.bt-cal__categoryTab:hover {
  border-color: var(--bt-primary);
}

.bt-cal__categoryTab.is-active {
  border-color: var(--bt-primary);
  background: var(--bt-primary);
  color: var(--bt-on-primary, #fff);
}

.bt-cal--resourceMatchi .bt-cal__servicePicker {
  grid-template-columns: minmax(0, 420px);
}

@media (max-width: 980px) and (min-width: 761px) {
  .bt-cal--resourceMatchi .bt-cal__primaryFilters {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr);
    gap: 12px;
  }

  .bt-cal--resourceMatchi .bt-cal__servicePicker {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-cal__categoryTabs {
    gap: 4px;
  }

  .bt-cal__categoryTab {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
  }
}

.bt-cal--resourceMatchi .bt-cal__resourceGrid {
  display: grid;
  gap: 18px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.bt-cal__availability,
.bt-cal__availableResources {
  min-width: 0;
}

.bt-cal__availabilityHeading,
.bt-cal__availableResourcesHeading {
  margin: 0 0 12px;
  color: var(--bt-text);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0;
}

.bt-cal__timeGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
}

.bt-cal__timeButton {
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--bt-primary);
  border-radius: 6px;
  padding: 7px 6px;
  background: var(--bt-surface);
  color: var(--bt-text);
  display: grid;
  place-content: center;
  gap: 2px;
  cursor: pointer;
  letter-spacing: 0;
}

.bt-cal__timeButton:hover,
.bt-cal__timeButton:focus-visible,
.bt-cal__timeButton.is-active {
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
}

.bt-cal__timeButton:focus-visible,
.bt-cal__availableResourceBook:focus-visible {
  outline: 2px solid var(--bt-primary);
  outline-offset: 2px;
}

.bt-cal__timeButtonTime {
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bt-cal__timeButtonCount {
  font-size: 10px;
  line-height: 1.2;
  color: var(--bt-muted);
  white-space: nowrap;
}

.bt-cal__timeButton:hover .bt-cal__timeButtonCount,
.bt-cal__timeButton:focus-visible .bt-cal__timeButtonCount,
.bt-cal__timeButton.is-active .bt-cal__timeButtonCount {
  color: var(--bt-primary-contrast);
}

.bt-cal__availabilityEmpty {
  border: 1px solid var(--bt-border);
  border-radius: 6px;
  padding: 16px;
  background: var(--bt-surface-muted);
  color: var(--bt-muted);
}

.bt-cal__availableResources {
  border: 1px solid var(--bt-border);
  border-radius: 6px;
  background: var(--bt-surface);
  overflow: hidden;
}

.bt-cal__availableResourcesHeading {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
}

.bt-cal__availableResourceList {
  display: grid;
}

.bt-cal__availableResource {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--bt-border);
}

.bt-cal__availableResource:last-child {
  border-bottom: 0;
}

.bt-cal__availableResourceDetails {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.bt-cal__availableResourceName {
  overflow-wrap: anywhere;
  color: var(--bt-text);
  font-weight: 800;
}

.bt-cal__availableResourceMeta,
.bt-cal__availableResourcePrice {
  color: var(--bt-muted);
  font-size: 12px;
}

.bt-cal__availableResourceAction {
  min-width: 92px;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.bt-cal__availableResourceBook {
  min-width: 72px;
  min-height: 36px;
  border: 1px solid var(--bt-primary);
  border-radius: 4px;
  padding: 7px 12px;
  background: var(--bt-primary);
  color: var(--bt-primary-contrast);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  cursor: pointer;
}

@media (max-width: 760px) {
  .bt-cal--resourceWeek .bt-cal__bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
  }

  .bt-cal--resourceWeek .bt-cal__barSide--date {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 36px minmax(120px, 1fr) 36px;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .bt-cal--resourceWeek .bt-cal__title {
    grid-column: 1 / -1;
    grid-row: 2;
    order: initial;
    justify-content: center;
  }

  .bt-cal--resourceWeekMobileDay .bt-cal__titleWeek {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    overflow: visible;
  }

  .bt-cal--resourceWeekMobileDay .bt-cal__mobileDateLabel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bt-cal--resourceWeekMobileDay .bt-cal__mobileWeekBadge {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bt-primary) 11%, var(--bt-surface));
    color: var(--bt-primary);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
  }

  .bt-cal--resourceWeek .bt-cal__barSide--actions {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: 36px 42px;
    gap: 6px;
    order: initial;
    justify-content: flex-end;
  }

  .bt-cal__weekResourcePicker {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "label"
      "select"
      "hint";
    align-items: stretch;
  }

  .bt-cal__weekTimeline {
    grid-template-columns: 70px repeat(7, minmax(122px, 1fr));
    min-width: 924px;
  }

  .bt-cal--resourceWeekMobileDay .bt-cal__weekTimeline {
    grid-template-columns: 64px minmax(0, 1fr);
    min-width: 0;
  }

  .bt-cal__weekMatrixSlot {
    padding: 6px;
  }

  .bt-cal__adminTargetPicker {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-cal__adminTargetControls {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-cal--resourceMatchi .bt-cal__bar,
  .bt-cal--sessions .bt-cal__bar,
  .bt-cal--timebased .bt-cal__bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
  }

  .bt-cal--resourceMatchi .bt-cal__barSide--date,
  .bt-cal--sessions .bt-cal__barSide--date,
  .bt-cal--timebased .bt-cal__barSide--date {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: 36px minmax(120px, 1fr) 36px;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .bt-cal--resourceMatchi .bt-cal__barSide--date > .bt-cal__datePicker,
  .bt-cal--sessions .bt-cal__barSide--date > .bt-cal__datePicker,
  .bt-cal--timebased .bt-cal__barSide--date > .bt-cal__datePicker {
    width: 100%;
    min-width: 0;
  }

  .bt-cal--resourceMatchi .bt-cal__title,
  .bt-cal--sessions .bt-cal__title,
  .bt-cal--timebased .bt-cal__title {
    grid-column: 1 / -1;
    grid-row: 2;
    order: initial;
  }

  .bt-cal--resourceMatchi .bt-cal__barSide--actions,
  .bt-cal--sessions .bt-cal__barSide--actions,
  .bt-cal--timebased .bt-cal__barSide--actions {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: 36px 42px;
    gap: 6px;
  }

  .bt-cal--resourceMatchi .bt-cal__primaryFilters {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-inline: 12px;
  }

  .bt-cal__categoryTabs {
    gap: 4px;
  }

  .bt-cal__categoryTab {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .bt-cal--resourceMatchi .bt-cal__servicePicker {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-cal__timeGrid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
}

@media (max-width: 430px) {
  .bt-cal__availableResource {
    gap: 10px;
    padding: 12px;
  }

  .bt-cal__availableResourcesHeading {
    padding: 12px;
    font-size: 14px;
  }

  .bt-cal__availableResourceAction {
    min-width: 78px;
  }
}

/* Sessions: filter panel */
.bt-cal__filtersPanel {
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bt-surface);
  margin: 10px 0;
  flex: 0 0 auto;
}

.bt-cal__filtersPanelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
}

.bt-cal__filtersPanelTitle { font-weight: 800; }

.bt-cal__filtersPanelBody {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: min(320px, calc(100vh - var(--bt-embed-offset-top, 0px) - 180px));
  max-height: min(320px, calc(100dvh - var(--bt-embed-offset-top, 0px) - 180px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.bt-cal__filtersPanelField {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bt-cal__filtersPanelField label { font-size: 12px; color: var(--bt-muted); }

.bt-cal__filterList {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.bt-cal__filterItem {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--bt-text);
}

.bt-cal__filterItem input {
  accent-color: var(--bt-primary);
}

.bt-cal__filterEmpty {
  font-size: 13px;
  color: var(--bt-muted);
}

.bt-cal__filtersPanelSelect {
  padding: 8px 10px;
  border: 1px solid var(--bt-border-strong);
  border-radius: 10px;
  background: var(--bt-surface);
  color: var(--bt-text);
}

/* Sessions: bottom navigation */
.bt-cal__bottomNav {
  position: sticky;
  bottom: 0;
  z-index: 6;
  border-top: 1px solid var(--bt-border);
  background: var(--bt-surface);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.bt-cal__bottomNav--with-places {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bt-cal__bottomNav--app-only {
  grid-template-columns: 72px;
  justify-content: end;
}

.bt-cal__bottomNav--app-only .bt-cal__bottomNavBtn:not(.bt-cal__bottomNavBtn--places) {
  display: none;
}

.bt-cal__bottomNavBtn {
  border: none;
  background: transparent;
  color: var(--bt-muted);
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.bt-cal__bottomNavBtn.is-active {
  color: var(--bt-primary);
  font-weight: 800;
}

.bt-cal__bottomNavLabel { font-size: 12px; }

/* Sessions: tab views */
.bt-cal__tabView {
  border: 1px solid var(--bt-border);
  border-radius: 12px;
  background: var(--bt-surface);
  overflow: hidden;
  padding-bottom: 72px;
}

.bt-cal__tabTitle {
  padding: 12px 12px;
  font-weight: 800;
  border-bottom: 1px solid var(--bt-border);
  background: var(--bt-surface-muted);
}

.bt-cal__tabHint {
  padding: 10px 12px;
  color: var(--bt-muted);
}

.bt-cal__tabForm,
.bt-cal__tabList {
  padding: 12px;
}

.bt-cal__tabActions {
  padding: 0 12px 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bt-cal__bookingRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--bt-border);
}

.bt-cal__bookingActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bt-cal__bookingTitle { font-weight: 800; }
.bt-cal__bookingMeta { font-size: 12px; color: var(--bt-muted); margin-top: 2px; }
.bt-cal__bookingCodeTitle { font-size: 13px; color: var(--bt-muted); margin-top: 2px; }
.bt-cal__accessStatus {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--bt-border);
  border-radius: 6px;
  background: var(--bt-surface-muted);
  font-size: 13px;
  font-weight: 700;
}
.bt-cal__accessStatus--active {
  border-color: color-mix(in srgb, var(--bt-accent) 45%, var(--bt-border));
  color: var(--bt-accent);
}
.bt-cal__accessValidity {
  margin-top: 8px;
  color: var(--bt-muted);
  font-size: 12px;
  line-height: 1.45;
}
.bt-cal__bookingCodeLabel {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bt-muted);
  margin-top: 12px;
}
.bt-cal__bookingCode {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 4px;
  padding: 10px 0;
}
.bt-cal__qrWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0 16px;
}
.bt-cal__qrImg {
  width: 180px;
  height: 180px;
  background: #fff;
  border: 1px solid var(--bt-border);
  border-radius: 8px;
}

/* Modal overlay and dialog */
.bt-cal__modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.bt-cal__modal-overlay--nested {
  z-index: 21000;
}

.bt-cal__modal-dialog {
  background: var(--bt-surface, #fff);
  border-radius: 12px;
  padding: 24px;
  box-sizing: border-box;
  width: calc(100vw - 24px);
  max-width: 500px;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Tab buttons in modal */
.bt-cal__modal-dialog .bt-cal__tab-group {
  display: flex;
  margin: 0 0 12px;
  border: 1px solid var(--bt-border-strong, #ccc);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bt-surface-muted, #f5f5f5);
}

.bt-cal__modal-dialog .bt-cal__tab-btn {
  flex: 1;
  border: 0;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--bt-muted, #666);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bt-cal__modal-dialog .bt-cal__tab-btn.is-active {
  background: var(--bt-primary, #007bff);
  color: var(--bt-primary-contrast, #fff);
  font-weight: 600;
}

.bt-cal__modal-dialog .bt-cal__tab-btn:hover:not(.is-active) {
  background: var(--bt-surface, #fff);
  color: var(--bt-text, #222);
}

.bt-cal__modal-dialog h3 {
  margin: 0 0 16px;
  color: var(--bt-text, #222);
  font-size: 20px;
  font-weight: 700;
}

.bt-cal__modal-dialog p {
  margin: 0 0 20px;
  color: var(--bt-text-secondary, #666);
  line-height: 1.5;
}

.bt-cal__modal-dialog input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--bt-border, #ddd);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  background: var(--bt-surface, #fff);
  color: var(--bt-text, #222);
}

.bt-cal__modal-dialog label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bt-text, #222);
}

.bt-cal__modal-dialog .bt-cal__field {
  margin-bottom: 12px;
}

.bt-cal__announcementDialog {
  width: min(560px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--bt-border, #ddd);
  border-radius: 8px;
  overflow: hidden;
}

.bt-cal__announcementDialog > h3 {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--bt-border, #ddd);
}

.bt-cal__announcementList {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding: 0 20px;
}

.bt-cal__announcementItem {
  padding: 18px 0;
  border-bottom: 1px solid var(--bt-border, #ddd);
}

.bt-cal__announcementItem:last-child { border-bottom: 0; }
.bt-cal__announcementItem.is-important { border-left: 3px solid #dc2626; padding-left: 14px; }
.bt-cal__announcementHeading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bt-cal__announcementHeading strong { color: var(--bt-text, #222); overflow-wrap: anywhere; }
.bt-cal__announcementPriority { color: #b91c1c; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.bt-cal__announcementFrom { margin-top: 5px; color: var(--bt-muted, #666); font-size: 12px; }
.bt-cal__modal-dialog .bt-cal__announcementMessage {
  margin: 12px 0 0;
  color: var(--bt-text, #222);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bt-cal__announcementActions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--bt-border, #ddd);
  background: var(--bt-surface-muted, #f5f5f5);
}

@media (max-width: 520px) {
  .bt-cal__modal-dialog {
    padding: 20px;
    width: 95%;
    max-height: 90vh;
  }
  
  .bt-cal__modal-dialog h3 {
    font-size: 18px;
  }
  
  .bt-cal__modal-dialog .bt-cal__tab-btn {
    font-size: 12px;
    padding: 8px 6px;
  }
}
/* Shared progress feedback for booking, cancellation and availability requests. */
.bt-cal__dialogBtn[aria-busy="true"]::before,
.bt-cal__availabilityStatus:not([hidden])::before,
.bt-cal button[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-inline-end: .55em;
  vertical-align: -.12em;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: bt-calendar-progress .7s linear infinite;
}
.bt-cal__resourceGrid[aria-busy="true"] { opacity: .6; }
@keyframes bt-calendar-progress { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .bt-cal__dialogBtn[aria-busy="true"]::before,
  .bt-cal__availabilityStatus:not([hidden])::before,
  .bt-cal button[aria-busy="true"]::before { animation: none; }
}
