.appointment-dialog .booking-times.booking-dynamic-times {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 116px), 1fr)) !important;
  justify-content: stretch;
}

.appointment-dialog .booking-dynamic-times .booking-time {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 34px !important;
  padding: 4px 6px !important;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: 0;
}

.appointment-dialog .booking-day.is-active,
.appointment-dialog .booking-dynamic-times .booking-time.is-active {
  position: relative;
  overflow: hidden;
}

.appointment-dialog .booking-day.is-active::after,
.appointment-dialog .booking-dynamic-times .booking-time.is-active::after {
  content: "\2713";
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #dcfce7;
  color: #059669;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.22);
}

.appointment-dialog .booking-dynamic-times > p {
  grid-column: 1 / -1;
}

.appointment-dialog.booking-details-dialog .booking-privacy-block {
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

/* The employee picker belongs to the time step; only this strip scrolls sideways. */
.appointment-dialog .booking-time-employees {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 8px;
  overflow: hidden;
}

.appointment-dialog .booking-time-employees .booking-barber-strip-wrap {
  min-width: 0;
  margin-bottom: 0;
}

.appointment-dialog .booking-time-employees .booking-barber-strip {
  flex-wrap: nowrap;
  align-items: start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 6px 10px;
  scroll-padding-inline: 6px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.appointment-dialog .booking-time-employees .booking-barber-pill {
  flex: 0 0 84px;
  width: 84px;
  min-width: 0;
  grid-template-rows: 60px minmax(28px, auto) auto;
  align-items: start;
  gap: 3px;
  padding: 4px 3px;
  scroll-snap-align: start;
}

.appointment-dialog .booking-time-employees .booking-barber-pill.is-any {
  flex-basis: 116px;
  width: 116px;
  min-width: 0;
}

/* A day off/holiday is not an employee choice on the selected booking date. */
.appointment-dialog .booking-time-employees .booking-barber-pill[data-barber]:disabled {
  filter: grayscale(1);
}

.appointment-dialog .booking-time-employees .booking-barber-circle {
  width: 60px;
  height: 60px;
}

.appointment-dialog .booking-time-employees .booking-barber-pill strong,
.appointment-dialog .booking-time-employees .booking-barber-pill small {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.appointment-dialog .booking-time-employees .booking-barber-strip .booking-barber-pill:focus-visible {
  outline: 2px solid var(--site-accent) !important;
  outline-offset: 1px !important;
}

.appointment-dialog .booking-employee-choice .booking-barber-strip {
  flex-wrap: wrap;
  overflow: visible;
  justify-content: center;
}

.appointment-dialog .booking-employee-choice .booking-barber-pill {
  flex-basis: 140px;
  width: 140px;
  min-width: 0;
}

.appointment-dialog .booking-employee-choice .booking-barber-pill strong,
.appointment-dialog .booking-employee-choice .booking-barber-pill small {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.appointment-dialog .booking-time-heading {
  margin: 0 0 8px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

@media (max-width: 720px), (pointer: coarse) {
  .appointment-modal:has(.booking-time-dialog) {
    padding-right: 4px !important;
    padding-left: 4px !important;
  }

  .appointment-dialog.booking-details-dialog > .appointment-head {
    display: none;
  }

  .appointment-dialog.booking-details-dialog .booking-summary-panel {
    display: none;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review > h3 {
    display: none;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review {
    margin: 0 0 4px;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-list {
    gap: 0;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-list div,
  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-meta span {
    gap: 1px;
    padding-bottom: 4px;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-list dt {
    font-size: 10.5px;
    line-height: 1.05;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-list dd {
    font-size: 13px;
    line-height: 1.12;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--site-line);
  }

  .appointment-dialog.booking-details-dialog .booking-combined-review .booking-summary-meta span {
    display: grid;
    min-width: 0;
    border-bottom: 0;
  }

  .appointment-dialog.booking-confirm-dialog > .appointment-head {
    display: none;
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-panel {
    display: none;
  }

  .appointment-dialog.booking-confirm-dialog .booking-main {
    display: block;
    min-height: 0;
  }

  .appointment-dialog.booking-confirm-dialog .booking-main > h3 {
    display: none;
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-list {
    gap: 0;
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-list div,
  .appointment-dialog.booking-confirm-dialog .booking-summary-list .booking-summary-meta span {
    gap: 1px;
    padding-bottom: 5px;
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-list dt {
    font-size: 11px;
    line-height: 1.1;
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-list dd {
    font-size: 14px;
    line-height: 1.15;
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--site-line);
  }

  .appointment-dialog.booking-confirm-dialog .booking-summary-meta span {
    display: grid;
    min-width: 0;
    border-bottom: 0;
  }

  .appointment-dialog.booking-details-dialog .booking-main {
    display: block;
    min-height: 0;
  }

  .appointment-dialog.booking-details-dialog .booking-form-grid {
    display: grid;
    flex: 0 0 auto !important;
    align-content: start !important;
    grid-auto-rows: min-content;
    gap: 4px !important;
    row-gap: 4px !important;
  }

  .appointment-dialog.booking-details-dialog .booking-form-grid label {
    gap: 0 !important;
    margin: 0 !important;
  }

  .appointment-dialog.booking-details-dialog .booking-form-grid input:not([type="checkbox"]) {
    height: 36px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 20px;
  }

  .appointment-dialog.booking-details-dialog .booking-privacy-block {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 22px;
    padding: 0;
    margin: 0 !important;
    border: 0;
    background: transparent;
    font-size: 11.5px;
    line-height: 1.15;
  }

  .appointment-dialog.booking-details-dialog .booking-privacy-block input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    outline: 0 !important;
    box-shadow: none !important;
  }

  .appointment-dialog.booking-details-dialog .booking-privacy-block.has-error input {
    outline: 0 !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
  }

  .appointment-dialog.booking-details-dialog .booking-privacy-block > span {
    min-width: 0;
    white-space: nowrap;
    font-size: 11.5px;
    line-height: 1.15;
  }

  .appointment-dialog.booking-details-dialog .booking-nav {
    margin-top: 10px;
    padding-top: 8px;
  }

  .appointment-dialog.booking-time-dialog > .appointment-head {
    display: none;
  }

  .appointment-dialog.booking-time-dialog {
    width: calc(100vw - 8px) !important;
  }

  .appointment-dialog.booking-time-dialog .booking-layout {
    padding-right: 6px !important;
    padding-left: 6px !important;
  }

  .appointment-dialog.booking-time-dialog .booking-main {
    min-height: 100%;
    padding-bottom: 2px;
  }

  .appointment-dialog.booking-time-dialog .booking-nav {
    margin-top: 6px;
    margin-bottom: -12px;
    padding-top: 6px;
  }

  .appointment-dialog.booking-time-dialog .booking-nav .booking-cart-summary {
    padding: 5px 9px;
  }

  .appointment-dialog.booking-time-dialog .booking-nav .booking-cart-head strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--site-text);
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .appointment-dialog.booking-time-dialog .booking-nav .booking-cart-lines {
    display: none;
  }

  .appointment-dialog.booking-time-dialog .booking-time-heading {
    display: none;
  }

  .appointment-dialog.booking-time-dialog .booking-time-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .appointment-dialog.booking-time-dialog .booking-time-employees {
    margin-bottom: 2px;
  }

  .appointment-dialog.booking-time-dialog .booking-calendar-head {
    margin-bottom: 4px;
  }

  .appointment-dialog.booking-time-dialog .booking-days {
    gap: 4px !important;
    margin-bottom: 5px;
  }

  .appointment-dialog .booking-times.booking-dynamic-times {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 178px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scroll-snap-type: y proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .appointment-dialog .booking-times.booking-dynamic-times::-webkit-scrollbar {
    display: none;
  }

  .appointment-dialog .booking-dynamic-times .booking-time {
    min-height: 40px !important;
    font-size: 12px;
    scroll-snap-align: start;
  }

  .appointment-dialog .booking-time-employees .booking-barber-strip {
    gap: 6px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .appointment-dialog .booking-time-employees .booking-barber-pill {
    flex-basis: 78px;
    width: 78px;
    grid-template-rows: 50px minmax(24px, auto) auto;
  }

  .appointment-dialog .booking-time-employees .booking-barber-pill.is-any {
    flex-basis: 108px;
    width: 108px;
  }

  .appointment-dialog .booking-time-employees .booking-barber-circle {
    width: 50px;
    height: 50px;
  }
}

/* Keep this combined step inside narrow phones without clipping its day buttons. */
@media (max-width: 720px), (pointer: coarse) and (max-width: 900px) {
  .appointment-dialog:has(.booking-time-employees) {
    width: calc(100vw - 8px) !important;
    min-width: 0;
  }

  .appointment-dialog:has(.booking-time-employees) .booking-days {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    max-width: 100%;
    gap: 4px !important;
  }

  .appointment-dialog:has(.booking-time-employees) .booking-day {
    width: 100%;
    min-width: 0;
  }

  .appointment-dialog:has(.booking-time-employees) .booking-times {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
    width: 100%;
  }

  .appointment-dialog:has(.booking-time-employees) .booking-time {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (pointer: coarse) and (max-width: 1180px) and (max-height: 500px) {
  .appointment-dialog:has(.booking-time-employees) .booking-nav {
    position: static !important;
    bottom: auto;
  }
}

@media (pointer: coarse) and (min-width: 600px) and (max-width: 900px) and (max-height: 500px) {
  .appointment-dialog:has(.booking-time-employees) .booking-days {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}
.appointment-dialog.booking-time-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(860px, calc(var(--booking-viewport-height, 100dvh) - 72px));
  min-height: 0 !important;
  overflow: hidden !important;
}

.booking-time-dialog > .appointment-head {
  position: relative;
  flex: 0 0 auto;
}

.appointment-dialog.booking-time-dialog .booking-layout {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden !important;
  scroll-snap-type: none;
}

.appointment-dialog.booking-time-dialog .booking-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.appointment-dialog.booking-time-dialog .booking-time-content {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.booking-time-content::-webkit-scrollbar {
  display: none;
}

.appointment-dialog.booking-time-dialog .booking-nav {
  position: static !important;
  flex: 0 0 auto;
}

.booking-day-loading {
  position: absolute;
  top: 100%;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--site-panel);
  color: var(--site-muted);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .appointment-dialog.booking-time-dialog {
    height: calc(var(--booking-viewport-height, 100dvh) - 8px - env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 8px) !important;
  }
}

/* Short screens keep the existing whole-content scrolling, without shrinking the frame. */
@media (max-height: 600px) {
  .appointment-dialog.booking-time-dialog .booking-layout {
    overflow-y: auto !important;
  }

  .appointment-dialog.booking-time-dialog .booking-main {
    min-height: 100%;
    overflow: visible;
  }

  .appointment-dialog.booking-time-dialog .booking-time-content {
    flex: 0 0 auto;
    overflow: visible;
  }
}
