[data-theme="dark"] .saved-practice::before,
[data-theme="dark"] .saved-practice::after,
[data-theme="dark"] .deep-dive::before,
[data-theme="dark"] .deep-dive::after,
[data-theme="dark"] .knowledge-base::before,
[data-theme="dark"] .knowledge-base::after {
    content: none;
}
[data-theme="dark"] .roadmap-modal {
    background: rgba(2, 6, 23, 0.78);
}
[data-theme="dark"] .roadmap-modal-dialog {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: 0 32px 75px rgba(2, 6, 23, 0.65);
}
[data-theme="dark"] .roadmap-modal h3 {
    color: rgba(226, 232, 240, 0.95);
}
[data-theme="dark"] .modal-subtitle {
    color: rgba(203, 213, 225, 0.78);
}
[data-theme="dark"] .roadmap-modal .modal-close {
    background: rgba(30, 41, 59, 0.55);
    color: rgba(226, 232, 240, 0.85);
}
[data-theme="dark"] .roadmap-modal .modal-close:hover,
[data-theme="dark"] .roadmap-modal .modal-close:focus-visible {
    background: rgba(59, 130, 246, 0.35);
    color: #cbd5f5;
}
[data-theme="dark"] .roadmap-form .form-label {
    color: rgba(226, 232, 240, 0.92);
}
[data-theme="dark"] .roadmap-form select,
[data-theme="dark"] .roadmap-form textarea {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(71, 85, 105, 0.55);
    color: rgba(226, 232, 240, 0.9);
    box-shadow: inset 0 1px 3px rgba(2, 6, 23, 0.45);
}
[data-theme="dark"] .roadmap-form select option {
    background-color: #0f172a;
    color: rgba(226, 232, 240, 0.92);
}
[data-theme="dark"] .roadmap-form select {
    background-image: none !important;
}
[data-theme="dark"] .roadmap-form textarea::placeholder {
    color: rgba(148, 163, 184, 0.65);
}
[data-theme="dark"] .roadmap-goal-option span,
[data-theme="dark"] .roadmap-skill-grid label span {
    background: rgba(17, 24, 39, 0.82);
    border-color: rgba(71, 85, 105, 0.58);
    color: rgba(226, 232, 240, 0.92);
    box-shadow: 0 22px 40px rgba(2, 6, 23, 0.55);
}
[data-theme="dark"] .roadmap-goal-option span::before,
[data-theme="dark"] .roadmap-skill-grid label span::before {
    border-color: rgba(96, 165, 250, 0.35);
}
[data-theme="dark"] .roadmap-goal-option:hover span,
[data-theme="dark"] .roadmap-skill-grid label:hover span {
    border-color: rgba(129, 140, 248, 0.55);
    box-shadow: 0 26px 46px rgba(2, 6, 23, 0.65);
}
[data-theme="dark"] .roadmap-goal-option input:checked + span,
[data-theme="dark"] .roadmap-skill-grid label input:checked + span {
    border-color: rgba(125, 211, 252, 0.6);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.55), rgba(37, 99, 235, 0.48));
    box-shadow: 0 28px 52px rgba(37, 99, 235, 0.4);
    color: rgba(226, 232, 240, 0.95);
}
[data-theme="dark"] .roadmap-goal-option input:checked + span::before,
[data-theme="dark"] .roadmap-skill-grid label input:checked + span::before {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.35);
}
[data-theme="dark"] .roadmap-modal .modal-actions {
    border-top-color: rgba(71, 85, 105, 0.6);
}
[data-theme="dark"] .roadmap-modal .modal-actions .btn-secondary {
    background: rgba(30, 41, 59, 0.7);
    color: rgba(226, 232, 240, 0.92);
}
[data-theme="dark"] .roadmap-modal .modal-actions .btn-secondary:hover,
[data-theme="dark"] .roadmap-modal .modal-actions .btn-secondary:focus-visible {
    background: rgba(59, 130, 246, 0.35);
}
/* Cher's Voice Language Learning App - Valerio.ai Style */

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #fafafa;
    --surface-color: #ffffff;
    --sidebar-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.75rem;
    --transition: all 0.2s ease-in-out;
    --mobile-nav-height: calc(3.75rem + env(safe-area-inset-bottom, 0px));
    --mobile-nav-gap: 0.25rem;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary-color: #94a3b8;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --sidebar-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Dark Theme Specific Styles */
[data-theme="dark"] html,
[data-theme="dark"] body {
    background: var(--surface-color);
}

[data-theme="dark"] .app-container {
    background: var(--surface-color);
}

[data-theme="dark"] .message.user,
[data-theme="dark"] .message.bot {
    background: transparent;
    color: inherit;
}

[data-theme="dark"] .chat-input {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .modal {
    background: rgba(2, 6, 23, 0.85);
}

[data-theme="dark"] .modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.7);
}
[data-theme="dark"] #personalNoteModal textarea {
    background: rgba(17, 24, 39, 0.95);
    border-color: rgba(59, 130, 246, 0.32);
    color: rgba(226, 232, 240, 0.92);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.55);
}
[data-theme="dark"] #personalNoteModal textarea::placeholder {
    color: rgba(148, 163, 184, 0.7);
}
[data-theme="dark"] #personalNoteModal textarea:focus {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    background: rgba(17, 24, 39, 0.98);
}
[data-theme="dark"] .modal-close {
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
}
[data-theme="dark"] .modal-close:hover,
[data-theme="dark"] .modal-close:focus-visible {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

[data-theme="dark"] .settings-modal {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: none;
}

/* History Modal Styles */
.history-modal {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
}

.history-modal .modal-content {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

[data-theme="dark"] .history-modal .modal-content {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.history-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    background: var(--surface-color);
    color: inherit;
    width: 100%;
    text-align: left;
    font: inherit;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.2);
}

.history-item:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.history-item:hover::before {
    opacity: 1;
}

[data-theme="dark"] .history-item {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .history-item::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
}

[data-theme="dark"] .history-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.history-item-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.history-item-content i {
    color: var(--primary-color);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover .history-item-content i {
    transform: scale(1.1);
}

[data-theme="dark"] .history-item-content i {
    color: #60a5fa;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.history-item:hover .history-name {
    color: var(--primary-color);
}

[data-theme="dark"] .history-item:hover .history-name {
    color: #60a5fa;
}

.history-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    align-items: center;
}

.history-voice-level {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.06));
    border-radius: 8px;
    padding: 0.2rem 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .history-voice-level,
.dark-mode .history-voice-level {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.1));
    border-color: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

.history-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.history-mode-voice {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(15, 118, 110, 0.12));
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.25);
}

.history-mode-voice i {
    font-size: 0.75rem;
}

.history-language,
.history-level,
.history-date,
.history-topic {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.12));
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.2s ease;
}

.history-topic {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.15));
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .history-topic,
[data-theme="dark"] .history-language,
[data-theme="dark"] .history-level,
[data-theme="dark"] .history-date {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(59, 130, 246, 0.15));
    border-color: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
}

[data-theme="dark"] .history-topic {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.22), rgba(59, 130, 246, 0.18));
    border-color: rgba(96, 165, 250, 0.3);
    color: #bfdbfe;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: relative;
    z-index: 1;
}

.history-actions button {
    border: none;
    background: var(--surface-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.45rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 2rem;
    height: 2rem;
}

.history-actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
}

.history-actions button:hover,
.history-actions button:focus-visible {
    color: white;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: var(--primary-color);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-actions button:hover::before,
.history-actions button:focus-visible::before {
    opacity: 1;
}

[data-theme="dark"] .history-actions button {
    background: rgba(30, 41, 59, 0.6);
    color: rgba(226, 232, 240, 0.8);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .history-actions button::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.1));
}

[data-theme="dark"] .history-actions button:hover,
[data-theme="dark"] .history-actions button:focus-visible {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(96, 165, 250, 0.5);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.history-actions .history-rename i {
    font-size: 0.7rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-actions button:hover .history-rename i,
.history-actions button:hover i {
    transform: scale(1.1);
}

.history-rename {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    margin-right: 0.5rem;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.history-download {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    color: var(--text-secondary);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.history-download:hover {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-download i {
    font-size: 0.7rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-download:hover i {
    transform: scale(1.1);
}

[data-theme="dark"] .history-download {
    color: rgba(226, 232, 240, 0.8);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .history-download:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(96, 165, 250, 0.5);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.history-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.history-empty i {
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.history-empty:hover i {
    opacity: 1;
    transform: scale(1.05);
}

.history-empty p {
    margin: 0;
    max-width: 320px;
    line-height: 1.6;
    font-size: 0.95rem;
}

[data-theme="dark"] .history-empty i {
    color: #60a5fa;
}

/* Modal Close Button Enhancement */
.history-modal .modal-close {
    position: absolute;
    top: clamp(0.75rem, 2vw, 1rem);
    right: clamp(0.75rem, 2vw, 1rem);
    border: none;
    background: var(--surface-color);
    color: var(--text-secondary);
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.history-modal .modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
}

.history-modal .modal-close:hover,
.history-modal .modal-close:focus-visible {
    background: var(--surface-color);
    color: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
    outline: none;
}

.history-modal .modal-close:hover::before,
.history-modal .modal-close:focus-visible::before {
    opacity: 1;
}

.history-modal .modal-close i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.history-modal .modal-close:hover i {
    transform: rotate(90deg) scale(1.1);
}

[data-theme="dark"] .history-modal .modal-close {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .history-modal .modal-close::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .history-modal .modal-close:hover,
[data-theme="dark"] .history-modal .modal-close:focus-visible {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Modal Actions Close Button */
.history-modal .modal-actions {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: var(--surface-color);
}

[data-theme="dark"] .history-modal .modal-actions {
    border-top-color: rgba(148, 163, 184, 0.15);
    background: rgba(30, 41, 59, 0.6);
}

.history-modal .modal-actions .btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.history-modal .modal-actions .btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-modal .modal-actions .btn-secondary:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.history-modal .modal-actions .btn-secondary:hover::before {
    opacity: 1;
}

.history-modal .modal-actions .btn-secondary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .history-modal .modal-actions .btn-secondary {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .history-modal .modal-actions .btn-secondary::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .history-modal .modal-actions .btn-secondary:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .history-modal .modal-actions .btn-secondary:focus-visible {
    outline-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25), 0 4px 16px rgba(59, 130, 246, 0.25);
}

/* Responsive history modal */
@media (max-width: 768px) {
    .history-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .history-item {
        padding: 0.9rem 1rem;
        border-radius: 10px;
    }
    
    .history-name {
        font-size: 0.9rem;
    }
    
    .history-meta {
        font-size: 0.7rem;
        gap: 0.4rem;
    }
    
    .history-actions button {
        width: 1.85rem;
        height: 1.85rem;
        padding: 0.4rem;
        border-radius: 8px;
    }
    
    .history-modal .modal-close {
        width: 1.85rem;
        height: 1.85rem;
        border-radius: 8px;
    }
}

@media (max-width: 640px) {
    .history-modal {
        width: 98%;
        max-height: 90vh;
    }
    
    .history-item {
        padding: 0.85rem 0.9rem;
        border-radius: 8px;
        margin-bottom: 0.6rem;
    }
    
    .history-item:hover {
        transform: none;
    }
    
    .history-name {
        font-size: 0.85rem;
    }
    
    .history-meta {
        font-size: 0.65rem;
        gap: 0.35rem;
    }
    
    .history-actions button {
        width: 1.75rem;
        height: 1.75rem;
        padding: 0.35rem;
        border-radius: 8px;
    }
    
    .history-modal .modal-close {
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 8px;
    }
    
    .history-modal .modal-actions .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .history-modal .modal-actions .btn-secondary:hover {
        transform: none;
    }
}

[data-theme="dark"] .btn {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

[data-theme="dark"] .btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

[data-theme="dark"] .btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--background-color);
    border-color: var(--text-secondary);
}

[data-theme="dark"] .language-card {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .language-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .level-card {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .level-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .level-card.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .chat-messages {
    background: var(--background-color);
}

[data-theme="dark"] .input-container {
    background: var(--surface-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .send-btn {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .send-btn:hover {
    background: var(--primary-dark);
}

[data-theme="dark"] .send-btn:disabled {
    background: var(--text-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .notification {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .notification.success {
    background: var(--success-color);
    color: white;
}

[data-theme="dark"] .notification.error {
    background: var(--danger-color);
    color: white;
}

[data-theme="dark"] .notification.info {
    background: var(--primary-color);
    color: white;
}

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

html {
    width: 100%;
    height: 100%;
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 100%);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

html.saved-corrections-active,
body.saved-corrections-active {
    overflow: hidden;
    height: 100%;
}

.app-container {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    margin: 0;
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 100%);
}

[data-theme="dark"] .app-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding-bottom: 2rem;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .sidebar {
    box-shadow: 2px 0 30px rgba(0, 0, 0, 0.3);
    border-right-color: rgba(148, 163, 184, 0.15);
}

.sidebar.collapsed {
    border-right: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

[data-theme="dark"] .sidebar-toggle {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .sidebar-toggle:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.75rem 0;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .history-text,
.sidebar.collapsed .nav-item .nav-text {
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    position: relative;
    top: auto;
    right: auto;
    margin: 0 auto 0.75rem;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 16px;
}

.sidebar.collapsed .sidebar-header {
    display: none; /* Hide entire header section when collapsed */
    border-bottom: none; /* Remove border when collapsed */
}

.sidebar.collapsed .logo {
    display: none; /* Hide logo completely when collapsed */
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
}


.sidebar.collapsed .recent-chats {
    display: none;
}

.sidebar.collapsed .upgrade-section {
    display: none;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

[data-theme="dark"] .sidebar-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: var(--transition);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.logo-link:hover {
    color: var(--primary-dark);
    transform: scale(1.02);
}

.nav-logo-link {
    display: inline-block;
    text-decoration: none;
    transition: var(--transition);
}

.nav-logo-link:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 1.5rem;
}

.logo-icon {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    transition: var(--transition);
}

.search-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
}

.search-bar i {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.sidebar-nav {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

[data-theme="dark"] .sidebar-nav {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.sidebar.collapsed .sidebar-nav {
    position: relative;
    top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    border-bottom: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    border-radius: 0 14px 14px 0;
    margin: 0 0.5rem 0.25rem 0;
    position: relative;
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 500;
    background: transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.06));
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border-radius: 0 14px 14px 0;
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08));
    color: var(--primary-color);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    border-left-color: rgba(37, 99, 235, 0.4);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.12));
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
    font-weight: 600;
    transform: translateX(2px);
}

.nav-item.active::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
}

[data-theme="dark"] .nav-item {
    color: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .nav-item::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .nav-item:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(59, 130, 246, 0.14));
    color: #60a5fa;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
    border-left-color: rgba(96, 165, 250, 0.5);
}

[data-theme="dark"] .nav-item.active {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.22), rgba(59, 130, 246, 0.18));
    color: #60a5fa;
    border-left-color: #60a5fa;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .nav-item.active::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(59, 130, 246, 0.15));
}

[data-theme="dark"] .nav-item:hover i,
[data-theme="dark"] .nav-item.active i {
    color: inherit;
}

.nav-item i {
    font-size: 1.1875rem;
    width: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover i {
    transform: scale(1.15) rotate(2deg);
    color: var(--primary-color);
}

.nav-item.active i {
    color: var(--primary-color);
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.3));
}

.nav-item .nav-text {
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

.nav-item:hover .nav-text {
    transform: translateX(2px);
}

[data-theme="dark"] .nav-item i {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .nav-item:hover i {
    color: #60a5fa;
}

.sidebar.collapsed .nav-item {
    width: 52px;
    height: 52px;
    padding: 0;
    margin: 0 auto 0.5rem;
    border: none;
    border-left: none;
    border-radius: 16px;
    justify-content: center;
    background: transparent;
    transform: none;
}

.sidebar.collapsed .nav-item:hover {
    transform: scale(1.08);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.sidebar.collapsed .nav-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    transform: scale(1.05);
}

.sidebar.collapsed .nav-item i {
    width: auto;
    font-size: 1.25rem;
}

.sidebar.collapsed .nav-item:hover i,
.sidebar.collapsed .nav-item.active i {
    color: inherit;
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

[data-theme="dark"] .sidebar.collapsed .nav-item:hover,
[data-theme="dark"] .sidebar.collapsed .nav-item.active {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.recent-chats {
    margin-top: 1.25rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 330px); /* Allow more space for recent chats */
    min-height: 240px;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.recent-chats h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

/* Search Container */
.search-container {
    margin-bottom: 1.35rem;
    padding: 0 0.35rem;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.9rem;
    padding: 0.6rem 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .search-bar {
    background: rgba(17, 24, 39, 0.92);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 20px 38px rgba(2, 6, 23, 0.6);
}

[data-theme="dark"] .search-bar i {
    color: rgba(148, 163, 184, 0.75);
}

[data-theme="dark"] .search-bar input {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .search-bar input::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

[data-theme="dark"] .search-bar:focus-within {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 24px 45px rgba(2, 6, 23, 0.65);
    background: rgba(17, 24, 39, 0.97);
}

.search-bar:focus-within {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.18);
    background: rgba(255, 255, 255, 0.98);
}

.search-bar i {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.topic-filter {
    margin: 0.85rem 0.35rem 1.1rem;
}

.topic-filter select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 0.85rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: rgba(248, 250, 252, 0.95);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] .topic-filter select {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(59, 130, 246, 0.3);
    color: rgba(226, 232, 240, 0.92);
    box-shadow: 0 20px 36px rgba(2, 6, 23, 0.6);
}

.topic-filter select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

[data-theme="dark"] .topic-filter select:focus {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.topic-filter select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Chat List Container */
.chat-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.chat-list-container::-webkit-scrollbar {
    width: 4px;
}

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

.chat-list-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.chat-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition);
    position: relative;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

[data-theme="dark"] .chat-item {
    color: var(--text-secondary);
}

.chat-item:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

[data-theme="dark"] .chat-item:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
}

.chat-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.chat-item:hover .chat-actions {
    opacity: 1;
}

[data-theme="dark"] .chat-actions button {
    color: var(--text-secondary);
}

[data-theme="dark"] .chat-actions button:hover {
    color: var(--text-primary);
}

.chat-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    gap: 0.5rem;
}

.chat-item i {
    font-size: 1rem;
    width: 16px;
    flex-shrink: 0;
}

[data-theme="dark"] .chat-item i {
    color: var(--text-secondary);
}

[data-theme="dark"] .chat-item:hover i {
    color: var(--text-primary);
}

.chat-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.chat-title-row > i {
    margin-right: 0.35rem;
}

.chat-rename-btn {
    border: none;
    background: rgba(148, 163, 184, 0.15);
    color: rgba(15, 23, 42, 0.55);
    cursor: pointer;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    width: 1.35rem;
    height: 1.35rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.chat-rename-btn i {
    font-size: 0.65rem;
    line-height: 1;
}

/* Remove hover effect in light mode - keep same appearance */
.chat-rename-btn:hover,
.chat-rename-btn:focus-visible {
    background: rgba(148, 163, 184, 0.15);
    color: rgba(15, 23, 42, 0.55);
    outline: none;
}

[data-theme="dark"] .chat-rename-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
}

/* Dark mode hover - keep same appearance */
[data-theme="dark"] .chat-rename-btn:hover,
[data-theme="dark"] .chat-rename-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
    outline: none;
}

.chat-topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    text-transform: none;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.chat-topic-pill.chat-topic-pill-voice {
    background: rgba(15, 118, 110, 0.18);
    color: #0f766e;
}

.chat-voice-pill {
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    color: rgba(37, 99, 235, 0.9);
    font-size: 0.58rem;
}

[data-theme="dark"] .chat-voice-pill {
    background: rgba(96, 165, 250, 0.2);
    color: rgba(191, 219, 254, 0.95);
}

.chat-topic-pill.chat-topic-pill-voice i {
    font-size: 0.75rem;
}

[data-theme="dark"] .chat-topic-pill {
    background: rgba(96, 165, 250, 0.16);
    color: #93c5fd;
}

.chat-meta {
    display: flex;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.chat-meta span {
    white-space: nowrap;
}

.chat-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 0.5rem;
}

[data-theme="dark"] .chat-actions button,
[data-theme="dark"] .chat-actions a {
    color: var(--text-secondary);
}

[data-theme="dark"] .chat-actions button:hover,
[data-theme="dark"] .chat-actions a:hover {
    color: var(--primary-color);
}

.edit-chat-btn,
.delete-chat-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: var(--transition);
    font-size: 0.75rem;
}

.edit-chat-btn:hover {
    background: var(--primary-color);
    color: white;
}

.delete-chat-btn:hover {
    background: var(--danger-color);
    color: white;
}

.chat-name-input {
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    width: 100%;
    outline: none;
}

.no-chats {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem 1rem;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.no-chats i {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: normal;
}

.no-chats p {
    margin: 0;
    line-height: 1.4;
}

.no-chats-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    font-style: normal;
}

.no-chats-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
    font-style: normal;
}

.no-chats-subtitle strong {
    color: var(--primary-color);
    font-weight: 600;
}

.clickable-history {
    color: var(--primary-color) !important;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: underline;
    text-decoration-color: transparent;
}

.clickable-history:hover {
    color: var(--primary-dark) !important;
    text-decoration-color: var(--primary-dark);
    transform: scale(1.05);
}

/* History Section Styles */
.history-section {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .history-section {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.sidebar.collapsed .history-section {
    border-bottom: none;
    padding: 0;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.history-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.125rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.history-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border-radius: 14px;
}

.sidebar.collapsed .history-btn {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 16px;
}

.history-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.history-btn:active {
    transform: translateY(0);
}

.history-btn:hover::before {
    opacity: 1;
}

.history-btn i,
.history-btn .history-text {
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-btn:hover i {
    transform: scale(1.12) rotate(-8deg);
}

[data-theme="dark"] .history-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .history-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 26px rgba(59, 130, 246, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.history-btn i {
    font-size: 1.125rem;
}

.sidebar.collapsed .history-btn i {
    font-size: 1.25rem;
}


.search-input::placeholder {
    color: var(--text-secondary);
}

.upgrade-section {
    padding: 0.75rem 1.2rem 1.2rem;
}

.upgrade-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.9rem 1rem;
    border-radius: calc(var(--border-radius) * 0.85);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upgrade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.upgrade-card:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35), 0 3px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.upgrade-card:hover::before {
    opacity: 1;
}

.upgrade-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.upgrade-card.plan-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 1.35rem 1.25rem;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3), 0 2px 8px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.upgrade-card.plan-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.upgrade-card.plan-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.18);
}

.upgrade-card.plan-cta:hover::before {
    opacity: 1;
}

.upgrade-card.plan-cta .plan-cta-message {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.upgrade-card.plan-cta.basic {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.upgrade-card.plan-cta.basic::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

.upgrade-card.plan-cta.basic:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.upgrade-card.plan-cta.pro {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.3), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.upgrade-card.plan-cta.pro::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

.upgrade-card.plan-cta.pro:hover {
    background: linear-gradient(135deg, #0f766e, #0d9488);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.upgrade-card.plan-cta.trial {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.upgrade-card.plan-cta.trial::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

.upgrade-card.plan-cta.trial:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.plan-cta-button {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    letter-spacing: -0.01em;
}

.plan-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.15));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 24px;
}

.plan-cta-button:hover,
.plan-cta-button:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.plan-cta-button:hover::before,
.plan-cta-button:focus-visible::before {
    opacity: 1;
}

.plan-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.plan-cta-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.25);
}

.plan-cta-button span,
.plan-cta-button {
    position: relative;
    z-index: 1;
}

/* Dark mode support for upgrade cards */
[data-theme="dark"] .upgrade-card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .upgrade-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .upgrade-card.plan-cta {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .upgrade-card.plan-cta:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .upgrade-card.plan-cta.basic {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .upgrade-card.plan-cta.basic:hover {
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .upgrade-card.plan-cta.pro {
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .upgrade-card.plan-cta.pro:hover {
    box-shadow: 0 8px 28px rgba(20, 184, 166, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .upgrade-card.plan-cta.trial {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .upgrade-card.plan-cta.trial:hover {
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .plan-cta-button {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .plan-cta-button:hover,
[data-theme="dark"] .plan-cta-button:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .plan-cta-button:focus-visible {
    outline-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15), 0 4px 18px rgba(0, 0, 0, 0.4);
}

/* Responsive design for upgrade cards */
@media (max-width: 768px) {
.upgrade-card.plan-cta {
        padding: 1.2rem 1.1rem;
        gap: 0.75rem;
        border-radius: 14px;
}

.upgrade-card.plan-cta .plan-cta-message {
    font-size: 0.95rem;
    }
    
    .plan-cta-button {
        padding: 0.6rem 1.35rem;
        font-size: 0.85rem;
        border-radius: 22px;
    }
    
    .upgrade-card.plan-cta:hover {
        transform: translateY(-1px);
    }
    
    .plan-cta-button:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 640px) {
    .upgrade-section {
        padding: 0.65rem 1rem 1rem;
    }
    
    .upgrade-card.plan-cta {
        padding: 1.1rem 1rem;
        gap: 0.7rem;
        border-radius: 12px;
    }
    
    .upgrade-card.plan-cta .plan-cta-message {
    font-size: 0.9rem;
    }
    
    .plan-cta-button {
        padding: 0.55rem 1.25rem;
        font-size: 0.8rem;
        border-radius: 20px;
    }
    
    .upgrade-card.plan-cta:hover {
        transform: none;
    }
    
    .plan-cta-button:hover {
        transform: none;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background: var(--surface-color);
    transition: margin-left 0.3s ease;
    width: calc(100% - 280px);
    overflow: hidden;
    padding-top: 0.6rem;
    position: relative;
}

/* Adjust main content when sidebar is collapsed */
.sidebar.collapsed ~ .main-content,
.app-container:has(.sidebar.collapsed) .main-content,
.app-container.sidebar-collapsed .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
}

.top-bar {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    min-height: 72px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.top-bar-right {
    justify-content: flex-end;
    margin-left: auto;
    gap: 1rem;
}

.top-bar[data-mode="minimal"] .top-bar-left,
.top-bar[data-mode="minimal"] .top-bar-quick-actions,
.top-bar[data-mode="minimal"] .user-profile {
    display: none;
}

body[data-topbar-mode="hidden"] .top-bar {
    display: none !important;
}

body[data-topbar-mode="hidden"] .content-area {
    padding-top: 1.5rem;
}

body[data-topbar-mode="hidden"] .content-area::before {
    display: none;
}

body[data-topbar-mode="hidden"] .main-content {
    padding-top: 0;
}

.top-bar-quick-actions {
    display: none;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.top-bar-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 1.85rem;
    font-size: 0.85rem;
}

.top-bar-quick-btn i {
    font-size: 0.8rem;
}

.top-bar-quick-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.top-bar-quick-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.logout-btn:hover {
    background: var(--surface-color);
    color: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.logout-btn:hover::before {
    opacity: 1;
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15);
}

.logout-btn:focus-visible {
    outline: 2px solid var(--danger-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.2);
}

.logout-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.logout-btn:hover i {
    transform: translateX(2px) scale(1.05);
}

.logout-btn span {
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
}

/* Dark mode logout button styling */
[data-theme="dark"] .logout-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    color: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .logout-btn::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .logout-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .logout-btn:focus-visible {
    outline-color: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.25), 0 4px 16px rgba(239, 68, 68, 0.3);
}

.logout-btn.is-logging-out,
[data-action="logout"].is-logging-out {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.logout-btn.is-logging-out i,
[data-action="logout"].is-logging-out i {
    animation: spin 1s linear infinite;
}

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

/* Responsive logout button */
@media (max-width: 768px) {
    .logout-btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
        gap: 0.45rem;
        border-radius: 10px;
    }
    
    .logout-btn i {
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .logout-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.4rem;
        border-radius: 8px;
    }
    
    .logout-btn i {
        font-size: 0.8rem;
    }
    
    .logout-btn:hover {
        transform: none;
    }
}

/* Theme Toggle */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover::before {
    opacity: 0;
}

.theme-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.theme-toggle i {
    font-size: 0.95rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.theme-toggle:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* Dark mode theme toggle styling */
[data-theme="dark"] .theme-toggle {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .theme-toggle::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.15));
}

[data-theme="dark"] .theme-toggle:hover {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    border-color: rgba(96, 165, 250, 0.5);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle:focus-visible {
    outline-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25), 0 4px 16px rgba(59, 130, 246, 0.4);
}

/* Responsive theme toggle */
@media (max-width: 768px) {
    .theme-toggle {
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 10px;
    }
    
    .theme-toggle i {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .theme-toggle {
        width: 2rem;
        height: 2rem;
        border-radius: 8px;
    }
    
    .theme-toggle i {
        font-size: 0.85rem;
    }
    
    .theme-toggle:hover {
        transform: none;
    }
}

/* Sidebar Toggle Icon Styling */
.sidebar-toggle i {
    font-size: 0.875rem;
    font-weight: bold;
    transition: var(--transition);
}

.version-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.user-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.user-profile:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.user-profile:hover::before {
    opacity: 1;
}

.user-profile:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.1);
}

.user-profile:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.15);
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.user-profile:hover .user-name {
    color: var(--primary-color);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.user-profile:hover .user-email {
    color: var(--text-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.user-profile:hover .user-avatar {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35), 0 3px 8px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: rgba(255, 255, 255, 1);
}

.user-profile:hover .user-avatar::before {
    opacity: 1;
}

.user-avatar i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.user-profile:hover .user-avatar i {
    transform: scale(1.1);
}

.settings-arrow {
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.user-profile:hover .settings-arrow {
    color: var(--primary-color);
    transform: translateY(2px);
}

/* Dark mode user profile styling */
[data-theme="dark"] .user-profile {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .user-profile::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.1));
}

[data-theme="dark"] .user-profile:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .user-profile:hover .user-name {
    color: #60a5fa;
}

[data-theme="dark"] .user-profile:hover .user-email {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .user-profile:hover .settings-arrow {
    color: #60a5fa;
}

[data-theme="dark"] .user-avatar {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .user-avatar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .user-profile:hover .user-avatar {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5), 0 3px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 1);
}

[data-theme="dark"] .user-profile:focus-visible {
    outline-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25), 0 4px 16px rgba(59, 130, 246, 0.25);
}

/* Responsive user profile */
@media (max-width: 768px) {
    .user-profile {
        padding: 0.45rem 0.65rem;
        gap: 0.5rem;
        border-radius: 10px;
    }
    
    .user-name {
        font-size: 0.85rem;
    }
    
    .user-email {
        font-size: 0.75rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        border-width: 1.5px;
        box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25), 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    .user-profile:hover .user-avatar {
        transform: scale(1.06);
        box-shadow: 0 5px 16px rgba(59, 130, 246, 0.3), 0 2px 6px rgba(0, 0, 0, 0.12);
    }
}

@media (max-width: 640px) {
    .user-profile {
        padding: 0.4rem 0.6rem;
        gap: 0.45rem;
        border-radius: 8px;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .user-email {
        font-size: 0.7rem;
    }
    
    .user-avatar {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
        border-width: 1.5px;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25), 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    
    .user-profile:hover .user-avatar {
        transform: scale(1.05);
        box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3), 0 2px 5px rgba(0, 0, 0, 0.12);
    }
    
    .user-profile:hover {
        transform: none;
    }
}

.content-area {
    flex: 1;
    padding: 2rem;
    padding-top: 2rem;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
    height: 100%;
    background: var(--background-color);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 1;
}

.content-area::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2rem;
    background: var(--surface-color);
    z-index: 0;
    pointer-events: none;
}

.content-area.chat-mode {
    overflow: hidden;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

.content-area.chat-mode::before {
    display: none;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 2rem 1rem;
}

.welcome-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .welcome-title {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 600px;
    transition: color 0.2s ease;
}

[data-theme="dark"] .welcome-subtitle {
    color: rgba(226, 232, 240, 0.8);
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1rem, 3vw, 1.6rem);
    max-width: min(960px, 92vw);
    width: 100%;
    margin: 0 auto;
    justify-items: center;
    justify-content: center;
    align-items: center;
}
.action-cards.two-card-tight {
    max-width: 640px;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: clamp(0.8rem, 2vw, 1rem);
    justify-content: center;
    align-items: center;
}
.action-cards.three-card {
    max-width: 960px;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: clamp(0.8rem, 2vw, 1.2rem);
    justify-content: center;
    align-items: center;
}

.action-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: clamp(2rem, 4vw, 2.5rem) clamp(1.75rem, 3vw, 2rem);
    width: min(320px, 100%);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
}

.action-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.action-card:hover::before {
    opacity: 1;
}

.action-card:active {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.action-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 12px 24px rgba(59, 130, 246, 0.15);
}

.action-card.coming-soon {
    border-style: dashed;
    border-color: rgba(148, 163, 184, 0.4);
}

.action-card.coming-soon:hover {
    border-style: dashed;
    border-color: rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .action-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .action-card::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
}

[data-theme="dark"] .action-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .action-card:focus-visible {
    outline-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25), 0 12px 32px rgba(59, 130, 246, 0.25);
}

.action-card i {
    font-size: clamp(1.75rem, 3vw, 2rem);
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.action-card:hover i {
    transform: scale(1.1) rotate(5deg);
    color: var(--primary-dark);
}

[data-theme="dark"] .action-card i {
    color: #60a5fa;
}

[data-theme="dark"] .action-card:hover i {
    color: #93c5fd;
}

.action-card h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.45rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}

.action-card:hover h3 {
    color: var(--primary-color);
}

[data-theme="dark"] .action-card h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .action-card:hover h3 {
    color: #60a5fa;
}

.action-card p {
    color: var(--text-secondary);
    font-size: clamp(0.8rem, 1.5vw, 0.875rem);
    line-height: 1.6;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.action-card:hover p {
    color: var(--text-primary);
}

[data-theme="dark"] .action-card p {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .action-card:hover p {
    color: rgba(226, 232, 240, 0.9);
}

/* Language Selection */
.language-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 100%);
    z-index: 2000;
}

[data-theme="dark"] .language-selection {
    background: linear-gradient(135deg, #0b1120 0%, #1c2540 100%);
}

/* Language Selection with Header */
.language-selection .top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 2001;
}

[data-theme="dark"] .language-selection .top-bar {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

    .selection-header {
        margin-bottom: 2rem;
    }

.selection-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.selection-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.language-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    width: 100%;
}

.language-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: var(--shadow);
}

.language-card.selected {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.language-card.disabled {
    cursor: default;
    opacity: 0.75;
    border-style: dashed;
}

.language-card.disabled:hover {
    border-color: var(--border-color);
    transform: none;
    box-shadow: var(--shadow);
}

.language-card.locked {
    cursor: not-allowed;
    opacity: 0.7;
    border-style: dashed;
    border-color: var(--warning-color);
}

.language-card.locked:hover {
    border-color: var(--warning-color);
    transform: none;
    box-shadow: var(--shadow);
}

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

.card-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.language-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.language-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.language-plan-note {
    display: block;
    margin-top: 1.2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.language-card.selected .language-plan-note {
    color: var(--primary-color);
}

.language-card.locked .language-plan-note {
    color: var(--warning-color);
}

/* Level Selection */
.level-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    width: 100%;
    margin-bottom: 2rem;
}

.level-grid.two-column {
    max-width: 520px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    justify-items: center;
}

.level-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 260px;
}

.level-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.level-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.level-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    gap: 1rem;
    overflow: hidden;
    height: 100%;
}

.chat-topic-bar,
.chat-input-container {
    flex-shrink: 0;
}

.chat-topic-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

[data-theme="dark"] .chat-topic-bar {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.5rem 0 6rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.chat-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 300px;
    color: var(--text-secondary);
}

.chat-empty-state .empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
}

.chat-empty-state i {
    font-size: 3rem;
    color: var(--text-tertiary);
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.chat-empty-state .empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-empty-state .empty-state-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

[data-theme="dark"] .chat-empty-state i {
    color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .chat-empty-state .empty-state-title {
    color: var(--text-primary);
}

[data-theme="dark"] .chat-empty-state .empty-state-subtitle {
    color: var(--text-secondary);
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in;
    position: relative;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.bot {
    align-self: flex-start;
}

.message-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1.15rem 1.35rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.message-content:hover {
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12), 0 3px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.message-content:hover::before {
    opacity: 1;
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.25));
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2), 0 2px 6px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message.user .message-content::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
}

.message.user .message-content:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.3));
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25), 0 3px 8px rgba(37, 99, 235, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .message-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .message-content::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(59, 130, 246, 0.03));
}

[data-theme="dark"] .message-content:hover {
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .message.user .message-content {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.35));
    color: rgba(241, 245, 249, 0.98);
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3), 0 2px 6px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .message.user .message-content::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .message.user .message-content:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.4));
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35), 0 3px 8px rgba(59, 130, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.message.bot .message-content {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.18));
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15), 0 2px 6px rgba(5, 150, 105, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message.bot .message-content::before {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.03));
}

