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

:root {
    /* Light Mode (Default) */
    --primary-color: #38bdf8;
    --secondary-color: #2dd4bf;
    --success-color: #78c2ad;
    --white: #FFFFFF;
    --danger-color: #f48fb1;
    --warning-color: #ffe082;
    --info-color: #66d9ef;
    --light-gray: #f8f9fa;
    --dark-gray: #2f3b46;
    --border-radius: 18px;
    --shadow: 0 2px 10px rgba(77, 208, 225, 0.2);
    --transition: all 0.3s ease;

    /* Semantic Colors */
    --bg-body: linear-gradient(135deg, #fff7c4 0%, #ffd6e7 45%, #b3ecff 100%);
    --bg-card: #fffdf7;
    --text-main: #1f2a37;
    --text-muted: #536471;
    --border-color: #bcecf4;
    --input-bg: #ffffff;
}

/* Dark Mode Variables */
body.dark-mode {
    --primary-color: #38bdf8;
    --secondary-color: #2dd4bf;
    --success-color: #34d399;
    --danger-color: #f472b6;
    --warning-color: #fbbf24;
    --info-color: #38bdf8;
    --bg-body: linear-gradient(135deg, #08131f 0%, #10273a 45%, #1b1730 100%);
    --bg-card: #112133;
    --text-main: #e6f7ff;
    --text-muted: #9fd0df;
    --border-color: #1f3b52;
    --input-bg: #173149;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}



.app-boot-splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--bg-body);
    z-index: 10000;
}

.app-boot-logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
    animation: splashPulse 1.2s ease-in-out infinite;
}

.app-boot-splash p {
    color: var(--text-main);
    font-weight: 600;
}

.app-boot-splash.hidden {
    display: none;
}

@keyframes splashPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* Dark Mode Overrides for Hardcoded Styles */
body.dark-mode .dropdown-menu {
    background: #2d3748;
    border-color: var(--border-color);
}

body.dark-mode .modal-content {
    background-color: var(--bg-card);
}

body.dark-mode .note-card-modal {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .profile-content {
    background: var(--bg-card);
}

body.dark-mode .chat-wrapper {
    background: var(--bg-card);
}

body.dark-mode .message-content {
    background: var(--bg-card);
}

body.dark-mode .chat-input-wrapper {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .view-note-btn {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
}

body.dark-mode .chat-message {
    background: var(--bg-card);
}

body.dark-mode .chat-input {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body.dark-mode .dash-note-item {
    background: var(--bg-card);
}

body.dark-mode .card {
    background: var(--bg-card);
}

body.dark-mode .auth-card {
    background: var(--bg-card);
}

body.dark-mode .dash-card {
    background: var(--bg-card);
}

/* Additional dark mode fixes */
body.dark-mode .dropdown-item {
    color: var(--text-main);
    border-color: var(--border-color);
}

body.dark-mode .dropdown-item:hover {
    background-color: var(--input-bg);
}

body.dark-mode .todo-item {
    background: var(--bg-card);
}

body.dark-mode .btn-secondary {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-main);
}

body.dark-mode .btn-secondary:hover {
    background-color: #374151;
}

body.dark-mode .form-control:focus {
    background-color: var(--input-bg);
    color: var(--text-main);
    border-color: var(--primary-color);
}

body.dark-mode .nav-buttons .btn-secondary {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-main);
}

body.dark-mode header {
    background: var(--bg-card);
}

body.dark-mode .mobile-tab-dropdown {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(30, 41, 59, 0.9));
    border-color: rgba(148, 163, 184, 0.42);
    color: var(--text-main);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.38);
}

body.dark-mode .mobile-tab-dropdown-menu {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
}

body.dark-mode .mobile-tab-dropdown-item {
    color: #e5e7eb;
}

body.dark-mode .mobile-tab-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--focus-text-color);
}

body.dark-mode .tabs {
    background: var(--bg-card);
}

body.dark-mode .tab {
    background: var(--input-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

body.dark-mode .tab.active {
    background: var(--primary-color);
    color: white;
}

body.dark-mode .tab:hover {
    background: #374151;
}

body.dark-mode .tab.active:hover {
    background: var(--primary-color);
}

body.dark-mode .mobile-nav-group {
    border-top-color: rgba(156, 163, 175, 0.35);
}

body.dark-mode .mobile-welcome-text {
    color: var(--text-main);
}

body.dark-mode .mobile-install-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: var(--focus-text-color);
}

body.dark-mode .mobile-install-btn:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

body.dark-mode .mobile-logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff5f5;
}

body.dark-mode .mobile-logout-btn:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
}

/* Text Color Fixes for Dark Mode */
body.dark-mode .dropdown-item {
    color: var(--text-main);
}

body.dark-mode .close-btn {
    color: var(--text-main);
}

body.dark-mode .note-card-modal .note-meta {
    color: var(--text-muted);
}

body.dark-mode .privacy-text {
    color: var(--text-muted);
}

body.dark-mode .message-time {
    color: var(--text-muted);
}

body.dark-mode .privacy-notice p {
    color: var(--text-muted);
}

body.dark-mode .task-meta {
    color: var(--text-muted);
}

body.dark-mode .delete-btn {
    color: var(--text-muted);
}

body.dark-mode .motivation-meta {
    color: var(--text-muted);
}

body.dark-mode .chat-message .message-time {
    color: var(--text-muted);
}

body.dark-mode .note-meta {
    color: var(--text-muted);
}

body.dark-mode .empty-state {
    color: var(--text-muted);
}

body.dark-mode .modal-header .close-btn {
    color: white;
}

body.dark-mode .modal-header .close-btn:hover {
    color: #f0f0f0;
}

/* Additional text fixes */
body.dark-mode .form-group label {
    color: var(--text-main);
}

body.dark-mode .section-header h4 {
    color: var(--text-main);
}

body.dark-mode .btn-primary {
    color: white;
}

body.dark-mode .btn-link {
    color: var(--primary-color);
}

body.dark-mode .btn-link:hover {
    color: var(--secondary-color);
}

body.dark-mode .alert-info {
    background-color: #1e3a5f;
    border-color: var(--primary-color);
    color: var(--text-main);
}

body.dark-mode .alert-success {
    background-color: #1e3a2f;
    border-color: var(--success-color);
    color: var(--text-main);
}

body.dark-mode .alert-warning {
    background-color: #3a2e1e;
    border-color: var(--warning-color);
    color: var(--text-main);
}

body.dark-mode .alert-danger {
    background-color: #3a1e1e;
    border-color: var(--danger-color);
    color: var(--text-main);
}

/* Fix for specific text elements */
body.dark-mode .todo-item h4,
body.dark-mode .todo-item p,
body.dark-mode .dash-task-item h4,
body.dark-mode .dash-task-item p {
    color: var(--text-main);
}

body.dark-mode .dash-note-item {
    color: var(--text-main);
}

body.dark-mode .stat-box h2,
body.dark-mode .stat-box p {
    color: var(--text-main);
}

body.dark-mode .quote,
body.dark-mode .quote-author {
    color: var(--text-main);
}

body.dark-mode .current-affairs-item h4,
body.dark-mode .current-affairs-item p {
    color: var(--text-main);
}

body.dark-mode .event-item h4,
body.dark-mode .event-item p {
    color: var(--text-main);
}

/* Fix for links and interactive text */
body.dark-mode a {
    color: var(--primary-color);
}

body.dark-mode a:hover {
    color: var(--secondary-color);
}

/* Fix for placeholder text */
body.dark-mode .form-control::placeholder {
    color: var(--text-muted);
}

/* Fix for select options */
body.dark-mode select {
    color: var(--text-main);
}

body.dark-mode select option {
    background-color: var(--input-bg);
    color: var(--text-main);
}

/* Fix for textarea */
body.dark-mode textarea {
    color: var(--text-main);
}

/* Fix for table elements if any */
body.dark-mode table {
    color: var(--text-main);
}

body.dark-mode th,
body.dark-mode td {
    border-color: var(--border-color);
}

/* Fix for code blocks if any */
body.dark-mode code {
    background-color: var(--input-bg);
    color: var(--text-main);
}

