/* ============================================
   Time-first booking flow + Review & pay layout
   Spec: pm-workspace/tba-fall-web/specs/booking-flow-time-first.md
   Mock-ups 1A / 2C / 3A-3C / 4A-4D; payment = Theme Lab "Booking: payment".
   Indigo & Cream: every color, font and shape is a role token from tokens.css
   (guardrail: scripts/check-design-tokens.sh).
   Phone first (R16): filter sheets are bottom sheets, dialogs from 768px.
   ============================================ */

.tf-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Banners: title over a short line */
.teacher-banner__content,
.location-banner__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.location-banner__text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ---------- Shared header (back arrow + title + sub line) ---------- */
.tf-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin: calc(-1 * var(--spacing-sm)) 0 var(--spacing-sm) calc(-1 * var(--spacing-sm));
}

.tf-back {
    width: var(--height-button-min);
    height: var(--height-button-min);
    flex: none;
    border: 0;
    background: none;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    cursor: pointer;
}

.tf-back:hover {
    background: var(--color-selected);
}

.tf-title {
    margin: 0;
}

/* The chosen instrument's photo, at the right of "Pick a time" */
.tf-head__photo {
    margin-left: auto;
    width: 56px;
    height: 56px;
    flex: none;
    object-fit: cover;
    border-radius: var(--radius-md);
    background-color: var(--color-border);
}

.tf-sub {
    margin: 2px 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.tf-when {
    margin: 0;
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
}

.tf-link {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    color: var(--color-link);
    text-decoration: underline;
    cursor: pointer;
}

.tf-muted {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.tf-flash {
    margin: 0 0 var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-input);
    background: var(--color-warning-bg);
    border: var(--border-width-thin) solid var(--color-warning-line);
    color: var(--color-warning-fg);
    font-size: var(--font-size-sm);
}

.tf-flash[hidden] {
    display: none;
}

/* ---------- Filter chips ---------- */
.tf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.tf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-chip);
    border: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface);
    font: var(--font-weight-semibold) 0.8125rem var(--font-body);
    color: var(--color-text);
    cursor: pointer;
}

.tf-chip:hover {
    border-color: var(--color-primary);
}

.tf-chip--set {
    border-color: var(--color-primary);
    background: var(--color-selected);
    color: var(--color-heading);
}

.tf-chip--lock {
    background: var(--color-surface-alt);
    border-color: var(--color-secondary);
    color: var(--color-heading);
    cursor: default;
}

/* Length is a native <select> dressed as a chip */
.tf-chip--select select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0 18px 0 0;
    margin-right: -18px;
    cursor: pointer;
}

.tf-chip--select select:focus-visible {
    outline: none;
}

.tf-chip--select:focus-within {
    box-shadow: var(--shadow-focus);
}

.tf-chip--select svg:last-child {
    pointer-events: none;
}

.tf-hint {
    margin: var(--spacing-sm) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ---------- Week strip ---------- */
.tf-week {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-md);
}

.tf-week b {
    color: var(--color-heading);
}

/* Month view, a day in the later month selected: that month's label takes the heading size */
.tf-week b.tf-month--minor {
    font-size: var(--font-size-sm);
}

.tf-week__arrows {
    display: flex;
    gap: var(--spacing-sm);
}

.tf-arrow {
    width: var(--height-button-min);
    height: var(--height-button-small);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-surface);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tf-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.tf-view {
    height: var(--height-button-small);
    padding: 0 12px;
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-surface);
    color: var(--color-primary);
    font: var(--font-weight-semibold) 0.8125rem var(--font-body);
    cursor: pointer;
}

.tf-view[aria-pressed="true"] {
    border-color: var(--color-primary);
    background: var(--color-selected);
}

.tf-days {
    display: flex;
    gap: var(--spacing-xs);
    margin: var(--spacing-sm) calc(-1 * var(--spacing-xs)) 0;
}