.message.bot .message-content:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.22));
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2), 0 3px 8px rgba(5, 150, 105, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.message-corrections,
.message-questions {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0.85rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px dashed rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.message-questions {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .message-corrections {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .message-questions {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.3);
}

.message-corrections li,
.message-questions li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.message-note-text {
    flex: 1 1 auto;
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgba(15, 23, 42, 0.95);
}

[data-theme="dark"] .message-note-text {
    color: rgba(241, 245, 249, 0.92);
}

.message-note-save {
    flex-shrink: 0;
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-note-save:hover:not(:disabled),
.message-note-save:focus-visible:not(:disabled) {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.7);
}

.message-note-save.is-saved,
.message-note-save:disabled {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.35);
    color: #15803d;
    cursor: default;
}

.message-notes-highlight {
    animation: notePulse 1.2s ease;
}

@keyframes notePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

[data-theme="dark"] .message.bot .message-content {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.3), rgba(5, 150, 105, 0.35));
    border-color: rgba(52, 211, 153, 0.5);
    color: rgba(241, 245, 249, 0.98);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25), 0 2px 6px rgba(5, 150, 105, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .message.bot .message-content::before {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), rgba(16, 185, 129, 0.08));
}

[data-theme="dark"] .message.bot .message-content:hover {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.35), rgba(5, 150, 105, 0.4));
    border-color: rgba(52, 211, 153, 0.6);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3), 0 3px 8px rgba(5, 150, 105, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.message.user .message-time {
    color: rgba(15, 23, 42, 0.8);
    font-weight: 500;
    transition: color 0.2s ease;
}

.message.user .message-content:hover .message-time {
    color: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .message.user .message-time {
    color: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .message.user .message-content:hover .message-time {
    color: rgba(226, 232, 240, 0.95);
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.message-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.message:hover .message-avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message:hover .message-avatar::before {
    opacity: 1;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.message.user .message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.message.user .message-avatar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
}

[data-theme="dark"] .message.user .message-avatar {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.2));
    color: var(--primary-color);
    border: 2px solid rgba(16, 185, 129, 0.25);
}

.message.bot .message-avatar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
}

[data-theme="dark"] .message.bot .message-avatar {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.3));
    color: rgba(52, 211, 153, 0.9);
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.message-text {
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
}

.message-content:hover .message-text {
    color: var(--text-primary);
}

[data-theme="dark"] .message-text {
    color: rgba(241, 245, 249, 0.95);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.65rem;
    text-align: right;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.message-content:hover .message-time {
    color: var(--text-primary);
}

[data-theme="dark"] .message-time {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .message-content:hover .message-time {
    color: rgba(226, 232, 240, 0.85);
}

.message-actions {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}

.message-actions .message-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.1));
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.message-actions .message-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-actions .message-action-btn:hover,
.message-actions .message-action-btn:focus-visible {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2), 0 2px 6px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-actions .message-action-btn:hover::before,
.message-actions .message-action-btn:focus-visible::before {
    opacity: 1;
}

.message-actions .message-action-btn i {
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-actions .message-action-btn:hover i,
.message-actions .message-action-btn:focus-visible i {
    transform: scale(1.1) rotate(5deg);
}

.message-actions .message-action-btn span {
    position: relative;
    z-index: 1;
}

.message.user .message-actions .message-action-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message.user .message-actions .message-action-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.25));
}

.message.user .message-actions .message-action-btn:hover,
.message.user .message-actions .message-action-btn:focus-visible {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.25));
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .message-actions .message-action-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.2));
    border-color: rgba(96, 165, 250, 0.35);
    color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .message-actions .message-action-btn::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(59, 130, 246, 0.25));
}

[data-theme="dark"] .message-actions .message-action-btn:hover,
[data-theme="dark"] .message-actions .message-action-btn:focus-visible {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.25));
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 6px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.audio-message {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    position: relative;
    z-index: 1;
}

.audio-player {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.05));
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.audio-player:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.08));
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.message.user .audio-player {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.2));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.message.user .audio-player:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.25));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .audio-player {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.15));
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .audio-player:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.2));
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.play-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.play-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.play-btn:hover::before {
    opacity: 1;
}

.play-btn i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.play-btn:hover i {
    transform: scale(1.1);
}

[data-theme="dark"] .play-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .play-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

[data-theme="dark"] .play-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Responsive Design for Chat Messages */
@media (max-width: 1024px) {
    .message {
        max-width: 85%;
        gap: 0.65rem;
    }
    
    .message-content {
        padding: 1rem 1.15rem;
        border-radius: 14px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .message-actions .message-action-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.75rem;
    }
    
    .play-btn {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 640px) {
    .message {
        max-width: 90%;
        gap: 0.5rem;
    }
    
    .message-content {
        padding: 0.9rem 1rem;
        border-radius: 12px;
    }
    
    .message-content:hover {
        transform: none;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .message:hover .message-avatar {
        transform: none;
    }
    
    .message-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .message-time {
        font-size: 0.7rem;
        margin-top: 0.5rem;
    }
    
    .message-actions {
        margin-top: 0.75rem;
        gap: 0.5rem;
    }
    
    .message-actions .message-action-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        border-radius: 10px;
    }
    
    .message-actions .message-action-btn:hover {
        transform: translateY(-1px);
    }
    
    .audio-player {
        padding: 0.55rem 0.7rem;
        border-radius: 10px;
    }
    
    .play-btn {
        width: 30px;
        height: 30px;
    }
    
    .play-btn:hover {
        transform: scale(1.05);
    }
}


/* Chat Input */
.chat-input-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem 1.5rem;
    margin-top: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    bottom: 0;
    z-index: 3;
    transition: all 0.2s ease;
}

[data-theme="dark"] .chat-input-container {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.input-group {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 2px 6px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .input-group {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .input-group:focus-within {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15), 0 2px 8px rgba(59, 130, 246, 0.2);
}

.input-group textarea {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 52px;
    max-height: 52px;
    height: 52px;
    overflow-y: auto;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
}

.input-group textarea::placeholder {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.input-group:focus-within textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.btn-primary:hover i {
    transform: translateY(-2px) scale(1.1);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-primary::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .btn-primary:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 4px 16px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    padding: 0.5rem;
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

[data-theme="dark"] .btn-icon:hover {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-primary);
}

.input-footer {
    margin-top: 0.75rem;
    text-align: center;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Practice Dashboard */
.practice-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.practice-header {
    margin-bottom: 2rem;
}

.practice-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.practice-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.practice-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.practice-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 260px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: var(--shadow);
    width: 280px;
    max-width: 100%;
}

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

.practice-card .card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0;
    background: none;
    color: var(--primary-color);
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}

.practice-card h3 {
    margin-top: 0.25rem;
}

/* Insights */
.insights-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 2rem clamp(1rem, 3vw, 2.5rem);
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.insights-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: flex-start;
    position: relative;
}

.insights-heading-copy {
    flex: 1 1 260px;
    position: relative;
}

.insights-header h2 {
    font-size: clamp(2.4rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

[data-theme="dark"] .insights-header h2 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insights-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: 0;
    transition: color 0.2s ease;
    line-height: 1.6;
}

[data-theme="dark"] .insights-header p {
    color: rgba(226, 232, 240, 0.8);
}

.insights-language-toggle {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    position: relative;
}

.insights-language-toggle .toggle-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.2s ease;
}

[data-theme="dark"] .insights-language-toggle .toggle-label {
    color: rgba(226, 232, 240, 0.85);
}

.insights-language-toggle .toggle-group {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.insights-language-toggle .toggle-group:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .insights-language-toggle .toggle-group {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .insights-language-toggle .toggle-group:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.insights-language-toggle .toggle-option {
    border: none;
    background: transparent;
    padding: 0.5rem 1.1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
}

.insights-language-toggle .toggle-option:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.08);
}

.insights-language-toggle .toggle-option + .toggle-option {
    border-left: 1px solid var(--border-color);
}

.insights-language-toggle .toggle-option.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.insights-language-toggle .toggle-option.active:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .insights-language-toggle .toggle-option {
    color: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .insights-language-toggle .toggle-option:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .insights-language-toggle .toggle-option.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .insights-language-toggle .toggle-option.active:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
}

.insights-row-primary {
    display: flex;
    gap: 1.8rem;
    align-items: flex-start;
    justify-content: center;
}

.insights-row-secondary {
    display: grid;
    gap: 1.8rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    width: 100%;
    min-width: 0;
}

.topic-usage-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.topic-usage-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.02));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.topic-usage-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(37, 99, 235, 0.04));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.topic-usage-list li:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.topic-usage-list li:hover::before {
    opacity: 1;
}

.topic-usage-list li:last-child {
    border-bottom: none;
}

[data-theme="dark"] .topic-usage-list li {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(59, 130, 246, 0.03));
    border-color: rgba(96, 165, 250, 0.12);
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .topic-usage-list li::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.06));
}

[data-theme="dark"] .topic-usage-list li:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}

.topic-usage-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1 1 200px;
    position: relative;
    z-index: 1;
}

.topic-usage-info .topic-name {
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.topic-usage-list li:hover .topic-name {
    color: var(--primary-color);
}

[data-theme="dark"] .topic-usage-info .topic-name {
    color: #e2e8f0;
}

[data-theme="dark"] .topic-usage-list li:hover .topic-name {
    color: #60a5fa;
}

.topic-usage-info .topic-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.topic-usage-list li:hover .topic-category {
    color: var(--text-primary);
}

[data-theme="dark"] .topic-usage-info .topic-category {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .topic-usage-list li:hover .topic-category {
    color: rgba(226, 232, 240, 0.85);
}

.topic-usage-count {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.1));
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.topic-usage-list li:hover .topic-usage-count {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .topic-usage-count {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.12));
    border-color: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
}

[data-theme="dark"] .topic-usage-list li:hover .topic-usage-count {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.22), rgba(59, 130, 246, 0.18));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.topic-usage-count span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
    transition: color 0.2s ease;
}

[data-theme="dark"] .topic-usage-count span {
    color: rgba(226, 232, 240, 0.7);
}

.topic-usage-list .empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    border-radius: 12px;
    border: 1px dashed rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .topic-usage-list .empty-state {
    color: rgba(226, 232, 240, 0.7);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.05));
    border-color: rgba(96, 165, 250, 0.2);
}

.insights-card {
    background: var(--surface-color);
    border-radius: 20px;
    padding: clamp(1.6rem, 3vw, 2rem);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-sizing: border-box;
    min-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    min-height: auto;
}

.insights-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.insights-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.insights-card:hover::before {
    opacity: 1;
}

[data-theme="dark"] .insights-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .insights-card::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(59, 130, 246, 0.03));
}

[data-theme="dark"] .insights-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.insights-row-primary .insights-card {
    flex: 1 1 320px;
    max-width: 520px;
    min-height: auto;
    height: auto;
}

.insights-card header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.insights-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.insights-card:hover h3 {
    color: var(--primary-color);
}

[data-theme="dark"] .insights-card h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .insights-card:hover h3 {
    color: #60a5fa;
}

.insights-meta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.12));
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.insights-card:hover .insights-meta {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .insights-meta {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(59, 130, 246, 0.15));
    border-color: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .insights-card:hover .insights-meta {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(59, 130, 246, 0.2));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.insights-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: visible;
}

.insights-stat {
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.insights-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.insights-stat:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.06));
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.insights-stat:hover::before {
    opacity: 1;
}

[data-theme="dark"] .insights-stat {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.05));
    border-color: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .insights-stat::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .insights-stat:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.08));
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}

.insights-stat .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.insights-stat:hover .label {
    color: var(--text-primary);
}

[data-theme="dark"] .insights-stat .label {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .insights-stat:hover .label {
    color: rgba(226, 232, 240, 0.9);
}

.insights-stat .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.insights-stat:hover .value {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .insights-stat .value {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .insights-stat:hover .value {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insights-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.insights-skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: visible;
}

.skill-block {
    padding: 1rem 1.2rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.06));
    border: 1px solid rgba(59, 130, 246, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.skill-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.08));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.skill-block:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08));
    border-color: rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.skill-block:hover::before {
    opacity: 1;
}

[data-theme="dark"] .skill-block {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
    border-color: rgba(96, 165, 250, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .skill-block::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.12));
}

[data-theme="dark"] .skill-block:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.12));
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.skill-block-button {
    border: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.06));
    color: inherit;
    padding: 1rem 1.2rem;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.skill-block-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.1));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.skill-block-button:hover,
.skill-block-button:focus-visible {
    outline: none;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.12));
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2), 0 0 0 3px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.skill-block-button:hover::before,
.skill-block-button:focus-visible::before {
    opacity: 1;
}

[data-theme="dark"] .skill-block-button {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
    border-color: rgba(96, 165, 250, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .skill-block-button::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.12));
}

[data-theme="dark"] .skill-block-button:hover,
[data-theme="dark"] .skill-block-button:focus-visible {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(59, 130, 246, 0.15));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3), 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.skill-block-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.skill-block:hover .skill-block-header {
    color: var(--primary-color);
}

[data-theme="dark"] .skill-block-header {
    color: #e2e8f0;
}

[data-theme="dark"] .skill-block:hover .skill-block-header {
    color: #60a5fa;
}

.skill-block-header i {
    color: #2563eb;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.skill-block:hover .skill-block-header i {
    color: #1d4ed8;
    transform: scale(1.1);
}

[data-theme="dark"] .skill-block-header i {
    color: #60a5fa;
}

[data-theme="dark"] .skill-block:hover .skill-block-header i {
    color: #93c5fd;
}

.skill-block-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.skill-block:hover .skill-block-text {
    color: var(--text-primary);
}

[data-theme="dark"] .skill-block-text {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .skill-block:hover .skill-block-text {
    color: rgba(226, 232, 240, 0.9);
}

.insights-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.insights-list li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.insights-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.insights-list li:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.06));
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.insights-list li:hover::before {
    opacity: 1;
}

[data-theme="dark"] .insights-list li {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.05));
    border-color: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .insights-list li::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .insights-list li:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.08));
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}

.insights-list i {
    color: #2563eb;
    margin-right: 0.6rem;
    flex-shrink: 0;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.insights-list li:hover i {
    color: #1d4ed8;
    transform: scale(1.1);
}

[data-theme="dark"] .insights-list i {
    color: #60a5fa;
}

[data-theme="dark"] .insights-list li:hover i {
    color: #93c5fd;
}

.voice-chat-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.voice-chat-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.voice-chat-button:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.voice-chat-button:hover::before {
    opacity: 1;
}

.voice-chat-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.voice-chat-button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 6px 16px rgba(37, 99, 235, 0.4);
}

.voice-chat-button i {
    font-size: 0.95rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.voice-chat-button:hover i {
    transform: scale(1.1) rotate(-5deg);
}

.voice-chat-button span,
.voice-chat-button {
    position: relative;
    z-index: 1;
}

/* Dark mode voice chat button styling */
[data-theme="dark"] .voice-chat-button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .voice-chat-button::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .voice-chat-button:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .voice-chat-button:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Responsive voice chat button */
@media (max-width: 768px) {
    .voice-chat-button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        gap: 0.45rem;
    }
    
    .voice-chat-button i {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .voice-chat-button {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
        gap: 0.4rem;
        border-radius: 20px;
    }
    
    .voice-chat-button i {
        font-size: 0.85rem;
    }
    
    .voice-chat-button:hover {
        transform: none;
    }
}

.voice-chat-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(12, 15, 32, 0.9);
    backdrop-filter: blur(16px);
    z-index: 3200;
}

.voice-chat-modal.active {
    display: flex;
}

.voice-chat-dialog {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.2), transparent 55%), var(--surface-color);
    border-radius: 0;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    color: var(--text-primary);
}

.voice-chat-header,
.voice-chat-footer {
    padding: clamp(1rem, 3vw, 1.3rem) clamp(1.2rem, 4vw, 1.8rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.voice-chat-body {
    flex: 1;
    padding: clamp(1rem, 3vw, 1.6rem) clamp(1.2rem, 4vw, 2.2rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.voice-topic-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem 0.75rem;
    gap: 0.75rem;
}

.voice-topic-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
}

.voice-topic-button i {
    color: var(--primary-color);
}

.voice-drill-panel {
    width: min(420px, 100%);
    border-radius: 16px;
    border: 1px dashed rgba(59, 130, 246, 0.4);
    padding: 1rem;
    background: rgba(59, 130, 246, 0.08);
    margin-top: 0.5rem;
    text-align: left;
}

.voice-drill-panel[hidden] {
    display: none !important;
}

.voice-drill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.voice-drill-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--primary-color);
}

.voice-drill-theme-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-right: auto;
}

.voice-drill-text {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}

.voice-drill-hint {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.voice-topic-picker {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(14px);
    z-index: 10;
}

.voice-topic-picker.active {
    display: flex;
}

.voice-topic-panel {
    width: min(460px, 92vw);
    background: var(--surface-color);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32);
    padding: clamp(1.4rem, 4vw, 1.8rem);
    display: grid;
    gap: 1.2rem;
    max-height: min(80vh, 720px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

.voice-topic-panel::-webkit-scrollbar {
    width: 8px;
}

.voice-topic-panel::-webkit-scrollbar-track {
    background: transparent;
}

.voice-topic-panel::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 999px;
}

.voice-topic-panel h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.voice-topic-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.voice-topic-options {
    display: grid;
    gap: 0.75rem;
}

.voice-level-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.voice-level-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(226, 232, 240, 0.45);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.voice-level-chip.selected,
.voice-level-chip:hover,
.voice-level-chip:focus-visible {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.18);
    color: var(--primary-color);
}

.voice-level-chip:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.voice-topic-card {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(226, 232, 240, 0.3);
    text-align: left;
    display: grid;
    gap: 0.4rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.voice-topic-card i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.voice-topic-card span {
    font-weight: 600;
    color: var(--text-primary);
}

.voice-topic-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.voice-topic-card.selected,
.voice-topic-card:hover,
.voice-topic-card:focus-visible {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.18);
    transform: translateY(-2px);
}

.voice-topic-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.voice-topic-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.voice-drill-theme-picker {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.voice-drill-theme-picker[hidden] {
    display: none !important;
}

.voice-drill-theme-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.voice-drill-theme-header p {
    margin: 0.2rem 0 0;
    color: #475569;
    font-size: 0.9rem;
}

.voice-drill-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    max-height: min(320px, 45vh);
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.voice-drill-theme-grid::-webkit-scrollbar {
    width: 6px;
}

.voice-drill-theme-grid::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.voice-drill-theme-card {
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: rgba(241, 245, 249, 0.8);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.voice-drill-theme-card h6 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    color: #0f172a;
}

.voice-drill-theme-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

.voice-drill-theme-card.selected,
.voice-drill-theme-card:hover,
.voice-drill-theme-card:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.voice-drill-theme-card:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.voice-drill-theme-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.voice-visual {
    display: grid;
    gap: 0.8rem;
    align-items: center;
    justify-items: center;
    color: #e2e8f0;
    font-size: 1.05rem;
    position: relative;
}

.voice-visual-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.voice-session-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.85);
}

.voice-tutor-name {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(71, 85, 105, 0.9);
}

[data-theme="dark"] .voice-session-title,
[data-theme="dark"] .voice-tutor-name {
    color: rgba(226, 232, 240, 0.95);
}

.voice-live-indicator {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at 30% 30%, rgba(251, 191, 36, 0.65), rgba(37, 99, 235, 0.25) 45%, rgba(15, 23, 42, 0.8) 75%);
    box-shadow: inset 0 0 18px rgba(15, 23, 42, 0.45), 0 18px 28px rgba(37, 99, 235, 0.28);
    opacity: 0.9;
    transform: scale(1);
    transition: box-shadow 0.25s ease, filter 0.25s ease, transform 0.25s ease;
}

.voice-live-indicator::before,
.voice-live-indicator::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2.5px solid rgba(59, 130, 246, 0.45);
    border-top-color: transparent;
    border-bottom-color: transparent;
    animation: voiceOrbit 2.8s linear infinite;
    animation-play-state: paused;
    opacity: 0.65;
}

.voice-live-indicator::after {
    inset: 12px;
    border: 2px solid rgba(248, 250, 252, 0.45);
    border-left-color: transparent;
    border-right-color: transparent;
    animation: voiceOrbit 1.6s linear infinite reverse;
    animation-play-state: paused;
    opacity: 0.4;
}

.voice-live-indicator .voice-live-core {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 25% 30%, rgba(248, 250, 252, 0.9), rgba(59, 130, 246, 0.85));
    box-shadow: 0 0 12px rgba(248, 250, 252, 0.55);
}

.voice-live-indicator.active {
    filter: drop-shadow(0 14px 24px rgba(37, 99, 235, 0.45));
    animation: voiceBeat 1.3s ease-in-out infinite;
}

.voice-live-indicator.active::before,
.voice-live-indicator.active::after {
    animation-play-state: running;
}

.voice-live-indicator.active .voice-live-core {
    animation: voiceCorePulse 1.3s ease-in-out infinite;
}