/* Fix for pre tags if any */
body.dark-mode pre {
    background-color: var(--input-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

/* Universal Text Color Conversion System */
/* Convert black text to white in dark mode */
body.dark-mode * {
    color: inherit !important;
}

/* Force specific color conversions for dark mode */
body.dark-mode,
body.dark-mode *,
body.dark-mode [style*="color: #000"],
body.dark-mode [style*="color: #000000"],
body.dark-mode [style*="color: black"],
body.dark-mode [style*="color: rgb(0,0,0)"],
body.dark-mode [style*="color: rgba(0,0,0"] {
    color: var(--text-main) !important;
}

/* Convert white text to black in light mode */
body:not(.dark-mode) *,
body:not(.dark-mode) [style*="color: #fff"],
body:not(.dark-mode) [style*="color: #ffffff"],
body:not(.dark-mode) [style*="color: white"],
body:not(.dark-mode) [style*="color: rgb(255,255,255)"],
body:not(.dark-mode) [style*="color: rgba(255,255,255"] {
    color: var(--text-main) !important;
}

/* Ensure important text elements always use theme colors */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode span,
body.dark-mode div,
body.dark-mode label,
body.dark-mode button,
body.dark-mode a,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode li,
body.dark-mode td,
body.dark-mode th {
    color: var(--text-main) !important;
}

/* Handle inline styles and dynamic content */
body.dark-mode [style*="color"] {
    color: var(--text-main) !important;
}

/* Preserve specific colored elements that should stay colored */
body.dark-mode .btn-primary,
body.dark-mode .btn-success,
body.dark-mode .btn-danger,
body.dark-mode .btn-warning,
body.dark-mode .btn-info,
body.dark-mode .text-primary,
body.dark-mode .text-success,
body.dark-mode .text-danger,
body.dark-mode .text-warning,
body.dark-mode .text-info {
    color: inherit !important;
}

/* Light mode text color fixes */
body:not(.dark-mode) h1,
body:not(.dark-mode) h2,
body:not(.dark-mode) h3,
body:not(.dark-mode) h4,
body:not(.dark-mode) h5,
body:not(.dark-mode) h6,
body:not(.dark-mode) p,
body:not(.dark-mode) span,
body:not(.dark-mode) div,
body:not(.dark-mode) label,
body:not(.dark-mode) button,
body:not(.dark-mode) a,
body:not(.dark-mode) input,
body:not(.dark-mode) textarea,
body:not(.dark-mode) select,
body:not(.dark-mode) li,
body:not(.dark-mode) td,
body:not(.dark-mode) th {
    color: var(--text-main) !important;
}

/* Handle inline styles in light mode */
body:not(.dark-mode) [style*="color"] {
    color: var(--text-main) !important;
}

/* JavaScript-based text color detection and conversion */
body.dark-mode::before {
    content: "";
    display: none;
}

body:not(.dark-mode)::before {
    content: "";
    display: none;
}

/* Apply Semantic Colors */
body {
    background: var(--bg-body) !important;
    color: var(--text-main);
}

.card,
.dash-card,
.modal-content,
.stat-box {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}

.form-control {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main) !important;
}

/* Specific overrides for text contrast */
body.dark-mode .text-muted {
    color: var(--text-muted) !important;
}

/* FORCEFUL DARK MODE STYLES - Override Everything */
body.dark-mode {
    background: var(--bg-body) !important;
}

body.dark-mode *,
body.dark-mode *::before,
body.dark-mode *::after {
    color: var(--text-main) !important;
}

/* Force all cards and boxes to be dark */
body.dark-mode .card,
body.dark-mode .dash-card,
body.dark-mode .modal-content,
body.dark-mode .stat-box,
body.dark-mode .auth-card,
body.dark-mode .note-card-modal,
body.dark-mode .profile-content,
body.dark-mode .chat-wrapper,
body.dark-mode .message-content,
body.dark-mode .chat-input-wrapper,
body.dark-mode .view-note-btn,
body.dark-mode .chat-message,
body.dark-mode .chat-input,
body.dark-mode .dash-note-item,
body.dark-mode .todo-item,
body.dark-mode .event-item,
body.dark-mode .current-affairs-item,
body.dark-mode .privacy-notice,
body.dark-mode .task-meta,
body.dark-mode .empty-state,
body.dark-mode .motivation-meta,
body.dark-mode .dropdown-menu,
body.dark-mode .notes-grid,
body.dark-mode .form-group,
body.dark-mode .password-section,
body.dark-mode .profile-section {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force all form elements to be dark */
body.dark-mode .form-control,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force all buttons to have proper colors */
body.dark-mode .btn,
body.dark-mode button {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .btn-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

body.dark-mode .btn-success {
    background-color: var(--success-color) !important;
    color: white !important;
    border-color: var(--success-color) !important;
}

body.dark-mode .btn-danger {
    background-color: var(--danger-color) !important;
    color: white !important;
    border-color: var(--danger-color) !important;
}

body.dark-mode .btn-warning {
    background-color: var(--warning-color) !important;
    color: black !important;
    border-color: var(--warning-color) !important;
}

body.dark-mode .btn-info {
    background-color: var(--info-color) !important;
    color: white !important;
    border-color: var(--info-color) !important;
}

/* Force all text elements to be visible */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode span,
body.dark-mode div,
body.dark-mode label,
body.dark-mode .form-group label,
body.dark-mode .section-header h4,
body.dark-mode .todo-item h4,
body.dark-mode .todo-item p,
body.dark-mode .dash-task-item h4,
body.dark-mode .dash-task-item p,
body.dark-mode .dash-note-item,
body.dark-mode .stat-box h2,
body.dark-mode .stat-box p,
body.dark-mode .quote,
body.dark-mode .quote-author,
body.dark-mode .current-affairs-item h4,
body.dark-mode .current-affairs-item p,
body.dark-mode .event-item h4,
body.dark-mode .event-item p,
body.dark-mode .note-card-modal h4,
body.dark-mode .note-card-modal .note-meta,
body.dark-mode .note-card-modal .note-content,
body.dark-mode .privacy-text,
body.dark-mode .message-time,
body.dark-mode .privacy-notice p,
body.dark-mode .task-meta,
body.dark-mode .delete-btn,
body.dark-mode .motivation-meta,
body.dark-mode .chat-message .message-time,
body.dark-mode .note-meta,
body.dark-mode .empty-state,
body.dark-mode .close-btn {
    color: var(--text-main) !important;
}

/* Force placeholder text */
body.dark-mode .form-control::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Force links */
body.dark-mode a,
body.dark-mode .btn-link {
    color: var(--primary-color) !important;
}

body.dark-mode a:hover,
body.dark-mode .btn-link:hover {
    color: var(--secondary-color) !important;
}

/* Force dropdowns */
body.dark-mode .dropdown-item {
    color: var(--text-main) !important;
    background-color: transparent !important;
}

body.dark-mode .dropdown-item:hover {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
}

/* Force tabs */
body.dark-mode .tab {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .tab.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

body.dark-mode .tab:hover {
    background-color: #374151 !important;
    color: var(--text-main) !important;
}

/* Force header and navigation */
body.dark-mode header,
body.dark-mode .header,
body.dark-mode .nav-buttons,
body.dark-mode .tabs {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

body.dark-mode .nav-buttons .btn-secondary {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* LIGHT MODE REVERSE STYLES */
body:not(.dark-mode) {
    background: var(--bg-body) !important;
}

body:not(.dark-mode) *,
body:not(.dark-mode) *::before,
body:not(.dark-mode) *::after {
    color: var(--text-main) !important;
}

/* Force all cards and boxes to be light in light mode */
body:not(.dark-mode) .card,
body:not(.dark-mode) .dash-card,
body:not(.dark-mode) .modal-content,
body:not(.dark-mode) .stat-box,
body:not(.dark-mode) .auth-card,
body:not(.dark-mode) .note-card-modal,
body:not(.dark-mode) .profile-content,
body:not(.dark-mode) .chat-wrapper,
body:not(.dark-mode) .message-content,
body:not(.dark-mode) .chat-input-wrapper,
body:not(.dark-mode) .view-note-btn,
body:not(.dark-mode) .chat-message,
body:not(.dark-mode) .chat-input,
body:not(.dark-mode) .dash-note-item,
body:not(.dark-mode) .todo-item,
body:not(.dark-mode) .event-item,
body:not(.dark-mode) .current-affairs-item,
body:not(.dark-mode) .privacy-notice,
body:not(.dark-mode) .task-meta,
body:not(.dark-mode) .empty-state,
body:not(.dark-mode) .motivation-meta,
body:not(.dark-mode) .dropdown-menu,
body:not(.dark-mode) .notes-grid,
body:not(.dark-mode) .form-group,
body:not(.dark-mode) .password-section,
body:not(.dark-mode) .profile-section {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force all form elements to be light in light mode */
body:not(.dark-mode) .form-control,
body:not(.dark-mode) input,
body:not(.dark-mode) textarea,
body:not(.dark-mode) select {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* ADDITIONAL COMPREHENSIVE FIXES FOR REMAINING WHITE ELEMENTS */
/* Target any element that might still be white */
body.dark-mode * [style*="background: white"],
body.dark-mode * [style*="background: #fff"],
body.dark-mode * [style*="background: #ffffff"],
body.dark-mode * [style*="background-color: white"],
body.dark-mode * [style*="background-color: #fff"],
body.dark-mode * [style*="background-color: #ffffff"] {
    background-color: var(--bg-card) !important;
}

/* Force all input-like elements */
body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="email"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="search"],
body.dark-mode input[type="file"],
body.dark-mode input:not([type]) {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force all textarea elements */
body.dark-mode textarea {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force all select elements */
body.dark-mode select,
body.dark-mode select option {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force specific notes tab elements */
body.dark-mode .note-input,
body.dark-mode .note-content,
body.dark-mode .note-title,
body.dark-mode .note-subject,
body.dark-mode .note-attachment,
body.dark-mode #noteTitle,
body.dark-mode #noteContent,
body.dark-mode #noteSubject {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force dashboard elements */
body.dark-mode .dashboard-input,
body.dark-mode .dashboard-search,
body.dark-mode .dashboard-filter,
body.dark-mode .dash-quick-note,
body.dark-mode #dashQuickNote,
body.dark-mode #newTask {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force chat elements */
body.dark-mode .chat-input,
body.dark-mode .chat-message-input,
body.dark-mode .chat-textarea,
body.dark-mode .community-input,
body.dark-mode #chatInput,
body.dark-mode #messageInput {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force all button-like elements that might be white */
body.dark-mode .btn,
body.dark-mode button,
body.dark-mode input[type="button"],
body.dark-mode input[type="submit"],
body.dark-mode input[type="reset"] {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Force all div and span elements that might have white backgrounds */
body.dark-mode div,
body.dark-mode span {
    background-color: transparent !important;
}

/* Override any inline styles that set white backgrounds */
body.dark-mode [style*="background"] {
    background-color: var(--bg-card) !important;
}

/* Force all labels and text elements */
body.dark-mode label,
body.dark-mode .label,
body.dark-mode .form-label,
body.dark-mode .input-label {
    color: var(--text-main) !important;
}

/* Force all placeholder text */
body.dark-mode ::placeholder,
body.dark-mode ::-webkit-input-placeholder,
body.dark-mode ::-moz-placeholder {
    color: var(--text-muted) !important;
}

/* Light mode reverse fixes */
body:not(.dark-mode) * [style*="background: black"],
body:not(.dark-mode) * [style*="background: #000"],
body:not(.dark-mode) * [style*="background: #000000"],
body:not(.dark-mode) * [style*="background-color: black"],
body:not(.dark-mode) * [style*="background-color: #000"],
body:not(.dark-mode) * [style*="background-color: #000000"] {
    background-color: var(--bg-card) !important;
}

/* Force light mode for specific elements */
body:not(.dark-mode) .note-input,
body:not(.dark-mode) .note-content,
body:not(.dark-mode) .note-title,
body:not(.dark-mode) .note-subject,
body:not(.dark-mode) .note-attachment,
body:not(.dark-mode) #noteTitle,
body:not(.dark-mode) #noteContent,
body:not(.dark-mode) #noteSubject {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body:not(.dark-mode) .dashboard-input,
body:not(.dark-mode) .dashboard-search,
body:not(.dark-mode) .dashboard-filter,
body:not(.dark-mode) .dash-quick-note,
body:not(.dark-mode) #dashQuickNote,
body:not(.dark-mode) #newTask {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body:not(.dark-mode) .chat-input,
body:not(.dark-mode) .chat-message-input,
body:not(.dark-mode) .chat-textarea,
body:not(.dark-mode) .community-input,
body:not(.dark-mode) #chatInput,
body:not(.dark-mode) #messageInput {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* CHAT CANVAS AND DASHBOARD SPECIFIC FIXES */
/* Chat Canvas Visibility Fix */
body.dark-mode .chat-canvas,
body.dark-mode .message-bubble,
body.dark-mode .chat-bubble,
body.dark-mode .message-container,
body.dark-mode .chat-container {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Differentiate between sent and received messages */
body.dark-mode .chat-message-sent .message-bubble,
body.dark-mode .chat-message-sent .chat-bubble,
body.dark-mode .message-sent {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

body.dark-mode .chat-message-received .message-bubble,
body.dark-mode .chat-message-received .chat-bubble,
body.dark-mode .message-received {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Chat message content visibility */
body.dark-mode .chat-message p,
body.dark-mode .chat-message span,
body.dark-mode .chat-message div,
body.dark-mode .message-text,
body.dark-mode .message-content {
    color: var(--text-main) !important;
}

body.dark-mode .chat-message-sent p,
body.dark-mode .chat-message-sent span,
body.dark-mode .chat-message-sent div,
body.dark-mode .message-sent .message-text,
body.dark-mode .message-sent .message-content {
    color: white !important;
}

body.dark-mode .chat-message-received p,
body.dark-mode .chat-message-received span,
body.dark-mode .chat-message-received div,
body.dark-mode .message-received .message-text,
body.dark-mode .message-received .message-content {
    color: var(--text-main) !important;
}

/* Chat metadata (sender name, time) */
body.dark-mode .message-sender,
body.dark-mode .message-time,
body.dark-mode .message-meta,
body.dark-mode .chat-header {
    color: var(--text-muted) !important;
}

/* Dashboard Specific Fixes */
body.dark-mode .dashboard-section,
body.dark-mode .dashboard-widget,
body.dark-mode .dashboard-component,
body.dark-mode .dash-widget,
body.dark-mode .dash-component,
body.dark-mode .welcome-back-card,
body.dark-mode .motivation-quote-card {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .dashboard-header,
body.dark-mode .dashboard-title,
body.dark-mode .dash-header,
body.dark-mode .dash-title {
    color: var(--text-main) !important;
}

body.dark-mode .dashboard-content,
body.dark-mode .dash-content,
body.dark-mode .welcome-back-content,
body.dark-mode .motivation-quote-text {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* SPECIFIC WELCOME AND MOTIVATION CAROUSEL FIXES */
/* Force welcome section elements */
body.dark-mode .dashboard-hero,
body.dark-mode .hero-text,
body.dark-mode .welcome-section,
body.dark-mode #welcomeUserDashboard,
body.dark-mode .welcome-message,
body.dark-mode .welcome-card {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .dashboard-hero h1,
body.dark-mode .dashboard-hero h2,
body.dark-mode .dashboard-hero p,
body.dark-mode .dashboard-hero .hero-text h1,
body.dark-mode .dashboard-hero .hero-text h2,
body.dark-mode .dashboard-hero .hero-text p,
body.dark-mode #welcomeUserDashboard,
body.dark-mode .welcome-text {
    color: var(--text-main) !important;
}

/* Force motivation carousel elements */
body.dark-mode .motivation-card,
body.dark-mode .motivation-section,
body.dark-mode .quote-carousel,
body.dark-mode .motivation-widget,
body.dark-mode #motivationQuote,
body.dark-mode #quoteAuthor,
body.dark-mode .quote,
body.dark-mode .quote-author {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .motivation-card h2,
body.dark-mode .motivation-card h3,
body.dark-mode .motivation-card p,
body.dark-mode .motivation-section h2,
body.dark-mode .motivation-section h3,
body.dark-mode .motivation-section p,
body.dark-mode #motivationQuote,
body.dark-mode #quoteAuthor,
body.dark-mode .quote,
body.dark-mode .quote-author {
    color: var(--text-main) !important;
}

/* Force any remaining white elements in dashboard */
body.dark-mode .dash-card,
body.dark-mode .dashboard-card,
body.dark-mode .hero-card,
body.dark-mode .welcome-card,
body.dark-mode .motivation-card {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Override any inline styles that might be keeping these white */
body.dark-mode .dashboard-hero [style*="background"],
body.dark-mode .hero-text [style*="background"],
body.dark-mode .motivation-card [style*="background"],
body.dark-mode .welcome-section [style*="background"] {
    background-color: var(--bg-card) !important;
}

body.dark-mode .dashboard-hero [style*="color"],
body.dark-mode .hero-text [style*="color"],
body.dark-mode .motivation-card [style*="color"],
body.dark-mode .welcome-section [style*="color"] {
    color: var(--text-main) !important;
}

/* ADDITIONAL FORCEFUL WELCOME CARD FIXES */
/* Target any possible welcome card variations */
body.dark-mode .welcome-back,
body.dark-mode .welcome-back-card,
body.dark-mode .welcome-section,
body.dark-mode .welcome-container,
body.dark-mode .hero-section,
body.dark-mode .dashboard-welcome {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
}

/* Force all children of welcome elements to be dark */
body.dark-mode .dashboard-hero *,
body.dark-mode .hero-text *,
body.dark-mode .welcome-section *,
body.dark-mode .welcome-card * {
    background-color: inherit !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Override any element with white background in welcome section */
body.dark-mode .dashboard-hero [style*="background: white"],
body.dark-mode .dashboard-hero [style*="background: #fff"],
body.dark-mode .dashboard-hero [style*="background: #ffffff"],
body.dark-mode .hero-text [style*="background: white"],
body.dark-mode .hero-text [style*="background: #fff"],
body.dark-mode .hero-text [style*="background: #ffffff"],
body.dark-mode .welcome-section [style*="background: white"],
body.dark-mode .welcome-section [style*="background: #fff"],
body.dark-mode .welcome-section [style*="background: #ffffff"] {
    background-color: var(--bg-card) !important;
}

/* Force welcome card to match other dash cards exactly */
body.dark-mode .dash-card,
body.dark-mode .dashboard-hero,
body.dark-mode .hero-text,
body.dark-mode .welcome-section {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow) !important;
}

/* Target specific welcome text elements */
body.dark-mode #welcomeUserDashboard,
body.dark-mode .welcome-message,
body.dark-mode .welcome-text,
body.dark-mode .hero-text h1,
body.dark-mode .hero-text p {
    background-color: transparent !important;
    color: var(--text-main) !important;
}

/* Force all chat-related elements */
body.dark-mode .chat-wrapper *,
body.dark-mode .chat-container *,
body.dark-mode .message-list *,
body.dark-mode .messages-container * {
    background-color: inherit !important;
    color: var(--text-main) !important;
}

/* Light mode reverse fixes for chat */
body:not(.dark-mode) .chat-canvas,
body:not(.dark-mode) .message-bubble,
body:not(.dark-mode) .chat-bubble,
body:not(.dark-mode) .message-container {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body:not(.dark-mode) .chat-message-sent .message-bubble,
body:not(.dark-mode) .chat-message-sent .chat-bubble {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

body:not(.dark-mode) .chat-message-received .message-bubble,
body:not(.dark-mode) .chat-message-received .chat-bubble {
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Light mode dashboard fixes */
body:not(.dark-mode) .dashboard-section,
body:not(.dark-mode) .dashboard-widget,
body:not(.dark-mode) .dash-widget {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Dropdown Styles */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-bottom: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-top: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 150px;
    margin-bottom: 5px;
    /* Add spacing when dropdown appears upward */
}

.dropdown-menu.upward {
    bottom: 100%;
    margin-bottom: 5px;
}

.dropdown-menu.downward {
    top: 100%;
    margin-top: 5px;
}

.dropdown-item {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

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

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

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

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.note-card-modal {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.note-card-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.note-card-modal h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.note-card-modal .note-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.note-card-modal .note-content {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--dark-gray);
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.note-card-modal .note-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.note-card-modal .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Enhanced Profile Section Styles */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    color: white;
}


.profile-cover-wrapper {
    position: relative;
    width: 100%;
    height: clamp(130px, 22vw, 190px);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
}

.profile-cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.profile-cover-wrapper.has-image img {
    display: block;
}

.cover-overlay {
    position: absolute;
    right: 10px;
    bottom: 10px;
}

.cover-edit-btn {
    background: rgba(0, 0, 0, 0.35);
    color: var(--focus-text-color);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar-wrapper img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.avatar-overlay {
    position: absolute;
    bottom: 5px;
    right: 5px;
    opacity: 0;
    transition: var(--transition);
}

.avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.avatar-edit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.avatar-edit-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.profile-status h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
}


.profile-logout-section {
    display: flex;
    justify-content: flex-start;
}

.profile-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.profile-content {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.profile-section {
    padding: 2rem;
    border-bottom: 1px solid #eee;
}

.profile-section:last-child {
    border-bottom: none;
}

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

.section-header h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-section .form-group {
    margin-bottom: 0;
}

.profile-section .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.profile-section .form-group label i {
    color: var(--primary-color);
    width: 16px;
}

.profile-section .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.profile-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.1);
}


.btn-update-profile {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-update-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 153, 51, 0.3);
}

.password-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.password-section .form-grid {
    align-items: end;
}

.password-input-wrap {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 5px;
}

.change-password-options {
    margin-bottom: 1rem;
}

.change-password-options .login-checkbox-label {
    font-weight: 600;
}

.btn-change-password {
    background: var(--warning-color);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 0 auto;
}

.btn-change-password:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.danger-zone {
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.danger-zone .section-header h4 {
    color: var(--danger-color);
}

.danger-content {
    text-align: center;
}

.danger-content p {
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.btn-delete-profile {
    background: var(--danger-color);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto 1rem auto;
}

.btn-delete-profile:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.danger-warning {
    color: var(--danger-color);
    font-size: 0.85rem;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

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

    .profile-section {
        padding: 1.5rem;
    }
}

/* Enhanced Community Chat Styles */
.community-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.community-title h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.community-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

.community-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.stat-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.privacy-notice.modern-notice {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.notice-icon {
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.notice-content h4 {
    margin: 0 0 1rem 0;
    color: var(--dark-gray);
    font-size: 1.2rem;
}

.guidelines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.guideline-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.guideline-item i {
    color: var(--primary-color);
}

.privacy-text {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.chat-wrapper {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chat-container.modern-chat {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
}

.chat-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.message-avatar {
    position: relative;
    flex-shrink: 0;
}

.message-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* --- Dashboard Revamp Styles --- */

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-card {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
    /* Start hidden */
}

/* Stagger delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

/* Modern Dashboard Card */
.dash-card {
    background: #ffffff;
    /* Pastel White / Clean White */
    border: 1px solid #f0f2f5;
    border-radius: 16px;
    /* Larger radius */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    /* Very soft shadow */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    overflow: hidden;
    /* Ensure content respects radius */
}

.dash-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.dash-card-header {
    background: linear-gradient(to right, rgba(235, 248, 255, 0.5), transparent);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.dash-card-header h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stat Boxes Modernization */
.dashboard-stats-row {
    gap: 1.5rem;
    /* More spacing */
}

.stat-box {
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.stat-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.stat-box:hover {
    transform: translateY(-5px) scale(1.02);
}

.stat-box h2 {
    font-size: 2.5rem;
    /* Larger numbers */
    margin-bottom: 5px;
}

.stat-box p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Dashboard Hero */
.dashboard-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(118, 75, 162, 0.3);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.dashboard-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #2ecc71;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Login Tasks Modal Specifics */
#loginTasksList .todo-item {
    background: white;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-content {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.message-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent white transparent transparent;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.message-time {
    font-size: 0.8rem;
    color: #666;
}

.message-text {
    color: var(--dark-gray);
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-input-wrapper {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 1rem;
}

.input-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.media-buttons {
    display: flex;
    gap: 0.5rem;
}

.media-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

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

.image-btn {
    background: #e3f2fd;
    color: #2196f3;
}

.image-btn:hover {
    background: #2196f3;
    color: white;
}

.video-btn {
    background: #fff3e0;
    color: #ff9800;
}

.video-btn:hover {
    background: #ff9800;
    color: white;
}

.refresh-btn {
    background: #f3e5f5;
    color: #9c27b0;
}

.refresh-btn:hover {
    background: #9c27b0;
    color: white;
}

.message-input-group {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-input-field {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.chat-input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.1);
}

.send-button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.send-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(255, 153, 51, 0.3);
}


/* Shared Note Card Styles */
.shared-note-card {
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 16px;
    background-color: #ffffff;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* More premium shadow */
    max-width: 320px;
    /* Limit width for chat bubble feel */
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shared-note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.shared-note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Align top for multi-line titles */
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
    gap: 10px;
}

.shared-note-title-group {
    display: flex;
    flex-direction: column;
}

.shared-note-title {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1.3;
}

.shared-note-subject {
    font-size: 0.75em;
    color: #586069;
    background-color: #f1f8ff;
    border: 1px solid #c8e1ff;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    align-self: flex-start;
}

.shared-note-user-msg {
    font-size: 0.95em;
    color: #24292e;
    margin-bottom: 12px;
    font-style: italic;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.shared-note-content-snippet {
    font-size: 0.9em;
    color: #444;
    margin-bottom: 12px;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.shared-note-attachments {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.attachment-preview {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.attachment-icon-placeholder {
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 1.5em;
    border: 1px solid #dee2e6;
    color: #6c757d;
    text-decoration: none;
    transition: background 0.2s;
}

.attachment-icon-placeholder:hover {
    background-color: #e9ecef;
}

.attachment-name-small {
    font-size: 0.5em;
    margin-top: 4px;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.view-note-btn {
    width: 100%;
    margin-top: 4px;
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.view-note-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

.chat-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.message-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.message-time {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.chat-message div:last-child {
    color: var(--dark-gray);
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-input {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 0.75rem;
}

.chat-input .form-control {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.chat-input .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.1);
    outline: none;
}

.dash-notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-note-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.dash-note-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.dash-note-item .delete-btn {
    color: #ff4d4d;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.dash-note-item .delete-btn:hover {
    opacity: 1;
}

.chat-input .btn {
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.chat-input .btn:hover {
    transform: translateY(-1px);
}

.chat-input .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.chat-input .btn-primary:hover {
    box-shadow: 0 4px 15px rgba(255, 153, 51, 0.3);
}

.chat-input .btn-secondary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

.chat-input .btn-secondary:hover {
    background: #e9ecef;
}

.chat-input .btn-info {
    background: #17a2b8;
    border: none;
}

.chat-input .btn-info:hover {
    background: #138496;
}

/* Privacy Notice Enhancements */
.privacy-notice {
    background: linear-gradient(135deg, #fff3cd, #ffffff);
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.1);
}

.privacy-notice h4 {
    color: #856404;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.privacy-notice ul {
    margin: 0;
    padding-left: 1.5rem;
}

.privacy-notice li {
    margin-bottom: 0.5rem;
    color: #856404;
}

.privacy-notice p {
    margin: 0.5rem 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* Chat Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

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

/* Responsive adjustments for community chat */
@media (max-width: 768px) {
    .chat-container {
        height: 400px;
    }

    .chat-input {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .chat-input .form-control {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .chat-input .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

/* Background with Ashoka Stambh watermark */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, 56vw);
    height: min(510px, 88vw);
    background-image: url('/assets/icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.06;
    z-index: -1;
    pointer-events: none;
}

/* Header */
.header {
    background: color-mix(in srgb, var(--bg-card) 74%, var(--primary-color) 26%);
    color: var(--white);
    padding: 0.85rem 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid color-mix(in srgb, var(--primary-color) 45%, var(--border-color) 55%);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}


.theme-fab {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--primary-color) 45%, var(--border-color) 55%);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(240, 252, 255, 0.9));
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    grid-column: 1;
    grid-row: 2;
}

.theme-fab:active {
    transform: scale(0.94);
}

.theme-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 18px rgba(15, 23, 42, 0.15);
}

body.dark-mode .theme-fab {
    color: #fbbf24;
    background: linear-gradient(145deg, #11273d, #0b1b2a);
}

.back-nav-btn {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.back-nav-btn:hover {
    transform: translateY(-1px) scale(1.03);
    background: rgba(255, 255, 255, 0.32);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-self: center;
    text-align: center;
    color: var(--text-main);
}

.logo img {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
}

.logo h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.logo small {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-buttons #welcomeUser {
    font-size: 0.92rem;
}

.mobile-tab-dropdown-wrap {
    display: none;
    position: relative;
    align-items: center;
    gap: 0.5rem;
}

.mobile-tab-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.mobile-tab-dropdown {
    border: 1px solid #d6deed;
    border-radius: 999px;
    padding: 0.48rem 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff, #f7f9ff);
    color: var(--secondary-color);
    min-width: 112px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.mobile-tab-dropdown:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}

.mobile-menu-caret {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.mobile-tab-dropdown.active .mobile-menu-caret {
    transform: rotate(180deg);
}

.mobile-tab-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    width: min(260px, calc(100vw - 1.8rem));
    max-width: min(280px, calc(100vw - 1.25rem));
    background: #ffffff;
    border: 1px solid #e5ebf8;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
    padding: 0.35rem;
    display: none;
    z-index: 1400;
}

.mobile-tab-dropdown-menu.open {
    display: block;
}

.mobile-tab-dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 10px;
    text-align: left;
    padding: 0.58rem 0.72rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.mobile-tab-dropdown-item:hover {
    background: #f1f5ff;
    color: #0f172a;
}

.header .nav-buttons .btn {
    padding: 0.42rem 0.85rem;
    font-size: 0.9rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #43bece;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}


.pwa-install-btn {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.pwa-install-btn i {
    font-size: 0.95rem;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

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

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
}

.navbar-toggle-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-bottom: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.navbar-toggle-btn:hover {
    transform: translateY(-1px);
}

.navbar-toggle-btn:active {
    transform: scale(0.94);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease, padding 0.3s ease, margin-bottom 0.3s ease;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--dark-gray);
    transition: var(--transition);
    white-space: nowrap;
    border-radius: var(--border-radius);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tab:hover {
    background: var(--light-gray);
    transform: translateY(-1px);
}

.tab:active {
    transform: scale(0.97);
}

.tab.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 10px 18px rgba(56, 189, 248, 0.28);
}

.tab,
.tab-content h1,
.tab-content h2,
.tab-content h3,
.tab-content h4,
.tab-content p,
.tab-content label,
.tab-content .btn,
.tab-content .form-control {
    letter-spacing: 0.01em;
}

.tab-content h1 {
    font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.tab-content h2 {
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

.tab-content h3 {
    font-size: clamp(0.98rem, 1.35vw, 1.12rem);
}

.tab-content p,
.tab-content label,
.tab-content .btn,
.tab-content .form-control,
.tab-content small {
    font-size: 0.9rem;
}

body.nav-collapsed .tabs {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    overflow: hidden;
    border: 0;
}

.mobile-nav-group {
    display: none;
}

.mobile-nav-action {
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.mobile-welcome-text {
    font-size: 0.9rem;
    color: var(--dark-gray);
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

body.nav-collapsed .tab-content.active {
    min-height: calc(100vh - 170px);
}

.alerts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.alerts-category-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.alerts-filter-chip {
    border: 1px solid color-mix(in srgb, var(--primary-color) 40%, transparent);
    background: color-mix(in srgb, var(--bg-card) 88%, var(--primary-color) 12%);
    color: var(--text-color);
    border-radius: 999px;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.alerts-filter-chip.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.alerts-status {
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.alerts-status-success {
    color: #15803d;
}

.alerts-status-error {
    color: #b91c1c;
}

.alerts-group-title {
    margin: 0.5rem 0 0.85rem;
    font-size: 1rem;
}

.alerts-group-title small {
    color: var(--text-muted);
    font-weight: 500;
}

.alerts-group-grid {
    display: grid;
    gap: 0.9rem;
}

.alerts-card {
    margin-bottom: 0;
}

.alerts-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
}

.alerts-card-meta {
    margin-top: 0.4rem;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.alerts-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary-color) 40%, transparent);
    padding: 0.15rem 0.55rem;
    font-size: 0.73rem;
    font-weight: 600;
}

.alerts-pill-category {
    border-color: color-mix(in srgb, var(--secondary-color) 50%, transparent);
}

.alerts-pill-severity {
    border-color: #f59e0b;
    color: #a16207;
}

.alerts-card-snippet {
    margin: 0.8rem 0 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.alerts-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
}

.alerts-card-source {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.alerts-detail-grid {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.alerts-detail-block h4 {
    margin: 0 0 0.4rem;
}

.alerts-metadata {
    margin: 0;
    padding: 0.8rem;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-card) 82%, #0f172a 18%);
    border: 1px solid color-mix(in srgb, var(--primary-color) 20%, transparent);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow: auto;
}

.alerts-muted {
    color: var(--text-muted);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

/* Todo List Styles */
.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.todo-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.form-group label {
    font-weight: 600;
    color: var(--dark-gray);
}

.totp-setup-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.totp-setup-row .form-control {
    flex: 1;
    min-width: 0;
}

.totp-setup-row .btn {
    flex-shrink: 0;
}

.totp-help-text {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.password-settings-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.password-settings-item {
    margin-bottom: 0;
}

.password-input-wrap {
    position: relative;
}

.password-otp-row {
    width: 100%;
    flex-wrap: wrap;
}

.password-otp-row .otp-inline-btn {
    flex-shrink: 0;
}

.forgot-password-settings-row {
    margin-bottom: 0.5rem;
}

.otp-inline-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.otp-inline-row .form-control {
    flex: 1;
    min-width: 0;
}

.otp-inline-btn {
    min-width: 92px;
    height: 38px;
    padding: 0.45rem 0.7rem;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.otp-input-with-button {
    position: relative;
}

.otp-inside-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    min-width: 102px;
    z-index: 1;
}

.otp-timer-text {
    font-weight: 600;
    color: var(--primary-color);
    margin-left: 0.25rem;
}

.totp-qr-wrapper {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px dashed #d6d6d6;
    border-radius: var(--border-radius);
    text-align: center;
    background: #fafafa;
}

.totp-qr-image {
    width: 180px;
    height: 180px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
    background: white;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0;
}

.login-checkbox-label input {
    margin: 0;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.25);
}

.priority-select {
    display: flex;
    gap: 0.5rem;
}

.priority-option {
    flex: 1;
    padding: 0.5rem;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.priority-option:hover {
    border-color: var(--primary-color);
}

.priority-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}

.priority-low {
    border-color: #28a745;
}

.priority-medium {
    border-color: #ffc107;
}

.priority-high {
    border-color: #fd7e14;
}

.priority-urgent {
    border-color: #dc3545;
}

/* Todo Items */
.todo-list {
    display: grid;
    gap: 1rem;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.todo-item:hover {
    background: #e9ecef;
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
}

.todo-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.todo-text {
    flex: 1;
    font-size: 1rem;
}

.todo-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
}

.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.low {
    background: #d4edda;
    color: #155724;
}

.priority-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.priority-badge.high {
    background: #ffeeba;
    color: #533f03;
}

.priority-badge.urgent {
    background: #f8d7da;
    color: #721c24;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* Motivation Section */
.motivation-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
    padding: 2rem;
}

.quote {
    font-size: 1.25rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.quote-author {
    font-size: 1rem;
    opacity: 0.9;
}

/* Current Affairs */
.affairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.2rem;
}

.affair-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0a0f1e;
    color: #e8ebf3;
    box-shadow: 0 12px 28px rgba(10, 15, 30, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.affair-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(10, 15, 30, 0.45);
}

.affair-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: block;
    background: linear-gradient(135deg, #1f3559, #112b45);
}

.affair-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.affair-card:hover .affair-image {
    transform: scale(1.04);
}

.affair-image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.affair-image-fallback-text {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.affair-content {
    padding: 1.1rem;
}

.affair-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.75);
}

.affair-source {
    font-weight: 700;
}

.affair-date {
    color: rgba(255, 255, 255, 0.65);
}

.affair-title {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.8rem;
}

.affair-title a {
    color: #ffffff;
    text-decoration: none;
}

.affair-title a:hover {
    text-decoration: underline;
}

.affair-description {
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(232, 235, 243, 0.9);
}

/* Community Chat */
.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--white);
    border-radius: var(--border-radius);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.message-author {
    font-weight: 600;
    color: var(--primary-color);
}

.message-time {
    color: #666;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
}

.message-left {
    align-self: flex-start;
    background: #ffffff;
    border-top-left-radius: 0;
    margin-right: 20%;
}

.message-right {
    align-self: flex-end;
    background: #dcf8c6;
    /* WhatsApp green */
    border-top-right-radius: 0;
    margin-left: 20%;
}

/* Profile Section */
.profile-form {
    max-width: 500px;
}

/* Login/Signup */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    z-index: 3000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.22), transparent 42%),
        radial-gradient(circle at 84% 12%, rgba(45, 212, 191, 0.2), transparent 38%),
        radial-gradient(circle at 78% 88%, rgba(251, 191, 36, 0.18), transparent 35%),
        linear-gradient(135deg, #fff7c4 0%, #ffd6e7 46%, #b3ecff 100%);
}

.auth-stars,
.auth-stars::before,
.auth-stars::after {
    content: '';
    position: fixed;
    inset: 0;
    background-repeat: repeat;
    background-size: 420px 420px;
    opacity: 0.3;
    pointer-events: none;
}

.auth-stars {
    z-index: 1;
    background-image:
        radial-gradient(2px 2px at 40px 60px, rgba(255, 255, 255, 0.95), transparent),
        radial-gradient(1.5px 1.5px at 120px 140px, rgba(192, 242, 255, 0.85), transparent),
        radial-gradient(2px 2px at 220px 30px, rgba(255, 232, 166, 0.88), transparent),
        radial-gradient(1px 1px at 300px 220px, rgba(255, 255, 255, 0.78), transparent);
    animation: landingStarDrift 60s linear infinite;
}

.auth-stars::before {
    background-image:
        radial-gradient(1px 1px at 55px 35px, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(2px 2px at 200px 90px, rgba(141, 232, 255, 0.82), transparent),
        radial-gradient(1px 1px at 310px 180px, rgba(255, 255, 255, 0.72), transparent),
        radial-gradient(2px 2px at 370px 320px, rgba(255, 245, 194, 0.75), transparent);
    animation: landingStarDriftReverse 85s linear infinite;
}

.auth-stars::after {
    background-image:
        radial-gradient(1px 1px at 30px 250px, rgba(255, 255, 255, 0.82), transparent),
        radial-gradient(2px 2px at 180px 200px, rgba(197, 237, 255, 0.8), transparent),
        radial-gradient(1px 1px at 280px 110px, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(1.5px 1.5px at 360px 55px, rgba(255, 216, 124, 0.7), transparent);
    animation: landingStarPulse 7s ease-in-out infinite;
}

.landing-screen {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(1rem, 2vw, 2rem) clamp(1rem, 4vw, 3rem) clamp(0.85rem, 2vw, 1.35rem);
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    animation: landingReveal 520ms ease-out;
}

.landing-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: clamp(1rem, 2vw, 2rem);
    padding: clamp(0.65rem, 1.35vw, 0.95rem) clamp(0.85rem, 2vw, 1.35rem);
    border: 1px solid rgba(167, 219, 245, 0.42);
    border-radius: 1.05rem;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.68), rgba(226, 245, 255, 0.56));
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 38px rgba(13, 60, 102, 0.13);
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #173042;
}

.landing-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(12, 74, 110, 0.55));
}

.landing-brand h1 {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.38rem);
    font-family: 'Bahnschrift', 'Trebuchet MS', sans-serif;
    letter-spacing: 0.03em;
}

.landing-brand p {
    margin: 0.15rem 0 0;
    color: rgba(23, 48, 66, 0.76);
    font-size: 0.84rem;
}

.landing-top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.landing-top-btn {
    border: 1px solid rgba(157, 207, 235, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #173042;
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    padding: 0.55rem 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.landing-top-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.78);
    background: rgba(255, 255, 255, 0.95);
}

.landing-top-btn.is-login {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.92), rgba(29, 78, 216, 0.9));
    border-color: rgba(103, 209, 245, 0.82);
    color: #f7fdff;
    box-shadow: 0 12px 28px rgba(56, 106, 190, 0.24);
    padding-left: 2.75rem;
    position: relative;
}

.landing-login-bell {
    position: absolute;
    left: 0.42rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    border: 1px solid rgba(234, 248, 255, 0.58);
    background: rgba(8, 35, 88, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f7fdff;
    cursor: pointer;
    animation: landingBellSwing 1.4s ease-in-out infinite;
}

.landing-login-bell:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 1px;
}

.landing-login-bell-dot {
    position: absolute;
    top: 0.18rem;
    right: 0.15rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #ff4d63;
    box-shadow: 0 0 0 2px rgba(14, 72, 140, 0.46);
}

.landing-login-bell-dot.hidden {
    display: none;
}

.landing-notification-modal {
    position: fixed;
    inset: 0;
    z-index: 1600;
    background: rgba(4, 16, 36, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.1rem;
}

.landing-notification-modal.is-open {
    display: flex;
}

.landing-notification-dialog {
    width: min(460px, 100%);
    border-radius: 1rem;
    border: 1px solid rgba(177, 223, 247, 0.65);
    background: linear-gradient(150deg, rgba(253, 254, 255, 0.97), rgba(234, 247, 255, 0.98));
    box-shadow: 0 24px 46px rgba(9, 38, 79, 0.23);
    padding: 1.2rem 1.15rem 1rem;
    position: relative;
}

.landing-notification-dialog h3 {
    font-size: 1.08rem;
    margin: 0 0 0.55rem;
    color: #12324a;
}

.landing-notification-dialog p {
    margin: 0 0 0.95rem;
    color: rgba(18, 50, 74, 0.82);
}

.landing-notification-dialog .landing-cta {
    width: 100%;
    justify-content: center;
}

.landing-notification-close {
    border: 0;
    background: transparent;
    color: #16415f;
    position: absolute;
    right: 0.6rem;
    top: 0.5rem;
    font-size: 1.1rem;
}

@keyframes landingBellSwing {
    0%, 100% { transform: translateY(-50%) rotate(0deg); }
    20% { transform: translateY(-50%) rotate(10deg); }
    40% { transform: translateY(-50%) rotate(-8deg); }
    60% { transform: translateY(-50%) rotate(6deg); }
    80% { transform: translateY(-50%) rotate(-4deg); }
}

.landing-content {
    color: #173042;
    flex: 1 1 auto;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(116, 197, 238, 0.55);
    border-radius: 999px;
    padding: 0.34rem 0.8rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1f4e73;
}

.landing-title {
    margin: 1rem 0 0.6rem;
    max-width: 760px;
    font-family: 'Bahnschrift', 'Segoe UI', sans-serif;
    letter-spacing: 0.02em;
    font-size: clamp(1.7rem, 4.6vw, 3.1rem);
    line-height: 1.08;
}

.landing-subtitle {
    max-width: 760px;
    color: rgba(31, 62, 83, 0.86);
    font-size: clamp(1.02rem, 2.15vw, 1.25rem);
    line-height: 1.56;
}

.landing-subtitle-carousel {
    min-height: 3.3rem;
    font-family: 'Bahnschrift', 'Trebuchet MS', sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: opacity 260ms ease, transform 260ms ease;
}

.landing-subtitle-carousel.is-changing {
    opacity: 0.2;
    transform: translateY(8px);
}

.landing-cta-row {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.landing-cta {
    border: none;
    border-radius: 999px;
    padding: 0.72rem 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.landing-cta:hover {
    transform: translateY(-1px);
}

.landing-cta.primary {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #f8fbff;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.35);
}

.landing-cta.ghost {
    background: rgba(255, 255, 255, 0.86);
    color: #184260;
    border: 1px solid rgba(120, 200, 238, 0.64);
    box-shadow: 0 12px 28px rgba(56, 118, 183, 0.16);
}

.landing-cta-download {
    color: #f8fff9;
    border: 1px solid rgba(126, 249, 173, 0.38);
    background: linear-gradient(130deg, rgba(18, 92, 43, 0.9), rgba(29, 133, 68, 0.9));
    box-shadow: 0 14px 30px rgba(6, 62, 26, 0.32);
}

.landing-cta-download:hover {
    color: #f8fff9;
    box-shadow: 0 18px 36px rgba(6, 62, 26, 0.44);
}

.landing-cta-download i {
    font-size: 1.1rem;
}

.landing-feature-grid {
    margin-top: 1.7rem;
    margin-bottom: 0.35rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.landing-footer {
    margin-top: 0.4rem;
    padding-top: 0.55rem;
    text-align: center;
    font-family: 'Bahnschrift', 'Trebuchet MS', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: clamp(1.02rem, 1.8vw, 1.2rem);
    color: rgba(23, 48, 66, 0.9);
    border-top: 1px solid rgba(145, 193, 222, 0.24);
}

.landing-feature-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(139, 194, 223, 0.36);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 250, 255, 0.92));
    padding: 1rem;
    min-height: 150px;
    box-shadow: 0 12px 26px rgba(55, 109, 167, 0.12);
    animation: landingCardRise 520ms ease-out both;
    animation-delay: var(--card-delay, 0ms);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.landing-feature-card::before {
    content: '';
    position: absolute;
    inset: -40% auto auto -30%;
    width: 68%;
    height: 165%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), rgba(45, 212, 191, 0.08), transparent);
    pointer-events: none;
}

.landing-feature-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(56, 189, 248, 0.58);
    box-shadow: 0 18px 32px rgba(45, 112, 176, 0.18);
}

.landing-feature-card i {
    font-size: 1.1rem;
    color: #2494c8;
}

.landing-feature-card h3 {
    margin: 0.72rem 0 0.35rem;
    font-size: 1rem;
    color: #194261;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.landing-feature-card p {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(23, 56, 80, 0.82);
    line-height: 1.45;
}

.landing-feature-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #184260;
    border: 1px solid rgba(79, 167, 231, 0.55);
    background: rgba(221, 242, 255, 0.9);
}

.auth-portal {
    position: relative;
    z-index: 3;
    width: min(440px, 100%);
    margin: auto;
}

.auth-portal-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.auth-nav-btn {
    border: 1px solid rgba(157, 207, 235, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #1c3f5b;
    display: inline-flex;
    align-items: center;
    gap: 0.44rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
}

.auth-card {
    background: linear-gradient(145deg, rgba(245, 253, 255, 0.96), rgba(228, 247, 255, 0.94));
    border: 1px solid rgba(146, 198, 229, 0.44);
    color: #0f2940;
    padding: 1.8rem;
    border-radius: 18px;
    box-shadow: 0 16px 44px rgba(2, 12, 26, 0.4);
    max-width: 420px;
    width: 100%;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.4rem;
}

.auth-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.85rem;
    color: rgba(15, 41, 64, 0.65);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(106, 147, 176, 0.38);
}

.google-auth-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.google-auth-button {
    width: 100%;
    min-height: 44px;
    display: flex;
    justify-content: center;
}

.google-auth-button.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.google-auth-hint {
    display: block;
    text-align: center;
    color: var(--text-muted);
    line-height: 1.45;
}

body.dark-mode .auth-container {
    background:
        radial-gradient(circle at 14% 20%, rgba(28, 78, 123, 0.42), transparent 46%),
        radial-gradient(circle at 84% 14%, rgba(17, 105, 92, 0.3), transparent 40%),
        radial-gradient(circle at 72% 86%, rgba(92, 59, 157, 0.28), transparent 38%),
        linear-gradient(145deg, #050d1a 0%, #0a1d32 46%, #12172e 100%);
}

body.dark-mode .auth-stars,
body.dark-mode .auth-stars::before,
body.dark-mode .auth-stars::after {
    opacity: 0.22;
}

body.dark-mode .landing-screen {
    border-color: rgba(110, 168, 204, 0.28);
    background: transparent;
}

body.dark-mode .landing-topbar {
    border-color: rgba(110, 152, 200, 0.44);
    background: linear-gradient(120deg, rgba(18, 28, 44, 0.7), rgba(22, 38, 59, 0.66));
    box-shadow: 0 16px 40px rgba(1, 8, 20, 0.52);
}

body.dark-mode .landing-notification-dialog {
    border-color: rgba(66, 104, 147, 0.62);
    background: linear-gradient(160deg, rgba(13, 24, 40, 0.97), rgba(16, 31, 51, 0.98));
    box-shadow: 0 24px 46px rgba(0, 0, 0, 0.45);
}

body.dark-mode .landing-notification-dialog h3,
body.dark-mode .landing-notification-close {
    color: #dbeeff;
}

body.dark-mode .landing-notification-dialog p {
    color: rgba(219, 238, 255, 0.8);
}

body.dark-mode .landing-feature-card {
    background: linear-gradient(145deg, rgba(7, 22, 37, 0.88), rgba(4, 13, 24, 0.85));
    border-color: rgba(80, 143, 184, 0.42);
    box-shadow: 0 16px 28px rgba(2, 11, 22, 0.42);
}

body.dark-mode .landing-top-btn,
body.dark-mode .auth-nav-btn {
    background: rgba(10, 26, 45, 0.8);
    color: #d8ebfa;
}

body.dark-mode .auth-card {
    background: linear-gradient(145deg, rgba(12, 30, 49, 0.94), rgba(13, 35, 57, 0.95));
    border-color: rgba(68, 110, 143, 0.44);
    color: #e5f5ff;
}

body.dark-mode .auth-divider {
    color: rgba(229, 245, 255, 0.72);
}

body.dark-mode .auth-divider::before,
body.dark-mode .auth-divider::after {
    background: rgba(120, 177, 214, 0.3);
}

body.dark-mode .landing-content,
body.dark-mode .landing-brand,
body.dark-mode .landing-feature-card h3 {
    color: #e9f5ff;
}

body.dark-mode .landing-feature-chip {
    color: #d7efff;
    border-color: rgba(110, 187, 240, 0.54);
    background: rgba(19, 53, 84, 0.82);
}

body.dark-mode .landing-subtitle,
body.dark-mode .landing-feature-card p,
body.dark-mode .landing-brand p,
body.dark-mode .landing-footer {
    color: rgba(220, 239, 252, 0.94);
}

body.dark-mode .landing-kicker {
    background: rgba(10, 27, 43, 0.78);
    color: #b8e7ff;
}

@keyframes landingStarDrift {
    0% {
        transform: translateY(0) translateX(0);
    }

    100% {
        transform: translateY(-80px) translateX(40px);
    }
}

@keyframes landingStarDriftReverse {
    0% {
        transform: translateY(0) translateX(0);
    }

    100% {
        transform: translateY(70px) translateX(-35px);
    }
}

@keyframes landingStarPulse {
    0%,
    100% {
        opacity: 0.44;
    }

    50% {
        opacity: 0.78;
    }
}

@keyframes landingReveal {
    0% {
        transform: translateY(18px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes landingCardRise {
    0% {
        transform: translateY(14px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .auth-container {
        padding: 0;
    }

    .landing-screen {
        min-height: 100dvh;
        padding: 1rem 1rem 1rem;
    }

    .landing-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-top-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .landing-title {
        font-size: clamp(1.45rem, 7vw, 2.15rem);
    }

    .landing-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-portal {
        width: min(100%, 420px);
    }

    .auth-card {
        max-width: 100%;
        max-height: calc(100vh - 5.2rem);
        padding: 1.35rem;
    }
}

@media (max-width: 992px) {
    .password-settings-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .landing-top-actions {
        flex-wrap: wrap;
    }

    .password-settings-row {
        grid-template-columns: 1fr;
    }

    .otp-inline-row {
        flex-direction: column;
        align-items: stretch;
    }

    .otp-inline-btn {
        min-width: 84px;
        width: 100%;
    }

    .landing-top-btn {
        flex: 1;
        justify-content: center;
    }

    .landing-cta-download {
        font-size: 0.88rem;
        padding: 0.8rem;
    }

    .landing-feature-grid {
        grid-template-columns: 1fr;
    }
}

.auth-container .hidden {
    display: none !important;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .landing-screen,
    .landing-feature-card,
    .landing-top-btn,
    .landing-cta-download,
    .landing-subtitle-carousel {
        animation: none !important;
        transition: none !important;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .header-content {
        justify-content: space-between;
        text-align: left;
    }

    .nav-buttons {
        display: flex;
        width: 100%;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .logo {
        width: 100%;
        grid-column: 2;
        grid-row: 1;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .logo small {
        font-size: 0.78rem;
    }

    .theme-fab {
        grid-column: 1;
        grid-row: 1;
    }

    .back-nav-btn {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    #welcomeUser {
        font-size: 0.92rem;
        font-weight: 600;
    }

    .mobile-tab-dropdown-wrap {
        display: flex;
    }

    .desktop-header-actions {
        display: none;
    }

    .container {
        margin-top: 1rem;
    }

    .tabs {
        display: none;
    }

    .navbar-toggle-btn {
        display: none;
    }

    .tab {
        width: 100%;
        text-align: center;
        padding: 0.7rem 0.6rem;
        background: #f8f9fb;
        border: 1px solid #edf0f6;
        font-size: 0.92rem;
    }

    .tab.active {
        box-shadow: 0 6px 16px rgba(255, 153, 51, 0.24);
    }

    .mobile-nav-group {
        display: none;
        grid-column: 1 / -1;
        margin-top: 0.15rem;
        padding-top: 0.65rem;
        border-top: 1px dashed #e3e8f3;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.55rem;
    }

    .mobile-nav-action {
        font-size: 0.86rem;
        padding: 0.45rem 0.8rem;
    }

    .affairs-grid {
        grid-template-columns: 1fr;
    }

    .todo-form>div:nth-child(2) {
        grid-template-columns: 1fr;
    }
}


/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Privacy Notice */
.privacy-notice {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
}

.hidden {
    display: none;
}

/* Delete button for tasks */
.delete-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.delete-btn:hover {
    background: #c82333;
}

/* Note cards */
.note-card {
    border-left: 4px solid var(--success-color);
    margin-bottom: 1rem;
}

.note-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.note-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.animated-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.upload-animation {
    animation: uploadPulse 2s infinite;
}

.video-animation {
    animation: videoPulse 2s infinite;
}

.refresh-animation {
    animation: spin 1s linear infinite;
}

.refresh-animation:hover {
    animation: spin 0.5s linear infinite;
}

@keyframes uploadPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes videoPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.3s ease;
}

/* Notes Modal Revamp */
.modal-content.large-modal {
    max-width: 900px !important;
    width: 90% !important;
}

#modalNotesList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.note-card-modal {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    height: 100%;
}

.note-card-modal:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

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

.note-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.3;
}

.note-card-badge {
    background: #eef2ff;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 10px;
}

.note-card-content {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.note-card-attachments {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.note-attachment-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.note-attachment-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid #f8f9fa;
    padding-top: 0.8rem;
}

.note-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #aaa;
    transition: color 0.2s;
    font-size: 1rem;
}

.note-action-btn.delete:hover {
    color: var(--danger-color);
}

.note-action-btn.share:hover {
    color: var(--secondary-color);
}

.notes-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #888;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

/* --- Dashboard Revamp Styles --- */
.dashboard-hero {
    background: linear-gradient(135deg, #fdf2f8 0%, #f0f9ff 100%);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.hero-text h1 {
    color: #1e293b;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-text p {
    color: #475569;
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 0.25rem;
}

.hero-text {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.hero-text-main {
    flex: 1;
    min-width: 0;
}

.hero-text small {
    color: #94a3b8;
}

.hero-live-panel {
    flex-shrink: 0;
    padding: 1rem 1.1rem;
    min-width: 210px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    text-align: right;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.hero-live-time {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1;
    color: #0f172a;
}

.hero-live-date {
    margin-top: 0.45rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #475569;
}

.hero-live-weather {
    margin-top: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #1e293b;
    font-weight: 700;
}

.hero-weather-icon {
    font-size: 1.3rem;
    transform-origin: center;
    animation: weatherIconPulse 2.8s ease-in-out infinite;
}

.hero-weather-icon.is-rainy,
.hero-weather-icon.is-stormy {
    animation: weatherIconShake 1.9s ease-in-out infinite;
}

.hero-weather-icon.is-cloudy,
.hero-weather-icon.is-foggy {
    animation: weatherIconFloat 3.6s ease-in-out infinite;
}

.hero-weather-temp {
    font-size: 1rem;
}

.hero-city-name {
    margin-top: 0.35rem;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #64748b;
}

@keyframes weatherIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

@keyframes weatherIconFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes weatherIconShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(8deg);
    }
}

.hero-image img {
    height: 180px;
    object-fit: contain;
}

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

.dash-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.dash-card-header h3 {
    font-size: 1.1rem;
    color: #475569;
    font-weight: 600;
}

.dash-event-list {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.event-item {
    padding: 12px;
    border: 1px solid #edf2f7;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.event-item-upcoming {
    background: #ffffff;
}

.event-item-completed {
    background: #f0fdf4;
}

.event-icon {
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-icon-upcoming {
    background: #ff9933;
}

.event-icon-completed {
    background: #138808;
}

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

.event-title {
    margin: 0;
    font-size: 1rem;
    color: #1f2937;
}

.event-title-completed {
    text-decoration: line-through;
    color: #4b5563;
}

.event-dates {
    margin: 4px 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.event-note-wrap {
    margin-top: 2px;
}

.event-note {
    margin: 0;
    font-size: 0.87rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.event-note.is-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-note-toggle {
    margin-top: 4px;
    border: none;
    background: none;
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.event-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

body.dark-mode .event-item {
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

body.dark-mode .event-item-upcoming {
    background: rgba(30, 41, 59, 0.9);
}

body.dark-mode .event-item-completed {
    background: rgba(20, 83, 45, 0.45);
}

body.dark-mode .event-title {
    color: var(--focus-text-color);
}

body.dark-mode .event-title-completed,
body.dark-mode .event-dates,
body.dark-mode .event-note {
    color: #cbd5e1;
}

body.dark-mode .event-note-toggle {
    color: #93c5fd;
}


.event-note-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    padding: 16px;
}

.event-note-modal-overlay.is-visible {
    display: flex;
}

.event-note-modal-card {
    width: min(680px, 100%);
    max-height: 80vh;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.event-note-modal-title {
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    color: #0f172a;
    font-size: 1rem;
}

.event-note-modal-body {
    padding: 16px 18px;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-y: auto;
}

.event-note-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 14px 18px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

body.dark-mode .event-note-modal-card {
    background: #0f172a;
}

body.dark-mode .event-note-modal-title {
    color: #f8fafc;
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

body.dark-mode .event-note-modal-body {
    color: #cbd5e1;
}

body.dark-mode .event-note-modal-footer {
    border-top-color: rgba(148, 163, 184, 0.35);
    background: #111827;
}

.icon-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.dash-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 10px;
}

.task-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-card.tasks-card .task-icon-circle {
    background: #fee2e2;
    color: #ef4444;
}

.task-info h4 {
    font-size: 0.95rem;
    margin: 0;
    color: #1e293b;
}

.task-info p {
    font-size: 0.8rem;
    margin: 0;
    color: #64748b;
}

.progress-ring-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.progress-ring {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 12px solid #e2e8f0;
    border-top-color: #3b82f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-ring span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e293b;
}

.progress-ring small {
    font-size: 0.8rem;
    color: #64748b;
}

.progress-ring-inner {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.dark-mode .progress-ring-inner {
    background: var(--bg-card);
}

body.dark-mode .progress-ring-inner span {
    color: var(--text-main) !important;
}

body.dark-mode .progress-ring-inner small {
    color: var(--text-muted) !important;
}

.progress-footer {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #475569;
}

.btn-dash-action {
    background: #ffe4e6;
    color: #e11d48;
    border: none;
    width: 100%;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: auto;
}

.btn-dash-outline {
    background: #eff6ff;
    color: #2563eb;
    border: none;
    width: 100%;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: auto;
}

.btn-dash-outline.downloading {
    opacity: 0.9;
    cursor: wait;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-dash-outline.analyzing {
    opacity: 0.9;
    cursor: progress;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-dash-outline.analyzing::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(37, 99, 235, 0.25);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: dashBtnSpin 0.8s linear infinite;
}

.btn-dash-outline.downloading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(37, 99, 235, 0.25);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: dashBtnSpin 0.8s linear infinite;
}

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

.btn-dash-link {
    background: none;
    border: none;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

#dashQuickNote {
    width: 100%;
    height: 120px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.95rem;
    color: #1e293b;
    resize: none;
    margin-bottom: 1rem;
}

.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-box {
    padding: 1.5rem;
    border-radius: 20px;
    color: white;
}

.stat-box.purple {
    background: #8b5cf6;
}

.stat-box.blue {
    background: #3b82f6;
}

.stat-box.pink {
    background: #ec4899;
}

.stat-box.orange {
    background: #f97316;
}

.stat-box h2 {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
}

.stat-box p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* --- Timer Styles --- */
.timer-fullscreen-card {
    min-height: 68vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    transition: background-image 0.9s ease, transform 0.25s ease;
}

.timer-fullscreen-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(160deg, rgba(5, 10, 26, 0.78) 0%, rgba(8, 17, 38, 0.62) 45%, rgba(14, 116, 144, 0.44) 100%);
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.timer-fullscreen-card.timer-fullscreen-active::before {
    opacity: 1;
}

.timer-overlay-content {
    position: relative;
    z-index: 1;
    max-width: 940px;
    margin: 0 auto;
}

.timer-display {
    font-size: clamp(2.4rem, 7vw, 5rem);
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    color: var(--secondary-color);
    margin: 1.4rem 0;
    letter-spacing: 0.18em;
    line-height: 1.1;
}

.timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.timer-controls .btn {
    padding: 0.95rem 2.6rem;
    border-radius: 50px;
    margin: 0;
    min-width: 170px;
}

.timer-controls .btn:nth-child(odd) {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
}

.timer-controls .btn:nth-child(even) {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%) !important;
}

.timer-widget-placement-row {
    margin-top: 1rem;
    display: grid;
    gap: 0.45rem;
    justify-items: center;
}

.timer-widget-pin-btn {
    border: 1px solid rgba(125, 211, 252, 0.58);
    background: linear-gradient(135deg, rgba(240, 249, 255, 0.95) 0%, rgba(224, 242, 254, 0.9) 100%);
    color: #0f172a;
    box-shadow: 0 8px 20px rgba(14, 116, 144, 0.18);
}

.timer-widget-placement-hint {
    display: block;
    font-size: 0.84rem;
    color: #475569;
}

.timer-fullscreen-minimize-btn {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    transform: translate(-26%, -26%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(145deg, #f8fafc 0%, #bae6fd 100%);
    color: #0f172a;
    font-size: 1.8rem;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(14, 116, 144, 0.3);
    cursor: pointer;
    z-index: 5;
}

.timer-fullscreen-minimize-btn:hover {
    transform: translate(-26%, -26%) scale(1.04);
}

.timer-fullscreen-card.timer-fullscreen-active .timer-fullscreen-minimize-btn {
    display: inline-flex;
}

.timer-stats {
    font-size: 1.08rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.1rem 1.6rem;
}

.timer-fullscreen-card.timer-fullscreen-active h2,
.timer-fullscreen-card.timer-fullscreen-active p,
.timer-fullscreen-card.timer-fullscreen-active .timer-display {
    color: var(--focus-text-color);
}

.timer-fullscreen-card.timer-fullscreen-active .timer-display {
    text-shadow: 0 8px 30px rgba(2, 6, 23, 0.58);
}

.timer-fullscreen-card.timer-fullscreen-active .timer-stats {
    color: var(--focus-subtext-color);
}

.timer-fullscreen-card.timer-fullscreen-active .timer-widget-placement-hint {
    color: rgba(226, 232, 240, 0.94);
}

.timer-fullscreen-card.timer-fullscreen-active #sessionTime {
    color: #fbbf24 !important;
}

.timer-fullscreen-card.timer-fullscreen-active #sessionCounter {
    color: #7dd3fc !important;
}

.timer-fullscreen-card:fullscreen,
.timer-fullscreen-card:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: clamp(1rem, 2.8vh, 2rem) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-fullscreen-card:fullscreen .timer-overlay-content,
.timer-fullscreen-card:-webkit-full-screen .timer-overlay-content {
    width: min(980px, 94vw);
}

.timer-fullscreen-card:fullscreen .timer-fullscreen-minimize-btn,
.timer-fullscreen-card:-webkit-full-screen .timer-fullscreen-minimize-btn {
    display: inline-flex;
}

.timer-fullscreen-card:fullscreen #resetTimerBtn,
.timer-fullscreen-card:fullscreen #minimizeTimerBtn,
.timer-fullscreen-card:fullscreen .timer-widget-placement-row,
.timer-fullscreen-card:-webkit-full-screen #resetTimerBtn,
.timer-fullscreen-card:-webkit-full-screen #minimizeTimerBtn,
.timer-fullscreen-card:-webkit-full-screen .timer-widget-placement-row {
    display: none !important;
}

.timer-floating-widget {
    position: fixed;
    right: clamp(0.8rem, 2.6vw, 1.4rem);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.9rem);
    width: min(330px, calc(100vw - 1.6rem));
    z-index: 10008;
    border-radius: 22px;
    padding: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.95) 0%, rgba(14, 116, 144, 0.9) 100%);
    color: #f8fafc;
    box-shadow: 0 16px 38px rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(8px);
    display: grid;
    gap: 0.55rem;
    animation: timer-widget-pop 0.22s ease;
}

.timer-widget-title {
    border: none;
    width: 100%;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0;
}

.timer-widget-display {
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(1.24rem, 4.8vw, 1.86rem);
    letter-spacing: 0.13em;
    font-weight: 700;
}

.timer-widget-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.timer-widget-controls .btn {
    min-width: 0;
    border-radius: 999px;
    font-size: 0.88rem;
    padding: 0.5rem 0.65rem;
}

.timer-widget-pin-mini {
    width: 100%;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.5);
    color: var(--focus-text-color);
}

.timer-widget-pin-mini i {
    color: #fde68a;
}

body.dark-mode .timer-widget-pin-btn {
    border-color: rgba(125, 211, 252, 0.45);
    background: rgba(15, 23, 42, 0.56);
    color: var(--focus-text-color);
}

body.dark-mode .timer-floating-widget {
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 16px 42px rgba(2, 6, 23, 0.5);
}

@keyframes timer-widget-pop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


.focus-mode-card {
    --focus-text-color: #f8fafc;
    --focus-subtext-color: rgba(248, 250, 252, 0.95);
    --focus-overlay-opacity: 0.18;
    min-height: 72vh;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    transition: background-image 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(8, 15, 28, var(--focus-overlay-opacity));
}

.focus-overlay-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--focus-text-color);
    width: min(780px, 100%);
    margin: 0 auto;
    padding: 2rem 1.25rem;
    display: grid;
    gap: 1rem;
}

.focus-overlay-content h2 {
    margin: 0;
}

.focus-overlay-content>p {
    margin: 0;
    color: var(--focus-subtext-color);
}

.focus-timer-row {
    max-width: 240px;
    margin: 0 auto;
    text-align: left;
}

.focus-timer-row label {
    color: var(--focus-subtext-color);
    font-weight: 600;
}

.focus-timer-row .form-control {
    margin-top: 0.45rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: var(--focus-text-color);
    text-align: center;
    font-size: 1.03rem;
}

.focus-timer-row .form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.24);
}



.focus-motivation-carousel {
    max-width: min(740px, 100%);
    margin: 0 auto;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(3px);
}

.focus-motivation-carousel p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--focus-text-color);
    transition: opacity 220ms ease;
}

.focus-motivation-carousel.is-changing p {
    opacity: 0.28;
}
.focus-player {
    margin-top: 0.45rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 1rem 1rem 1.1rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(226, 232, 240, 0.28);
}

.focus-player h4 {
    margin: 0 0 0.65rem;
    color: var(--focus-text-color);
}

#focusTrackSelect {
    background: rgba(15, 23, 42, 0.46);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: var(--focus-text-color);
}

.focus-player-controls {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.focus-player-controls .btn {
    min-width: 106px;
}

.focus-player-controls input[type='range'] {
    width: min(220px, 46vw);
}

.focus-mode-card:fullscreen,
.focus-mode-card:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: clamp(0.8rem, 2.4vh, 1.8rem);
}

.focus-mode-card:fullscreen .focus-overlay-content,
.focus-mode-card:-webkit-full-screen .focus-overlay-content {
    width: min(860px, 95vw);
}

.about-us-card {
    display: grid;
    gap: 1rem;
}

.about-us-summary {
    margin: 0;
    color: var(--text-muted);
    max-width: 880px;
}

.about-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.about-us-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.95rem;
    background: rgba(255, 255, 255, 0.72);
}

.about-us-item h4 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    color: var(--text-color);
}

.about-us-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.45;
}

body.dark-mode .about-us-item {
    background: rgba(15, 23, 42, 0.64);
    border-color: #334155;
}

body.dark-mode .about-us-item h4 {
    color: #e2e8f0;
}

@media (max-width: 1024px) {
    .timer-widget-pin-btn {
        width: min(100%, 360px);
    }

    .focus-overlay-content {
        width: min(760px, 100%);
        padding: 1.55rem 1rem;
    }

    .focus-player-controls .btn {
        min-width: 98px;
    }
}

@media (max-width: 768px) {
    .timer-controls .btn {
        min-width: min(320px, 100%);
    }

    .timer-fullscreen-minimize-btn {
        width: 44px;
        height: 44px;
        font-size: 1.65rem;
    }

    .timer-stats {
        font-size: 1rem;
    }

    .timer-widget-pin-btn {
        width: 100%;
    }

    .timer-floating-widget {
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        border-radius: 18px;
    }

    .timer-fullscreen-card:fullscreen .timer-overlay-content,
    .timer-fullscreen-card:-webkit-full-screen .timer-overlay-content {
        width: 100%;
    }

    .focus-overlay-content {
        padding: 1.1rem 0.45rem;
        gap: 0.8rem;
    }

    .focus-player {
        padding: 0.8rem;
    }

    .focus-player-controls {
        gap: 0.5rem;
    }

    .focus-player-controls .btn {
        min-width: 42%;
        padding: 0.72rem 0.85rem;
    }

    .focus-player-controls input[type='range'] {
        width: 100%;
        order: 10;
    }
}

@media (max-width: 480px) {
    .timer-display {
        letter-spacing: 0.11em;
    }

    .timer-widget-display {
        letter-spacing: 0.1em;
    }

    .timer-widget-controls .btn {
        font-size: 0.82rem;
        padding: 0.45rem 0.45rem;
    }

    .timer-widget-pin-mini {
        font-size: 0.8rem;
    }

    .timer-fullscreen-card {
        min-height: 64vh;
    }

    .focus-mode-card {
        min-height: 66vh;
    }

    .about-us-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Community Badge Enhancement --- */
.notification-badge {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    position: absolute;
    top: -5px;
    right: -10px;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* --- Dark Mode Toggle Switch --- */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Dark Mode Toggle Highlight */
input:checked+.slider {
    background-color: var(--primary-color);
    border: 2px solid white !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5) !important;
}

/* Removed rectangular highlight from container */
/* body.dark-mode #darkModeToggle {
    outline: 2px solid white !important;
    outline-offset: 2px !important;
} */

/* Removed rectangular box-shadow from switch container */
/* body.dark-mode .switch {
    box-shadow: 0 0 0 2px white !important;
} */

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .hero-live-panel {
        margin: 0;
        text-align: center;
        min-width: 170px;
    }

    .hero-image {
        margin-top: 1.5rem;
    }

    .hero-text h1 {
        font-size: 2rem;
    }
}

/* --- Notification controls in profile --- */
.notifications-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.notification-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1 1 360px;
    min-height: 56px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff8ef 0%, #ffffff 100%);
}

.notification-toggle-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.notification-toggle-text strong {
    color: #b45309;
    font-size: 0.95rem;
}

.notification-toggle-text small {
    color: #64748b;
    font-size: 0.78rem;
}

.notification-switch {
    flex-shrink: 0;
}


body.dark-mode .notification-toggle-card {
    border-color: #334155;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body.dark-mode .notification-toggle-text strong {
    color: #fcd34d;
}

body.dark-mode .notification-toggle-text small {
    color: #cbd5e1;
}

body.dark-mode .slider {
    background-color: #475569;
}

body.dark-mode .slider:before {
    background-color: #f8fafc;
}

@media (max-width: 768px) {
    .notification-toggle-card {
        width: 100%;
    }

}

/* --- UI refresh: back button, badges, and button consistency --- */
.back-nav-btn {
    background: rgba(17, 24, 39, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.back-nav-btn i {
    color: #dbeafe !important;
    font-size: 1.05rem;
}

.notification-badge {
    display: none;
}

.btn,
.tab,
.card,
.dash-card {
    animation: fadeInUp 0.45s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.btn-primary,
.btn-secondary,
.btn-info,
.btn-success {
    background: linear-gradient(135deg, #38bdf8 0%, #2dd4bf 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.btn-secondary,
.btn-info {
    background: linear-gradient(135deg, #2dd4bf 0%, #0ea5e9 100%) !important;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-info:hover,
.btn-success:hover {
    filter: brightness(1.08);
}

body.dark-mode .btn-primary,
body.dark-mode .btn-secondary,
body.dark-mode .btn-info,
body.dark-mode .btn-success {
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%) !important;
    color: #ffffff !important;
}

body.dark-mode .btn-secondary,
body.dark-mode .btn-info {
    background: linear-gradient(135deg, #0d9488 0%, #0369a1 100%) !important;
}

@media (prefers-reduced-motion: reduce) {

    .btn,
    .tab,
    .card,
    .dash-card {
        animation: none;
    }
}

.time-greeting-animated {
    display: inline-block;
    animation: greetingPulse 1.8s ease-in-out infinite;
}

@keyframes greetingPulse {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.85;
    }

    50% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

/* AI Guide */
.ai-guide-card {
    height: var(--chat-tab-height, calc(100dvh - 7.2rem));
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
    box-shadow: none;
    border: 0;
}

#ai-guide.tab-content.active {
    overflow: hidden;
}

.ai-guide-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
}

.ai-guide-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-guide-toolbar-clean {
    justify-content: space-between;
    align-items: center;
}

.ai-guide-refresh-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.ai-guide-refresh-btn i {
    transition: transform 0.35s ease;
}

.ai-guide-refresh-btn:hover i {
    transform: rotate(180deg);
}

.ai-guide-refresh-btn.is-refreshing i {
    animation: aiGuideSpin 0.85s linear infinite;
}

.ai-guide-refresh-btn:focus-visible i,
.ai-guide-refresh-btn:active i {
    animation: aiGuideSpin 0.7s linear;
}

@keyframes aiGuideSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ai-guide-actions-dropdown-wrap {
    position: relative;
}

.ai-guide-actions-trigger {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-guide-actions-dropdown {
    position: absolute;
    width: min(220px, calc(100vw - 16px));
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 2300;
    overflow-y: auto;
    max-height: min(70vh, 320px);
}

.ai-guide-actions-dropdown.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.ai-guide-actions-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.ai-guide-actions-item:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-card) 90%);
}

.ai-guide-actions-item.danger:hover {
    background: color-mix(in srgb, #ef4444 15%, var(--bg-card) 85%);
}

.ai-guide-attachment-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ai-guide-chat-panel {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 100%;
    height: var(--chat-tab-height, calc(100vh - 6.5rem));
    overflow: hidden;
    width: min(980px, 100%);
    margin-inline: auto;
    padding: clamp(0.35rem, 1vw, 0.8rem) clamp(0.35rem, 1.8vw, 1rem) 0;
}

.ai-guide-chat-window {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    position: relative;
}

.ai-guide-chat-corner-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 6;
}

.ai-guide-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 430px;
    overflow-y: auto;
}

.ai-guide-history-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem;
    padding: 0.35rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.ai-guide-history-item.active {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
}

.ai-guide-history-item.new-chat .ai-guide-history-open {
    font-weight: 600;
    color: #6366f1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-guide-history-item.new-chat {
    border: 1px dashed rgba(99, 102, 241, 0.35);
    margin-bottom: 0.3rem;
}

body.dark-mode .ai-guide-history-item.new-chat .ai-guide-history-open {
    color: #818cf8;
}

.ai-guide-history-open {
    border: none;
    background: transparent;
    text-align: left;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
}

.ai-guide-history-open span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.ai-guide-history-actions {
    display: flex;
    gap: 0.25rem;
}

.ai-guide-history-actions .btn {
    padding: 0.25rem 0.45rem;
}

.ai-guide-history-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem;
}

.ai-guide-status {
    min-height: 18px;
    font-size: 0.84rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-align: center;
}

.ai-guide-status.thinking,
.ai-guide-status.web-search {
    color: #2563eb;
    animation: pulseStatus 1s ease-in-out infinite;
}

@keyframes pulseStatus {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 1;
    }
}

.ai-guide-message.streaming {
    position: relative;
}

/* Chain-of-Thought collapsible */
.ai-guide-cot-wrap {
    margin-bottom: 0.6rem;
    border: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, var(--bg-secondary, #f8fafc) 70%, transparent);
}

.ai-guide-cot-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    border: 0;
    background: transparent;
    color: #6366f1;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ai-guide-cot-toggle:hover {
    background: color-mix(in srgb, #6366f1 8%, transparent);
}

.ai-guide-cot-arrow {
    margin-left: auto;
    font-size: 0.68rem;
    transition: transform 0.25s ease;
}

.ai-guide-cot-wrap.open .ai-guide-cot-arrow {
    transform: rotate(180deg);
}

.ai-guide-cot-body {
    max-height: 0;
    overflow: hidden;
    padding: 0 0.7rem;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted);
    border-top: 1px solid transparent;
    transition: max-height 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
    white-space: pre-wrap;
}

.ai-guide-cot-wrap.open .ai-guide-cot-body {
    max-height: 500px;
    padding: 0.55rem 0.7rem;
    border-top-color: color-mix(in srgb, var(--border-color) 50%, transparent);
}

body.dark-mode .ai-guide-cot-wrap {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(100, 116, 139, 0.3);
}

body.dark-mode .ai-guide-cot-toggle {
    color: #818cf8;
}

body.dark-mode .ai-guide-cot-toggle:hover {
    background: rgba(129, 140, 248, 0.1);
}

body.dark-mode .ai-guide-cot-body {
    color: #94a3b8;
}

/* Web Search Chip */
.ai-guide-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.ai-guide-chip.searching {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.25);
    animation: pulseChip 1.4s ease-in-out infinite;
}

.ai-guide-chip.done {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

@keyframes pulseChip {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

body.dark-mode .ai-guide-chip.searching {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

body.dark-mode .ai-guide-chip.done {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.ai-guide-messages {
    min-height: 0;
    height: 100%;
    flex: 1;
    overflow-y: auto;
    border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
    border-radius: 22px;
    padding: clamp(0.8rem, 1.8vw, 1.25rem);
    padding-top: clamp(2.4rem, 3.2vw, 2.8rem);
    background: color-mix(in srgb, var(--bg-card) 96%, #f8fafc 4%);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.ai-guide-messages::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ai-guide-messages::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 35%, transparent);
    border-radius: 999px;
}

.ai-guide-message {
    position: relative;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    white-space: pre-wrap;
    max-width: min(80%, 720px);
    line-height: 1.5;
    font-size: 0.96rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.ai-guide-message.user {
    background: #e9f2ff;
    color: #0f172a;
    border: 1px solid #c8dbff;
    align-self: flex-end;
    border-bottom-right-radius: 7px;
}

.ai-guide-message.user::after {
    display: none;
}

.ai-guide-message.bot {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 7px;
}

.ai-guide-message.bot::after {
    display: none;
}

body.dark-mode .ai-guide-message.user {
    background: #1f3048;
    color: #dbeafe;
    border-color: #35537b;
}

body.dark-mode .ai-guide-message.user::after {
    border-left-color: #1d4d3f;
}

body.dark-mode .ai-guide-message.bot {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark-mode .ai-guide-message.bot::after {
    border-right-color: #0f172a;
}


.ai-guide-message.bot {
    padding-top: 1.95rem;
}

.ai-guide-message-actions {
    position: absolute;
    top: 0.3rem;
    right: 0.35rem;
    display: inline-flex;
    gap: 0.28rem;
    z-index: 2;
}

.ai-guide-response-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
    background: color-mix(in srgb, var(--bg-card) 82%, transparent);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.16s ease;
}

.ai-guide-response-action-btn:hover {
    color: var(--text-primary);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

body.dark-mode .ai-guide-response-action-btn {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
}


.ai-guide-composer-shell {
    flex-shrink: 0;
    position: relative;
    padding: 0 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, color-mix(in srgb, var(--bg-main) 95%, transparent), transparent);
}

.ai-guide-input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    position: relative;
    background: color-mix(in srgb, var(--bg-card) 94%, white 6%);
    padding: 0.55rem;
    border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent);
    border-radius: 18px;
    z-index: 4;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.09);
}

.ai-guide-input-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

#aiGuideInput {
    min-height: 44px;
    max-height: 140px;
    flex: 1;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.55rem 0.25rem;
    resize: none;
    line-height: 1.45;
}

#aiGuideInput:focus {
    outline: none;
    box-shadow: none;
}

.ai-guide-send-btn {
    padding: 0.58rem 1rem;
    font-size: 0.92rem;
    white-space: nowrap;
    border-radius: 12px;
}

.ai-guide-mic-btn,
.ai-guide-refresh-btn,
.ai-guide-actions-trigger {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.ai-guide-chat-corner-actions .ai-guide-actions-trigger {
    background: color-mix(in srgb, var(--bg-card) 86%, #fff 14%);
    border-color: color-mix(in srgb, var(--border-color) 78%, transparent);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
}

.ai-guide-mic-btn.recording {
    background: #dc2626;
    border-color: #dc2626;
    color: var(--focus-text-color);
    animation: pulseMic 1.1s infinite;
}

@keyframes pulseMic {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.ai-guide-message.loading {
    opacity: 0.95;
}

.ai-guide-typing-dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.ai-guide-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.25;
    animation: aiGuideTypingDots 1.1s infinite ease-in-out;
}

.ai-guide-typing-dots span:nth-child(2) {
    animation-delay: 0.18s;
}

.ai-guide-typing-dots span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes aiGuideTypingDots {

    0%,
    80%,
    100% {
        opacity: 0.2;
        transform: translateY(0);
    }

    40% {
        opacity: 0.9;
        transform: translateY(-2px);
    }
}

@media (max-width: 900px) {
    .ai-guide-card {
        height: var(--chat-tab-height, calc(100dvh - 9.8rem));
    }

    .ai-guide-chat-panel {
        width: 100%;
        padding: 0.25rem 0.15rem 0;
        gap: 0.5rem;
    }

    .ai-guide-messages {
        flex: 1;
        border-radius: 16px;
        padding: 0.75rem;
    }

    .ai-guide-composer-shell {
        padding: 0 0 calc(0.3rem + env(safe-area-inset-bottom, 0px));
    }

    .ai-guide-input-row {
        align-items: flex-end;
        flex-wrap: nowrap;
        padding: 0.4rem;
        gap: 0.35rem;
        border-radius: 14px;
    }

    .ai-guide-input-tools {
        width: auto;
        justify-content: flex-start;
    }

    .ai-guide-send-btn {
        padding-inline: 0.7rem;
    }

    .ai-guide-message {
        max-width: 90%;
        font-size: 0.93rem;
    }
}

.ai-guide-history-modal-body {
    max-height: 62vh;
    overflow-y: auto;
    display: grid;
    gap: 0.75rem;
}

.ai-guide-history-modal-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    background: var(--bg-secondary);
}

.ai-guide-history-modal-item h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.ai-guide-history-modal-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}


.ai-guide-history-modal-actions {
    margin-top: 0.6rem;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ai-guide-history-modal-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ai-guide-history-selector {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    display: inline-flex;
    align-items: center;
}

.ai-guide-history-modal-item {
    position: relative;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.ai-guide-history-modal-item:hover {
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.shared-sarthai-card .shared-note-subject {
    color: #2563eb;
}

.language-toggle-card {
    gap: 14px;
}

.language-select {
    max-width: 170px;
    min-width: 130px;
}

.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

@media (min-width: 901px) {
    .mobile-tab-dropdown-wrap {
        display: none !important;
    }

    .mobile-tab-dropdown-menu {
        display: none !important;
    }

}


.community-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.community-search-toggle {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.community-search-row {
    display: flex;
    margin-bottom: 0.7rem;
}

.marketplace-card {
    display: grid;
    gap: 0.9rem;
}

.marketplace-compose-card,
.pyq-analysis-summary-card {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.04));
}

.marketplace-compose-card.collapsed .marketplace-compose-grid,
.marketplace-compose-card.collapsed .marketplace-compose-actions {
    display: none;
}

.marketplace-search-row.collapsed {
    display: none;
}

.marketplace-compose-top,
.pyq-header-shell,
.pyq-leaderboard-header,
.pyq-panel-header,
.pyq-leaderboard-title-row,
.pyq-toolbar-row,
.pyq-chip-inline-row,
.marketplace-compose-actions,
.marketplace-card-actions,
.marketplace-type-chips {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

#pyqs .btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

#pyqs .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 0 18px rgba(59, 130, 246, 0.22);
}

#pyqs .btn.btn-primary {
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

#pyqs .btn.btn-outline-secondary {
    border-color: rgba(59, 130, 246, 0.28);
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.88);
}

.pyq-header-subtitle,
.pyq-panel-subtitle,
.marketplace-slider-label,
.marketplace-chip-caption {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.marketplace-avatar-pill {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    color: #fff;
    display: grid;
    place-items: center;
}

.pyq-toolbar-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.pyq-toolbar-row .btn {
    width: 100%;
}

.pyq-mode-toggle-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.pyq-mode-toggle-row .btn {
    width: 100%;
}

.marketplace-compose-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
    gap: 12px;
}

.marketplace-filter-panel {
    display: grid;
    gap: 10px;
    align-content: start;
}

.marketplace-type-chip {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
}

.marketplace-header h2 {
    margin-bottom: 0.35rem;
}

.marketplace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.marketplace-header p {
    margin: 0;
    color: var(--text-muted);
}

.marketplace-search-toggle-row {
    display: flex;
    justify-content: flex-end;
}

.marketplace-search-row {
    display: flex;
    gap: 0.65rem;
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}

.marketplace-item-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.marketplace-item-image {
    width: 100%;
    min-width: 220px;
    height: 190px;
    object-fit: cover;
    background: #e2e8f0;
}

.marketplace-image-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0.75rem 0.75rem;
}

.marketplace-item-body {
    padding: 0.75rem;
    display: grid;
    gap: 0.5rem;
}

.marketplace-social-card {
    border-radius: 18px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.marketplace-user-row,
.marketplace-title-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0.9rem 0.75rem 0.35rem;
}

.marketplace-user-row span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.marketplace-post-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.marketplace-item-body h4 {
    font-size: 0.95rem;
    margin: 0;
}

.marketplace-item-tag {
    display: inline-flex;
    width: fit-content;
    font-size: 0.74rem;
    background: #e0ecff;
    color: #1e40af;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.marketplace-item-tag-prominent {
    align-self: flex-start;
    font-weight: 800;
    font-size: 0.82rem;
    background: rgba(250, 204, 21, 0.22);
    color: #92400e;
    padding: 0.35rem 0.7rem;
}

.marketplace-item-body p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.marketplace-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.marketplace-share-preview,
.marketplace-comment-card,
.marketplace-reply-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.85rem;
    background: var(--bg-secondary);
}

.marketplace-comments-thread,
.marketplace-reply-list {
    display: grid;
    gap: 10px;
    margin-left: 1rem;
    padding-left: 0.9rem;
    border-left: 2px solid rgba(148, 163, 184, 0.28);
}

.marketplace-comment-composer {
    border-top: 1px solid var(--border-color);
    margin-top: 14px;
    padding-top: 14px;
}

.marketplace-card {
    gap: 1rem;
}

.marketplace-header {
    display: grid;
    gap: 0.35rem;
}

.marketplace-composer {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-secondary) 82%, white 18%);
}

.marketplace-composer-grid {
    display: grid;
    grid-template-columns: 1.2fr minmax(140px, 0.75fr) minmax(120px, 0.7fr) minmax(140px, 0.8fr) 1fr;
    gap: 0.75rem;
}

.marketplace-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.marketplace-upload-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.marketplace-upload-preview {
    display: grid;
    gap: 0.65rem;
}

.marketplace-upload-chip {
    display: grid;
    grid-template-columns: 68px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
}

.marketplace-upload-thumb {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 12px;
    background: #dbe4f0;
}

.marketplace-upload-meta {
    display: grid;
    gap: 0.15rem;
}

.marketplace-upload-meta strong {
    font-size: 0.9rem;
    word-break: break-word;
}

.marketplace-upload-meta span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.marketplace-upload-remove {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    cursor: pointer;
}

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

.marketplace-post-card {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg-card);
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.marketplace-post-header {
    display: grid;
    gap: 0.65rem;
}

.marketplace-post-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.marketplace-post-meta {
    display: grid;
    gap: 0.2rem;
    margin-top: 0;
    font-size: inherit;
}

.marketplace-post-meta h4 {
    margin: 0;
    font-size: 1rem;
}

.marketplace-post-meta span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.marketplace-post-user {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
}

.marketplace-post-menu {
    position: relative;
    flex-shrink: 0;
}

.marketplace-post-menu-trigger {
    min-width: 42px;
    padding-inline: 0.8rem;
}

.marketplace-post-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 148px;
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.16);
    display: none;
    z-index: 5;
}

.marketplace-post-menu.is-open .marketplace-post-menu-panel {
    display: grid;
    gap: 0.2rem;
}

.marketplace-post-menu-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.72rem 0.8rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.marketplace-post-menu-item:hover {
    background: rgba(148, 163, 184, 0.12);
}

.marketplace-post-menu-item.danger {
    color: #dc2626;
}

.marketplace-location-link {
    border: 0;
    cursor: pointer;
}

.marketplace-location-link:hover {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.marketplace-pill-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.marketplace-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 0.76rem;
    font-weight: 600;
    background: #e0ecff;
    color: #1e40af;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
}

.marketplace-pill-muted {
    background: #f1f5f9;
    color: #475569;
}

.marketplace-pill-price {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.marketplace-post-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.marketplace-post-content {
    display: grid;
    gap: 0.85rem;
}

.marketplace-post-media {
    display: grid;
    gap: 0.5rem;
}

.marketplace-post-media.is-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketplace-post-media-link {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: #dbe4f0;
}

.marketplace-post-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.marketplace-post-body {
    display: grid;
    gap: 0.5rem;
}

.marketplace-post-body p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.marketplace-post-body p em {
    font-style: italic;
}

.marketplace-post-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.marketplace-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.marketplace-action-btn.is-active {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.18);
}

.marketplace-comments-modal {
    max-width: 760px;
}

.marketplace-edit-modal {
    max-width: 760px;
}

.marketplace-edit-body {
    display: grid;
    gap: 0.9rem;
}

.marketplace-comments-body {
    display: grid;
    gap: 0.9rem;
}

.marketplace-comments-list {
    display: grid;
    gap: 0.8rem;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.marketplace-comment-card {
    border-radius: 16px;
    background: var(--bg-card);
    padding: 0.9rem 1rem;
    display: grid;
    gap: 0.45rem;
}

.marketplace-comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
}

.marketplace-comment-meta span {
    color: var(--text-muted);
}

.marketplace-comment-parent {
    display: grid;
    gap: 0.15rem;
    padding-left: 0.8rem;
    border-left: 3px solid rgba(37, 99, 235, 0.22);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.marketplace-comment-card p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.marketplace-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.marketplace-comment-actions .btn {
    padding-inline: 0.7rem;
}

.marketplace-comment-actions .btn.is-active {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.22);
    color: #1d4ed8;
}

.marketplace-comment-node {
    display: grid;
    gap: 0.55rem;
}

.marketplace-comment-card.is-reply {
    background: color-mix(in srgb, var(--bg-card) 88%, #eff6ff 12%);
}

.marketplace-reply-helper {
    display: grid;
    gap: 0.45rem;
}

.marketplace-reply-target {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 14px;
    background: rgba(219, 234, 254, 0.45);
    font-size: 0.84rem;
    color: var(--text-muted);
}

.marketplace-comment-form {
    display: grid;
    gap: 0.7rem;
}

.marketplace-empty {
    padding: 1.2rem;
}

@media (max-width: 640px) {
    .marketplace-search-row {
        flex-direction: column;
    }

    .marketplace-composer-grid,
    .marketplace-compose-grid,
    .pyq-leaderboard-row-card,
    .pyq-toolbar-row,
    .pyq-mode-toggle-row {
        grid-template-columns: 1fr;
    }

    .marketplace-composer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .marketplace-post-image {
        height: 180px;
    }
}

/* Sidebar layout revamp (YouTube-inspired) */
#mainApp {
    min-height: 100vh;
}

#mainApp .app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    transition: grid-template-columns 0.25s ease;
}

#mainApp .sidebar-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #0f1115;
    color: #f8fafc;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 0.65rem;
    z-index: 1201;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#mainApp.sidebar-collapsed .sidebar-nav {
    padding: 0.75rem 0.5rem;
}


body:not(.dark-mode) #mainApp .sidebar-nav {
    background: #ffffff;
    color: #0f172a;
    border-right: 1px solid #dbe3ef;
}

body:not(.dark-mode) #mainApp .sidebar-topbar {
    border-bottom-color: #e2e8f0;
}

body:not(.dark-mode) #mainApp .sidebar-brand h1 {
    color: #0f172a;
}

body:not(.dark-mode) #mainApp .sidebar-brand small {
    color: #64748b;
}

body:not(.dark-mode) #mainApp .sidebar-icon-btn {
    background: #e8f0ff;
    color: #1e293b;
}

body:not(.dark-mode) #mainApp .sidebar-nav .tab {
    color: #1f2937;
}

body:not(.dark-mode) #mainApp .sidebar-nav .tab:hover {
    background: #edf3ff;
    color: #0f172a;
}

body:not(.dark-mode) #mainApp .sidebar-nav .tab.active {
    background: #dbeafe;
    color: #0f172a;
}

#mainApp .sidebar-topbar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 0.65rem;
    padding: 0.2rem 0.2rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mainApp .sidebar-brand {
    min-width: 0;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mainApp .sidebar-brand h1 {
    font-size: 1.2rem;
    line-height: 1.2;
    color: #ffffff;
    font-weight: 700;
    margin: 0;
}

#mainApp .sidebar-brand small {
    color: rgba(226, 232, 240, 0.75);
    font-size: 0.72rem;
}

#mainApp .sidebar-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    padding: 0 0.2rem;
}

#mainApp .sidebar-talkback-switch {
    width: 48px;
    height: 26px;
}

#mainApp .sidebar-talkback-switch .slider:before {
    width: 18px;
    height: 18px;
    left: 4px;
    bottom: 4px;
}

#mainApp .sidebar-talkback-switch input:checked+.slider:before {
    transform: translateX(22px);
}

#mainApp .sidebar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    line-height: 1;
}

#mainApp .sidebar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

#mainApp .sidebar-nav .mobile-tab-dropdown-wrap {
    display: none;
}

#mainApp .sidebar-nav .tabs {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: transparent;
    box-shadow: none;
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
    padding: 0;
}

#mainApp .sidebar-nav .tabs::-webkit-scrollbar {
    width: 6px;
}

#mainApp .sidebar-nav .tabs::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.7);
    border-radius: 999px;
}

#mainApp .sidebar-nav .tabs::-webkit-scrollbar-track {
    background: transparent;
}

#mainApp .sidebar-nav .tabs::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

#mainApp .sidebar-nav .tab {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: rgba(255, 255, 255, 0.86);
    border-radius: 10px;
    padding: 0.66rem 0.72rem;
    background: transparent;
    font-size: 0.94rem;
}

#mainApp .sidebar-nav .tab i,
#mainApp .sidebar-nav .tab span {
    min-width: 1.25rem;
}

#mainApp .sidebar-nav .tab .tab-label {
    display: inline;
    min-width: 0;
}

#mainApp .sidebar-nav .tab.tab-beta {
    flex-wrap: wrap;
}

#mainApp .sidebar-nav .tab .tab-chip-beta {
    margin-left: auto;
    min-width: auto;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#mainApp .sidebar-nav .tab:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--focus-text-color);
    transform: none;
}

