.duration-picker-popup {
  width: 380px;
  max-width: calc(100vw - 24px);
  color: var(--bs-text);
}

.duration-picker-popup > .popup-content {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid var(--bs-border-color);
  border-radius: 16px;
  background: var(--bs-surface-bg);
  box-shadow: 0 8px 28px rgb(15 23 42 / 10%);
}

.duration-picker-popup .quick-book-duration-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.duration-picker-heading,
.duration-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.duration-picker-heading h2 {
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  margin: 0;
}

.duration-picker-heading button {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  height: 36px;
}

.quick-book-duration-form > label {
  font-size: 13px;
  font-weight: 500;
  margin: 4px 0 -8px;
  color: var(--bs-text-muted);
}

.duration-service-name {
  margin: 0;
  font-size: 14px;
  color: var(--bs-text-muted);
  overflow-wrap: anywhere;
}

.duration-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.duration-stepper button,
.duration-picker-heading button {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--bs-border-color);
  border-radius: 50%;
  background: var(--bs-surface-bg);
  color: var(--bs-text);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.duration-stepper button:not(:disabled):hover,
.duration-picker-heading button:hover {
  background: var(--bs-surface-2-bg);
  border-color: color-mix(in srgb, var(--bs-main) 25%, var(--bs-border-color));
}

.duration-stepper input {
  width: 100%;
  min-width: 0;
  height: 56px;
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  background: var(--bs-surface-2-bg);
  color: var(--bs-text);
  text-align: center;
  font-size: 22px;
  font-weight: 600;
}

.duration-stepper input:focus-visible {
  outline: 2px solid var(--bs-main);
  outline-offset: 2px;
}

.duration-error {
  margin: 0;
  color: var(--bs-danger);
  font-size: 13px;
}

.duration-error:empty {
  display: none;
}

.duration-picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 16px;
  border-top: 1px solid var(--bs-border-color);
  margin-top: 4px;
}

.duration-picker-actions .btn {
  flex: 1;
  min-height: 44px;
  width: 100%;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
}

.duration-picker-actions .btn[data-action="cancel"] {
  color: var(--bs-text);
  background: var(--bs-surface-2-bg);
  border: 1px solid var(--bs-border-color);
}

.duration-picker-actions .btn[data-action="cancel"]:hover {
  background: var(--bs-border-color);
}

.quick-book-picker-sheet .duration-picker-heading {
  display: none;
}

body.quick-book-picker-open {
  overflow: hidden;
}

body .quick-book-picker-sheet {
  position: fixed;
  inset: 0;
  z-index: 1056;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100vh;
  height: 100dvh;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(135, 140, 147, 0.5);
  overflow: hidden;
}

.quick-book-picker-sheet .quick-book-picker-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 100%;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom);
  border-radius: 8px 8px 0 0;
  background: var(--bs-surface-bg);
  color: var(--bs-text);
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0;
  overflow: hidden;
  animation: quick-book-picker-enter 180ms ease-out;
}

.quick-book-picker-sheet .quick-book-picker-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--bs-border-color);
}

.quick-book-picker-sheet .quick-book-picker-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.quick-book-picker-sheet .quick-book-picker-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--bs-surface-2-bg);
  color: var(--bs-text);
  font-size: 20px;
}

.quick-book-picker-sheet .quick-book-picker-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
}

.quick-book-picker-sheet .popup-container,
.quick-book-picker-sheet .popup-content {
  position: static;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  overflow: hidden;
}

.quick-book-picker-sheet .header-time > p,
.quick-book-picker-sheet .close-btn-time,
.quick-book-picker-sheet .header-repeat {
  display: none;
}

.quick-book-picker-sheet .flat-time-available {
  min-width: 0;
  min-height: 0;
  gap: 12px;
}

.quick-book-picker-sheet .flat-time-available .header-time {
  flex: 0 0 auto;
}

.quick-book-picker-sheet .flat-time-available .time-description {
  width: calc(100% - 32px);
  min-height: 44px;
  margin: 12px 16px 0;
  padding: 0;
  gap: 4px;
  overflow: visible;
}

.quick-book-picker-sheet .flat-time-available .box-time-select {
  min-width: 0;
  min-height: 44px;
  height: auto;
  padding: 8px 4px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  text-align: center;
}

.quick-book-picker-sheet .flat-time-available .area-time-append {
  min-height: 0;
  max-height: none;
  padding: 0 16px 16px;
  gap: 12px;
  overscroll-behavior: contain;
}