.voice-thinking-label {
    min-height: 1.25rem;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(30, 41, 59, 0.65);
    margin-top: 0.35rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.voice-thinking-label.visible {
    opacity: 1;
}

[data-theme="dark"] .voice-thinking-label {
    color: rgba(226, 232, 240, 0.7);
}

@keyframes voiceOrbit {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes voiceBeat {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.08);
    }
    60% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes voiceCorePulse {
    0% {
        box-shadow: 0 0 12px rgba(248, 250, 252, 0.55);
        background-position: 25% 30%;
    }
    40% {
        box-shadow: 0 0 20px rgba(248, 250, 252, 0.85);
        background-position: 40% 45%;
    }
    100% {
        box-shadow: 0 0 12px rgba(248, 250, 252, 0.55);
        background-position: 25% 30%;
    }
}

.voice-visual i {
    font-size: clamp(3rem, 12vw, 5rem);
    color: rgba(59, 130, 246, 0.85);
    filter: drop-shadow(0 12px 24px rgba(37, 99, 235, 0.45));
}

.voice-visual p {
    margin: 0;
    letter-spacing: 0.02em;
    color: rgba(15, 23, 42, 0.75);
}

[data-theme="dark"] .voice-visual p {
    color: rgba(226, 232, 240, 0.85);
}

.voice-focus-hint {
    max-width: 420px;
    margin-top: 0.5rem !important;
    color: rgba(15, 23, 42, 0.65);
    font-size: 0.85rem;
}

[data-theme="dark"] .voice-focus-hint {
    color: rgba(226, 232, 240, 0.75);
}

.voice-status-label {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(71, 85, 105, 0.85);
}

.voice-chat-history {
    display: none;
}

.voice-entry {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.voice-entry.user {
    align-items: flex-end;
}

.voice-entry.assistant {
    align-items: flex-start;
}

.voice-entry.system {
    align-items: center;
}

.voice-entry-bubble {
    max-width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    line-height: 1.5;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.voice-entry.user .voice-entry-bubble {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.voice-entry.assistant .voice-entry-bubble {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
}

.voice-entry.system .voice-entry-bubble {
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.voice-corrections-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.voice-corrections-hint i {
    margin-right: 0.35rem;
    color: #2563eb;
}

.voice-entry-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.voice-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.voice-control-group {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
}

[data-theme="dark"] .voice-control-group {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.18);
}

.voice-listen-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #fff;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.voice-listen-button i {
    font-size: 0.95rem;
}

.voice-btn-label {
    display: inline-block;
}

.voice-listen-button:hover,
.voice-listen-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 15px 40px rgba(17, 24, 39, 0.35);
}

.voice-listen-button.toggle-mode {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.voice-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.voice-mode-toggle input {
    appearance: none;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.3rem;
    border: 1.5px solid rgba(37, 99, 235, 0.3);
    background: rgba(248, 250, 252, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.voice-mode-toggle input:checked {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.voice-mode-toggle input:checked::after {
    content: '';
    width: 0.55rem;
    height: 0.35rem;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
}

[data-theme="dark"] .voice-mode-toggle input {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.45);
}

[data-theme="dark"] .voice-mode-toggle input:checked {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
}

.voice-options {
    display: none !important;
}

.voice-options {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-end;
}

.voice-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.voice-option input {
    width: 1.05rem;
    height: 1.05rem;
}

.voice-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.voice-option.disabled input {
    pointer-events: none;
}

.voice-chat-dialog.voice-state-listening .voice-favicon {
    animation: voice-pulse 1.4s ease-in-out infinite;
}

.voice-chat-dialog.voice-state-processing .voice-favicon {
    animation: voice-spin 0.9s linear infinite;
}

.voice-chat-dialog.voice-state-speaking .voice-favicon {
    animation: voice-speak 1.2s ease-in-out infinite;
}

.voice-chat-dialog.voice-state-processing .voice-status-label,
.voice-chat-dialog.voice-state-speaking .voice-status-label,
.voice-chat-dialog.voice-state-listening .voice-status-label {
    color: #2563eb;
    font-weight: 600;
}

.voice-entry-interim .voice-entry-bubble {
    opacity: 0.7;
    font-style: italic;
}

@keyframes voice-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes voice-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
}

@keyframes voice-speak {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.05); }
    60% { transform: scale(0.97); }
}

@media (max-width: 640px) {
    .voice-chat-dialog {
        width: 100%;
        border-radius: 18px;
    }

    .voice-chat-header,
    .voice-chat-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .voice-controls {
        width: 100%;
        justify-content: space-between;
    }

    .voice-instruction {
        text-align: left;
    }
}

.voice-summary-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 15, 32, 0.82);
    backdrop-filter: blur(12px);
    z-index: 3300;
    padding: clamp(1rem, 5vw, 2rem);
}

.voice-summary-modal.active {
    display: flex;
}

.voice-summary-dialog {
    width: min(720px, 95vw);
    max-height: 90vh;
    background: var(--surface-color);
    border-radius: 24px;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.voice-summary-header,
.voice-summary-footer {
    padding: clamp(1rem, 3vw, 1.4rem) clamp(1.2rem, 4vw, 1.8rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.voice-summary-header .modal-close {
    position: static;
}

.voice-summary-footer {
    justify-content: flex-end;
}

.voice-summary-body {
    padding: 0 clamp(1.2rem, 4vw, 1.8rem) clamp(1.2rem, 3vw, 1.6rem);
    overflow-y: auto;
    display: grid;
    gap: 1.2rem;
}

.voice-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin: 0 0 0.5rem;
    color: #475569;
    font-size: 0.9rem;
}

.voice-summary-turn {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    padding: 1rem clamp(1rem, 3vw, 1.4rem);
    background: rgba(241, 245, 249, 0.55);
    display: grid;
    gap: 0.8rem;
}

.voice-summary-turn h4 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #475569;
}

.voice-summary-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
}

.voice-summary-corrections {
    margin: 0;
    padding-left: 1.1rem;
    color: #1f2937;
    font-size: 0.95rem;
}

.voice-summary-corrections li + li {
    margin-top: 0.4rem;
}

.voice-summary-empty {
    text-align: center;
    color: #475569;
    font-size: 1rem;
}

.voice-summary-footer .btn {
    margin-left: 0;
}

.text-muted {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.insights-modal {
    max-width: min(680px, 90vw);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: clamp(1.8rem, 4vw, 2.6rem);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2), 0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.insights-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

[data-theme="dark"] .insights-modal {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .insights-modal::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(59, 130, 246, 0.03));
}

.insights-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .insights-modal .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.insights-modal .modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .insights-modal .modal-header h3 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insights-modal .modal-close {
    position: relative;
    top: auto;
    right: auto;
    border: none;
    background: var(--surface-color);
    color: var(--text-secondary);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.insights-modal .modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
}

.insights-modal .modal-close:hover,
.insights-modal .modal-close:focus-visible {
    background: var(--surface-color);
    color: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
    outline: none;
}

.insights-modal .modal-close:hover::before,
.insights-modal .modal-close:focus-visible::before {
    opacity: 1;
}

.insights-modal .modal-close i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.insights-modal .modal-close:hover i {
    transform: rotate(90deg) scale(1.1);
}

[data-theme="dark"] .insights-modal .modal-close {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .insights-modal .modal-close::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .insights-modal .modal-close:hover,
[data-theme="dark"] .insights-modal .modal-close:focus-visible {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.insights-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    position: relative;
    z-index: 1;
}

.insights-modal-body section {
    position: relative;
}

.insights-modal-body section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

[data-theme="dark"] .insights-modal-body section h4 {
    color: #e2e8f0;
}

.insights-summary {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.08));
    border-radius: 16px;
    padding: 1.25rem 1.15rem;
    border: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.insights-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.1));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.insights-summary:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.1));
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.insights-summary:hover::before {
    opacity: 1;
}

[data-theme="dark"] .insights-summary {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.1));
    border-color: rgba(96, 165, 250, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .insights-summary::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.12));
}

[data-theme="dark"] .insights-summary:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.12));
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.insights-summary > div {
    position: relative;
    z-index: 1;
}

.summary-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.insights-summary:hover .summary-label {
    color: var(--text-primary);
}

[data-theme="dark"] .summary-label {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .insights-summary:hover .summary-label {
    color: rgba(226, 232, 240, 0.9);
}

.insights-summary strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.2s ease;
    display: block;
}

.insights-summary:hover strong {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .insights-summary strong {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .insights-summary:hover strong {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insights-breakdown,
.insights-examples,
.insights-actions {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.insights-breakdown li,
.insights-examples li,
.insights-actions li {
    padding: 1rem 1.15rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(37, 99, 235, 0.04));
    border: 1px solid rgba(59, 130, 246, 0.12);
    color: var(--text-secondary);
    line-height: 1.6;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.insights-breakdown li::before,
.insights-examples li::before,
.insights-actions li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.08));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.insights-breakdown li:hover,
.insights-examples li:hover,
.insights-actions li:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.08));
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15), 0 1px 4px rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.insights-breakdown li:hover::before,
.insights-examples li:hover::before,
.insights-actions li:hover::before {
    opacity: 1;
}

[data-theme="dark"] .insights-breakdown li,
[data-theme="dark"] .insights-examples li,
[data-theme="dark"] .insights-actions li {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.06));
    border-color: rgba(96, 165, 250, 0.15);
    color: rgba(226, 232, 240, 0.75);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .insights-breakdown li::before,
[data-theme="dark"] .insights-examples li::before,
[data-theme="dark"] .insights-actions li::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.1));
}

[data-theme="dark"] .insights-breakdown li:hover,
[data-theme="dark"] .insights-examples li:hover,
[data-theme="dark"] .insights-actions li:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.1));
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2), 0 1px 4px rgba(0, 0, 0, 0.3);
    color: rgba(226, 232, 240, 0.9);
}