#mainApp .sidebar-nav .tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--focus-text-color);
    box-shadow: none;
}

#mainApp .sidebar-footer-actions {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.7rem;
}

#mainApp .sidebar-footer-actions .pwa-install-btn {
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border-color: transparent;
    color: var(--focus-text-color);
}

#mainApp .sidebar-version {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 0.75rem;
    letter-spacing: 0.5px;
    font-weight: 500;
}

body:not(.dark-mode) #mainApp .sidebar-version {
    color: #64748b;
}

#mainApp .sidebar-version a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

#mainApp .sidebar-version a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

#mainApp .sidebar-backdrop {
    display: none;
}

#mainApp .content-area {
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.45rem 0.9rem 0.85rem;
}

#mainApp .main-screen-controls {
    position: sticky;
    top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.5rem 0.2rem;
    background: transparent;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.active-screen-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    opacity: 0.95;
    padding-right: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.dark-mode) .active-screen-heading {
    color: #0f172a;
}

#mainApp .mobile-nav-toggle {
    display: none;
}

#mainApp .main-screen-controls .sidebar-icon-btn,
#mainApp .main-screen-controls .back-nav-btn {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

#mainApp .navbar-toggle-btn,
#mainApp .header,
#mainApp .desktop-header-actions,
#mainApp .nav-buttons {
    display: none !important;
}

