@import url('slots.css');
@import url('components/navigation-component.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

*:active,
*:focus {
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    position: relative;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    padding: 0;
    padding-top: 0;
    padding-bottom: max(56px, calc(56px + env(safe-area-inset-bottom)));
    margin: 0;
    min-height: 100vh;
    height: 100vh;
    position: relative;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: padding-top 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

body::-webkit-scrollbar {
    display: none;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.organizer-calendar-page.container {
    max-width: none;
    padding: 0;
    margin: 0;
    height: 100%;
}

/* Кнопка открытия меню - скрыта, используется нижняя панель */
.menu-toggle {
    display: none;
}

/* Левое выезжающее меню - скрыто */
.sidebar {
    display: none;
}

.sidebar.active {
    pointer-events: auto;
}

.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar.active .sidebar-overlay {
    opacity: 1;
}

.sidebar-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85%;
    height: 100%;
    background: var(--tg-theme-bg-color, #ffffff);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.active .sidebar-content {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #cccccc);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--tg-theme-text-color, #000000);
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-close:active {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--tg-theme-text-color, #000000);
    font-size: 16px;
}

.sidebar-item:hover,
.sidebar-item:active {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
}

.sidebar-item.active {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.sidebar-item .icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.sidebar-item .text {
    flex: 1;
}

/* Виджеты */
.widget-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.widget-card {
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin: 0 0 12px 0;
}

.widget-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-event-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.widget-event-item-organizer {
    border: 2px solid var(--tg-theme-button-color, #3390ec);
}

.widget-event-item-participant {
    border: 2px solid #4caf50;
}


.widget-event-item-organizer:hover,
.widget-event-item-organizer:active {
    background: var(--tg-theme-hint-color, #e0e0e0);
    border-color: var(--tg-theme-button-color, #3390ec);
}

.widget-event-item-participant:hover,
.widget-event-item-participant:active {
    background: var(--tg-theme-hint-color, #e0e0e0);
    border-color: #4caf50;
}

.widget-event-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.widget-event-title .event-text-wrapper {
    width: 100%;
    position: relative;
}

.widget-event-title .event-text-collapsed {
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    max-height: 1.6em;
}

.widget-event-title .event-text-collapsed p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.6;
    white-space: pre-wrap;
    overflow: hidden;
    display: block;
}

.widget-role-badge {
    font-size: 12px;
    flex-shrink: 0;
}

.widget-event-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
}

.widget-event-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.widget-view-all-btn {
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.widget-view-all-btn:hover,
.widget-view-all-btn:active {
    background: var(--tg-theme-button-color, #2a7fd4);
    opacity: 0.9;
}

/* Меню с секциями */
.menu {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #999999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    min-width: 0;
    /* Позволяет flex-элементам сжиматься */
}

.menu-section-title-text {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Информация о пользователе в меню */
.user-info-in-menu {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.user-info-in-menu-content {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    transition: all 0.2s ease;
}

.user-info-in-menu-content:hover {
    background: var(--tg-theme-secondary-bg-color, #e8e8e8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-info-in-menu-content:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-info-in-menu-content .user-info-name {
    line-height: 1;
    white-space: nowrap;
}

/* Название профиля организатора */
.organizer-profile-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    margin-left: auto;
    white-space: nowrap;
    padding: 4px 10px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.organizer-profile-name:hover {
    background: var(--tg-theme-secondary-bg-color, #e8e8e8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.organizer-profile-name:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .user-info-in-menu-content {
        padding: 3px 8px;
        font-size: 12px;
    }

    .user-info-in-menu-content .user-info-name {
        /* Имя пользователя показывается полностью */
    }

    .organizer-profile-name {
        font-size: 12px;
        padding: 3px 8px;
    }
}

/* Стили для модального окна авторизации Telegram */
.telegram-auth-modal-content {
    max-width: 420px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.telegram-auth-modal-header {
    background: linear-gradient(135deg, var(--tg-theme-button-color, #3390ec) 0%, #2a7fd4 100%);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-bottom: none;
    padding: 24px 20px;
}

.telegram-auth-modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.telegram-auth-modal-icon {
    display: none;
}

.telegram-auth-modal-icon svg {
    display: none;
}

.telegram-auth-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff !important;
    line-height: 1.3;
}

.telegram-auth-modal-close {
    color: #ffffff !important;
    opacity: 0.9;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.telegram-auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.telegram-auth-modal-close:active {
    background: rgba(255, 255, 255, 0.3);
}

.telegram-auth-modal-body {
    padding: 28px 24px;
    text-align: left;
}

.telegram-auth-benefits {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.telegram-auth-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 12px;
    transition: background 0.2s ease;
}

.telegram-auth-benefit-item:hover {
    background: var(--tg-theme-secondary-bg-color, #f0f1f2);
}

.telegram-auth-benefit-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.telegram-auth-benefit-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.telegram-auth-benefit-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.3;
}

.telegram-auth-benefit-desc {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #666666);
    line-height: 1.4;
}

.telegram-auth-widget-container {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

/* Вкладки в модальном окне авторизации */
.telegram-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.telegram-auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
    font-weight: 500;
}

.telegram-auth-tab:hover {
    color: var(--tg-theme-text-color, #000000);
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.telegram-auth-tab.active {
    color: var(--tg-theme-button-color, #3390ec);
    border-bottom-color: var(--tg-theme-button-color, #3390ec);
    font-weight: 600;
}

.telegram-auth-tab .tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.telegram-auth-tab .tab-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.telegram-auth-tab .tab-text {
    line-height: 1;
}

/* Контент вкладок */
.telegram-auth-tab-content {
    display: none;
}

.telegram-auth-tab-content.active {
    display: block;
}

/* Форма регистрации в модальном окне */
.telegram-auth-registration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.telegram-auth-registration-form .form-group {
    margin: 0;
}

.telegram-auth-registration-form .form-input {
    width: 100%;
    box-sizing: border-box;
}

.telegram-auth-registration-form .checkbox-label {
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-text-color, #000000);
}

.telegram-auth-registration-form .checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

@media (max-width: 768px) {
    .telegram-auth-tabs {
        margin-bottom: 20px;
    }

    .telegram-auth-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .telegram-auth-tab .tab-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 768px) {
    .telegram-auth-modal-content {
        max-width: 95%;
        border-radius: 16px;
    }

    .telegram-auth-modal-header {
        padding: 20px 16px;
    }

    .telegram-auth-modal-title {
        font-size: 18px;
    }

    .telegram-auth-modal-icon {
        width: 28px;
        height: 28px;
    }

    .telegram-auth-modal-icon svg {
        width: 18px;
        height: 18px;
    }

    .telegram-auth-modal-body {
        padding: 24px 20px;
    }

    .telegram-auth-benefits {
        gap: 12px;
        margin-bottom: 24px;
    }

    .telegram-auth-benefit-item {
        padding: 10px;
        gap: 12px;
    }

    .telegram-auth-benefit-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .telegram-auth-benefit-title {
        font-size: 14px;
    }

    .telegram-auth-benefit-desc {
        font-size: 12px;
    }
}

.menu-section-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.menu-item:active {
    opacity: 0.8;
}

.menu-item .icon {
    font-size: 24px;
    margin-right: 12px;
    width: 32px;
    text-align: center;
}

.menu-item .text {
    flex: 1;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.widget-section {
    padding-top: 20px;
    border-top: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
}

.required {
    color: #ff3333;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
}

.form-group select {
    padding-right: 48px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px 20px;
    cursor: pointer;
}

.reschedule-time-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reschedule-time-inputs input[type="date"],
.reschedule-time-inputs input[type="time"] {
    flex: 1;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--tg-theme-link-color, #3390ec);
}

.form-group textarea {
    resize: vertical;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    margin-top: 2px;
    margin-bottom: -12px;
}

.char-counter span {
    font-weight: 500;
}

.form-group small,
.form-hint,
.field-hint {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

.form-group {
    position: relative;
}

/* Объединенные предложения для категорий и типов активности */
.unified-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

/* Показываем выпадающий список только когда он не пустой */
.unified-suggestions:not(:empty) {
    display: block;
}

.unified-suggestions .suggestions-section {
    padding: 12px;
}

.unified-suggestions .section-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #999999);
    text-transform: uppercase;
    margin-bottom: 8px;
    padding: 4px 0;
}

.unified-suggestions .categories-list,
.unified-suggestions .activity-types-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.unified-suggestions .search-container {
    margin-bottom: 12px;
}

.unified-suggestions .search-container input {
    pointer-events: auto !important;
    cursor: text !important;
    z-index: 1001;
    position: relative;
}

.unified-suggestions .step-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tg-theme-hint-color, #eeeeee);
}

.suggestion-item {
    padding: 12px;
    text-align: center;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 13px;
}

/* Кнопки этапов */
.step-button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.step-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.unified-suggestions .category-option,
.unified-suggestions .activity-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.unified-suggestions .category-option:hover,
.unified-suggestions .activity-option:hover {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.unified-suggestions .category-option.selected,
.unified-suggestions .activity-option.selected {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.unified-suggestions .category-option input[type="checkbox"],
.unified-suggestions .activity-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.unified-suggestions .category-option span,
.unified-suggestions .activity-option span {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.unified-suggestions .activity-option span small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Контейнер для поля ввода с тегами */
.tags-input-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 8px;
    cursor: pointer;
}

.tags-input-container:focus-within {
    border-color: var(--tg-theme-button-color, #3390ec);
    outline: none;
}

.tags-input-container input {
    flex: 1;
    min-width: 120px;
    width: 0;
    height: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    padding: 0;
    margin: 0;
    caret-color: transparent;
    cursor: pointer;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.tags-input-container input::placeholder {
    color: var(--tg-theme-hint-color, #999999);
}

/* Теги внутри поля ввода */
.selected-tags-in-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    width: 100%;
    min-height: 0;
}

/* Когда нет тегов, показываем placeholder через псевдоэлемент */
.tags-input-container::after {
    content: attr(data-placeholder);
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
    pointer-events: none;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.tags-input-container.show-placeholder::after {
    opacity: 1;
}

.tag-in-input {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tag-in-input:hover {
    opacity: 0.8;
}

.tag-in-input .tag-remove {
    margin-left: 6px;
    font-weight: bold;
    cursor: pointer;
}

.tag-in-input.category-tag {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    color: var(--tg-theme-text-color, #000000);
}

.tag-in-input.activity-tag {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

/* Выбранные элементы (старый стиль, оставляем для совместимости) */
.selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.selected-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.selected-item:hover {
    background: var(--tg-theme-hint-color, #e0e0e0);
}

.selected-item.category-item {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.selected-item.activity-item {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    color: var(--tg-theme-text-color, #000000);
}

.address-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.address-suggestions:not(:empty) {
    display: block;
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color, #f1f1f1);
    transition: background 0.2s;
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:active {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
}

.suggestion-item strong {
    display: block;
    margin-bottom: 4px;
}

.suggestion-item small {
    color: var(--tg-theme-hint-color, #999999);
    font-size: 12px;
}

.map-container {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    margin-bottom: 10px;
    margin-top: 10px;
}

.map-container .leaflet-container {
    height: 100%;
    width: 100%;
}

/* Скрыть attribution Leaflet */
.leaflet-control-attribution {
    display: none !important;
}

/* Кнопки управления на карте */
.map-control-btn {
    position: absolute;
    z-index: 1000;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    font-size: 18px;
}

.map-control-btn:hover {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-color: var(--tg-theme-button-color, #3390ec);
}

.map-control-btn:active {
    opacity: 0.8;
}

.map-btn-clear {
    top: 10px;
    right: 10px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.map-btn-clear:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
}

.map-btn-location {
    bottom: 10px;
    right: 10px;
}

.location-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.location-inputs input {
    flex: 1;
}

.location-inputs input[readonly] {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    cursor: default;
}

.location-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.location-buttons .btn-secondary {
    flex: 1;
    min-width: 140px;
}

.location-control-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 0;
}

.btn-location-compact {
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    white-space: nowrap;
    gap: 6px;
}

.btn-location-compact:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.btn-location-compact:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.btn-primary,
.btn-secondary {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.btn-primary:active {
    opacity: 0.8;
}

.btn-secondary {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    color: var(--tg-theme-text-color, #000000);
}

.btn-secondary:active {
    opacity: 0.8;
}

.btn-remove {
    background: #ff3333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}

.btn-remove:active {
    opacity: 0.8;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--tg-theme-hint-color, #999999);
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Стили для страницы поиска мероприятий */
.view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--tg-theme-text-color, #000000);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.toggle-btn:active {
    opacity: 0.8;
}

/* Панель фильтров */
.filters-panel {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.filters-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.filters-count {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: none;
}

.filters-content {
    padding: 16px;
    border-top: 1px solid var(--tg-theme-hint-color, #cccccc);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.filter-group input[type="text"],
.filter-group input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 6px;
    font-size: 14px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
}

/* Обертка для поля ввода с suggestions */
.activity-type-input-wrapper {
    position: relative;
    width: 100%;
}

/* Контейнер для тегов и поля поиска типов активности */
.activity-types-tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.activity-type-input-wrapper:focus-within .activity-types-tags-container {
    border-color: var(--tg-theme-button-color, #3390ec);
    outline: none;
}

.activity-type-search-input {
    flex: 1;
    min-width: 150px;
    width: 0;
    /* Позволяет flex правильно работать */
    border: none !important;
    outline: none;
    background: transparent;
    font-size: 14px;
    padding: 0;
    margin: 0;
    color: var(--tg-theme-text-color, #000000);
    box-shadow: none;
    line-height: 1.2;
    height: 24px;
    padding: 0 !important;
}

.activity-type-search-input:focus {
    border: none !important;
    outline: none;
}

.activity-type-search-input::placeholder {
    color: var(--tg-theme-hint-color, #999999);
}

.activity-types-tags-container .selected-tags-in-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    width: auto;
    min-height: 0;
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.filter-actions .btn-secondary {
    flex: 1;
}

/* Фильтр категорий */
.categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 2px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 20px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-chip:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
}

.category-chip.selected {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.category-icon {
    font-size: 16px;
    line-height: 1;
}

.category-name {
    font-weight: 500;
}

/* Выбранные элементы (типы активности) */
.selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.selected-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.selected-item-name {
    line-height: 1;
}

.selected-item-remove {
    background: none;
    border: none;
    color: var(--tg-theme-button-text-color, #ffffff);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.selected-item-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Календарь в фильтрах */
.filter-group calendar-component {
    margin-top: 8px;
}


/* Контейнеры режимов просмотра */
.view-container {
    min-height: 400px;
}

.map-container-large {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
}

.map-container-large .leaflet-container {
    height: 100%;
    width: 100%;
}

.map-loading-placeholder {
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-hint-color, #666666);
    background: var(--tg-theme-bg-color, #f5f5f5);
    border-radius: 8px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
}

/* Панель управления на странице "Мои мероприятия" */

.nearest-slot-info {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #666666);
    margin-top: 4px;
    font-weight: 400;
}

/* Список мероприятий */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.events-section-divider {
    margin-top: 24px;
    margin-bottom: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.events-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin: 0;
    padding: 0;
}

.event-card {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.event-card-organizer {
    border: 2px solid var(--tg-theme-button-color, #3390ec);
}

.event-card-participant {
    border: 2px solid #4caf50;
}

.event-card:hover,
.event-card:active {
    background: var(--tg-theme-bg-color, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-card-organizer:hover,
.event-card-organizer:active {
    border-color: var(--tg-theme-button-color, #3390ec);
}

.event-card-participant:hover,
.event-card-participant:active {
    border-color: #4caf50;
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.event-header-content {
    flex: 1;
    cursor: pointer;
}

.event-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin: 0;
    flex: 1;
}

.event-text-wrapper {
    position: relative;
    width: 100%;
}

.event-text-collapsed {
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    max-height: 1.6em;
}

.event-text-collapsed .event-text {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.6;
    max-height: 1.6em;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    display: block;
    font-family: inherit;
}

.event-text-collapsed .event-location {
    display: none;
}

.expand-event-btn {
    background: none;
    border: none;
    color: var(--tg-theme-button-color, #3390ec);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    text-decoration: underline;
    transition: opacity 0.2s;
    width: 100%;
    text-align: left;
}

.expand-event-btn:hover {
    opacity: 0.7;
}

.expand-event-btn:active {
    opacity: 0.5;
}

.event-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-text {
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
    margin: 0;
    line-height: 1.4;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
}

.event-role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.event-role-badge.organizer {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.event-role-badge.participant {
    background: var(--tg-theme-hint-color, #999999);
    color: var(--tg-theme-bg-color, #ffffff);
    opacity: 0.8;
}


.event-slots-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    min-height: 40px;
}


.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 16px;
}

/* Стили для закрепленного календаря при скролле */
calendar-component.calendar-sticky {
    position: relative;
}

/* В sticky режиме только контейнер дат закрепляется */
calendar-component.calendar-sticky .dates-scroll-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--tg-theme-bg-color, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding-top: 8px;
    padding-bottom: 8px;
    margin-top: 0;
    transition: box-shadow 0.2s ease;
}

/* Страница просмотра события */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.event-details {
    margin-bottom: 32px;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.event-text-wrapper-view {
    flex: 1;
    min-width: 0;
    position: relative;
}

.event-text {
    font-size: 16px;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    width: 100%;
}

.event-text-collapsed-view {
    max-height: 200px;
    overflow: hidden;
}

.event-text-expanded-view {
    max-height: none;
    overflow: visible;
}

.expand-event-text-btn {
    background: none;
    border: none;
    color: var(--tg-theme-button-color, #3390ec);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
    text-decoration: underline;
    transition: opacity 0.2s;
    width: 100%;
    text-align: left;
}

.expand-event-text-btn:hover {
    opacity: 0.7;
}

.expand-event-text-btn:active {
    opacity: 0.5;
}

.event-header-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    flex-shrink: 0;
    width: auto;
}

.event-common-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.event-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    flex-shrink: 0;
}

.action-btn {
    background: none;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: var(--tg-theme-text-color, #000000);
}

.action-btn:hover {
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.action-btn:active {
    opacity: 0.8;
}

.action-btn.subscribed {
    color: var(--tg-theme-button-color, #3390ec);
}

.action-btn.subscribed:hover {
    background: rgba(51, 144, 236, 0.1);
}

.event-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 12px;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.location-link {
    color: var(--tg-theme-link-color, #3390ec);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.location-link:hover,
.location-link:active {
    opacity: 0.8;
    text-decoration: underline;
}

.info-item {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.organizer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.organizer-label {
    color: var(--tg-theme-hint-color, #999999);
    font-weight: 400;
}

.organizer-link {
    color: var(--tg-theme-link-color, #3390ec);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.organizer-link:hover,
.organizer-link:active {
    opacity: 0.8;
    text-decoration: underline;
}

.info-label {
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    color: var(--tg-theme-text-color, #000000);
    border-radius: 16px;
    font-size: 13px;
    white-space: nowrap;
    margin-right: 6px;
}

.activity-type-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-radius: 16px;
    font-size: 13px;
    white-space: nowrap;
    margin-right: 6px;
}

.event-image {
    margin-top: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.event-image img {
    width: 100%;
    height: auto;
    display: block;
}

.registration-section {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.registration-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.registration-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-register {
    padding: 12px 20px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-register:active {
    opacity: 0.9;
}

.btn-registered {
    padding: 12px 20px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    color: var(--tg-theme-text-color, #000000);
    border: 2px solid var(--tg-theme-button-color, #3390ec);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-registered:active {
    opacity: 0.9;
}

.registration-status {
    margin-top: 12px;
}

.status-text {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    text-align: center;
    padding: 8px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 6px;
}

.organizer-section {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.organizer-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.organizer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.participants-section {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.participants-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.participants-section h4 {
    font-size: 16px;
    font-weight: 500;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--tg-theme-text-color, #000000);
}

.calendar-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 0;
    color: var(--tg-theme-text-color, #000000);
}

/* Компактный календарь */
.compact-calendar-container {
    margin-bottom: 20px;
}

/* Плейсхолдер для отсутствующих доступных слотов */
.no-available-slots-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--tg-theme-hint-color, #999999);
}

.no-slots-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-slots-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 8px;
}

.no-slots-description {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    line-height: 1.4;
}

.compact-dates-list {
    display: flex;
    gap: 6px;
    padding: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compact-date-item {
    position: relative;
    flex: 0 0 calc((100% - 36px) / 7);
    padding: 6px 4px;
    border: 1px solid var(--tg-theme-hint-color, #999999);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--tg-theme-bg-color, #ffffff);
    box-sizing: border-box;
}

.compact-date-item:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.compact-date-item.today .date-number {
    color: var(--tg-theme-button-color, #3390ec);
    font-weight: 600;
}

.compact-date-item.today.selected .date-number {
    color: var(--tg-theme-button-text-color, #ffffff);
}

.compact-date-item.weekend .date-number {
    color: #e74c3c;
}

.compact-date-item.weekend .date-weekday {
    color: #e74c3c;
}

.compact-date-item .date-slot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.compact-date-item .date-month {
    font-size: 8px;
    opacity: 0.7;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.compact-date-item .date-number {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.compact-date-item .date-weekday {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

.compact-date-item.in-range {
    background: rgba(51, 144, 236, 0.15);
    border-color: rgba(51, 144, 236, 0.5);
}

.compact-date-item.range-start {
    border-left-width: 1px;
    border-left-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: inset 2px 0 0 0 var(--tg-theme-button-color, #3390ec);
}

.compact-date-item.range-end {
    border-right-width: 1px;
    border-right-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: inset -2px 0 0 0 var(--tg-theme-button-color, #3390ec);
}

.compact-date-item.range-start.range-end {
    border-left-color: var(--tg-theme-button-color, #3390ec);
    border-right-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: inset 2px 0 0 0 var(--tg-theme-button-color, #3390ec),
        inset -2px 0 0 0 var(--tg-theme-button-color, #3390ec);
}

/* Многодневные слоты */
.multi-day-slots-container {
    margin-bottom: 20px;
}

.multi-day-slots-list {
    list-style: none;
    padding: 0;
    margin: 0;
}


/* Стили для режимов мероприятия */
.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* Компактный переключатель режимов для строки с месяцем */
.mode-selector-compact {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 0;
    background: transparent;
    border-radius: 8px;
    padding: 2px;
}

.mode-selector-compact .mode-option {
    padding: 4px 10px;
    font-size: 0.85em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mode-selector-compact .mode-option input[type="radio"] {
    margin: 0;
    margin-right: 4px;
}

.mode-selector-compact .mode-option:has(input[type="radio"]:checked),
.mode-selector-compact .mode-option.active {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    font-weight: 500;
}

.mode-selector-compact .mode-option:not(:has(input[type="radio"]:checked)):not(.active):hover {
    background: var(--tg-theme-hint-color, #e0e0e0);
    opacity: 0.8;
}

.mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid var(--tg-theme-hint-color, #999999);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.mode-option:has(input:checked) {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.date-mode-fields {
    margin-top: 15px;
}

.date-mode-container {
    margin-top: 10px;
}

.location-mode-fields {
    margin-top: 15px;
}

.location-mode-fields input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

.timezone-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--tg-theme-hint-color, #666666);
    text-align: left;
    line-height: 1.4;
    padding: 0;
}

.btn-small.active {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-color: var(--tg-theme-button-color, #3390ec);
}

/* Миниатюрный select месяца */
/* Кнопки навигации недель */
.week-navigation-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.week-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 3px 6px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 6px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.week-nav-btn:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.week-nav-btn:active {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--tg-theme-text-color, #000000);
}

.week-nav-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Переключатель вида (неделя/месяц) */
.view-switch-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 6px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.view-switch-btn:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.view-switch-btn.active {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-color: var(--tg-theme-button-color, #3390ec);
}

.view-switch-btn:active {
    opacity: 0.8;
}

/* Режим месяца - сетка календаря */
.dates-list.month-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
}

.dates-list.month-view .date-item {
    aspect-ratio: 1;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dates-list.month-view .date-item.other-month {
    opacity: 0.4;
}

.dates-list.month-view .date-item.weekend .date-number,
.date-item.weekend .date-number {
    color: #e74c3c;
}

.date-item.weekend .date-weekday {
    color: #e74c3c;
}

.dates-list.month-view .date-month {
    font-size: 0.7em;
    margin-bottom: 2px;
}

.dates-list.month-view .date-number {
    font-size: 1em;
    font-weight: 500;
}

.dates-list.month-view .date-weekday {
    font-size: 0.65em;
    margin-top: 2px;
}

/* Заголовки дней недели для режима месяца */
.month-view-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.month-view-header-item {
    text-align: center;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #999999);
    padding: 4px 0;
}

/* Миниатюрные кнопки */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-small:hover {
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    border-color: var(--tg-theme-button-color, #3390ec);
}

.btn-small:active {
    opacity: 0.8;
}

/* Стили для модального окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    pointer-events: auto;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active .modal-overlay {
    opacity: 1;
}

.modal-content {
    position: relative;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 12px;
    max-width: 90%;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.slot-modal-content {
    max-width: 90%;
    width: 100%;
    max-width: 600px;
}

/* Компактный заголовок модального окна слота */
#slotModal .slot-modal-header,
#slotModal.slot-modal .modal-header.slot-modal-header {
    padding: 10px 14px 10px 16px;
    align-items: flex-start;
    gap: 12px;
    min-height: 0;
}

#slotModal .slot-modal-header-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#slotModal .slot-modal-header .modal-close {
    flex-shrink: 0;
    margin-top: -2px;
}

#slotModal .slot-modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

/* Строка «Название (комментарий)» — над датами слота, одна строка */
#slotModal .slot-modal-event-name {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #666666);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#registrationModal .modal-content {
    max-width: 750px;
}

/* Модальное окно регистрации - без скролла внутри */
/* Стили перенесены ниже для лучшей организации */

/* Модальное окно шаринга не должно скроллиться */
#shareModal .modal-content {
    overflow: visible;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

#shareModal .modal-body {
    overflow: visible;
    flex: 1;
    min-height: 0;
    position: relative;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Модальное окно снизу (slide-up) */
.modal-bottom {
    align-items: flex-end;
    justify-content: center;
}

.modal-bottom .modal-content {
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 80vh;
    margin: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-bottom.active .modal-content {
    transform: translateY(0);
}

.modal-bottom-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.modal-bottom-content .modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #cccccc);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    text-transform: none;
}

/* Компактные стили для модального окна регистрации */
#registrationModal {
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

#registrationModal:not(.active) {
    opacity: 0;
    pointer-events: none;
}

#registrationModal.active {
    opacity: 1;
    pointer-events: auto;
}

#registrationModal .modal-header {
    padding: 12px 16px;
}

#registrationModal .modal-header h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
    text-transform: none;
}

#registrationModal .modal-body {
    padding: 0;
}

/* Двухколоночный layout */
#registrationModal .registration-layout {
    display: flex;
    flex-direction: row;
    min-height: 0;
    /* Отключаем transition для layout, чтобы избежать дергания при переключении режимов */
    transition: none;
}

#registrationModal .event-info-section {
    flex: 0 0 50%;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    padding: 16px;
    border-right: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    display: flex;
    flex-direction: column;
}

#registrationModal .event-info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#registrationModal .event-info-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

#registrationModal .event-info-description {
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.5;
    margin-top: 8px;
    display: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#registrationModal .event-info-location {
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.5;
    margin-top: 12px;
    display: none;
}

#registrationModal .event-info-location .location-link {
    color: var(--tg-theme-link-color, #3390ec);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#registrationModal .event-info-location .location-link:hover {
    text-decoration: underline;
}

#registrationModal .event-datetime-section {
    margin-bottom: 16px;
}


#registrationModal .event-info-divider {
    height: 1px;
    background: var(--tg-theme-hint-color, #e0e0e0);
    margin: 12px 0;
}

#registrationModal .registration-form-section {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    min-height: 0;
}

#registrationModal .modal-content {
    overflow-y: visible;
    max-height: none;
    max-width: 750px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Фиксируем размеры во время анимации */
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    will-change: opacity, transform;
}

#registrationModal.active .modal-content {
    opacity: 1;
    transform: translateY(0);
}



.modal-body {
    padding: 16px 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tg-theme-hint-color, #999999);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    color: var(--tg-theme-text-color, #000000);
}

.modal-body {
    padding: 16px 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--tg-theme-hint-color, #cccccc);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer .btn-primary {
    width: 100%;
}

/* Для модального окна комментария - кнопки рядом с отступом */
#commentModal .modal-footer {
    justify-content: flex-end;
}

#commentModal .modal-footer .btn {
    width: auto;
    min-width: 100px;
}

.form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #3390ec);
}

/* Кастомный выпадающий список для выбора месяца */
.custom-month-select {
    position: relative;
    display: inline-block;
    width: auto;
    min-width: 150px;
}

.custom-month-select-button {
    width: auto;
    min-width: 150px;
    padding: 6px 12px;
    border: 1px solid var(--tg-theme-hint-color, #cccccc);
    border-radius: 6px;
    font-size: 0.85em;
    font-family: inherit;
    background: transparent;
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    line-height: 1;
}

.custom-month-select-button:hover {
    background: transparent;
    border-color: var(--tg-theme-button-color, #3390ec);
}

.custom-month-select-button.active {
    border-color: var(--tg-theme-button-color, #3390ec);
}

.custom-month-select-text {
    flex: 1;
    text-align: left;
}

.custom-month-select-arrow {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.custom-month-select-button.active .custom-month-select-arrow {
    transform: rotate(180deg);
}

.custom-month-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    margin-top: 4px;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.custom-month-select-option {
    padding: 10px;
    cursor: pointer;
    color: var(--tg-theme-text-color, #000000);
    background: var(--tg-theme-bg-color, #ffffff);
    transition: background-color 0.2s, color 0.2s;
    line-height: 1;
}

.custom-month-select-option:hover {
    background: var(--tg-theme-button-color, #3390ec) !important;
    color: var(--tg-theme-button-text-color, #ffffff) !important;
}

.custom-month-select-option.selected {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    font-weight: 500;
}

/* Стили для скроллбара в темной теме */
body.theme-dark .custom-month-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

body.theme-dark .custom-month-select-dropdown::-webkit-scrollbar-track {
    background: var(--tg-theme-bg-color, #2d2d2d);
}

body.theme-dark .custom-month-select-dropdown::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 4px;
    opacity: 0.3;
}

body.theme-dark .custom-month-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #ffffff;
    opacity: 0.5;
}

/* Для Firefox */
body.theme-dark .custom-month-select-dropdown {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) var(--tg-theme-bg-color, #2d2d2d);
}

/* Стили для инструментов выбора дат */

/* Стили для списка дат */
.dates-scroll-container {
    overflow: hidden;
    margin: 10px 0;
    padding: 5px 0;
    position: relative;
    touch-action: pan-y;
    min-height: fit-content;
}

.dates-list {
    display: flex;
    gap: 6px;
    padding: 3px;
    width: 100%;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.dates-list-old {
    display: flex;
    gap: 6px;
    padding: 3px;
    width: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: flex-start;
    box-sizing: border-box;
}


.date-item {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 6px 4px;
    border: 1px solid var(--tg-theme-hint-color, #999999);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--tg-theme-bg-color, #ffffff);
    box-sizing: border-box;
}

.date-item:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.date-item.selected {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.date-item.in-range {

    border-color: var(--iframe-theme-accent-range-border, rgba(51, 144, 236, 0.5));
}

.date-item.range-start {
    border-left-width: 1px;
    border-left-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: inset 2px 0 0 0 var(--tg-theme-button-color, #3390ec);
}

.date-item.range-end {
    border-right-width: 1px;
    border-right-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: inset -2px 0 0 0 var(--tg-theme-button-color, #3390ec);
}

/* Специальный стиль для одного дня (когда startDate === endDate) */
.date-item.range-start.range-end {
    border-left-color: var(--tg-theme-button-color, #3390ec);
    border-right-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: inset 2px 0 0 0 var(--tg-theme-button-color, #3390ec),
        inset -2px 0 0 0 var(--tg-theme-button-color, #3390ec);
}

.date-item.selected-for-paste {
    background: var(--tg-theme-button-color, #3390ec);
    border-color: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-width: 1px;
}

.date-range-info {
    padding: 10px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 8px;
    margin-top: 15px;
}

.date-month {
    font-size: 8px;
    opacity: 0.7;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.date-number {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.date-weekday {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

.date-item.selected .date-weekday {
    opacity: 1;
}

.date-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.date-item.today .date-number {
    color: var(--tg-theme-button-color, #3390ec);
    font-weight: 600;
}

.date-item.today.selected .date-number {
    color: var(--tg-theme-button-text-color, #ffffff);
}

.date-slot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}



/* Базовые стили для layout расписания */
.schedule-layout {
    display: flex;
    flex-direction: column;
}

/* Мобильный режим (< 768px) */
@media (max-width: 767px) {

    /* События первыми, календарь вторым */
    .schedule-layout .events-section {
        order: 1;
        margin-bottom: 24px;
    }

    .schedule-layout .calendar-section {
        order: 2;
    }

    /* Показываем кнопки прокрутки в мобильной версии */
    .events-section-header {
        display: flex;
    }

    /* Горизонтальный скролл событий в мобильной версии */
    .schedule-layout .events-section .events-list-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        /* Скрываем скроллбар */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE и Edge */
    }

    .schedule-layout .events-section .events-list-wrapper::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .schedule-layout .events-section .events-list {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        gap: 0;
        width: max-content;
    }

    /* Карточки адаптивной ширины для горизонтального скролла */
    .schedule-layout .events-section .event-card {
        flex: 0 0 auto;
        min-width: 140px;
        max-width: 280px;
        width: fit-content;
        margin-bottom: 0;
        margin-right: 16px;
        padding: 10px 12px;
    }

    /* Уменьшаем размеры шрифтов и отступы в карточках для мобильной версии */
    .schedule-layout .events-section .event-card-header {
        margin-bottom: 6px;
        gap: 8px;
    }

    .schedule-layout .events-section .event-text-collapsed .event-text {
        font-size: 14px;
        line-height: 1.4;
    }

    .schedule-layout .events-section .event-card-body {
        gap: 6px;
    }

    .schedule-layout .events-section .event-meta {
        font-size: 11px;
        gap: 8px;
    }

    /* Скрываем слоты в карточках в мобильной версии */
    .schedule-layout .events-section .event-slots-list {
        display: none;
    }

    /* Включаем выбор дат в календаре */
    .calendar-section .date-item {
        cursor: pointer;
        pointer-events: auto;
    }
}

.events-section {
    width: 100%;
    position: relative;
}

.events-section-header {
    display: none;
    /* По умолчанию скрыты для мобильных */
    justify-content: flex-end;
    margin-bottom: 8px;
}

.events-scroll-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.events-list-wrapper {
    position: relative;
    width: 100%;
}

/* Стили для списка событий - переопределяются в медиа-запросе для планшетов */
.events-section .events-list {
    display: flex;
    flex-direction: column;
    /* Вертикальный список по умолчанию (мобильные) */
    gap: 16px;
    overflow-x: visible;
    overflow-y: visible;
}

/* Скрываем скроллбар в Chrome, Safari и Opera */
.events-section .events-list::-webkit-scrollbar {
    display: none;
}

/* Кнопки прокрутки списка событий используют стили week-nav-btn */
.events-scroll-btn-left,
.events-scroll-btn-right {
    flex-shrink: 0;
}

.events-scroll-btn-left:disabled,
.events-scroll-btn-right:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.calendar-section {
    width: 100%;
}

.calendar-section calendar-component {
    width: 100%;
}

/* Режим для планшетов и выше (>= 768px) */
@media (min-width: 768px) {

    /* Меняем порядок: события сверху, календарь внизу */
    .schedule-layout .events-section {
        order: 1;
    }

    .schedule-layout .calendar-section {
        order: 2;
    }

    /* Показываем кнопки прокрутки */
    .events-section-header {
        display: flex;
    }

    /* Горизонтальный скролл событий */
    .events-section .events-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .events-section .event-card {
        flex: 0 0 auto;
        min-width: 140px;
        max-width: 280px;
        width: fit-content;
        padding: 10px 12px;
    }

    /* Уменьшаем размеры шрифтов и отступы в карточках для широкого экрана */
    .events-section .event-card-header {
        margin-bottom: 6px;
        gap: 8px;
    }

    .events-section .event-card-header h3 {
        font-size: 14px;
    }

    .events-section .event-text-collapsed .event-text {
        font-size: 14px;
        line-height: 1.4;
    }

    .events-section .event-card-body {
        gap: 6px;
    }

    .events-section .event-meta {
        font-size: 11px;
        gap: 8px;
    }

    /* Скрываем количество людей в карточках событий на широком экране */
    /* Скрываем все span в event-meta, кроме первого (activityType) */
    .events-section .event-meta span:nth-child(n+2) {
        display: none;
    }

    /* Скрываем слоты в карточках событий */
    .events-section .event-slots-list {
        display: none;
    }

    /* Отключаем выбор дат в календаре (только для виджета расписания) */
    .schedule-layout .calendar-section .date-item {
        cursor: default;
        pointer-events: none;
    }

    .schedule-layout .calendar-section .date-item:hover {
        border-color: var(--tg-theme-hint-color, #999999);
        background: var(--tg-theme-bg-color, #ffffff);
    }

    /* На странице view-event календарь всегда должен быть кликабельным */
    #eventContent .calendar-section .date-item {
        cursor: pointer;
        pointer-events: auto;
    }

    #eventContent .calendar-section .date-item:hover {
        border-color: var(--tg-theme-button-color, #3390ec);
        background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    }
}

/* Широкоэкранный режим для расписания организатора */
@media (min-width: 1024px) {
    .events-section .events-list {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* Стили для диапазонов времени */
.time-ranges-list {
    margin: 15px 0;
    min-height: 50px;
}

.time-range-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    border-radius: 6px;
    font-size: 14px;
}

.time-range-item .max-participants {
    color: var(--tg-theme-hint-color, #999999);
    font-size: 12px;
}

.btn-remove-small {
    background: none;
    border: none;
    color: var(--tg-theme-destructive-text-color, #ff0000);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-remove-small:hover {
    background: rgba(255, 0, 0, 0.15);
}

.btn-edit-small {
    background: none;
    border: none;
    color: var(--tg-theme-button-color, #3390ec);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-edit-small:hover {
    background: rgba(51, 144, 236, 0.15);
}


.no-ranges {
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
    text-align: center;
    padding: 8px 12px;
    margin: 0;
}

.time-range-form {
    margin-top: 15px;
    padding: 15px;
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    border-radius: 8px;
}

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-col {
    flex: 1;
    min-width: 120px;
}

.form-col label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.form-col input {
    width: 100%;
}

/* Стили для слайдеров времени */
.time-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dual-range слайдер */
.time-input-mini {
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 4px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.time-input-mini:focus {
    border-color: var(--tg-theme-button-color, #3390ec);
}

.dual-time-slider-wrapper {
    position: relative;
    width: 100%;
    height: 60px;
    margin-bottom: 4px;
    padding-top: 17px;
    padding-bottom: 20px;
}

.dual-time-slider-wrapper .time-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 17px;
    left: 0;
    background: transparent;
    outline: none;
    border: none;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    z-index: 1;
    margin: 0;
    padding: 0;
    transform: translateY(0);
}

.dual-time-slider-wrapper .time-slider-start {
    z-index: 2;
}

.dual-time-slider-wrapper .time-slider-end {
    z-index: 3;
}

/* Фоновая линия для слайдера */
.dual-time-slider-wrapper::before {
    content: '';
    position: absolute;
    top: 17px;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 3px;
    z-index: 0;
}

/* Активная область между двумя точками */
.dual-time-slider-wrapper::after {
    content: '';
    position: absolute;
    top: 17px;
    left: var(--start-percent, 0%);
    width: var(--width-percent, 0%);
    height: 6px;
    background: var(--tg-theme-button-color, #3390ec);
    border-radius: 3px;
    z-index: 1;
    transition: left 0.1s, width 0.1s;
}

/* Метки времени */
.time-marks {
    position: absolute;
    top: 23px;
    left: 0;
    width: 100%;
    height: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 0;
}

.time-mark {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
}

.time-mark-line {
    width: 1px;
    height: 8px;
    background: var(--tg-theme-hint-color, #999999);
    margin-bottom: 2px;
}

.time-mark-label {
    font-size: 10px;
    color: var(--tg-theme-hint-color, #999999);
    white-space: nowrap;
}

.time-slider {
    height: 6px;
    border-radius: 3px;
    background: transparent;
    outline: none;
    border: none;
    -webkit-appearance: none;
    appearance: none;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tg-theme-button-color, #3390ec);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    position: relative;
    pointer-events: auto;
    margin-top: -7px;
}

.time-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.time-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tg-theme-button-color, #3390ec);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    position: relative;
    pointer-events: auto;
    margin-top: -7px;
}

.time-slider::-moz-range-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.time-slider::-moz-range-track {
    height: 6px;
    background: transparent;
}

/* Tooltip для слайдера */
.slider-tooltip {
    position: absolute;
    top: -40px;
    transform: translateX(-50%);
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-tooltip[style*="display: block"] {
    opacity: 1;
}

.slider-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--tg-theme-button-color, #3390ec);
}

.time-displays {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.time-display {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
    padding: 4px 8px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 4px;
}

.time-separator {
    font-weight: 600;
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
}


/* Стили для переключателя вида отображения */
.view-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    padding: 4px;
    border-radius: 8px;
}

/* Стили для контейнера календаря */
.calendar-events-container {
    margin-top: 20px;
}

.timeline-event-block {
    cursor: pointer;
}

.timeline-event-block:hover {
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Стили для временной шкалы (timeline) */
.timeline-container {
    display: flex;
    margin-top: 20px;
    min-height: 400px;
    position: relative;
}

.timeline-axis {
    width: 60px;
    position: relative;
    border-right: 2px solid var(--tg-theme-hint-color, #999999);
    padding-right: 10px;
    flex-shrink: 0;
}

.timeline-axis-label {
    position: absolute;
    right: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    white-space: nowrap;
}

.timeline-divider {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--tg-theme-hint-color, #e0e0e0);
    opacity: 0.5;
}

.timeline-no-participants {
    background: var(--tg-theme-hint-color, #cccccc) !important;
    color: var(--tg-theme-text-color, #666666) !important;
    opacity: 0.6;
    border-color: var(--tg-theme-hint-color, #cccccc) !important;
}

.timeline-no-participants:hover {
    opacity: 0.8;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 600px) {
    .timeline-container {
        min-height: 300px;
    }

    .timeline-axis {
        width: 50px;
    }
}

/* На страницах без меню убираем отступ через класс */
body.no-bottom-nav {
    padding-bottom: 0;
    height: 100vh;
}


/* Меню фильтра событий */
.events-filter-menu {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    flex-shrink: 0;
    background: var(--tg-theme-bg-color, #ffffff);
    height: 100%;
}

.events-filter-menu.active {
    width: 280px;
}

/* На мобильных устройствах меню показывается поверх контента */
@media (max-width: 1023px) {
    .events-filter-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
        background: transparent;
        border-right: none;
    }

    .events-filter-menu.active {
        pointer-events: auto;
        opacity: 1;
        width: 100%;
    }

    .events-filter-overlay {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 0;
    }

    .events-filter-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85%;
        height: 100%;
        background: var(--tg-theme-bg-color, #ffffff);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        z-index: 1;
    }

    .events-filter-menu.active .events-filter-content {
        transform: translateX(0);
    }
}

/* На широких экранах скрываем overlay */
@media (min-width: 1024px) {
    .events-filter-overlay {
        display: none;
    }
}

/* На широких экранах показываем меню по умолчанию */
@media (min-width: 1024px) {
    .events-filter-menu {
        width: 280px;
    }

    .events-filter-menu.closed {
        width: 0 !important;
    }
}

.events-filter-content {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.events-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    flex-shrink: 0;
    min-height: 53px;
}

.events-filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
}

.events-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.events-filter-close:hover {
    background: var(--tg-theme-hint-color, #e0e0e0);
}

.events-filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.events-filter-footer {
    flex-shrink: 0;
    padding: 12px;
    background: var(--tg-theme-bg-color, #ffffff);
}

.events-filter-add-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    color: var(--tg-theme-button-color, #3390ec);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.events-filter-add-btn:hover {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
}

.events-filter-add-btn:active {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    opacity: 0.8;
}

.events-filter-add-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.events-filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s;
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.events-filter-item:active {
    -webkit-tap-highlight-color: transparent !important;
    background: var(--tg-theme-bg-color, #ffffff) !important;
    background-color: var(--tg-theme-bg-color, #ffffff) !important;
}

.events-filter-toggle-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-hint-color, #999999);
    transition: all 0.2s;
    opacity: 0.5;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.events-filter-toggle-btn.checked {
    color: var(--tg-theme-button-color, #3390ec);
    opacity: 1;
}

.events-filter-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.events-filter-toggle-btn:active {
    transform: scale(0.95);
    -webkit-tap-highlight-color: transparent !important;
    background: transparent !important;
    background-color: transparent !important;
}

.events-filter-toggle-btn:focus {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.events-filter-toggle-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.events-filter-toggle-btn svg line {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.events-filter-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.events-filter-item-text {
    flex: 1;
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
    word-wrap: break-word;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.events-filter-empty {
    padding: 24px;
    text-align: center;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
}

.events-filter-section-divider {
    margin-top: 16px;
    margin-bottom: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.events-filter-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #999999);
    margin: 0 0 8px 0;
    padding: 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.events-filter-color-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.2s;
}

.events-filter-color-btn:hover {
    transform: scale(1.1);
}

.events-filter-color-btn:active {
    transform: scale(0.95);
}

.events-filter-view-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-hint-color, #999999);
    transition: all 0.2s;
    opacity: 0.7;
}

.events-filter-view-btn:hover {
    color: var(--tg-theme-button-color, #3390ec);
    opacity: 1;
    transform: scale(1.1);
}

.events-filter-view-btn:active {
    transform: scale(0.95);
}

.events-filter-view-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.events-filter-color-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    display: block;
    flex-shrink: 0;
}

/* Модальное окно выбора цвета события */
.event-color-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 8px;
}

.event-color-picker-item {
    background: none;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    aspect-ratio: 1;
}

.event-color-picker-item:hover {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-color: var(--tg-theme-hint-color, #e0e0e0);
}

.event-color-picker-item.selected {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
}

.event-color-picker-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    min-width: 32px;
    min-height: 32px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Стили для страницы настроек */
.settings-section {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    border-radius: 12px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-field-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--tg-theme-hint-color, #999999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-name {
    font-size: 18px;
    font-weight: 400;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.4;
    margin: 0;
    padding: 12px 16px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 8px;
}

.profile-description {
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.6;
    margin: 0;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.profile-description a {
    color: var(--tg-theme-link-color, #3390ec);
    text-decoration: underline;
    word-break: break-all;
}

.profile-description a:hover,
.profile-description a:active {
    opacity: 0.8;
}


.char-counter {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    font-weight: normal;
    margin-left: 8px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
    flex: 1;
}

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

.section-title-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    color: var(--tg-theme-text-color, #000000);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.icon-btn:active {
    opacity: 0.8;
}

.icon-btn-danger:hover {
    background: #ff4444;
    color: #ffffff;
}

.settings-item {
    margin-bottom: 12px;
}

.settings-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 8px;
    gap: 12px;
}

.settings-item-label {
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.settings-item-value {
    color: var(--tg-theme-hint-color, #666666);
}

/* Стили для кнопок настроек профиля */
.profile-settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-settings-buttons .btn {
    width: 100%;
    text-align: center;
}

.profile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.profile-item-badge {
    font-size: 11px;
    color: var(--tg-theme-button-color, #3390ec);
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(51, 144, 236, 0.1);
    border-radius: 4px;
}

/* Заголовок страницы - уменьшенный */
.page-title-small {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Header для страницы организатора */
.organizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.organizer-header .page-title-small {
    margin-bottom: 0;
    flex: 1;
    margin: 0;
}

/* Описание под заголовком */
.page-description {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Секция подписок */
.subscriptions-section {
    margin-bottom: 32px;
    padding: 10px 12px;
}

/* Сообщение об отсутствии подписок */
.empty-subscriptions-message {
    text-align: left;
    padding: 20px 12px;
}

.empty-message-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 12px;
}

.empty-message-text {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    margin-bottom: 12px;
    line-height: 1.5;
}

.empty-message-list {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    line-height: 1.8;
    margin: 0;
    padding-left: 20px;
}

.empty-message-list li {
    margin-bottom: 4px;
}

.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

/* Секция организатора */
.subscription-org-section {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-org-header {
    margin-bottom: 0;
}

.organizer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.organizer-label {
    color: var(--tg-theme-hint-color, #999999);
    font-weight: 400;
}

.organizer-link {
    color: var(--tg-theme-link-color, #3390ec);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.organizer-link:hover,
.organizer-link:active {
    opacity: 0.8;
    text-decoration: underline;
}

.organizer-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.organizer-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
}

/* Список подписок организатора */
.subscription-events-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.profile-item {
    padding: 10px 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 8px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    transition: all 0.2s;
}

.profile-item:hover:not(.profile-item-current) {
    border-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.profile-item-current {
    background: var(--tg-theme-button-color, #3390ec);
    border-color: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.profile-item-current .profile-item-content {
    color: var(--tg-theme-button-text-color, #ffffff);
}

.profile-item-current .profile-item-badge {
    background: rgba(255, 255, 255, 0.2);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.btn-full-width {
    width: 100%;
    box-sizing: border-box;
}

.subscription-item {
    padding: 8px 10px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 6px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.subscription-item:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


.profile-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.subscription-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.subscription-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.subscription-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.subscription-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.subscription-type {
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.3;
}

.subscription-event-name {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* Компактная кнопка для подписок */
.subscription-item .btn-small {
    padding: 5px 10px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-danger {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #ff4444;
    color: #ffffff;
}

.btn-danger:active {
    opacity: 0.8;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.form-actions .btn {
    flex: 1;
}

@media (max-width: 480px) {
    .flexible-input-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Стили для кнопок записи */
.registration-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.registration-toggle-buttons-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.registration-toggle-buttons-row .btn-register-toggle {
    flex: 1;
}

/* Строка с кнопками "Поделиться" и "+ комментарий" */
.registration-actions-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
}

.registration-actions-row .btn-register-toggle {
    flex: 1;
    min-width: 120px;
}

.registration-button-wrapper {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
    width: 100%;
}

.btn-register-toggle,
.btn-register-with-control {
    flex: 1;
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--tg-theme-button-color, #3390ec);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-button-color, #3390ec);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
}

.btn-register-toggle:hover:not(.active),
.btn-register-with-control:hover:not(.active) {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-color: var(--tg-theme-button-color, #3390ec);
}

.btn-register-toggle.disabled,
.btn-register-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-register-toggle.active:hover,
.btn-register-with-control.active:hover {
    opacity: 0.9;
}

.btn-register-toggle.active,
.btn-register-with-control.active {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.btn-register-with-control {
    justify-content: space-between;
    padding: 10px 20%;
    position: relative;
}

.button-name {
    flex: 1;
    text-align: center;
    font-weight: 500;
    margin: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-guest,
.btn-remove-guest {
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    min-width: 36px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    align-self: center;
}

.btn-register-with-control:not(.active) .btn-add-guest,
.btn-register-with-control:not(.active) .btn-remove-guest {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    color: var(--tg-theme-button-color, #3390ec);
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.btn-add-guest:hover {
    background: rgba(76, 175, 80, 0.3);
}

.btn-register-with-control:not(.active) .btn-add-guest:hover {
    background: #4caf50;
    color: #ffffff;
    border-color: #4caf50;
}

.btn-remove-guest:hover {
    background: rgba(255, 68, 68, 0.3);
}

.btn-register-with-control:not(.active) .btn-remove-guest:hover {
    background: #ff4444;
    color: #ffffff;
    border-color: #ff4444;
}

.guest-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guest-count {
    font-size: 15px;
    font-weight: 600;
    color: inherit;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

/* Стили для поля комментария при регистрации */
.registration-comment-field-wrapper {
    margin-bottom: 12px;
}

.registration-comment-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #3390ec);
}

.comment-textarea::placeholder {
    color: var(--tg-theme-hint-color, #999999);
}

.btn-save-comment {
    padding: 8px 16px;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-start;
}

.btn-save-comment:hover {
    opacity: 0.9;
}

.btn-save-comment:active {
    opacity: 0.8;
}


/* Стили для управления администраторами */
.admins-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-item {
    padding: 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.admin-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.admin-badge {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #999999);
    font-style: italic;
}

.no-admins {
    padding: 12px;
    text-align: center;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
}

.admins-actions {
    margin-top: 16px;
}

.btn-remove-admin {
    padding: 4px 8px;
    font-size: 16px;
    min-width: auto;
    height: auto;
    line-height: 1.2;
    background: transparent;
    border: none;
    color: var(--tg-theme-destructive-text-color, #ff4444);
    box-shadow: none;
}

.btn-remove-admin:hover {
    background: transparent;
    opacity: 0.7;
}

.btn-remove-admin:active {
    opacity: 0.5;
}

.invite-link-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Стили для списка приглашений */
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invitation-item {
    padding: 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 8px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.invitation-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invitation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.invitation-status {
    font-weight: 500;
    font-size: 15px;
}

.invitation-date {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
}

.invitation-user {
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
}

.invitation-link-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.invitation-link-input {
    flex: 1;
    font-size: 12px;
    padding: 8px;
}

/* Стили для модального окна шаринга */
.share-option {
    margin-bottom: 24px;
}

.share-option:last-child {
    margin-bottom: 0;
}

.share-option-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 8px;
}

.share-link-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.share-link-input {
    flex: 1;
    font-size: 12px;
    padding: 8px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 6px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    font-family: monospace;
    word-break: break-all;
}

.share-link-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #3390ec);
}

.share-hint {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    margin-top: 4px;
    line-height: 1.4;
}

/* Секция ссылки в модальном окне поделиться */
.share-link-section {
    margin-bottom: 24px;
}

/* Блок "Анонс в чате" */
.announce-in-chat-section {
    margin-top: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    overflow: visible;
}

.announce-in-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
}


/* Кнопки анонсов */
.share-announce-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.share-announce-buttons .btn {
    flex: 1;
}

@media (max-width: 480px) {
    .share-announce-buttons {
        flex-direction: column;
    }

    .share-announce-buttons .btn {
        width: 100%;
    }
}

/* Секция приглашений в управлении администраторами */
.invitations-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.invitations-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.no-invitations {
    padding: 12px;
    text-align: center;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
}

/* Стили для табов администраторов */
.admins-tabs {
    margin-top: 8px;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid var(--tg-theme-hint-color, #e0e0e0);
    margin-bottom: 16px;
    gap: 0;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--tg-theme-text-color, #000000);
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.tab-button.active {
    color: var(--tg-theme-button-color, #3390ec);
    border-bottom-color: var(--tg-theme-button-color, #3390ec);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Стили для настроек уведомлений */
.notification-settings-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 12px;
}

.notification-options-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 2px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.notification-option-btn:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.notification-option-btn.active {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.notification-option-btn.active .notification-option-label {
    color: var(--tg-theme-button-text-color, #ffffff);
}

.notification-option-btn.active .notification-option-description {
    color: rgba(255, 255, 255, 0.9);
}

.notification-option-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-option-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.notification-option-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.3;
}

.notification-option-description {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #999999);
    line-height: 1.4;
}

/* Toast уведомления */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90%;
    width: 320px;
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    transform: translateX(400px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: auto;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    background: #4caf50;
    color: #ffffff;
    border-left: 4px solid #2e7d32;
}

.toast-error {
    background: #f44336;
    color: #ffffff;
    border-left: 4px solid #c62828;
}

.toast-info {
    background: var(--tg-theme-button-color, #3390ec);
    color: #ffffff;
    border-left: 4px solid #1976d2;
}

.toast-warning {
    background: #ff9800;
    color: #ffffff;
    border-left: 4px solid #f57c00;
}

/* Адаптация для мобильных устройств */
@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100% - 20px);
    }

    .toast {
        width: 100%;
    }
}


/* Стили для модального окна комментария */
.comment-modal-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-modal-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.comment-modal-textarea:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #3390ec);
}

.comment-modal-textarea::placeholder {
    color: var(--tg-theme-hint-color, #999999);
}

.comment-modal-hint {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #666666);
    margin-top: 4px;
}

.comment-modal-counter {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #666666);
    text-align: right;
    margin-top: 4px;
}

.comment-modal-counter span {
    font-weight: 500;
}

/* Стили для модального окна регистрации */
.registration-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.registration-option {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.registration-option h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--tg-theme-text-color, #000000);
}

.option-description {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #666666);
    margin: 0;
}

.registration-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 4px 0;
}

.registration-divider::before,
.registration-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.registration-divider span {
    padding: 0 12px;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
}

/* Стили для публичной страницы расписания */
.date-section {
    margin-bottom: 32px;
}

.date-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tg-theme-hint-color, #e0e0e0);
}

.events-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-card {
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.event-header {
    margin-bottom: 12px;
}

.event-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin: 0;
}

.event-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}



.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 16px;
}


/* Стили для блока информации о записи пользователя в модальном окне */
.user-registration-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #333);
    margin-bottom: 12px;
}

.user-registration-message {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-registration-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4caf50;
}

.user-registration-icon svg {
    width: 24px;
    height: 24px;
}

.user-registration-check-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    color: #4caf50;
    vertical-align: middle;
}

.user-registration-check-icon svg {
    width: 24px;
    height: 24px;
}

.user-registration-text {
    flex: 1;
    font-size: 16px;
    color: var(--tg-theme-text-color, #333);
}

.user-registration-text strong {
    color: #4caf50;
    font-weight: 600;
}

.user-registration-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.user-registration-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.user-registration-detail-label {
    color: var(--tg-theme-hint-color, #666);
    font-weight: 500;
}

.user-registration-detail-value {
    color: var(--tg-theme-text-color, #333);
    text-align: right;
}

/* Стили для модального окна фильтров */
.filter-section {
    margin-bottom: 24px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 12px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--tg-theme-text-color, #000000);
    user-select: none;
}

.filter-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--tg-theme-button-color, #3390ec);
}

.filter-toggle-buttons {
    display: flex;
    gap: 8px;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    border-radius: 8px;
    padding: 4px;
}

.filter-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: var(--tg-theme-hint-color, #999999);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-toggle-btn.active {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.filter-toggle-btn:hover:not(.active) {
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
}

.filter-toggle-btn:active {
    opacity: 0.8;
}

.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tg-theme-hint-color, #cccccc);
}

.filter-actions .btn-primary,
.filter-actions .btn-secondary {
    flex: 1;
}

/* Стили для кликабельных участников-веб-пользователей */
.participant-item-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.participant-item-clickable:hover {
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

/* Подсветка текущего пользователя в списке участников */
.participant-item-current-user {
    background-color: var(--tg-theme-secondary-bg-color, #f0f0f0) !important;
    border-left: 3px solid var(--tg-theme-button-color, #3390ec);
    padding-left: 8px;
}

/* Стили для раскрывающегося блока с подробной информацией о участнике */
.participant-item-expanded {
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5) !important;
}

.participant-details-expanded-wrapper {
    width: 100%;
    flex-basis: 100%;
    order: 999;
}

.participant-details-expanded {
    animation: slideDown 0.2s ease;
}

.participant-detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.participant-detail-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--tg-theme-hint-color, #999999);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для модального окна с деталями веб-пользователя */
#webUserDetailsModal {
    display: none;
}

#webUserDetailsModal.active {
    display: flex;
}

#webUserDetailsModal .modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#webUserDetailsModal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
}

#webUserDetailsModal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tg-theme-hint-color, #999999);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#webUserDetailsModal .modal-close:hover {
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

/* Кнопка для повторного открытия модального окна авторизации */
.telegram-auth-banner-button {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--tg-theme-button-color, #3390ec) 0%, #2a7fd4 100%);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.telegram-auth-banner-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

.telegram-auth-banner-button:active {
    transform: translateY(0);
    opacity: 0.9;
}

.telegram-auth-banner-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.telegram-auth-banner-button-icon svg {
    width: 100%;
    height: 100%;
}

.telegram-auth-banner-button-text {
    line-height: 1;
}

@media (max-width: 768px) {
    .telegram-auth-banner-button {
        top: max(12px, calc(12px + env(safe-area-inset-top)));
        right: 12px;
        padding: 7px 11px;
        font-size: 12px;
    }

    .telegram-auth-banner-button-icon {
        width: 14px;
        height: 14px;
    }
}

/* Обертка для кнопки входа и информации о пользователе */
.login-header-wrapper {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

/* Кнопка входа на главном экране */
.login-button-container {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.login-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--tg-theme-button-color, #3390ec) 0%, #2a7fd4 100%);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

.login-button:active {
    transform: translateY(0);
    opacity: 0.9;
}

.login-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    line-height: 1;
}

.login-button-icon svg {
    width: 100%;
    height: 100%;
}

.login-button-text {
    line-height: 1;
}

@media (max-width: 768px) {
    .login-header-wrapper {
        margin-bottom: 12px;
    }

    .login-button {
        padding: 7px 14px;
        font-size: 12px;
        border-radius: 18px;
    }

    .login-button-icon {
        width: 12px;
        height: 12px;
    }
}

/* Информация о пользователе на главном экране */
.user-info-container {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    transition: all 0.2s ease;
}

.user-info:hover {
    background: var(--tg-theme-secondary-bg-color, #e8e8e8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-info:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-info-icon {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info-name {
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

@media (max-width: 768px) {
    .user-info {
        padding: 7px 14px;
        font-size: 12px;
        border-radius: 18px;
    }

    .user-info-icon {
        font-size: 14px;
    }

    .user-info-name {
        max-width: 120px;
    }
}

#webUserDetailsModal .modal-body {
    padding: 16px;
}

.user-detail-item {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-detail-item:last-child {
    margin-bottom: 0;
}

.user-detail-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-hint-color, #999999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-detail-value {
    font-size: 16px;
    color: var(--tg-theme-text-color, #000000);
    word-wrap: break-word;
}

.user-detail-value a {
    color: var(--tg-theme-link-color, #3390ec);
    text-decoration: none;
}

.user-detail-value a:hover {
    text-decoration: underline;
}

/* Модальное окно регистрации на мероприятие */
.event-registration-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.event-registration-modal.active {
    display: flex;
}

.event-registration-modal-content {
    background: var(--tg-theme-bg-color, #ffffff);
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.event-registration-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.event-registration-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
}

.event-registration-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--tg-theme-hint-color, #999999);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 1;
}

.event-registration-modal-close:hover {
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.event-registration-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Вкладки */
.event-registration-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.event-registration-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
    font-weight: 500;
}

.event-registration-tab:hover {
    color: var(--tg-theme-text-color, #000000);
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.event-registration-tab.active {
    color: var(--tg-theme-button-color, #3390ec);
    border-bottom-color: var(--tg-theme-button-color, #3390ec);
    font-weight: 600;
}

.tab-icon {
    font-size: 18px;
}

.tab-text {
    line-height: 1;
}

/* Контент вкладок */
.event-registration-tab-content {
    display: none;
}

.event-registration-tab-content.active {
    display: block;
}

/* Секция Telegram авторизации */
.telegram-auth-section {
    text-align: center;
}

.telegram-auth-description {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    line-height: 1.5;
}

.telegram-auth-widget-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

/* Форма регистрации */
.event-registration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.event-registration-form .form-group {
    margin: 0;
}

.event-registration-form .form-input {
    width: 100%;
    box-sizing: border-box;
}

.event-registration-form .checkbox-label {
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-text-color, #000000);
}

.event-registration-form .checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.event-registration-form .btn-primary {
    margin-top: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .event-registration-modal-content {
        max-width: 95%;
        border-radius: 16px;
    }

    .event-registration-modal-header {
        padding: 16px 20px;
    }

    .event-registration-modal-title {
        font-size: 18px;
    }

    .event-registration-modal-body {
        padding: 20px;
    }

    .event-registration-tabs {
        margin-bottom: 20px;
    }

    .event-registration-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .tab-icon {
        font-size: 16px;
    }
}

/* Стили для выпадающего списка событий в виджете */
.events-dropdown-wrapper {
    position: relative;
    z-index: 1;
}

.events-dropdown-button {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 6px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.events-dropdown-button:hover:not(.disabled) {
    border-color: var(--tg-theme-button-color, #3390ec);
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.events-dropdown-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.events-dropdown-button-text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.events-dropdown-arrow {
    margin-left: 8px;
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.events-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 6px;
    background: var(--tg-theme-bg-color, #ffffff);
    z-index: 10002;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Компактный список выбранных событий */
.selected-event-item {
    padding: 8px 12px;
    border: 1px solid var(--tg-theme-button-color, #3390ec);
    border-radius: 6px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    transition: all 0.2s;
}

.selected-event-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-event-number {
    font-weight: 600;
    color: var(--tg-theme-button-color, #3390ec);
    min-width: 20px;
    flex-shrink: 0;
}

.selected-event-name {
    flex: 1;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    word-break: break-word;
}

.selected-event-name:hover {
    background: var(--tg-theme-bg-color, #ffffff);
}

.selected-event-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.selected-event-actions .btn-small {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 32px;
    height: 28px;
}

/* Календарь организатора */
.organizer-calendar-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.organizer-calendar-page {
    height: 100vh;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.organizer-calendar-page.container {
    height: 100%;
    display: flex;
    flex-direction: row;
    flex: 1;
    padding: 0;
    margin: 0;
    max-width: 100%;
    min-width: 0;
}


.organizer-calendar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    height: 100%;
    position: relative;
}

.organizer-calendar-main .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    min-height: 56px;
}

.calendar-header .menu-toggle-btn {
    padding: 8px 16px;
    min-width: auto;
    width: auto;
    height: auto;
    margin-right: auto;
    gap: 8px;
    font-size: 15px;
}

.calendar-header .menu-toggle-btn svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
    flex-shrink: 0;
}

.calendar-header .nav-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--tg-theme-text-color, #000000);
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-header .nav-btn-arrow {
    padding: 6px;
    min-width: 32px;
    width: 32px;
    height: 32px;
}

.calendar-header .nav-btn-arrow svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.calendar-header .nav-btn:hover {
    background: transparent;
}

.calendar-header .nav-btn:active {
    opacity: 1;
    background: transparent;
}

/* Отключаем hover эффекты на мобильных устройствах */
@media (hover: none) and (pointer: coarse) {
    .calendar-header .nav-btn:hover {
        background: transparent;
    }

    .calendar-header .nav-btn:active {
        background: transparent;
        opacity: 1;
    }

    .calendar-header .today-btn:hover {
        background: transparent;
    }

    .calendar-header .today-btn:active {
        background: transparent;
    }

    .calendar-header .sync-btn:hover {
        background: transparent;
    }

    .calendar-header .sync-btn:active {
        background: transparent;
    }

    .calendar-header .calendar-date-picker-btn:hover {
        background: transparent;
    }

    .calendar-header .calendar-date-picker-btn:active {
        background: transparent;
    }

    .calendar-header .menu-toggle-btn:hover {
        background: transparent;
    }

    .calendar-header .menu-toggle-btn:active {
        background: transparent;
    }
}

.calendar-header .today-btn {
    background: transparent;
    color: var(--tg-theme-text-color, #000000);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-width: 52px;
    width: 52px;
    height: 44px;
    position: relative;
    flex-shrink: 0;
}

.calendar-header .today-btn svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    pointer-events: none;
}

.calendar-header .today-btn .today-btn-date {
    position: absolute;
    top: 53%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    color: var(--tg-theme-text-color, #000000);
}

.calendar-header .today-btn:hover {
    background: transparent;
    opacity: 1;
}

.calendar-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.calendar-header .sync-btn {
    padding: 8px;
    min-width: 48px;
    width: 48px;
    height: 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-header .sync-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.calendar-header .sync-btn .sync-icon {
    width: 24px;
    height: 24px;
    pointer-events: none;
    transition: opacity 0.2s;
}

.calendar-header .sync-btn .sync-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.calendar-header .sync-btn .sync-spinner .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: sync-spinner-spin 0.7s linear infinite;
}

@keyframes sync-spinner-spin {
    to {
        transform: rotate(360deg);
    }
}

.calendar-header .current-period {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
}

.calendar-date-picker-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-date-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    cursor: pointer;
    padding: 8px;
    min-width: 52px;
    width: 52px;
    height: 44px;
    flex-shrink: 0;
}

.calendar-date-picker-btn svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    pointer-events: none;
}


/* Обертка для горизонтального календаря */
.horizontal-calendar-wrapper {
    width: 100%;
    background: var(--tg-theme-bg-color, #ffffff);
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color, #f0f0f0);
}

/* Контейнер для горизонтального календаря */
.horizontal-months-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    padding: 8px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: pan-x;
    will-change: scroll-position;
    /* Скрываем скроллбар */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.horizontal-months-container::-webkit-scrollbar {
    display: none;
}

.horizontal-months-container.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Отдельный месяц */
.horizontal-calendar-month {
    flex: 0 0 auto;
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.horizontal-calendar-month-header {
    font-weight: 600;
    font-size: 16px;
    color: var(--tg-theme-text-color, #000000);
    text-align: center;
    padding: 4px 0;
}

.horizontal-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.horizontal-calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-hint-color, #666666);
    padding: 4px 0;
}

.horizontal-calendar-weekday.weekend {
    color: #e53935;
    font-weight: 500;
}

.horizontal-calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.horizontal-calendar-date-item {
    aspect-ratio: 1;
    min-height: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
    position: relative;
    padding: 2px;
}

.horizontal-calendar-date-item:hover {
    background-color: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.horizontal-calendar-date-item.other-month {
    opacity: 0.3;
}

.horizontal-calendar-date-item.today {
    border: 2px solid var(--tg-theme-button-color, #3390ec);
    font-weight: 600;
}

.horizontal-calendar-date-item.today:hover {
    background-color: var(--tg-theme-secondary-bg-color, #f0f0f0);
}

.horizontal-calendar-date-item.weekend {
    color: var(--tg-theme-hint-color, #999999);
}

.horizontal-calendar-date-item.paste-mode {
    cursor: pointer;
}

.horizontal-calendar-date-item.paste-mode:hover {
    background-color: rgba(51, 144, 236, 0.15);
}

.horizontal-calendar-date-item.paste-target {
    background-color: rgba(51, 144, 236, 0.2);
    outline: 2px solid var(--tg-theme-button-color, #3390ec);
    outline-offset: -1px;
}

.horizontal-calendar-date-item.paste-target:hover {
    background-color: rgba(51, 144, 236, 0.3);
}

.horizontal-calendar-date-number {
    font-size: 14px;
    line-height: 1;
    margin-bottom: 2px;
}

.horizontal-calendar-date-dots {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.horizontal-calendar-date-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {

    .horizontal-months-container {
        scroll-behavior: auto;
        /* Отключаем плавный скролл на мобильных для лучшей производительности */
        cursor: default;
        /* Убираем курсор grab на мобильных */
    }

    .horizontal-calendar-month {
        width: 260px;
        min-width: 260px;
    }

    .horizontal-calendar-date-item {
        min-height: 28px;
    }

    .horizontal-calendar-date-number {
        font-size: 13px;
    }
}

.calendar-days-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    display: flex;
    gap: 0;
    scroll-behavior: auto;
    /* Управление анимацией через JavaScript */
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    height: 100%;
    position: relative;
    scrollbar-width: none;
    /* Firefox - скрываем скроллбары */
    -ms-overflow-style: none;
    /* IE and Edge */
    cursor: grab;
}

.calendar-days-scroll:active {
    cursor: grabbing;
}

.calendar-days-scroll button,
.calendar-days-scroll a {
    cursor: pointer;
}

.calendar-days-scroll:active button,
.calendar-days-scroll:active a {
    cursor: pointer;
}

.calendar-days-scroll::-webkit-scrollbar {
    width: 8px;
    height: 0;
    /* Chrome, Safari, Opera - скрываем горизонтальный скроллбар */
}

.calendar-days-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.calendar-days-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.calendar-days-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

body.theme-dark .calendar-days-scroll {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

body.theme-dark .calendar-days-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-dark .calendar-days-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

body.theme-dark .calendar-days-scroll {
    scrollbar-width: none;
    /* Firefox */
}

.virtual-scroll-spacer {
    flex-shrink: 0;
    height: 100%;
    pointer-events: none;
    box-sizing: border-box;
}

.virtual-scroll-spacer-left,
.virtual-scroll-spacer-right {
    display: block;
}

/* Плавающая панель выделенных слотов */
.slot-selection-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--tg-theme-bg-color, #ffffff);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    gap: 12px;
}

.slot-selection-bar-normal,
.slot-selection-bar-paste {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.slot-selection-bar-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.slot-selection-bar-actions,
.slot-selection-bar-paste-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slot-selection-bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--tg-theme-text-color, #000000);
    font-size: 16px;
    cursor: pointer;
}

.slot-selection-bar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slot-selection-bar-btn-secondary {
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    color: var(--tg-theme-text-color, #000000);
}

.slot-selection-bar-btn-primary {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.slot-selection-bar-paste-hint {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #666666);
}

.slot-selection-bar-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--tg-theme-hint-color, #666666);
    cursor: pointer;
}

.slot-selection-bar-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--tg-theme-text-color, #000000);
}

.slot-selection-bar-close:active {
    background: rgba(0, 0, 0, 0.1);
}

.slot-selection-bar-close-icon {
    display: block;
    flex-shrink: 0;
}

/* Плавающая кнопка создания слота (FAB) */
.fab-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    /* Учитываем safe area для устройств с вырезом */
    bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
}

.fab-button:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.fab-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fab-button svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* FAB скрывается через JavaScript когда активна панель выделения */

/* На мобильных устройствах корректируем позицию */
@media (max-width: 768px) {
    .fab-button {
        bottom: max(70px, calc(70px + env(safe-area-inset-bottom)));
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Скрываем FAB когда открыто модальное окно */
.modal.active~.fab-button,
.modal.active~.fab-group {
    display: none !important;
}

/* FAB-группа: карандаш (режим редактирования) или «Вернуться к просмотру» */
.fab-group {
    position: fixed;
    bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    right: 20px;
    z-index: 101;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: column;
    justify-content: flex-start;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .fab-group {
        bottom: max(70px, calc(70px + env(safe-area-inset-bottom)));
        right: 16px;
    }
}

.fab-group .fab-button-main {
    flex-shrink: 0;
    position: relative;
    bottom: auto;
    right: auto;
    /* Сохраняем размеры и форму от базового .fab-button */
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.fab-group .fab-button-cancel {
    position: relative;
    bottom: auto;
    right: auto;
    margin-bottom: 0;
    padding: 0;
    width: 56px;
    height: 56px;
    min-width: 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    border-radius: 50%;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, #e8e8e8);
    cursor: pointer;
    transition: max-width 0.25s ease, opacity 0.2s ease, width 0.25s ease, margin-bottom 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fab-group .fab-button-cancel.fab-button-cancel--visible {
    max-width: 56px;
    width: 56px;
    opacity: 1;
    margin-bottom: 12px;
}

.fab-group .fab-button-cancel:hover {
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.fab-group .fab-button-cancel:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fab-group .fab-button-cancel svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.fab-group .fab-icon-save {
    display: none;
}

.fab-group .fab-icon-back {
    display: none;
}

.fab-group.fab-group--edit-mode .fab-icon-pencil {
    display: none;
}

.fab-group.fab-group--edit-mode .fab-icon-save {
    display: none;
}

.fab-group.fab-group--edit-mode .fab-icon-back {
    display: block;
}

/* Кнопка добавления нового слота (показывается только в режиме редактирования) */
.fab-group .fab-button-add {
    position: relative;
    bottom: auto;
    right: auto;
    margin-bottom: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.fab-group .fab-button-add:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2), 0 1.5px 3px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.fab-group .fab-button-add:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), 0 0.5px 1px rgba(0, 0, 0, 0.1);
}

.fab-group .fab-icon-add {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}


.timeline-slot,
.multiday-slot {
    position: relative;
}

/* Компактные стили для модального окна редактирования слота */
.edit-slot-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.edit-slot-form .form-group {
    margin-bottom: 0;
}

.edit-slot-form .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 6px;
    display: block;
}

.edit-slot-form .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.edit-slot-form .form-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.edit-slot-form .form-input::placeholder {
    color: var(--tg-theme-hint-color, #999999);
    opacity: 0.7;
}

.edit-slot-form .form-select {
    padding-right: 48px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px 20px;
    cursor: pointer;
}

.edit-slot-form .form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%233390ec' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.edit-slot-form textarea.form-input {
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
    padding: 8px 12px;
}

.edit-slot-form .char-counter {
    text-align: right;
    font-size: 11px;
    color: var(--tg-theme-hint-color, #999999);
    margin-top: 4px;
    font-weight: 500;
}

.edit-slot-form .reschedule-time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
}

.edit-slot-form .reschedule-time-inputs input {
    width: 100%;
}

/* Компактные стили для секций гибкого слота и разбиения */
.edit-slot-form .slot-flexible-section,
.edit-slot-form .slot-split-section {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border: 2px solid var(--tg-theme-hint-color, #e9ecef);
    border-radius: 10px;
    padding: 12px;
    margin: 0;
    transition: all 0.2s ease;
}

.edit-slot-form .slot-flexible-section:hover,
.edit-slot-form .slot-split-section:hover {
    border-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.08);
}

.edit-slot-form .slot-flexible-section[style*="opacity: 0.5"] {
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    opacity: 0.6;
}

.edit-slot-form .slot-flexible-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    margin-bottom: 6px;
    padding: 2px 0;
}

.edit-slot-form .slot-flexible-checkbox,
.edit-slot-form .slot-split-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--tg-theme-button-color, #3390ec);
}

.edit-slot-form .slot-help-text-small {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #666666);
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.4;
    padding-left: 28px;
}

.edit-slot-form .flexible-fields,
.edit-slot-form .split-fields {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--tg-theme-hint-color, #e0e0e0);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edit-slot-form .flexible-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
}

.edit-slot-form .flexible-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-slot-form .flexible-input-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
    margin-bottom: 0;
}

.edit-slot-form .flexible-input-group input,
.edit-slot-form .slot-min-duration,
.edit-slot-form .slot-step,
.edit-slot-form .slot-split-interval {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.edit-slot-form .flexible-input-group input:focus,
.edit-slot-form .slot-min-duration:focus,
.edit-slot-form .slot-step:focus,
.edit-slot-form .slot-split-interval:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #3390ec);
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.edit-slot-form .comment-modal-hint {
    background: linear-gradient(135deg, rgba(51, 144, 236, 0.08), rgba(51, 144, 236, 0.04));
    border: 1px solid rgba(51, 144, 236, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--tg-theme-text-color, #000000);
    margin-top: 4px;
    line-height: 1.4;
}

/* Компактные стили для модального окна редактирования */
#editSlotModal .modal-content {
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#editSlotModal .modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#editSlotModal .modal-footer {
    padding: 14px 20px;
    background: transparent;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#editSlotModal .modal-footer .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

#editSlotModal .modal-footer .btn-secondary {
    background: transparent;
    color: var(--tg-theme-text-color, #000000);
    border: none;
}

#editSlotModal .modal-footer .btn-secondary:hover {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    opacity: 0.8;
}

#editSlotModal .modal-footer .btn-secondary:active {
    opacity: 0.6;
}

#editSlotModal .modal-footer .btn-primary {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    box-shadow: none;
}

#editSlotModal .modal-footer .btn-primary:hover {
    background: var(--tg-theme-button-color, #2a7bd6);
    opacity: 0.9;
}

#editSlotModal .modal-footer .btn-primary:active {
    opacity: 0.8;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    #editSlotModal .modal-content {
        max-width: 95%;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
    }

    #editSlotModal .modal-body {
        padding: 20px;
    }

    #editSlotModal .modal-footer {
        padding: 14px 16px;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
    }

    #editSlotModal .modal-footer .btn {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        font-size: 14px;
    }

    .edit-slot-form .reschedule-time-inputs {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .edit-slot-form .flexible-input-row {
        grid-template-columns: 1fr;
    }
}

.calendar-day-card {
    flex: 0 0 auto;
    min-width: 100px;
    background: var(--tg-theme-bg-color, #ffffff);
    border: none;
    border-radius: 0;
    margin-right: 12px;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 1476px;
    /* Высота = day-header (36px) + day-timeline (1440px) = 1476px */
    position: relative;
    /* Создаем stacking context для правильного z-index */
}


.calendar-day-card.time-labels-card {
    min-width: 35px;
    width: 35px;
    flex: 0 0 35px;
    position: sticky;
    left: 0;
    z-index: 10;
    /* Уменьшаем z-index карточки времени */
    padding-top: 0;
    box-sizing: border-box;
    min-height: 1476px;
    /* Высота = day-header (36px) + day-timeline (1440px) = 1476px */
    display: flex;
    flex-direction: column;
    background: var(--tg-theme-secondary-bg-color, #ffffff);
}

.time-labels-card .day-header {
    background: var(--tg-theme-bg-color, #ffffff);
    position: sticky;
    top: 0;
    z-index: 21;
}

.time-labels-card .day-timeline {
    background: var(--tg-theme-secondary-bg-color, #ffffff);
    padding-top: 0;
    overflow-y: hidden;
    /* Убираем вертикальный скролл */
    overflow-x: hidden;
    height: 1440px;
    /* Фиксированная высота для 24 часов (24 * 60px = 1440px) */
    flex: 0 0 1440px;
    /* Фиксированная высота для flex-контейнера */
}

.time-labels-card .timeline-hour {
    text-align: right;
    padding-right: 4px;
    border-top: none;
    font-size: 10px;
}

.day-header {
    padding: 6px 12px;
    border-bottom: none;
    background: var(--tg-theme-secondary-bg-color, #f1f1f1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    box-sizing: border-box;
    overflow: hidden;
}

.calendar-day-card:not(.time-labels-card) .day-header {
    position: sticky;
    top: 0;
    z-index: 25;
    /* Выше шкалы времени (z-index: 10-11) */
}

.day-name {
    font-size: 12px;
    font-weight: 400;
    color: var(--tg-theme-hint-color, #999999);
    text-transform: capitalize;
    flex-shrink: 0;
}

.day-name.day-name--weekend {
    color: #e53935;
    font-weight: 500;
}

.day-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.2;
}

.day-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    width: fit-content;
}

.day-badge.today {
    background: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.calendar-day-card.calendar-day-card--paste-target .day-header {
    background: rgba(51, 144, 236, 0.2);
    outline: 2px solid var(--tg-theme-button-color, #3390ec);
    outline-offset: -1px;
}

.day-header.day-header--clickable {
    cursor: pointer;
}

.day-header.day-header--clickable:hover {
    background: rgba(51, 144, 236, 0.15);
}

.day-header.day-header--today {
    border: 2px solid var(--tg-theme-button-color, #3390ec);
    border-radius: 4px;
}

.multiday-slots-panel {
    position: sticky;
    top: 36px;
    /* Высота .day-header */
    z-index: 25;
    /* Выше шкалы времени (z-index: 10-11), на уровне с .day-header */
    min-height: 0;
    max-height: fit-content;
    overflow-x: visible;
    overflow-y: visible;
}

.multiday-slots-panel:empty {
    display: none;
}

.multiday-slots-overlay {
    position: sticky;
    top: 36px;
    height: 0;
    z-index: 24;
    /* Выше шкалы времени (z-index: 10-11), но ниже панели многодневных слотов (z-index: 25) */
    pointer-events: none;
}

.multiday-slots-overlay-inner {
    background: var(--tg-theme-bg-color, #ffffff);
}

.multiday-slot {
    position: relative;
    top: auto;
    padding: 6px 10px;
    border-radius: 0;
    border: 1px solid;
    border-left: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    overflow: visible;
    z-index: 10;
    box-sizing: border-box;
    margin: 0;
    min-height: 32px;
    height: auto;
}

.multiday-slot[data-slot-start="true"] {
    border-left: 1px solid;
    border-radius: 4px 0 0 4px;
}

.multiday-slot[data-slot-end="true"] {
    border-right: 1px solid;
    border-radius: 0 4px 4px 0;
}

.multiday-slot.slot-empty {
    background: transparent !important;
}

.multiday-slot.slot-cancelled {
    opacity: 0.5;
    text-decoration: line-through;
}

.multiday-slot.slot-past {
    opacity: 0.5;
}

.multiday-slot-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.multiday-slot-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.multiday-slot-dates {
    white-space: nowrap;
    font-size: 11px;
    opacity: 0.9;
    flex-shrink: 0;
}

.multiday-slot-time {
    white-space: nowrap;
    font-size: 11px;
    opacity: 0.9;
    flex-shrink: 0;
}


.day-timeline {
    flex: 0 0 1440px;
    position: relative;
    height: 1440px;
    /* Фиксированная высота для 24 часов (24 * 60px = 1440px) */
    padding: 0;
    background: var(--tg-theme-bg-color, #ffffff);
    overflow-y: hidden;
    /* Убираем вертикальный скролл из отдельных карточек */
    overflow-x: visible;
    box-sizing: border-box;
}

/* Приглушённая сетка по часу в карточках дней (не в колонке подписей) */
.calendar-day-card:not(.time-labels-card) .day-timeline-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--tg-theme-secondary-bg-color, #ffffff);
    pointer-events: none;
    z-index: 0;
}

.timeline-hour {
    position: absolute;
    left: 0;
    right: 0;
    padding: 0 5px;
    font-size: 11px;
    color: var(--tg-theme-hint-color, #999999);
    border-top: 1px solid var(--tg-theme-hint-color, #e8e8e8);
    margin-top: 0;
    pointer-events: none;
    /* Убираем transform для правильного позиционирования относительно сетки */
    z-index: 2;
}

.timeline-add-slot-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, #999999);
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    z-index: 5;
    /* Выше timeline-hour (z-index: 2), но ниже слотов */
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

/* На десктопе: показывать только активную кнопку при hover */
@media (hover: hover) and (pointer: fine) {
    .day-timeline:hover .timeline-add-slot-btn.timeline-add-slot-btn--active {
        opacity: 0.6;
        pointer-events: auto;
    }

    .day-timeline:hover .timeline-add-slot-btn.timeline-add-slot-btn--active:hover {
        opacity: 1;
        border-color: var(--tg-theme-button-color, #3390ec);
        color: var(--tg-theme-button-color, #3390ec);
        transform: translateX(-50%) scale(1.1);
    }
}

/* На мобильных устройствах: показывать кнопки при тапе на область времени */
@media (hover: none) and (pointer: coarse) {
    .day-timeline.day-timeline--show-add-buttons .timeline-add-slot-btn {
        opacity: 0.6;
        pointer-events: auto;
    }

    .day-timeline.day-timeline--show-add-buttons .timeline-add-slot-btn:active {
        opacity: 1;
        border-color: var(--tg-theme-button-color, #3390ec);
        color: var(--tg-theme-button-color, #3390ec);
        transform: translateX(-50%) scale(1.05);
    }
}

.timeline-add-slot-btn:active {
    transform: translateX(-50%) scale(1.05);
}

.current-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #f53c3c;
    z-index: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.current-time-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #f53c3c;
    border-radius: 50%;
}

.timeline-slot {
    position: absolute;
    margin: 1px 0;
    background: var(--tg-theme-button-color, #3390ec);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    overflow: visible;
    min-height: 18px;
    max-height: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.timeline-slot * {
    cursor: inherit;
}

/* Исключаем drag handle из наследования курсора */
.timeline-slot .slot-drag-handle {
    cursor: grab !important;
}

.timeline-slot.slot-empty {
    background: transparent !important;
    border: 1px solid;
}

.timeline-slot.slot-past {
    opacity: 0.5 !important;
}

.timeline-slot.slot-cancelled {
    opacity: 0.6;
    background: rgba(128, 128, 128, 0.3) !important;
    border: 1px dashed rgba(128, 128, 128, 0.6) !important;
}

.timeline-slot.slot-cancelled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 4px,
            rgba(128, 128, 128, 0.1) 4px,
            rgba(128, 128, 128, 0.1) 8px);
    pointer-events: none;
    z-index: 1;
}

.timeline-slot.slot-cancelled .slot-content {
    position: relative;
    z-index: 2;
}

.timeline-slot.slot-cancelled .slot-title {
    opacity: 0.7;
}

.timeline-slot.slot-cancelled .slot-time {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    opacity: 0.6;
}

.timeline-slot:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* В режиме редактирования обычные слоты можно перетаскивать */
.timeline-slot:not(.timeline-slot-draft):not(.timeline-slot--draft).slot-draft-dragging {
    cursor: grabbing !important;
    opacity: 0.8;
    will-change: top;
    transform: translateZ(0);
}

.timeline-slot:not(.timeline-slot-draft):not(.timeline-slot--draft).slot-draft-resizing {
    cursor: ns-resize !important;
    will-change: top, height;
    transform: translateZ(0);
}

.timeline-slot.slot-cancelled:hover {
    opacity: 0.7;
}

.timeline-slot:active {
    transform: translateY(0);
    opacity: 0.9;
}

/* Курсор grabbing только при активном перетаскивании через drag handle */
.timeline-slot:not(.timeline-slot-draft):not(.timeline-slot--draft).slot-draft-dragging {
    cursor: grabbing !important;
}

.timeline-slot:not(.timeline-slot-draft):not(.timeline-slot--draft).slot-draft-dragging .slot-drag-handle {
    cursor: grabbing !important;
}


/* Исключаем drag handle из наследования курсора для многодневных слотов */
.multiday-slot .slot-drag-handle {
    cursor: grab !important;
}

.multiday-slot.slot-draft-dragging .slot-drag-handle {
    cursor: grabbing !important;
}

.slot-approval-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #f44336;
    color: #ffffff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    white-space: nowrap;
}

.slot-content {
    padding: 2px 6px;
    color: var(--tg-theme-text-color, #000000);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    cursor: inherit;
}

.slot-title {
    font-size: var(--slot-title-font-size, clamp(11px, 2.5vh, 16px));
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    display: block;
}

.timeline-slot .slot-comment {
    font-size: var(--slot-comment-font-size, clamp(10px, 2.5vh, 16px));
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    white-space: nowrap;
    max-width: 100%;
    margin-top: 1px;
    color: var(--tg-theme-text-color, #000000);
    margin-left: 0;
    opacity: 1;
}

.timeline-slot .slot-title .slot-comment-inline {
    opacity: 0.85;
    font-weight: 500;
    margin-left: 4px;
}

.slot-time {
    font-size: var(--slot-time-font-size, clamp(11px, 2vh, 12px));
    opacity: 0.9;
    line-height: 1.1;
    white-space: nowrap;
    width: 100%;
}

.slot-participants {
    font-size: 10px;
    opacity: 0.9;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.day-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
    padding: 20px;
}

/* Индикатор наличия событий в заголовке дня - цветные точки */
.day-events-indicator {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    margin-left: 12px;
    vertical-align: middle;
}

.day-events-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.day-card-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--tg-theme-hint-color, #999999);
    font-size: 13px;
}

.day-card-loader-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--tg-theme-button-color, #3390ec);
    border-radius: 50%;
    animation: day-card-loader-spin 0.7s linear infinite;
}

@keyframes day-card-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .calendar-header {
        padding: 10px 14px;
        gap: 10px;
        min-height: 52px;
    }

    .calendar-header .nav-btn {
        padding: 7px 14px;
        font-size: 14px;
    }

    .calendar-header .nav-btn-arrow {
        padding: 6px;
        min-width: 32px;
        width: 32px;
        height: 32px;
    }

    .calendar-header .nav-btn-arrow svg {
        display: block;
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .calendar-header .current-period {
        font-size: 14px;
    }

    .calendar-header .today-btn {
        padding: 7px;
        min-width: 48px;
        width: 48px;
        height: 40px;
    }

    .calendar-header .today-btn svg {
        width: 26px;
        height: 26px;
    }

    .calendar-header .today-btn .today-btn-date {
        font-size: 12px;
        transform: translate(-50%, -50%);
    }

    .calendar-header-right {
        gap: 10px;
    }

    .calendar-header .sync-btn {
        padding: 7px;
        min-width: 44px;
        width: 44px;
        height: 36px;
    }

    .calendar-header .sync-btn .sync-icon {
        width: 22px;
        height: 22px;
    }

    .calendar-date-picker-btn {
        padding: 7px;
        min-width: 48px;
        width: 48px;
        height: 40px;
    }

    .calendar-date-picker-btn svg {
        width: 26px;
        height: 26px;
    }

    .calendar-header .menu-toggle-btn {
        padding: 7px 14px;
        gap: 7px;
        font-size: 14px;
    }

    .calendar-header .menu-toggle-btn svg {
        width: 22px;
        height: 22px;
    }

    .calendar-day-card {
        min-width: 180px;
        margin-right: 8px;
    }

    .day-header {
        padding: 6px 12px;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        overflow: hidden;
    }

    .day-timeline {
        height: 1440px;
        /* Фиксированная высота для 24 часов */
    }

    .timeline-slot {
        left: 4px;
        right: 4px;
    }

    .slot-content {
        padding: 2px 6px;
        gap: 2px;
    }

    .slot-title {
        font-size: clamp(11px, min(1vw, 1.3vh), 11px);
    }

    .slot-time {
        font-size: clamp(11px, min(0.9vw, 1.2vh), 11px);
    }
}

@media (max-width: 480px) {
    .calendar-header {
        padding: 8px 12px;
        gap: 8px;
        min-height: 48px;
    }

    .calendar-header .current-period {
        font-size: 12px;
    }

    .calendar-header .nav-btn-arrow {
        padding: 6px;
        min-width: 26px;
        width: 26px;
        height: 26px;
    }

    .calendar-header .nav-btn-arrow svg {
        display: block;
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    .calendar-header .today-btn {
        padding: 6px;
        min-width: 44px;
        width: 44px;
        height: 36px;
    }

    .calendar-header .today-btn svg {
        width: 24px;
        height: 24px;
    }

    .calendar-header .today-btn .today-btn-date {
        font-size: 11px;
        transform: translate(-50%, -50%);
    }

    .calendar-header-right {
        gap: 8px;
    }

    .calendar-header .sync-btn {
        padding: 6px;
        min-width: 40px;
        width: 40px;
        height: 32px;
    }

    .calendar-header .sync-btn .sync-icon {
        width: 20px;
        height: 20px;
    }

    .calendar-date-picker-btn {
        padding: 6px;
        min-width: 44px;
        width: 44px;
        height: 36px;
    }

    .calendar-date-picker-btn svg {
        width: 24px;
        height: 24px;
    }

    .calendar-header .menu-toggle-btn {
        padding: 6px 12px;
        gap: 6px;
        font-size: 13px;
    }

    .calendar-header .menu-toggle-btn svg {
        width: 20px;
        height: 20px;
    }

    .calendar-day-card {
        min-width: 160px;
    }

    .day-timeline {
        height: 1440px;
        /* Фиксированная высота для 24 часов */
    }
}

/* Стили для inline-редактирования комментариев */
.participant-comment-item {
    position: relative;
}

.comment-display {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.comment-edit {
    width: 100%;
}

.comment-edit-input {
    width: 100%;
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 4px;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    box-sizing: border-box;
    font-family: inherit;
}

.comment-edit-input:focus {
    outline: none;
    border-color: var(--tg-theme-link-color, #3390ec);
}

.comment-actions-display,
.comment-actions-edit {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.comment-actions-edit {
    display: none;
}

/* Блокируем клики на раскрытом блоке деталей участника */
.participant-details-expanded-wrapper {
    pointer-events: auto;
}

.participant-details-expanded {
    pointer-events: auto;
}