.insights-breakdown li strong {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    transition: color 0.2s ease;
    display: block;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insights-breakdown li:hover strong {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .insights-breakdown li strong {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .insights-breakdown li:hover strong {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insights-breakdown li span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    display: block;
    margin-top: 0.25rem;
}

.insights-breakdown li:hover span {
    color: var(--text-primary);
}

[data-theme="dark"] .insights-breakdown li span {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .insights-breakdown li:hover span {
    color: rgba(226, 232, 240, 0.85);
}

.insights-examples li span {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.4rem;
    color: rgba(15, 23, 42, 0.65);
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.insights-examples li:hover span {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.06));
    border-color: rgba(59, 130, 246, 0.15);
    color: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .insights-examples li span {
    color: rgba(226, 232, 240, 0.65);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.06));
    border-color: rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .insights-examples li:hover span {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
    border-color: rgba(96, 165, 250, 0.18);
    color: rgba(226, 232, 240, 0.8);
}

.insights-actions li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.insights-actions li i {
    color: #2563eb;
    margin-right: 0.5rem;
    flex-shrink: 0;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    margin-top: 0.1rem;
}

.insights-actions li:hover i {
    color: #1d4ed8;
    transform: scale(1.1) rotate(5deg);
}

[data-theme="dark"] .insights-actions li i {
    color: #60a5fa;
}

[data-theme="dark"] .insights-actions li:hover i {
    color: #93c5fd;
}

@media (max-width: 1024px) {
    .insights-dashboard {
        padding: 1.5rem 1rem 3.5rem;
        gap: 2rem;
    }

    .insights-row-primary {
        flex-direction: column;
        gap: 1.5rem;
    }

    .insights-row-secondary {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 1.5rem;
    }

    .insights-row-secondary .insights-card {
        width: 100%;
    }
    
    .insights-card {
        padding: 1.5rem;
    }
    
    .insights-card:hover {
        transform: translateY(-1px);
    }
    
    .insights-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .insights-skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 1024px) {
    .insights-modal {
        max-width: min(90vw, 680px);
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .insights-modal-body {
        gap: 1.5rem;
    }
    
    .insights-summary {
        padding: 1rem;
    }
    
    .insights-breakdown li,
    .insights-examples li,
    .insights-actions li {
        padding: 0.9rem 1rem;
    }
}

@media (max-width: 640px) {
    .insights-modal {
        max-width: 95vw;
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .insights-modal .modal-header {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }
    
    .insights-modal .modal-header h3 {
        font-size: 1.25rem;
    }
    
    .insights-modal .modal-close {
        width: 2rem;
        height: 2rem;
        border-radius: 8px;
    }
    
    .insights-modal-body {
        gap: 1.25rem;
    }
    
    .insights-modal-body section h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .insights-summary {
        grid-template-columns: 1fr;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .insights-summary:hover {
        transform: none;
    }
    
    .insights-summary strong {
        font-size: 1.35rem;
    }
    
    .insights-breakdown li,
    .insights-examples li,
    .insights-actions li {
        padding: 0.85rem 0.95rem;
        border-radius: 12px;
    }
    
    .insights-breakdown li:hover,
    .insights-examples li:hover,
    .insights-actions li:hover {
        transform: translateX(2px);
    }
    
    .insights-examples li span {
        padding: 0.45rem 0.65rem;
        font-size: 0.8rem;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(18px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal.immersive-modal {
    box-shadow: none;
}

body.modal-open {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

.upgrade-features {
    margin-top: 1rem;
}

.upgrade-features h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upgrade-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upgrade-features li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 28px;
    padding: clamp(1.8rem, 4vw, 2.6rem);
    width: min(600px, 94vw);
    max-height: min(88vh, 900px);
    overflow-y: auto;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 3vw, 1.5rem);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 1.5rem;
}

#personalNoteModal textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(248, 250, 252, 0.95);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#personalNoteModal textarea::placeholder {
    color: #94a3b8;
}

#personalNoteModal textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
    background: rgba(255, 255, 255, 0.98);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Confirm Dialog Modal Styles */
.confirm-dialog-modal {
    z-index: 10001; /* Higher than settings modal */
}

.confirm-dialog-content {
    max-width: 480px;
    width: 90%;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .confirm-dialog-content {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.confirm-dialog-content .modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.confirm-dialog-content .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-dialog-content .modal-body {
    padding: 1.5rem;
    margin-bottom: 0;
}

.confirm-dialog-content .confirm-message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.confirm-dialog-content .modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

.confirm-dialog-content .modal-actions .btn {
    min-width: 120px;
}

[data-theme="dark"] .confirm-dialog-content .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .confirm-dialog-content .modal-actions {
    border-top-color: rgba(148, 163, 184, 0.2);
}

#vocabularyModal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#vocabularyModal label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

#vocabularyModal input,
#vocabularyModal textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#vocabularyModal textarea {
    min-height: 120px;
    resize: vertical;
}

#vocabularyModal input:focus,
#vocabularyModal textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

[data-theme="dark"] #vocabularyModal label {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] #vocabularyModal input,
[data-theme="dark"] #vocabularyModal textarea {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(59, 130, 246, 0.32);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] #vocabularyModal input::placeholder,
[data-theme="dark"] #vocabularyModal textarea::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.confirmation-modal .modal-content {
    max-width: 420px;
    width: 90%;
}

.confirmation-modal .modal-body {
    margin-bottom: 1rem;
}

.confirmation-modal .modal-body p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar,
    .sidebar.collapsed {
        display: none !important;
    }

    .sidebar-toggle,
    #sidebarToggle {
        display: none !important;
    }

    .app-container {
        height: 100vh;
        min-height: 100vh;
        padding-left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        min-height: 0;
        height: 100%;
    }

    .app-container:has(.sidebar.collapsed) .main-content,
    .app-container.sidebar-collapsed .main-content,
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-bar {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .top-bar-left,
    .top-bar-right {
        width: 100%;
        justify-content: space-between;
    }

    .top-bar-right {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .top-bar-quick-actions {
        display: flex;
        width: 100%;
    }

    .top-bar-quick-btn {
        flex: 1;
        justify-content: center;
    }

    .top-bar-right .user-profile {
        width: 100%;
        justify-content: center;
    }
    
    .theme-toggle {
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 10px;
    }
    
    .theme-toggle i {
        font-size: 0.9rem;
    }
    
    .logo-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .content-area {
        padding: 1.25rem;
        padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
        min-height: 0;
        height: 100%;
        overflow-y: auto;
    }

    .content-area.chat-mode {
        height: 100%;
        min-height: 0;
        padding-bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
    }

    .chat-container {
        flex: 1;
        min-height: 0;
        height: 100%;
    }

    .chat-messages {
        flex: 1;
        min-height: 0;
    }
    
    .insights-dashboard {
        width: 100%;
        box-sizing: border-box;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    }

    .insights-row-primary .insights-card,
    .insights-row-secondary .insights-card {
        max-width: none;
        width: 100%;
    }

    .insights-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .insights-stat {
        padding: 0.9rem 1rem;
    }
    
    .insights-stat .value {
        font-size: 1.4rem;
    }

    .insights-skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skill-block,
    .skill-block-button {
        padding: 0.9rem 1rem;
    }
    
    .topic-usage-list {
        display: flex;
        flex-direction: column;
    }
    
    .topic-usage-list li {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.85rem 1rem;
    }
    
    .topic-usage-info {
        width: 100%;
    }
    
    .topic-usage-count {
        width: 100%;
        margin-top: 0.25rem;
        justify-content: center;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .action-cards {
        grid-template-columns: 1fr;
    }
    
    .action-cards.two-card-tight {
        grid-template-columns: 1fr;
        max-width: min(480px, 92vw);
        justify-items: center;
        justify-content: center;
        align-items: center;
    }
    
    .action-cards.three-card {
        grid-template-columns: 1fr;
        max-width: min(480px, 92vw);
        justify-items: center;
        justify-content: center;
        align-items: center;
    }
    
    .language-cards {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
        gap: 1.25rem;
    }
    
    .level-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .practice-grid {
        grid-template-columns: 1fr;
    }
    
    .message {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .level-grid {
        grid-template-columns: 1fr;
    }
    
.action-card,
.language-card,
.practice-card {
    padding: 1.5rem;
}

    .language-card {
        margin: 0 0.75rem;
        border-radius: calc(var(--border-radius) * 1.1);
    }
    
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}

/* Settings Modal Styles */
.settings-modal {
    max-width: 720px;
    width: min(94vw, 720px);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: clamp(1.8rem, 4vw, 2.6rem);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2), 0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .settings-modal {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

[data-theme="dark"] .settings-modal .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.settings-modal .modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .settings-modal .modal-header h3 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-modal .modal-close {
    position: relative;
    top: auto;
    right: auto;
    border: none;
    background: var(--surface-color);
    color: var(--text-secondary);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.settings-modal .modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
}

.settings-modal .modal-close:hover,
.settings-modal .modal-close:focus-visible {
    background: var(--surface-color);
    color: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
    outline: none;
}

.settings-modal .modal-close:hover::before,
.settings-modal .modal-close:focus-visible::before {
    opacity: 1;
}

.settings-modal .modal-close i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.settings-modal .modal-close:hover i {
    transform: rotate(90deg) scale(1.1);
}

[data-theme="dark"] .settings-modal .modal-close {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .settings-modal .modal-close::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .settings-modal .modal-close:hover,
[data-theme="dark"] .settings-modal .modal-close:focus-visible {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.settings-section {
    margin-bottom: 2.25rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

[data-theme="dark"] .settings-section {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.settings-section h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .settings-section h4 {
    color: #e2e8f0;
}

.settings-note {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

[data-theme="dark"] .settings-note {
    color: rgba(226, 232, 240, 0.75);
}

.setting-item {
    margin-bottom: 1.75rem;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .setting-item label {
    color: rgba(226, 232, 240, 0.95);
}

.setting-item input[type="text"],
.setting-item input[type="email"] {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--surface-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.setting-item input[type="text"]::placeholder,
.setting-item input[type="email"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.setting-item input[type="text"]:hover,
.setting-item input[type="email"]:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.1);
}

.setting-item input[type="text"]:focus,
.setting-item input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 2px 8px rgba(59, 130, 246, 0.2);
    background: var(--surface-color);
}

[data-theme="dark"] .setting-item input[type="text"],
[data-theme="dark"] .setting-item input[type="email"] {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
    color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .setting-item input[type="text"]:hover,
[data-theme="dark"] .setting-item input[type="email"]:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .setting-item input[type="text"]:focus,
[data-theme="dark"] .setting-item input[type="email"]:focus {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), 0 2px 12px rgba(59, 130, 246, 0.25);
    background: rgba(30, 41, 59, 0.8);
}

.setting-item select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--surface-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.setting-item select:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.1);
}

.setting-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 2px 8px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .setting-item select {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
    color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .setting-item select:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .setting-item select:focus {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), 0 2px 12px rgba(59, 130, 246, 0.25);
    background: rgba(30, 41, 59, 0.8);
}

/* Theme Toggle Switch in Settings */
.theme-toggle-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.theme-toggle-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
}

.theme-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 3rem;
    text-align: center;
    transition: color 0.2s ease;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
    cursor: pointer;
    flex-shrink: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.3);
    transition: var(--transition);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch input:checked + .theme-slider {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.theme-switch input:checked + .theme-slider:before {
    transform: translateX(24px);
}

.theme-switch input:focus + .theme-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.theme-switch:hover .theme-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.theme-switch input:checked + .theme-slider:before {
    background-color: #fff;
}

/* Dark mode theme toggle styling */
[data-theme="dark"] .theme-slider {
    background-color: rgba(71, 85, 105, 0.5);
}

[data-theme="dark"] .theme-switch input:checked + .theme-slider {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .theme-switch input:focus + .theme-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .theme-switch:hover .theme-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .theme-label {
    color: var(--text-secondary);
}

.theme-switch input:checked ~ .theme-label.dark,
.theme-switch input:not(:checked) ~ .theme-label.light {
    color: var(--text-primary);
    font-weight: 600;
}

/* Responsive theme toggle */
@media (max-width: 768px) {
    .theme-toggle-option {
        gap: 0.75rem;
    }
    
    .theme-label {
        font-size: 0.85rem;
        min-width: 2.5rem;
    }
    
    .theme-switch {
        width: 52px;
        height: 30px;
    }
    
    .theme-slider:before {
        height: 22px;
        width: 22px;
        left: 4px;
        bottom: 4px;
    }
    
    .theme-switch input:checked + .theme-slider:before {
        transform: translateX(22px);
    }
}

@media (max-width: 640px) {
    .theme-toggle-option {
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .theme-label {
        font-size: 0.8rem;
        min-width: 2rem;
    }
    
    .theme-switch {
        width: 48px;
        height: 28px;
    }
    
    .theme-slider:before {
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
    }
    
    .theme-switch input:checked + .theme-slider:before {
        transform: translateX(20px);
    }
}

.profile-pic-upload {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.settings-modal .btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.settings-modal .btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.settings-modal .btn-secondary:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.settings-modal .btn-secondary:hover::before {
    opacity: 1;
}

.settings-modal .btn-secondary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .settings-modal .btn-secondary {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .settings-modal .btn-secondary::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .settings-modal .btn-secondary:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .settings-modal .btn-secondary:focus-visible {
    outline-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25), 0 4px 16px rgba(59, 130, 246, 0.25);
}

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

[data-theme="dark"] .settings-modal .modal-actions {
    border-top-color: rgba(148, 163, 184, 0.15);
}

.settings-modal .modal-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.settings-modal .modal-actions .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.settings-modal .modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.settings-modal .modal-actions .btn-primary:hover::before {
    opacity: 1;
}

.settings-modal .modal-actions .btn-primary:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .settings-modal .modal-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .settings-modal .modal-actions .btn-primary::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .settings-modal .modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .settings-modal .modal-actions .btn-primary:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 4px 16px rgba(59, 130, 246, 0.5);
}

.plan-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.25rem;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.plan-info:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.plan-info.sprint-info {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

[data-theme="dark"] .plan-info {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .plan-info:hover {
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.plan-badge {
    padding: 0.35rem 0.9rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.plan-info .plan-badge {
    align-self: center;
    position: relative;
    top: 0;
}

.plan-badge.basic {
    background: #000000;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.plan-badge.basic:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.plan-badge.pro {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.plan-badge:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.plan-badge.pro:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.plan-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

[data-theme="dark"] .plan-message {
    color: rgba(226, 232, 240, 0.8);
}

.plan-upgrade-btn {
    display: none;
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.plan-upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.plan-upgrade-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.plan-upgrade-btn:hover::before {
    opacity: 1;
}

.plan-upgrade-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(37, 99, 235, 0.4);
}

.plan-upgrade-btn.is-ack {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: default;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .plan-upgrade-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .plan-upgrade-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .plan-upgrade-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .plan-upgrade-btn:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 4px 16px rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .plan-upgrade-btn.is-ack {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.logout-settings .logout-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.logout-settings .logout-inline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.logout-settings .logout-inline:hover {
    background: var(--surface-color);
    border-color: var(--danger-color);
    color: var(--danger-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.logout-settings .logout-inline:hover::before {
    opacity: 1;
}

.logout-settings .logout-inline:focus-visible {
    outline: 2px solid var(--danger-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.2);
}

.logout-settings .logout-inline i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.logout-settings .logout-inline:hover i {
    transform: translateX(2px) scale(1.05);
}

[data-theme="dark"] .logout-settings .logout-inline {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .logout-settings .logout-inline::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .logout-settings .logout-inline:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .logout-settings .logout-inline:focus-visible {
    outline-color: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.25), 0 4px 16px rgba(239, 68, 68, 0.3);
}

.roadmap-summary-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: center;
    transition: all 0.2s ease;
}

.roadmap-summary-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .roadmap-summary-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .roadmap-summary-card:hover {
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.roadmap-summary-eyebrow {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

[data-theme="dark"] .roadmap-summary-eyebrow {
    color: rgba(226, 232, 240, 0.7);
}

.roadmap-summary-copy h5 {
    margin: 0.35rem 0 0.5rem;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 700;
}

[data-theme="dark"] .roadmap-summary-copy h5 {
    color: #e2e8f0;
}

.roadmap-summary-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

[data-theme="dark"] .roadmap-summary-meta {
    color: rgba(226, 232, 240, 0.75);
}

.roadmap-summary-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.roadmap-summary-actions .btn {
    border-radius: 12px;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.roadmap-summary-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.roadmap-summary-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.roadmap-summary-actions .btn:hover::before {
    opacity: 1;
}

[data-theme="dark"] .roadmap-summary-actions .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .roadmap-summary-actions .btn:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive settings modal */
@media (max-width: 768px) {
    .settings-modal {
        width: 96vw;
        padding: clamp(1.5rem, 4vw, 2rem);
        border-radius: 16px;
    }
    
    .settings-modal .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .settings-section h4 {
        font-size: 1.1rem;
    }
    
    .setting-item input[type="text"],
    .setting-item input[type="email"],
    .setting-item select {
        padding: 0.75rem 0.9rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .current-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
        border-width: 2.5px;
    }
    
    .settings-modal .btn-secondary,
    .settings-modal .modal-actions .btn-primary {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
}

@media (max-width: 640px) {
    .settings-modal {
        width: 98vw;
        padding: clamp(1.25rem, 4vw, 1.75rem);
        border-radius: 12px;
    }
    
    .settings-modal .modal-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .settings-modal .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .settings-section {
        margin-bottom: 1.75rem;
        padding-bottom: 1.5rem;
    }
    
    .settings-section h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .setting-item {
        margin-bottom: 1.5rem;
    }
    
    .setting-item label {
        font-size: 0.9rem;
        margin-bottom: 0.55rem;
    }
    
    .setting-item input[type="text"],
    .setting-item input[type="email"],
    .setting-item select {
        padding: 0.7rem 0.85rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .current-avatar {
        width: 65px;
        height: 65px;
        font-size: 1.6rem;
        border-width: 2px;
    }
    
    .profile-pic-upload {
        gap: 1.25rem;
    }
    
    .settings-modal .btn-secondary,
    .settings-modal .modal-actions .btn-primary,
    .logout-settings .logout-inline {
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .settings-modal .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .settings-modal .modal-actions .btn-secondary,
    .settings-modal .modal-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .settings-modal .btn-secondary:hover,
    .settings-modal .modal-actions .btn-primary:hover,
    .logout-settings .logout-inline:hover {
        transform: none;
    }
}

.preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed var(--primary-color);
    border-radius: 0.5rem;
    background: #f8fafc;
}

.cropper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.cropper-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8fafc;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.cropper-wrapper:active {
    cursor: grabbing;
}

.cropper-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: all;
    cursor: grab;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.cropper-img:active {
    cursor: grabbing;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

.crop-box {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
    pointer-events: all;
    cursor: move;
    touch-action: none;
    z-index: 2;
    transition: border-color 0.2s ease;
}

.crop-box:hover {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.crop-box:active {
    cursor: grabbing;
    border-color: rgba(59, 130, 246, 0.8);
}

.crop-handles {
    position: relative;
    width: 100%;
    height: 100%;
}

.crop-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    pointer-events: all;
    z-index: 3;
    touch-action: none;
}

.crop-handle:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: var(--primary-color);
    border-color: white;
}

.crop-handle:active {
    transform: scale(1.1);
}

.crop-handle.nw {
    top: -8px;
    left: -8px;
    cursor: nw-resize;
}

.crop-handle.ne {
    top: -8px;
    right: -8px;
    cursor: ne-resize;
}

.crop-handle.sw {
    bottom: -8px;
    left: -8px;
    cursor: sw-resize;
}

.crop-handle.se {
    bottom: -8px;
    right: -8px;
    cursor: se-resize;
}

.cropper-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-level {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

.reset-controls {
    display: flex;
    gap: 0.5rem;
}

.preview-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.preview-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.current-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.current-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.current-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4), 0 3px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 1);
}

.current-avatar:hover::before {
    opacity: 1;
}

.current-avatar i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.current-avatar:hover i {
    transform: scale(1.1);
}

[data-theme="dark"] .current-avatar {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .current-avatar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .current-avatar:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.5), 0 3px 14px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 1);
}

/* Profile picture pending save indicator */
.current-avatar.pending-save {
    position: relative;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(59, 130, 246, 0.3);
    animation: pendingPulse 2s ease-in-out infinite;
}

.current-avatar.pending-save::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pendingPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3), 0 6px 16px rgba(59, 130, 246, 0.4);
    }
}

/* Change Picture button with pending indicator */
#changePictureBtn.has-pending {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-color: #2563eb;
    position: relative;
}

#changePictureBtn.has-pending::after {
    content: '•';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    color: white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Highlight Save Changes button animation */
.highlight-save-button {
    animation: highlightSaveButton 2s ease-in-out;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 4px 16px rgba(59, 130, 246, 0.5) !important;
    transform: scale(1.05);
}

@keyframes highlightSaveButton {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }
    25%, 75% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.5), 0 6px 20px rgba(59, 130, 246, 0.6);
        transform: scale(1.08);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.6), 0 8px 24px rgba(59, 130, 246, 0.7);
        transform: scale(1.1);
    }
}

[data-theme="dark"] .current-avatar.pending-save {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3), 0 4px 12px rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .current-avatar.pending-save::after {
    background: #60a5fa;
}

[data-theme="dark"] #changePictureBtn.has-pending {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border-color: #3b82f6;
}

[data-theme="dark"] .highlight-save-button {
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.5), 0 4px 16px rgba(96, 165, 250, 0.6) !important;
}

.language-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.language-display span {
    font-weight: 500;
    color: var(--text-primary);
}


.plan-upgrade-btn {
    display: none;
    width: 100%;
    margin-top: 0.75rem;
    justify-content: center;
    align-items: center;
}

.plan-upgrade-btn.is-ack {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: default;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .plan-upgrade-btn {
        display: inline-flex;
    }
}

/* Large screen optimization */
@media (min-width: 1200px) {
    .action-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        max-width: 1100px;
    }
    
    .language-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1000px;
    }
    
    .level-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 1000px;
    }
    
    .practice-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
    }
}

/* Floating Profile Icon */
.floating-profile {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    display: block;
}

/* Hide floating profile icon when chat interface is active */
.floating-profile.hidden {
    display: none;
}

.floating-profile:hover {
    transform: scale(1.05) translateY(-2px);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.profile-avatar:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 12px 32px rgba(37, 99, 246, 0.4), 0 6px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.profile-avatar:hover::before {
    opacity: 1;
}

.profile-avatar i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar:hover i {
    transform: scale(1.1) rotate(5deg);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Dark theme adjustments for floating profile */
[data-theme="dark"] .profile-avatar {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .profile-avatar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

[data-theme="dark"] .profile-avatar:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Hide floating profile on mobile and tablet - only show on desktop/web app */
@media (max-width: 1024px) {
    .floating-profile {
        display: none !important;
    }
    
    .top-bar .user-profile {
        display: none;
    }
}

/* Desktop/web app only - show floating profile */
@media (min-width: 1025px) {
    .floating-profile:not(.hidden) {
        display: block;
    }
    
    /* Show floating profile in practice modes and insights section on desktop/web app */
    .practice-dashboard ~ .floating-profile,
    #savedPractice ~ .floating-profile,
    #knowledgeBase ~ .floating-profile,
    #deepDivePractice ~ .floating-profile,
    #insightsDashboard ~ .floating-profile {
        display: block !important;
    }
    
    /* Ensure floating profile is visible when practice sections or insights are active on desktop */
    body:has(#practiceDashboard[style*="flex"]) .floating-profile,
    body:has(#savedPractice[style*="flex"]) .floating-profile,
    body:has(#knowledgeBase[style*="flex"]) .floating-profile,
    body:has(#deepDivePractice[style*="flex"]) .floating-profile,
    body:has(#insightsDashboard[style*="flex"]) .floating-profile {
        display: block !important;
    }
}

/* Pricing Modal Styles */
.pricing-modal {
    max-width: 880px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25), 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(16px);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.pricing-modal::-webkit-scrollbar {
    width: 8px;
}

.pricing-modal::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.pricing-modal::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.pricing-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .pricing-modal::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .pricing-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.6);
}

.pricing-modal::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 0;
}

.pricing-modal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    pointer-events: none;
    z-index: 1;
}

.pricing-modal .modal-content {
    position: relative;
    z-index: 1;
    padding: clamp(1.8rem, 4vw, 2.5rem);
    min-height: min-content;
    display: flex;
    flex-direction: column;
}

.pricing-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.pricing-modal .modal-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

[data-theme="dark"] .pricing-modal .modal-header h2 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-modal .modal-close {
    position: relative;
    top: auto;
    right: auto;
    border: none;
    background: var(--surface-color);
    color: var(--text-secondary);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.pricing-modal .modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
}

.pricing-modal .modal-close:hover,
.pricing-modal .modal-close:focus-visible {
    background: var(--surface-color);
    color: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
    outline: none;
}

.pricing-modal .modal-close:hover::before,
.pricing-modal .modal-close:focus-visible::before {
    opacity: 1;
}

.pricing-modal .modal-close i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.pricing-modal .modal-close:hover i {
    transform: rotate(90deg) scale(1.1);
}

[data-theme="dark"] .pricing-modal .modal-close {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .pricing-modal .modal-close::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .pricing-modal .modal-close:hover,
[data-theme="dark"] .pricing-modal .modal-close:focus-visible {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pricing-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    overflow: visible;
    position: relative;
    z-index: 1;
    min-height: min-content;
}

.pricing-modal-note {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08));
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    font-weight: 500;
    line-height: 1.5;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.pricing-modal-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pricing-modal-note:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.pricing-modal-note:hover::before {
    opacity: 1;
}

[data-theme="dark"] .pricing-modal-note {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.12));
    border-color: rgba(96, 165, 250, 0.25);
    color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .pricing-modal-note::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .pricing-modal-note:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.15));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.pricing-card {
    background: var(--surface-color);
    border-radius: 18px;
    padding: 2.5rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: visible;
    position: relative;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 18px;
    pointer-events: none;
}

.pricing-card::after {
    display: none;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.pricing-card:hover::before {
    opacity: 1;
}

.pricing-card.pro-plan {
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    background: var(--surface-color);
    margin-top: 0;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15), 0 2px 10px rgba(0, 0, 0, 0.08);
}

.pricing-card.pro-plan::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(37, 99, 235, 0.04));
}

.pricing-card.pro-plan:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.2), 0 4px 14px rgba(0, 0, 0, 0.1);
}

.pricing-card:not(.pro-plan) {
    margin-top: 0.9rem;
}

/* Pricing Modal Plan Badge - Stagnant on mobile/tablet when upgrade to pro is clicked */
.pricing-card .plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(120deg, var(--primary-color), #3b82f6);
    color: white;
    padding: 0.45rem 1.4rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 18px 28px rgba(59, 130, 246, 0.35);
    z-index: 3;
    min-width: 120px;
    display: inline-flex;
    justify-content: center;
    transition: none;
    pointer-events: none;
}

.pricing-card:hover .plan-badge {
    transform: translateX(-50%);
}

@media (max-width: 1024px) {
    .pricing-card .plan-badge {
        transition: none;
        pointer-events: none;
    }
    
    .pricing-card:hover .plan-badge {
        transform: translateX(-50%);
    }
    
    .plan-features li {
        white-space: nowrap;
        font-size: clamp(0.8rem, 1.5vw, 0.95rem);
        min-width: 0;
    }
    
    .plan-features li > * {
        flex-shrink: 0;
    }
    
    .plan-note {
        font-size: clamp(0.75rem, 1.5vw, 0.85rem);
        line-height: 1.5;
    }
}

@media (max-width: 768px) {
    .pricing-card {
        padding-top: 4.1rem;
        align-items: center;
        text-align: center;
    }
    
    .pricing-card:hover {
        transform: none;
        box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    }
    
    .pricing-card .plan-badge {
        top: -4px;
        min-width: 140px;
        transition: none;
        pointer-events: none;
    }
    
    .pricing-card:hover .plan-badge {
        transform: translateX(-50%);
    }
    
    .plan-header {
        padding-top: 1.8rem;
    }
    
    .plan-header h3 {
        margin-top: 0.65rem;
    }
}

@media (max-width: 640px) {
    .pricing-card:hover {
        transform: none;
        box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    }
    
    .pricing-card .plan-badge {
        transition: none;
        pointer-events: none;
    }
    
    .pricing-card:hover .plan-badge {
        transform: translateX(-50%);
    }
}

.plan-header {
    text-align: center;
    margin-bottom: 1.75rem;
    position: relative;
    z-index: 1;
}

.plan-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.plan-price .currency {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.plan-price .amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .plan-price .amount {
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.plan-price .period {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem 0;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.6rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.2s ease;
    position: relative;
    white-space: nowrap;
    min-width: 0;
}

.plan-features li > * {
    flex-shrink: 0;
}

.plan-features li > i {
    flex-shrink: 0;
}

.plan-features li > strong {
    flex-shrink: 0;
}

.plan-features li:hover {
    color: var(--text-primary);
}

.plan-features li i {
    color: var(--success-color);
    font-size: 0.9rem;
    width: 18px;
    flex-shrink: 0;
    margin-top: 0.15rem;
    transition: transform 0.2s ease;
}

.plan-features li:hover i {
    transform: scale(1.1);
}

[data-theme="dark"] .plan-features li i {
    color: #34d399;
}

.plan-features li strong {
    font-weight: 600;
    color: var(--text-primary);
}

.plan-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 1.75rem;
    line-height: 1.6;
    font-style: italic;
    padding: 0 0.5rem;
}

.plan-status {
    text-align: center;
    margin-bottom: 1.5rem;
}

.current-plan {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.current-plan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.current-plan:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.current-plan:hover::before {
    opacity: 1;
}

[data-theme="dark"] .current-plan {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .current-plan:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}

.plan-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.upgrade-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4), 0 3px 8px rgba(0, 0, 0, 0.15);
}

.upgrade-btn:hover::before {
    opacity: 1;
}

.upgrade-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.upgrade-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 6px 16px rgba(37, 99, 235, 0.4);
}

.upgrade-btn span,
.upgrade-btn {
    position: relative;
    z-index: 1;
}

/* Responsive pricing modal */
@media (max-width: 768px) {
    .pricing-modal {
        width: 96%;
        border-radius: 20px;
        max-height: 92vh;
        padding: clamp(1.5rem, 4vw, 2rem);
    }
    
    .pricing-modal .modal-content {
        padding: clamp(1.5rem, 4vw, 2rem);
    }
    
    .pricing-modal .modal-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }
    
    .pricing-modal .modal-header h2 {
        font-size: clamp(1.3rem, 3vw, 1.75rem);
    }
    
    .pricing-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .pricing-card {
        padding: 2rem 1.75rem;
        border-radius: 16px;
    }
    
    .pricing-card:hover {
        transform: translateY(-2px);
    }
    
    .plan-header h3 {
        font-size: 1.5rem;
    }
    
    .plan-price .amount {
        font-size: 2.75rem;
    }
    
    .plan-features li {
        font-size: clamp(0.75rem, 2vw, 0.9rem);
        padding: 0.55rem 0;
        white-space: nowrap;
        min-width: 0;
    }
    
    .plan-features li > * {
        flex-shrink: 0;
    }
    
    .plan-note {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .upgrade-btn {
        padding: 0.85rem 1.35rem;
        font-size: 0.95rem;
    }
    
    .upgrade-btn:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 640px) {
    .pricing-modal {
        width: 98%;
        border-radius: 16px;
        max-height: 95vh;
    }
    
    .pricing-modal .modal-content {
        padding: clamp(1.25rem, 4vw, 1.75rem);
    }
    
    .pricing-modal .modal-header {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }
    
    .pricing-modal .modal-header h2 {
        font-size: clamp(1.2rem, 3vw, 1.5rem);
    }
    
    .pricing-modal .modal-close {
        width: 2rem;
        height: 2rem;
        border-radius: 8px;
    }
    
    .pricing-container {
        gap: 1.25rem;
        margin-top: 1.5rem;
        padding-bottom: 1.25rem;
    }
    
    .pricing-modal-note {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .pricing-card {
        padding: 1.75rem 1.5rem;
        border-radius: 14px;
    }
    
    .pricing-card:hover {
        transform: none;
    }
    
    .plan-header {
        margin-bottom: 1.5rem;
    }
    
    .plan-header h3 {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .plan-price {
        gap: 0.25rem;
    }
    
    .plan-price .currency {
        font-size: 1.15rem;
    }
    
    .plan-price .amount {
        font-size: 2.5rem;
    }
    
    .plan-price .period {
        font-size: 0.95rem;
    }
    
    .plan-features ul {
        margin-bottom: 1.5rem;
    }
    
    .plan-features li {
        font-size: clamp(0.7rem, 1.8vw, 0.85rem);
        padding: 0.5rem 0;
        gap: 0.75rem;
        white-space: nowrap;
        min-width: 0;
    }
    
    .plan-features li > * {
        flex-shrink: 0;
    }
    
    .plan-features li i {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        width: 16px;
        flex-shrink: 0;
    }
    
    .plan-note {
        font-size: clamp(0.7rem, 1.6vw, 0.8rem);
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .current-plan {
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    
    .current-plan:hover {
        transform: none;
    }
    
    .upgrade-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .upgrade-btn:hover {
        transform: none;
    }
}

[data-theme="dark"] .pricing-modal {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pricing-modal::before {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .pricing-modal::after {
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.3), transparent);
}

[data-theme="dark"] .pricing-modal .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .pricing-card {
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .pricing-card::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(59, 130, 246, 0.03));
}

[data-theme="dark"] .pricing-card:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pricing-card.pro-plan {
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.25), 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pricing-card.pro-plan::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.05));
}

[data-theme="dark"] .pricing-card.pro-plan:hover {
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3), 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .plan-header h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .plan-price .currency {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .plan-price .period {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .plan-features li {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .plan-features li strong {
    color: #e2e8f0;
}

[data-theme="dark"] .plan-note {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .upgrade-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .upgrade-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .upgrade-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 3px 10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .upgrade-btn:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Pro Plan Card Styles */
.pro-plan-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    text-align: center;
    border: none;
    padding: 1.1rem 1.25rem;
}

.pro-plan-icon {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: #fbbf24;
}

.pro-plan-card h4 {
    color: white;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.pro-plan-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.pro-plan-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.6rem;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.2rem 0.45rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Dark theme adjustments for pro plan card */
[data-theme="dark"] .pro-plan-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

[data-theme="dark"] .feature-badge {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Chat Save Buttons */
.message-save-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message:hover .message-save-controls {
    opacity: 1;
}

.save-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.save-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.save-btn.saved {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    cursor: not-allowed;
}

.save-btn.saved:hover {
    transform: none;
}

.save-btn.has-data {
    background: rgba(37, 99, 235, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.save-btn.has-data:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.save-btn.has-data::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.message-save-controls.has-data {
    opacity: 1;
}

.saved-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--success-color);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Save Modals */
.save-modal {
    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: 1000;
    padding: 1rem;
}

.save-modal .modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.save-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.save-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: var(--transition);
}

.save-modal .modal-close:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.save-modal .modal-body {
    padding: 0 1.5rem;
}

.save-modal .modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

/* Correction Preview */
.correction-preview,
.vocabulary-preview,
.grammar-preview {
    margin-bottom: 1.5rem;
}

.correction-preview > div,
.vocabulary-preview > div,
.grammar-preview > div {
    margin-bottom: 1rem;
}

.correction-preview label,
.vocabulary-preview label,
.grammar-preview label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.text-content {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
    color: var(--text-primary);
    line-height: 1.5;
}


.favorite-modal-intro {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.favorite-correction-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.favorite-correction-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.favorite-correction-item input {
    margin-top: 0.2rem;
}

.favorite-correction-item span {
    flex: 1;
    line-height: 1.5;
    color: var(--text-primary);
}

.favorite-saved-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--success-color);
    font-size: 0.75rem;
    font-weight: 600;
}

.favorite-saved-tag i {
    font-size: 0.75rem;
}

.correction-save-modal .modal-content {
    max-width: 540px;
}
/* Save Options */
.save-options {
    margin-top: 1.5rem;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.option-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.option-group select,
.option-group input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.option-group input[type="text"]:focus,
.option-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Save Success Notification */
.save-success-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1001;
    animation: slideInUp 0.3s ease;
}

.save-success-notification .success-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.save-success-notification .success-text {
    font-weight: 500;
}

.save-success-notification .view-practice {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.save-success-notification .view-practice:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dark theme adjustments for save functionality */
[data-theme="dark"] .save-btn {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .save-btn:hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .save-btn.has-data {
    background: rgba(96, 165, 250, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .save-btn.has-data::after {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .text-content {
    background: var(--background-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .save-modal .modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .option-group select,
[data-theme="dark"] .option-group input[type="text"] {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Audio Controls */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--background-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.audio-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.75rem;
}

.audio-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.audio-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.audio-progress {
    flex: 1;
    height: 0.5rem;
    background: var(--border-color);
    border-radius: 0.25rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.audio-progress:hover {
    background: var(--text-muted);
}

.audio-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 0.25rem;
}

.audio-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 4rem;
    text-align: right;
}

/* Dark theme for audio controls */
[data-theme="dark"] .audio-controls {
    background: var(--background-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .audio-progress {
    background: var(--border-color);
}

/* Mobile responsiveness for save buttons */
@media (max-width: 768px) {
    .message-save-controls {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .save-btn {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
    
    .save-modal {
        padding: 0.5rem;
    }
    
    .save-modal .modal-content {
        max-height: 95vh;
    }
    
    .save-success-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .audio-controls {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .audio-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.6875rem;
    }
    
    .audio-time {
        font-size: 0.6875rem;
        min-width: 3rem;
    }
}

/* Microphone Button */
.microphone-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    margin-right: 0.5rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.microphone-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 50%;
}

.microphone-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.microphone-btn:hover::before {
    opacity: 1;
}

.microphone-btn:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.microphone-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(37, 99, 235, 0.4);
}

.microphone-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.microphone-btn:hover i {
    transform: scale(1.1);
}

.microphone-btn.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.4);
}

.microphone-btn.recording::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    opacity: 1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0.2), 0 4px 12px rgba(239, 68, 68, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.4);
    }
}

/* Dark theme for microphone */
[data-theme="dark"] .microphone-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .microphone-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .microphone-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .microphone-btn:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 4px 16px rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .microphone-btn.recording {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 0 0 8px rgba(248, 113, 113, 0.2), 0 4px 16px rgba(239, 68, 68, 0.5);
}

/* Responsive chat input */
@media (max-width: 768px) {
    .chat-input-container {
        padding: 0.9rem 1rem 1.25rem;
        border-radius: 10px;
    }
    
    .input-group {
        padding: 0.65rem;
        border-radius: 10px;
        gap: 0.65rem;
    }
    
    .microphone-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .chat-input-container {
        padding: 0.75rem 0.9rem 1rem;
        border-radius: 8px;
    }
    
    .input-group {
        padding: 0.6rem;
        border-radius: 8px;
        gap: 0.6rem;
    }
    
    .microphone-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
        margin-right: 0.4rem;
    }
    
    .btn-primary {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .microphone-btn:hover,
    .btn-primary:hover {
        transform: none;
    }
}

/* Saved Corrections Practice */
.saved-practice {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    position: relative;
    overflow: visible;
}

.saved-practice-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.32);
}

.saved-practice-header h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 650;
    color: #0f172a;
}

.saved-practice-header .subtitle {
    margin: 0;
    color: #475569;
    max-width: 640px;
}

.saved-practice-header .back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.saved-practice-content {
    padding: 0;
    display: flex;
    gap: 1.5rem;
    margin-top: 1.25rem;
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible;
}

.saved-practice-tabs {
    display: inline-flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    padding: 0.25rem;
    flex-wrap: wrap;
}

.saved-tab {
    border: none;
    background: transparent;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.saved-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

.saved-items-list {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1.1rem;
    border: 1px solid rgba(226, 232, 240, 0.45);
    padding: 1rem 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 0 0 32%;
    max-height: none;
    overflow-y: visible;
    height: auto;
    min-height: auto;
}

.saved-empty-hint {
    padding: 1.5rem;
    text-align: center;
    color: #475569;
    font-size: 0.95rem;
}

[data-theme="dark"] .saved-empty-hint {
    color: rgba(226, 232, 240, 0.85);
}

.saved-item-card {
    position: relative;
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.15rem;
    padding: 1rem;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saved-item-card:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.saved-item-card.active {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 26px 52px rgba(37, 99, 235, 0.18);
}

.saved-item-card .card-badge {
    color: var(--primary-color);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.saved-item-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saved-item-card .item-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #0f172a;
}

.saved-item-card .card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.saved-practice-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.94) 0%, rgba(242, 246, 252, 0.92) 48%, rgba(233, 238, 247, 0.88) 100%);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 1.5rem;
    box-shadow: 0 28px 58px rgba(15, 23, 42, 0.14);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    max-height: none;
    overflow: visible;
    min-height: auto;
    height: auto;
}

.practice-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    color: #475569;
    padding: 2rem 1.5rem;
    background: rgba(226, 232, 240, 0.32);
    border-radius: 1.15rem;
}

.practice-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
}

.saved-meta-line {
    margin: 0.1rem 0;
    color: #475569;
    font-size: 0.9rem;
}

.saved-vocab-flashcard {
    border: 1px dashed rgba(37, 99, 235, 0.35);
    background: rgba(226, 232, 240, 0.35);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
}

.saved-vocab-activity-nav,
.saved-correction-activity-nav,
.saved-question-activity-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
}

.vocab-activity-chip,
.correction-activity-chip {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f8fafc;
    color: #0f172a;
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.vocab-activity-chip i,
.correction-activity-chip i {
    font-size: 0.85rem;
}

.vocab-activity-chip.active,
.correction-activity-chip.active {
    background: #2563eb;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.25);
}

.saved-vocab-activity-panels,
.saved-correction-activity-panels,
.saved-question-activity-panels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    scrollbar-width: none;
    min-height: auto;
}

.saved-vocab-activity-panel,
.saved-correction-activity-panel,
.saved-question-activity-panel {
    display: none;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    overflow: visible;
    min-height: auto;
}

.saved-vocab-activity-panel.active,
.saved-correction-activity-panel.active,
.saved-question-activity-panel.active {
    display: flex;
}

.activity-callout {
    border-left: 4px solid #2563eb;
    background: rgba(37, 99, 235, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.flashcard-header h4 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
}

.flashcard-header p {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: #475569;
}

.flashcard-mode {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    background: #dbeafe;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

.flashcard-prompt {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.flashcard-input {
    width: 100%;
}

.flashcard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.flashcard-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flashcard-feedback {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
    min-height: 1rem;
}

.flashcard-feedback.success {
    color: #059669;
}

.flashcard-feedback.error {
    color: #dc2626;
}

.flashcard-feedback.info {
    color: #0f172a;
}

.contrast-split {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contrast-split > div {
    flex: 1 1 200px;
}

.context-hint {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
}

.context-option-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.context-option-list label {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.context-option-list input[type="checkbox"] {
    margin-top: 0.2rem;
}

.saved-correction-context,
.saved-vocab-context-summary,
.knowledge-context-summary,
.deep-dive-context {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.2);
}

.saved-correction-context h5,
.saved-vocab-context-summary h5,
.knowledge-context-summary h5,
.deep-dive-context h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.saved-correction-context p,
.saved-vocab-context-summary p,
.knowledge-context-summary p,
.deep-dive-context p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #64748b;
    font-style: italic;
}

[data-theme="dark"] .saved-correction-context,
[data-theme="dark"] .saved-vocab-context-summary,
[data-theme="dark"] .knowledge-context-summary,
[data-theme="dark"] .deep-dive-context {
    border-top-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .saved-correction-context h5,
[data-theme="dark"] .saved-vocab-context-summary h5,
[data-theme="dark"] .knowledge-context-summary h5,
[data-theme="dark"] .deep-dive-context h5 {
    color: rgba(203, 213, 225, 0.85);
}

[data-theme="dark"] .saved-correction-context p,
[data-theme="dark"] .saved-vocab-context-summary p,
[data-theme="dark"] .knowledge-context-summary p,
[data-theme="dark"] .deep-dive-context p {
    color: rgba(148, 163, 184, 0.8);
}

.saved-question-context {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.2);
}

.saved-question-context h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.saved-question-context p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #64748b;
    font-style: italic;
}

.saved-question-original {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.2);
}

.saved-vocab-content .sc-body,
.saved-question-content .sc-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: visible;
    min-height: auto;
}

.sc-footer-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.saved-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    max-height: none;
    height: auto;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 247, 252, 0.94) 50%, rgba(235, 239, 246, 0.9) 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.35rem;
    box-shadow: 0 28px 65px rgba(15, 23, 42, 0.16);
    overflow: visible;
    backdrop-filter: blur(18px);
    scroll-behavior: smooth;
    scrollbar-width: none;
    min-height: auto;
}

.saved-panel::-webkit-scrollbar,
.sc-content::-webkit-scrollbar,
.sc-body::-webkit-scrollbar,
.saved-vocab-activity-panels::-webkit-scrollbar,
.saved-correction-activity-panels::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.saved-panel::-webkit-scrollbar-track,
.sc-content::-webkit-scrollbar-track,
.sc-body::-webkit-scrollbar-track,
.saved-vocab-activity-panels::-webkit-scrollbar-track,
.saved-correction-activity-panels::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 999px;
}

.saved-panel::-webkit-scrollbar-thumb,
.sc-content::-webkit-scrollbar-thumb,
.sc-body::-webkit-scrollbar-thumb,
.saved-vocab-activity-panels::-webkit-scrollbar-thumb,
.saved-correction-activity-panels::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.45);
    border-radius: 999px;
}

.saved-panel::-webkit-scrollbar-thumb:hover,
.sc-content::-webkit-scrollbar-thumb:hover,
.sc-body::-webkit-scrollbar-thumb:hover,
.saved-vocab-activity-panels::-webkit-scrollbar-thumb:hover,
.saved-correction-activity-panels::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.7);
}

.sc-header {
    padding: 18px 22px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.55) 0%, rgba(248, 250, 252, 0.65) 100%);
    backdrop-filter: blur(16px);
}

.sc-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.sc-header-top h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.sc-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #64748b;
}

.sc-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 18px 22px 26px;
    gap: 16px;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    scrollbar-width: none;
    min-height: auto;
}

.sc-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: visible;
    overflow-x: hidden;
    padding-right: 0;
    max-height: none;
    scrollbar-width: none;
}

.saved-vocab-activity-panels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    scrollbar-width: none;
    min-height: auto;
}

.sc-reminder {
    background: linear-gradient(140deg, rgba(59, 130, 246, 0.12) 0%, rgba(129, 140, 248, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 1rem;
    padding: 16px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.sc-reminder h4 {
    margin: 0 0 6px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
}

.sc-reminder p {
    margin: 0;
    color: #0f172a;
    line-height: 1.55;
}

.sc-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    max-height: 100%;
}

.sc-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-msg-user,
.sc-msg-tutor {
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.45;
    font-size: 0.95rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.sc-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
}

.sc-msg-tutor {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #0f172a;
}

.sc-input-label {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.sc-input {
    width: 100%;
    min-height: 110px;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.95rem 1rem;
    font-size: 0.95rem;
    resize: vertical;
}

.sc-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.sc-footer {
    position: relative;
    bottom: auto;
    padding: 14px 22px 18px;
    background: #ffffff;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.sc-footer .btn {
    min-width: 140px;
}

.sc-feedback {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 1.1rem;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.sc-feedback h4 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1d4ed8;
}

.sc-feedback p {
    margin: 0;
    line-height: 1.5;
}

.practice-session {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    overflow: hidden;
}

.practice-session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    position: sticky;
    top: 0;
    background: inherit;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.05);
    z-index: 1;
}

.practice-session-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    padding: 1rem 0.75rem 1rem 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(255, 255, 255, 0.75);
    overscroll-behavior: contain;
}

.practice-session-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.practice-session-header .practice-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #64748b;
}

.practice-reference {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 1.1rem;
    padding: 1.1rem;
}

.practice-reference h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.practice-reference p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-primary);
}

.practice-input {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding-top: 1.2rem;
}

.practice-input label {
    font-weight: 600;
    color: var(--text-primary);
}

.practice-input textarea {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.85rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.practice-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.practice-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.practice-feedback {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 1.1rem;
    padding: 1.1rem;
}

.practice-feedback h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--success-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.practice-feedback .feedback-content {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-primary);
}

.saved-practice-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

.saved-practice-empty i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.loading-state,
.error-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
}