.tf-day {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0 7px;
    border: 0;
    border-radius: var(--radius-card);
    background: none;
    font-family: var(--font-body);
    color: var(--color-text);
    cursor: pointer;
}

.tf-day:hover {
    background: var(--color-selected);
}

.tf-day small {
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--label-tracking);
    color: var(--color-text-muted);
}

.tf-day b {
    font-size: 1.0625rem;
}

.tf-day--on,
.tf-day--on:hover {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.tf-day--on small {
    color: var(--color-on-primary);
    opacity: 0.8;
}

/* Sundays, days outside the booking window, and days with no open times (tap shows why) */
.tf-day--off,
.tf-day--off:hover {
    background: none;
    color: var(--color-text-muted);
    opacity: 0.45;
    cursor: default;
}

/* Tapped a greyed-out day: a quick side-to-side shake */
.tf-day--nope {
    animation: tf-nope 0.3s ease;
}

@keyframes tf-nope {
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

/* Why that day can't be picked: right under the days, stays until the next tap */
.tf-day-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs) var(--spacing-sm);
    margin: var(--spacing-sm) 0 0;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-input);
    background: var(--color-text);
    color: var(--color-bg);
    font-size: var(--font-size-sm);
    text-align: center;
}

.tf-day-note[hidden] {
    display: none;
}

.tf-day-note__link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: var(--font-weight-semibold);
    text-decoration: underline;
    cursor: pointer;
}

/* Toast: floats above the bottom of the screen, fades after a few seconds */
.tf-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 8px);
    max-width: min(90vw, 420px);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-input);
    background: var(--color-text);
    color: var(--color-bg);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-sm);
    text-align: center;
    z-index: var(--z-tooltip);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tf-toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
    .tf-toast {
        transition: none;
    }

    .tf-day--nope {
        animation: none;
    }
}

/* Month view: four weeks in a 7-column grid, weekday letters on top */
.tf-days--month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    row-gap: 2px;
}

.tf-days--month .tf-day {
    padding: 6px 0 5px;
}

.tf-dow {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--label-tracking);
    color: var(--color-text-muted);
}

.tf-month-label {
    grid-column: 1 / -1;
    margin: var(--spacing-sm) 0 0 var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
}

.tf-month-label--on {
    font-size: inherit;  /* same as the heading above the strip */
}

.tf-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--dot-color);
}

.tf-day--on .tf-dot {
    background: var(--color-accent);
}

.tf-dot--none {
    background: transparent;
}

.tf-dot--loading {
    background: var(--color-border);
}

/* ---------- Pick a time: light band for the header, filters and week strip,
   times on a white panel below (mock-up 1A) ---------- */
#step-timeslot {
    --tf-pad: var(--spacing-xl);   /* matches .booking-step padding */
    background: var(--color-surface-alt);
    /* clip, not hidden: hidden makes this a scroll box and the sticky
       contact bar would stick to it instead of the screen */
    overflow: clip;
}

/* Contact bar under the white times panel, full width like .tf-list */
#step-timeslot .booking-step__actions {
    margin: 0 calc(-1 * var(--tf-pad)) calc(-1 * var(--tf-pad));
    padding-left: var(--tf-pad);
    padding-right: var(--tf-pad);
}

@media (max-width: 576px) {
    #step-timeslot {
        --tf-pad: var(--spacing-lg);
    }
}

#step-timeslot .tf-chip,
#step-timeslot .tf-arrow,
#step-timeslot .tf-view {
    background: var(--color-surface);
}

.tf-list {
    margin: var(--spacing-sm) calc(-1 * var(--tf-pad)) calc(-1 * var(--tf-pad));
    padding: var(--spacing-xs) var(--tf-pad) var(--tf-pad);
    background: var(--color-surface);
    border-top: var(--border-width-thin) solid var(--color-border);
}

/* ---------- Times ---------- */
.tf-times {
    min-height: 120px;
}

