                                                            
                                                            
                                             
                                                               

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-alt: #f1f5f9;
    --border-color: #e2e8f0;
    --border-subtle: #edf2f7;
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.12);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #0ea5e9;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1);
    --font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

                
.writing-app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

                                        
.writing-sidebar {
    width: 320px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sidebar-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 14px;
    background: var(--bg-card-alt);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-back-btn:hover {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: rgba(79, 70, 229, 0.2);
    transform: translateX(-2px);
}

.mobile-sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.sidebar-sub-hint {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 14px;
}

                        
.task-tabs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.task-tab-btn {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}

.task-tab-btn:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.03);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.task-tab-btn.active {
    border-color: var(--primary);
    background: var(--primary-glow);
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.15);
}

.task-tab-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.tab-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-card-alt);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.task-tab-btn:hover .tab-icon-box {
    color: var(--primary);
    background: #ffffff;
}

.task-tab-btn.active .tab-icon-box {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.tab-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tab-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tab-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.tab-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
}

.badge-a2-b1 { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.badge-b1-b2 { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.badge-b2-c1 { background: rgba(16, 185, 129, 0.12); color: #059669; }

.tab-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.tab-target {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

                       
.sidebar-tips-card {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: auto;
    margin-bottom: 16px;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 8px;
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.76rem;
    color: #b45309;
}

.tips-list li strong {
    color: #78350f;
}

                         
.sidebar-user-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.user-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.user-meta-wrap {
    flex: 1;
    overflow: hidden;
}

.user-full-name {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-id-level {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.user-id-tag {
    font-family: monospace;
    font-size: 0.72rem;
    background: rgba(15, 23, 42, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-secondary);
}

.user-badge-level {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 600;
}

                                        
.writing-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
    height: 100vh;
    overflow: hidden;
}

.workspace-header {
    padding: 14px 28px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-menu-trigger {
    display: none;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
}

.ai-status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-dot-pulsing {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.ai-title-wrap h1 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.ai-model-tag {
    font-size: 0.76rem;
    color: var(--primary);
    font-weight: 600;
}

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

.btn-refresh-task {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-card-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh-task:hover {
    color: var(--primary);
    border-color: var(--primary-light);
    background: var(--primary-glow);
}

.icon-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-card-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.icon-nav-btn:hover {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: rgba(79, 70, 229, 0.3);
}

                                
.workspace-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

                                                    
.must-select-banner {
    max-width: 900px;
    margin: 30px auto;
    width: 100%;
    animation: fadeIn 0.4s ease;
}

.banner-hero-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.banner-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
}

.hero-sparkle-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(99, 102, 241, 0.25));
    color: var(--primary);
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.banner-hero-card h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.banner-lead {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto 30px;
}

.quick-pick-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    text-align: left;
}

.quick-card {
    background: var(--bg-card-alt);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.quick-card:hover {
    border-color: var(--primary);
    background: #ffffff;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-card-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
    padding: 3px 8px;
    border-radius: 9999px;
    align-self: flex-start;
    margin-bottom: 12px;
}

.quick-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.quick-card h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.quick-card p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.quick-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.btn-choose {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s ease;
}

.quick-card:hover .btn-choose {
    transform: translateX(4px);
}

                                       
.top-task-bar-wrapper {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-task-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-task-bar-header .bar-label {
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-task-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.top-task-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.top-task-pill:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: #fafafa;
}

.top-task-pill.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.32);
}

.top-task-pill .pill-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card-alt);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.top-task-pill.active .pill-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

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

.pill-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-task-pill.active .pill-name {
    color: #ffffff;
}

.pill-desc {
    font-size: 0.76rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-task-pill.active .pill-desc {
    color: rgba(255, 255, 255, 0.85);
}

.pill-level {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.top-task-pill.active .pill-level {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

                                          
.active-task-container {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.35s ease;
}

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

                      
.task-prompt-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    border-left: 5px solid var(--primary);
}

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

.task-type-badge {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.task-identity h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.prompt-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.target-words-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0284c7;
    background: rgba(14, 165, 233, 0.1);
    padding: 6px 12px;
    border-radius: 9999px;
}

.btn-ghost-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost-small:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-glow);
}

.prompt-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prompt-text-box {
    font-size: 1.05rem;
    line-height: 1.65;
    color: #1e293b;
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

.prompt-guidelines {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: #0369a1;
    background: rgba(14, 165, 233, 0.08);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid #0284c7;
}

                      
.prompt-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

                         
.writing-editor-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    padding: 14px 22px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.editor-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.word-counter {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.counter-status-tag {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: var(--text-muted);
}

.counter-status-tag.optimal {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.counter-status-tag.too-short {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.counter-status-tag.too-long {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.word-progress-track {
    height: 3px;
    background: #e2e8f0;
    width: 100%;
}

.word-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.2s ease, background-color 0.2s ease;
}

.editor-wrapper {
    padding: 20px 22px;
}

.editor-wrapper textarea {
    width: 100%;
    min-height: 240px;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--text-primary);
    resize: vertical;
    background: transparent;
}

.editor-wrapper textarea::placeholder {
    color: var(--text-light);
    font-style: italic;
}

.editor-footer {
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-left-info .hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.btn-editor-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-editor-secondary:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-editor-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    color: #ffffff;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-editor-primary:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-editor-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

                            
.evaluating-loader-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 44px 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.3s ease;
}

.loader-spinner-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(79, 70, 229, 0.15);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    color: var(--primary);
}

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

.evaluating-loader-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loader-steps-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.analysis-steps-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.step-chip {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.step-chip.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

                                                                
.evaluation-report-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 28px;
    animation: fadeIn 0.4s ease;
}

                         
.report-header-banner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: var(--radius-lg);
    color: #ffffff;
}

.score-circle-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(15, 23, 42, 0.6) 80%);
    border: 3px solid #6366f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.35);
}

.score-number-display {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.score-big {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.score-max {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 600;
}

.score-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #818cf8;
    margin-top: 4px;
}

.report-main-verdict {
    flex: 1;
}

.cefr-badge-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.cefr-level-badge {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    padding: 4px 14px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.level-desc {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.score-rationale {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cbd5e1;
}

                            
.criteria-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.criterion-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.criterion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.criterion-head strong {
    color: var(--text-primary);
    font-weight: 700;
}

.crit-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.crit-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #4f46e5, #06b6d4);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

                        
.report-section-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid var(--border-color);
    padding-top: 22px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-wrap i {
    font-size: 1.15rem;
}

.section-title-wrap h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

                 
.topics-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #4338ca;
    background: #e0e7ff;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid #c7d2fe;
}

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

.mistake-card {
    background: #fff;
    border: 1px solid #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mistake-topic-pill {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #b91c1c;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
}

.mistake-diff-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.err-bad {
    color: #dc2626;
    background: #fef2f2;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: line-through;
    font-weight: 600;
}

.err-arrow {
    color: var(--text-light);
    font-size: 0.85rem;
}

.err-good {
    color: #059669;
    background: #ecfdf5;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.mistake-recommendation {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.clean-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
}

                           
.lexical-critique-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.lex-card {
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lex-card.misused {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.lex-card.misused h4 {
    color: #991b1b;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

.lex-card.recommendations {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.lex-card.recommendations h4 {
    color: #166534;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

.lex-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.lex-card.misused ul li {
    color: #7f1d1d;
}

.lex-card.recommendations ul li {
    color: #14532d;
}

                         
.spelling-errors-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spelling-item {
    font-size: 0.88rem;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
}

                
.mentor-box {
    background: #f8fafc;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.mentor-text-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #1e293b;
}

                                   
.sample-answer-accordion {
    margin-top: 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    background: #ffffff;
    overflow: hidden;
}

.sample-toggle-btn {
    width: 100%;
    padding: 14px 18px;
    background: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sample-toggle-btn:hover {
    background: #f1f5f9;
}

.toggle-icon {
    transition: transform 0.25s ease;
}

.sample-toggle-btn.open .toggle-icon {
    transform: rotate(180deg);
}

.sample-content-box {
    padding: 18px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #334155;
    white-space: pre-wrap;
}

.sample-box-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.sample-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #b45309;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-copy-sample {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy-sample:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-glow);
}

                           
.report-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-report-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.btn-report-action.primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-report-action.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-report-action.secondary {
    background: var(--bg-card-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-report-action.secondary:hover {
    background: #ffffff;
    color: var(--text-primary);
}

.btn-report-action.outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-report-action.outline:hover {
    background: var(--primary-glow);
}

                         
.writing-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    animation: toastIn 0.3s ease;
}

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

                            
@media (max-width: 992px) {
    .writing-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    }

    .writing-sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-trigger,
    .mobile-sidebar-close {
        display: flex;
    }

    .criteria-grid,
    .lexical-critique-grid {
        grid-template-columns: 1fr;
    }

    .workspace-content-scroll {
        padding: 16px 16px 36px;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .workspace-header {
        padding: 12px 16px;
    }

    .ai-title-wrap h1 {
        font-size: 0.95rem;
    }

    .top-task-bar-wrapper {
        gap: 6px;
    }

    .top-task-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .top-task-nav::-webkit-scrollbar {
        display: none;
    }

    .top-task-pill {
        flex: 0 0 auto;
        min-width: 135px;
        padding: 10px 12px;
        gap: 8px;
    }

    .top-task-pill .pill-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .pill-name {
        font-size: 0.88rem;
    }

    .pill-desc {
        font-size: 0.72rem;
    }

    .task-prompt-card {
        padding: 18px 16px;
        border-radius: var(--radius-md);
    }

    .task-identity h2 {
        font-size: 1.1rem;
    }

    .prompt-text-box {
        font-size: 0.96rem;
        padding: 14px 16px;
    }

    .writing-editor-card {
        border-radius: var(--radius-md);
    }

    .editor-wrapper {
        padding: 14px 16px;
    }

    .editor-wrapper textarea {
        font-size: 16px;                                                   
        min-height: 200px;
        line-height: 1.6;
    }

    .editor-header,
    .editor-footer {
        padding: 12px 16px;
    }

    .evaluation-report-card {
        padding: 20px 16px;
        gap: 20px;
        border-radius: var(--radius-lg);
    }

    .report-header-banner {
        padding: 18px 16px;
        gap: 18px;
    }
}

@media (max-width: 640px) {
    .report-header-banner {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .score-circle-wrapper {
        width: 104px;
        height: 104px;
    }

    .score-big {
        font-size: 2rem;
    }

    .cefr-badge-row {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cefr-level-badge {
        font-size: 1.15rem;
        padding: 3px 12px;
    }

    .level-desc {
        font-size: 0.95rem;
    }

    .prompt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .prompt-tools {
        width: 100%;
        justify-content: space-between;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .editor-stats {
        width: 100%;
        justify-content: space-between;
    }

    .editor-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .footer-left-info {
        text-align: center;
    }

    .footer-buttons {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .btn-editor-secondary {
        flex: 1;
        justify-content: center;
        padding: 11px 12px;
    }

    .btn-editor-primary {
        flex: 2;
        justify-content: center;
        padding: 11px 14px;
        font-size: 0.88rem;
    }

    .mistake-diff-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .err-arrow {
        transform: rotate(90deg);
        margin: 2px 0 2px 10px;
    }

    .report-actions-row {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .btn-report-action {
        width: 100%;
        justify-content: center;
    }
}
/* Writing "faqat 1 marta" eslatmasi */
.writing-limit-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.4;
}

.task-tab-btn.used-once::after,
.top-task-pill.used-once::after {
    content: "\f00c";
    margin-left: 6px;
    font-size: 0.7rem;
    color: #10b981;
}