.error-state {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

@media (max-width: 1024px) {
    .saved-practice-content {
        flex-direction: column;
        height: auto;
        max-height: none;
        overflow: visible;
        min-height: auto;
    }

    .saved-items-list {
        width: 100%;
        max-width: none;
        max-height: none;
        padding: 0.85rem 0.75rem;
        overflow-y: visible;
        height: auto;
    }

    .saved-practice-panel {
        height: auto;
        max-height: none;
        overflow-y: visible;
        min-height: auto;
    }
    
    .saved-panel {
        max-height: none;
        height: auto;
        overflow-y: visible;
        min-height: auto;
    }
    
    .sc-content {
        max-height: none;
        overflow-y: visible;
        min-height: auto;
    }

    .practice-session-body {
        padding: 0.75rem;
        max-height: none;
    }

    .practice-session-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .practice-session-header .practice-meta {
        align-items: flex-start;
    }
    
    .saved-vocab-activity-panels {
        max-height: none;
        overflow-y: visible;
        min-height: auto;
    }
    
    .saved-vocab-activity-panel {
        overflow: visible;
        min-height: auto;
    }
}

/* Deep Dive Practice */
.deep-dive {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    position: relative;
    overflow: visible;
}

.deep-dive-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.32);
}

.deep-dive-header h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 650;
    color: #0f172a;
}

.deep-dive-header .subtitle {
    margin: 0;
    color: #475569;
    max-width: 640px;
}

.deep-dive-header .back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.deep-dive-tabs {
    display: inline-flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    padding: 0.25rem;
    flex-wrap: wrap;
}

.deep-dive-content {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.deep-dive-list {
    width: 36%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.35rem;
}

.deep-dive-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.15rem;
    padding: 1rem;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.deep-dive-item:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.deep-dive-item.active {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 26px 52px rgba(37, 99, 235, 0.18);
}

.deep-dive-item h4 {
    margin: 0;
    font-size: 0.98rem;
    color: #0f172a;
}

.deep-dive-item p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
}

.deep-dive-item-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(37, 99, 235, 0.1);
    color: rgba(37, 99, 235, 0.9);
    align-self: flex-start;
    margin-bottom: 0.25rem;
}

.deep-dive-item[data-type="vocabulary"] .deep-dive-item-badge {
    background: rgba(16, 185, 129, 0.1);
    color: rgba(16, 185, 129, 0.9);
}

.deep-dive-item[data-type="question"] .deep-dive-item-badge {
    background: rgba(168, 85, 247, 0.1);
    color: rgba(168, 85, 247, 0.9);
}

.deep-dive-panel {
    flex: 1;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 248, 255, 0.93) 55%, rgba(235, 239, 246, 0.9) 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.35rem;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: visible;
    backdrop-filter: blur(18px);
}

.dd-right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-radius: 1.35rem;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.96) 55%, rgba(235, 240, 248, 0.94) 100%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 28px 58px rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.dd-focus-card {
    flex-shrink: 0;
}

.dd-chat-scroll {
    padding: 0 1.5rem;
}

.dd-fixed-input {
    flex-shrink: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    padding-bottom: 0.25rem;
}

.dd-input-inner {
    padding: 1rem 1.5rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.dd-input-label {
    font-size: 0.9rem;
    color: #0f172a;
}

.dd-question-input {
    width: 100%;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.97);
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    height: 120px;
    max-height: 160px;
    overflow-y: auto;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dd-question-input::placeholder {
    color: rgba(100, 116, 139, 0.8);
}

.dd-question-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dd-input-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 1024px) {
    .dd-right-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .dd-right-panel {
        min-height: 520px;
    }
}

.deep-dive-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    color: #475569;
    padding: 2rem 1.5rem;
    background: rgba(226, 232, 240, 0.32);
    border-radius: 1.15rem;
}

.deep-dive-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
}

.deep-dive-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: static;
    background: transparent;
}

.deep-dive-summary h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #0f172a;
}

.deep-dive-summary p {
    margin: 0;
    line-height: 1.5;
    color: #1f2937;
}

.deep-dive-meta {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
}

.deep-dive-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 0 2rem;
    margin: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    overscroll-behavior: contain;
}

.deep-dive-bubble {
    max-width: 85%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    line-height: 1.5;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
}

.deep-dive-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #f8fafc;
}

.deep-dive-bubble.tutor {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.16);
    color: #0f172a;
}

.deep-dive-bubble .timestamp {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(15, 23, 42, 0.6);
}

.deep-dive-input {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding-top: 1.25rem;
}

.deep-dive-input label {
    font-weight: 600;
    color: var(--text-primary);
}

.deep-dive-input textarea {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.85rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.deep-dive-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.deep-dive-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.deep-dive-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 1.25rem;
    background: rgba(226, 232, 240, 0.4);
    color: #475569;
}

.deep-dive-empty i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

@media (max-width: 1024px) {
    .deep-dive-content {
        flex-direction: column;
    }

    .deep-dive-list {
        width: 100%;
        max-width: none;
        max-height: 240px;
    }

    .deep-dive-panel {
        min-height: auto;
    }

    .deep-dive-summary {
        flex-direction: column;
    }
}

.deep-dive-history .hint {
    align-self: center;
    color: #64748b;
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
}

.deep-dive-bubble.user .timestamp,
.deep-dive-bubble.tutor .timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.deep-dive-bubble.tutor .timestamp {
    color: rgba(15, 23, 42, 0.5);
}

.deep-dive-actions .shake {
    animation: shake 0.3s linear;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}

/* Knowledge Base */
.knowledge-base {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    position: relative;
    overflow: visible;
}

.knowledge-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.knowledge-header .header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.knowledge-header h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 650;
    color: #0f172a;
}

.knowledge-header .subtitle {
    margin: 0;
    color: #475569;
    max-width: 720px;
}

.knowledge-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.knowledge-search {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem 0.6rem 0.95rem;
    border-radius: 0.95rem;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.search-input-group i {
    color: #64748b;
    font-size: 0.95rem;
}

.search-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
}

.search-input-group input::placeholder {
    color: #94a3b8;
}

.search-input-group:focus-within {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.18);
    background: rgba(255, 255, 255, 0.98);
}

#knowledgeSearchClear {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(59, 130, 246, 0.14);
    color: var(--primary-dark);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#knowledgeSearchClear:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

#knowledgeSearchClear i {
    margin: 0;
    font-size: 0.9rem;
}