.tf-date {
    margin: var(--spacing-md) 0 2px;
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
}

.tf-group {
    margin: var(--spacing-md) 0 var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.tf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

@media (min-width: 600px) {
    .tf-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.tf-time {
    height: var(--height-button-min);
    border-radius: var(--radius-input);
    border: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface);
    font: var(--font-weight-semibold) 0.9375rem var(--font-body);
    color: var(--color-heading);
    cursor: pointer;
}

.tf-time:hover {
    border-color: var(--color-primary);
    background: var(--color-selected);
}

.tf-empty {
    padding: var(--spacing-md) 0;
}

.tf-empty p {
    margin: 0 0 var(--spacing-md);
    color: var(--color-text-muted);
}

.tf-empty .btn {
    margin: 0 var(--spacing-sm) var(--spacing-sm) 0;
}

.tf-tz {
    margin: var(--spacing-lg) 0 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ---------- "Let us find a time and teacher for you" (tb-gdo.59) ----------
   Lives in this step's sticky contact bar, above Call / Text / Email and under the
   bar's top border, so it only exists on Pick a time. The keyframes run each time the
   step goes from hidden to shown: the bar grows as the banner slides up (a drawer). */
#step-timeslot .booking-step__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}


@media (min-width: 577px) {
    #step-timeslot .booking-contact {
        align-self: flex-end;
    }
}

.tf-request {
    display: grid;
    grid-template-rows: 1fr;
    animation: tf-drawer-up 300ms ease-out both;
}

/* Logged-in users don't get the offer (display: grid above would beat the UA [hidden] rule) */
.tf-request[hidden] {
    display: none;
}

/* Collapses to nothing at the start of the slide (the card's padding lives one level in) */
.tf-request__clip {
    min-height: 0;
    overflow: hidden;
    padding: 2px;               /* room for focus rings inside the clip */
}

/* The card: same look as the original under-the-times box */
.tf-request__card {
    padding: var(--spacing-md);
    border-radius: var(--radius-card);
    background: var(--color-surface-alt);
    border: var(--border-width-thin) solid var(--color-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm) var(--spacing-md);
}

/* Space between the card and Call / Text / Email */
.tf-request__card {
    margin-bottom: var(--spacing-md);
}

.tf-request__label--short {
    display: none;
}

@keyframes tf-drawer-up {
    from {
        grid-template-rows: 0fr;
        opacity: 0;
    }
    to {
        grid-template-rows: 1fr;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tf-request {
        animation: none;
    }
}

.tf-request__line {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

/* Phones and small tablets (the sheets' breakpoint): only the button, full width,
   labelled with the question + arrow, filled with the card cream (no card). Wraps to two centred lines
   if a very narrow screen can't fit it on one. */
@media (max-width: 767.98px) {
    /* No card around it; the button itself takes the desktop card's cream */
    .tf-request__card {
        padding: 0;
        background: none;
        border: 0;
        border-radius: 0;
    }

    .tf-request__card .tf-request__line,
    .tf-request__card .tf-request__label--long {
        display: none;
    }

    /* The arrow rides inside the short label (after a no-break space), so a wrap
       keeps it with "teacher?" */
    .tf-request__card .tf-request__label--short {
        display: inline;
    }

    .tf-request__card .tf-request__arrow {
        display: none;
    }

    #step-timeslot .booking-step__actions .tf-request__card .tf-request__btn {
        width: 100%;
        white-space: normal;
        text-align: center;
        background-color: var(--color-surface-alt);
        font-size: var(--font-size-sm);
        letter-spacing: var(--letter-spacing-tight);
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
}

.tf-req__summary {
    margin: 0 0 var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-xs);
    border-radius: var(--radius-input);
    border: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface-alt);
    min-width: 0;
}

.tf-req__summary-title {
    margin: var(--spacing-xs) 0 var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.tf-req__lesson-type {
    margin: 0 0 var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

/* Two columns from 480px (age + experience, and the picked-so-far fields) */
.tf-req__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: var(--spacing-md);
}

@media (min-width: 480px) {
    .tf-req__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.tf-req__summary .form-group {
    margin-bottom: var(--spacing-md);
}

.tf-req__summary .form-input,
.tf-req__summary .form-select {
    background-color: var(--color-surface);
}

/* Instrument: pick any, as toggle chips (same order as the instrument step) */
.tf-req__instruments {
    margin: 0 0 var(--spacing-md);
    padding: 0;
    border: 0;
    min-width: 0;
}

.tf-req__hint {
    font-weight: var(--font-weight-normal);
}

.tf-req__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.tf-req__chip {
    position: relative;
    cursor: pointer;
}

.tf-req__chip input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.tf-req__chip span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 var(--spacing-md);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.tf-req__chip input:checked + span {
    background: var(--color-selected);
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.tf-req__chip input:focus-visible + span {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Preferred date + one-tap "No preferred date": its own full-width row so the date never squishes */
.tf-req__date-group {
    grid-column: 1 / -1;
}

.tf-req__date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm) var(--spacing-md);
}

.tf-req__date .form-input {
    flex: 0 1 220px;
    min-width: 180px;
}

.tf-req__nodate {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex: 0 0 auto;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    cursor: pointer;
}

.tf-req__nodate input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-primary);
}

/* Spam trap: off-screen, not display:none (some bots skip hidden fields) */
.tf-req__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.tf-req__help {
    margin: 0 0 var(--spacing-sm);
}

.tf-req__contact-error {
    margin: calc(-1 * var(--spacing-md)) 0 var(--spacing-lg);
}

.tf-req__done {
    padding: var(--spacing-lg) 0;
    text-align: center;
    outline: none;
}

.tf-req__done-title {
    margin: 0 0 var(--spacing-sm);
    font-family: var(--font-display);
    font-style: var(--font-display-style);
    font-size: var(--font-size-xl);
    color: var(--color-heading);
}

/* ---------- Teacher screen (2C) ---------- */
.tf-question {
    margin: var(--spacing-md) 0;
}

.tf-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* The whole card is tappable: it picks the teacher (and the place, when
   there is only one); the Where buttons pick a place directly. */
.tf-card {
    padding: 14px;
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.tf-card:hover {
    border-color: var(--color-text-muted);
}

.tf-card--on,
.tf-card--on:hover {
    border: var(--border-width-medium) solid var(--color-primary);
    background: var(--color-selected);
    padding: 13px;
}

.tf-card__hd {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-input);
}

.tf-card__hd:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.tf-card__name b {
    font-size: var(--font-size-base);
    color: var(--color-heading);
}

.tf-card__price {
    margin-left: auto;
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
}

.tf-avatar {
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 50%;
    background: var(--color-surface-alt);
    color: var(--color-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
}

.tf-avatar--photo {
    overflow: hidden;
}

.tf-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}

/* "More about {name}" — sits under the name, outside the select button */
.tf-card__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: -8px 0 0 calc(48px + 12px);  /* tucks under the name: avatar + header gap */
    padding: 2px 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-card__more:hover {
    color: var(--color-primary);
}

.tf-card__more:focus-visible {
    outline: none;
    border-radius: var(--radius-chip);
    box-shadow: var(--shadow-focus);
}

.tf-avatar--any {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.tf-card__lbl {
    margin: 12px 0 6px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
}

/* Teacher picked but not the place yet: ask for it in the card itself */
.tf-card__lbl--prompt {
    font-size: var(--font-size-sm);
    color: var(--color-heading);
}

.tf-card--ask .tf-place {
    border-color: var(--color-primary);
    animation: tf-nudge 0.6s ease 1;
}

@keyframes tf-nudge {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: var(--shadow-focus); }
}

@media (prefers-reduced-motion: reduce) {
    .tf-card--ask .tf-place {
        animation: none;
    }
}

.tf-card__places {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tf-place {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-chip);
    border: var(--border-width-thin) solid var(--color-border);
    background: var(--color-surface);
    font: var(--font-weight-semibold) 0.8125rem var(--font-body);
    color: var(--color-text);
    cursor: pointer;
}

.tf-place:hover {
    border-color: var(--color-primary);
}

.tf-place--on,
.tf-place--on:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}

