* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8fafc;
    color: #1a1a1a;
    width: 320px;
    height: auto;
    overflow: visible;
    font-size: 13px;
    line-height: 1.4;
}

.popup-container {
    display: flex;
    flex-direction: column;
    height: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}


/* Стили для авторизации */
.auth-section {
    padding: 18px;
    padding-top: 24px;
    min-width: 320px;
    background: white;
}

.auth-tabs {
    display: flex;
    margin-bottom: 18px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 3px;
}

.tab-button {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tab-button:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.8);
}

.tab-button.active {
    color: #667eea;
    background: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

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

.auth-form.hidden {
    display: none;
}

.auth-form input {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1a1a1a;
    font-weight: 400;
}

.auth-form input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-button {
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:active {
    transform: translateY(0);
}

.verify-info {
    text-align: center;
    margin-bottom: 8px;
}

.verify-info p {
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 4px;
}

.verify-info small {
    color: #6b7280;
    font-size: 12px;
}

.verify-info span {
    color: #667eea;
    font-weight: 600;
}

/* Стили для основного интерфейса */
.main-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    padding-top: 16px;
    min-width: 320px;
    background: white;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-email {
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 600;
}

.logout-button {
    padding: 6px 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logout-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Стили для переключателя прокси */
.proxy-controls {
    margin-bottom: 18px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-label:hover {
    color: #667eea;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    margin-right: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}


/* Стили для состояний */
.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 18px;
    min-width: 320px;
    background: white;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(102, 126, 234, 0.1);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-section p {
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
}

.error-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 12px 20px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.error-message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.error-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.error-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

/* Header */
.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
}


.popup-header h1 {
    font-size: 16px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.header-icon {
    width: 24px;
    height: 24px;
    opacity: 0.95;
    border-radius: 3px;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { 
        transform: translateY(0px);
    }
    50% { 
        transform: translateY(-3px);
    }
}

/* Footer */
.popup-footer {
    background: #f8fafc;
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.version {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 8px;
    border-radius: 6px;
}

/* Основные вкладки */
.main-tabs {
    display: flex;
    /* margin: 8px 8px 0 8px; */
    background: #f8fafc;
    border-radius: 8px;
    padding: 3px;
}

.main-tab-button {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.main-tab-button.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.main-tab-button:hover:not(.active) {
    color: #334155;
}

/* Индикатор непрочитанных сообщений */
.unread-indicator {
    position: relative;
}

.unread-indicator::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Контент вкладок */
.tab-content {
    animation: fadeIn 0.3s ease;
}

/* Стили для обратной связи */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 12px;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.file-help {
    color: #6b7280;
    font-size: 11px;
    margin-top: 4px;
}

.feedback-submit-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.feedback-submit-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.feedback-submit-button:active {
    transform: translateY(0);
}

.feedback-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Заголовки секций */
.tab-content h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* История обращений */
.feedback-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.new-feedback-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-feedback-button:hover {
    background: #059669;
    transform: translateY(-1px);
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.feedback-subject {
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
    margin: 0;
}

.feedback-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.feedback-status.new {
    background: #fef3c7;
    color: #92400e;
}

.feedback-status.in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.feedback-status.resolved {
    background: #d1fae5;
    color: #065f46;
}

.feedback-status.closed {
    background: #f3f4f6;
    color: #374151;
}

.feedback-message-preview {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feedback-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #9ca3af;
}

.feedback-date {
    margin: 0;
}

.feedback-responses-count {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

/* Детальный просмотр обращения */
.feedback-detail {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.feedback-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.feedback-detail-subject {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.feedback-detail-message {
    color: #374151;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.feedback-attachment-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.feedback-attachment-info::before {
    content: '📎';
    font-size: 14px;
}

/* Ответы администратора */
.feedback-responses {
    margin-top: 16px;
}

.feedback-response {
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.feedback-response-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
    color: #6b7280;
}

.feedback-response-admin {
    font-weight: 500;
    color: #1e40af;
}

.feedback-response-message {
    color: #1e293b;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

/* Кнопка возврата */
.back-button {
    background: #f3f4f6;
    color: #374151;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.back-button:hover {
    background: #e5e7eb;
}

/* Стили для чата поддержки */
.support-chat-container {
    display: flex;
    flex-direction: column;
    height: 320px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.chat-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.status-indicator {
    font-size: 8px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafa;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease-out;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.admin {
    align-self: flex-start !important;
    max-width: 80%;
}


.message-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.admin .message-bubble {
    background: #f0f9ff;
    color: #1e293b;
    border: 1px solid #bae6fd;
    border-bottom-right-radius: 4px;
}


.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 10px;
    color: #9ca3af;
}

.message-sender {
    font-weight: 500;
}

.chat-message.user .message-sender {
    color: #93c5fd;
}

.chat-message.admin .message-sender {
    color: #0369a1;
}

.message-time {
    font-size: 10px;
}

.message-attachment {
    margin-top: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
}

.chat-message.admin .message-attachment {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #bae6fd;
}

.message-attachment a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-attachment a:hover {
    text-decoration: underline;
}

/* Превью изображений в сообщениях */
.message-attachment img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-attachment img:hover {
    transform: scale(1.05);
}

/* Стили для файлов (не изображений) */
.message-attachment .file-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.message-attachment .file-link:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.chat-input-container {
    border-top: 1px solid #e2e8f0;
    background: white;
    padding: 4px;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px;
}

.chat-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#chat-message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 8px;
    font-size: 13px;
    outline: none;
    resize: none;
}

#chat-message-input::placeholder {
    color: #9ca3af;
}

.attachment-btn,
.send-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}



/* .attachment-btn {
    margin-right: 8px;
} */

.attachment-btn img {
    filter: grayscale(1);
    opacity: 0.7;
    transition: all 0.2s;
    width: 18px !important;
    height: 18px !important;
}

.attachment-btn:hover {
    background: #e2e8f0;
}

.attachment-btn:hover img {
    filter: grayscale(0);
    opacity: 1;
}

.send-btn {
    background: #3b82f6;
    color: white;
    margin-left: -15px;
}

.send-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 12px;
}

.file-name {
    flex: 1;
    color: #0369a1;
}

.file-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.file-remove:hover {
    background: #fef2f2;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для подписок */
.subscription-status {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.subscription-status.active {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #6ee7b7;
}

.subscription-status.trial {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.subscription-status.expired {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
}

.subscription-status-text {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.subscription-status-details {
    font-size: 12px;
    color: #6b7280;
}

.inline-subscription-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.inline-subscription-badge.trial {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.autopay-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.autopay-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.toggle-label.sm {
    font-size: 12px;
    margin-right: auto;
}

.toggle-label.sm .toggle-slider {
    width: 36px;
    height: 18px;
    margin-right: 8px;
}

.toggle-label.sm .toggle-slider::before {
    width: 12px;
    height: 12px;
    top: 1px;
    left: 1px;
}

.toggle-label.sm input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(18px);
}

.card-mask {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #fecaca;
    border-color: #f87171;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.legal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 10px;
    color: #6b7280;
    cursor: pointer;
}

.legal-checkbox input[type="checkbox"] {
    margin: 0;
    width: 12px;
    height: 12px;
}

.legal-checkbox a {
    color: #3b82f6;
    text-decoration: none;
}

.legal-checkbox a:hover {
    text-decoration: underline;
}

.plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.plan-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.plan-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.plan-card.selected {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.plan-card.popular::before {
    content: 'Популярный';
    position: absolute;
    top: -1px;
    right: -1px;
    background: #3b82f6;
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 0 6px 0 6px;
}

.plan-name {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
}

.plan-price {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2px;
}

.plan-discount {
    font-size: 10px;
    color: #10b981;
    font-weight: 500;
}

.plan-duration {
    font-size: 10px;
    color: #6b7280;
}

.payment-pending {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.pending-title {
    font-weight: 600;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 6px;
}

.payment-pending p {
    font-size: 11px;
    color: #92400e;
    margin-bottom: 8px;
}

.pending-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.subscription-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.subscription-actions button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.legal-note {
    display: block;
    text-align: center;
    color: #9ca3af;
    font-size: 10px;
    line-height: 1.3;
}

/* Адаптивность для планов */
@media (max-width: 300px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plan-card {
    animation: fadeIn 0.3s ease;
}

.subscription-status {
    animation: fadeIn 0.3s ease;
}

.autopay-box {
    animation: fadeIn 0.3s ease;
}

/* Скроллбар для сообщений */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Диалог подтверждения автопродления */
.autorenew-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 300px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.dialog-content h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.dialog-content p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.dialog-content a {
    color: #3b82f6;
    text-decoration: none;
}

.dialog-content a:hover {
    text-decoration: underline;
}

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

.dialog-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}