#mainApp .tab-content.active {
    min-height: calc(100vh - 1.1rem);
}

#mainApp:has(#ai-guide.tab-content.active) .content-area {
    /* overflow-y: hidden; Removed to allow scrolling */
}

#mainApp:has(#ai-guide.tab-content.active)+footer {
    display: none;
}

body.chat-tab-active #mainApp .content-area {
    /* overflow-y: hidden; Removed to allow scrolling */
}

#mainApp:has(#ai-guide.tab-content.active) .content-area {
    /* overflow-y: hidden; Removed to allow scrolling */
}

#mainApp:has(#ai-guide.tab-content.active)+footer {
    display: none;
}

#mainApp .container {
    max-width: min(1460px, calc(100vw - 1.6rem));
    margin: 0 auto;
    padding: 0;
}

#mainApp.sidebar-collapsed .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
}

#mainApp.sidebar-collapsed .sidebar-brand,
#mainApp.sidebar-collapsed .sidebar-footer-actions,
#mainApp.sidebar-collapsed .sidebar-controls,
#mainApp.sidebar-collapsed .sidebar-version {
    display: none;
}

#mainApp.sidebar-collapsed .sidebar-topbar {
    justify-content: center;
    grid-template-columns: 1fr;
    border-bottom: 0;
    padding-left: 0;
    padding-right: 0;
}

