/* Keep the booking sheet bounded even when generated utility CSS is cached. */
@media (max-width: 1023px), (max-height: 500px) {
  #booking-modal .booking-modal-sheet { display: block !important; overflow-y: auto !important; overscroll-behavior: contain; scroll-padding: 16px; }
  #booking-modal .booking-modal-body { overflow: visible !important; flex: none !important; padding-bottom: 20px !important; }
  #booking-modal .booking-modal-footer { position: static !important; display: block !important; padding: 16px !important; }
  #booking-modal .booking-modal-footer > div { width: 100% !important; }
  #booking-modal .booking-modal-footer > div:first-child { display: flex !important; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
  #booking-modal .booking-modal-footer button { width: 100%; }
  #booking-modal .booking-modal-sheet > :first-child { position: static !important; }
}
#booking-otp-box[hidden], #booking-otp-box [hidden] { display: none !important; }
#booking-otp-box { padding: 14px; border: 1px solid #dbe4ee; border-radius: 12px; background: #f8fafc; }
#booking-otp-box p { font-size: 14px; line-height: 1.45; margin-bottom: 10px; }
#booking-otp-box button { min-height: 44px; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 650; }
#booking-otp-box .otp-primary { background: #005e9e; color: white; }
#booking-otp-box .otp-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: stretch; }
#booking-modal #booking-sms-code { width: 100%; min-width: 0; height: 48px; background: white; border: 1px solid #b8ccdc; border-radius: 10px; padding: 8px; font-size: 22px; letter-spacing: 5px; text-align: center; }
#booking-modal #booking-sms-code:focus { border-color: #087e97; outline: 3px solid #c5e9ef; outline-offset: 1px; }
#booking-otp-box .otp-row button { height: 48px; white-space: nowrap; padding: 10px; }
#booking-otp-box .otp-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
#booking-otp-box .otp-heading label { font-size: 13px; line-height: 1.4; color: #526c78; }
#booking-display-phone { display: block; color: #17364a; font-size: 14px; font-weight: 650; }
#booking-otp-box #btn-booking-edit-phone { padding: 8px 0 8px 8px; color: #00649b; font-size: 13px; font-weight: 500; }
#booking-otp-box #btn-booking-resend-code { margin-top: 4px; padding: 8px 0; color: #00649b; font-weight: 500; }
#booking-otp-box #btn-booking-resend-code:disabled { color: #718797; cursor: default; }
.booking-phone-field { position: relative; }
.booking-phone-example { position: absolute; inset: 0; display: flex; align-items: center; padding: 10px 14px; pointer-events: none; font-size: 16px; font-weight: 500; color: #94a3b8; }
.booking-phone-example > span { visibility: hidden; }
.booking-phone-example[hidden] { display: none !important; }
#booking-otp-error-msg { color: #b91c1c; font-size: 14px; margin-top: 10px; }
#booking-otp-success { color: #047857; font-size: 14px; }
#booking-modal {
  overflow: hidden;
}
html:has(#booking-modal:not(.hidden)) { overflow: hidden; }
@media (max-height: 380px) {
  #booking-modal .booking-carrier-line {
    flex-wrap: nowrap;
    margin-bottom: 2px;
  }
  #booking-modal .booking-carrier-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 10px;
    line-height: 14px;
  }
  #booking-modal .booking-recommendation {
    display: none;
  }
  #booking-modal #modal-route-title {
    font-size: 14px;
    line-height: 18px;
  }
  #booking-modal #modal-route-time {
    font-size: 11px;
    line-height: 14px;
  }
}
#booking-modal .booking-modal-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 94vh;
  max-height: 94dvh;
}
#booking-modal .booking-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 16px;
}
#booking-modal .booking-modal-footer,
#booking-modal .booking-modal-sheet > :first-child {
  flex: 0 0 auto;
}
@media (max-width: 1023px) {
  #main-search-form input:not([type="hidden"]),
  #modify-search-form input:not([type="hidden"]),
  #modify-search-form select,
  #booking-modal input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]):not(.otp-box),
  #booking-modal select,
  #booking-modal textarea,
  #cabinet-phone-input,
  #single-ticket-input {
    font-size: 16px;
    letter-spacing: 0;
  }
}
@media (max-height: 500px) {
  #booking-modal {
    padding: 0;
  }
  #booking-modal .booking-modal-sheet {
    max-height: 100vh;
    max-height: 100dvh;
    margin-block: 0;
  }
  #booking-modal .booking-modal-sheet > :first-child {
    padding: 8px 12px;
  }
  #booking-modal .booking-modal-footer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
  }
  #booking-modal .booking-modal-footer > div {
    display: block;
    min-width: 0;
    width: auto;
  }
  #booking-modal #modal-total-price {
    font-size: 18px;
    line-height: 24px;
    white-space: nowrap;
  }
  #booking-modal #btn-confirm-booking {
    min-height: 44px;
    width: 100%;
    padding: 8px;
    font-size: 14px;
    line-height: 18px;
  }
  #booking-modal .booking-modal-footer > div:last-child > div {
    font-size: 10px;
    line-height: 13px;
  }
}