.knowledge-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.knowledge-filters .filter-chip {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.35rem 0.75rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.knowledge-filters .filter-chip input:checked + span {
    color: #0f172a;
    font-weight: 600;
}

.knowledge-filters .filter-chip input:checked + span .count {
    background: rgba(59, 130, 246, 0.16);
}

.knowledge-filters .filter-chip:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.filter-chip span .count,
.filter-chip span em.count {
    font-style: normal;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-dark);
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.filter-chip input:checked + span .count {
    background: var(--primary-color);
    color: var(--text-primary);
}

.knowledge-content {
    display: flex;
    gap: 1.5rem;
}

.knowledge-list {
    width: 38%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.35rem;
}

.knowledge-list .hint {
    padding: 1rem;
    text-align: center;
    color: #475569;
    background: rgba(255, 255, 255, 0.8);
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: 1rem;
}

[data-theme="dark"] .knowledge-list .hint {
    color: rgba(226, 232, 240, 0.75);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(59, 130, 246, 0.25);
}

.knowledge-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.15rem;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.knowledge-item:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.knowledge-item.active {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 26px 52px rgba(37, 99, 235, 0.18);
}

.knowledge-item h4 {
    margin: 0;
    font-size: 0.98rem;
    color: #0f172a;
}

.knowledge-item p {
    margin: 0;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
}

.knowledge-item .meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.knowledge-detail {
    flex: 1;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.35rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.knowledge-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    color: #475569;
    padding: 2rem 1.5rem;
    background: rgba(226, 232, 240, 0.32);
    border-radius: 1.15rem;
}

.knowledge-placeholder i {
    font-size: 2.1rem;
    color: var(--primary-color);
}

.knowledge-entry {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

.knowledge-entry .knowledge-vocab-word {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.knowledge-entry .knowledge-vocab-translation {
    margin-top: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.knowledge-entry .knowledge-vocab-context {
    margin: 0.75rem 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

.knowledge-entry .knowledge-vocab-context-explained {
    margin: 0.5rem 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-word {
    color: rgba(226, 232, 240, 0.96);
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-translation {
    color: rgba(147, 197, 253, 0.95);
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-context {
    color: rgba(203, 213, 225, 0.78);
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-context-explained {
    color: rgba(226, 232, 240, 0.85);
}

.knowledge-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    background: inherit;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.05);
    z-index: 1;
}

.knowledge-entry-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
}

.knowledge-entry p {
    margin: 0;
    line-height: 1.6;
    color: #1f2937;
}

.knowledge-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

.knowledge-entry-meta span {
    background: rgba(148, 163, 184, 0.2);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}

.knowledge-entry-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    padding-top: 0.75rem;
    background: inherit;
    margin-top: auto;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 -12px 20px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .knowledge-base .filter-chip {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
    border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .knowledge-base .filter-chip input:checked + span {
    color: var(--text-primary);
    font-weight: 600;
}

[data-theme="dark"] .knowledge-base .filter-chip input:checked + span .count {
    background: rgba(96, 165, 250, 0.25);
    color: var(--text-primary);
}

[data-theme="dark"] .knowledge-base {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .saved-practice-panel {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.9) 0%, rgba(18, 28, 46, 0.92) 55%, rgba(24, 36, 58, 0.94) 100%);
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 30px 68px rgba(2, 6, 23, 0.65);
}

[data-theme="dark"] .saved-panel {
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.92) 0%, rgba(18, 28, 48, 0.94) 50%, rgba(22, 34, 56, 0.95) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 30px 70px rgba(2, 6, 23, 0.65);
}

[data-theme="dark"] .saved-tab {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .saved-tab.active {
    background: rgba(30, 41, 59, 0.9);
    color: rgba(248, 250, 252, 0.96);
}

[data-theme="dark"] .saved-tag {
    background: rgba(59, 130, 246, 0.2);
    color: rgba(191, 219, 254, 0.95);
}

[data-theme="dark"] .saved-focus-toggle {
    background: rgba(71, 85, 105, 0.4);
}

[data-theme="dark"] .saved-focus-btn {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .saved-focus-btn.active {
    background: rgba(30, 41, 59, 0.92);
    color: rgba(248, 250, 252, 0.96);
}

[data-theme="dark"] .saved-focus-hint {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .saved-meta-line {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .sc-feedback {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(59, 130, 246, 0.3);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .sc-feedback h4 {
    color: rgba(147, 197, 253, 0.95);
}

[data-theme="dark"] .saved-tab {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .saved-tab.active {
    background: rgba(30, 41, 59, 0.9);
    color: rgba(248, 250, 252, 0.96);
}

[data-theme="dark"] .saved-meta-line {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .sc-header {
    background: linear-gradient(140deg, rgba(30, 41, 59, 0.78) 0%, rgba(28, 37, 59, 0.82) 100%);
    border-bottom-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .sc-header-top h3 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .sc-header-meta {
    color: rgba(148, 163, 184, 0.75);
}

[data-theme="dark"] .sc-reminder {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.22) 0%, rgba(14, 165, 233, 0.18) 100%);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .sc-reminder h4,
[data-theme="dark"] .sc-reminder p {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .saved-question-context {
    border-top-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .saved-question-context h5 {
    color: rgba(203, 213, 225, 0.85);
}

[data-theme="dark"] .saved-question-context p {
    color: rgba(148, 163, 184, 0.8);
}

[data-theme="dark"] .saved-question-original {
    border-top-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .knowledge-detail {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.82) 0%, rgba(17, 24, 39, 0.94) 65%, rgba(24, 33, 52, 0.96) 100%);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 26px 60px rgba(2, 6, 23, 0.6);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry-meta span {
    background: rgba(59, 130, 246, 0.28);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry-actions {
    border-top-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 -14px 26px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry-header {
    border-bottom-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 14px 26px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry p {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry h3 {
    color: rgba(226, 232, 240, 0.96);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(96, 165, 250, 0.18);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-base::before,
[data-theme="dark"] .knowledge-base::after {
    content: none;
}

[data-theme="dark"] .knowledge-search {
    background: rgba(17, 24, 39, 0.85);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
}

[data-theme="dark"] .search-input-group {
    background: rgba(17, 24, 39, 0.92);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .search-input-group i {
    color: rgba(148, 163, 184, 0.75);
}

[data-theme="dark"] .search-input-group input {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .search-input-group input::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

[data-theme="dark"] .search-input-group:focus-within {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.65);
    background: rgba(17, 24, 39, 0.97);
}

[data-theme="dark"] #knowledgeSearchClear {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(37, 99, 235, 0.28);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] #knowledgeSearchClear:hover {
    background: rgba(37, 99, 235, 0.38);
    border-color: rgba(96, 165, 250, 0.55);
}

[data-theme="dark"] .knowledge-entry {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-placeholder {
    background: rgba(30, 41, 59, 0.55);
    color: rgba(226, 232, 240, 0.85);
}

[data-theme="dark"] .knowledge-entry-meta span {
    background: rgba(96, 165, 250, 0.2);
    color: var(--text-primary);
}

[data-theme="dark"] .knowledge-item {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-item h4 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .knowledge-item p {
    color: rgba(203, 213, 225, 0.8);
}

[data-theme="dark"] .knowledge-item .meta {
    color: rgba(148, 163, 184, 0.85);
}

[data-theme="dark"] .knowledge-entry-header,
[data-theme="dark"] .knowledge-entry-actions {
    background: rgba(17, 24, 39, 0.92);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: none;
}

[data-theme="dark"] .knowledge-entry-header {
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-entry-actions {
    box-shadow: 0 -12px 24px rgba(2, 6, 23, 0.5);
}

[data-theme="dark"] .knowledge-entry-header h3 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .knowledge-entry p {
    color: rgba(226, 232, 240, 0.88);
}

[data-theme="dark"] .deep-dive {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .deep-dive::before,
[data-theme="dark"] .deep-dive::after {
    content: none;
}

[data-theme="dark"] .deep-dive-header h2 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .deep-dive-header .subtitle {
    color: rgba(203, 213, 225, 0.75);
}

[data-theme="dark"] .deep-dive-list .hint {
    background: rgba(30, 41, 59, 0.6);
    color: rgba(226, 232, 240, 0.78);
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .deep-dive-item {
    background: rgba(15, 23, 42, 0.68);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .deep-dive-item h4 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .deep-dive-item p {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .deep-dive-item .meta {
    color: rgba(148, 163, 184, 0.85);
}

[data-theme="dark"] .deep-dive-item-badge {
    background: rgba(59, 130, 246, 0.2);
    color: rgba(147, 197, 253, 0.95);
}

[data-theme="dark"] .deep-dive-item[data-type="vocabulary"] .deep-dive-item-badge {
    background: rgba(16, 185, 129, 0.2);
    color: rgba(110, 231, 183, 0.95);
}

[data-theme="dark"] .deep-dive-item[data-type="question"] .deep-dive-item-badge {
    background: rgba(168, 85, 247, 0.2);
    color: rgba(196, 181, 253, 0.95);
}

[data-theme="dark"] .deep-dive-panel {
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.9) 0%, rgba(18, 28, 48, 0.92) 55%, rgba(23, 36, 58, 0.95) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 32px 70px rgba(2, 6, 23, 0.65);
}

[data-theme="dark"] .deep-dive-placeholder {
    background: rgba(30, 41, 59, 0.55);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .deep-dive-summary h3 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .deep-dive-summary p,
[data-theme="dark"] .deep-dive-meta {
    color: rgba(203, 213, 225, 0.78);
}

[data-theme="dark"] .deep-dive-summary {
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.3);
}

[data-theme="dark"] .deep-dive-history {
    background: transparent;
    border-color: transparent;
}

[data-theme="dark"] .deep-dive-bubble.user {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.92) 100%);
    color: rgba(248, 250, 252, 0.95);
}

[data-theme="dark"] .deep-dive-bubble.tutor {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(59, 130, 246, 0.35);
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .deep-dive-bubble .timestamp {
    color: rgba(148, 163, 184, 0.8);
}

[data-theme="dark"] .deep-dive-input textarea {
    background: rgba(17, 24, 39, 0.78);
    border-color: rgba(59, 130, 246, 0.32);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .deep-dive-input textarea:focus {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .deep-dive-input {
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .deep-dive-empty {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(59, 130, 246, 0.25);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .saved-practice {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .saved-practice::before,
[data-theme="dark"] .saved-practice::after {
    content: none;
}

[data-theme="dark"] .dd-right-panel {
    background: linear-gradient(160deg, rgba(13, 20, 34, 0.96) 0%, rgba(15, 24, 40, 0.94) 55%, rgba(17, 28, 46, 0.92) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 32px 70px rgba(2, 6, 23, 0.7);
}

[data-theme="dark"] .dd-fixed-input {
    background: rgba(15, 22, 36, 0.92);
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .dd-input-label {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .dd-question-input {
    background: rgba(17, 24, 39, 0.78);
    border-color: rgba(59, 130, 246, 0.28);
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .dd-question-input::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

[data-theme="dark"] .dd-question-input:focus {
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .saved-practice::before {
    background: radial-gradient(circle at 30% 35%, rgba(59, 130, 246, 0.2), transparent 60%);
}

[data-theme="dark"] .saved-practice::after {
    background: radial-gradient(circle at 75% 65%, rgba(14, 165, 233, 0.2), transparent 62%);
}

[data-theme="dark"] .saved-practice-header h2 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .saved-practice-header .subtitle {
    color: rgba(203, 213, 225, 0.75);
}

[data-theme="dark"] .saved-items-list {
    border-color: rgba(59, 130, 246, 0.22);
    background: rgba(17, 24, 39, 0.68);
}

[data-theme="dark"] .saved-item-card {
    background: rgba(17, 24, 39, 0.7);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .saved-item-card .item-text {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .saved-item-card .card-meta {
    color: rgba(148, 163, 184, 0.85);
}

[data-theme="dark"] .saved-practice-panel {
    background: rgba(17, 24, 39, 0.82);
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.6);
}

[data-theme="dark"] .practice-placeholder {
    background: rgba(30, 41, 59, 0.55);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .practice-session-header h3 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .practice-session-header .practice-meta {
    color: rgba(203, 213, 225, 0.78);
}

[data-theme="dark"] .practice-reference {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.32);
}

[data-theme="dark"] .practice-reference p {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .practice-input label,
[data-theme="dark"] .practice-input textarea,
[data-theme="dark"] .practice-feedback .feedback-content {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .practice-input textarea {
    background: rgba(17, 24, 39, 0.78);
    border-color: rgba(96, 165, 250, 0.32);
}

[data-theme="dark"] .practice-input textarea:focus {
    border-color: rgba(125, 211, 252, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .practice-feedback {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .practice-actions {
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .practice-session-body {
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .saved-practice-empty {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(59, 130, 246, 0.25);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .practice-session-header {
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.48);
    border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .practice-session-body {
    background: rgba(17, 24, 39, 0.68);
    border-radius: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1rem 0.75rem 1rem 1rem;
}

[data-theme="dark"] .practice-input {
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .knowledge-item:hover,
[data-theme="dark"] .knowledge-item.active {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.45);
}

[data-theme="dark"] .knowledge-entry-actions .btn,
[data-theme="dark"] .knowledge-entry-actions .btn-outline {
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-primary);
}

.knowledge-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 1.25rem;
    background: rgba(226, 232, 240, 0.4);
    color: #475569;
}

.knowledge-empty i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.modal-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.75rem 0 0;
}

@media (max-width: 1024px) {
    .knowledge-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .knowledge-actions {
        justify-content: flex-start;
    }

    .knowledge-content {
        flex-direction: column;
    }

    .knowledge-list {
        width: 100%;
        max-width: none;
        padding-right: 0;
    }

    .knowledge-detail {
        min-height: 0;
    }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    justify-content: space-between;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
    padding: 0.2rem clamp(0.75rem, 5vw, 1.5rem) calc(0.2rem + env(safe-area-inset-bottom, 0px)) clamp(0.75rem, 5vw, 1.5rem);
    min-height: var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px)));
    z-index: 1400;
}

.bottom-nav-item {
    flex: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.3rem 0.2rem;
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.bottom-nav-item i {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

.bottom-nav-item span {
    line-height: 1.1;
}

.bottom-nav-item:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
}

.bottom-nav-item:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.bottom-nav-item.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
}

.bottom-nav-item.active i {
    transform: scale(1.05);
}

[data-theme="dark"] .mobile-bottom-nav {
    background: var(--surface-color);
    border-top-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .bottom-nav-item {
    color: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .bottom-nav-item:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .bottom-nav-item.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.18);
    box-shadow: 0 8px 16px rgba(96, 165, 250, 0.2);
}

@media (max-width: 1024px) {
    .mobile-bottom-nav {
        display: flex;
    }

    .content-area.chat-mode {
        padding-bottom: calc(var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + 5.5rem);
    }

    .chat-input-container {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: min(640px, calc(100% - 2.25rem));
        max-width: calc(100% - 1.5rem);
        bottom: calc(var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + var(--mobile-nav-gap, 0rem));
        margin-bottom: 0;
        z-index: 1500;
    }

    .chat-messages {
        padding-bottom: calc(7rem + var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + 0.5rem);
    }
}

@media (max-width: 640px) {
    .chat-input-container {
        width: calc(100% - 1.5rem);
        max-width: calc(100% - 1.5rem);
        bottom: calc(var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + var(--mobile-nav-gap, 0rem));
    }

    .chat-messages {
        padding-bottom: calc(6.5rem + var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + 0.5rem);
    }
}

@media (max-width: 480px) {
    .bottom-nav-item {
        font-size: 0.65rem;
        padding: 0.25rem 0.15rem;
        gap: 0.1rem;
    }

    .bottom-nav-item i {
        font-size: 0.95rem;
    }
}

/* Temporary visibility controls for in-progress pages */
.nav-menu a[href="/community"],
.nav-menu a[href="/help-center"],
.nav-menu a[href="/cookie-policy"] {
    display: none !important;
}

footer .footer-section ul li:has(> a[href="/community"]),
footer .footer-section ul li:has(> a[href="/help-center"]),
footer .footer-section ul li:has(> a[href="/cookie-policy"]) {
    display: none !important;
}
[data-theme="dark"] .deep-dive-history .hint {
    color: rgba(203, 213, 225, 0.78);
}
/* Topic picker */
.chat-topic-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.chat-topic-bar .topic-bar-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
}

.topic-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topic-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.topic-bar-name {
    font-weight: 600;
    color: var(--text-primary);
}

.topic-bar-tag {
    font-size: 0.8rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.12));
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.topic-bar-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.08));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.topic-bar-tag:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.topic-bar-tag:hover::before {
    opacity: 1;
}

[data-theme="dark"] .topic-bar-tag {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(59, 130, 246, 0.15));
    border-color: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .topic-bar-tag::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.1));
}

[data-theme="dark"] .topic-bar-tag:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(59, 130, 246, 0.2));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-outline:hover::before {
    opacity: 0;
}

.btn-outline:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.btn-outline:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.btn-outline:hover i {
    transform: scale(1.1);
}

.btn-outline span,
.btn-outline {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .btn-outline {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .btn-outline::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .btn-outline:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(96, 165, 250, 0.5);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-outline:focus-visible {
    outline-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25), 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-outline:disabled,
.btn-outline.disabled,
.btn-outline.rename-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
    background: var(--surface-color);
    color: var(--text-tertiary);
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.btn-outline:disabled:hover,
.btn-outline.disabled:hover,
.btn-outline.rename-disabled:hover {
    background: var(--surface-color);
    color: var(--text-tertiary);
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.btn-outline:disabled::before,
.btn-outline.disabled::before,
.btn-outline.rename-disabled::before {
    opacity: 0;
}

.btn-outline:disabled i,
.btn-outline.disabled i,
.btn-outline.rename-disabled i {
    transform: none;
    opacity: 0.5;
}

[data-theme="dark"] .btn-outline:disabled,
[data-theme="dark"] .btn-outline.disabled,
[data-theme="dark"] .btn-outline.rename-disabled {
    background: rgba(30, 41, 59, 0.4);
    color: rgba(226, 232, 240, 0.4);
    border-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .btn-outline:disabled:hover,
[data-theme="dark"] .btn-outline.disabled:hover,
[data-theme="dark"] .btn-outline.rename-disabled:hover {
    background: rgba(30, 41, 59, 0.4);
    color: rgba(226, 232, 240, 0.4);
    border-color: rgba(148, 163, 184, 0.1);
}

.btn-compact {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 12px;
}

/* Responsive topic bar elements */
@media (max-width: 768px) {
    .chat-topic-bar {
        padding: 0.85rem 1rem;
        border-radius: 10px;
    }
    
    .topic-bar-tag {
        padding: 0.25rem 0.7rem;
        font-size: 0.75rem;
        border-radius: 10px;
    }
    
    .btn-compact {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
    gap: 0.35rem;
        border-radius: 10px;
    }
}

@media (max-width: 640px) {
    .chat-topic-bar {
        padding: 0.75rem 0.9rem;
        border-radius: 8px;
    }
    
    .topic-bar-tag {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 8px;
    }
    
    .btn-compact {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        gap: 0.3rem;
        border-radius: 8px;
    }
    
    .btn-outline:hover {
        transform: none;
    }
    
    .topic-bar-tag:hover {
        transform: none;
    }
}

.topic-picker-modal .topic-picker-content {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-name-modal input {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-color);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-name-modal input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.chat-name-modal label {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-helper {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.modal-error {
    font-size: 0.85rem;
    color: var(--danger-color);
    margin-top: 0.35rem;
    min-height: 1rem;
}

.topic-picker-header p.modal-eyebrow {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.topic-filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}

.topic-filter-btn {
    border: 1px solid #cbd5f5;
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topic-filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.topic-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.topic-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.topic-card:hover {
    border-color: #cbd5f5;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.topic-card.active {
    border-color: #2563eb;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.2);
}

.topic-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.topic-levels {
    font-size: 0.75rem;
    color: #64748b;
}

.topic-card h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.topic-card p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.topic-chip {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

.topic-focus-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.topic-focus-words span {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.8rem;
    color: #0f172a;
}

.topic-prompts {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.85rem;
    color: #475569;
}

.topic-prompts strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.topic-prompts ul {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.topic-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.topic-selection-summary {
    font-size: 0.9rem;
    color: #475569;
}

.topic-selection-summary strong {
    color: #0f172a;
}

.topic-footer-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topic-empty {
    background: #f8fafc;
    border: 1px dashed #cbd5f5;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: #475569;
}

.topic-empty i {
    font-size: 1.5rem;
    color: #2563eb;
}

.topic-empty .hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .chat-topic-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topic-picker-modal .topic-picker-content {
        max-height: 95vh;
    }

    .topic-list {
        grid-template-columns: 1fr;
    }
}
.dark-mode .voice-topic-panel,
[data-theme="dark"] .voice-topic-panel {
    background: rgba(15, 23, 42, 0.92);
    color: var(--text-primary);
}

.dark-mode .voice-topic-card,
[data-theme="dark"] .voice-topic-card {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.25);
}

.dark-mode .voice-topic-card.selected,
.dark-mode .voice-topic-card:hover,
.dark-mode .voice-topic-card:focus-visible,
[data-theme="dark"] .voice-topic-card.selected,
[data-theme="dark"] .voice-topic-card:hover,
[data-theme="dark"] .voice-topic-card:focus-visible {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.32);
    box-shadow: 0 14px 26px rgba(14, 116, 144, 0.25);
}

.dark-mode .voice-drill-theme-picker,
[data-theme="dark"] .voice-drill-theme-picker {
    border-top-color: rgba(148, 163, 184, 0.25);
}

.dark-mode .voice-drill-theme-header h5,
[data-theme="dark"] .voice-drill-theme-header h5 {
    color: #e2e8f0;
    font-weight: 700;
}

.dark-mode .voice-drill-theme-header p,
[data-theme="dark"] .voice-drill-theme-header p {
    color: rgba(226, 232, 240, 0.85);
}

.dark-mode .voice-drill-theme-card,
[data-theme="dark"] .voice-drill-theme-card {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text-primary);
}

.dark-mode .voice-drill-theme-card h6,
[data-theme="dark"] .voice-drill-theme-card h6 {
    color: #e2e8f0;
    font-weight: 700;
}

.dark-mode .voice-drill-theme-card p,
[data-theme="dark"] .voice-drill-theme-card p {
    color: rgba(226, 232, 240, 0.75);
}

.dark-mode .voice-drill-theme-hint,
[data-theme="dark"] .voice-drill-theme-hint {
    color: rgba(226, 232, 240, 0.8);
}

.dark-mode .voice-drill-theme-card.selected,
.dark-mode .voice-drill-theme-card:hover,
.dark-mode .voice-drill-theme-card:focus-visible,
[data-theme="dark"] .voice-drill-theme-card.selected,
[data-theme="dark"] .voice-drill-theme-card:hover,
[data-theme="dark"] .voice-drill-theme-card:focus-visible {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.32);
    box-shadow: 0 12px 22px rgba(14, 116, 144, 0.25);
}

.dark-mode .voice-drill-theme-label,
[data-theme="dark"] .voice-drill-theme-label {
    color: rgba(226, 232, 240, 0.9);
}

.dark-mode .voice-level-chip,
[data-theme="dark"] .voice-level-chip {
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-primary);
}

.dark-mode .voice-level-chip.selected,
.dark-mode .voice-level-chip:hover,
.dark-mode .voice-level-chip:focus-visible,
[data-theme="dark"] .voice-level-chip.selected,
[data-theme="dark"] .voice-level-chip:hover,
[data-theme="dark"] .voice-level-chip:focus-visible {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.38);
    color: var(--text-primary);
}

/* ===== Roadmap ===== */
.roadmap-panel {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
[data-theme="dark"] .roadmap-panel {
    background: #0f172a;
    border-color: rgba(248, 250, 252, 0.08);
    box-shadow: none;
}
.roadmap-empty {
    border: 1px dashed rgba(15, 23, 42, 0.2);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}
[data-theme="dark"] .roadmap-empty {
    border-color: rgba(248, 250, 252, 0.25);
}
.roadmap-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: #2563eb;
}
.roadmap-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.roadmap-scope {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
    font-weight: 600;
}
.roadmap-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.roadmap-banner {
    background: rgba(37, 99, 235, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.roadmap-next {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: rgba(15, 23, 42, 0.02);
}
.roadmap-week-list {
    display: grid;
    gap: 16px;
}
.roadmap-week-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 16px;
}
.roadmap-week-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 8px;
}
.roadmap-week-header span {
    color: #94a3b8;
}
.roadmap-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.roadmap-task {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.roadmap-task label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    width: 100%;
    cursor: pointer;
}
.roadmap-task input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}
.roadmap-task button {
    margin-left: auto;
}
.roadmap-modal {
    position: fixed;
    inset: 0;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(18px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 90;
}

/* Hide sidebar when roadmap modal is open */
.roadmap-modal[aria-hidden="false"] ~ .app-container .sidebar,
.app-container:has(.roadmap-modal[aria-hidden="false"]) .sidebar,
body:has(.roadmap-modal[aria-hidden="false"]) .sidebar,
.sidebar.hidden-for-modal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Alternative approach: hide sidebar when modal-open class is on body and roadmap modal is visible */
body.modal-open .roadmap-modal[aria-hidden="false"] ~ .app-container .sidebar,
body.modal-open:has(.roadmap-modal[aria-hidden="false"]) .sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.roadmap-modal[aria-hidden="false"] {
    display: flex;
}
.roadmap-modal-dialog {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 28px;
    width: min(720px, 94vw);
    max-height: min(88vh, 900px);
    padding: clamp(1.8rem, 4vw, 2.6rem);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 3vw, 1.5rem);
}
.roadmap-modal-sm {
    width: min(420px, 92vw);
    padding: clamp(1.6rem, 4vw, 2.2rem);
    gap: 1rem;
}
.roadmap-modal h3 {
    margin: 0;
    font-size: clamp(1.45rem, 2.6vw, 1.7rem);
    font-weight: 700;
    color: #0f172a;
}
.modal-subtitle {
    color: #475569;
    margin: 0 0 clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.55;
}
.modal-close {
    position: absolute;
    top: clamp(0.75rem, 2vw, 1rem);
    right: clamp(0.75rem, 2vw, 1rem);
    border: none;
    background: rgba(15, 23, 42, 0.06);
    font-size: 1.1rem;
    color: #0f172a;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
}
.modal-close:hover,
.modal-close:focus-visible {
    background: rgba(37, 99, 235, 0.16);
    color: #2563eb;
    transform: scale(1.05);
    outline: none;
}
.roadmap-form-grid {
    display: grid;
    gap: 18px;
}
.roadmap-goal-grid,
.roadmap-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.roadmap-goal-option,
.roadmap-skill-grid label {
    position: relative;
    display: block;
    cursor: pointer;
}
.roadmap-goal-option input,
.roadmap-skill-grid label input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}
.roadmap-goal-option span,
.roadmap-skill-grid label span {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(248, 250, 252, 0.92);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    padding: 0.95rem 1.1rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    min-height: 74px;
}
.roadmap-goal-option span::before,
.roadmap-skill-grid label span::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.45);
    background: transparent;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}
.roadmap-skill-grid label span::before {
    border-radius: 8px;
}
.roadmap-goal-option span::after,
.roadmap-skill-grid label span::after {
    display: none;
}
.roadmap-goal-option:hover span,
.roadmap-skill-grid label:hover span {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}
.roadmap-goal-option:focus-within span,
.roadmap-skill-grid label:focus-within span {
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.roadmap-goal-option input:checked + span,
.roadmap-skill-grid label input:checked + span {
    border-color: rgba(37, 99, 235, 0.7);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(191, 219, 254, 0.88));
    box-shadow: 0 22px 44px rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
}
.roadmap-goal-option input:checked + span::before,
.roadmap-skill-grid label input:checked + span::before {
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.roadmap-goal-option input:checked + span::after,
.roadmap-skill-grid label input:checked + span::after {
    content: '';
    opacity: 0;
    transform: translateY(-4px);
}
.roadmap-form {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2.5vw, 1.5rem);
}
.roadmap-form .stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.roadmap-form .form-label {
    font-weight: 600;
    color: #0f172a;
}
.roadmap-form select,
.roadmap-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(248, 250, 252, 0.92);
    font-size: 1rem;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}
.roadmap-form select {
    background-image: none !important;
    background-repeat: no-repeat;
    padding-right: 1.1rem;
}
.roadmap-form textarea {
    min-height: 108px;
    resize: vertical;
}
.roadmap-form textarea::placeholder {
    color: rgba(148, 163, 184, 0.78);
}
.roadmap-form select:focus,
.roadmap-form textarea:focus {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
    outline: none;
}
.roadmap-modal .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}
.roadmap-modal .modal-actions .btn-secondary {
    background: rgba(148, 163, 184, 0.14);
    border-color: transparent;
    color: #0f172a;
}
.roadmap-modal .modal-actions .btn-secondary:hover,
.roadmap-modal .modal-actions .btn-secondary:focus-visible {
    background: rgba(148, 163, 184, 0.22);
    color: #0f172a;
}

@media (max-width: 720px) {
    .roadmap-modal-dialog {
        width: min(640px, 96vw);
        padding: clamp(1.5rem, 5vw, 2.2rem);
    }
    .roadmap-goal-grid,
    .roadmap-skill-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .roadmap-form select,
    .roadmap-form textarea {
        font-size: 0.95rem;
    }
}
}
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-primary.btn-small::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
}

.btn-outline.btn-small::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
}

.btn-small:hover::before {
    opacity: 1;
}

.btn-primary.btn-small:hover {
    transform: translateY(-1px);
}

.btn-outline.btn-small:hover {
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-outline.btn-small::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}
.roadmap-reminder-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--surface-color);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 2rem 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.roadmap-reminder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.roadmap-reminder-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.roadmap-reminder-card:hover::before {
    opacity: 1;
}

.welcome-screen .roadmap-reminder-card {
    width: 100%;
    max-width: 1000px;
    align-self: stretch;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.roadmap-reminder-info {
    position: relative;
    z-index: 1;
}

.roadmap-reminder-info h3 {
    margin: 0.1rem 0 0.5rem;
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.roadmap-reminder-card:hover .roadmap-reminder-info h3 {
    color: var(--primary-color);
}

[data-theme="dark"] .roadmap-reminder-info h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .roadmap-reminder-card:hover .roadmap-reminder-info h3 {
    color: #60a5fa;
}

.roadmap-reminder-info p {
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    line-height: 1.6;
    margin: 0;
    transition: color 0.2s ease;
}

.roadmap-reminder-card:hover .roadmap-reminder-info p {
    color: var(--text-primary);
}

[data-theme="dark"] .roadmap-reminder-info p {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .roadmap-reminder-card:hover .roadmap-reminder-info p {
    color: rgba(226, 232, 240, 0.9);
}

.roadmap-reminder-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: clamp(0.7rem, 1.2vw, 0.75rem);
    font-weight: 600;
    color: var(--primary-color);
    display: inline-block;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.roadmap-reminder-card:hover .roadmap-reminder-label {
    color: var(--primary-dark);
}

[data-theme="dark"] .roadmap-reminder-label {
    color: #60a5fa;
}

[data-theme="dark"] .roadmap-reminder-card:hover .roadmap-reminder-label {
    color: #93c5fd;
}

.roadmap-reminder-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .roadmap-reminder-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .roadmap-reminder-card::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
}

[data-theme="dark"] .roadmap-reminder-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Responsive Welcome Screen & Action Cards */
@media (max-width: 768px) {
    .welcome-screen {
        padding: 1.5rem 1rem;
    }
    
    .welcome-title {
        margin-bottom: 0.75rem;
    }
    
    .welcome-subtitle {
        margin-bottom: 2rem;
    }
    
    .action-cards {
        gap: clamp(0.75rem, 2vw, 1.25rem);
        max-width: 100%;
    }
    
    .action-cards.two-card-tight {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 1rem;
    }
    
    .action-cards.three-card {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 1rem;
    }
    
    .action-card {
        padding: 2rem 1.5rem;
        min-height: 240px;
        border-radius: 16px;
    }
    
    .action-card:hover {
        transform: translateY(-4px);
    }
    
    .action-card i {
        margin-bottom: 1rem;
    }
    
    .roadmap-reminder-card {
        padding: 1.25rem 1.25rem;
        margin-top: 1.5rem;
        border-radius: 14px;
    }
    
    .roadmap-reminder-actions {
        gap: 0.6rem;
    }
    
    .btn-small {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .btn-small:hover {
        transform: none;
    }
}

@media (max-width: 640px) {
    .welcome-screen {
        padding: 1.25rem 0.75rem;
    }
    
    .welcome-title {
        margin-bottom: 0.5rem;
    }
    
    .welcome-subtitle {
        margin-bottom: 1.75rem;
    }
    
    .action-cards {
        gap: 0.75rem;
    }
    
    .action-cards.two-card-tight {
        gap: 0.75rem;
    }
    
    .action-card {
        padding: 1.75rem 1.25rem;
        min-height: 220px;
        border-radius: 14px;
        width: 100%;
    }
    
    .action-card:hover {
        transform: translateY(-2px);
    }
    
    .action-card:active {
        transform: translateY(0);
    }
    
    .action-card i {
        font-size: 1.5rem;
        margin-bottom: 0.85rem;
    }
    
    .action-card h3 {
        margin-bottom: 0.6rem;
    }
    
    .roadmap-reminder-card {
        padding: 1rem 1rem;
        margin-top: 1.25rem;
        border-radius: 12px;
        gap: 0.85rem;
    }
    
    .roadmap-reminder-info h3 {
        margin: 0.1rem 0 0.4rem;
    }
    
    .roadmap-reminder-actions {
        gap: 0.5rem;
        flex-direction: column;
        width: 100%;
    }
    
    .roadmap-reminder-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-small {
        padding: 0.4rem 0.85rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
}

.settings-section-highlight {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    border-radius: 0.75rem;
    transition: box-shadow 0.3s ease;
}
.roadmap-summary-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.roadmap-summary-eyebrow {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #64748b;
}

.roadmap-summary-copy h5 {
    margin: 0.25rem 0 0.4rem;
    font-size: 1.1rem;
    color: #0f172a;
}

.roadmap-summary-meta {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
}

.roadmap-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.roadmap-summary-actions .btn {
    min-width: 150px;
}

[data-theme="dark"] .roadmap-summary-card {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: none;
}

.roadmap-detail-modal .modal-body {
    padding-top: 0;
}

.roadmap-detail-modal {
    width: min(780px, 96vw);
}

.roadmap-detail-body {
    max-height: calc(80vh - 3rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

[data-theme="dark"] .plan-upgrade-btn.is-ack {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.logout-settings .logout-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.logout-settings .logout-inline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.logout-settings .logout-inline:hover {
    background: var(--surface-color);
    border-color: var(--danger-color);
    color: var(--danger-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.logout-settings .logout-inline:hover::before {
    opacity: 1;
}

.logout-settings .logout-inline:focus-visible {
    outline: 2px solid var(--danger-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.2);
}

.logout-settings .logout-inline i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.logout-settings .logout-inline:hover i {
    transform: translateX(2px) scale(1.05);
}

[data-theme="dark"] .logout-settings .logout-inline {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .logout-settings .logout-inline::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .logout-settings .logout-inline:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .logout-settings .logout-inline:focus-visible {
    outline-color: #f87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.25), 0 4px 16px rgba(239, 68, 68, 0.3);
}

.roadmap-summary-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: center;
    transition: all 0.2s ease;
}

.roadmap-summary-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .roadmap-summary-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .roadmap-summary-card:hover {
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.roadmap-summary-eyebrow {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

[data-theme="dark"] .roadmap-summary-eyebrow {
    color: rgba(226, 232, 240, 0.7);
}

.roadmap-summary-copy h5 {
    margin: 0.35rem 0 0.5rem;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 700;
}

[data-theme="dark"] .roadmap-summary-copy h5 {
    color: #e2e8f0;
}

.roadmap-summary-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

[data-theme="dark"] .roadmap-summary-meta {
    color: rgba(226, 232, 240, 0.75);
}

.roadmap-summary-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.roadmap-summary-actions .btn {
    border-radius: 12px;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.roadmap-summary-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.roadmap-summary-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.roadmap-summary-actions .btn:hover::before {
    opacity: 1;
}

[data-theme="dark"] .roadmap-summary-actions .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .roadmap-summary-actions .btn:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive settings modal */
@media (max-width: 768px) {
    .settings-modal {
        width: 96vw;
        padding: clamp(1.5rem, 4vw, 2rem);
        border-radius: 16px;
    }
    
    .settings-modal .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .settings-section h4 {
        font-size: 1.1rem;
    }
    
    .setting-item input[type="text"],
    .setting-item input[type="email"],
    .setting-item select {
        padding: 0.75rem 0.9rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .current-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
        border-width: 2.5px;
    }
    
    .settings-modal .btn-secondary,
    .settings-modal .modal-actions .btn-primary {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
}

@media (max-width: 640px) {
    .settings-modal {
        width: 98vw;
        padding: clamp(1.25rem, 4vw, 1.75rem);
        border-radius: 12px;
    }
    
    .settings-modal .modal-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .settings-modal .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .settings-section {
        margin-bottom: 1.75rem;
        padding-bottom: 1.5rem;
    }
    
    .settings-section h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .setting-item {
        margin-bottom: 1.5rem;
    }
    
    .setting-item label {
        font-size: 0.9rem;
        margin-bottom: 0.55rem;
    }
    
    .setting-item input[type="text"],
    .setting-item input[type="email"],
    .setting-item select {
        padding: 0.7rem 0.85rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .current-avatar {
        width: 65px;
        height: 65px;
        font-size: 1.6rem;
        border-width: 2px;
    }
    
    .profile-pic-upload {
        gap: 1.25rem;
    }
    
    .settings-modal .btn-secondary,
    .settings-modal .modal-actions .btn-primary,
    .logout-settings .logout-inline {
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .settings-modal .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .settings-modal .modal-actions .btn-secondary,
    .settings-modal .modal-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .settings-modal .btn-secondary:hover,
    .settings-modal .modal-actions .btn-primary:hover,
    .logout-settings .logout-inline:hover {
        transform: none;
    }
}

.preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed var(--primary-color);
    border-radius: 0.5rem;
    background: #f8fafc;
}

.cropper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.cropper-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8fafc;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.cropper-wrapper:active {
    cursor: grabbing;
}

.cropper-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: all;
    cursor: grab;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.cropper-img:active {
    cursor: grabbing;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

.crop-box {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
    pointer-events: all;
    cursor: move;
    touch-action: none;
    z-index: 2;
    transition: border-color 0.2s ease;
}

.crop-box:hover {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.crop-box:active {
    cursor: grabbing;
    border-color: rgba(59, 130, 246, 0.8);
}

.crop-handles {
    position: relative;
    width: 100%;
    height: 100%;
}

.crop-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    pointer-events: all;
    z-index: 3;
    touch-action: none;
}

.crop-handle:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: var(--primary-color);
    border-color: white;
}

.crop-handle:active {
    transform: scale(1.1);
}

.crop-handle.nw {
    top: -8px;
    left: -8px;
    cursor: nw-resize;
}

.crop-handle.ne {
    top: -8px;
    right: -8px;
    cursor: ne-resize;
}

.crop-handle.sw {
    bottom: -8px;
    left: -8px;
    cursor: sw-resize;
}

.crop-handle.se {
    bottom: -8px;
    right: -8px;
    cursor: se-resize;
}

.cropper-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-level {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

.reset-controls {
    display: flex;
    gap: 0.5rem;
}

.preview-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.preview-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.current-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.current-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.current-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4), 0 3px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 1);
}

.current-avatar:hover::before {
    opacity: 1;
}

.current-avatar i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.current-avatar:hover i {
    transform: scale(1.1);
}

[data-theme="dark"] .current-avatar {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .current-avatar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .current-avatar:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.5), 0 3px 14px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 1);
}

/* Profile picture pending save indicator */
.current-avatar.pending-save {
    position: relative;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(59, 130, 246, 0.3);
    animation: pendingPulse 2s ease-in-out infinite;
}

.current-avatar.pending-save::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pendingPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3), 0 6px 16px rgba(59, 130, 246, 0.4);
    }
}

/* Change Picture button with pending indicator */
#changePictureBtn.has-pending {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-color: #2563eb;
    position: relative;
}

#changePictureBtn.has-pending::after {
    content: '•';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    color: white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Highlight Save Changes button animation */
.highlight-save-button {
    animation: highlightSaveButton 2s ease-in-out;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 4px 16px rgba(59, 130, 246, 0.5) !important;
    transform: scale(1.05);
}

@keyframes highlightSaveButton {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }
    25%, 75% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.5), 0 6px 20px rgba(59, 130, 246, 0.6);
        transform: scale(1.08);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.6), 0 8px 24px rgba(59, 130, 246, 0.7);
        transform: scale(1.1);
    }
}

[data-theme="dark"] .current-avatar.pending-save {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3), 0 4px 12px rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .current-avatar.pending-save::after {
    background: #60a5fa;
}

[data-theme="dark"] #changePictureBtn.has-pending {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border-color: #3b82f6;
}

[data-theme="dark"] .highlight-save-button {
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.5), 0 4px 16px rgba(96, 165, 250, 0.6) !important;
}

.language-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.language-display span {
    font-weight: 500;
    color: var(--text-primary);
}


.plan-upgrade-btn {
    display: none;
    width: 100%;
    margin-top: 0.75rem;
    justify-content: center;
    align-items: center;
}

.plan-upgrade-btn.is-ack {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: default;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .plan-upgrade-btn {
        display: inline-flex;
    }
}

/* Large screen optimization */
@media (min-width: 1200px) {
    .action-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        max-width: 1100px;
    }
    
    .language-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1000px;
    }
    
    .level-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 1000px;
    }
    
    .practice-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
    }
}

/* Floating Profile Icon */
.floating-profile {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    display: block;
}

/* Hide floating profile icon when chat interface is active */
.floating-profile.hidden {
    display: none;
}

.floating-profile:hover {
    transform: scale(1.05) translateY(-2px);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.profile-avatar:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 12px 32px rgba(37, 99, 246, 0.4), 0 6px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.profile-avatar:hover::before {
    opacity: 1;
}

.profile-avatar i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar:hover i {
    transform: scale(1.1) rotate(5deg);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Dark theme adjustments for floating profile */
[data-theme="dark"] .profile-avatar {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .profile-avatar::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

[data-theme="dark"] .profile-avatar:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Hide floating profile on mobile and tablet - only show on desktop/web app */
@media (max-width: 1024px) {
    .floating-profile {
        display: none !important;
    }
    
    .top-bar .user-profile {
        display: none;
    }
}

/* Desktop/web app only - show floating profile */
@media (min-width: 1025px) {
    .floating-profile:not(.hidden) {
        display: block;
    }
    
    /* Show floating profile in practice modes and insights section on desktop/web app */
    .practice-dashboard ~ .floating-profile,
    #savedPractice ~ .floating-profile,
    #knowledgeBase ~ .floating-profile,
    #deepDivePractice ~ .floating-profile,
    #insightsDashboard ~ .floating-profile {
        display: block !important;
    }
    
    /* Ensure floating profile is visible when practice sections or insights are active on desktop */
    body:has(#practiceDashboard[style*="flex"]) .floating-profile,
    body:has(#savedPractice[style*="flex"]) .floating-profile,
    body:has(#knowledgeBase[style*="flex"]) .floating-profile,
    body:has(#deepDivePractice[style*="flex"]) .floating-profile,
    body:has(#insightsDashboard[style*="flex"]) .floating-profile {
        display: block !important;
    }
}

/* Pricing Modal Styles */
.pricing-modal {
    max-width: 880px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25), 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(16px);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.pricing-modal::-webkit-scrollbar {
    width: 8px;
}

.pricing-modal::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.pricing-modal::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.pricing-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .pricing-modal::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .pricing-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.6);
}

.pricing-modal::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 0;
}

.pricing-modal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    pointer-events: none;
    z-index: 1;
}

.pricing-modal .modal-content {
    position: relative;
    z-index: 1;
    padding: clamp(1.8rem, 4vw, 2.5rem);
    min-height: min-content;
    display: flex;
    flex-direction: column;
}

.pricing-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.pricing-modal .modal-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

[data-theme="dark"] .pricing-modal .modal-header h2 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-modal .modal-close {
    position: relative;
    top: auto;
    right: auto;
    border: none;
    background: var(--surface-color);
    color: var(--text-secondary);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.pricing-modal .modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
}

.pricing-modal .modal-close:hover,
.pricing-modal .modal-close:focus-visible {
    background: var(--surface-color);
    color: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), 0 2px 4px rgba(0, 0, 0, 0.08);
    outline: none;
}

.pricing-modal .modal-close:hover::before,
.pricing-modal .modal-close:focus-visible::before {
    opacity: 1;
}

.pricing-modal .modal-close i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.pricing-modal .modal-close:hover i {
    transform: rotate(90deg) scale(1.1);
}

[data-theme="dark"] .pricing-modal .modal-close {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .pricing-modal .modal-close::before {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(239, 68, 68, 0.08));
}

[data-theme="dark"] .pricing-modal .modal-close:hover,
[data-theme="dark"] .pricing-modal .modal-close:focus-visible {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pricing-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    overflow: visible;
    position: relative;
    z-index: 1;
    min-height: min-content;
}

.pricing-modal-note {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08));
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    font-weight: 500;
    line-height: 1.5;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.pricing-modal-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pricing-modal-note:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.pricing-modal-note:hover::before {
    opacity: 1;
}

[data-theme="dark"] .pricing-modal-note {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.12));
    border-color: rgba(96, 165, 250, 0.25);
    color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .pricing-modal-note::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .pricing-modal-note:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.15));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.pricing-card {
    background: var(--surface-color);
    border-radius: 18px;
    padding: 2.5rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: visible;
    position: relative;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 18px;
    pointer-events: none;
}

.pricing-card::after {
    display: none;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.pricing-card:hover::before {
    opacity: 1;
}

.pricing-card.pro-plan {
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    background: var(--surface-color);
    margin-top: 0;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15), 0 2px 10px rgba(0, 0, 0, 0.08);
}

.pricing-card.pro-plan::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(37, 99, 235, 0.04));
}

.pricing-card.pro-plan:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.2), 0 4px 14px rgba(0, 0, 0, 0.1);
}

.pricing-card:not(.pro-plan) {
    margin-top: 0.9rem;
}

/* Pricing Modal Plan Badge - Stagnant on mobile/tablet when upgrade to pro is clicked */
.pricing-card .plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(120deg, var(--primary-color), #3b82f6);
    color: white;
    padding: 0.45rem 1.4rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 18px 28px rgba(59, 130, 246, 0.35);
    z-index: 3;
    min-width: 120px;
    display: inline-flex;
    justify-content: center;
    transition: none;
    pointer-events: none;
}

.pricing-card:hover .plan-badge {
    transform: translateX(-50%);
}

@media (max-width: 1024px) {
    .pricing-card .plan-badge {
        transition: none;
        pointer-events: none;
    }
    
    .pricing-card:hover .plan-badge {
        transform: translateX(-50%);
    }
    
    .plan-features li {
        white-space: nowrap;
        font-size: clamp(0.8rem, 1.5vw, 0.95rem);
        min-width: 0;
    }
    
    .plan-features li > * {
        flex-shrink: 0;
    }
    
    .plan-note {
        font-size: clamp(0.75rem, 1.5vw, 0.85rem);
        line-height: 1.5;
    }
}

@media (max-width: 768px) {
    .pricing-card {
        padding-top: 4.1rem;
        align-items: center;
        text-align: center;
    }
    
    .pricing-card:hover {
        transform: none;
        box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    }
    
    .pricing-card .plan-badge {
        top: -4px;
        min-width: 140px;
        transition: none;
        pointer-events: none;
    }
    
    .pricing-card:hover .plan-badge {
        transform: translateX(-50%);
    }
    
    .plan-header {
        padding-top: 1.8rem;
    }
    
    .plan-header h3 {
        margin-top: 0.65rem;
    }
}

@media (max-width: 640px) {
    .pricing-card:hover {
        transform: none;
        box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    }
    
    .pricing-card .plan-badge {
        transition: none;
        pointer-events: none;
    }
    
    .pricing-card:hover .plan-badge {
        transform: translateX(-50%);
    }
}

.plan-header {
    text-align: center;
    margin-bottom: 1.75rem;
    position: relative;
    z-index: 1;
}

.plan-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.plan-price .currency {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.plan-price .amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .plan-price .amount {
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.plan-price .period {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem 0;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.6rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.2s ease;
    position: relative;
    white-space: nowrap;
    min-width: 0;
}

.plan-features li > * {
    flex-shrink: 0;
}

.plan-features li > i {
    flex-shrink: 0;
}

.plan-features li > strong {
    flex-shrink: 0;
}

.plan-features li:hover {
    color: var(--text-primary);
}

.plan-features li i {
    color: var(--success-color);
    font-size: 0.9rem;
    width: 18px;
    flex-shrink: 0;
    margin-top: 0.15rem;
    transition: transform 0.2s ease;
}

.plan-features li:hover i {
    transform: scale(1.1);
}

[data-theme="dark"] .plan-features li i {
    color: #34d399;
}

.plan-features li strong {
    font-weight: 600;
    color: var(--text-primary);
}

.plan-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 1.75rem;
    line-height: 1.6;
    font-style: italic;
    padding: 0 0.5rem;
}

.plan-status {
    text-align: center;
    margin-bottom: 1.5rem;
}

.current-plan {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.current-plan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.current-plan:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.current-plan:hover::before {
    opacity: 1;
}

[data-theme="dark"] .current-plan {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .current-plan:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}

.plan-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.upgrade-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4), 0 3px 8px rgba(0, 0, 0, 0.15);
}

.upgrade-btn:hover::before {
    opacity: 1;
}

.upgrade-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.upgrade-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 6px 16px rgba(37, 99, 235, 0.4);
}

.upgrade-btn span,
.upgrade-btn {
    position: relative;
    z-index: 1;
}

/* Responsive pricing modal */
@media (max-width: 768px) {
    .pricing-modal {
        width: 96%;
        border-radius: 20px;
        max-height: 92vh;
        padding: clamp(1.5rem, 4vw, 2rem);
    }
    
    .pricing-modal .modal-content {
        padding: clamp(1.5rem, 4vw, 2rem);
    }
    
    .pricing-modal .modal-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }
    
    .pricing-modal .modal-header h2 {
        font-size: clamp(1.3rem, 3vw, 1.75rem);
    }
    
    .pricing-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .pricing-card {
        padding: 2rem 1.75rem;
        border-radius: 16px;
    }
    
    .pricing-card:hover {
        transform: translateY(-2px);
    }
    
    .plan-header h3 {
        font-size: 1.5rem;
    }
    
    .plan-price .amount {
        font-size: 2.75rem;
    }
    
    .plan-features li {
        font-size: clamp(0.75rem, 2vw, 0.9rem);
        padding: 0.55rem 0;
        white-space: nowrap;
        min-width: 0;
    }
    
    .plan-features li > * {
        flex-shrink: 0;
    }
    
    .plan-note {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .upgrade-btn {
        padding: 0.85rem 1.35rem;
        font-size: 0.95rem;
    }
    
    .upgrade-btn:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 640px) {
    .pricing-modal {
        width: 98%;
        border-radius: 16px;
        max-height: 95vh;
    }
    
    .pricing-modal .modal-content {
        padding: clamp(1.25rem, 4vw, 1.75rem);
    }
    
    .pricing-modal .modal-header {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }
    
    .pricing-modal .modal-header h2 {
        font-size: clamp(1.2rem, 3vw, 1.5rem);
    }
    
    .pricing-modal .modal-close {
        width: 2rem;
        height: 2rem;
        border-radius: 8px;
    }
    
    .pricing-container {
        gap: 1.25rem;
        margin-top: 1.5rem;
        padding-bottom: 1.25rem;
    }
    
    .pricing-modal-note {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .pricing-card {
        padding: 1.75rem 1.5rem;
        border-radius: 14px;
    }
    
    .pricing-card:hover {
        transform: none;
    }
    
    .plan-header {
        margin-bottom: 1.5rem;
    }
    
    .plan-header h3 {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .plan-price {
        gap: 0.25rem;
    }
    
    .plan-price .currency {
        font-size: 1.15rem;
    }
    
    .plan-price .amount {
        font-size: 2.5rem;
    }
    
    .plan-price .period {
        font-size: 0.95rem;
    }
    
    .plan-features ul {
        margin-bottom: 1.5rem;
    }
    
    .plan-features li {
        font-size: clamp(0.7rem, 1.8vw, 0.85rem);
        padding: 0.5rem 0;
        gap: 0.75rem;
        white-space: nowrap;
        min-width: 0;
    }
    
    .plan-features li > * {
        flex-shrink: 0;
    }
    
    .plan-features li i {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        width: 16px;
        flex-shrink: 0;
    }
    
    .plan-note {
        font-size: clamp(0.7rem, 1.6vw, 0.8rem);
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .current-plan {
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    
    .current-plan:hover {
        transform: none;
    }
    
    .upgrade-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .upgrade-btn:hover {
        transform: none;
    }
}

[data-theme="dark"] .pricing-modal {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pricing-modal::before {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .pricing-modal::after {
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.3), transparent);
}

[data-theme="dark"] .pricing-modal .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .pricing-card {
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .pricing-card::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(59, 130, 246, 0.03));
}

[data-theme="dark"] .pricing-card:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pricing-card.pro-plan {
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.25), 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pricing-card.pro-plan::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(59, 130, 246, 0.05));
}

[data-theme="dark"] .pricing-card.pro-plan:hover {
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3), 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .plan-header h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .plan-price .currency {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .plan-price .period {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .plan-features li {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .plan-features li strong {
    color: #e2e8f0;
}

[data-theme="dark"] .plan-note {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .upgrade-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .upgrade-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .upgrade-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 3px 10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .upgrade-btn:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Pro Plan Card Styles */
.pro-plan-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    text-align: center;
    border: none;
    padding: 1.1rem 1.25rem;
}

.pro-plan-icon {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: #fbbf24;
}

.pro-plan-card h4 {
    color: white;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.pro-plan-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.pro-plan-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.6rem;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.2rem 0.45rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Dark theme adjustments for pro plan card */
[data-theme="dark"] .pro-plan-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

[data-theme="dark"] .feature-badge {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Chat Save Buttons */
.message-save-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message:hover .message-save-controls {
    opacity: 1;
}

.save-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.save-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.save-btn.saved {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    cursor: not-allowed;
}

.save-btn.saved:hover {
    transform: none;
}

.save-btn.has-data {
    background: rgba(37, 99, 235, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.save-btn.has-data:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.save-btn.has-data::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.message-save-controls.has-data {
    opacity: 1;
}

.saved-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--success-color);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Save Modals */
.save-modal {
    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: 1000;
    padding: 1rem;
}

.save-modal .modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.save-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.save-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: var(--transition);
}

.save-modal .modal-close:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.save-modal .modal-body {
    padding: 0 1.5rem;
}

.save-modal .modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

/* Correction Preview */
.correction-preview,
.vocabulary-preview,
.grammar-preview {
    margin-bottom: 1.5rem;
}

.correction-preview > div,
.vocabulary-preview > div,
.grammar-preview > div {
    margin-bottom: 1rem;
}

.correction-preview label,
.vocabulary-preview label,
.grammar-preview label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.text-content {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
    color: var(--text-primary);
    line-height: 1.5;
}


.favorite-modal-intro {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.favorite-correction-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.favorite-correction-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.favorite-correction-item input {
    margin-top: 0.2rem;
}

.favorite-correction-item span {
    flex: 1;
    line-height: 1.5;
    color: var(--text-primary);
}

.favorite-saved-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--success-color);
    font-size: 0.75rem;
    font-weight: 600;
}

.favorite-saved-tag i {
    font-size: 0.75rem;
}

.correction-save-modal .modal-content {
    max-width: 540px;
}
/* Save Options */
.save-options {
    margin-top: 1.5rem;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.option-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.option-group select,
.option-group input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.option-group input[type="text"]:focus,
.option-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Save Success Notification */
.save-success-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1001;
    animation: slideInUp 0.3s ease;
}

.save-success-notification .success-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.save-success-notification .success-text {
    font-weight: 500;
}

.save-success-notification .view-practice {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.save-success-notification .view-practice:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dark theme adjustments for save functionality */
[data-theme="dark"] .save-btn {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .save-btn:hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .save-btn.has-data {
    background: rgba(96, 165, 250, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .save-btn.has-data::after {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .text-content {
    background: var(--background-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .save-modal .modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .option-group select,
[data-theme="dark"] .option-group input[type="text"] {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Audio Controls */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--background-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.audio-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.75rem;
}

.audio-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.audio-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.audio-progress {
    flex: 1;
    height: 0.5rem;
    background: var(--border-color);
    border-radius: 0.25rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.audio-progress:hover {
    background: var(--text-muted);
}

.audio-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 0.25rem;
}

.audio-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 4rem;
    text-align: right;
}

/* Dark theme for audio controls */
[data-theme="dark"] .audio-controls {
    background: var(--background-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .audio-progress {
    background: var(--border-color);
}

/* Mobile responsiveness for save buttons */
@media (max-width: 768px) {
    .message-save-controls {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .save-btn {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
    
    .save-modal {
        padding: 0.5rem;
    }
    
    .save-modal .modal-content {
        max-height: 95vh;
    }
    
    .save-success-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .audio-controls {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .audio-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.6875rem;
    }
    
    .audio-time {
        font-size: 0.6875rem;
        min-width: 3rem;
    }
}

/* Microphone Button */
.microphone-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    margin-right: 0.5rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.microphone-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 50%;
}

.microphone-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.microphone-btn:hover::before {
    opacity: 1;
}

.microphone-btn:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.microphone-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4), 0 4px 12px rgba(37, 99, 235, 0.4);
}

.microphone-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.microphone-btn:hover i {
    transform: scale(1.1);
}

.microphone-btn.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.4);
}

.microphone-btn.recording::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    opacity: 1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0.2), 0 4px 12px rgba(239, 68, 68, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.4);
    }
}

/* Dark theme for microphone */
[data-theme="dark"] .microphone-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .microphone-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

[data-theme="dark"] .microphone-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .microphone-btn:focus-visible {
    outline-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.4), 0 4px 16px rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .microphone-btn.recording {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 0 0 8px rgba(248, 113, 113, 0.2), 0 4px 16px rgba(239, 68, 68, 0.5);
}

/* Responsive chat input */
@media (max-width: 768px) {
    .chat-input-container {
        padding: 0.9rem 1rem 1.25rem;
        border-radius: 10px;
    }
    
    .input-group {
        padding: 0.65rem;
        border-radius: 10px;
        gap: 0.65rem;
    }
    
    .microphone-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .chat-input-container {
        padding: 0.75rem 0.9rem 1rem;
        border-radius: 8px;
    }
    
    .input-group {
        padding: 0.6rem;
        border-radius: 8px;
        gap: 0.6rem;
    }
    
    .microphone-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
        margin-right: 0.4rem;
    }
    
    .btn-primary {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .microphone-btn:hover,
    .btn-primary:hover {
        transform: none;
    }
}

/* Saved Corrections Practice */
.saved-practice {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    position: relative;
    overflow: visible;
}

.saved-practice-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.32);
}

.saved-practice-header h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 650;
    color: #0f172a;
}

.saved-practice-header .subtitle {
    margin: 0;
    color: #475569;
    max-width: 640px;
}

.saved-practice-header .back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.saved-practice-content {
    padding: 0;
    display: flex;
    gap: 1.5rem;
    margin-top: 1.25rem;
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible;
}

.saved-practice-tabs {
    display: inline-flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    padding: 0.25rem;
    flex-wrap: wrap;
}

.saved-tab {
    border: none;
    background: transparent;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.saved-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

.saved-items-list {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1.1rem;
    border: 1px solid rgba(226, 232, 240, 0.45);
    padding: 1rem 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 0 0 32%;
    max-height: none;
    overflow-y: visible;
    height: auto;
    min-height: auto;
}

.saved-empty-hint {
    padding: 1.5rem;
    text-align: center;
    color: #475569;
    font-size: 0.95rem;
}

[data-theme="dark"] .saved-empty-hint {
    color: rgba(226, 232, 240, 0.85);
}

.saved-item-card {
    position: relative;
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.15rem;
    padding: 1rem;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saved-item-card:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.saved-item-card.active {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 26px 52px rgba(37, 99, 235, 0.18);
}

.saved-item-card .card-badge {
    color: var(--primary-color);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.saved-item-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saved-item-card .item-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #0f172a;
}

.saved-item-card .card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.saved-practice-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.94) 0%, rgba(242, 246, 252, 0.92) 48%, rgba(233, 238, 247, 0.88) 100%);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 1.5rem;
    box-shadow: 0 28px 58px rgba(15, 23, 42, 0.14);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    max-height: none;
    overflow: visible;
    min-height: auto;
    height: auto;
}

.practice-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    color: #475569;
    padding: 2rem 1.5rem;
    background: rgba(226, 232, 240, 0.32);
    border-radius: 1.15rem;
}

.practice-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
}

.saved-meta-line {
    margin: 0.1rem 0;
    color: #475569;
    font-size: 0.9rem;
}

.saved-vocab-flashcard {
    border: 1px dashed rgba(37, 99, 235, 0.35);
    background: rgba(226, 232, 240, 0.35);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
}

.saved-vocab-activity-nav,
.saved-correction-activity-nav,
.saved-question-activity-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
}

.vocab-activity-chip,
.correction-activity-chip {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f8fafc;
    color: #0f172a;
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.vocab-activity-chip i,
.correction-activity-chip i {
    font-size: 0.85rem;
}

.vocab-activity-chip.active,
.correction-activity-chip.active {
    background: #2563eb;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.25);
}

.saved-vocab-activity-panels,
.saved-correction-activity-panels,
.saved-question-activity-panels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    scrollbar-width: none;
    min-height: auto;
}

.saved-vocab-activity-panel,
.saved-correction-activity-panel,
.saved-question-activity-panel {
    display: none;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    overflow: visible;
    min-height: auto;
}

.saved-vocab-activity-panel.active,
.saved-correction-activity-panel.active,
.saved-question-activity-panel.active {
    display: flex;
}

.activity-callout {
    border-left: 4px solid #2563eb;
    background: rgba(37, 99, 235, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.flashcard-header h4 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
}

.flashcard-header p {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: #475569;
}

.flashcard-mode {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    background: #dbeafe;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

.flashcard-prompt {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.flashcard-input {
    width: 100%;
}

.flashcard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.flashcard-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flashcard-feedback {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
    min-height: 1rem;
}

.flashcard-feedback.success {
    color: #059669;
}

.flashcard-feedback.error {
    color: #dc2626;
}

.flashcard-feedback.info {
    color: #0f172a;
}

.contrast-split {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contrast-split > div {
    flex: 1 1 200px;
}

.context-hint {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
}

.context-option-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.context-option-list label {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.context-option-list input[type="checkbox"] {
    margin-top: 0.2rem;
}

.saved-correction-context,
.saved-vocab-context-summary,
.knowledge-context-summary,
.deep-dive-context {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.2);
}

.saved-correction-context h5,
.saved-vocab-context-summary h5,
.knowledge-context-summary h5,
.deep-dive-context h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.saved-correction-context p,
.saved-vocab-context-summary p,
.knowledge-context-summary p,
.deep-dive-context p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #64748b;
    font-style: italic;
}

[data-theme="dark"] .saved-correction-context,
[data-theme="dark"] .saved-vocab-context-summary,
[data-theme="dark"] .knowledge-context-summary,
[data-theme="dark"] .deep-dive-context {
    border-top-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .saved-correction-context h5,
[data-theme="dark"] .saved-vocab-context-summary h5,
[data-theme="dark"] .knowledge-context-summary h5,
[data-theme="dark"] .deep-dive-context h5 {
    color: rgba(203, 213, 225, 0.85);
}

[data-theme="dark"] .saved-correction-context p,
[data-theme="dark"] .saved-vocab-context-summary p,
[data-theme="dark"] .knowledge-context-summary p,
[data-theme="dark"] .deep-dive-context p {
    color: rgba(148, 163, 184, 0.8);
}

.saved-question-context {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.2);
}

.saved-question-context h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.saved-question-context p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #64748b;
    font-style: italic;
}

.saved-question-original {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.2);
}

.saved-vocab-content .sc-body,
.saved-question-content .sc-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: visible;
    min-height: auto;
}

.sc-footer-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.saved-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    max-height: none;
    height: auto;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 247, 252, 0.94) 50%, rgba(235, 239, 246, 0.9) 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.35rem;
    box-shadow: 0 28px 65px rgba(15, 23, 42, 0.16);
    overflow: visible;
    backdrop-filter: blur(18px);
    scroll-behavior: smooth;
    scrollbar-width: none;
    min-height: auto;
}

.saved-panel::-webkit-scrollbar,
.sc-content::-webkit-scrollbar,
.sc-body::-webkit-scrollbar,
.saved-vocab-activity-panels::-webkit-scrollbar,
.saved-correction-activity-panels::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.saved-panel::-webkit-scrollbar-track,
.sc-content::-webkit-scrollbar-track,
.sc-body::-webkit-scrollbar-track,
.saved-vocab-activity-panels::-webkit-scrollbar-track,
.saved-correction-activity-panels::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 999px;
}

.saved-panel::-webkit-scrollbar-thumb,
.sc-content::-webkit-scrollbar-thumb,
.sc-body::-webkit-scrollbar-thumb,
.saved-vocab-activity-panels::-webkit-scrollbar-thumb,
.saved-correction-activity-panels::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.45);
    border-radius: 999px;
}

.saved-panel::-webkit-scrollbar-thumb:hover,
.sc-content::-webkit-scrollbar-thumb:hover,
.sc-body::-webkit-scrollbar-thumb:hover,
.saved-vocab-activity-panels::-webkit-scrollbar-thumb:hover,
.saved-correction-activity-panels::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.7);
}

.sc-header {
    padding: 18px 22px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.55) 0%, rgba(248, 250, 252, 0.65) 100%);
    backdrop-filter: blur(16px);
}

.sc-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.sc-header-top h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.sc-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #64748b;
}