.tf-badge {
    display: inline-block;
    margin-left: 6px;
    padding: var(--badge-padding-y) var(--badge-padding-x);
    border-radius: var(--badge-border-radius);
    background: var(--color-secondary-soft);
    font-size: var(--badge-font-size);
    font-weight: var(--font-weight-semibold);
    font-style: normal;
    color: var(--color-heading);
    vertical-align: 1px;
}

.tf-place--on .tf-badge {
    background: transparent;
    border: var(--border-width-thin) solid currentColor;
    color: inherit;
}

.tf-continue {
    flex: 1;
    max-width: 420px;
}

/* ---------- Filter sheets (3A / 3B / 3C) ---------- */
body.tf-sheet-open {
    overflow: hidden;
}

.tf-sheet {
    position: fixed;
    inset: 0;
    /* Under .modal, so the coming-soon / eligibility modals can open on top */
    z-index: calc(var(--z-modal) - 1);
}

.tf-sheet__scrim {
    position: absolute;
    inset: 0;
    background: var(--color-scrim);
}

.tf-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: calc(100% - 48px);
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    padding: 10px var(--spacing-md) 0;
    box-shadow: var(--shadow-xl);
    outline: none;
}

.tf-sheet__grab {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--color-secondary);
    margin: 0 auto 10px;
    flex: none;
}

