:root {
    --tf-enroll-bg: #f4f8fd;
    --tf-enroll-surface: #ffffff;
    --tf-enroll-text: #0b2545;
    --tf-enroll-muted: #5b7290;
    --tf-enroll-primary: #1e63c7;
    --tf-enroll-primary-soft: #e8f1ff;
    --tf-enroll-primary-hover: #164ea3;
    --tf-enroll-primary-hover-soft: #dbe8fd;
    --tf-enroll-border: #d6e4f7;
    --tf-enroll-warning: #b54708;
    --tf-enroll-danger: #b42318;
    --tf-enroll-shadow: 0 14px 32px rgba(11, 37, 69, 0.10);
    --tf-enroll-radius: 18px;

    /* Wysokość przyklejonego nagłówka motywu (sticky/fixed). Formularz sam go
       wykrywa; tę zmienną ustaw, gdy motyw chowa/pokazuje nagłówek w locie
       albo wykrycie nie działa: --tf-enroll-sticky-offset: 72px; */
    --tf-enroll-sticky-offset: 0px;
}

.tf-enroll {
    background:
        radial-gradient(circle at 16% 6%, rgba(30, 99, 199, 0.12) 0, rgba(30, 99, 199, 0.02) 36%, transparent 62%),
        linear-gradient(180deg, #fbfdff 0%, var(--tf-enroll-bg) 70%);
    border: 1px solid var(--tf-enroll-border);
    border-radius: var(--tf-enroll-radius);
    color: var(--tf-enroll-text);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    margin: 0 auto;
    max-width: 980px;
    padding: 18px;
}

.tf-enroll,
.tf-enroll * {
    box-sizing: border-box;
}

/* Isolate controls from aggressive theme-level button typography/colors. */
.tf-enroll button,
.tf-enroll [type="button"],
.tf-enroll [type="submit"] {
    font-family: inherit;
    letter-spacing: normal;
    line-height: 1.2;
    text-transform: none;
}

/* Belka postępu (zamiast steppera z klikalnymi kartami): tytuł + licznik,
   cienki pasek 3 segmentów i nazwa bieżącego kroku. NIE jest nawigacją. */
.tf-enroll-progress {
    margin: 0 0 14px;
    padding: 2px 2px 0;
}

.tf-enroll-progress__top {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.tf-enroll-progress__title {
    color: var(--tf-enroll-text);
    font-size: 20px;
    line-height: 1.2;
    margin: 0;
}

.tf-enroll-progress__counter {
    color: var(--tf-enroll-muted);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tf-enroll-progress__track {
    display: flex;
    gap: 4px;
    margin: 9px 0 0;
}

.tf-enroll-progress__seg {
    background: #e3ecf9;
    border-radius: 999px;
    flex: 1 1 0;
    height: 4px;
    transition: background-color 0.2s ease;
}

.tf-enroll-progress__seg.is-filled {
    background: var(--tf-enroll-primary);
}

.tf-enroll-progress__step {
    color: var(--tf-enroll-primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    margin: 9px 0 0;
}

.tf-enroll__content {
    display: grid;
    gap: 12px;
}

.tf-enroll-card {
    background: var(--tf-enroll-surface);
    border: 1px solid var(--tf-enroll-border);
    border-radius: 14px;
    box-shadow: var(--tf-enroll-shadow);
    padding: 16px;
}

/* <form> to wyłącznie wrapper dla natywnego autofillu — nie zmienia layoutu. */
.tf-enroll-form {
    display: block;
    margin: 0;
    padding: 0;
}

.tf-enroll-card--loading {
    min-height: 80px;
}

.tf-enroll-card--success {
    text-align: center;
    padding: 32px 16px;
    background: var(--tf-enroll-surface);
    border: 2px solid var(--tf-enroll-success, #22c55e);
    border-radius: 14px;
}

.tf-enroll-card--success h3 {
    color: var(--tf-enroll-success, #22c55e);
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.tf-enroll-card--success p {
    margin: 0 0 8px;
    color: var(--tf-enroll-text-secondary, #666);
}

.tf-enroll-success-id {
    font-size: 0.85rem;
    opacity: 0.6;
}

.tf-enroll-section-title {
    font-size: 18px;
    margin: 0 0 7px;
}

.tf-enroll-row {
    margin-bottom: 12px;
}

.tf-enroll-row__head {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

/* „Anuluj” — wyjście z edytora etapu bez zmiany wartości. */
.tf-enroll-cancel {
    background: transparent !important;
    border: 0 !important;
    color: var(--tf-enroll-muted) !important;
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 6px;
    padding: 2px 4px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-enroll-cancel:hover,
.tf-enroll-cancel:focus-visible {
    color: var(--tf-enroll-primary) !important;
}

.tf-enroll-cancel:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.24);
    outline-offset: 1px;
}

/* Wyrównanie przycisku przy polu „Uczeń" do wysokości selecta
   (na desktopie pola-grid ma 2 kolumny — przycisk i select są obok siebie). */
.tf-enroll-row--add-student {
    align-items: flex-end;
    display: flex;
}

.tf-enroll-self-note {
    background: #f7faff;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    color: var(--tf-enroll-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    padding: 10px;
}

.tf-enroll-fields-grid .tf-enroll-row--enroll-for {
    grid-column: 1 / -1;
}

.tf-enroll-enroll-for-content {
    margin-top: 12px;
}

.tf-enroll-row--student-name {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tf-enroll-row--student-name .tf-enroll-row {
    margin-bottom: 0;
}

@media (max-width: 560px) {
    .tf-enroll-row--student-name {
        grid-template-columns: 1fr;
    }
}

/* Pasek tagów: wszystkie podjęte decyzje w jednym rzędzie. */
.tf-enroll-tags {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
}

.tf-enroll-tag {
    align-items: center;
    background: #f7faff !important;
    border: 1px solid var(--tf-enroll-border) !important;
    border-radius: 10px;
    color: var(--tf-enroll-text) !important;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    gap: 5px;
    max-width: 100%;
    min-height: 30px;
    padding: 4px 9px;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tf-enroll-tag:hover,
.tf-enroll-tag:focus-visible {
    background: #eef5ff !important;
    border-color: #a9c8ef !important;
    color: var(--tf-enroll-text) !important;
}

.tf-enroll-tag:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.24);
    outline-offset: 1px;
}

.tf-enroll-tag.is-active {
    background: var(--tf-enroll-primary-soft) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: var(--tf-enroll-primary) !important;
    cursor: default;
}

/* Tag bez możliwości edycji (etap ma tylko jedną opcję) — sam fakt, bez ołówka. */
.tf-enroll-tag.is-static {
    cursor: default;
    font-weight: 600;
}

.tf-enroll-tag__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-enroll-tag__icon {
    color: var(--tf-enroll-muted);
    display: inline-flex;
    flex: 0 0 auto;
    opacity: 0.55;
}

.tf-enroll-tag:hover .tf-enroll-tag__icon,
.tf-enroll-tag:focus-visible .tf-enroll-tag__icon {
    color: var(--tf-enroll-primary);
    opacity: 1;
}

.tf-enroll-tag.is-active .tf-enroll-tag__icon {
    display: none;
}

.tf-enroll-row--note-toggle {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

/* Szary wariant przycisku (kod polecającego) — celowo mniej wyrazisty niż notatka. */
.tf-enroll-note-toggle--muted,
.tf-enroll-note-toggle--muted .tf-enroll-note-toggle__icon {
    color: var(--tf-enroll-primary);
}

.tf-enroll-note-toggle--muted .tf-enroll-note-toggle__icon {
    background: var(--tf-enroll-primary-soft);
}

.tf-enroll-hint {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    margin: 6px 0 0;
}

/* Wynik natychmiastowego sprawdzenia kodu rabatowego (bez czekania na bramkę). */
.tf-enroll-coupon-status {
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    margin: 8px 0 0;
    padding: 8px 10px;
}

.tf-enroll-coupon-status--ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #15803d;
}

.tf-enroll-coupon-status--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* Informacja o automatycznie usuniętym kodzie (nie blokuje zapisu). */
.tf-enroll-coupon-status--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* Pole kodu (polecającego / rabatowego) z przyciskiem potwierdzającym obok.
   Sprawdzanie dzieje się WYŁĄCZNIE po kliknięciu przycisku (albo Enterze),
   dzięki czemu przycisk „Dalej" nie czeka na odpowiedź serwera. */
.tf-enroll-code-wrap {
    align-items: center;
    display: flex;
    gap: 8px;
}

.tf-enroll-code-wrap .tf-enroll-input {
    flex: 1;
    min-width: 0;
}

.tf-enroll-code-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px;
    color: #334155 !important;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    min-height: 44px;
    padding: 0 14px;
    white-space: nowrap;
}

/* !important, bo motyw witryny nadpisuje tło/obramowanie przycisków w hover
   (objaw: pomarańczowy „Dodaj” zamiast szarego jak reszta formularza). */
.tf-enroll-code-btn:hover:not(:disabled),
.tf-enroll-code-btn:focus:not(:disabled),
.tf-enroll-code-btn:active:not(:disabled) {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #334155 !important;
}

.tf-enroll-code-btn:disabled {
    background: #f1f5f9 !important;
    border-color: #dbe3ec !important;
    color: #94a3b8 !important;
    cursor: default;
}

/* Notatka dla korepetytora zajmuje całą szerokość formularza. */
.tf-enroll-note-toggle--wide {
    width: 100%;
}

/* Kody: jedno pole „Mam kod” (serwer rozpoznaje kupon / kod polecający). */
.tf-enroll-code-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 8px 0 0;
}

.tf-enroll-code-chip {
    align-items: center;
    background: var(--tf-enroll-primary-soft);
    border: 1px solid #c7dcfa;
    border-radius: 10px;
    color: var(--tf-enroll-primary);
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 700;
    gap: 6px;
    max-width: 100%;
    padding: 5px 6px 5px 10px;
}

.tf-enroll-code-chip--referral {
    background: #f1f5fb;
    border-color: var(--tf-enroll-border);
    color: var(--tf-enroll-text);
}

.tf-enroll-code-chip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-enroll-code-chip__detail {
    color: #16794a;
    font-weight: 700;
    white-space: nowrap;
}

.tf-enroll-code-chip__remove {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50%;
    color: inherit !important;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    height: 20px;
    justify-content: center;
    line-height: 1;
    opacity: 0.6;
    padding: 0;
    width: 20px;
}

.tf-enroll-code-chip__remove:hover,
.tf-enroll-code-chip__remove:focus-visible {
    background: rgba(30, 99, 199, 0.12) !important;
    opacity: 1;
}

/* Kody wpisujemy wielkimi literami — klient nie musi się zastanawiać nad
   pisownią, a dopasowanie w bazie jest niewrażliwe na wielkość liter. */
.tf-enroll-code-input {
    text-transform: uppercase;
}

/* Rabat odrzucony przez serwer — komunikat pod podsumowaniem. */
.tf-enroll-summary__note--error {
    color: #b91c1c;
    font-weight: 600;
}

/* Kod usunięty automatycznie (informacja, nie błąd). */
.tf-enroll-summary__note--warn {
    color: #92400e;
    font-weight: 600;
}

/* Sekcja faktury jest teraz toggle'em (jak notatka i kod) — checkbox
   i jego etykieta nie są już używane. */

.tf-enroll-fields-grid--invoice {
    margin-top: 8px;
}

/* Pole NIP z przyciskiem pobierania danych z Białej Listy VAT */
.tf-enroll-fields-grid .tf-enroll-row--nip {
    grid-column: 1 / -1;
}

.tf-enroll-nip-wrap {
    align-items: center;
    display: flex;
    gap: 8px;
}

.tf-enroll-nip-wrap .tf-enroll-input {
    flex: 1;
}

.tf-enroll-nip-fetch {
    flex-shrink: 0;
    white-space: nowrap;
}

.tf-enroll-nip-status {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 6px;
}

.tf-enroll-nip-status.is-success {
    color: #16794a;
}

.tf-enroll-nip-status.is-error {
    color: #b42318;
}

.tf-enroll-fields-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.tf-enroll-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Nagłówek etapu jako CTA: „Wybierz przedmiot”.
   Podwójna klasa, bo `.tf-enroll-label` w media queries ma font-size 12px. */
.tf-enroll .tf-enroll-label--cta {
    align-items: center;
    display: flex;
    font-size: 15px;
    font-weight: 800;
    gap: 8px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.tf-enroll-label__text {
    min-width: 0;
}

/* Podpowiedź pod nagłówkiem aktywnego etapu („Kliknij jedną z opcji”). */
.tf-enroll-row__hint {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    line-height: 1.4;
    margin: 0 0 9px;
}

.tf-enroll-input,
.tf-enroll-textarea,
.tf-enroll-select {
    background: #fff;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    color: var(--tf-enroll-text);
    font: inherit;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

.tf-enroll-textarea {
    min-height: 96px;
    resize: vertical;
}

/* Walidacja „w locie”: pole z błędem + komunikat pod polem. */
.tf-enroll-input.is-invalid,
.tf-enroll-textarea.is-invalid,
.tf-enroll-select.is-invalid {
    background: #fffafa;
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.1);
}

.tf-enroll-input.is-invalid:focus,
.tf-enroll-textarea.is-invalid:focus,
.tf-enroll-select.is-invalid:focus {
    border-color: #b42318 !important;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.16) !important;
    outline: none;
}

.tf-enroll-field-error {
    color: #b42318;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    margin: 6px 0 0;
}

/* Podpowiedź pod przyciskami nawigacji (krok 2), gdy „Dalej” jest zablokowany. */
.tf-enroll-nav__hint {
    color: #5a6b85;
    font-size: 12px;
    line-height: 1.4;
    margin: 12px 0 0;
    text-align: right;
}

/* Pasek „Masz zapisany formularz” po odświeżeniu strony. */
.tf-enroll-draft-prompt {
    align-items: center;
    background: var(--tf-enroll-primary-soft);
    border: 1px solid #c7dcfa;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: space-between;
    margin: 0 0 14px;
    padding: 12px 14px;
}

.tf-enroll-draft-prompt__body {
    flex: 1 1 240px;
    min-width: 0;
}

.tf-enroll-draft-prompt__title {
    color: var(--tf-enroll-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 2px;
}

.tf-enroll-draft-prompt__text {
    color: #3d5372;
    font-size: 12.5px;
    line-height: 1.45;
    margin: 0;
}

.tf-enroll-draft-prompt__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tf-enroll-draft-prompt__actions .tf-enroll-btn {
    margin: 0;
    min-height: 38px;
}

@media (max-width: 600px) {
    .tf-enroll-draft-prompt__actions {
        width: 100%;
    }

    .tf-enroll-draft-prompt__actions .tf-enroll-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 600px) {
    .tf-enroll-nav__hint {
        text-align: left;
    }
}

/* Wiersz-akcja („+ Dodaj notatkę…”, „+ Mam kod”, „+ Chcę fakturę”):
   bez ramki i tła — jak link akcji, żeby nie robić „pudełek” w formularzu. */
.tf-enroll-note-toggle {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    color: var(--tf-enroll-primary) !important;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    justify-content: flex-start;
    min-height: 30px;
    padding: 3px 0;
    text-align: left;
}

.tf-enroll-note-toggle:hover,
.tf-enroll-note-toggle:focus-visible {
    background: transparent !important;
    border: 0 !important;
    color: var(--tf-enroll-primary-hover) !important;
}

.tf-enroll-note-toggle:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.24);
    outline-offset: 2px;
}

.tf-enroll-note-toggle__icon {
    align-items: center;
    background: var(--tf-enroll-primary-soft);
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 18px;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    width: 18px;
}

/* Ikona jest wektorem (SVG), więc leży dokładnie w środku kółka. */
.tf-enroll-note-toggle__icon svg {
    display: block;
    height: 10px;
    width: 10px;
}

.tf-enroll-note-toggle.is-open {
    color: var(--tf-enroll-text) !important;
}

/* Treść rozwiniętej akcji leży bezpośrednio na karcie (bez tła i ramki). */
.tf-enroll-note-panel {
    margin: 6px 0 14px;
    padding: 0;
}

.tf-enroll-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tf-enroll-chip {
    background: #f8faf8;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    color: var(--tf-enroll-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    min-height: 36px;
    padding: 7px 14px;
}

.tf-enroll-chip.is-static {
    cursor: default;
}

.tf-enroll-chip:disabled {
    cursor: wait;
    opacity: 0.7;
}

.tf-enroll-chip.is-selected {
    background: var(--tf-enroll-primary-soft) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: var(--tf-enroll-primary) !important;
}

.tf-enroll-chip.is-selected:hover,
.tf-enroll-chip.is-selected:focus,
.tf-enroll-chip.is-selected:active {
    background: var(--tf-enroll-primary-soft) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: var(--tf-enroll-primary) !important;
}

.tf-enroll-chip:hover:not(:disabled):not(.is-selected) {
    background: #eef5ff !important;
    border-color: #a9c8ef !important;
    color: var(--tf-enroll-text) !important;
}

.tf-enroll-inline-loading {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    margin-top: 6px;
}

.tf-enroll-tutor-cards {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tf-enroll-tutor {
    background: #fff;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    gap: 4px 10px;
    grid-template-columns: auto 1fr;
    min-height: 82px;
    padding: 10px;
    text-align: left;
    width: 100%;
}

.tf-enroll-tutor.is-selected {
    background: #eef5ff !important;
    border-color: var(--tf-enroll-primary);
    box-shadow: 0 0 0 2px rgba(30, 99, 199, 0.14);
}

.tf-enroll-tutor.is-selected:hover,
.tf-enroll-tutor.is-selected:focus,
.tf-enroll-tutor.is-selected:active {
    background: #eef5ff !important;
    border-color: var(--tf-enroll-primary) !important;
}

.tf-enroll-tutor:hover:not(.is-selected) {
    background: #f8fbff !important;
    border-color: #b7cfee !important;
}

.tf-enroll-tutor__avatar-wrap {
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    grid-row: 1 / 3;
    overflow: hidden;
    width: 96px;
}

.tf-enroll-tutor__avatar {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tf-enroll-tutor__body {
    min-width: 0;
}

.tf-enroll-tutor__name {
    color: var(--tf-enroll-text);
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.tf-enroll-tutor__meta-label {
    color: #4f5d6c;
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tf-enroll-tutor__meta {
    color: #4f5d6c;
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.tf-enroll-tutor__bio {
    color: var(--tf-enroll-text);
    font-size: 12px;
    grid-column: 1 / -1;
    line-height: 1.35;
    margin: 2px 0 0;
}

@media (min-width: 600px) {
    .tf-enroll-tutor__bio {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
    }

    .tf-enroll-tutor__meta {
        margin-bottom: 0;
    }
}

.tf-enroll-week-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tf-enroll-week-label {
    color: var(--tf-enroll-muted);
    font-size: 13px;
    font-weight: 600;
}

.tf-enroll-days-label {
    border-bottom: 1px solid var(--tf-enroll-border);
    color: var(--tf-enroll-muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    order: -1;
    padding: 12px 14px 8px;
    text-transform: uppercase;
}

.tf-enroll-days {
    background: var(--tf-enroll-surface);
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    display: grid;
    gap: 0;
    overflow: hidden;
}

.tf-enroll-days__list {
    display: contents;
}

.tf-enroll-day + .tf-enroll-day {
    border-top: 1px solid var(--tf-enroll-border);
}

.tf-enroll-day {
    cursor: pointer;
}

.tf-enroll-day:hover,
.tf-enroll-day:focus-visible,
.tf-enroll-day.is-open,
.tf-enroll-day.is-open .tf-enroll-day__head,
.tf-enroll-day__head:hover,
.tf-enroll-day__head:focus-visible {
    background: #eaf1fb;
}

.tf-enroll-day:focus-visible .tf-enroll-day__head {
    outline: 2px solid var(--tf-enroll-primary);
    outline-offset: -2px;
}

.tf-enroll-day__head {
    align-items: center;
    color: var(--tf-enroll-text);
    display: flex;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    gap: 10px;
    justify-content: space-between;
    min-height: 46px;
    padding: 10px 14px;
    text-align: left;
    width: 100%;
}

.tf-enroll-day__head-main {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tf-enroll-day__count {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 0;
}

.tf-enroll-day__chevron {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--tf-enroll-muted);
    flex: 0 0 auto;
    height: 0;
    transition: transform 0.15s ease;
    width: 0;
}

.tf-enroll-day.is-open .tf-enroll-day__chevron {
    transform: rotate(180deg);
}

.tf-enroll-days__panel {
    background: var(--tf-enroll-surface);
    border-top: 1px solid var(--tf-enroll-border);
    cursor: default;
    padding: 10px 14px 14px;
}

.tf-enroll-matrix {
    display: grid;
    gap: 6px;
}

.tf-enroll-matrix__title {
    color: var(--tf-enroll-muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.tf-enroll-matrix__row {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tf-enroll-matrix .tf-enroll-slot {
    min-width: 0;
    width: 100%;
}

.tf-enroll-matrix__cell {
    border-radius: 9px;
    display: block;
    min-height: 34px;
}

.tf-enroll-matrix__cell--empty {
    background: #f0f2f0;
}

.tf-enroll-slot {
    background: #f8faf8;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 9px;
    color: var(--tf-enroll-text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    min-height: 34px;
    min-width: 72px;
    padding: 6px 10px;
}

.tf-enroll-slot:disabled {
    color: var(--tf-enroll-text);
    opacity: 1;
    -webkit-text-fill-color: var(--tf-enroll-text);
}

.tf-enroll-slot.is-busy {
    background: #f1f5fb;
    color: #7a8793;
    cursor: not-allowed;
}

.tf-enroll-slot.is-busy:disabled {
    color: #7a8793;
    -webkit-text-fill-color: #7a8793;
}

.tf-enroll-slot.is-selected {
    background: var(--tf-enroll-primary) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: #fff !important;
}

.tf-enroll-slot.is-selected:hover,
.tf-enroll-slot.is-selected:focus,
.tf-enroll-slot.is-selected:active {
    background: var(--tf-enroll-primary) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: #fff !important;
}

.tf-enroll-slot:hover:not(:disabled):not(.is-selected):not(.is-busy) {
    background: #eef5ff !important;
    border-color: #a9c8ef !important;
    color: var(--tf-enroll-text) !important;
}

.tf-enroll-summary {
    background: #f7faff;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    display: grid;
    gap: 6px;
    padding: 12px;
}

.tf-enroll-summary__item {
    align-items: center;
    display: flex;
    font-size: 14px;
    gap: 8px;
    justify-content: space-between;
}

.tf-enroll-summary__item strong {
    font-weight: 700;
}

.tf-enroll-summary__note {
    color: var(--tf-enroll-muted);
    font-size: 13px;
    margin-top: 6px;
}

.tf-enroll-slot-placeholder {
    background: #fffbf4;
    border: 1px solid #f2dcc3;
    border-radius: 10px;
    color: #7a4f18;
    font-size: 13px;
    padding: 10px;
}

.tf-enroll-empty-help {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    /* Tekst zajmuje cały wiersz, a akcje stoją OBOK SIEBIE po lewej.
       Wcześniej `space-between` rozrzucał trzy elementy na szerokość karty
       i „Zadzwoń” wisiało pośrodku. */
    column-gap: 10px;
    justify-content: flex-start;
    margin-top: 10px;
    row-gap: 8px;
}

.tf-enroll-empty-help__text {
    color: var(--tf-enroll-muted);
    flex: 1 1 100%;
    font-size: 13px;
}

.tf-enroll-empty-help__badge {
    background: #eaf7ef;
    border: 1px solid #b9dfc5;
    border-radius: 999px;
    color: #145a3e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 5px 10px;
    white-space: nowrap;
}

.tf-enroll-empty-help__button {
    min-height: 36px;
    padding: 7px 12px;
}

/* „Zadzwoń: …” w pustych stanach — wygląda jak przycisk ghost, ale jest
   prawdziwym linkiem `tel:` (działa też bez JS). */
.tf-enroll-empty-help__link {
    align-items: center;
    display: inline-flex;
    min-height: 36px;
    padding: 7px 12px;
    text-decoration: none;
}

/* Wiersz pod paskiem postępu: nazwa kroku (lewo) + telefon (prawo).
   Numer nie zajmuje dodatkowej linii — siedzi w wierszu, który już istniał. */
.tf-enroll-progress__foot {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 9px;
}

.tf-enroll-progress__foot .tf-enroll-progress__step {
    margin: 0;
}

.tf-enroll-progress__phone {
    align-items: center;
    color: var(--tf-enroll-muted);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 600;
    gap: 5px;
    text-decoration: none;
    white-space: nowrap;
}

.tf-enroll-progress__phone-icon {
    display: inline-flex;
    height: 13px;
    width: 13px;
}

.tf-enroll-progress__phone-icon svg {
    display: block;
    height: 13px;
    width: 13px;
}

.tf-enroll-progress__phone:hover,
.tf-enroll-progress__phone:focus-visible {
    color: var(--tf-enroll-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-enroll-subtle-hint {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    margin-top: 10px;
}

.tf-enroll-subtle-hint__link {
    background: transparent;
    border: 0;
    color: var(--tf-enroll-primary);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    margin: 0;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-enroll-subtle-hint__link:hover,
.tf-enroll-subtle-hint__link:focus-visible,
.tf-enroll-subtle-hint__link:active {
    /* Motyw potrafi dać pomarańczową pigułkę na hover — zerujemy wszystko
       i zostawiamy sam kolor tekstu. */
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--tf-enroll-primary-hover);
    outline: 0;
    padding: 0 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-enroll-subtle-hint__link:focus-visible {
    outline: 2px solid var(--tf-enroll-primary);
    outline-offset: 2px;
}

.tf-enroll-modal {
    align-items: center;
    background: rgba(17, 24, 39, 0.42);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 16px;
    position: fixed;
    z-index: 9999;
}

.tf-enroll-modal__dialog {
    background: #fff;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 14px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.2);
    max-width: 560px;
    padding: 18px;
    position: relative;
    width: 100%;
}

.tf-enroll-modal__close {
    align-items: center;
    background: #fff;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 999px;
    color: #5f6c7b;
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 30px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
}

.tf-enroll-modal__title {
    font-size: 20px;
    line-height: 1.25;
    margin: 0 36px 8px 0;
}

.tf-enroll-modal__lead {
    color: var(--tf-enroll-muted);
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 10px;
}

.tf-enroll-modal__context {
    background: #f7faff;
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    color: var(--tf-enroll-text);
    font-size: 13px;
    margin: 0 0 12px;
    padding: 9px 10px;
}

.tf-enroll-modal__input {
    margin-bottom: 2px;
}

.tf-enroll-modal__textarea {
    margin-bottom: 4px;
    min-height: 80px;
}

.tf-enroll-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}

.tf-enroll-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-top: 8px;
}

.tf-enroll-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    min-height: 44px;
    padding: 10px 14px;
}

.tf-enroll-btn--ghost {
    background: #fff;
    border-color: var(--tf-enroll-border);
    color: var(--tf-enroll-text);
}

.tf-enroll-btn--primary {
    background: var(--tf-enroll-primary);
    color: #fff;
}

.tf-enroll .tf-enroll-btn--ghost {
    background: #fff !important;
    border-color: var(--tf-enroll-border) !important;
    color: var(--tf-enroll-text) !important;
}

.tf-enroll .tf-enroll-btn--primary {
    background: var(--tf-enroll-primary) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: #fff !important;
}

.tf-enroll-btn--primary:focus,
.tf-enroll-btn--primary:active {
    background: var(--tf-enroll-primary) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: #fff !important;
}

.tf-enroll-btn--ghost:hover:not(:disabled) {
    background: #eef5ff !important;
    border-color: #a9c8ef !important;
    color: var(--tf-enroll-text) !important;
}

.tf-enroll-btn--primary:hover:not(:disabled) {
    background: var(--tf-enroll-primary-hover) !important;
    border-color: var(--tf-enroll-primary-hover) !important;
    color: #fff !important;
}

.tf-enroll-btn:focus-visible,
.tf-enroll-code-btn:focus-visible,
.tf-enroll-chip:focus-visible,
.tf-enroll-tutor:focus-visible,
.tf-enroll-slot:focus-visible,
.tf-enroll-note-toggle:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.24);
    outline-offset: 1px;
}

.tf-enroll-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.tf-enroll .tf-enroll-btn--ghost:disabled {
    background: #f4f7fb !important;
    border-color: #d6e4f7 !important;
    color: #8195ad !important;
    opacity: 1 !important;
}

.tf-enroll .tf-enroll-btn--primary:disabled {
    background: #b9cde8 !important;
    border-color: #b9cde8 !important;
    color: #f7faff !important;
    opacity: 1 !important;
}

.tf-enroll-feedback {
    border-radius: 10px;
    font-size: 13px;
    margin: 10px 0 0;
    padding: 9px 10px;
}

.tf-enroll-feedback--error {
    background: #fff3f2;
    border: 1px solid #fecaca;
    color: var(--tf-enroll-danger);
}

.tf-enroll-feedback--warning {
    background: #fffbf2;
    border: 1px solid #f7dfbe;
    color: var(--tf-enroll-warning);
}

.tf-enroll-inline-link {
    background: transparent;
    border: 0;
    color: var(--tf-enroll-primary);
    cursor: pointer;
    display: inline;
    font: inherit;
    font-weight: 700;
    margin: 0;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-enroll-inline-link:hover {
    color: var(--tf-enroll-primary-hover);
}

.tf-enroll-feedback--success {
    background: #eef9f2;
    border: 1px solid #bae4c9;
    color: #135d40;
}

.tf-enroll-auth-title {
    font-weight: 700;
    margin-bottom: 6px;
}

/* Linki „Zaloguj się” / „Przypomnij hasło” — bez `gap` zlepiały się w jeden napis. */
.tf-enroll-auth-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.tf-enroll-auth-link {
    color: var(--tf-enroll-primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tf-enroll-auth-link:hover {
    color: var(--tf-enroll-primary-hover);
}


.tf-enroll-auth-meta {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    margin-top: 7px;
}

.tf-enroll-skeleton {
    animation: tf-enroll-pulse 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, #eef2f8 0%, #e2eaf5 50%, #eef2f8 100%);
    background-size: 200% 100%;
    border-radius: 8px;
    height: 14px;
    width: 100%;
}

.tf-enroll-skeleton.short {
    width: 62%;
}

/* Spinner w miejscach, gdzie czekamy na dane (np. dostępne terminy). */
.tf-enroll-loading {
    align-items: center;
    background: var(--tf-enroll-surface);
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    color: var(--tf-enroll-muted);
    display: flex;
    font-size: 13px;
    gap: 10px;
    line-height: 1.4;
    padding: 12px 14px;
}

.tf-enroll-loading__spinner {
    animation: tf-enroll-spin 0.8s linear infinite;
    border: 2px solid var(--tf-enroll-primary-soft);
    border-radius: 50%;
    border-top-color: var(--tf-enroll-primary);
    display: block;
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.tf-enroll-loading__text {
    color: var(--tf-enroll-muted);
    font-size: 13px;
}

@keyframes tf-enroll-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tf-enroll-loading__spinner {
        animation-duration: 2.4s;
    }
}

.tf-enroll-skeleton--line + .tf-enroll-skeleton--line {
    margin-top: 10px;
}

/* ── Subject chips (kompaktowe chipy z miniaturą) ─────────────────────────── */

.tf-enroll-subject-chips {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.tf-enroll-subject-chip {
    align-items: center;
    background: #ffffff !important;
    border: 1px solid var(--tf-enroll-border) !important;
    border-radius: 10px;
    color: var(--tf-enroll-text) !important;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    line-height: 1.25;
    max-width: 100%;
    min-height: 44px;
    padding: 5px 12px 5px 5px;
    text-align: left;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.tf-enroll-subject-chip:hover:not(:disabled):not(.is-selected) {
    background: #f8fbff !important;
    border-color: #b7cfee !important;
    color: var(--tf-enroll-text) !important;
    box-shadow: 0 2px 10px rgba(30, 99, 199, 0.1) !important;
}

.tf-enroll-subject-chip.is-selected {
    background: var(--tf-enroll-primary-soft) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: var(--tf-enroll-primary) !important;
    box-shadow: 0 0 0 3px rgba(30, 99, 199, 0.12) !important;
}

.tf-enroll-subject-chip.is-selected:hover,
.tf-enroll-subject-chip.is-selected:focus,
.tf-enroll-subject-chip.is-selected:active {
    background: var(--tf-enroll-primary-soft) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: var(--tf-enroll-primary) !important;
}

.tf-enroll-subject-chip:disabled,
.tf-enroll-subject-chip.is-disabled {
    cursor: wait;
    opacity: 0.7;
}

.tf-enroll-subject-chip:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.3);
    outline-offset: 2px;
}

.tf-enroll-subject-chip__thumb {
    background: #eef2f8;
    border-radius: 8px;
    flex: 0 0 auto;
    height: 32px;
    overflow: hidden;
    width: 32px;
}

.tf-enroll-subject-chip__img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tf-enroll-subject-chip__letter {
    align-items: center;
    background: linear-gradient(135deg, #dbe8fd 0%, #c7dcfa 100%);
    color: var(--tf-enroll-primary);
    display: flex;
    font-size: 15px;
    font-weight: 800;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.tf-enroll-subject-chip__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: break-word;
    white-space: normal;
}

.tf-enroll-subject-chip__check {
    color: var(--tf-enroll-primary);
    display: none;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.tf-enroll-subject-chip.is-selected .tf-enroll-subject-chip__check {
    display: block;
}

/* ── /Subject chips ────────────────────────────────────────────────────────── */

@keyframes tf-enroll-pulse {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* ── Login section in step 2 ─────────────────────────────────────────────────── */

.tf-enroll-login-prompt {
    align-items: center;
    background: #f0f6fb;
    border: 1px solid #c7dcee;
    border-radius: 10px;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 10px 12px;
}

.tf-enroll-login-prompt__text {
    color: #21496d;
    font-size: 13px;
    font-weight: 600;
}

.tf-enroll-login-prompt__btn {
    background: #fff;
    border: 1px solid #9bbddb;
    border-radius: 8px;
    color: #1c4a6c;
    cursor: pointer;
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    padding: 6px 12px;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.tf-enroll-login-prompt__btn:hover {
    background: #e5f0fa !important;
    border-color: #7aaed4 !important;
    color: #1c4a6c !important;
}

.tf-enroll-logged-in-badge {
    align-items: center;
    background: #e8f5ed;
    border: 1px solid #b3dac4;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 10px 12px;
}

.tf-enroll-logged-in-badge__text {
    color: #135d40;
    font-size: 13px;
    font-weight: 600;
}

.tf-enroll-logged-in-badge__logout {
    background: transparent;
    border: 1px solid #91c5a9;
    border-radius: 8px;
    color: #135d40;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    min-height: 30px;
    padding: 4px 10px;
}

.tf-enroll-logged-in-badge__logout:hover {
    background: #d2f0df !important;
    border-color: #6fb390 !important;
}

@media (max-width: 820px) {
    .tf-enroll {
        border-radius: 14px;
        padding: 14px;
    }

    .tf-enroll-progress__title {
        font-size: 18px;
    }

    .tf-enroll-nav {
        flex-direction: column-reverse;
    }

    .tf-enroll-nav .tf-enroll-btn {
        width: 100%;
    }

    .tf-enroll-week-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tf-enroll-subject-chips {
        gap: 7px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 820px) {
    .tf-enroll-days {
        align-items: stretch;
        display: flex;
        padding: 0;
    }

    .tf-enroll-days__list {
        border-right: 1px solid var(--tf-enroll-border);
        display: block;
        flex: 0 0 320px;
        min-width: 0;
    }

    .tf-enroll-days--panel-taller .tf-enroll-days__list .tf-enroll-day:last-child {
        border-bottom: 1px solid var(--tf-enroll-border);
    }

    .tf-enroll-days__panel {
        border-top: 0;
        flex: 1 1 0;
        min-width: 0;
        padding: 12px;
    }

    .tf-enroll-matrix__title {
        border-bottom: 1px solid var(--tf-enroll-border);
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
}

@media (max-width: 599px) {
    .tf-enroll {
        border-radius: 10px;
        padding: 10px;
    }

    .tf-enroll-progress {
        margin-bottom: 12px;
    }

    .tf-enroll-progress__title {
        font-size: 17px;
    }

    .tf-enroll-progress__counter {
        font-size: 11.5px;
    }

    .tf-enroll-card {
        border-radius: 10px;
        padding: 12px;
    }

    .tf-enroll-chip {
        font-size: 12px;
        min-height: 32px;
        padding: 6px 12px;
    }

    .tf-enroll-choice-summary {
        padding: 7px 9px;
    }

    .tf-enroll-choice-summary__label,
    .tf-enroll-choice-summary__value {
        font-size: 12px;
    }

    .tf-enroll-choice-summary__edit {
        min-height: 28px;
        padding: 4px 9px;
    }

    .tf-enroll-tutor-cards {
        grid-template-columns: 1fr;
    }

    .tf-enroll-tutor {
        min-height: auto;
    }

    .tf-enroll-tutor__avatar-wrap {
        width: 72px;
    }

    .tf-enroll-day__head {
        font-size: 13px;
        min-height: 42px;
        padding: 8px 10px;
    }

    .tf-enroll-days__panel {
        padding: 8px 10px 10px;
    }

    .tf-enroll-matrix__row {
        gap: 5px;
    }

    .tf-enroll-matrix .tf-enroll-slot {
        font-size: 11px;
        min-height: 32px;
        padding: 4px 6px;
    }

    .tf-enroll-btn {
        font-size: 13px;
        min-height: 40px;
        padding: 8px 12px;
    }

    .tf-enroll-empty-help {
        align-items: stretch;
        flex-direction: column;
    }

    .tf-enroll-empty-help__button {
        width: 100%;
    }

    .tf-enroll-login-prompt {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .tf-enroll-login-prompt__btn {
        width: 100%;
    }

    .tf-enroll-logged-in-badge {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tf-enroll-logged-in-badge__logout {
        width: 100%;
    }

    .tf-enroll-modal__dialog {
        padding: 14px;
    }

    .tf-enroll-modal__title {
        font-size: 18px;
    }

    .tf-enroll-modal__actions {
        justify-content: stretch;
    }

    .tf-enroll-modal__actions .tf-enroll-btn {
        width: 100%;
    }

    .tf-enroll-section-title {
        font-size: 16px;
    }

    .tf-enroll-label {
        font-size: 12px;
    }

    .tf-enroll-input,
    .tf-enroll-textarea,
    .tf-enroll-select {
        font-size: 16px; /* zapobiega zoom na iOS przy focusie */
    }

    .tf-enroll-subject-chip {
        font-size: 12.5px;
        gap: 7px;
        min-height: 40px;
        padding: 4px 10px 4px 4px;
    }

    .tf-enroll-subject-chip__thumb {
        height: 28px;
        width: 28px;
    }
}

@media (max-width: 399px) {
    .tf-enroll {
        padding: 8px;
    }

    .tf-enroll-progress__title {
        font-size: 16px;
    }

    .tf-enroll-card {
        padding: 10px;
    }

    .tf-enroll-chip {
        font-size: 11px;
        padding: 5px 10px;
    }

    .tf-enroll-choice-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .tf-enroll-choice-summary__edit {
        align-self: flex-end;
    }

    .tf-enroll-login-box {
        padding: 10px;
    }

    .tf-enroll-slot {
        font-size: 11px;
        min-height: 30px;
        padding: 4px 6px;
    }

    .tf-enroll-matrix__row {
        gap: 4px;
    }
}

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

    .tf-enroll-fields-grid .tf-enroll-row {
        margin-bottom: 0;
    }
}

/* ==========================================================================
   Kalendarz miesięczny + lista godzin obok
   ========================================================================== */

.tf-enroll-cal-layout {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
    .tf-enroll-cal-layout {
        align-items: stretch;
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    }
}

.tf-enroll-cal {
    background: var(--tf-enroll-surface);
    border: 1px solid var(--tf-enroll-border);
    border-radius: 14px;
    height: 100%;
    padding: 12px;
}

.tf-enroll-cal__head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tf-enroll-cal__title {
    color: var(--tf-enroll-text);
    font-size: 15px;
    font-weight: 700;
    text-transform: capitalize;
}

.tf-enroll-cal__nav {
    align-items: center;
    background: var(--tf-enroll-primary-soft) !important;
    border: 1px solid var(--tf-enroll-border) !important;
    border-radius: 50%;
    color: var(--tf-enroll-primary) !important;
    cursor: pointer;
    display: inline-flex;
    font-size: 16px;
    height: 30px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 30px;
}

.tf-enroll-cal__nav:hover:not(:disabled) {
    background: var(--tf-enroll-primary-hover-soft) !important;
    border-color: var(--tf-enroll-primary) !important;
}

.tf-enroll-cal__nav:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.tf-enroll-cal__grid {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tf-enroll-cal__dow {
    color: var(--tf-enroll-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 0;
    text-align: center;
    text-transform: uppercase;
}

.tf-enroll-cal__cell {
    align-items: center;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px;
    color: var(--tf-enroll-text) !important;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 13px;
    height: 36px;
    justify-content: center;
    padding: 0;
}

/* Heat mapa: im więcej wolnych startów, tym mocniejsze tło dnia.
   Reguły muszą być PRZED `.is-selected`/`:hover`, żeby te stany wygrywały. */
.tf-enroll-cal__cell.is-heat-1 {
    background: rgba(30, 99, 199, 0.08) !important;
}

.tf-enroll-cal__cell.is-heat-2 {
    background: rgba(30, 99, 199, 0.16) !important;
}

.tf-enroll-cal__cell.is-heat-3 {
    background: rgba(30, 99, 199, 0.27) !important;
}

.tf-enroll-cal__cell.is-heat-4 {
    background: rgba(30, 99, 199, 0.4) !important;
}

.tf-enroll-cal__cell:hover:not(:disabled) {
    background: var(--tf-enroll-primary-soft) !important;
    border-color: var(--tf-enroll-border) !important;
}

.tf-enroll-cal__cell.is-today {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tf-enroll-cal__cell.is-selected {
    background: var(--tf-enroll-primary) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: #ffffff !important;
    font-weight: 700;
}

.tf-enroll-cal__cell.is-disabled {
    background: #f2f5f9 !important;
    color: #8b9db5 !important;
    cursor: not-allowed;
    text-decoration: line-through;
    /* Przekreślenie ma być wyraźne, ale nie krzyczeć (1,5 px, chłodny szary). */
    text-decoration-color: #93a6bd;
    text-decoration-thickness: 1.5px;
}

.tf-enroll-cal__cell--empty {
    background: transparent !important;
    pointer-events: none;
}

.tf-enroll-cal__note {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 10px 0 0;
}

.tf-enroll-cal__note--error {
    color: var(--tf-enroll-danger);
}

/* Legenda heat mapy */
.tf-enroll-cal__legend {
    align-items: center;
    color: var(--tf-enroll-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    gap: 5px;
    justify-content: flex-end;
    margin-top: 10px;
}

.tf-enroll-cal__legend-swatch {
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(30, 99, 199, 0.18);
    display: block;
    height: 10px;
    width: 10px;
}

.tf-enroll-cal__legend-swatch--1 {
    background: rgba(30, 99, 199, 0.12);
}

.tf-enroll-cal__legend-swatch--2 {
    background: rgba(30, 99, 199, 0.2);
}

.tf-enroll-cal__legend-swatch--3 {
    background: rgba(30, 99, 199, 0.3);
}

.tf-enroll-cal__legend-swatch--4 {
    background: rgba(30, 99, 199, 0.42);
}

/* Skrócona notka pod całym wyborem terminu. */
.tf-enroll-schedule-note {
    line-height: 1.5;
    margin: 14px 0 0;
}

/* Prawa kolumna: godziny dnia wybranego w kalendarzu. */
.tf-enroll-cal-hours {
    background: var(--tf-enroll-surface);
    border: 1px solid var(--tf-enroll-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.tf-enroll-cal-hours__head {
    align-items: baseline;
    border-bottom: 1px solid var(--tf-enroll-border);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    justify-content: flex-start;
    padding: 12px 14px 10px;
}

.tf-enroll-cal-hours__sep {
    color: var(--tf-enroll-border);
    font-size: 14px;
}

.tf-enroll-cal-hours__tutor {
    color: var(--tf-enroll-primary);
    font-size: 13px;
    font-weight: 600;
}

.tf-enroll-cal-hours__title {
    color: var(--tf-enroll-text);
    font-size: 14px;
    font-weight: 700;
}

.tf-enroll-cal-hours__count {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    font-weight: 600;
}

.tf-enroll-cal-hours__body {
    flex: 1 1 auto;
    padding: 10px 14px 14px;
}

/* Pusty stan prawej kolumny („Brak wolnych terminów w tym miesiącu”) —
   bez tego komunikat i akcje dotykały krawędzi karty. */
.tf-enroll-cal-hours--empty {
    gap: 10px;
    padding: 14px;
}

/* — pierścień godzin: poziomo przewijany pasek kafelków z wolnymi terminami — */
.tf-enroll-ring__summary {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tf-enroll-ring__summary-time {
    color: var(--tf-enroll-text);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.tf-enroll-ring__summary-meta {
    color: var(--tf-enroll-muted);
    font-size: 13px;
    font-weight: 600;
}

.tf-enroll-ring__track-wrap {
    align-items: center;
    display: flex;
    position: relative;
}

/* Mgiełki na brzegach: godziny schowane pod delikatnym gradientem tła karty
   (ten sam wzorzec co pasek zakładek w panelach — klasy z JS). */
.tf-enroll-ring__track-wrap::before,
.tf-enroll-ring__track-wrap::after {
    bottom: 0;
    content: "";
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    transition: opacity 0.18s ease;
    width: 34px;
    z-index: 2;
}

.tf-enroll-ring__track-wrap::before {
    background: linear-gradient(90deg, var(--tf-enroll-surface) 18%, rgba(255, 255, 255, 0) 100%);
    left: 0;
}

.tf-enroll-ring__track-wrap::after {
    background: linear-gradient(270deg, var(--tf-enroll-surface) 18%, rgba(255, 255, 255, 0) 100%);
    right: 0;
}

.tf-enroll-ring__track-wrap.has-overflow-left::before,
.tf-enroll-ring__track-wrap.has-overflow-right::after {
    opacity: 1;
}

/* Strzałki: same ikony w warstwie NAD kafelkami (bez tła i ramki). */
.tf-enroll-ring__nav {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 8px;
    color: var(--tf-enroll-primary) !important;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 22px;
    font-weight: 700;
    height: 44px;
    justify-content: center;
    line-height: 1;
    opacity: 0.7;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.15s ease, color 0.15s ease;
    width: 30px;
    z-index: 3;
}

.tf-enroll-ring__nav--prev {
    left: 0;
}

.tf-enroll-ring__nav--next {
    right: 0;
}

.tf-enroll-ring__nav:hover,
.tf-enroll-ring__nav:focus-visible {
    background: transparent !important;
    border: 0 !important;
    opacity: 1;
}

.tf-enroll-ring__nav:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.24);
    outline-offset: 1px;
}

.tf-enroll-ring__list {
    align-items: center;
    cursor: grab;
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    /* Połowa szerokości kafelka z każdej strony — skrajne kafelki też
       mogą stanąć w środku, więc bęben działa „w kółko”. */
    padding: 8px calc(50% - 34px);
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

/* Przeciąganie myszą: bez animacji i bez przyciągania w trakcie ruchu. */
.tf-enroll-ring__list.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
    user-select: none;
}

.tf-enroll-ring__list::-webkit-scrollbar {
    display: none;
}

.tf-enroll-ring__tile {
    align-items: center;
    background: #f7faff !important;
    border: 1px solid var(--tf-enroll-border) !important;
    border-radius: 10px;
    color: var(--tf-enroll-text) !important;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    font: inherit;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    gap: 1px;
    height: 52px;
    justify-content: center;
    opacity: 0.55;
    padding: 6px 8px;
    scroll-snap-align: center;
    transform: scale(0.86);
    transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease,
        border-color 0.18s ease, color 0.18s ease;
    width: 68px;
}

.tf-enroll-ring__tile:hover,
.tf-enroll-ring__tile:focus-visible {
    background: #eef5ff !important;
    border-color: #a9c8ef !important;
    opacity: 0.85;
}

.tf-enroll-ring__tile:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.24);
    outline-offset: 1px;
}

/* Kafelek w środku bębna = aktualnie wskazywana godzina. */
.tf-enroll-ring__tile.is-center {
    background: var(--tf-enroll-primary) !important;
    border-color: var(--tf-enroll-primary) !important;
    color: #ffffff !important;
    opacity: 1;
    transform: scale(1.06);
}

.tf-enroll-ring__tile.is-center:hover {
    background: var(--tf-enroll-primary-hover) !important;
    border-color: var(--tf-enroll-primary-hover) !important;
    opacity: 1;
}

.tf-enroll-ring__tile.is-chosen:not(.is-center) {
    border-color: var(--tf-enroll-primary) !important;
    color: var(--tf-enroll-primary) !important;
    opacity: 0.9;
}

.tf-enroll-ring__time {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.tf-enroll-ring__tile.is-center .tf-enroll-ring__time {
    font-size: 14px;
}

.tf-enroll-ring__actions {
    margin-top: 12px;
}

.tf-enroll-ring__actions .tf-enroll-btn {
    width: 100%;
}

.tf-enroll-ring__hint {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 10px 0 0;
    text-align: center;
}

/* Na wąskich ekranach kafelki są mniejsze, ale strzałki zostają
   (jako nakładka nie zabierają miejsca na godziny). */
@media (max-width: 460px) {
    .tf-enroll-ring__nav {
        font-size: 20px;
        height: 40px;
        width: 28px;
    }

    .tf-enroll-ring__track-wrap::before,
    .tf-enroll-ring__track-wrap::after {
        width: 20px;
    }

    .tf-enroll-ring__list {
        padding: 8px calc(50% - 30px);
    }

    .tf-enroll-ring__tile {
        height: 48px;
        width: 60px;
    }

    .tf-enroll-ring__summary-time {
        font-size: 21px;
    }
}

/* ==========================================================================
   Pasek korepetytorów (nad kalendarzem) + karta korepetytora
   ========================================================================== */

.tf-enroll-tutor-strip {
    margin-bottom: 12px;
}

.tf-enroll-tutor-strip__label {
    color: var(--tf-enroll-text);
    display: block;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 7px;
    text-transform: none;
}

/* CTA pod nagłówkiem (tylko gdy korepetytorów jest więcej niż jeden):
   wygląd przejmuje z `.tf-enroll-row__hint`, tu tylko odstęp. */
.tf-enroll-tutor-strip__hint {
    margin: -3px 0 9px;
}

.tf-enroll-tutor-strip__list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tf-enroll-tutor-strip__list::-webkit-scrollbar {
    display: none;
}

.tf-enroll-tutor-chip {
    align-items: center;
    background: #ffffff !important;
    border: 1px solid var(--tf-enroll-border) !important;
    border-radius: 10px;
    color: var(--tf-enroll-text) !important;
    display: inline-flex;
    flex: 0 0 auto;
    overflow: hidden;
}

.tf-enroll-tutor-chip:hover,
.tf-enroll-tutor-chip:focus-within {
    border-color: var(--tf-enroll-primary) !important;
}

.tf-enroll-tutor-chip.is-selected {
    background: var(--tf-enroll-primary-soft) !important;
    border-color: var(--tf-enroll-primary) !important;
}

.tf-enroll-tutor-chip__select {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    color: inherit !important;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: 8px;
    padding: 6px 4px 6px 8px;
}

.tf-enroll-tutor-chip__select:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.35);
    outline-offset: -2px;
}

.tf-enroll-tutor-chip__info {
    align-items: center;
    align-self: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px;
    color: var(--tf-enroll-muted) !important;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    height: 26px;
    justify-content: center;
    line-height: 0;
    margin: 0 6px 0 0;
    padding: 0;
    width: 26px;
}

.tf-enroll-tutor-chip__info svg {
    display: block;
}

.tf-enroll-tutor-chip__info:hover,
.tf-enroll-tutor-chip__info:focus-visible {
    background: var(--tf-enroll-primary-soft) !important;
    color: var(--tf-enroll-primary) !important;
}

.tf-enroll-tutor-chip__info:focus-visible {
    outline: 2px solid rgba(30, 99, 199, 0.35);
    outline-offset: 1px;
}

.tf-enroll-tutor-chip__avatar {
    border-radius: 50%;
    display: block;
    flex: 0 0 auto;
    height: 28px;
    object-fit: cover;
    width: 28px;
}

.tf-enroll-tutor-chip__avatar--letter {
    align-items: center;
    background: var(--tf-enroll-primary-soft);
    color: var(--tf-enroll-primary);
    display: flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    text-transform: uppercase;
}

.tf-enroll-tutor-chip__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

.tf-enroll-tutor-chip__name {
    font-size: 13px;
    font-weight: 700;
}

.tf-enroll-tutor-chip__meta {
    color: var(--tf-enroll-muted);
    font-size: 11px;
    font-weight: 500;
}

.tf-enroll-tutor-chip__price {
    color: var(--tf-enroll-primary);
    font-size: 12px;
    font-weight: 700;
}

/* — karta korepetytora: dymek przy chipie (desktop) / arkusz od dołu (mobile) — */
.tf-enroll-tutor-info {
    max-width: 460px;
    width: 100%;
}

.tf-enroll-modal--popover {
    align-items: flex-start;
    background: transparent;
    justify-content: flex-start;
    padding: 0;
}

.tf-enroll-tutor-info--popover {
    box-shadow: 0 18px 40px rgba(11, 37, 69, 0.22);
    max-width: none;
    padding: 16px;
}

/* ogonek dymka wskazujący ikonę „i” (desktop) */
.tf-enroll-tutor-info--below::before,
.tf-enroll-tutor-info--above::after {
    border: 6px solid transparent;
    content: "";
    height: 0;
    left: var(--tf-arrow-left, 50%);
    margin-left: -6px;
    position: absolute;
    width: 0;
}

.tf-enroll-tutor-info--below::before {
    border-bottom-color: #ffffff;
    top: -12px;
}

.tf-enroll-tutor-info--above::after {
    border-top-color: #ffffff;
    bottom: -12px;
}

.tf-enroll-tutor-info__head {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-right: 24px;
}

.tf-enroll-tutor-info__avatar {
    border-radius: 50%;
    flex: 0 0 auto;
    height: 56px;
    object-fit: cover;
    width: 56px;
}

.tf-enroll-tutor-info__headtext {
    min-width: 0;
}

.tf-enroll-tutor-info .tf-enroll-modal__title {
    margin: 0 0 2px;
}

.tf-enroll-tutor-info__meta {
    color: var(--tf-enroll-muted);
    font-size: 12px;
    margin: 0;
}

.tf-enroll-tutor-info__bio {
    color: var(--tf-enroll-text);
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 14px;
    max-height: 40vh;
    overflow-y: auto;
    white-space: pre-line;
}

.tf-enroll-tutor-info__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 599px) {
    .tf-enroll-modal--sheet {
        align-items: flex-end;
        padding: 0;
    }

    .tf-enroll-modal--sheet .tf-enroll-tutor-info {
        border-radius: 16px 16px 0 0;
        max-height: 82vh;
        max-width: none;
        overflow-y: auto;
    }

    .tf-enroll-tutor-info__actions .tf-enroll-btn {
        flex: 1 1 100%;
    }
}

/* Skrajnie wąskie ekrany: przedmioty w jednej kolumnie, żeby nazwy się nie łamały.
   (Blok musi być PO @media 820px, które ustawia dwie kolumny.) */
@media (max-width: 340px) {
    .tf-enroll-subject-chips {
        grid-template-columns: minmax(0, 1fr);
    }
}
