.tm-booking {
    --tm-booking-gap: 24px;
    width: 100%;
}
.tm-booking-frame {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: #fff;
}
.tm-booking .tm-booking-open,
.tm-booking .tm-booking-close {
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid #1769aa;
    border-radius: 8px;
    background: #1769aa;
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}
.tm-booking .tm-booking-open:focus-visible,
.tm-booking .tm-booking-close:focus-visible {
    outline: 3px solid #1769aa;
    outline-offset: 3px;
}
.tm-booking-dialog {
    box-sizing: border-box;
    width: min(1120px, calc(100% - 2 * var(--tm-booking-gap)));
    max-width: none;
    height: min(920px, calc(100vh - 2 * var(--tm-booking-gap)));
    height: min(920px, calc(100dvh - 2 * var(--tm-booking-gap)));
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 16px;
    background: #fff;
    color: #172333;
    box-shadow: 0 24px 80px #07132366;
}
.tm-booking-dialog:not([open]) { display: none; }
.tm-booking-dialog[open] { display: flex; flex-direction: column; }
.tm-booking-dialog::backdrop { background: #0b1728a6; }
.tm-booking-dialog-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid #d8dee8;
    background: #fff;
}
.tm-booking .tm-booking-dialog-header h2 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 20px;
    line-height: 1.3;
    color: inherit;
}
.tm-booking .tm-booking-close {
    flex: 0 0 auto;
    border-color: #ccd5e1;
    background: #f1f5f9;
    color: #172333;
}
.tm-booking-close span { margin-right: 4px; font-size: 22px; line-height: 1; }
.tm-booking-dialog > .tm-booking-frame {
    flex: 1 1 0;
    height: auto;
    max-height: none;
    min-height: 0;
    border: 0;
    border-radius: 0;
}
html:has(.tm-booking-dialog[open]) { overflow: hidden; }
@media (max-width: 600px), (max-height: 600px) {
    .tm-booking { --tm-booking-gap: 12px; }
    .tm-booking-dialog-header { gap: 8px; padding: 8px 12px; }
    .tm-booking .tm-booking-dialog-header h2 { font-size: 17px; }
}

/* Trip details share the existing jQuery UI dialog and its inherited theme colors. */
.ui-dialog.tm-timetable-dialog {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
}
.ui-dialog.tm-timetable-dialog .ui-dialog-titlebar {
    flex: 0 0 auto;
    padding: 20px 60px 20px 24px;
    background: var(--tm-color-surface, #fff);
    border-bottom: 1px solid var(--tm-color-border, #d8dee8);
}
.ui-dialog.tm-timetable-dialog .ui-dialog-title {
    float: none;
    display: block;
    width: auto;
    white-space: normal;
    font-size: 20px;
    line-height: 1.45;
}
.ui-dialog.tm-timetable-dialog .ui-dialog-content {
    flex: 1 1 auto;
    min-height: 0 !important;
    padding: 0;
    overflow: auto;
}
.ui-dialog.tm-timetable-dialog .tm-timetable-details > img.tm-timetable-image {
    display: block;
    width: 100%;
    height: clamp(160px, 25vh, 280px);
    object-fit: cover;
}
.tm-timetable-copy {
    padding: 24px 28px 28px;
    color: var(--tm-color-text, #172333);
    line-height: 1.75;
    overflow-wrap: anywhere;
}
.tm-timetable-copy > * { max-width: 68ch; }
.tm-timetable-copy > :first-child { margin-top: 0; font-size: 1.08em; font-weight: 500; }
.tm-timetable-copy > :last-child { margin-bottom: 0; }
.tm-timetable-copy p + p { margin-top: 1.25em; }
.tm-timetable-copy img { max-width: 100%; height: auto; }
.ui-dialog.tm-timetable-dialog .ui-dialog-buttonpane {
    flex: 0 0 auto;
    margin: 0;
    padding: 16px 24px;
    background: var(--tm-color-muted, #f1f5f9);
}
.ui-dialog.tm-timetable-dialog .ui-dialog-buttonset { float: none; display: flex; justify-content: space-between; gap: 12px; }
.ui-dialog.tm-timetable-dialog .ui-dialog-buttonset button { margin: 0; min-height: 46px; }
@media (max-width: 600px) {
    .ui-dialog.tm-timetable-dialog .ui-dialog-titlebar { padding: 16px 52px 16px 18px; }
    .ui-dialog.tm-timetable-dialog .ui-dialog-title { font-size: 18px; }
    .tm-timetable-copy { padding: 20px; }
    .ui-dialog.tm-timetable-dialog .ui-dialog-buttonpane { padding: 14px 18px; }
}