#mainApp.sidebar-collapsed .sidebar-nav .tab {
    justify-content: center;
    gap: 0;
    padding: 0.58rem 0;
    width: 42px;
    min-height: 42px;
    margin: 0 auto;
}

#mainApp.sidebar-collapsed .sidebar-topbar .sidebar-icon-btn {
    width: 36px;
    height: 36px;
}

#mainApp.sidebar-collapsed .sidebar-nav .tabs {
    padding-inline: 0;
}

#mainApp.sidebar-collapsed .sidebar-nav .tab> :not(i):not(.notification-badge):not(.tab-chip-beta) {
    display: none;
}

#mainApp.sidebar-collapsed .sidebar-nav .tab .tab-chip-beta {
    display: none;
}

#mainApp.sidebar-collapsed .sidebar-nav .tab i {
    font-size: 1.1rem;
    min-width: 0;
    margin: 0;
}

@media (max-width: 900px) {
    #mainApp .app-shell {
        grid-template-columns: 1fr;
    }

    #mainApp .sidebar-nav {
        position: fixed;
        left: 0;
        top: 0;
        width: min(82vw, 320px);
        transform: translateX(-105%);
        box-shadow: 8px 0 28px rgba(2, 6, 23, 0.48);
    }

    #mainApp.sidebar-open .sidebar-nav {
        transform: translateX(0);
    }

    #mainApp .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.45);
        z-index: 1200;
    }

    #mainApp.sidebar-open .sidebar-backdrop {
        display: block;
    }

    #mainApp .mobile-nav-toggle {
        display: inline-flex;
    }

    #mainApp .main-screen-controls {
        position: sticky;
        top: 0.45rem;
    }

    #mainApp .content-area {
        height: 100vh;
        padding: 0.55rem 0.75rem 0.85rem;
    }

    body.chat-tab-active #mainApp .content-area {
        /* overflow-y: hidden; Removed to allow scrolling */
    }

    #mainApp .container {
        max-width: 100%;
    }

    #mainApp .tab-content.active {
        min-height: calc(100vh - 140px);
    }
}