.tf-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex: none;
}

.tf-sheet__title {
    font-family: var(--font-display);
    font-style: var(--font-display-style);
    font-weight: var(--font-display-weight);
    letter-spacing: var(--display-tracking);
    font-size: var(--font-size-xl);
    color: var(--color-heading);
    margin: 0;
}

.tf-sheet__title .tf-crumb {
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--font-body);
    font-style: normal;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    letter-spacing: normal;
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.tf-sheet__title .tf-crumb:hover {
    color: var(--color-primary);
}

.tf-sheet__title .tf-crumb:focus-visible {
    outline: none;
    border-radius: var(--radius-chip);
    box-shadow: var(--shadow-focus);
}

.tf-crumb__sep {
    margin: 0 0.4em;
    font-family: var(--font-body);
    font-style: normal;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
}

.tf-crumb__trail {
    white-space: nowrap;
}

.tf-sheet__sub {
    margin: 4px 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.tf-sheet__x {
    width: var(--height-button-min);
    height: var(--height-button-min);
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--color-surface-alt);
    color: var(--color-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tf-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 2px var(--spacing-md);
}

.tf-sheet__foot {
    flex: none;
    display: flex;
    gap: 10px;
    padding: 12px 0 calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: var(--border-width-thin) solid var(--color-border);
}

.tf-sheet__foot:empty {
    display: none;
}

.tf-sheet__go {
    flex: 1;
}

.tf-sheet__reset {
    width: 110px;
}

@media (min-width: 768px) {
    .tf-sheet__panel {
        left: 50%;
        top: 50%;
        bottom: auto;
        right: auto;
        width: min(560px, calc(100% - 48px));
        max-height: min(85vh, 760px);
        transform: translate(-50%, -50%);
        border-radius: var(--radius-card);
        padding-top: var(--spacing-lg);
    }

    .tf-sheet__grab {
        display: none;
    }
}

/* Teacher profile panel: the website's instructor page in a frame */
.tf-sheet--profile .tf-sheet__panel {
    height: calc(100% - 24px);
    max-height: none;
}

.tf-sheet--profile .tf-sheet__body {
    padding: 12px 0 0;
    overflow: hidden;
}

.tf-profile-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius-input);
    background: var(--color-surface);
}

