input[type="file"]::file-selector-button:hover {
    background: var(--hover-color);
}

/* Avatar modal styles */
.tg-modal-avatar-settings {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 420px;
    max-width: 95vw;
    padding: 24px;
    position: relative;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.tg-modal-avatar-settings .tg-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.tg-modal-avatar-settings .tg-modal-close:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.tg-modal-avatar-settings .tg-modal-title {
    font-weight: 600;
    font-size: 1.2em;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 24px;
    padding-right: 40px;
    transition: color 0.3s ease;
}

/* Стили для модального окна создания чата */
.tg-modal-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.tg-modal-group select,
.tg-modal-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95em;
    outline: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.tg-modal-group select:focus,
.tg-modal-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(var(--accent-color-rgb), 0.15);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tg-modal-search-results {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.tg-modal-search-username {
    color: var(--text-primary);
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.tg-modal-selected-user {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 0.9em;
    gap: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tg-modal-selected-user-remove {
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
}

.tg-modal-selected-user-remove:hover {
    background: var(--accent-color);
    color: #fff;
}

.tg-modal-footer {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-top: 1.5px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.tg-modal .tg-modal-close {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0;
}

.tg-modal .tg-modal-close:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.tg-settings-list li a.tg-badge-channel {
    background: rgba(var(--accent-color-rgb), 0.15);
    color: var(--accent-color);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.3s ease;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Обновленные стили для поиска в шапке */
.tg-search-bar-top {
    display: flex;
    align-items: center;
    width: 220px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 0 10px;
    margin: 0;
    box-shadow: none;
    border: none;
    transition: background-color 0.3s ease;
}

.tg-search-bar-top i {
    margin-right: 8px;
    color: var(--text-secondary);
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.tg-search-bar-top .tg-search-input {
    flex: 1;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1em;
    padding: 0;
    outline: none;
    transition: color 0.3s ease;
}

.tg-search-bar-top .tg-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    transition: color 0.3s ease;
}

/* Обновляем стили для верхней панели */
.tg-sidebar-top {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: var(--bg-primary);
    border-bottom: 1.5px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Удаляем лишние линии под поиском */
.tg-search-bar {
    border-bottom: none !important;
}

.tg-chat-type-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 2px;
    margin-bottom: 0;
    line-height: 1.2;
    font-weight: 400;
    transition: color 0.3s ease;
}
.tg-chat-link {
    color: var(--accent-color);
    font-size: 0.9em;
    margin-left: 6px;
    text-decoration: none;
    transition: color 0.3s ease;
}
.tg-chat-link:hover {
    text-decoration: underline;
}

.tg-btn-info {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    font-size: 1.2em;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: background 0.2s, color 0.2s, background-color 0.3s ease, color 0.3s ease;
}
.tg-btn-info:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Skeleton Loader */
.tg-skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: tg-skeleton-pulse 1.2s infinite linear;
    border-radius: 12px;
    min-height: 48px;
    margin-bottom: 12px;
    width: 100%;
}
.tg-skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    margin-right: 14px;
    flex-shrink: 0;
}
.tg-skeleton-line {
    height: 14px;
    width: 60%;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}
.tg-skeleton-line.short {
    width: 30%;
}
@keyframes tg-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.tg-skeleton-chat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    margin-bottom: 0;
}
.tg-skeleton-message {
    height: 32px;
    width: 70%;
    margin: 0 24px 12px 24px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: tg-skeleton-pulse 1.2s infinite linear;
}

.tg-status-online {
    color: var(--status-online-color);
    font-weight: 500;
    transition: color 0.3s ease;
}
.tg-status-offline {
    color: var(--status-offline-color);
    font-weight: 400;
    transition: color 0.3s ease;
}

.tg-dropdown-menu {
    position: absolute;
    top: 50px;
    left: 10px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tg-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tg-dropdown-header {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    transition: border-color 0.3s ease;
}

.tg-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    transition: background-color 0.3s ease;
}

.tg-dropdown-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.tg-dropdown-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.tg-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease, color 0.3s ease;
}

.tg-dropdown-item:hover {
    background-color: var(--hover-color);
}

.tg-dropdown-item i {
    font-size: 18px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.tg-theme-dropdown {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 8px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    z-index: 10000;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tg-theme-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.tg-chat-item.active {
    background: var(--bg-tertiary);
    transition: background-color 0.3s ease;
}

.tg-unread-badge {
    background: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75em;
    padding: 2px 6px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(var(--accent-color-rgb), 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 8px;
    position: relative;
    top: -1px;
}

/* User Info Panel */
.tg-user-info-panel {
    position: fixed;
    top: 0;
    right: -420px; /* Updated to fully hide the panel */
    width: 420px; /* Increased width */
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 999;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out, background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tg-user-info-panel.active {
    right: 0;
}

.tg-user-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tg-user-info-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tg-user-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed to space-between to push items to ends */
    padding: 14px 24px;
    background: var(--bg-primary);
    border-bottom: 1.5px solid var(--border-color);
    position: relative;
    z-index: 2;
}

.tg-user-info-header-content {
    display: flex;
    align-items: center;
    /* flex-grow: 1; */ /* Removed to prevent it from occupying all space */
    gap: 12px;
    justify-content: center; /* Center its own content (avatar, text) */
    position: absolute; /* Take out of flow to prevent overlap */
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none; /* Allow clicks to pass through */
    width: calc(100% - 48px - 48px); /* Adjust width to fit between buttons */
}

.tg-user-info-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tg-user-info-header-avatar.visible {
    opacity: 1;
}

.tg-user-info-header-text {
    display: flex;
    flex-direction: column;
    /* Removed flex-grow: 1; */
    align-items: center; /* Center content vertically */
}

.tg-user-info-close {
    position: relative; /* Keep relative to be part of flex layout */
    left: auto;
    z-index: 10; /* Ensure it's clickable on top */
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent button from shrinking */
    pointer-events: auto; /* Explicitly ensure it's clickable */
}

.tg-user-info-close:hover {
    color: var(--text-primary);
}

.tg-user-info-title {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
    transition: color 0.3s ease, margin-right 0.2s ease;
}

.tg-user-info-header-username {
    font-size: 0.9em;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tg-user-info-header-username.visible {
    opacity: 1;
}

.tg-user-info-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    /* Original styles */

    /* Scrollbar styling for consistency */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-secondary);
    transition: scrollbar-color 0.3s ease, background-color 0.3s ease;
}

.tg-user-info-body::-webkit-scrollbar {
    width: 8px;
    background: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

.tg-user-info-body::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.tg-user-info-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.tg-user-info-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    transition: opacity 0.2s ease;
}

.tg-user-info-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid var(--accent-color);
    transition: opacity 0.2s ease;
}

.tg-user-info-name {
    font-weight: 700;
    font-size: 1.5em;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: opacity 0.2s ease;
}

.tg-user-info-status {
    color: var(--text-secondary);
    font-size: 0.95em;
    transition: opacity 0.2s ease;
}

.tg-user-info-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Enhanced shadow for more depth */
    border: 1.5px solid var(--border-color);
}

.tg-user-info-bio {
    color: var(--text-primary);
    font-size: 1em;
    line-height: 1.5;
    transition: opacity 0.2s ease;
}

@media (max-width: 900px) {
    .tg-user-info-panel {
        width: 100%; /* Make it full width on smaller screens */
        right: -100%;
    }
}

.tg-user-info-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
    opacity: 0.5;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.tg-user-info-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1.5px solid var(--border-color);
}

.tg-chat-status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.tg-message-text-wrapper {
    max-height: none;
    overflow: visible;
    transition: none;
    display: block;
}
.tg-message-text {
    white-space: pre-wrap;
    word-break: break-word;
    /* без max-height и overflow! */
}

.tg-message-text.expanded {
    max-height: 2000px;
}

.tg-message-text.collapsing {
    max-height: 200px;
    opacity: 0.8;
}

.tg-message-toggle {
    color: var(--accent-color);
    background: rgba(128, 128, 128, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 12px;
    margin: 8px 0;
    cursor: pointer;
    font-size: 0.9em;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: none;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.tg-message-toggle:hover {
    opacity: 1;
    background: rgba(128, 128, 128, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.tg-message-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.tg-message-toggle:hover::before {
    transform: translateX(100%);
}

.tg-message-toggle.visible {
    display: block;
}

.tg-message-bubble {
    display: flex;
    flex-direction: column;
}

.tg-user-info-section {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tg-settings-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-bottom: 8px;
}

.tg-user-info-bio {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.tg-user-info-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.tg-user-info-value {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.tg-user-info-value:hover {
    color: #fff;
}

.tg-user-info-value.copied {
    color: #4CAF50;
}

.tg-modal-profile {
    max-width: 500px;
    width: 90%;
    margin: 20px auto;
}

.tg-profile-avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.tg-profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.tg-profile-info-section {
    padding: 0 20px;
}

.tg-profile-name {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.tg-profile-bio {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.tg-profile-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.tg-profile-section {
    margin-bottom: 15px;
}

.tg-profile-section-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.tg-profile-value {
    color: var(--text-primary);
    font-size: 16px;
    word-break: break-all;
}

.tg-profile-value.tg-user-id {
    cursor: pointer;
    user-select: all;
}

.tg-profile-value.tg-user-id:hover {
    color: var(--primary-color);
}

.tg-profile-value.copied {
    color: var(--success-color);
}

@media (max-width: 300px) {
    .tg-modal-profile {
        width: 95%;
        margin: 10px auto;
    }
    
    .tg-profile-avatar-large {
        width: 100px;
        height: 100px;
    }
    
    .tg-profile-name {
        font-size: 20px;
    }
}

.tg-settings-group {
    margin-bottom: 1rem;
}

.tg-settings-group label {
    display: block;
    margin-bottom: 0.5rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.tg-settings-input,
.tg-settings-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.tg-settings-input:focus,
.tg-settings-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.tg-settings-textarea {
    min-height: 100px;
    resize: vertical;
}

.tg-settings-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.tg-settings-switch input {
    display: none;
}

.tg-settings-switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 12px;
    margin-right: 12px;
    transition: background-color 0.2s;
}

.tg-settings-switch-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.tg-settings-switch input:checked + .tg-settings-switch-slider {
    background-color: var(--primary-color);
}

.tg-settings-switch input:checked + .tg-settings-switch-slider:before {
    transform: translateX(20px);
}

.tg-settings-switch-label {
    color: var(--text-primary);
    font-size: 14px;
}

.tg-modal-settings .tg-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

.tg-modal-settings .tg-settings-section {
    margin-bottom: 30px;
}

.tg-modal-settings .tg-settings-section:last-child {
    margin-bottom: 0;
}

.tg-modal-settings .tg-settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 300px) {
    .tg-modal-settings .tg-modal-body {
        padding: 15px;
    }
    
    .tg-settings-switch-slider {
        width: 36px;
        height: 20px;
    }
    
    .tg-settings-switch-slider:before {
        width: 16px;
        height: 16px;
    }
    
    .tg-settings-switch input:checked + .tg-settings-switch-slider:before {
        transform: translateX(16px);
    }
}

/* Updated scrollbar styles to be hidden by default and appear on hover */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

*:hover::-webkit-scrollbar-thumb {
    background: var(--accent-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-primary);
}

/* Account Settings Modal Styles */
.tg-settings-disabled {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tg-settings-disabled i {
    font-size: 1.2em;
    color: var(--accent-color);
    flex-shrink: 0;
}

.tg-settings-disabled span {
    flex: 1;
    min-width: 0;
}

.tg-settings-group {
    margin-bottom: 20px;
}

.tg-settings-group:last-child {
    margin-bottom: 0;
}

.tg-settings-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95em;
    transition: color 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tg-settings-input,
.tg-settings-textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95em;
    outline: none;
    transition: all 0.2s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.tg-settings-input:focus,
.tg-settings-textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(var(--accent-color-rgb), 0.15);
}

.tg-settings-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
    max-height: 200px;
}

.tg-bio-counter {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    float: right;
}

.tg-bio-counter.error {
    color: #ff4d4f;
    background-color: rgba(255, 77, 79, 0.1);
    font-weight: 500;
}

.tg-modal-settings .tg-modal-footer {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-top: 1.5px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.tg-modal-settings .tg-modal-footer .tg-btn {
    min-width: 120px;
    padding: 10px 20px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.tg-modal-settings .tg-modal-footer .tg-btn:hover {
    background: var(--hover-color);
}

/* Адаптивные стили для модального окна настроек */
@media (max-width: 600px) {
    .tg-modal-settings {
        width: 95vw;
        max-width: 95vw;
        margin: 10px;
    }
    
    .tg-modal-settings .tg-modal-body {
        padding: 16px;
        max-height: 60vh;
    }
    
    .tg-modal-settings .tg-modal-header {
        padding: 16px 20px;
    }
    
    .tg-modal-settings .tg-modal-header span {
        font-size: 1.1em;
    }
    
    .tg-settings-section {
        margin-bottom: 24px;
    }
    
    .tg-settings-section-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .tg-settings-group {
        margin-bottom: 16px;
    }
    
    .tg-settings-input,
    .tg-settings-textarea {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .tg-settings-textarea {
        min-height: 80px;
        max-height: 150px;
    }
    
    .tg-settings-disabled {
        padding: 12px;
        font-size: 0.9em;
        gap: 8px;
    }
    
    .tg-settings-disabled i {
        font-size: 1.1em;
    }
    
    .tg-modal-settings .tg-modal-footer {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .tg-modal-settings .tg-modal-footer .tg-btn {
        min-width: 100px;
        padding: 8px 16px;
        font-size: 0.9em;
    }
}

@media (max-width: 400px) {
    .tg-modal-settings {
        width: 98vw;
        max-width: 98vw;
        margin: 5px;
    }
    
    .tg-modal-settings .tg-modal-body {
        padding: 12px;
        max-height: 50vh;
    }
    
    .tg-modal-settings .tg-modal-header {
        padding: 12px 16px;
    }
    
    .tg-modal-settings .tg-modal-header span {
        font-size: 1em;
    }
    
    .tg-settings-section {
        margin-bottom: 20px;
    }
    
    .tg-settings-section-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .tg-settings-group {
        margin-bottom: 12px;
    }
    
    .tg-settings-input,
    .tg-settings-textarea {
        padding: 8px;
        font-size: 0.85em;
    }
    
    .tg-settings-textarea {
        min-height: 70px;
        max-height: 120px;
    }
    
    .tg-settings-disabled {
        padding: 10px;
        font-size: 0.85em;
        gap: 6px;
    }
    
    .tg-settings-disabled i {
        font-size: 1em;
    }
    
    .tg-modal-settings .tg-modal-footer {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .tg-modal-settings .tg-modal-footer .tg-btn {
        min-width: 90px;
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

@media (max-width: 300px) {
    .tg-modal-settings {
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
    }
    
    .tg-modal-settings .tg-modal-header {
        border-radius: 0;
    }
    
    .tg-modal-settings .tg-modal-body {
        border-radius: 0;
        padding: 10px;
        max-height: 45vh;
    }
    
    .tg-settings-switch-slider {
        width: 36px;
        height: 20px;
    }
    
    .tg-settings-switch-slider:before {
        width: 16px;
        height: 16px;
    }
    
    .tg-settings-switch input:checked + .tg-settings-switch-slider:before {
        transform: translateX(16px);
    }
    
    .tg-settings-group {
        margin-bottom: 10px;
    }
    
    .tg-settings-input,
    .tg-settings-textarea {
        padding: 6px;
        font-size: 0.8em;
    }
    
    .tg-settings-textarea {
        min-height: 60px;
        max-height: 100px;
    }
    
    .tg-settings-disabled {
        padding: 8px;
        font-size: 0.8em;
        gap: 4px;
    }
    
    .tg-settings-disabled i {
        font-size: 0.9em;
    }
    
    .tg-modal-settings .tg-modal-footer {
        padding: 8px 10px;
        gap: 4px;
    }
    
    .tg-modal-settings .tg-modal-footer .tg-btn {
        min-width: 80px;
        padding: 5px 10px;
        font-size: 0.8em;
    }
}

.tg-input-counter {
    position: absolute;
    right: 50px;
    bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.tg-input-counter.error {
    color: #ff4d4f;
    background-color: rgba(255, 77, 79, 0.1);
    font-weight: 500;
}

.tg-join-group-btn {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tg-join-group-btn:hover {
    background-color: var(--tg-theme-button-color-hover);
}

.tg-join-group-btn:active {
    transform: scale(0.98);
}

/* Notification styles */
.tg-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.tg-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.tg-notification-success {
    background-color: #4CAF50;
    color: white;
}

.tg-notification-error {
    background-color: #f44336;
    color: white;
}

.tg-notification-info {
    background-color: #2196F3;
    color: white;
}

.tg-context-menu {
    position: fixed;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 4px;
    z-index: 1000;
    min-width: 150px;
}

.tg-context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.tg-context-menu-item:hover {
    background-color: var(--bg-secondary);
}

.tg-context-menu-item:active {
    background-color: var(--bg-tertiary);
}

.tg-message-form button[type="submit"].editing {
    background-color: var(--accent-color);
}

.tg-message-form button[type="submit"].editing:hover {
    background-color: var(--accent-color-hover);
}

.tg-message-edited {
    color: var(--text-secondary);
    font-size: 0.8em;
    margin-right: 4px;
    opacity: 0.7;
}

.tg-message-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Блокировка/разблокировка */
.tg-blocked-notice {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    color: var(--accent-color);
    border: 1.5px solid var(--accent-color);
    border-radius: 8px;
    padding: 18px 28px;
    margin: 18px 0 14px 0;
    font-size: 1em;
    box-shadow: 0 2px 8px rgba(var(--accent-color-rgb),0.04);
    gap: 12px;
    animation: fadeInBlocked 0.3s;
}
.tg-blocked-notice .tg-blocked-icon {
    font-size: 1.4em;
    margin-right: 10px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
}
.tg-blocked-notice .tg-blocked-text {
    color: var(--text-primary);
    font-size: 1em;
    font-weight: 500;
    margin-right: 10px;
    flex: 1;
}
.tg-unblock-btn {
    margin-left: 12px;
    padding: 6px 18px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.2s;
    box-shadow: 0 1px 4px rgba(var(--accent-color-rgb),0.08);
}
.tg-unblock-btn:hover {
    background: var(--hover-color);
    color: var(--accent-color);
}
@keyframes fadeInBlocked {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* --- Call Modal Modern Styles --- */
.tg-modal-call-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 32px 24px 24px 24px;
    background: var(--bg-primary);
    border-radius: 0 0 16px 16px;
    min-width: 320px;
    min-height: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}
.tg-call-user-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px;
    gap: 10px;
}
.tg-call-avatar-wrapper {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}
.tg-call-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: block;
    border: 2px solid var(--accent-color);
    transition: box-shadow 0.2s;
}
.tg-call-avatar-fallback {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    font-size: 2.6em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    border: 2px solid var(--accent-color);
}
.tg-call-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.tg-call-user-name {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    text-align: center;
}
.tg-call-user-status {
    font-size: 0.95em;
    color: var(--text-secondary);
    text-align: center;
}
.tg-call-status {
    margin: 18px 0 18px 0;
    font-size: 1.1em;
    color: var(--accent-color);
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.01em;
}
.tg-modal-call-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
}
.tg-modal-call-actions .tg-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.1em;
    padding: 0 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tg-modal-call-actions .tg-btn-success {
    background: var(--accent-color);
    color: #fff;
}
.tg-modal-call-actions .tg-btn-danger {
    background: #f44336;
    color: #fff;
}
.tg-modal-call-actions .tg-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-color);
}
@media (max-width: 600px) {
    .tg-modal-call-body {
        min-width: 0;
        padding: 18px 4vw 18px 4vw;
    }
    .tg-call-avatar-wrapper, .tg-call-avatar, .tg-call-avatar-fallback {
        width: 64px;
        height: 64px;
        font-size: 1.6em;
    }
}

/* --- Group Call Modal Styles --- */
.tg-modal-group-call {
    width: 90vw;
    max-width: 1700px;
    height: 90vh;
    min-width: 800px; /* Гарантируем минимальную ширину */
    display: flex;
    flex-direction: column;
    padding: 0;
}

.tg-group-call-body {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
}

.tg-group-call-screens {
    flex-grow: 1;
    background: var(--bg-primary);
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
    gap: 16px;
    overflow-y: auto;
    position: relative;
    align-content: flex-start;
}

/* Добавлено для расширенного просмотра */
.tg-group-call-screens.has-expanded .tg-group-call-screen-item:not(.expanded) {
    display: none;
}

.tg-group-call-screen-item {
    position: relative;
    width: 100%;
    background-color: black;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    transition: all 0.3s ease;
}
/* Добавлено для расширенного просмотра */
.tg-group-call-screen-item.expanded {
    position: absolute;
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    z-index: 10;
}
.tg-group-call-screen-item video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.tg-group-call-screen-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}
/* Добавлен контейнер для кнопок управления */
.tg-group-call-screen-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.tg-group-call-screen-fullscreen,
.tg-group-call-screen-expand {
    position: static;
    border: none;
    background: rgba(0,0,0,0.5);
    color: white;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s;
}
.tg-group-call-screen-fullscreen:hover,
.tg-group-call-screen-expand:hover {
    background: rgba(0,0,0,0.8);
}


.tg-group-call-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.tg-group-call-user-list-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.tg-group-call-user-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tg-group-call-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    background-color: var(--bg-primary);
    transition: background-color 0.2s ease;
}

.tg-group-call-user-item:not(.is-self) {
    cursor: pointer;
}

.tg-group-call-user-item:not(.is-self):hover {
    background-color: var(--hover-color);
}

.is-self-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-left: 4px;
}

.tg-group-call-user-avatar,
.tg-group-call-user-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tg-group-call-user-avatar-fallback {
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.tg-group-call-user-name {
    flex-grow: 1;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-group-call-user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.tg-group-call-footer {
    border-top: 1.5px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .tg-modal-group-call {
        width: 100vw !important;
        height: 100vh !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    .tg-group-call-body {
        flex-direction: column;
    }

    .tg-group-call-screens {
        grid-template-columns: 1fr;
        padding: 8px;
        gap: 8px;
    }

    .tg-group-call-screen-item.expanded {
        top: 8px;
        left: 8px;
        width: calc(100% - 16px);
        height: calc(100% - 16px);
    }

    .tg-group-call-sidebar {
        width: 100%;
        flex-shrink: 0;
        height: 40%; /* Выделяем 40% высоты под список участников */
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 8px;
    }

    .tg-group-call-user-list-title {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .tg-group-call-user-item {
        padding: 6px;
    }

    .tg-group-call-user-avatar,
    .tg-group-call-user-avatar-fallback {
        width: 32px;
        height: 32px;
    }

    .tg-group-call-footer {
        padding: 8px;
        gap: 8px;
        flex-wrap: wrap;
    }
}

/* Allow interaction with page when call is minimized */
.tg-modal-bg.minimized-mode {
    background: transparent;
    pointer-events: none;
    /* We don't want the flexbox centering to affect the minimized modal */
    align-items: initial;
    justify-content: initial;
}

.tg-modal-group-call.minimized {
    position: fixed !important;
    right: 24px;
    bottom: 24px;
    width: 320px !important;
    height: 64px !important;
    min-width: 0 !important;
    max-width: 90vw !important;
    max-height: 90px !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    z-index: 99999;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    overflow: hidden;
    pointer-events: auto; /* Make sure the bar is clickable */
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
}
.tg-modal-group-call.minimized .tg-modal-header,
.tg-modal-group-call.minimized .tg-group-call-body,
.tg-modal-group-call.minimized .tg-group-call-footer {
    display: none !important;
}
.tg-group-call-minimized-bar {
    display: none;
}
.tg-modal-group-call.minimized .tg-group-call-minimized-bar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 18px;
    background: var(--bg-primary);
    cursor: move;
    gap: 14px;
}
.tg-group-call-minimized-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1em;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tg-group-call-minimized-count {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.1em;
    margin-left: 8px;
}
.tg-group-call-minimized-mic {
    color: var(--text-secondary);
    margin-left: 8px;
}
.tg-group-call-minimized-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 8px;
    transition: color 0.2s;
}
.tg-group-call-minimized-close:hover {
    color: var(--accent-color);
}
@media (max-width: 600px) {
    .tg-modal-group-call.minimized {
        right: 8px;
        bottom: 8px;
        width: 98vw !important;
        min-width: 0 !important;
        max-width: 98vw !important;
        height: 54px !important;
        max-height: 60px !important;
        border-radius: 10px !important;
        padding: 0;
    }
    .tg-modal-group-call.minimized .tg-group-call-minimized-bar {
        padding: 0 8px;
    }
}

.tg-group-call-user-avatar.active-speaker {
    box-shadow: 0 0 0 3px var(--accent-color), 0 0 12px 4px rgba(var(--accent-color-rgb), 0.4);
    animation: tg-active-speaker-pulse 1s infinite alternate;
}
@keyframes tg-active-speaker-pulse {
    0% { box-shadow: 0 0 0 3px var(--accent-color), 0 0 12px 4px rgba(var(--accent-color-rgb), 0.2); }
    100% { box-shadow: 0 0 0 6px var(--accent-color), 0 0 24px 8px rgba(var(--accent-color-rgb), 0.5); }
}

/* --- Group Call User Context Menu --- */
.tg-group-call-context-menu {
    position: fixed;
    z-index: 100000;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    padding: 8px;
    min-width: 220px;
    display: none; /* Hidden by default */
}

.tg-group-call-context-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    gap: 12px;
}

.tg-group-call-context-menu-item:hover {
    background-color: var(--hover-color);
}

.tg-group-call-context-menu-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1em;
}

.tg-group-call-context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.tg-group-call-volume-control {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    gap: 12px;
}

.tg-group-call-volume-control span {
    width: 40px;
    text-align: right;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.tg-group-call-volume-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    transition: opacity 0.2s;
}

.tg-group-call-volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}

.tg-group-call-volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.tg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-primary);
    transition: color 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tg-checkbox-label:hover {
    color: var(--accent-color);
}

.tg-settings-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .tg-checkbox-label {
        font-size: 0.9em;
        gap: 8px;
    }
    
    .tg-settings-checkbox {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 400px) {
    .tg-checkbox-label {
        font-size: 0.85em;
        gap: 6px;
    }
    
    .tg-settings-checkbox {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 300px) {
    .tg-checkbox-label {
        font-size: 0.8em;
        gap: 4px;
    }
    
    .tg-settings-checkbox {
        width: 12px;
        height: 12px;
    }
}