/* Continuation shading for bounded testimonial and booking panels, with or without
   JavaScript: surface-coloured covers scroll with the content (local) over shadows
   fixed to the panel (scroll), so a shadow shows only where content continues.
   Only the panels listed here opt in. Panels (or their ancestors) may set
   --scroll-shade-surface (their background) and --scroll-shade-size (shadow depth).
   Overflow-hidden variants are left out: a cue there could not be scrolled.
   Chromium paints scroll-attached layers into an empty reserved scrollbar gutter,
   so where scroll-state queries exist the panels keep sticky edge cues instead
   (end of file), shown only where the panel can scroll further. */
@supports not (container-type: scroll-state) {
  :is(
    .review-story-body:not(.review-story-dialog--scroll *),
    .review-story-dialog--scroll .review-story-content,
    .review-dialog,
    :is(body.booking-embedded, .booking-page, .calendar_wrap) :is(.fcal_day_picker_wrap, .fcal_booking_form_wrap, .fcal_date_event_details),
    body:not(.booking-embedded) :is(.booking-page, .calendar_wrap) .fcal_slot_items,
    body.booking-embedded .booking-actions-bottom .fcal_slot_wrapper,
    body.booking-embedded .fcal_confirmation:not(.booking-receipt-layout) .fcal_confirm_body,
    body.booking-embedded .booking-receipt-fields,
    .booking-server .server-scroll
  ) {
    background-image:
      linear-gradient(var(--scroll-shade-surface, var(--color-paper)) 35%, transparent),
      linear-gradient(transparent, var(--scroll-shade-surface, var(--color-paper)) 65%),
      linear-gradient(var(--scroll-cue-color), transparent),
      linear-gradient(transparent, var(--scroll-cue-color));
    background-position: top, bottom, top, bottom;
    background-size: 100% 40px, 100% 40px,
      100% calc(var(--scroll-shade-size, 20px) * var(--scroll-shade-open, 1)),
      100% calc(var(--scroll-shade-size, 20px) * var(--scroll-shade-open, 1));
    background-repeat: no-repeat;
    background-attachment: local, local, scroll, scroll;
    /* Flush with the panel's edges. */
    background-clip: padding-box;
  }
}
/* Rounded ends. The review form dialog keeps its own card corners; vendor panels are square. */
:is(
  .review-story-body:not(.review-story-dialog--scroll *),
  .review-story-dialog--scroll .review-story-content,
  :is(body.booking-embedded, .booking-page, .calendar_wrap) :is(.fcal_day_picker_wrap, .fcal_booking_form_wrap, .fcal_date_event_details),
  body:not(.booking-embedded) :is(.booking-page, .calendar_wrap) .fcal_slot_items,
  body.booking-embedded .booking-actions-bottom .fcal_slot_wrapper,
  body.booking-embedded .fcal_confirmation:not(.booking-receipt-layout) .fcal_confirm_body,
  body.booking-embedded .booking-receipt-fields,
  .booking-server .server-scroll
) { border-radius: var(--radius-control) !important; }
.review-story-dialog { --scroll-shade-surface: var(--surface-page); }
/* Inside a disclosure, draw shadows only once the panel reaches its final height.
   Closing, instant (responsive) and reduced-motion toggles settle at once. */
details > .disclosure-content { --scroll-shade-open: 0; }
details[open] > .disclosure-content { --scroll-shade-open: 1; }
details > .disclosure-content :is(.booking-receipt-fields, .server-scroll) { transition: background-size 0s; }
details[open] > .disclosure-content :is(.booking-receipt-fields, .server-scroll) { transition-delay: var(--disclosure-duration); }
details[data-disclosure-instant] > .disclosure-content :is(.booking-receipt-fields, .server-scroll) { transition: none; }
@media (prefers-reduced-motion: reduce) {
  details > .disclosure-content :is(.booking-receipt-fields, .server-scroll) { transition: none; }
}
/* Scroll-state browsers: the same panels draw zero-height sticky edge cues whose
   shadows fade in only where the panel can scroll further. */
@supports (container-type: scroll-state) {
  :is(
    .review-story-body:not(.review-story-dialog--scroll *),
    .review-story-dialog--scroll .review-story-content,
    .review-dialog,
    :is(body.booking-embedded, .booking-page, .calendar_wrap) :is(.fcal_day_picker_wrap, .fcal_booking_form_wrap, .fcal_date_event_details),
    body:not(.booking-embedded) :is(.booking-page, .calendar_wrap) .fcal_slot_items,
    body.booking-embedded .booking-actions-bottom .fcal_slot_wrapper,
    body.booking-embedded .fcal_confirmation:not(.booking-receipt-layout) .fcal_confirm_body,
    body.booking-embedded .booking-receipt-fields,
    .booking-server .server-scroll
  ) {
    /* Isolated, so the cues' z-index stays inside the panel and never paints over
       positioned neighbouring content. */
    container-type: scroll-state; isolation: isolate;
    @container scroll-state(scrollable: y) {
      &::before, &::after {
        content: ''; display: block; position: sticky; z-index: 2;
        flex: 0 0 0; height: 0; opacity: 0; pointer-events: none;
        transition-property: opacity, visibility;
        transition-duration: var(--interaction-duration, 180ms), 0s;
        transition-timing-function: var(--interaction-ease, ease-out);
      }
    }
    @container scroll-state(scrollable: top) { &::before { opacity: 1; } }
    @container scroll-state(scrollable: bottom) { &::after { opacity: 1; } }
    @media (prefers-reduced-motion: reduce) {
      &::before, &::after { transition: none; }
    }
  }
  /* Low specificity: panels may set their own depth or padding offsets (booking.css). */
  :where(
    .review-story-body:not(.review-story-dialog--scroll *),
    .review-story-dialog--scroll .review-story-content,
    .review-dialog,
    :is(body.booking-embedded, .booking-page, .calendar_wrap) :is(.fcal_day_picker_wrap, .fcal_booking_form_wrap, .fcal_date_event_details),
    body:not(.booking-embedded) :is(.booking-page, .calendar_wrap) .fcal_slot_items,
    body.booking-embedded .booking-actions-bottom .fcal_slot_wrapper,
    body.booking-embedded .fcal_confirmation:not(.booking-receipt-layout) .fcal_confirm_body,
    body.booking-embedded .booking-receipt-fields,
    .booking-server .server-scroll
  ) {
    &::before { top: 0; box-shadow: 0 5px 12px 7px var(--scroll-cue-color); }
    &::after { bottom: 0; box-shadow: 0 -5px 12px 7px var(--scroll-cue-color); }
  }
  /* Inside a disclosure, cues appear once the panel reaches its final height. */
  details > .disclosure-content :is(.booking-receipt-fields, .server-scroll)::before,
  details > .disclosure-content :is(.booking-receipt-fields, .server-scroll)::after { visibility: hidden; }
  details[open] > .disclosure-content :is(.booking-receipt-fields, .server-scroll)::before,
  details[open] > .disclosure-content :is(.booking-receipt-fields, .server-scroll)::after { visibility: visible; transition-delay: 0s, var(--disclosure-duration); }
  details[data-disclosure-instant] > .disclosure-content :is(.booking-receipt-fields, .server-scroll)::before,
  details[data-disclosure-instant] > .disclosure-content :is(.booking-receipt-fields, .server-scroll)::after { transition-delay: 0s; }
}
