/* Юстихаб Календарь — 390×844, UI по .cursor/rules/UI СТАНДАРТЫ ИНТЕРФЕЙСОВ.mdc */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    height: 100svh;
    overflow: hidden;
}

body {
    margin: 0;
    height: 100%;
    height: 100svh;
    overflow: hidden;
    overflow-x: hidden;
    background: #000000;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

body.modal-open {
    overflow: hidden;
}

html.modal-open {
    overflow: hidden;
}

input,
textarea {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* Экран авторизации — как в yustihab-chats (тёмная тема, карточка) */
.auth-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 24px;
    background: #000;
    position: relative;
}
.auth-screen[hidden] {
    display: none !important;
}
.auth-screen__container {
    position: relative;
    z-index: 1;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    animation: authScreenFadeInUp 0.6s ease-out both;
}
@keyframes authScreenFadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-screen__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0;
    margin-bottom: 36px;
}
.auth-screen__logo-img {
    height: 22px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
}
.auth-screen__logo-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 22px;
    font-weight: 300;
    margin-bottom: -4px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-screen__beta {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-top: -8px;
    color: #a78bfa;
    border: 1px solid #a78bfa;
    border-radius: 6px;
    padding: 2px 6px;
    align-self: center;
    flex-shrink: 0;
}
.auth-screen__heading {
    font-size: 18px;
    font-weight: 600;
    color: rgb(243, 244, 246);
    margin: 0 0 8px 0;
    text-align: center;
}
.auth-screen__hint {
    font-size: 14px;
    color: rgb(156, 163, 175);
    margin: 0 0 20px 0;
    text-align: center;
    line-height: 1.5;
}
.auth-screen__input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #2a2b2c;
    border-radius: 12px;
    color: rgb(243, 244, 246);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}
.auth-screen__input::placeholder {
    color: rgb(107, 114, 128);
}
.auth-screen__input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}
.auth-screen__input:disabled {
    opacity: 0.55;
}
.auth-screen__btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 8px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.auth-screen__btn:hover:not(:disabled) {
    background: #2563eb;
}
.auth-screen__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.auth-screen__link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: rgb(156, 163, 175);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    padding: 8px;
    margin-top: 12px;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}
.auth-screen__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgb(243, 244, 246);
}
.auth-screen__phone-display {
    text-align: center;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}
.auth-screen__error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}
.auth-screen__error[hidden] {
    display: none;
}
@media (max-width: 430px) {
    .auth-screen__container {
        padding: 20px;
    }
    .auth-screen__logo-title {
        font-size: 20px;
    }
}

/* Фиксированная высота окна — прокрутка только внутри .main */
.app {
    width: 100%;
    max-width: 390px;
    height: 100%;
    height: 100svh;
    min-height: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #000000;
    overflow: hidden;
}

/* Шапка — закреплена сверху при прокрутке .main */
.header {
    position: sticky;
    top: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px;
    background: rgba(16, 16, 21, 0.65);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.header__left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header__logo {
    height: 22px;
    width: auto;
    display: block;
}

.header__title {
    font-size: 19px;
    font-weight: 400;
    margin: 0 0 -5px 0;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.9);
}

.header__beta {
    font-size: 8px;
    font-weight: 300;
    color: #ffffff;
    padding: 2px 5px;
    background: #ffffff21;
    margin-left: -3px;
    border-radius: 6px;
    margin-top: -4px;
}

.header__avatar-area {
    position: relative;
}

.header__avatar-wrap {
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: block;
}

.header__avatar-wrap:hover {
    background: rgba(255, 255, 255, 0.15);
}

.header__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.header__avatar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 300px;
    padding: 12px 16px 10px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

.header__avatar-menu[hidden] {
    display: none;
}

.header__avatar-menu-title {
    padding: 0 0 4px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

.header__lawyer-name {
    padding: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.header__lawyer-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0 10px;
}

.header__lawyer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease-out;
}

.header__lawyer-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Активный юрист (календарь которого открыт) — чуть светлее фона */
.header__lawyer-item.header__lawyer-item--selected,
.header__lawyer-item.header__lawyer-item--selected:hover {
    background: rgba(255, 255, 255, 0.08);
}

