.real-time-slot.occupied {
    opacity: 1;
    gap: 5px;
    border-color: #dde1e8;
    background: #f1f3f6;
    color: #8a93a3;
    text-decoration: none;
    cursor: not-allowed;
}

.real-time-slot.occupied small {
    color: #a06969;
    font-size:12px;
    font-weight: 700;
}

.teacher-booking-student,
.teacher-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.teacher-action-row {
    flex-wrap: wrap;
    gap: 9px;
}

.teacher-action-row form { margin: 0; }
.teacher-booking-student .teacher-avatar-photo { width: 42px; height: 42px; }

.teacher-reject-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 9px;
    width: 100%;
    margin-top: 14px;
}

.teacher-reject-form input {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.danger-button { border-color: #b74242; background: #b74242; color: #fff; }

@media (max-width: 620px) {
    .teacher-reject-form { grid-template-columns: 1fr; }
}

/* Give the booking form the full reading width; the summary follows the choices. */
.booking-workspace { grid-template-columns: minmax(0, 1fr); }
.booking-summary { position: static; width: 100%; }

.booking-status.cancellation_requested { background: #fff0dc; color: #a75b16; }
.teacher-time-spotlight { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; padding: 12px 14px; border-radius: 10px; background: #eef3ff; color: #17305b; }
.teacher-time-spotlight i { color: var(--blue); font-size: 24px; }
.teacher-time-spotlight strong { font-size: 19px; letter-spacing: .3px; }
.teacher-time-spotlight span { color: #697890; font-size:12px; font-weight: 700; }
.cancel-request-alert { padding: 8px 10px; border-radius: 7px; background: #fff0dc; color: #a75b16; font-size:12px; font-weight: 800; }
.cancellation-approval-box { margin-top: 20px; padding: 18px; border: 1px solid #f0c88e; border-radius: 11px; background: #fff8ec; }
.cancellation-approval-box h3 { margin: 0; color: #8d4e14; font-size: 15px; }
.cancellation-approval-box h3 i { margin-right: 7px; }
.cancellation-approval-box p { color: #776a5a; font-size:12px; line-height: 1.6; }

.teacher-week-calendar { margin-bottom: 20px; overflow: hidden; }
.week-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.week-calendar-head h2 { margin: 4px 0 0; color: var(--navy); font-size: 18px; }
.week-calendar-head > div:last-child { display: flex; align-items: center; gap: 5px; }
.week-calendar-head a { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--blue); font-size:12px; font-weight: 800; text-decoration: none; }
.week-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(125px, 1fr)); gap: 8px; overflow-x: auto; }
.week-day { min-height: 150px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.week-day.today { border-color: #8eb0ff; box-shadow: inset 0 0 0 1px #8eb0ff; }
.week-day header { display: grid; grid-template-columns: 1fr auto; gap: 3px; padding: 10px; border-bottom: 1px solid var(--line); }
.week-day header small { color: var(--muted); font-size:11px; }
.week-day header strong { font-size:13px; }
.week-day header em { grid-column: 2; grid-row: 1 / 3; align-self: center; padding: 3px 6px; border-radius: 10px; background: #e8efff; color: var(--blue); font-size:11px; font-style: normal; }
.week-day > div { display: grid; gap: 6px; padding: 7px; }
.calendar-empty { padding: 20px; color: #bbc2cd; text-align: center; }
.calendar-booking { display: grid; gap: 2px; padding: 8px; border-left: 3px solid var(--blue); border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 3px 8px rgba(31,52,86,.06); }
.calendar-booking.cancellation_requested { border-left-color: #e49a3f; background: #fff8ec; }
.calendar-booking b { color: var(--blue); font-size:14px; }
.calendar-booking span { overflow: hidden; font-size:12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.calendar-booking small { color: var(--muted); font-size:11px; }

@media (max-width: 780px) {
    .booking-workspace-v2,.booking-workspace-v2 .booking-form-column,.booking-workspace-v2 .student-panel { width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; }
    .booking-foundation-grid { display: block; width: 100%; }
    .teacher-time-spotlight { align-items: flex-start; flex-direction: column; gap: 4px; }
    .week-calendar-grid { grid-template-columns: repeat(7, 135px); }
    .week-calendar-head { align-items: flex-start; flex-direction: column; }
}

/* Student booking v2: progressive, compact, and mobile-friendly. */
.booking-page-head { margin-bottom: 16px; }
.booking-stepper-compact { justify-content: space-between; padding: 13px 18px; }
.booking-stepper-compact > div { flex: 0 0 auto; }
.booking-stepper-compact > i { flex: 1; width: auto; max-width: 120px; }
.booking-workspace-v2 .booking-form-column { gap: 14px; }
.booking-workspace-v2,.booking-workspace-v2 .booking-form-column,.booking-foundation-grid > * { min-width: 0; }
.booking-workspace-v2 .booking-section { padding: 23px; }
.booking-workspace-v2 .booking-section-title { margin-bottom: 16px; }
.booking-foundation-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(380px, 1.25fr); gap: 15px; }
.compact-course-choice { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 15px; border: 1px solid #dce6fa; border-radius: 11px; background: #f5f8ff; }
.compact-course-choice .feature-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 10px; background: #e4edff; color: var(--blue); font-size: 22px; }
.compact-course-choice > div:not(.compact-course-links) { min-width: 0; flex: 1; }
.compact-course-choice small,.compact-course-choice strong,.compact-course-choice em { display: block; }
.compact-course-choice small { color: var(--muted); font-size:11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.compact-course-choice strong { overflow: hidden; margin: 4px 0 3px; color: var(--navy); font-size:14px; text-overflow: ellipsis; white-space: nowrap; }
.compact-course-choice em { color: #6d798b; font-size:12px; font-style: normal; }
.compact-course-links { display: grid; gap: 4px; }
.compact-course-links a { padding: 5px 7px; border-radius: 6px; color: var(--muted); font-size:11px; font-weight: 800; text-decoration: none; }
.compact-course-links a.active { background: #fff; color: var(--blue); box-shadow: 0 2px 7px rgba(38,72,130,.1); }
.compact-duration-grid { gap: 9px; }
.compact-duration-grid { width: 100%; min-width: 0; }
.compact-duration-grid .duration-choice { min-width: 0; padding: 13px; gap: 10px; }
.compact-duration-grid .duration-choice > span strong { font-size: 24px; }
.compact-duration-grid .duration-choice > div { min-width: 0; }
.compact-duration-grid .duration-choice > div b { font-size:12px; }
.compact-duration-grid .duration-choice > div em { white-space: normal; line-height: 1.35; }

.selected-teacher-card { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid #b9ceff; border-radius: 11px; background: linear-gradient(100deg,#f5f8ff,#fff); box-shadow: inset 3px 0 0 var(--blue); }
.selected-teacher-card .teacher-avatar-photo { width: 52px; height: 52px; object-fit: cover; }
.selected-teacher-card > div { flex: 1; min-width: 0; }
.selected-teacher-card small { color: var(--blue); font-size:11px; font-weight: 900; }
.selected-teacher-card h3 { margin: 3px 0; color: var(--navy); font-size: 16px; }
.selected-teacher-card p { overflow: hidden; margin: 0; color: var(--muted); font-size:12px; text-overflow: ellipsis; white-space: nowrap; }
.button-sm { width: auto; min-height: 38px; padding: 8px 12px; font-size:12px; }
.teacher-picker { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.teacher-picker > summary { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; color: #526178; cursor: pointer; list-style: none; font-size:12px; font-weight: 800; }
.teacher-picker > summary::-webkit-details-marker { display: none; }
.teacher-picker > summary span { display: flex; align-items: center; gap: 7px; color: var(--navy); }
.teacher-picker > summary span i { color: var(--blue); font-size: 17px; }
.teacher-picker > summary b { margin-left: auto; color: var(--muted); font-size:12px; }
.teacher-picker > summary > i { font-size: 18px; transition: transform .18s; }
.teacher-picker[open] > summary > i { transform: rotate(180deg); }
.teacher-picker-body { padding: 13px; border-top: 1px solid var(--line); background: #f8fafc; }
.teacher-search { display: flex; align-items: center; gap: 8px; max-width: 420px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #8b96a8; }
.teacher-search input { width: 100%; border: 0; outline: 0; color: var(--ink); font: inherit; font-size:12px; }
.teacher-option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; max-height: 320px; margin-top: 10px; overflow: auto; }
.teacher-option { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.teacher-option[hidden] { display: none; }
.teacher-option.selected { border-color: #a9c1fa; background: #f5f8ff; }
.teacher-option .teacher-avatar-photo { min-width: 38px; width: 38px; height: 38px; object-fit: cover; font-size:13px; }
.teacher-option > div { flex: 1; min-width: 0; }
.teacher-option strong,.teacher-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-option strong { color: var(--navy); font-size:12px; }
.teacher-option small { margin-top: 3px; color: var(--muted); font-size:11px; }
.teacher-option a { min-width: 52px; padding: 7px 8px; border-radius: 7px; background: #edf3ff; color: var(--blue); font-size:11px; font-weight: 900; text-align: center; text-decoration: none; }

.compact-date-strip { padding-bottom: 5px; }
.compact-date-strip a { flex: 1 0 54px; min-height: 57px; }
.later-dates { margin-top: 8px; }
.later-dates > summary { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--blue); cursor: pointer; list-style: none; font-size:12px; font-weight: 800; }
.later-dates > summary::-webkit-details-marker { display: none; }
.later-date-grid { margin-bottom: 10px; padding: 10px; border-radius: 9px; background: #f7f9fc; }
.time-choice-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 14px; padding: 11px 13px; border-radius: 9px; background: #f1edff; }
.time-choice-head span { color: var(--navy); font-size:12px; font-weight: 900; }
.time-choice-head b { color: #6a52bf; font-size:12px; }
.datetime-section-v2 .time-group { margin-top: 12px; }
.datetime-section-v2 .real-time-slot { min-width: 77px; min-height: 42px; }
.datetime-section-v2 .real-time-slot.linked-selected { border-color: #8fb0fa; background: #edf3ff; color: var(--blue); box-shadow: inset 0 0 0 1px #c7d7fc; }
.datetime-section-v2 .real-time-slot.linked-selected:before { content: "✓"; position: absolute; right: 5px; top: 3px; color: var(--blue); font-size:12px; font-weight: 900; }
.linked-slot-label { position: absolute; left: 50%; bottom: 2px; color: #6683bd; font-size:11px!important; font-weight: 800; line-height: 1; text-decoration: none; transform: translateX(-50%); white-space: nowrap; }

.booking-summary-v2 { padding: 23px; }
.booking-review-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.booking-review-grid > div { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.booking-review-grid small,.booking-review-grid strong { display: block; }
.booking-review-grid small { color: var(--muted); font-size:11px; }
.booking-review-grid strong { overflow: hidden; margin-top: 5px; color: var(--navy); font-size:13px; text-overflow: ellipsis; white-space: nowrap; }
.booking-review-grid #bookingSummaryTime { color: var(--blue); font-size:14px; }
.booking-review-bottom { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; align-items: start; margin-top: 12px; }
.booking-review-bottom .booking-note-label { margin: 0; }
.booking-review-bottom textarea { min-height: 112px; background: #fff; }
.booking-submit-panel .credit-cost { margin-top: 0; }
.booking-submit-panel .button { min-height: 46px; }

@media (max-width: 1050px) {
    .booking-foundation-grid { grid-template-columns: 1fr; }
    .booking-review-bottom { grid-template-columns: minmax(0,1fr) 300px; }
}

@media (max-width: 780px) {
    .booking-page-head { gap: 10px; }
    .booking-credit-chip { width: 100%; box-sizing: border-box; }
    .booking-stepper-compact { justify-content: space-between; gap: 3px; padding: 11px 8px; overflow: visible; }
    .booking-stepper-compact > div { flex-direction: column; gap: 4px; min-width: 47px; text-align: center; font-size:11px; }
    .booking-stepper-compact > div span { display: block; line-height: 1.2; }
    .booking-stepper-compact > div b { width: 23px; height: 23px; }
    .booking-stepper-compact > i { min-width: 7px; margin: -14px 0 0; }
    .booking-workspace-v2 .booking-section,.booking-summary-v2 { padding: 17px 14px; }
    .booking-workspace-v2 .booking-section-title { gap: 10px; margin-bottom: 14px; }
    .booking-workspace-v2 .booking-section-title h2 { font-size: 16px; }
    .compact-course-choice { align-items: flex-start; padding: 13px; }
    .compact-course-choice .feature-icon { flex-basis: 38px; height: 38px; }
    .compact-course-links { width: 100%; }
    .compact-duration-grid { display: grid; grid-template-columns: 1fr; margin-top: 10px; }
    .compact-duration-grid .duration-choice { align-items: flex-start; flex-direction: column; gap: 5px; min-height: 98px; }
    .compact-duration-grid .duration-choice { width: auto; overflow: hidden; box-sizing: border-box; }
    .selected-teacher-card { align-items: center; flex-wrap: wrap; padding: 13px; }
    .selected-teacher-card > div { width: calc(100% - 67px); }
    .selected-teacher-card .button { width: 100%; }
    .teacher-picker > summary { padding: 0 11px; }
    .teacher-picker > summary b { display: none; }
    .teacher-option-grid { grid-template-columns: 1fr; max-height: 285px; }
    .compact-date-strip a { flex: 0 0 59px; min-height: 60px; }
    .time-choice-head { align-items: flex-start; flex-direction: column; gap: 3px; }
    .datetime-section-v2 .time-group { grid-template-columns: 1fr; }
    .datetime-section-v2 .time-group > div { display: grid; grid-template-columns: repeat(4,1fr); }
    .datetime-section-v2 .real-time-slot { min-width: 0; min-height: 44px; padding: 8px 5px!important; }
    .booking-review-grid { grid-template-columns: 1fr 1fr; }
    .booking-review-bottom { grid-template-columns: 1fr; }
    .booking-submit-panel .button { width: 100%; }
}

@media (max-width: 380px) {
    .booking-stepper-compact > div { min-width: 43px; }
    .datetime-section-v2 .time-group > div { grid-template-columns: repeat(3,1fr); }
}

/* Dual-path booking: choose a tutor first or find tutors by an exact time. */
.booking-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.booking-mode-switch a { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 15px; border: 1px solid transparent; border-radius: 9px; color: #647187; text-decoration: none; transition: .18s ease; }
.booking-mode-switch a:hover { background: #f7f9fd; }
.booking-mode-switch a.active { border-color: #a9c1fb; background: #edf3ff; color: var(--blue); box-shadow: 0 5px 14px rgba(56,116,255,.08); }
.booking-mode-switch a > i { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 9px; background: #f0f3f8; font-size: 20px; }
.booking-mode-switch a.active > i { background: #fff; }
.booking-mode-switch strong,.booking-mode-switch small { display: block; }
.booking-mode-switch strong { color: var(--navy); font-size:13px; }
.booking-mode-switch small { margin-top: 3px; font-size:11px; line-height: 1.4; }

.teacher-filter-bar { display: grid; grid-template-columns: minmax(230px,1.4fr) repeat(3,minmax(125px,.65fr)); gap: 8px; }
.teacher-filter-bar > label:not(.teacher-search) { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.teacher-filter-bar > label > span { color: var(--muted); font-size:11px; font-weight: 800; white-space: nowrap; }
.teacher-filter-bar select { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size:12px; }
.teacher-hover-help { margin: 9px 0 0; color: var(--muted); font-size:11px; }
.teacher-hover-help i { margin-right: 4px; color: var(--blue); }
.teacher-option-grid { max-height: none; overflow: visible; }
.teacher-option { position: relative; z-index: 1; }
.teacher-option:hover,.teacher-option:focus-within,.teacher-option.quick-open { z-index: 15; border-color: #9ab8fb; box-shadow: 0 7px 18px rgba(31,55,98,.1); }
.teacher-option-copy { flex: 1; min-width: 0; }
.teacher-option-copy em { display: block; margin-top: 3px; color: #8994a6; font-size:11px; font-style: normal; }
.teacher-quick-view { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--blue); cursor: pointer; font-size: 15px; }
.teacher-select-action { min-width: 56px!important; }
.teacher-hover-card { position: absolute; left: 0; top: calc(100% + 7px); display: none; width: 320px; padding: 16px; border: 1px solid #cad7ef; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 20px 45px rgba(22,44,83,.2); text-align: left; }
.teacher-option:nth-child(even) .teacher-hover-card { right: 0; left: auto; }
.teacher-option:hover .teacher-hover-card,.teacher-option:focus-within .teacher-hover-card,.teacher-option.quick-open .teacher-hover-card { display: block; }
.teacher-hover-card header { display: flex; align-items: center; gap: 10px; }
.teacher-hover-card header img,.teacher-hover-card header > span { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; object-fit: cover; font-weight: 900; }
.teacher-hover-card header div { flex: 1; min-width: 0; }
.teacher-hover-card header strong,.teacher-hover-card header small { display: block; }
.teacher-hover-card header strong { color: var(--navy); font-size:14px; }
.teacher-hover-card header small { margin-top: 3px; color: var(--muted); font-size:11px; }
.teacher-hover-card header b { padding: 5px 7px; border-radius: 7px; background: #edf3ff; color: var(--blue); font-size:11px; white-space: nowrap; }
.teacher-hover-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 13px 0 9px; }
.teacher-hover-card dl div { min-width: 0; padding: 8px; border-radius: 7px; background: #f6f8fb; }
.teacher-hover-card dt { color: var(--muted); font-size:11px; }
.teacher-hover-card dd { overflow: hidden; margin: 3px 0 0; color: var(--navy); font-size:11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.teacher-hover-specialties { display: flex; flex-wrap: wrap; gap: 4px; }
.teacher-hover-specialties span { padding: 4px 6px; border-radius: 10px; background: #ecf8f4; color: #157b5b; font-size:11px; font-weight: 800; }
.teacher-hover-card p { margin: 10px 0 0; color: #657287; font-size:12px; line-height: 1.65; }
.teacher-filter-empty { margin-top: 10px; padding: 20px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size:12px; text-align: center; }
.booking-guidance { display: grid; justify-items: center; gap: 6px; padding: 28px; border: 1px dashed #c9d5e9; border-radius: 10px; background: #f8fafc; color: var(--muted); text-align: center; }
.booking-guidance i { color: #87a7ec; font-size: 30px; }
.booking-guidance strong { color: var(--navy); font-size:13px; }
.booking-guidance span { font-size:12px; }

.market-date-strip a em { top: 3px; right: 3px; }
.market-time-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.market-time-grid a { position: relative; display: grid; justify-items: center; gap: 3px; min-height: 63px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); text-decoration: none; transition: .16s; }
.market-time-grid a:hover { border-color: #9fb9f4; transform: translateY(-1px); }
.market-time-grid a.selected { border-color: var(--blue); background: #edf3ff; color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.market-time-grid strong { font-size:13px; }
.market-time-grid small { color: #178161; font-size:11px; font-weight: 900; }
.market-time-grid em { color: var(--muted); font-size:11px; font-style: normal; }
.market-selected-time-input { position: absolute; opacity: 0; pointer-events: none; }

.daily-booking-notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; padding: 12px 14px; border: 1px solid #cfe7dd; border-radius: 10px; background: #f1faf7; color: #236b58; }
.daily-booking-notice > i { flex: 0 0 auto; margin-top: 1px; font-size: 20px; }
.daily-booking-notice strong,.daily-booking-notice span { display: block; }
.daily-booking-notice strong { color: #155c49; font-size: 13px; }
.daily-booking-notice span { margin-top: 3px; font-size: 12px; line-height: 1.55; }
.daily-booking-notice.is-limited { border-color: #f1d39a; background: #fff8e9; color: #8b6215; }
.daily-booking-notice.is-limited strong { color: #76500c; }
.daily-booking-notice.is-full { border-color: #f1c6c1; background: #fff3f1; color: #a1493f; }
.daily-booking-notice.is-full strong { color: #8d382f; }
.compact-date-strip a { min-height: 70px; align-content: center; }
.real-date-strip a .date-credit-state { display: block; color: #178161; font-size: 11px; font-weight: 900; line-height: 1; }
.real-date-strip a.daily-full { border-color: #edcfca; background: #fff9f8; }
.real-date-strip a.daily-full .date-credit-state { color: #b44d43; }
.real-date-strip a.selected .date-credit-state { color: #fff; }
.real-date-strip a.selected.daily-full { border-color: #e2a69f; background: #fff0ed; color: #8d382f; box-shadow: inset 0 0 0 1px #e9b9b3; }
.real-date-strip a.selected.daily-full small { color: #a45b52; }
.real-date-strip a.selected.daily-full.has-slots em { background: #f3cbc6; color: #8d382f; }
.real-date-strip a.selected.daily-full .date-credit-state { color: #a13f35; }
.real-date-strip a.daily-full.has-slots:after,.real-date-strip a.daily-open.has-slots:after { display: none; }
.daily-limit-empty { border-color: #edcfca; background: #fff8f7; }

.availability-calendar-head { align-items: flex-end; }
.calendar-legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 800; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 9px; height: 9px; border-radius: 50%; background: #61b89d; }
.calendar-legend .booked i { background: #ec765f; }
.teacher-calendar-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9fc; }
.calendar-paging { display: flex; align-items: center; gap: 10px; }
.calendar-paging strong { color: var(--navy); font-size: 13px; }
.calendar-nav { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #6550b4; font-size: 20px; text-decoration: none; }
.calendar-nav.disabled { opacity: .35; }
.calendar-jump-form { display: flex; align-items: flex-end; gap: 8px; }
.calendar-jump-form label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
.calendar-jump-form input { height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
.teacher-date-strip a { min-height: 75px; align-content: center; }
.teacher-date-strip a em { margin-top: 2px; color: #168063; font-size: 11px; font-style: normal; font-weight: 900; }
.teacher-date-strip a.has-bookings { border-color: #edb9b0; background: #fff5f2; }
.teacher-date-strip a.has-bookings em { color: #bb4e3f; }
.teacher-date-strip a.active,.teacher-date-strip a.active em { color: #fff; }
.teacher-date-strip a.active.has-bookings { border-color: #d85e49; background: #d85e49; box-shadow: 0 8px 18px rgba(216,94,73,.22); }
.time-range-selector { display: grid; grid-template-columns: minmax(210px,1fr) 145px 145px auto; align-items: end; gap: 10px; margin-top: 14px; padding: 13px 15px; border: 1px solid #ded7f4; border-radius: 10px; background: #faf8ff; }
.time-range-selector > div strong,.time-range-selector > div span { display: block; }
.time-range-selector > div strong { color: var(--navy); font-size: 13px; }
.time-range-selector > div span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.time-range-selector label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
.time-range-selector select { height: 35px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
.selected-slot-summary { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 9px 12px; border-radius: 8px; background: #f1edff; color: #654bbf; font-size: 12px; font-weight: 800; }
.teacher-slot-cell.booked > span { border-color: #efb8ae; background: #fff0ed; color: #a84435; cursor: not-allowed; box-shadow: inset 0 0 0 1px rgba(216,94,73,.06); }
.teacher-slot-cell.booked em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-slot-cell.booked input:disabled + span { opacity: 1; }

@media (max-width: 1050px) {
    .teacher-filter-bar { grid-template-columns: 1fr 1fr; }
    .teacher-filter-bar .teacher-search { max-width: none; }
    .market-time-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .teacher-calendar-controls { align-items: flex-start; flex-direction: column; }
    .time-range-selector { grid-template-columns: 1fr 1fr; }
    .time-range-selector > div { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
    .booking-mode-switch { grid-template-columns: 1fr; }
    .booking-mode-switch a { min-height: 54px; }
    .teacher-filter-bar { grid-template-columns: 1fr 1fr; }
    .teacher-filter-bar .teacher-search { grid-column: 1 / -1; }
    .teacher-hover-help { display: none; }
    .teacher-option { flex-wrap: wrap; }
    .teacher-option:hover .teacher-hover-card,.teacher-option:focus-within .teacher-hover-card { display: none; }
    .teacher-option.quick-open .teacher-hover-card { position: static; display: block; order: 10; width: 100%; box-sizing: border-box; margin-top: 5px; }
    .teacher-option.quick-open { box-shadow: none; }
    .market-time-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .availability-calendar-head { align-items: flex-start; flex-direction: column; }
    .teacher-calendar-controls,.calendar-jump-form { width: 100%; box-sizing: border-box; }
    .calendar-jump-form { align-items: stretch; }
    .calendar-jump-form label { flex: 1; }
}

@media (max-width: 430px) {
    .teacher-filter-bar { grid-template-columns: 1fr; }
    .teacher-filter-bar .teacher-search { grid-column: auto; }
    .market-time-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .calendar-paging { width: 100%; justify-content: space-between; }
    .calendar-jump-form { flex-direction: column; }
    .time-range-selector { grid-template-columns: 1fr; }
    .time-range-selector > div { grid-column: auto; }
}

/* Keep the one-column booking form inside the desktop content area. */
.booking-workspace.booking-workspace-v2 { grid-template-columns: minmax(0, 1fr); }
.booking-workspace-v2 .booking-section,
.booking-workspace-v2 .teacher-picker,
.booking-workspace-v2 .teacher-picker-body { min-width: 0; }
.booking-workspace-v2 .teacher-filter-bar { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); }
.booking-workspace-v2 .teacher-search input { min-width: 0; }
.booking-workspace-v2 .booking-foundation-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.booking-workspace-v2 .real-date-strip { max-width: 100%; overflow-x: auto; }
.booking-workspace-v2 .booking-review-grid strong { overflow-wrap: anywhere; }
.teacher-search:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Explain booking availability without hiding the teacher and time browser. */
.booking-credit-chip.has-no-credits { background: #fff7e6; color: #875e14; border-color: #efd8a9; }
.booking-page-head .booking-credit-chip { flex-wrap: wrap; max-width: 100%; }
.booking-page-head .booking-credit-chip strong { overflow-wrap: anywhere; }
.booking-availability-notice { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; padding: 22px; background: #fff9ed; border: 1px solid #f0dbb3; border-radius: 18px; color: #654719; }
.booking-availability-notice > i { font-size: 26px; line-height: 1.3; flex: 0 0 auto; }
.booking-availability-notice > div:first-of-type { flex: 1; min-width: 0; }
.booking-availability-notice h2 { font-size: 17px; line-height: 1.5; margin: 0 0 5px; color: #654719; }
.booking-availability-notice p { margin: 0 0 7px; line-height: 1.7; }
.booking-availability-notice small { display: block; color: #857257; line-height: 1.6; }
.booking-availability-actions { display: flex; flex-wrap: wrap; gap: 9px; flex-shrink: 0; }
.booking-plan-choice { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 17px; border: 1px solid #e2e8f2; border-radius: 14px; background: #f8faff; }
.booking-plan-choice label { font-size: 13px; font-weight: 700; color: #5c6d89; }
.booking-plan-choice select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; padding: 11px 34px 11px 12px; border: 1px solid #d9e1ef; border-radius: 9px; background: #fff; color: #192c50; font: inherit; font-size: 14px; text-overflow: ellipsis; }
.booking-plan-choice select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.booking-plan-choice strong { font-size: 15px; }
.booking-plan-choice small { font-size: 12px; color: #6b7890; }
.duration-choice .duration-block-reason { display: block; margin-top: 5px; color: #986b26; line-height: 1.5; font-size: 12px; }
.duration-choice.unavailable { cursor: not-allowed; }
.real-date-strip a.outside-validity { background: #f1f3f7; border-color: #e0e5ed; color: #8290a6; }
.real-date-strip a.outside-validity .date-credit-state { color: #8290a6; }
.real-date-strip a.outside-validity.selected { border-color: #a3afc1; box-shadow: inset 0 0 0 1px #a3afc1; }
.daily-booking-notice.is-preview { background: #f3f6fb; border-color: #e1e7f0; color: #697a95; }
.booking-submit-reason { margin: 13px 0 10px; padding: 11px 12px; background: #fff7e8; border-radius: 9px; color: #845d22; font-size: 13px; line-height: 1.65; }
.booking-submit-reason.is-ready { background: #edf9f3; color: #278363; }
.booking-submit-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.booking-submit-actions [hidden], .booking-resume-notice[hidden] { display: none !important; }
.booking-resume-notice { padding: 13px 17px; margin-bottom: 17px; background: #eef4ff; border-radius: 12px; color: #3b61a2; line-height: 1.6; }
@media (max-width: 1100px) {
    .booking-availability-notice { flex-wrap: wrap; }
    .booking-availability-actions { width: 100%; padding-left: 42px; }
}
@media (max-width: 600px) {
    .booking-availability-notice { padding: 17px; gap: 11px; }
    .booking-availability-actions { padding-left: 0; flex-direction: column; }
    .booking-availability-actions .button { width: 100%; box-sizing: border-box; }
    .booking-plan-choice select { font-size: 13px; }
}

/* Keep plan names, balances and validity readable instead of packing them into a native select. */
.booking-foundation-refined .booking-plan-choice { background: #fff; gap: 13px; padding: 18px; }
.booking-plan-heading { display: flex; gap: 11px; align-items: center; min-width: 0; }
.booking-plan-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; background: #edf3ff; color: var(--blue); font-size: 21px; }
.booking-plan-heading > div { flex: 1; min-width: 0; }
.booking-plan-heading > div > small { display: block; font-size: 11px; margin-bottom: 4px; color: #7b879d; }
.booking-plan-heading > div > strong { display: block; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.booking-plan-balance { display: inline-flex; align-items: center; flex-shrink: 0; padding: 5px 8px; border-radius: 7px; background: #edf8f3; color: #258465; font-size: 12px; font-weight: 700; }
.booking-plan-choice .booking-plan-select-label { margin-bottom: -6px; font-size: 11px; color: #7b879d; }
.booking-plan-select-wrap { position: relative; min-width: 0; }
.booking-plan-choice .booking-plan-select-wrap select { display: block; -webkit-appearance: none; appearance: none; height: 44px; min-height: 44px; margin: 0; line-height: normal; padding: 0 38px 0 12px; font-size: 14px; background: #f8faff; background-image: none; border-radius: 10px; }
.booking-plan-select-wrap > i { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); pointer-events: none; color: #7586a2; font-size: 21px; }
.booking-plan-meta { display: flex; flex-direction: column; gap: 7px; padding-top: 11px; border-top: 1px solid #edf0f6; }
.booking-plan-meta > span { font-size: 13px; color: #566781; }
.booking-plan-meta > small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #7c889c; }
.booking-plan-empty { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 18px; border: 1px solid #e5eaf3; border-radius: 14px; background: #f8faff; }
.booking-plan-empty > div { flex: 1; min-width: 150px; }
.booking-plan-empty strong { font-size: 15px; color: #586b86; }
.booking-plan-empty p { margin: 7px 0 0; color: #7c889c; font-size: 12px; line-height: 1.7; }
.booking-plan-empty .booking-plan-icon { color: #7c8ba2; background: #eaf0f8; }
.booking-plan-empty-link { display: inline-flex; align-items: center; gap: 5px; margin-left: 50px; color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.booking-previous-teacher { display: inline-block; width: fit-content; max-width: 100%; margin: 0 0 0 8px; padding: 3px 7px; background: #eaf7f1; color: #258465; border-radius: 6px; font-size: 11px; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
.teacher-option-copy .booking-previous-teacher { margin: 5px 0 0; }
@media (max-width: 600px) {
    .booking-plan-heading { flex-wrap: wrap; }
    .booking-plan-heading > div { min-width: 120px; }
    .booking-plan-balance { margin-left: 49px; }
    .booking-plan-choice .booking-plan-select-wrap select { font-size: 13px; }
    .selected-teacher-card .booking-previous-teacher { display: block; margin: 5px 0 0; }
}
