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

/* Улучшение touch-интерфейса на мобильных */
button, a, [role="button"] {
    -webkit-tap-highlight-color: rgba(79, 70, 229, 0.2);
    touch-action: manipulation;
}

:root {
    --primary-blue: #4F46E5;
    --primary-blue-hover: #4338CA;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --border-gray: #E5E7EB;
    --error-red: #EF4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #F9FAFB 0%, #E0E7FF 50%, #FCE7F3 100%);
    min-height: 100vh;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-text-reslide {
    color: var(--text-dark);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Видимость по состоянию авторизации (JS ставит class на body) */
body.user-authenticated #auth-buttons {
    display: none !important;
}
body:not(.user-authenticated) #user-menu {
    display: none !important;
}
body.user-authenticated #user-menu {
    display: flex !important;
}

.btn-signin {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.btn-signin:hover {
    color: var(--primary-blue);
}

.btn-signup {
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.btn-signup:hover {
    background: var(--primary-blue-hover);
}

.btn-blog {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    white-space: nowrap;
}

.btn-blog:hover {
    color: var(--primary-blue);
    background: var(--bg-light);
}

.btn-articles {
    background: #10b981;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin-right: 1rem;
    display: inline-block;
}

.btn-articles:hover {
    background: #059669;
}

.btn-admin {
    background: #EF4444;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin-right: 1rem;
    display: inline-block;
}

.btn-admin:hover {
    background: #DC2626;
}

.btn-logout {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-logout:hover {
    background: var(--bg-light);
    border-color: var(--text-dark);
}

.btn-profile {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.btn-profile:hover {
    background: var(--bg-light);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

#user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    min-height: 0;
}

/* Site footer — в одном стиле с header */
body .site-footer {
    background: #ffffff;
    background: var(--bg-white);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.08);
    margin-top: auto;
    flex-shrink: 0;
}
body .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
body .footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
body .footer-refresh-btn {
    background: none;
    border: none;
    color: #6B7280;
    color: var(--text-gray);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}
body .footer-refresh-btn:hover {
    color: #4F46E5;
    color: var(--primary-blue);
}
body .footer-link {
    color: #6B7280;
    color: var(--text-gray);
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
}
body .footer-link:hover {
    color: #4F46E5;
    color: var(--primary-blue);
}

/* Welcome Page */
.welcome-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.welcome-container {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.welcome-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.welcome-subtitle {
    font-size: 1.5rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.welcome-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

.btn-welcome-primary {
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-welcome-primary:hover {
    background: var(--primary-blue-hover);
}

.btn-welcome-secondary {
    background: var(--bg-white);
    color: var(--primary-blue);
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--primary-blue);
    transition: all 0.2s;
}

.btn-welcome-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Carousel Page */
.carousel-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.carousel-container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.carousel-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 2.5rem;
}

.input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.tab-btn {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    color: var(--text-gray);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--text-dark);
    border-color: var(--text-dark);
    font-weight: 600;
}

.tab-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.input-section {
    margin-bottom: 2rem;
}

.text-input {
    width: 100%;
    padding: 1.5rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-white);
    color: var(--text-dark);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-create-carousel {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-create-carousel:hover {
    background: var(--primary-blue-hover);
}

.carousel-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 0.75rem;
    border: 1px solid var(--border-gray);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.auth-container {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-gray);
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-input {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-error {
    background: #FEE2E2;
    color: var(--error-red);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.btn-auth-submit {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
}

.btn-auth-submit:hover {
    background: var(--primary-blue-hover);
}

.auth-footer {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-top: 1rem;
}

.auth-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    color: var(--text-gray);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-gray);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.9rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background: var(--bg-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google-icon {
    flex-shrink: 0;
}

/* Review Page */
.review-page {
    min-height: calc(100vh - 80px);
    background: #F3F4F6;
    padding: 2rem;
}

.review-no-submission {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.review-no-submission-inner {
    text-align: center;
    max-width: 420px;
    padding: 2rem;
}

.review-no-submission-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.review-no-submission-text {
    margin: 0 0 1.5rem;
    color: #6B7280;
    line-height: 1.5;
}

.review-no-submission-footer {
    margin: 1.5rem 0 0;
    font-size: 0.9rem;
}

.review-container {
    max-width: 1400px;
    margin: 0 auto;
}

.review-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.review-nav-right {
    display: flex;
    gap: 1rem;
}

.btn-back {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-back:hover {
    background: var(--primary-blue-hover);
}

.btn-edit-toggle {
    background: #E5E7EB;
    color: var(--text-dark);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-edit-toggle:hover {
    background: #D1D5DB;
}

.btn-next {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-next:hover {
    background: var(--primary-blue-hover);
}

.review-main {
    display: flex;
    gap: 2rem;
    position: relative;
}

.review-content {
    flex: 1;
    background: white;
    border-radius: 1rem;
    padding: 2rem;
}

.review-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.review-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.review-subtitle {
    font-size: 1rem;
    color: var(--text-gray);
}

.btn-add-slide {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-add-slide:hover {
    background: var(--primary-blue-hover);
}

.slides-preview-container {
    margin-top: 2rem;
}

.slides-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.slide-card {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.slide-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.slide-card-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    padding-right: 2rem;
}

.slide-move-controls {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.slide-order-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-gray);
}

.slide-move-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: var(--primary-blue);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.slide-move-btn:hover:not(:disabled) {
    background: var(--primary-blue-hover);
    color: #ffffff;
}

.slide-move-btn:disabled {
    opacity: 0.45;
    background: #a5b4fc;
    color: #eef2ff;
    cursor: not-allowed;
}

.slide-delete {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #EC4899;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.slide-delete:hover {
    opacity: 0.7;
}

.slide-content {
    margin-top: 0.5rem;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.slide-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.slide-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5em;
}

.slide-subtitle {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5em;
}

/* Edit Sidebar */
.edit-sidebar {
    position: fixed;
    right: -400px;
    top: 80px;
    bottom: 0;
    width: 400px;
    background: white;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.edit-sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.sidebar-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.sidebar-close:hover {
    color: var(--text-dark);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.slide-edit-form {
    margin-bottom: 2rem;
}

.slide-edit-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.slide-edit-title {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.slide-edit-title:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.slide-edit-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    color: var(--text-dark);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.btn-update {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.btn-update:hover {
    background: var(--primary-blue-hover);
}

/* Responsive - планшеты и ниже */
@media (max-width: 1024px) {
    .header-container {
        padding: 0.75rem 1rem;
    }

    .review-main {
        flex-direction: column;
    }

    .review-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .review-nav {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .review-nav-right {
        flex-wrap: wrap;
    }
}

/* Responsive - телефоны и узкие экраны */
@media (max-width: 768px) {
    .header-container {
        padding: 0.6rem 0.75rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .logo {
        flex-shrink: 0;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .header-actions {
        gap: 0.35rem;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .btn-signin,
    .btn-signup {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }

    .btn-blog {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .btn-articles,
    .btn-admin {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .welcome-page,
    .carousel-page,
    .auth-page {
        padding: 1rem;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: 1.1rem;
    }

    .welcome-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .welcome-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 2.5rem;
    }

    .btn-welcome-primary,
    .btn-welcome-secondary {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .welcome-features {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-top: 2rem;
    }

    .feature-item {
        padding: 1.5rem;
    }

    .carousel-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .input-tabs {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    .text-input {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .auth-container {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .review-page {
        padding: 1rem;
    }

    .review-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .review-nav-right {
        justify-content: stretch;
    }

    .review-nav-right .btn-edit-toggle,
    .review-nav-right .btn-next {
        flex: 1;
    }

    .review-header {
        flex-direction: column;
        align-items: stretch;
    }

    .review-title {
        font-size: 1.5rem;
    }

    .btn-add-slide {
        width: 100%;
        justify-content: center;
    }

    .review-content {
        padding: 1.25rem;
    }

    .slides-preview {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .slide-card {
        padding: 1.25rem;
    }

    .slide-move-btn {
        width: 26px;
        height: 26px;
    }

    .edit-sidebar {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        width: 90%;
        max-width: 500px;
        margin: 1rem;
        max-height: 85vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Телефоны: всё в одну линию */
@media (max-width: 480px) {
    .header {
        min-height: auto;
    }

    .header-container {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0.5rem 0.5rem !important;
        gap: 0.5rem !important;
    }

    .header-container .logo {
        flex-shrink: 0;
    }

    .logo-text {
        font-size: 1rem;
    }

    .header-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.35rem !important;
        flex-shrink: 1;
        min-width: 0;
    }

    #auth-buttons,
    #user-menu {
        flex-wrap: nowrap !important;
        gap: 0.35rem !important;
    }

    .btn-blog,
    .btn-signin,
    .btn-signup,
    .btn-admin {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }
}

@media (max-width: 400px) {
    .welcome-title {
        font-size: 1.75rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    margin: 1rem;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.modal-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.modal-input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    color: var(--text-dark);
    min-height: 200px;
    line-height: 1.5;
}

.modal-rich-editor {
    background: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.text-mini-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 0.7rem;
    padding: 0.45rem;
    border: 1px solid var(--border-gray);
    border-radius: 10px;
    background: #f8fafc;
}

.text-mini-toolbar-inline {
    margin: 0.55rem 0 0.4rem;
}

.text-mini-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #eef2ff;
    color: var(--primary-blue);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.text-mini-btn:hover {
    border-color: var(--primary-blue-hover);
    background: #e0e7ff;
    color: var(--primary-blue-hover);
}

/* Force review toolbar visual style over browser defaults */
.review-page .text-mini-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.45rem !important;
    border: 1px solid var(--border-gray) !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
}

.review-page .text-mini-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border: 1px solid #c7d2fe !important;
    border-radius: 8px !important;
    background: #eef2ff !important;
    color: var(--primary-blue) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
}

.review-page .text-mini-btn:hover {
    border-color: var(--primary-blue-hover) !important;
    background: #e0e7ff !important;
    color: var(--primary-blue-hover) !important;
}

.slide-edit-input[contenteditable="true"] {
    min-height: 90px;
    white-space: pre-wrap;
    word-break: break-word;
}

.slide-edit-input[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.btn-modal-cancel {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-gray);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel:hover {
    background: var(--bg-light);
    border-color: var(--text-gray);
    color: var(--text-dark);
}

.btn-modal-save {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-modal-save:hover {
    background: var(--primary-blue-hover);
}

/* Styles Page */
.styles-page {
    min-height: calc(100vh - 80px);
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.styles-container {
    width: 100%;
}

.styles-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.styles-main {
    width: 100%;
}

.styles-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 2rem;
}

.styles-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    background: var(--bg-white);
    padding: 0.25rem;
    border-radius: 0.75rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-button {
    padding: 0.75rem 2rem;
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tab-button.active {
    background: var(--bg-light);
    color: var(--text-dark);
}

.tab-button:hover:not(.active) {
    color: var(--text-dark);
}

.tab-content {
    display: none;
}

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

.template-category {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: left;
}

.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.style-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.style-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.style-card.selected {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

.style-preview {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 0.75rem 0.75rem 0 0;
    position: relative;
    overflow: hidden;
}

.reslide-preview {
    background: rgb(3, 72, 169);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem;
    color: white;
}

.reslide-preview .preview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: white;
    text-align: left;
    font-family: Arial, Helvetica, sans-serif;
}

.reslide-preview .preview-body {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    font-family: Arial, Helvetica, sans-serif;
}

.template-preview {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.template-1 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 300"><rect fill="%2310b981" width="200" height="300"/><path d="M0 200 Q50 150 100 200 T200 200 L200 300 L0 300 Z" fill="%23059669" opacity="0.5"/></svg>');
}

.template-2 {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 300"><rect fill="%231f2937" width="200" height="300"/><rect x="20" y="20" width="160" height="200" fill="%23111827" opacity="0.3"/></svg>');
}

.template-3 {
    background: repeating-conic-gradient(#f3f4f6 0% 25%, #e5e7eb 0% 50%) 50% / 20px 20px;
    background-color: #ffffff;
}

.template-overlay {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 0.5rem;
}

.template-name {
    font-size: 0.875rem;
    font-weight: 600;
    display: block;
}

.style-label {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--bg-white);
}

/* Responsive styles for styles page */
@media (max-width: 768px) {
    .styles-page {
        padding: 1rem;
    }

    .styles-title {
        font-size: 2rem;
    }

    .styles-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Edit Style Page */
.edit-style-page {
    min-height: calc(100vh - 80px);
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.edit-style-container {
    width: 100%;
}

/* Top editing panel with tabs */
.edit-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-gray);
}

.btn-undo,
.btn-redo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: var(--bg-light);
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn-undo:hover:not(:disabled),
.btn-redo:hover:not(:disabled) {
    background: #D1D5DB;
}

.btn-undo:disabled,
.btn-redo:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.edit-panel-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.edit-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.edit-tab:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--text-dark);
}

.edit-tab.active {
    background: var(--bg-light);
    color: var(--text-dark);
}

.edit-tab[data-section="background"].active .edit-tab-bg-swatch {
    box-shadow: 0 0 0 2px var(--primary-blue);
}

.edit-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.edit-tab-icon {
    width: 28px;
    height: 28px;
    display: block;
    flex-shrink: 0;
}

.edit-tab-bg-swatch {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: block;
    background: #be185d;
}

.edit-panel-actions {
    display: flex;
    gap: 0.75rem;
}

.edit-panel-actions .btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-style-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.edit-style-nav-right {
    display: flex;
    gap: 1rem;
}

.btn-save-template {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-template:hover {
    background: var(--border-gray);
}

.btn-export {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-export:hover {
    background: var(--primary-blue-hover);
}

.edit-style-main {
    display: grid;
    grid-template-columns: 140px 1fr 360px;
    gap: 1.25rem;
    align-items: start;
    position: relative;
}

/* Left sidebar: all slides thumbnails */
.edit-style-thumbnails {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.thumbnails-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    flex-shrink: 0;
}

.thumbnails-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.thumbnails-add-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.thumbnails-add-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: var(--bg-light);
}

.thumbnails-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.thumbnail-item {
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-white);
    text-align: left;
    padding: 0;
}

.thumbnail-item:hover {
    border-color: var(--border-gray);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-item.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 1px var(--primary-blue);
}

.thumbnail-item .thumb-preview {
    aspect-ratio: 9 / 16;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 8px 7px;
    font-size: 0.56rem;
    line-height: 1.3;
    overflow: hidden;
}

.thumb-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.35rem 0;
    gap: 0.25rem;
}

.thumb-slide-number {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-gray);
}

.thumb-delete-btn {
    width: 18px;
    height: 18px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    color: #ef4444;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thumb-delete-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
}

.thumb-move-controls {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
}

.thumb-move-btn {
    width: 17px;
    height: 17px;
    border: none;
    background: var(--primary-blue);
    color: #ffffff;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thumb-move-btn:hover:not(:disabled) {
    background: var(--primary-blue-hover);
    color: #ffffff;
}

.thumb-move-btn:disabled {
    opacity: 0.45;
    background: #a5b4fc;
    color: #eef2ff;
    cursor: not-allowed;
}

.thumbnail-item .thumb-preview .thumb-title {
    font-weight: 700;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 1.7em;
    margin-bottom: 0.2rem;
}

.thumbnail-item .thumb-preview .thumb-body {
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    color: rgba(255, 255, 255, 0.95);
}

.edit-style-content {
    overflow: hidden;
}

.edit-style-content {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.edit-style-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Slides Carousel */
.slides-carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.slides-carousel {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
    margin: 0 auto;
}

.slides-carousel-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(1px);
    z-index: 30;
}

.slides-carousel-loading.is-visible {
    display: flex;
}

.slides-carousel-loading-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    animation: carousel-spin 0.9s linear infinite;
}

@keyframes carousel-spin {
    to {
        transform: rotate(360deg);
    }
}

.slides-carousel-track {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.slide-carousel-item {
    position: absolute;
    width: 100%;
    max-width: 280px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s ease,
                z-index 0.6s ease;
    transform-origin: center center;
    cursor: pointer;
    will-change: transform, opacity;
    pointer-events: auto;
}

.slide-preview-card {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.slide-carousel-item:hover .slide-preview-card {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* AI slide: container must match scaled iframe (1080×1350 → scale 0.259259 = 280×350).
   Otherwise 9/16 card gives height ~498px and leaves white space below. */
.slide-preview-card.slide-template-preview {
    position: relative;
    aspect-ratio: 1080 / 1350;
}

.slide-template-iframe {
    position: absolute;
    left: 0;
    top: 0;
    width: 1080px;
    height: 1350px;
    border: none;
    transform: scale(0.259259);
    transform-origin: 0 0;
    pointer-events: none;
}

.carousel-nav {
    background: var(--bg-white);
    border: 2px solid var(--border-gray);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
    z-index: 20;
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

.carousel-nav:active {
    transform: scale(0.95);
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border-gray);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.carousel-dot:hover {
    background: var(--text-gray);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--primary-blue);
    width: 12px;
    height: 12px;
}

.slide-preview-content {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgb(3, 72, 169);
    color: white;
    min-height: 0;
    overflow: hidden;
}

.slide-preview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.2;
}

.slide-preview-body {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.edit-style-panel {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
    z-index: 100;
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.panel-content {
    margin-bottom: 2rem;
    max-height: 500px;
    overflow-y: auto;
}

/* Text section (Header / Body) */
.text-section-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.text-section-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.text-section-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.text-section-editable {
    min-height: 2.5rem;
    outline: none;
}

.text-section-editable:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.text-section-editable[data-placeholder]:empty::before,
.text-section-editable.empty::before {
    content: attr(data-placeholder);
    color: var(--text-gray);
}

.text-section-body-editable {
    min-height: 5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-section-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.text-section-row .font-dropdown {
    flex: 1;
}

.text-section-size {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.text-section-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.alignment-btns {
    display: flex;
    gap: 2px;
}

.align-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-gray);
    background: var(--bg-white);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.align-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.align-btn:hover,
.align-btn.active {
    background: var(--bg-light);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.style-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-gray);
    background: var(--bg-white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
}

.style-btn:hover {
    background: var(--bg-light);
}

.color-swatch-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-gray);
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    background: var(--bg-white);
    transition: box-shadow 0.2s;
}

.color-swatch-btn:hover {
    box-shadow: 0 0 0 2px var(--primary-blue);
}

/* Background section */
.btn-apply-to-all {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-blue);
    background: transparent;
    border: 2px solid var(--primary-blue);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.btn-apply-to-all:hover {
    background: var(--primary-blue);
    color: white;
}

.apply-text-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.apply-text-checkboxes .panel-checkbox-label {
    margin-bottom: 0;
}

.panel-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.bg-swatches {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.bg-swatch {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.bg-swatch:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bg-swatch.active {
    border-color: var(--text-dark);
    box-shadow: 0 0 0 2px var(--bg-white);
}

.bg-swatch-transparent {
    background: repeating-conic-gradient(#ccc 0% 25%, #eee 0% 50%) 50% / 12px 12px;
}

.bg-picker-area {
    margin-top: 1rem;
}

.bg-color-preview-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bg-color-preview-row .color-swatch-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.bg-hex-input {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-family: monospace;
    font-size: 0.95rem;
}

.bg-opacity-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.bg-opacity-label input {
    width: 56px;
    padding: 0.4rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
}

/* Palitra modal (color picker iframe) */
#palitraModal .palitra-modal-content {
    background: var(--bg-white);
    border-radius: 1rem;
    overflow: hidden;
    max-width: 360px;
}

.palitra-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-gray);
}

.palitra-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

#palitraIframe {
    width: 100%;
    height: 420px;
    border: none;
    display: block;
}

.slide-edit-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.slide-edit-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.slide-block-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.slide-block-title {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.slide-block-title:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.slide-block-body {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.slide-block-body:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.panel-footer {
    border-top: 1px solid var(--border-gray);
    padding-top: 1.5rem;
}

.font-selector {
    margin-bottom: 1.5rem;
}

.panel-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.font-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-white);
    cursor: pointer;
}

.font-dropdown:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.colors-selector {
    margin-bottom: 0;
}

.colors-hint {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 0.75rem;
}

.colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.color-add {
    width: 40px;
    height: 40px;
    border: 2px dashed var(--border-gray);
    border-radius: 0.5rem;
    background: var(--bg-light);
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.color-add:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: var(--bg-white);
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch.selected {
    border-color: var(--text-dark);
    border-width: 3px;
    box-shadow: 0 0 0 2px var(--bg-white);
}

/* Responsive styles for edit-style page */
@media (max-width: 1024px) {
    .edit-style-main {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .edit-style-thumbnails {
        display: flex;
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
    }

    .thumbnails-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.25rem;
    }

    .thumbnail-item {
        width: 108px;
        min-width: 108px;
    }

    .edit-style-panel {
        position: static;
    }

    .slides-result {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .slides-carousel {
        height: 450px;
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .edit-style-page {
        padding: 1rem;
    }

    .edit-style-title {
        font-size: 1.5rem;
    }

    .edit-style-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .edit-style-nav-right {
        flex-direction: column;
    }

    /* Top panel - компактный вид на мобильных */
    .edit-panel-top {
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-template-rows: auto auto auto;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .edit-panel-top > .btn-back {
        grid-column: 1;
        grid-row: 1;
    }

    .edit-panel-top > .btn-undo {
        grid-column: 2;
        grid-row: 1;
    }

    .edit-panel-top > .btn-redo {
        grid-column: 3;
        grid-row: 1;
    }

    .edit-panel-top > .edit-panel-tabs {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .edit-panel-top > .edit-panel-actions {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .edit-panel-tabs {
        justify-content: flex-start;
        margin: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
        scrollbar-width: thin;
    }

    .edit-panel-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .edit-tab {
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .edit-tab-icon {
        width: 22px;
        height: 22px;
    }

    .edit-panel-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .edit-panel-actions .btn-export {
        flex: 1;
        min-width: 120px;
    }

    .edit-panel-actions .btn-save-template {
        flex: 1;
        min-width: 120px;
    }

    /* Карусель слайдов - мобильная версия */
    .slides-carousel-container {
        gap: 0.5rem;
        margin: 1rem 0;
    }

    .slides-carousel {
        height: min(400px, 70vh);
        max-width: 100%;
    }

    .carousel-nav {
        width: 36px;
        height: 36px;
        padding: 0;
    }

    .carousel-nav svg {
        width: 18px;
        height: 18px;
    }

    .slide-carousel-item {
        max-width: 220px;
    }

    /* Масштаб iframe слайдов под ширину 220px: 220/1080 ≈ 0.2037 */
    .slide-template-iframe {
        transform: scale(0.2037) !important;
        transform-origin: 0 0;
    }

    .carousel-indicator {
        margin-top: 1rem;
        gap: 0.35rem;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    .carousel-dot.active {
        width: 10px;
        height: 10px;
    }

    /* Слайды: текст виден полностью на мобильных */
    .slide-preview-content {
        padding: 0.75rem 1rem;
    }

    .slide-preview-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .slide-preview-body {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    /* Панель редактирования */
    .edit-style-panel {
        padding: 1.25rem;
    }

    .thumbnail-item {
        width: 94px;
        min-width: 94px;
    }

    .thumb-move-btn,
    .thumb-delete-btn {
        width: 20px;
        height: 20px;
    }

    .thumb-slide-number {
        font-size: 0.68rem;
    }

    .panel-title {
        font-size: 1.25rem;
    }

    .panel-content {
        max-height: 400px;
    }

    .text-section-toolbar {
        gap: 0.35rem;
    }

    .align-btn,
    .style-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .color-swatch-btn {
        width: 28px;
        height: 28px;
    }

    .text-section-row {
        flex-direction: column;
    }

    .text-section-size {
        width: 100%;
    }

    /* Палитра (модальное окно) */
    #palitraModal .palitra-modal-content {
        max-width: 100%;
        margin: 0 1rem;
    }

    #palitraIframe {
        height: min(380px, 65vh);
    }
}

@media (max-width: 480px) {
    .edit-panel-top {
        padding: 0.75rem;
    }

    .slides-carousel {
        height: min(340px, 60vh);
    }

    .slide-carousel-item {
        max-width: 180px;
    }

    /* Масштаб iframe слайдов под ширину 180px: 180/1080 ≈ 0.1667 */
    .slide-template-iframe {
        transform: scale(0.1667) !important;
        transform-origin: 0 0;
    }

    .btn-undo,
    .btn-redo {
        width: 2.25rem;
        height: 2.25rem;
    }
}

/* Export Modal Styles */
.export-modal-content {
    max-width: 900px;
}

.export-modal-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.export-preview-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-height: 450px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.export-preview-slide {
    background: white;
    border-radius: 0.5rem;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    aspect-ratio: 9 / 16;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    max-height: 220px;
    overflow: hidden;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.export-preview-slide--template {
    aspect-ratio: 1080 / 1350;
    max-height: none;
    min-height: 0;
    max-width: 280px;
}

.export-preview-slide .slide-preview-card {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgb(3, 72, 169);
}

.export-preview-slide .slide-preview-content {
    width: 100%;
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgb(3, 72, 169);
    color: white;
    box-sizing: border-box;
}

.export-preview-slide .slide-preview-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.export-preview-slide .slide-preview-body {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 1;
    word-break: break-word;
}

.export-more-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 600;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-export-png,
.btn-export-pdf,
.btn-post-linkedin {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
    justify-content: center;
}

.btn-export-png {
    background: var(--primary-blue);
    color: white;
}

.btn-export-png:hover:not(:disabled) {
    background: var(--primary-blue-hover);
}

.btn-export-pdf {
    background: var(--error-red);
    color: white;
}

.btn-export-pdf:hover:not(:disabled) {
    background: #DC2626;
}

.btn-post-linkedin {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-post-linkedin:hover:not(:disabled) {
    background: var(--primary-blue-hover);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.btn-export-png:disabled,
.btn-export-pdf:disabled,
.btn-post-linkedin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* LinkedIn publish format dropdown - matches export buttons style */
.linkedin-publish-wrapper {
    position: relative;
    min-width: 180px;
}

.linkedin-format-chevron {
    margin-left: 0.25rem;
    opacity: 0.9;
}

.linkedin-format-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-gray);
    overflow: hidden;
    z-index: 100;
}

.linkedin-format-dropdown.is-open {
    display: block;
}

.linkedin-format-opt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
    transition: all 0.2s;
}

.linkedin-format-opt:hover {
    background: var(--primary-blue);
    color: white;
}

.linkedin-format-opt:hover .linkedin-format-desc {
    color: rgba(255, 255, 255, 0.9);
}

.linkedin-format-opt:not(:last-child) {
    border-bottom: 1px solid var(--border-gray);
}

.linkedin-format-label {
    display: block;
}

.linkedin-format-desc {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-gray);
    margin-top: 0.25rem;
}

.export-slide-full {
    font-family: inherit;
}

@media (max-width: 768px) {
    .export-preview-container {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .btn-export-png,
    .btn-export-pdf,
    .linkedin-publish-wrapper {
        width: 100%;
    }
    
    .btn-post-linkedin {
        width: 100%;
    }
    
    .export-preview-slide {
        max-height: 200px;
    }
    
    .export-preview-slide--template {
        max-height: none;
        max-width: 100%;
    }
}

/* Profile Modal Styles */
.profile-modal-content {
    max-width: 500px;
}

.profile-modal-body {
    padding: 2rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

.profile-subscription {
    margin-top: 0.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 0.75rem;
    border: 2px solid #F59E0B;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

.subscription-header {
    margin-bottom: 1rem;
}

.subscription-label {
    color: #92400E;
    font-size: 0.875rem;
    font-weight: 700;
}

.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subscription-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: #92400E;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    border: 1px solid #F59E0B;
}

.subscription-dates {
    font-size: 0.95rem;
    color: #78350F;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.subscription-date-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

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

.subscription-date-label {
    font-weight: 600;
    color: #92400E;
}

.subscription-date-value {
    color: #78350F;
}

.subscription-active {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-color: #10B981;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.subscription-active .subscription-label {
    color: #065F46;
}

.subscription-active .subscription-status {
    color: #065F46;
    border-color: #10B981;
}

.subscription-active .subscription-date-label {
    color: #065F46;
}

.subscription-active .subscription-date-value {
    color: #047857;
}

.subscription-inactive {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: #EF4444;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.subscription-inactive .subscription-label {
    color: #991B1B;
}

.subscription-inactive .subscription-status {
    color: #991B1B;
    border-color: #EF4444;
}

.subscription-inactive .subscription-date-label {
    color: #991B1B;
}

.subscription-inactive .subscription-date-value {
    color: #DC2626;
}

.profile-modal-footer {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.btn-logout-modal {
    background: transparent;
    color: var(--error-red);
    border: 1px solid var(--error-red);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
    max-width: 200px;
}

.btn-logout-modal:hover {
    background: var(--error-red);
    color: white;
}

@media (max-width: 768px) {
    .profile-modal-content {
        width: 90%;
        max-width: 500px;
    }
    
    .profile-modal-body {
        padding: 1.5rem;
    }
    
    .profile-subscription {
        padding: 1rem;
    }
}