.pyqs-layout-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pyqs-tab-switcher {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pyqs-switch-btn.active {
    background: var(--primary-color);
    color: var(--focus-text-color);
    border-color: var(--primary-color);
}

.pyqs-panel {
    display: none;
}


.live-mini-dot {
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: #dc2626;
    color: var(--focus-text-color);
}

.pyq-live-status-badge {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    width: fit-content;
}

.pyq-live-status-idle {
    background: rgba(100, 116, 139, 0.16);
    color: #334155;
}

.pyq-live-status-live {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.pyq-live-status-upcoming {
    background: rgba(37, 99, 235, 0.11);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.28);
}

.pyqs-panel.active {
    display: block;
}

.pyqs-placeholder-container {
    padding: 18px;
    border: 1px dashed rgba(127, 127, 127, 0.5);
    border-radius: 10px;
}

body.dark-mode .pyqs-switch-btn.active {
    color: #101010;
}

.pyqs-dashboard-head,
.pyqs-editor-meta,
.pyqs-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pyqs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.pyqs-stat-card,
.pyqs-chart-placeholder {
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.35);
    margin-bottom: 10px;
}

.pyq-central-dashboard-card {
    margin-top: 14px;
}


.pyq-crawl-status-card {
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 12px;
    padding: 12px;
    background: rgba(219, 234, 254, 0.25);
}