.sc-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 18px 22px 26px;
    gap: 16px;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    scrollbar-width: none;
    min-height: auto;
}

.sc-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: visible;
    overflow-x: hidden;
    padding-right: 0;
    max-height: none;
    scrollbar-width: none;
}

.saved-vocab-activity-panels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    scrollbar-width: none;
    min-height: auto;
}

.sc-reminder {
    background: linear-gradient(140deg, rgba(59, 130, 246, 0.12) 0%, rgba(129, 140, 248, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 1rem;
    padding: 16px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.sc-reminder h4 {
    margin: 0 0 6px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
}

.sc-reminder p {
    margin: 0;
    color: #0f172a;
    line-height: 1.55;
}

.sc-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    max-height: 100%;
}

.sc-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-msg-user,
.sc-msg-tutor {
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.45;
    font-size: 0.95rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.sc-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
}

.sc-msg-tutor {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #0f172a;
}

.sc-input-label {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.sc-input {
    width: 100%;
    min-height: 110px;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.95rem 1rem;
    font-size: 0.95rem;
    resize: vertical;
}

.sc-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.sc-footer {
    position: relative;
    bottom: auto;
    padding: 14px 22px 18px;
    background: #ffffff;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.sc-footer .btn {
    min-width: 140px;
}

.sc-feedback {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 1.1rem;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.sc-feedback h4 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1d4ed8;
}

.sc-feedback p {
    margin: 0;
    line-height: 1.5;
}

.practice-session {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    overflow: hidden;
}

.practice-session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    position: sticky;
    top: 0;
    background: inherit;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.05);
    z-index: 1;
}

.practice-session-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    padding: 1rem 0.75rem 1rem 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(255, 255, 255, 0.75);
    overscroll-behavior: contain;
}

.practice-session-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.practice-session-header .practice-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #64748b;
}

.practice-reference {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 1.1rem;
    padding: 1.1rem;
}

.practice-reference h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.practice-reference p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-primary);
}

.practice-input {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding-top: 1.2rem;
}

.practice-input label {
    font-weight: 600;
    color: var(--text-primary);
}

.practice-input textarea {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.85rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.practice-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.practice-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.practice-feedback {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 1.1rem;
    padding: 1.1rem;
}

.practice-feedback h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--success-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.practice-feedback .feedback-content {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-primary);
}

.saved-practice-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

.saved-practice-empty i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.loading-state,
.error-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
}

.error-state {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

@media (max-width: 1024px) {
    .saved-practice-content {
        flex-direction: column;
        height: auto;
        max-height: none;
        overflow: visible;
        min-height: auto;
    }

    .saved-items-list {
        width: 100%;
        max-width: none;
        max-height: none;
        padding: 0.85rem 0.75rem;
        overflow-y: visible;
        height: auto;
    }

    .saved-practice-panel {
        height: auto;
        max-height: none;
        overflow-y: visible;
        min-height: auto;
    }
    
    .saved-panel {
        max-height: none;
        height: auto;
        overflow-y: visible;
        min-height: auto;
    }
    
    .sc-content {
        max-height: none;
        overflow-y: visible;
        min-height: auto;
    }

    .practice-session-body {
        padding: 0.75rem;
        max-height: none;
    }

    .practice-session-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .practice-session-header .practice-meta {
        align-items: flex-start;
    }
    
    .saved-vocab-activity-panels {
        max-height: none;
        overflow-y: visible;
        min-height: auto;
    }
    
    .saved-vocab-activity-panel {
        overflow: visible;
        min-height: auto;
    }
}

/* Deep Dive Practice */
.deep-dive {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    position: relative;
    overflow: visible;
}

.deep-dive-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.32);
}

.deep-dive-header h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 650;
    color: #0f172a;
}

.deep-dive-header .subtitle {
    margin: 0;
    color: #475569;
    max-width: 640px;
}

.deep-dive-header .back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.deep-dive-tabs {
    display: inline-flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    padding: 0.25rem;
    flex-wrap: wrap;
}

.deep-dive-content {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.deep-dive-list {
    width: 36%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.35rem;
}

.deep-dive-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.15rem;
    padding: 1rem;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.deep-dive-item:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.deep-dive-item.active {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 26px 52px rgba(37, 99, 235, 0.18);
}

.deep-dive-item h4 {
    margin: 0;
    font-size: 0.98rem;
    color: #0f172a;
}

.deep-dive-item p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
}

.deep-dive-item-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(37, 99, 235, 0.1);
    color: rgba(37, 99, 235, 0.9);
    align-self: flex-start;
    margin-bottom: 0.25rem;
}

.deep-dive-item[data-type="vocabulary"] .deep-dive-item-badge {
    background: rgba(16, 185, 129, 0.1);
    color: rgba(16, 185, 129, 0.9);
}

.deep-dive-item[data-type="question"] .deep-dive-item-badge {
    background: rgba(168, 85, 247, 0.1);
    color: rgba(168, 85, 247, 0.9);
}

.deep-dive-panel {
    flex: 1;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 248, 255, 0.93) 55%, rgba(235, 239, 246, 0.9) 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.35rem;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: visible;
    backdrop-filter: blur(18px);
}

.dd-right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-radius: 1.35rem;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.96) 55%, rgba(235, 240, 248, 0.94) 100%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 28px 58px rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.dd-focus-card {
    flex-shrink: 0;
}

.dd-chat-scroll {
    padding: 0 1.5rem;
}

.dd-fixed-input {
    flex-shrink: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    padding-bottom: 0.25rem;
}

.dd-input-inner {
    padding: 1rem 1.5rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.dd-input-label {
    font-size: 0.9rem;
    color: #0f172a;
}

.dd-question-input {
    width: 100%;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.97);
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    height: 120px;
    max-height: 160px;
    overflow-y: auto;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dd-question-input::placeholder {
    color: rgba(100, 116, 139, 0.8);
}

.dd-question-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dd-input-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 1024px) {
    .dd-right-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .dd-right-panel {
        min-height: 520px;
    }
}

.deep-dive-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    color: #475569;
    padding: 2rem 1.5rem;
    background: rgba(226, 232, 240, 0.32);
    border-radius: 1.15rem;
}

.deep-dive-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
}

.deep-dive-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: static;
    background: transparent;
}

.deep-dive-summary h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #0f172a;
}

.deep-dive-summary p {
    margin: 0;
    line-height: 1.5;
    color: #1f2937;
}

.deep-dive-meta {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
}

.deep-dive-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 0 2rem;
    margin: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    overscroll-behavior: contain;
}

.deep-dive-bubble {
    max-width: 85%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    line-height: 1.5;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
}

.deep-dive-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #f8fafc;
}

.deep-dive-bubble.tutor {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.16);
    color: #0f172a;
}

.deep-dive-bubble .timestamp {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(15, 23, 42, 0.6);
}

.deep-dive-input {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding-top: 1.25rem;
}

.deep-dive-input label {
    font-weight: 600;
    color: var(--text-primary);
}

.deep-dive-input textarea {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.85rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.deep-dive-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.deep-dive-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.deep-dive-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 1.25rem;
    background: rgba(226, 232, 240, 0.4);
    color: #475569;
}

.deep-dive-empty i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

@media (max-width: 1024px) {
    .deep-dive-content {
        flex-direction: column;
    }

    .deep-dive-list {
        width: 100%;
        max-width: none;
        max-height: 240px;
    }

    .deep-dive-panel {
        min-height: auto;
    }

    .deep-dive-summary {
        flex-direction: column;
    }
}

.deep-dive-history .hint {
    align-self: center;
    color: #64748b;
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
}

.deep-dive-bubble.user .timestamp,
.deep-dive-bubble.tutor .timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.deep-dive-bubble.tutor .timestamp {
    color: rgba(15, 23, 42, 0.5);
}

.deep-dive-actions .shake {
    animation: shake 0.3s linear;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}

/* Knowledge Base */
.knowledge-base {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 1.75rem;
    background: var(--surface-color);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    position: relative;
    overflow: visible;
}

.knowledge-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.knowledge-header .header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.knowledge-header h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 650;
    color: #0f172a;
}

.knowledge-header .subtitle {
    margin: 0;
    color: #475569;
    max-width: 720px;
}

.knowledge-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.knowledge-search {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem 0.6rem 0.95rem;
    border-radius: 0.95rem;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.search-input-group i {
    color: #64748b;
    font-size: 0.95rem;
}

.search-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
}

.search-input-group input::placeholder {
    color: #94a3b8;
}

.search-input-group:focus-within {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.18);
    background: rgba(255, 255, 255, 0.98);
}

#knowledgeSearchClear {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(59, 130, 246, 0.14);
    color: var(--primary-dark);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#knowledgeSearchClear:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

#knowledgeSearchClear i {
    margin: 0;
    font-size: 0.9rem;
}