.quick-book-picker-sheet .time-period-section {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.quick-book-picker-sheet .time-period-header {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 20px;
  gap: 4px 8px;
  min-height: 48px;
  padding: 8px;
  border-radius: 6px;
}

.quick-book-picker-sheet .time-period-header .period-icon {
  width: 24px;
  height: 24px;
  font-size: 16px;
}

.quick-book-picker-sheet .time-period-header span {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
}

.quick-book-picker-sheet .time-period-header small {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  line-height: 16px;
}

.quick-book-picker-sheet .time-period-header .slot-count {
  grid-column: 3;
  grid-row: 1 / 3;
  margin: 0;
}

.quick-book-picker-sheet .time-period-toggle {
  grid-column: 4;
  grid-row: 1 / 3;
}

.quick-book-picker-sheet .time-period-slots {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
}

.quick-book-picker-sheet .flat-repeat-form-popup,
.quick-book-picker-sheet .flat-repeat-form {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 16px;
  overflow: auto;
}

.quick-book-picker-sheet .flat-repeat-form {
  padding: 16px 20px 0;
}

.quick-book-picker-sheet .flat-repeat-form > * {
  flex-shrink: 0;
}

.quick-book-picker-sheet .flat-repeat-form .ui-repeat-every,
.quick-book-picker-sheet .flat-repeat-form .ui-repeat-ends {
  min-width: 0;
  width: 100%;
  height: auto;
  gap: 8px;
  font-size: 14px;
  line-height: 22px;
}

.quick-book-picker-sheet .flat-repeat-form .title {
  font-size: 14px;
  line-height: 22px;
}

.quick-book-picker-sheet .ui-repeat-every {
  display: flex;
  flex-wrap: wrap;
}

.quick-book-picker-sheet .ui-repeat-every .title {
  flex-basis: 100%;
}

.quick-book-picker-sheet .flat-repeat-form .ui-repeat-every input,
.quick-book-picker-sheet .flat-repeat-form .ui-repeat-every select,
.quick-book-picker-sheet .flat-repeat-form .repeat-ends .item-check-select-ends-type input {
  min-width: 0;
  min-height: 44px;
  height: auto;
  padding: 8px;
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  font-size: 16px;
  line-height: 24px;
}

.quick-book-picker-sheet .flat-repeat-form select {
  flex: 1;
}

.quick-book-picker-sheet .flat-repeat-form .ui-repeat-every .every-inp,
.quick-book-picker-sheet .flat-repeat-form .ui-repeat-ends .repeat-ends .after-inp {
  width: 64px;
}

.quick-book-picker-sheet .flat-repeat-form .ui-repeat-ends .repeat-ends {
  height: auto;
}

.quick-book-picker-sheet .flat-repeat-form .ui-repeat-ends .repeat-ends .item-check-select-ends-type {
  width: 100%;
  min-height: 60px;
  height: auto;
  margin: 0;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.quick-book-picker-sheet .flat-repeat-form .ui-repeat-ends .repeat-ends .ends-ratio-select {
  min-width: 80px;
  max-width: 80px;
}

.quick-book-picker-sheet .flat-repeat-form .ui-repeat-ends .repeat-ends .on-date-inp {
  flex: 1;
  width: 160px;
  margin: 0;
}

.quick-book-picker-sheet .flat-repeat-form .repeat-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-surface-bg);
  z-index: 2;
}

.quick-book-picker-sheet .repeat-actions button {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  height: auto;
  padding: 12px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 20px;
}

.quick-book-picker-sheet .daterangepicker {
  position: static !important;
  width: 100% !important;
  max-width: none;
  margin: 0;
  padding: 12px 16px 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  float: none;
}

.quick-book-picker-sheet .daterangepicker::before,
.quick-book-picker-sheet .daterangepicker::after {
  display: none;
}

.quick-book-picker-sheet .daterangepicker.single .drp-calendar.left {
  float: none;
  width: 100%;
  max-width: none;
  padding: 0;
}

.quick-book-picker-sheet .daterangepicker .calendar-table {
  width: 100%;
  padding: 0;
}

.quick-book-picker-sheet .daterangepicker .calendar-table table {
  width: 100%;
  table-layout: fixed;
}

.quick-book-picker-sheet .daterangepicker .calendar-table th,
.quick-book-picker-sheet .daterangepicker .calendar-table td {
  min-width: 0;
  width: auto;
  height: 44px;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
}

.quick-book-picker-sheet button:focus-visible,
.quick-book-picker-sheet input:focus-visible,
.quick-book-picker-sheet select:focus-visible {
  outline: 2px solid var(--bs-main);
  outline-offset: -2px;
}

@keyframes quick-book-picker-enter {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .quick-book-picker-sheet .quick-book-picker-panel {
    animation: none;
  }
}