.header__lawyer-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    flex-shrink: 0;
}

.header__logout-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}
.header__logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* Основной контент — единственная прокручиваемая область */
.main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.main__content {
    padding: 20px 20px 24px;
    flex: 1;
    min-height: min-content;
}

/* Переключатель вида: Календарь / Список */
.view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: rgb(16, 16, 21);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-toggle__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease-out, color 0.2s ease-out;
}

.view-toggle__btn .view-toggle__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.2s ease-out;
}

.view-toggle__btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.view-toggle__btn:hover .view-toggle__icon {
    color: rgba(255, 255, 255, 0.65);
}

.view-toggle__btn--active {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

.view-toggle__btn--active .view-toggle__icon {
    color: rgba(255, 255, 255, 0.6);
}

/* Режим списка записей */
.list-view {
    padding: 0;
}

.list-view__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.list-view__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.list-view__nav-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.list-view__nav-btn:hover {
    background: transparent;
}

.list-view__nav-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.list-view__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    flex: 1;
    min-width: 0;
}

.list-view__filter {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-view__filter-btn {
    height: 24px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.list-view__filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Выбрано «Все» — та же обводка, что у цветных квадратиков */
.list-view__filter-btn--active {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
    color: #fff;
}

.list-view__filter-btn--active:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Кнопки-квадраты по цвету (синий / красный) */
.list-view__filter-btn--blue {
    width: 24px;
    height: 24px;
    padding: 0;
    background: #0071e3;
    border-color: rgba(255, 255, 255, 0.25);
}

.list-view__filter-btn--blue:hover {
    background: #0077ed;
}

.list-view__filter-btn--blue.list-view__filter-btn--active {
    background: #0071e3;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.list-view__filter-btn--red {
    width: 24px;
    height: 24px;
    padding: 0;
    background: #ea4335;
    border-color: rgba(255, 255, 255, 0.25);
}

.list-view__filter-btn--red:hover {
    background: #f04a3b;
}

.list-view__filter-btn--red.list-view__filter-btn--active {
    background: #ea4335;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.list-view__content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-view__day {
    background: rgb(16, 16, 21);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
}

.list-view__day-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.list-view__slots {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.list-view__slot {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    font-size: 14px;
    color: #fff;
    background: #0071e3;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease-out;
}

.list-view__slot:hover,
.list-view__slot:focus {
    background: #0077ed;
    outline: none;
}

.list-view__slot--court {
    background: #ea4335;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.list-view__slot--court .list-view__slot-primary {
    display: block;
    font-weight: 600;
}

.list-view__slot--court .list-view__slot-detail {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
}

.list-view__slot--court:hover,
.list-view__slot--court:focus {
    background: #f04a3b;
    outline: none;
}

/* Записи и суды прошлых дней в списке — бледнее */
.list-view__day--past .list-view__slot {
    opacity: 0.6;
}

.list-view__day--past .list-view__slot:hover,
.list-view__day--past .list-view__slot:focus {
    opacity: 0.75;
}

.list-view__empty {
    margin: 0;
    padding: 24px 16px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    background: rgb(16, 16, 21);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Календарь */
.calendar {
    background: rgb(16, 16, 21);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 16px 20px;
}

.calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar__nav-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.calendar__nav-btn:hover {
    background: transparent;
}

.calendar__nav-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.calendar__month {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 10px;
}

.calendar__weekday {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 6px 0;
}

.calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar__day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
    border: 0;
    border-radius: 10px;
    padding: 4px;
    transition: background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out;
}

.calendar__day-num {
    line-height: 1;
}

/* Ряд кружков-слотов под числом: синий = свободный, зелёный = занятый */
.calendar__day-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px;
    max-width: 100%;
}

.calendar__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar__dot--free {
    background: rgba(255, 255, 255, 0.35);
}

.calendar__dot--busy {
    background: #0071e3;
}

.calendar__dot--court {
    background: #ea4335;
}

/* В прошлых днях точки записей/судов — бледнее */
.calendar__day--past .calendar__dot--free,
.calendar__day--past .calendar__dot--busy,
.calendar__day--past .calendar__dot--court {
    opacity: 0.55;
}

/* Выходные — бледно-красные неактивные блоки, слотов не показываем */
.calendar__day--weekend {
    background: rgba(234, 67, 53, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

.calendar__day--empty {
    background: transparent;
    color: transparent;
    pointer-events: none;
}

/* Прошедшие даты — бледный вид, но кликабельны */
.calendar__day--past {
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.03);
}

/* Прошедший день, но выходной — как все выходные, красный */
.calendar__day--past.calendar__day--weekend {
    background: rgba(234, 67, 53, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

/* Текущий день — обводка 1px */
.calendar__day--today {
    background: transparent;
    border: 1px solid #8b5cf6;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* Выбранный активный день (клик) — обводка 1px */
.calendar__day--selected {
    background: rgba(0, 113, 227, 0.15);
    border: 1px solid #0071e3;
    font-weight: 600;
}

.calendar__day--selected.calendar__day--today {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid #8b5cf6;
}

/* Все непустые ячейки кликабельны (включая прошедшие) */
.calendar__day:not(.calendar__day--empty) {
    cursor: pointer;
}

.calendar__day:not(.calendar__day--empty):not(.calendar__day--selected):not(.calendar__day--past):active {
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

.calendar__day:not(.calendar__day--empty):not(.calendar__day--selected).calendar__day--past:active {
    background: rgba(255, 255, 255, 0.06);
    border: none;
}

@media (hover: hover) {
    .calendar__day:not(.calendar__day--empty):not(.calendar__day--selected):not(.calendar__day--past):hover {
        background: rgba(255, 255, 255, 0.08);
        border: none;
    }
    .calendar__day:not(.calendar__day--empty):not(.calendar__day--selected).calendar__day--past:hover {
        background: rgba(255, 255, 255, 0.05);
        border: none;
    }
}

/* Блок слотов на выбранный день — сетка по часам (8:00–21:00), как в Google Calendar */
.day-slots {
    margin-top: 20px;
    padding: 18px 16px 20px;
    background: rgb(16, 16, 21);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

/* Режим только просмотр (прошлая дата/месяц): без кнопок, перетаскивание отключено; записи и суды бледнее */
.day-slots--readonly .day-slots__add,
.day-slots--readonly .day-slots__delete,
.day-slots--readonly .day-slots__add-court {
    display: none;
}

.day-slots--readonly .day-slots__block--busy,
.day-slots--readonly .day-slots__block--court,
.day-slots--readonly .day-slots__block--court-overlay {
    opacity: 0.6;
}

.day-slots__title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.day-slots__empty {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Сетка дня: время слева, блок справа. При .day-slots__list--grid — грид для объединённых блоков суда. */
.day-slots__list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: 12px;
    overflow: hidden;
}

.day-slots__list--grid {
    position: relative;
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: repeat(14, 44px);
    row-gap: 1px;
    column-gap: 0;
}

.day-slots__overlay {
    position: absolute;
    top: 0;
    left: 52px;
    right: 0;
    bottom: 0;
    pointer-events: none;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    z-index: 2;
}

.day-slots__overlay .day-slots__block--court-overlay {
    position: absolute;
    left: 0;
    right: 0;
    box-sizing: border-box;
    pointer-events: auto;
    border-radius: 10px;
    align-items: flex-start;
    padding-top: 8px;
    overflow: hidden;
    min-height: 0;
    background: linear-gradient(180deg, #ed4d3d 0%, #d93a2b 100%);
}

.day-slots__list--grid .day-slots__time {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px 0 0;
}

.day-slots__list--grid .day-slots__time:first-child {
    border-top: none;
}

/* Полоска текущего времени (только для выбранного сегодня) */
.day-slots__now-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: #ea4335;
    z-index: 4;
    pointer-events: none;
    display: none;
    box-shadow: 0 2px 10px 2px rgba(0, 0, 0, 0.18), 0 4px 20px 4px rgba(0, 0, 0, 0.12);
}

.day-slots__now-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ea4335;
    box-shadow: 0 3px 12px 2px rgba(0, 0, 0, 0.2), 0 6px 24px 4px rgba(0, 0, 0, 0.14);
}

.day-slots__hour {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: stretch;
    gap: 0;
    min-height: 44px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.day-slots__hour:first-child {
    border-top: none;
}

.day-slots__time {
    display: flex;
    align-items: flex-start;
    padding: 4px 10px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

.day-slots__block {
    min-height: 44px;
    background: transparent;
    border-radius: 10px;
}

.day-slots__block--placeholder {
    min-height: 44px;
    background: transparent;
    border-radius: 0;
}

.day-slots__list--grid .day-slots__block:not(:nth-child(2)) {
    position: relative;
}

.day-slots__list--grid .day-slots__block:not(:nth-child(2))::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.day-slots__list--grid .day-slots__block--court-span {
    align-items: flex-start;
    padding-top: 8px;
}

.day-slots__list--grid .day-slots__block--court-span::before {
    display: none;
}

.day-slots__block--empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
}

.day-slots__block--court-dragging {
    touch-action: none;
}

.day-slots__add-court {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    touch-action: none;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s ease-out, color 0.2s ease-out;
}

.day-slots__add-court:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.day-slots__add {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s ease-out, color 0.2s ease-out;
}

.day-slots__add:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.day-slots__add-slot {
    width: auto;
    height: auto;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
}

.day-slots__block--free {
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

.day-slots__free-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.day-slots__delete {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s ease-out, color 0.2s ease-out;
}

.day-slots__delete:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.day-slots__block--busy {
    background: linear-gradient(180deg, #0078eb 0%, #0066cc 100%);
    display: flex;
    align-items: center;
    padding: 0 10px;
    cursor: grab;
    transition: opacity 0.2s ease-out;
}

.day-slots__block--busy:active {
    opacity: 0.9;
}

.day-slots__client {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.day-slots__block--court {
    background: #ea4335;
    display: flex;
    align-items: flex-start;
    padding: 8px 10px 0;
    cursor: pointer;
    transition: opacity 0.2s ease-out;
    overflow: hidden;
}

.day-slots__block--court:active {
    opacity: 0.9;
}

.day-slots__court-label {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    min-height: 0;
}

/* Черновик диапазона при долгом нажатии «+ суд» и перетаскивании */
.day-slots__draft-container {
    position: absolute;
    top: 0;
    left: 52px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.day-slots__court-draft-block {
    position: absolute;
    left: 0;
    right: 0;
    border-radius: 10px;
    background: rgba(234, 67, 53, 0.5);
    box-sizing: border-box;
}

.day-slots__block.day-slots__drop-target {
    outline: 2px dashed rgba(0, 113, 227, 0.8);
    outline-offset: 2px;
    background: rgba(0, 113, 227, 0.12);
}

/* Один общий пунктирный блок при перетаскивании суда (высота = блоку суда) */
.day-slots__drop-preview.day-slots__drop-preview--court {
    border-radius: 10px;
    outline: 2px dashed rgba(234, 67, 53, 0.9);
    outline-offset: 2px;
    background: rgba(234, 67, 53, 0.12);
    box-sizing: border-box;
}

/* Перетаскивание занятых слотов: призрак и зона сброса */
body.day-slots-dragging {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* Иначе на мобильных вертикальное движение забирает скролл .main и сбрасывает перетаскивание */
body.day-slots-dragging .main {
    touch-action: none;
    -webkit-touch-callout: none;
    overflow: hidden;
}

.day-slots__ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    pointer-events: none;
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0.95;
    background: #0071e3;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

body.day-slots-dragging .day-slots__block--busy,
body.day-slots-dragging .day-slots__block--court {
    cursor: grabbing;
}

.day-slots__ghost.day-slots__block--court {
    background: linear-gradient(180deg, #ed4d3d 0%, #d93a2b 100%);
    align-items: flex-start;
    padding: 8px 10px 0;
}

/* Карточка записи (при клике на занятый слот) */
.booking-card-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    max-height: 100vh;
    max-height: 100svh;
    padding: 24px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.booking-card {
    width: 100%;
    max-width: 360px;
    margin: auto 0;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 20px 24px 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.booking-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.booking-card__header .booking-card__title {
    margin: 0;
    flex: 1;
}

.booking-card__edit-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.booking-card__edit-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
}

.booking-card__edit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0071e3;
}

.booking-card__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.booking-card__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
}

.booking-card__close:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0071e3;
}

.booking-card__title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.booking-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.booking-card__body--scroll {
    /* Высота не ограничена — прокрутка общая (бэкдроп), без внутреннего скролла модалки */
}

/* Не менее 16px в модалке, чтобы на iOS не зумило при фокусе в поле */
.booking-card input,
.booking-card textarea,
.booking-card select {
    font-size: 16px !important;
}

.booking-card__link {
    color: #0071e3;
    text-decoration: none;
}

.booking-card__link:hover {
    text-decoration: underline;
}

.court-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.court-form__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.court-form__section-title {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.4);
}

.court-form__textarea {
    width: 100%;
    min-height: 72px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.9);
    background: rgb(26, 26, 35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-sizing: border-box;
    resize: vertical;
}

.court-form__textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.court-form__textarea:hover,
.court-form__textarea:focus {
    border-color: rgba(255, 255, 255, 0.25);
    outline: none;
}

.court-form__side-hint {
    margin-bottom: 6px;
}

.court-form__toggle {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgb(26, 26, 35);
}

.court-form__toggle-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.court-form__toggle-btn:hover {
    color: rgba(255, 255, 255, 0.85);
}

.court-form__toggle-btn--selected {
    color: #fff;
    background: #0071e3;
}

.court-form__section-title--mt {
    margin-top: 14px;
}

.court-form__option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.court-form__option-btn {
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.7);
    background: rgb(26, 26, 35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.court-form__option-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.court-form__option-btn--selected {
    color: #fff;
    background: #0071e3;
    border-color: #0071e3;
}

.booking-card__row {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.booking-card__label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

.booking-card__value {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.cancel-confirm__text,
.move-booking-modal .booking-card__body > .cancel-confirm__text {
    margin: 0 0 16px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.45;
}

.move-booking-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.move-booking-form__label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.move-booking-form__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.move-booking-form__row .move-booking-form__input {
    flex: 1;
    min-width: 0;
}

.move-booking-form__row--time .move-booking-form__input--min {
    flex: 0 0 auto;
    width: 72px;
}

.move-booking-form__row select.move-booking-form__input {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.move-booking-form__sep {
    color: rgba(255, 255, 255, 0.45);
    font-size: 14px;
    flex-shrink: 0;
}

.move-booking-form__select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.9);
    background: rgb(26, 26, 35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.move-booking-form__select:hover,
.move-booking-form__select:focus {
    border-color: rgba(255, 255, 255, 0.25);
    outline: none;
}

.move-booking-form__input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.9);
    background: rgb(26, 26, 35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-sizing: border-box;
}

.move-booking-form__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.move-booking-form__input:hover,
.move-booking-form__input:focus {
    border-color: rgba(255, 255, 255, 0.25);
    outline: none;
}

/* Поле даты — такой же размер, как остальные поля формы */
.move-booking-form__input[type="date"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 44px;
}

.booking-card__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.booking-card__btn {
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease-out;
    border: none;
}

.booking-card__btn--secondary {
    background: rgb(16, 16, 21);
    color: rgba(255, 255, 255, 0.9);
}

.booking-card__btn--secondary:hover {
    background: rgb(26, 26, 35);
}

.booking-card__btn--danger {
    background: #ea4335;
    color: #fff;
}

.booking-card__btn--danger:hover {
    background: #f04a3b;
}

.booking-card__btn--primary {
    background: #0071e3;
    color: #fff;
}

.booking-card__btn--primary:hover {
    background: #0077ed;
}

/* Уведомление при конфликте слотов суда с записью клиента */
.day-slots__toast {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 24px;
    z-index: 150;
    width: calc(100% - 24px);
    padding: 12px 20px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: day-slots__toast-in 0.2s ease-out;
}

.day-slots__toast--error {
    background: #ea4335;
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

@keyframes day-slots__toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