.pyq-crawl-status-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pyq-crawl-wheel {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(37, 99, 235, 0.25);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: pyqCrawlSpin 0.85s linear infinite;
    flex-shrink: 0;
}

.pyq-crawl-wheel.done {
    animation: none;
    border-color: rgba(34, 197, 94, 0.35);
    border-top-color: #22c55e;
}

.pyq-crawl-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.3);
    margin-bottom: 6px;
}

.pyq-crawl-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0ea5e9, #2563eb);
    transition: width 0.35s ease;
}

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

.pyq-question-card {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    animation: fadeSlideIn 0.25s ease;
}

.pyq-question-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.mains-answer-editor {
    min-height: 240px;
    max-height: 52vh;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.55;
}

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

#pyqs .card,
#pyqs .pyqs-panel {
    overflow: auto;
}


.pyq-tab-panel {
    display: none;
}

.pyq-tab-panel.active {
    display: block;
}

.pyq-select {
    min-width: 170px;
    height: 40px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.pyq-history-btn {
    min-height: 40px;
    font-weight: 600;
}

@media (max-width: 680px) {
    .pyq-select {
        min-width: 140px;
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pyq-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.pyq-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(15, 23, 42, 0.05);
    font-size: 0.78rem;
}

.pyq-chip-ok {
    background: rgba(34, 197, 94, 0.18);
}

.pyq-subject-pill {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: #072a3e;
    background: linear-gradient(135deg, #3ad3cc, #1da1e8);
    transition: transform 0.2s ease;
}

.pyq-subject-pill:hover {
    transform: translateY(-1px);
}

.pyq-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pyq-history-item {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    animation: fadeSlideIn 0.2s ease;
}

.pyq-history-item.correct {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.06);
}

.pyq-history-item.wrong {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.05);
}

.pyq-history-answer.correct {
    color: #15803d;
    font-weight: 700;
}

.pyq-history-answer.wrong {
    color: #b91c1c;
    font-weight: 700;
}

/* ── Beta Indicators ── */
.beta-chip-small {
    background: #f59e0b;
    color: var(--focus-text-color);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    vertical-align: middle;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.beta-banner {
    background: linear-gradient(90deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: betaPulse 4s infinite ease-in-out;
}

@keyframes betaPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.95;
        transform: scale(0.995);
    }
}

/* ── PYQ Dark Mode Overrides ── */
body.dark-mode .pyqs-stat-card,
body.dark-mode .pyqs-chart-placeholder {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .pyq-question-card {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .pyq-crawl-status-card {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.22);
}

body.dark-mode .pyq-chip {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.2);
}

body.dark-mode .pyq-chip-ok {
    background: rgba(34, 197, 94, 0.12);
}

body.dark-mode .pyq-subject-pill {
    color: #ffffff;
    background: linear-gradient(135deg, #0d9488, #0369a1);
}

body.dark-mode .pyq-history-item {
    border-color: rgba(148, 163, 184, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .mains-answer-editor {
    background: var(--input-bg);
    border-color: var(--border-color);
}

body.dark-mode .mains-answer-editor:empty:before {
    color: rgba(148, 163, 184, 0.5);
}

body.dark-mode .pyq-central-dashboard-card {
    background: var(--bg-card);
}

body.dark-mode .beta-chip-small {
    background: #d97706;
}

body.dark-mode .beta-banner {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

body.dark-mode #pyqHistoryModal>div,
body.dark-mode #pyqAttemptDetailModal>div,
body.dark-mode #mainsAttemptModal>div,
body.dark-mode #pyqResultModal>div {
    background: var(--bg-card);
}

.pyq-themed-modal-overlay {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
}

.pyq-themed-fullscreen-shell {
    width: 100vw;
    height: 100vh;
    overflow: auto;
    padding: 20px;
    background: linear-gradient(180deg, #fffdf5, #f8fafc);
    color: #0f172a;
}

.pyq-themed-shell-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.pyq-themed-shell-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.pyq-themed-shell-title {
    margin: 0 0 8px 0;
}

.pyq-themed-shell-copy {
    margin: 0;
    opacity: 0.85;
}

.pyq-themed-shell-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.pyq-themed-shell-timer {
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
}

.pyq-themed-shell-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #9a3412;
}

.pyq-themed-dialog {
    max-width: 900px;
    margin: 4vh auto;
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    max-height: 88vh;
    overflow: auto;
    color: #111827;
}

.pyq-themed-result-dialog {
    max-width: 760px;
    margin: 6vh auto;
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    max-height: 88vh;
    overflow: auto;
    color: #111827;
}

body.pyq-test-lock {
    overflow: hidden;
    touch-action: none;
}

.pyq-active-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pyq-result-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.pyq-result-row:last-child {
    border-bottom: none;
}

.pyq-result-summary {
    margin-bottom: 14px;
}

.pyq-workspace-panel.active {
    display: block;
}

.pyq-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.pyq-leaderboard-top3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.pyq-leaderboard-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.12));
    border: 1px solid rgba(59, 130, 246, 0.2);
    animation: pyqFloatCard 2.2s ease-in-out infinite;
}

.pyq-leaderboard-medal {
    font-size: 2rem;
}

.pyq-leaderboard-card-main,
.pyq-leaderboard-list-shell {
    display: grid;
    gap: 10px;
}

.pyq-leaderboard-metrics,
.pyq-leaderboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 8px;
}