.knowledge-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.knowledge-filters .filter-chip {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.35rem 0.75rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.knowledge-filters .filter-chip input:checked + span {
    color: #0f172a;
    font-weight: 600;
}

.knowledge-filters .filter-chip input:checked + span .count {
    background: rgba(59, 130, 246, 0.16);
}

.knowledge-filters .filter-chip:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.filter-chip span .count,
.filter-chip span em.count {
    font-style: normal;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-dark);
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.filter-chip input:checked + span .count {
    background: var(--primary-color);
    color: var(--text-primary);
}

.knowledge-content {
    display: flex;
    gap: 1.5rem;
}

.knowledge-list {
    width: 38%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.35rem;
}

.knowledge-list .hint {
    padding: 1rem;
    text-align: center;
    color: #475569;
    background: rgba(255, 255, 255, 0.8);
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: 1rem;
}

[data-theme="dark"] .knowledge-list .hint {
    color: rgba(226, 232, 240, 0.75);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(59, 130, 246, 0.25);
}

.knowledge-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.15rem;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.knowledge-item:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.knowledge-item.active {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 26px 52px rgba(37, 99, 235, 0.18);
}

.knowledge-item h4 {
    margin: 0;
    font-size: 0.98rem;
    color: #0f172a;
}

.knowledge-item p {
    margin: 0;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
}

.knowledge-item .meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.knowledge-detail {
    flex: 1;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.35rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.knowledge-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    color: #475569;
    padding: 2rem 1.5rem;
    background: rgba(226, 232, 240, 0.32);
    border-radius: 1.15rem;
}

.knowledge-placeholder i {
    font-size: 2.1rem;
    color: var(--primary-color);
}

.knowledge-entry {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

.knowledge-entry .knowledge-vocab-word {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.knowledge-entry .knowledge-vocab-translation {
    margin-top: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.knowledge-entry .knowledge-vocab-context {
    margin: 0.75rem 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

.knowledge-entry .knowledge-vocab-context-explained {
    margin: 0.5rem 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-word {
    color: rgba(226, 232, 240, 0.96);
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-translation {
    color: rgba(147, 197, 253, 0.95);
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-context {
    color: rgba(203, 213, 225, 0.78);
}

[data-theme="dark"] .knowledge-entry .knowledge-vocab-context-explained {
    color: rgba(226, 232, 240, 0.85);
}

.knowledge-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    background: inherit;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.05);
    z-index: 1;
}

.knowledge-entry-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
}

.knowledge-entry p {
    margin: 0;
    line-height: 1.6;
    color: #1f2937;
}

.knowledge-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

.knowledge-entry-meta span {
    background: rgba(148, 163, 184, 0.2);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}

.knowledge-entry-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    padding-top: 0.75rem;
    background: inherit;
    margin-top: auto;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 -12px 20px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .knowledge-base .filter-chip {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
    border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .knowledge-base .filter-chip input:checked + span {
    color: var(--text-primary);
    font-weight: 600;
}

[data-theme="dark"] .knowledge-base .filter-chip input:checked + span .count {
    background: rgba(96, 165, 250, 0.25);
    color: var(--text-primary);
}

[data-theme="dark"] .knowledge-base {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .saved-practice-panel {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.9) 0%, rgba(18, 28, 46, 0.92) 55%, rgba(24, 36, 58, 0.94) 100%);
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 30px 68px rgba(2, 6, 23, 0.65);
}

[data-theme="dark"] .saved-panel {
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.92) 0%, rgba(18, 28, 48, 0.94) 50%, rgba(22, 34, 56, 0.95) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 30px 70px rgba(2, 6, 23, 0.65);
}

[data-theme="dark"] .saved-tab {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .saved-tab.active {
    background: rgba(30, 41, 59, 0.9);
    color: rgba(248, 250, 252, 0.96);
}

[data-theme="dark"] .saved-tag {
    background: rgba(59, 130, 246, 0.2);
    color: rgba(191, 219, 254, 0.95);
}

[data-theme="dark"] .saved-focus-toggle {
    background: rgba(71, 85, 105, 0.4);
}

[data-theme="dark"] .saved-focus-btn {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .saved-focus-btn.active {
    background: rgba(30, 41, 59, 0.92);
    color: rgba(248, 250, 252, 0.96);
}

[data-theme="dark"] .saved-focus-hint {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .saved-meta-line {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .sc-feedback {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(59, 130, 246, 0.3);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .sc-feedback h4 {
    color: rgba(147, 197, 253, 0.95);
}

[data-theme="dark"] .saved-tab {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .saved-tab.active {
    background: rgba(30, 41, 59, 0.9);
    color: rgba(248, 250, 252, 0.96);
}

[data-theme="dark"] .saved-meta-line {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .sc-header {
    background: linear-gradient(140deg, rgba(30, 41, 59, 0.78) 0%, rgba(28, 37, 59, 0.82) 100%);
    border-bottom-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .sc-header-top h3 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .sc-header-meta {
    color: rgba(148, 163, 184, 0.75);
}

[data-theme="dark"] .sc-reminder {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.22) 0%, rgba(14, 165, 233, 0.18) 100%);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .sc-reminder h4,
[data-theme="dark"] .sc-reminder p {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .saved-question-context {
    border-top-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .saved-question-context h5 {
    color: rgba(203, 213, 225, 0.85);
}

[data-theme="dark"] .saved-question-context p {
    color: rgba(148, 163, 184, 0.8);
}

[data-theme="dark"] .saved-question-original {
    border-top-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .knowledge-detail {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.82) 0%, rgba(17, 24, 39, 0.94) 65%, rgba(24, 33, 52, 0.96) 100%);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 26px 60px rgba(2, 6, 23, 0.6);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry-meta span {
    background: rgba(59, 130, 246, 0.28);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry-actions {
    border-top-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 -14px 26px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry-header {
    border-bottom-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 14px 26px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry p {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry h3 {
    color: rgba(226, 232, 240, 0.96);
}

[data-theme="dark"] .knowledge-detail .knowledge-entry {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(96, 165, 250, 0.18);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-base::before,
[data-theme="dark"] .knowledge-base::after {
    content: none;
}

[data-theme="dark"] .knowledge-search {
    background: rgba(17, 24, 39, 0.85);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
}

[data-theme="dark"] .search-input-group {
    background: rgba(17, 24, 39, 0.92);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .search-input-group i {
    color: rgba(148, 163, 184, 0.75);
}

[data-theme="dark"] .search-input-group input {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .search-input-group input::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

[data-theme="dark"] .search-input-group:focus-within {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.65);
    background: rgba(17, 24, 39, 0.97);
}

[data-theme="dark"] #knowledgeSearchClear {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(37, 99, 235, 0.28);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] #knowledgeSearchClear:hover {
    background: rgba(37, 99, 235, 0.38);
    border-color: rgba(96, 165, 250, 0.55);
}

[data-theme="dark"] .knowledge-entry {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-placeholder {
    background: rgba(30, 41, 59, 0.55);
    color: rgba(226, 232, 240, 0.85);
}

[data-theme="dark"] .knowledge-entry-meta span {
    background: rgba(96, 165, 250, 0.2);
    color: var(--text-primary);
}

[data-theme="dark"] .knowledge-item {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-item h4 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .knowledge-item p {
    color: rgba(203, 213, 225, 0.8);
}

[data-theme="dark"] .knowledge-item .meta {
    color: rgba(148, 163, 184, 0.85);
}

[data-theme="dark"] .knowledge-entry-header,
[data-theme="dark"] .knowledge-entry-actions {
    background: rgba(17, 24, 39, 0.92);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: none;
}

[data-theme="dark"] .knowledge-entry-header {
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .knowledge-entry-actions {
    box-shadow: 0 -12px 24px rgba(2, 6, 23, 0.5);
}

[data-theme="dark"] .knowledge-entry-header h3 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .knowledge-entry p {
    color: rgba(226, 232, 240, 0.88);
}

[data-theme="dark"] .deep-dive {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .deep-dive::before,
[data-theme="dark"] .deep-dive::after {
    content: none;
}

[data-theme="dark"] .deep-dive-header h2 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .deep-dive-header .subtitle {
    color: rgba(203, 213, 225, 0.75);
}

[data-theme="dark"] .deep-dive-list .hint {
    background: rgba(30, 41, 59, 0.6);
    color: rgba(226, 232, 240, 0.78);
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .deep-dive-item {
    background: rgba(15, 23, 42, 0.68);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .deep-dive-item h4 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .deep-dive-item p {
    color: rgba(203, 213, 225, 0.82);
}

[data-theme="dark"] .deep-dive-item .meta {
    color: rgba(148, 163, 184, 0.85);
}

[data-theme="dark"] .deep-dive-item-badge {
    background: rgba(59, 130, 246, 0.2);
    color: rgba(147, 197, 253, 0.95);
}

[data-theme="dark"] .deep-dive-item[data-type="vocabulary"] .deep-dive-item-badge {
    background: rgba(16, 185, 129, 0.2);
    color: rgba(110, 231, 183, 0.95);
}

[data-theme="dark"] .deep-dive-item[data-type="question"] .deep-dive-item-badge {
    background: rgba(168, 85, 247, 0.2);
    color: rgba(196, 181, 253, 0.95);
}

[data-theme="dark"] .deep-dive-panel {
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.9) 0%, rgba(18, 28, 48, 0.92) 55%, rgba(23, 36, 58, 0.95) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 32px 70px rgba(2, 6, 23, 0.65);
}

[data-theme="dark"] .deep-dive-placeholder {
    background: rgba(30, 41, 59, 0.55);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .deep-dive-summary h3 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .deep-dive-summary p,
[data-theme="dark"] .deep-dive-meta {
    color: rgba(203, 213, 225, 0.78);
}

[data-theme="dark"] .deep-dive-summary {
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.3);
}

[data-theme="dark"] .deep-dive-history {
    background: transparent;
    border-color: transparent;
}

[data-theme="dark"] .deep-dive-bubble.user {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.92) 100%);
    color: rgba(248, 250, 252, 0.95);
}

[data-theme="dark"] .deep-dive-bubble.tutor {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(59, 130, 246, 0.35);
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .deep-dive-bubble .timestamp {
    color: rgba(148, 163, 184, 0.8);
}

[data-theme="dark"] .deep-dive-input textarea {
    background: rgba(17, 24, 39, 0.78);
    border-color: rgba(59, 130, 246, 0.32);
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .deep-dive-input textarea:focus {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .deep-dive-input {
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .deep-dive-empty {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(59, 130, 246, 0.25);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .saved-practice {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .saved-practice::before,
[data-theme="dark"] .saved-practice::after {
    content: none;
}

[data-theme="dark"] .dd-right-panel {
    background: linear-gradient(160deg, rgba(13, 20, 34, 0.96) 0%, rgba(15, 24, 40, 0.94) 55%, rgba(17, 28, 46, 0.92) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 32px 70px rgba(2, 6, 23, 0.7);
}

[data-theme="dark"] .dd-fixed-input {
    background: rgba(15, 22, 36, 0.92);
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .dd-input-label {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .dd-question-input {
    background: rgba(17, 24, 39, 0.78);
    border-color: rgba(59, 130, 246, 0.28);
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .dd-question-input::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

[data-theme="dark"] .dd-question-input:focus {
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .saved-practice::before {
    background: radial-gradient(circle at 30% 35%, rgba(59, 130, 246, 0.2), transparent 60%);
}

[data-theme="dark"] .saved-practice::after {
    background: radial-gradient(circle at 75% 65%, rgba(14, 165, 233, 0.2), transparent 62%);
}

[data-theme="dark"] .saved-practice-header h2 {
    color: rgba(226, 232, 240, 0.95);
}

[data-theme="dark"] .saved-practice-header .subtitle {
    color: rgba(203, 213, 225, 0.75);
}

[data-theme="dark"] .saved-items-list {
    border-color: rgba(59, 130, 246, 0.22);
    background: rgba(17, 24, 39, 0.68);
}

[data-theme="dark"] .saved-item-card {
    background: rgba(17, 24, 39, 0.7);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

[data-theme="dark"] .saved-item-card .item-text {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .saved-item-card .card-meta {
    color: rgba(148, 163, 184, 0.85);
}

[data-theme="dark"] .saved-practice-panel {
    background: rgba(17, 24, 39, 0.82);
    border-color: rgba(59, 130, 246, 0.22);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.6);
}

[data-theme="dark"] .practice-placeholder {
    background: rgba(30, 41, 59, 0.55);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .practice-session-header h3 {
    color: rgba(226, 232, 240, 0.92);
}

[data-theme="dark"] .practice-session-header .practice-meta {
    color: rgba(203, 213, 225, 0.78);
}

[data-theme="dark"] .practice-reference {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.32);
}

[data-theme="dark"] .practice-reference p {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .practice-input label,
[data-theme="dark"] .practice-input textarea,
[data-theme="dark"] .practice-feedback .feedback-content {
    color: rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .practice-input textarea {
    background: rgba(17, 24, 39, 0.78);
    border-color: rgba(96, 165, 250, 0.32);
}

[data-theme="dark"] .practice-input textarea:focus {
    border-color: rgba(125, 211, 252, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .practice-feedback {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .practice-actions {
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .practice-session-body {
    border-color: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .saved-practice-empty {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(59, 130, 246, 0.25);
    color: rgba(226, 232, 240, 0.82);
}

[data-theme="dark"] .practice-session-header {
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.48);
    border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .practice-session-body {
    background: rgba(17, 24, 39, 0.68);
    border-radius: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1rem 0.75rem 1rem 1rem;
}

[data-theme="dark"] .practice-input {
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .knowledge-item:hover,
[data-theme="dark"] .knowledge-item.active {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.45);
}

[data-theme="dark"] .knowledge-entry-actions .btn,
[data-theme="dark"] .knowledge-entry-actions .btn-outline {
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-primary);
}

.knowledge-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 1.25rem;
    background: rgba(226, 232, 240, 0.4);
    color: #475569;
}

.knowledge-empty i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.modal-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.75rem 0 0;
}

@media (max-width: 1024px) {
    .knowledge-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .knowledge-actions {
        justify-content: flex-start;
    }

    .knowledge-content {
        flex-direction: column;
    }

    .knowledge-list {
        width: 100%;
        max-width: none;
        padding-right: 0;
    }

    .knowledge-detail {
        min-height: 0;
    }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    justify-content: space-between;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
    padding: 0.2rem clamp(0.75rem, 5vw, 1.5rem) calc(0.2rem + env(safe-area-inset-bottom, 0px)) clamp(0.75rem, 5vw, 1.5rem);
    min-height: var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px)));
    z-index: 1400;
}

.bottom-nav-item {
    flex: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.3rem 0.2rem;
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.bottom-nav-item i {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

.bottom-nav-item span {
    line-height: 1.1;
}

.bottom-nav-item:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
}

.bottom-nav-item:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.bottom-nav-item.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
}

.bottom-nav-item.active i {
    transform: scale(1.05);
}

[data-theme="dark"] .mobile-bottom-nav {
    background: var(--surface-color);
    border-top-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .bottom-nav-item {
    color: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .bottom-nav-item:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .bottom-nav-item.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.18);
    box-shadow: 0 8px 16px rgba(96, 165, 250, 0.2);
}

@media (max-width: 1024px) {
    .mobile-bottom-nav {
        display: flex;
    }

    .content-area.chat-mode {
        padding-bottom: calc(var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + 5.5rem);
    }

    .chat-input-container {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: min(640px, calc(100% - 2.25rem));
        max-width: calc(100% - 1.5rem);
        bottom: calc(var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + var(--mobile-nav-gap, 0rem));
        margin-bottom: 0;
        z-index: 1500;
    }

    .chat-messages {
        padding-bottom: calc(7rem + var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + 0.5rem);
    }
}

@media (max-width: 640px) {
    .chat-input-container {
        width: calc(100% - 1.5rem);
        max-width: calc(100% - 1.5rem);
        bottom: calc(var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + var(--mobile-nav-gap, 0rem));
    }

    .chat-messages {
        padding-bottom: calc(6.5rem + var(--mobile-nav-height, calc(3.75rem + env(safe-area-inset-bottom, 0px))) + 0.5rem);
    }
}

@media (max-width: 480px) {
    .bottom-nav-item {
        font-size: 0.65rem;
        padding: 0.25rem 0.15rem;
        gap: 0.1rem;
    }

    .bottom-nav-item i {
        font-size: 0.95rem;
    }
}

/* Temporary visibility controls for in-progress pages */
.nav-menu a[href="/community"],
.nav-menu a[href="/help-center"],
.nav-menu a[href="/cookie-policy"] {
    display: none !important;
}

footer .footer-section ul li:has(> a[href="/community"]),
footer .footer-section ul li:has(> a[href="/help-center"]),
footer .footer-section ul li:has(> a[href="/cookie-policy"]) {
    display: none !important;
}
[data-theme="dark"] .deep-dive-history .hint {
    color: rgba(203, 213, 225, 0.78);
}
/* Topic picker */
.chat-topic-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.chat-topic-bar .topic-bar-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
}

.topic-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topic-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.topic-bar-name {
    font-weight: 600;
    color: var(--text-primary);
}

.topic-bar-tag {
    font-size: 0.8rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.12));
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.topic-bar-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.08));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.topic-bar-tag:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.topic-bar-tag:hover::before {
    opacity: 1;
}

[data-theme="dark"] .topic-bar-tag {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(59, 130, 246, 0.15));
    border-color: rgba(96, 165, 250, 0.25);
    color: #93c5fd;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .topic-bar-tag::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.1));
}

[data-theme="dark"] .topic-bar-tag:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(59, 130, 246, 0.2));
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-outline:hover::before {
    opacity: 0;
}

.btn-outline:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.btn-outline:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.btn-outline:hover i {
    transform: scale(1.1);
}

.btn-outline span,
.btn-outline {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .btn-outline {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .btn-outline::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}

[data-theme="dark"] .btn-outline:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(96, 165, 250, 0.5);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-outline:focus-visible {
    outline-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25), 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-outline:disabled,
.btn-outline.disabled,
.btn-outline.rename-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
    background: var(--surface-color);
    color: var(--text-tertiary);
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.btn-outline:disabled:hover,
.btn-outline.disabled:hover,
.btn-outline.rename-disabled:hover {
    background: var(--surface-color);
    color: var(--text-tertiary);
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.btn-outline:disabled::before,
.btn-outline.disabled::before,
.btn-outline.rename-disabled::before {
    opacity: 0;
}

.btn-outline:disabled i,
.btn-outline.disabled i,
.btn-outline.rename-disabled i {
    transform: none;
    opacity: 0.5;
}

[data-theme="dark"] .btn-outline:disabled,
[data-theme="dark"] .btn-outline.disabled,
[data-theme="dark"] .btn-outline.rename-disabled {
    background: rgba(30, 41, 59, 0.4);
    color: rgba(226, 232, 240, 0.4);
    border-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .btn-outline:disabled:hover,
[data-theme="dark"] .btn-outline.disabled:hover,
[data-theme="dark"] .btn-outline.rename-disabled:hover {
    background: rgba(30, 41, 59, 0.4);
    color: rgba(226, 232, 240, 0.4);
    border-color: rgba(148, 163, 184, 0.1);
}

.btn-compact {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 12px;
}

/* Responsive topic bar elements */
@media (max-width: 768px) {
    .chat-topic-bar {
        padding: 0.85rem 1rem;
        border-radius: 10px;
    }
    
    .topic-bar-tag {
        padding: 0.25rem 0.7rem;
        font-size: 0.75rem;
        border-radius: 10px;
    }
    
    .btn-compact {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
    gap: 0.35rem;
        border-radius: 10px;
    }
}

@media (max-width: 640px) {
    .chat-topic-bar {
        padding: 0.75rem 0.9rem;
        border-radius: 8px;
    }
    
    .topic-bar-tag {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 8px;
    }
    
    .btn-compact {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        gap: 0.3rem;
        border-radius: 8px;
    }
    
    .btn-outline:hover {
        transform: none;
    }
    
    .topic-bar-tag:hover {
        transform: none;
    }
}

.topic-picker-modal .topic-picker-content {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-name-modal input {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-color);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-name-modal input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.chat-name-modal label {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-helper {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.modal-error {
    font-size: 0.85rem;
    color: var(--danger-color);
    margin-top: 0.35rem;
    min-height: 1rem;
}

.topic-picker-header p.modal-eyebrow {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.topic-filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}

.topic-filter-btn {
    border: 1px solid #cbd5f5;
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topic-filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.topic-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.topic-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.topic-card:hover {
    border-color: #cbd5f5;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.topic-card.active {
    border-color: #2563eb;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.2);
}

.topic-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.topic-levels {
    font-size: 0.75rem;
    color: #64748b;
}

.topic-card h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.topic-card p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.topic-chip {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

.topic-focus-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.topic-focus-words span {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.8rem;
    color: #0f172a;
}

.topic-prompts {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.85rem;
    color: #475569;
}

.topic-prompts strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.topic-prompts ul {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.topic-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.topic-selection-summary {
    font-size: 0.9rem;
    color: #475569;
}

.topic-selection-summary strong {
    color: #0f172a;
}

.topic-footer-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topic-empty {
    background: #f8fafc;
    border: 1px dashed #cbd5f5;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: #475569;
}

.topic-empty i {
    font-size: 1.5rem;
    color: #2563eb;
}

.topic-empty .hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .chat-topic-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topic-picker-modal .topic-picker-content {
        max-height: 95vh;
    }

    .topic-list {
        grid-template-columns: 1fr;
    }
}
.dark-mode .voice-topic-panel,
[data-theme="dark"] .voice-topic-panel {
    background: rgba(15, 23, 42, 0.92);
    color: var(--text-primary);
}

.dark-mode .voice-topic-card,
[data-theme="dark"] .voice-topic-card {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(148, 163, 184, 0.25);
}

.dark-mode .voice-topic-card.selected,
.dark-mode .voice-topic-card:hover,
.dark-mode .voice-topic-card:focus-visible,
[data-theme="dark"] .voice-topic-card.selected,
[data-theme="dark"] .voice-topic-card:hover,
[data-theme="dark"] .voice-topic-card:focus-visible {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.32);
    box-shadow: 0 14px 26px rgba(14, 116, 144, 0.25);
}

.dark-mode .voice-drill-theme-picker,
[data-theme="dark"] .voice-drill-theme-picker {
    border-top-color: rgba(148, 163, 184, 0.25);
}

.dark-mode .voice-drill-theme-header h5,
[data-theme="dark"] .voice-drill-theme-header h5 {
    color: #e2e8f0;
    font-weight: 700;
}

.dark-mode .voice-drill-theme-header p,
[data-theme="dark"] .voice-drill-theme-header p {
    color: rgba(226, 232, 240, 0.85);
}

.dark-mode .voice-drill-theme-card,
[data-theme="dark"] .voice-drill-theme-card {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text-primary);
}

.dark-mode .voice-drill-theme-card h6,
[data-theme="dark"] .voice-drill-theme-card h6 {
    color: #e2e8f0;
    font-weight: 700;
}

.dark-mode .voice-drill-theme-card p,
[data-theme="dark"] .voice-drill-theme-card p {
    color: rgba(226, 232, 240, 0.75);
}

.dark-mode .voice-drill-theme-hint,
[data-theme="dark"] .voice-drill-theme-hint {
    color: rgba(226, 232, 240, 0.8);
}

.dark-mode .voice-drill-theme-card.selected,
.dark-mode .voice-drill-theme-card:hover,
.dark-mode .voice-drill-theme-card:focus-visible,
[data-theme="dark"] .voice-drill-theme-card.selected,
[data-theme="dark"] .voice-drill-theme-card:hover,
[data-theme="dark"] .voice-drill-theme-card:focus-visible {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.32);
    box-shadow: 0 12px 22px rgba(14, 116, 144, 0.25);
}

.dark-mode .voice-drill-theme-label,
[data-theme="dark"] .voice-drill-theme-label {
    color: rgba(226, 232, 240, 0.9);
}

.dark-mode .voice-level-chip,
[data-theme="dark"] .voice-level-chip {
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-primary);
}

.dark-mode .voice-level-chip.selected,
.dark-mode .voice-level-chip:hover,
.dark-mode .voice-level-chip:focus-visible,
[data-theme="dark"] .voice-level-chip.selected,
[data-theme="dark"] .voice-level-chip:hover,
[data-theme="dark"] .voice-level-chip:focus-visible {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.38);
    color: var(--text-primary);
}

/* ===== Roadmap ===== */
.roadmap-panel {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
[data-theme="dark"] .roadmap-panel {
    background: #0f172a;
    border-color: rgba(248, 250, 252, 0.08);
    box-shadow: none;
}
.roadmap-empty {
    border: 1px dashed rgba(15, 23, 42, 0.2);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}
[data-theme="dark"] .roadmap-empty {
    border-color: rgba(248, 250, 252, 0.25);
}
.roadmap-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: #2563eb;
}
.roadmap-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.roadmap-scope {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
    font-weight: 600;
}
.roadmap-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.roadmap-banner {
    background: rgba(37, 99, 235, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.roadmap-next {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: rgba(15, 23, 42, 0.02);
}
.roadmap-week-list {
    display: grid;
    gap: 16px;
}
.roadmap-week-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 16px;
}
.roadmap-week-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 8px;
}
.roadmap-week-header span {
    color: #94a3b8;
}
.roadmap-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.roadmap-task {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.roadmap-task label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    width: 100%;
    cursor: pointer;
}
.roadmap-task input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}
.roadmap-task button {
    margin-left: auto;
}
.roadmap-modal {
    position: fixed;
    inset: 0;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(18px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 90;
}

/* Hide sidebar when roadmap modal is open */
.roadmap-modal[aria-hidden="false"] ~ .app-container .sidebar,
.app-container:has(.roadmap-modal[aria-hidden="false"]) .sidebar,
body:has(.roadmap-modal[aria-hidden="false"]) .sidebar,
.sidebar.hidden-for-modal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Alternative approach: hide sidebar when modal-open class is on body and roadmap modal is visible */
body.modal-open .roadmap-modal[aria-hidden="false"] ~ .app-container .sidebar,
body.modal-open:has(.roadmap-modal[aria-hidden="false"]) .sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.roadmap-modal[aria-hidden="false"] {
    display: flex;
}
.roadmap-modal-dialog {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 28px;
    width: min(720px, 94vw);
    max-height: min(88vh, 900px);
    padding: clamp(1.8rem, 4vw, 2.6rem);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 3vw, 1.5rem);
}
.roadmap-modal-sm {
    width: min(420px, 92vw);
    padding: clamp(1.6rem, 4vw, 2.2rem);
    gap: 1rem;
}
.roadmap-modal h3 {
    margin: 0;
    font-size: clamp(1.45rem, 2.6vw, 1.7rem);
    font-weight: 700;
    color: #0f172a;
}
.modal-subtitle {
    color: #475569;
    margin: 0 0 clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.55;
}
.modal-close {
    position: absolute;
    top: clamp(0.75rem, 2vw, 1rem);
    right: clamp(0.75rem, 2vw, 1rem);
    border: none;
    background: rgba(15, 23, 42, 0.06);
    font-size: 1.1rem;
    color: #0f172a;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
}
.modal-close:hover,
.modal-close:focus-visible {
    background: rgba(37, 99, 235, 0.16);
    color: #2563eb;
    transform: scale(1.05);
    outline: none;
}
.roadmap-form-grid {
    display: grid;
    gap: 18px;
}
.roadmap-goal-grid,
.roadmap-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.roadmap-goal-option,
.roadmap-skill-grid label {
    position: relative;
    display: block;
    cursor: pointer;
}
.roadmap-goal-option input,
.roadmap-skill-grid label input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}
.roadmap-goal-option span,
.roadmap-skill-grid label span {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(248, 250, 252, 0.92);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    padding: 0.95rem 1.1rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    min-height: 74px;
}
.roadmap-goal-option span::before,
.roadmap-skill-grid label span::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.45);
    background: transparent;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}
.roadmap-skill-grid label span::before {
    border-radius: 8px;
}
.roadmap-goal-option span::after,
.roadmap-skill-grid label span::after {
    display: none;
}
.roadmap-goal-option:hover span,
.roadmap-skill-grid label:hover span {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}
.roadmap-goal-option:focus-within span,
.roadmap-skill-grid label:focus-within span {
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.roadmap-goal-option input:checked + span,
.roadmap-skill-grid label input:checked + span {
    border-color: rgba(37, 99, 235, 0.7);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(191, 219, 254, 0.88));
    box-shadow: 0 22px 44px rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
}
.roadmap-goal-option input:checked + span::before,
.roadmap-skill-grid label input:checked + span::before {
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.roadmap-goal-option input:checked + span::after,
.roadmap-skill-grid label input:checked + span::after {
    content: '';
    opacity: 0;
    transform: translateY(-4px);
}
.roadmap-form {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2.5vw, 1.5rem);
}
.roadmap-form .stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.roadmap-form .form-label {
    font-weight: 600;
    color: #0f172a;
}
.roadmap-form select,
.roadmap-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(248, 250, 252, 0.92);
    font-size: 1rem;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}
.roadmap-form select {
    background-image: none !important;
    background-repeat: no-repeat;
    padding-right: 1.1rem;
}
.roadmap-form textarea {
    min-height: 108px;
    resize: vertical;
}
.roadmap-form textarea::placeholder {
    color: rgba(148, 163, 184, 0.78);
}
.roadmap-form select:focus,
.roadmap-form textarea:focus {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
    outline: none;
}
.roadmap-modal .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}
.roadmap-modal .modal-actions .btn-secondary {
    background: rgba(148, 163, 184, 0.14);
    border-color: transparent;
    color: #0f172a;
}
.roadmap-modal .modal-actions .btn-secondary:hover,
.roadmap-modal .modal-actions .btn-secondary:focus-visible {
    background: rgba(148, 163, 184, 0.22);
    color: #0f172a;
}

@media (max-width: 720px) {
    .roadmap-modal-dialog {
        width: min(640px, 96vw);
        padding: clamp(1.5rem, 5vw, 2.2rem);
    }
    .roadmap-goal-grid,
    .roadmap-skill-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .roadmap-form select,
    .roadmap-form textarea {
        font-size: 0.95rem;
    }
}
}
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-primary.btn-small::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
}

.btn-outline.btn-small::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
}

.btn-small:hover::before {
    opacity: 1;
}

.btn-primary.btn-small:hover {
    transform: translateY(-1px);
}

.btn-outline.btn-small:hover {
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-outline.btn-small::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.08));
}
.roadmap-reminder-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--surface-color);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 2rem 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.roadmap-reminder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.roadmap-reminder-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.roadmap-reminder-card:hover::before {
    opacity: 1;
}

.welcome-screen .roadmap-reminder-card {
    width: 100%;
    max-width: 1000px;
    align-self: stretch;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.roadmap-reminder-info {
    position: relative;
    z-index: 1;
}

.roadmap-reminder-info h3 {
    margin: 0.1rem 0 0.5rem;
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.roadmap-reminder-card:hover .roadmap-reminder-info h3 {
    color: var(--primary-color);
}

[data-theme="dark"] .roadmap-reminder-info h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .roadmap-reminder-card:hover .roadmap-reminder-info h3 {
    color: #60a5fa;
}

.roadmap-reminder-info p {
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    line-height: 1.6;
    margin: 0;
    transition: color 0.2s ease;
}

.roadmap-reminder-card:hover .roadmap-reminder-info p {
    color: var(--text-primary);
}

[data-theme="dark"] .roadmap-reminder-info p {
    color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .roadmap-reminder-card:hover .roadmap-reminder-info p {
    color: rgba(226, 232, 240, 0.9);
}

.roadmap-reminder-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: clamp(0.7rem, 1.2vw, 0.75rem);
    font-weight: 600;
    color: var(--primary-color);
    display: inline-block;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.roadmap-reminder-card:hover .roadmap-reminder-label {
    color: var(--primary-dark);
}

[data-theme="dark"] .roadmap-reminder-label {
    color: #60a5fa;
}

[data-theme="dark"] .roadmap-reminder-card:hover .roadmap-reminder-label {
    color: #93c5fd;
}

.roadmap-reminder-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .roadmap-reminder-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .roadmap-reminder-card::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
}

[data-theme="dark"] .roadmap-reminder-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Responsive Welcome Screen & Action Cards */
@media (max-width: 768px) {
    .welcome-screen {
        padding: 1.5rem 1rem;
    }
    
    .welcome-title {
        margin-bottom: 0.75rem;
    }
    
    .welcome-subtitle {
        margin-bottom: 2rem;
    }
    
    .action-cards {
        gap: clamp(0.75rem, 2vw, 1.25rem);
        max-width: 100%;
    }
    
    .action-cards.two-card-tight {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 1rem;
    }
    
    .action-cards.three-card {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 1rem;
    }
    
    .action-card {
        padding: 2rem 1.5rem;
        min-height: 240px;
        border-radius: 16px;
    }
    
    .action-card:hover {
        transform: translateY(-4px);
    }
    
    .action-card i {
        margin-bottom: 1rem;
    }
    
    .roadmap-reminder-card {
        padding: 1.25rem 1.25rem;
        margin-top: 1.5rem;
        border-radius: 14px;
    }
    
    .roadmap-reminder-actions {
        gap: 0.6rem;
    }
    
    .btn-small {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .btn-small:hover {
        transform: none;
    }
}

@media (max-width: 640px) {
    .welcome-screen {
        padding: 1.25rem 0.75rem;
    }
    
    .welcome-title {
        margin-bottom: 0.5rem;
    }
    
    .welcome-subtitle {
        margin-bottom: 1.75rem;
    }
    
    .action-cards {
        gap: 0.75rem;
    }
    
    .action-cards.two-card-tight {
        gap: 0.75rem;
    }
    
    .action-card {
        padding: 1.75rem 1.25rem;
        min-height: 220px;
        border-radius: 14px;
        width: 100%;
    }
    
    .action-card:hover {
        transform: translateY(-2px);
    }
    
    .action-card:active {
        transform: translateY(0);
    }
    
    .action-card i {
        font-size: 1.5rem;
        margin-bottom: 0.85rem;
    }
    
    .action-card h3 {
        margin-bottom: 0.6rem;
    }
    
    .roadmap-reminder-card {
        padding: 1rem 1rem;
        margin-top: 1.25rem;
        border-radius: 12px;
        gap: 0.85rem;
    }
    
    .roadmap-reminder-info h3 {
        margin: 0.1rem 0 0.4rem;
    }
    
    .roadmap-reminder-actions {
        gap: 0.5rem;
        flex-direction: column;
        width: 100%;
    }
    
    .roadmap-reminder-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-small {
        padding: 0.4rem 0.85rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
}

.settings-section-highlight {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    border-radius: 0.75rem;
    transition: box-shadow 0.3s ease;
}
.roadmap-summary-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.roadmap-summary-eyebrow {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #64748b;
}

.roadmap-summary-copy h5 {
    margin: 0.25rem 0 0.4rem;
    font-size: 1.1rem;
    color: #0f172a;
}

.roadmap-summary-meta {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
}

.roadmap-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.roadmap-summary-actions .btn {
    min-width: 150px;
}

[data-theme="dark"] .roadmap-summary-card {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: none;
}

.roadmap-detail-modal .modal-body {
    padding-top: 0;
}

.roadmap-detail-modal {
    width: min(780px, 96vw);
}

.roadmap-detail-body {
    max-height: calc(80vh - 3rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}