@media (min-width: 768px) {
    .tf-sheet--profile .tf-sheet__panel {
        width: min(760px, calc(100% - 48px));
        height: min(88vh, 900px);
    }
}

.tf-opts {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Option rows follow the Theme Lab .pt-option */
.tf-opt {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-input);
    background: var(--color-surface);
    font-family: var(--font-body);
    text-align: left;
    color: var(--color-text);
    cursor: pointer;
}

/* Teacher rows: the "More about" link sits under the name, outside the select button */
.tf-opt-row {
    position: relative;
}

.tf-opt--more {
    padding-bottom: 32px;
}

.tf-opt__more {
    position: absolute;
    left: calc(12px + 20px + 12px + 48px + 12px);  /* padding + radio + gap + avatar + gap */
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-opt__more:hover {
    color: var(--color-primary);
}

.tf-opt__more:focus-visible {
    outline: none;
    border-radius: var(--radius-chip);
    box-shadow: var(--shadow-focus);
}

.tf-opt--on {
    border-color: var(--color-primary);
    background: var(--color-selected);
}

.tf-opt b {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-heading);
}

.tf-s {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.tf-opt__price {
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
    white-space: nowrap;
}

.tf-rad {
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 50%;
    border: var(--border-width-medium) solid var(--color-text-muted);
    background: var(--color-surface);
}

.tf-opt--on .tf-rad,
.tf-loc--on .tf-rad {
    border: 6px solid var(--color-primary);
}

/* In person: dropdown chevron in the radio's slot, flips up when the location list is open */
.tf-drop {
    width: 20px;
    height: 20px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: transform 0.15s ease;
}

.tf-drop svg {
    width: 16px;
    height: 16px;
}

.tf-drop--open {
    color: var(--color-primary);
    transform: rotate(180deg);
}

.tf-ic {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: var(--radius-input);
    background: var(--color-surface-alt);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-nest {
    margin: -2px 0 2px 16px;
    padding-left: 14px;
    border-left: var(--border-width-medium) solid var(--color-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tf-loc {
    padding: 2px 6px 6px;
    border-radius: var(--radius-input);
}

.tf-loc--on {
    background: var(--color-selected);
}

.tf-loc__pick {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 4px 0;
    border: 0;
    background: none;
    font-family: var(--font-body);
    text-align: left;
    color: var(--color-text);
    cursor: pointer;
}

.tf-loc__pick .tf-rad {
    width: 18px;
    height: 18px;
}

.tf-loc__pick b {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

.tf-loc__sub {
    display: block;
    margin-left: 28px;
}

.tf-loc--off .tf-loc__pick {
    cursor: default;
}

.tf-loc--off b {
    color: var(--color-text-muted);
}

.tf-maplink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin: 2px 0 4px;
    padding: 6px;
    border: 0;
    background: none;
    font: var(--font-weight-semibold) 0.8125rem var(--font-body);
    color: var(--color-link);
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Map / list of locations (3B) ---------- */
.tf-map__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: var(--spacing-sm);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.tf-seg {
    display: flex;
    padding: 4px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-button);
}

.tf-seg button {
    flex: 1;
    height: 38px;
    border: 0;
    border-radius: var(--radius-button);
    background: none;
    font: var(--font-weight-semibold) var(--font-size-sm) var(--font-body);
    color: var(--color-text-muted);
    cursor: pointer;
}

.tf-seg .tf-seg--on {
    background: var(--color-surface);
    color: var(--color-heading);
    box-shadow: var(--shadow-sm);
}

.tf-zip {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 10px 0;
    padding: 0 6px 0 12px;
    min-height: 46px;
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-input);
    background: var(--color-surface);
    color: var(--color-text-muted);
}

.tf-zip:focus-within {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.tf-zip input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: var(--font-weight-normal) 0.9375rem var(--font-body);
    color: var(--color-text);
}

.tf-map {
    height: 340px;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--color-surface-alt);
}

.tf-map__card {
    margin-top: var(--spacing-sm);
}

.tf-map__card[hidden] {
    display: none;
}

.tf-loclist {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.tf-loccard {
    padding: 14px;
    border: var(--card-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
}

.tf-loccard b {
    color: var(--color-heading);
}

.tf-loccard p {
    margin: 3px 0 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.tf-loccard .btn {
    margin-top: 12px;
}

/* Leaflet pins */
.tf-pin {
    background: none;
    border: 0;
}

.tf-pin i {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.tf-pin--soon i {
    background: var(--color-secondary);
}

.tf-pin span {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    font: var(--font-weight-bold) var(--font-size-xs) var(--font-body);
    color: var(--color-heading);
}

/* ---------- Review & pay (R12-R15, Theme Lab "Booking: payment") ---------- */
.btn--block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

@media (min-width: 720px) {
    .checkout-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    }

    .checkout-grid--single {
        grid-template-columns: minmax(0, 1fr);
        max-width: 460px;
    }
}

.checkout-pay {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: var(--card-padding);
    border: var(--card-border);
    border-radius: var(--card-border-radius);
    background: var(--color-surface);
}

.checkout-pay[hidden] {
    display: none;
}

.checkout-pay__title {
    font-family: var(--font-display);
    font-style: var(--font-display-style);
    font-weight: var(--font-display-weight);
    letter-spacing: var(--display-tracking);
    font-size: var(--font-size-lg);
    color: var(--color-heading);
    margin: 0;
}

.checkout-side {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.checkout-side .authorization-notice,
.checkout-side .contact-summary {
    margin-bottom: 0;
}

/* Lesson summary panel (Theme Lab .pt-panel + .pt-sum) */
.checkout-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: var(--spacing-md) 18px;
    border-radius: var(--card-border-radius);
    background: var(--color-surface-alt);
}

.checkout-summary__title {
    font-family: var(--font-display);
    font-style: var(--font-display-style);
    font-weight: var(--font-display-weight);
    letter-spacing: var(--display-tracking);
    font-size: var(--font-size-md);
    color: var(--color-heading);
    margin: 0;
}

.checkout-summary__rows {
    display: grid;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-variant-numeric: tabular-nums;
}

.checkout-summary__row {
    margin: 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.checkout-summary__row--lead {
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

.checkout-summary__muted {
    color: var(--color-text-muted);
}

.checkout-summary__travel {
    margin: -2px 0 2px;
    padding: 8px 10px;
    border-radius: var(--radius-input);
    background: var(--color-warning-bg);
    border: var(--border-width-thin) solid var(--color-warning-line);
    color: var(--color-warning-fg);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.checkout-summary__travel[hidden] {
    display: none;
}

.checkout-summary__total {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: var(--border-width-thin) solid var(--color-border);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    color: var(--color-heading);
}

.checkout-summary__total-note {
    margin: -4px 0 0;
    text-align: right;
    font-size: 0.8125rem;
    color: var(--color-warning-fg);
}

.checkout-summary__total-note[hidden] {
    display: none;
}

.checkout-summary__note {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Payment options as radio rows (Theme Lab .pt-option) */
.checkout-pay .payment-methods-list {
    gap: 10px;
    margin-bottom: 0;
}

.checkout-pay .payment-method-option {
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-width: 1.5px;
}

.checkout-pay .payment-method-option input[type="radio"] {
    margin-top: 2px;
    flex: none;
}

.payment-method-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-method-text b {
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

.payment-method-sub {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.checkout-pay .payment-method-icon--badge {
    margin-left: auto;
}

.checkout-pay .pep-badge-icon {
    height: 26px;
}