.pyq-leaderboard-row-card {
    display: grid;
    grid-template-columns: 72px minmax(180px, 1fr) minmax(380px, 1.4fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    background: var(--bg-secondary);
}

.pyq-leaderboard-rank {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.pyq-leaderboard-row-card h5,
.pyq-leaderboard-row-card p {
    margin: 0;
}

.pyq-leaderboard-row-card p,
.pyq-leaderboard-stat-grid small {
    color: var(--text-muted);
}

.pyq-leaderboard-stat-grid span {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
}

.pyq-leaderboard-stat-grid strong {
    font-size: 1rem;
    line-height: 1.25;
    word-break: break-word;
}

.pyq-leaderboard-card:nth-child(2) { animation-delay: 0.2s; }
.pyq-leaderboard-card:nth-child(3) { animation-delay: 0.4s; }

.pyq-analysis-pill,
.pyq-exam-target-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.25);
    font-size: 0.9rem;
    font-weight: 600;
}

.pyq-question-status-badge {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    margin-right: 10px;
    animation: pyqPulseBadge 1.4s ease-in-out infinite;
}

.pyq-question-status-badge.correct {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.pyq-question-status-badge.wrong {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

@keyframes pyqPulseBadge {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.2); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

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

body.dark-mode .pyq-themed-modal-overlay {
    background: rgba(2, 6, 23, 0.9);
}

body.dark-mode .pyq-themed-fullscreen-shell {
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #f8fafc;
}

body.dark-mode .pyq-themed-shell-timer {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

body.dark-mode .pyq-themed-shell-warning {
    background: rgba(245, 158, 11, 0.22);
    color: #fed7aa;
}

body.dark-mode .pyq-themed-dialog,
body.dark-mode .pyq-themed-result-dialog {
    background: var(--bg-card);
    color: var(--text-color);
}

body.dark-mode .pyq-leaderboard-card {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.24), rgba(5, 150, 105, 0.2));
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .pyq-analysis-pill,
body.dark-mode .pyq-exam-target-chip {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(96, 165, 250, 0.24);
}

body.dark-mode .pyqs-placeholder-container {
    border-color: rgba(148, 163, 184, 0.2);
}


body.dark-mode .pyq-live-status-idle {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

body.dark-mode .pyq-live-status-live {
    background: rgba(220, 38, 38, 0.2);
    color: #fecaca;
}

body.dark-mode .pyq-live-status-upcoming {
    background: rgba(30, 64, 175, 0.28);
    color: #bfdbfe;
}



/* Live Test Modal */
.live-test-modal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    max-width: 500px;
}

body.dark-mode .live-test-modal .modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-test-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.live-pulse-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    position: relative;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.live-text {
    color: #ef4444;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.live-test-hero {
    padding: 20px;
    text-align: center;
}

.live-test-hero h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #1e293b;
}

body.dark-mode .live-test-hero h2 {
    color: #f1f5f9;
}

.live-test-details {
    background: rgba(37, 99, 235, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #2563eb;
    text-align: left;
    font-size: 0.9rem;
}

body.dark-mode .live-test-details {
    background: rgba(59, 130, 246, 0.1);
}

#streakCelebrationHost {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.streak-celebration {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.streak-celebration-banner {
    position: absolute;
    top: 18%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    color: var(--focus-text-color);
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.3);
    animation: streakBannerPop 2.2s ease;
}

.streak-confetti-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.confetti {
    position: absolute;
    left: var(--x);
    top: -30px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    animation: confettiFall 1.8s linear forwards;
}

.confetti-1 { background: #ef4444; }
.confetti-2 { background: #f59e0b; }
.confetti-3 { background: #22c55e; }
.confetti-4 { background: #3b82f6; }
.confetti-5 { background: #a855f7; }
.confetti-6 { background: #f97316; }

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}

@keyframes streakBannerPop {
    0% { transform: scale(0.5); opacity: 0; }
    15% { transform: scale(1.05); opacity: 1; }
    85% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.96); opacity: 0; }
}


.marketplace-title-content {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.marketplace-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.marketplace-item-tag-mode {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    font-weight: 700;
}

:root {
    --glass-bg: rgba(255, 255, 255, 0.42);
    --glass-border: rgba(255, 255, 255, 0.48);
    --glass-shadow: 0 14px 40px rgba(15, 23, 42, 0.14);
    --glass-blur: 16px;
}

body.dark-mode {
    --glass-bg: rgba(15, 23, 42, 0.4);
    --glass-border: rgba(148, 163, 184, 0.34);
    --glass-shadow: 0 16px 40px rgba(2, 6, 23, 0.52);
}

.card,
.auth-card,
.modal-content,
.dropdown-menu,
.tab-content,
.tabs,
header,
.chat-wrapper,
.message-content,
.chat-input-wrapper,
.todo-item,
.note-card,
.focus-stats,
.marketplace-post-card,
.marketplace-comments-modal,
.marketplace-edit-modal {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
}

.form-control,
.btn,
.tab,
.mobile-tab-dropdown,
.mobile-tab-dropdown-menu,
.notification-item {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-primary,
.btn-secondary {
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

/* === iOS-inspired Glassmorphism Revamp (UI only) === */
:root {
    --glass-ios-bg: color-mix(in srgb, var(--glass-bg) 88%, transparent);
    --glass-ios-stroke: color-mix(in srgb, var(--glass-border) 82%, #ffffff 18%);
    --glass-ios-soft-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
    --glass-ios-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.42);
    --glass-ios-surface-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1));
}

body.dark-mode {
    --glass-ios-bg: color-mix(in srgb, var(--glass-bg) 90%, transparent);
    --glass-ios-stroke: color-mix(in srgb, var(--glass-border) 84%, #cbd5e1 16%);
    --glass-ios-soft-shadow: 0 24px 52px rgba(2, 6, 23, 0.56);
    --glass-ios-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    --glass-ios-surface-gradient: linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(15, 23, 42, 0.16));
}

body {
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    width: min(44vw, 460px);
    height: min(44vw, 460px);
    border-radius: 999px;
    filter: blur(50px);
    opacity: 0.38;
    pointer-events: none;
}

body::before {
    top: -120px;
    right: -70px;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.55), rgba(56, 189, 248, 0));
}

body::after {
    bottom: -130px;
    left: -80px;
    background: radial-gradient(circle at center, rgba(45, 212, 191, 0.52), rgba(45, 212, 191, 0));
}

#mainApp,
.auth-container,
.landing-screen,
.auth-portal,
.mobile-header,
.mobile-tab-dropdown-menu {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

:is(
    .card,
    .auth-card,
    .modal-content,
    .dropdown-menu,
    .tab-content,
    .tabs,
    header,
    .chat-wrapper,
    .message-content,
    .chat-input-wrapper,
    .todo-item,
    .note-card,
    .focus-stats,
    .marketplace-post-card,
    .marketplace-comments-modal,
    .marketplace-edit-modal,
    .landing-feature-card,
    .landing-topbar,
    .landing-footer,
    .landing-cta,
    .auth-nav-btn,
    .mobile-sheet,
    .mobile-tab-dropdown,
    .mobile-tab-dropdown-item,
    .marketplace-upload-chip,
    .shared-note-card,
    .timer-card,
    .focus-card,
    .calendar-card,
    .profile-card,
    .community-card
) {
    background: var(--glass-ios-surface-gradient), var(--glass-ios-bg) !important;
    border: 1px solid var(--glass-ios-stroke) !important;
    box-shadow: var(--glass-ios-soft-shadow), var(--glass-ios-inner-highlight) !important;
    backdrop-filter: blur(calc(var(--glass-blur) + 2px)) saturate(135%);
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 2px)) saturate(135%);
}

:is(.btn, .form-control, .tab, .pill, .badge, .notification-item, .marketplace-pill, .landing-top-btn) {
    border-radius: 14px;
}

.btn,
.form-control,
.tab,
.marketplace-action-btn,
.marketplace-pill,
.mobile-tab-dropdown-item {
    background: color-mix(in srgb, var(--glass-ios-bg) 82%, transparent) !important;
    border: 1px solid color-mix(in srgb, var(--glass-ios-stroke) 86%, transparent) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 10px 24px rgba(15, 23, 42, 0.1);
}

.btn:hover,
.tab:hover,
.marketplace-action-btn:hover,
.landing-top-btn:hover,
.auth-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 16px 30px rgba(15, 23, 42, 0.16);
}

body.dark-mode .btn,
body.dark-mode .form-control,
body.dark-mode .tab,
body.dark-mode .marketplace-action-btn,
body.dark-mode .marketplace-pill {
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.2), 0 12px 26px rgba(2, 6, 23, 0.42);
}

.landing-top-btn.is-login {
    padding-left: 0.95rem;
}

:is(
    .card,
    .auth-card,
    .modal-content,
    .dash-card,
    .todo-item,
    .note-card,
    .note-card-modal,
    .event-item,
    .marketplace-post-card,
    .marketplace-comments-modal,
    .marketplace-edit-modal,
    .landing-feature-card,
    .landing-topbar,
    .landing-footer,
    .auth-nav-btn,
    .community-card,
    .profile-card,
    .calendar-card,
    .timer-card,
    .focus-card,
    .sidebar-nav,
    .mobile-tab-dropdown,
    .mobile-tab-dropdown-item,
    .tab-content,
    .chat-wrapper,
    .form-control,
    .btn,
    .btn-create-task,
    .btn-view-tasks,
    .btn-dash-action,
    .btn-dash-outline
) {
    border-radius: var(--border-radius);
}

.btn,
.btn-create-task,
.btn-view-tasks,
.btn-dash-action,
.btn-dash-outline,
.sidebar-icon-btn,
.landing-top-btn,
.auth-nav-btn,
.marketplace-action-btn {
    transition: transform 0.24s ease, box-shadow 0.24s ease, opacity 0.24s ease, background 0.24s ease;
}

button.is-busy,
.btn.is-busy,
.btn-dash-action.is-busy,
.btn-dash-outline.is-busy,
.sidebar-icon-btn.is-busy,
.marketplace-action-btn.is-busy {
    position: relative;
    pointer-events: none;
    opacity: 0.9;
}

.button-progress-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.btn-progress-wheel {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-top-color: rgba(255, 255, 255, 0.25);
    display: inline-block;
    animation: progressWheelSpin 0.8s linear infinite;
    flex-shrink: 0;
}

.btn-progress-wheel.is-dark {
    border-top-color: rgba(15, 23, 42, 0.2);
}

.sidebar-notification-bell {
    margin-left: 0;
    position: relative;
    overflow: visible;
    justify-self: end;
}

#mainApp .sidebar-toggle-btn {
    justify-self: start;
}

.sidebar-notification-bell.has-unread {
    animation: sidebarBellRing 1.5s ease-in-out infinite;
    transform-origin: top center;
}

.sidebar-notification-dot {
    position: absolute;
    top: 0.35rem;
    right: 0.32rem;
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5f6d, #ff2d55);
    border: 2px solid color-mix(in srgb, var(--bg-card) 75%, white 25%);
    box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.14);
    animation: sidebarDotPulse 1.5s ease-in-out infinite;
}

.sidebar-notification-modal {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    isolation: isolate;
}

.sidebar-notification-modal.is-open {
    display: flex;
}

body.sidebar-notification-open {
    overflow: hidden;
}

.sidebar-notification-dialog {
    position: relative;
    width: min(460px, 100%);
    max-height: min(80vh, 700px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.15rem;
    border-radius: calc(var(--border-radius) + 4px);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 255, 0.9));
    border: 1px solid rgba(186, 230, 253, 0.8);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.2);
}

body.dark-mode .sidebar-notification-dialog {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    border-color: rgba(148, 163, 184, 0.28);
}

.sidebar-notification-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.sidebar-notification-header h3 {
    margin: 0 0 0.3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.sidebar-notification-header p {
    margin: 0;
    color: var(--text-muted);
}

.sidebar-notification-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: inherit;
}

.sidebar-notification-summary {
    padding: 0.95rem 1rem;
    border-radius: calc(var(--border-radius) - 2px);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(45, 212, 191, 0.12));
    border: 1px solid rgba(125, 211, 252, 0.38);
    color: var(--text-main);
}

.sidebar-notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.sidebar-notification-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: calc(var(--border-radius) - 2px);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(191, 219, 254, 0.72);
}

body.dark-mode .sidebar-notification-item {
    background: rgba(30, 41, 59, 0.82);
    border-color: rgba(148, 163, 184, 0.22);
}

.sidebar-notification-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.9), rgba(94, 234, 212, 0.82));
    flex-shrink: 0;
}

.sidebar-notification-item-body {
    min-width: 0;
    flex: 1;
}

.sidebar-notification-item-body strong,
.sidebar-notification-item-body p {
    display: block;
}

.sidebar-notification-item-body strong {
    margin-bottom: 0.2rem;
}

.sidebar-notification-item-body p {
    margin: 0;
    color: var(--text-muted);
}

.sidebar-notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-weight: 700;
}

body.dark-mode .sidebar-notification-count {
    background: rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
}

.sidebar-notification-item-action {
    margin-left: auto;
    align-self: center;
}

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

@keyframes sidebarBellRing {
    0%, 100% {
        transform: rotate(0deg);
    }

    12% {
        transform: rotate(14deg);
    }

    24% {
        transform: rotate(-10deg);
    }

    36% {
        transform: rotate(6deg);
    }

    48% {
        transform: rotate(-4deg);
    }
}

@keyframes sidebarDotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.18);
    }

    50% {
        transform: scale(1.12);
        box-shadow: 0 0 0 8px rgba(255, 45, 85, 0);
    }
}
