@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-canvas: #f7f8fc;
    --card-lime: #e8f3bf;
    --card-pink: #fcd3e7;
    --card-mint: #d6f0ce;
    --card-peach: #feddc0;
    --accent-purple: #7c4dff;
    --accent-purple-hover: #6536eb;
    --accent-purple-light: rgba(124, 77, 255, 0.08);
    --text-primary: #232228;
    --text-secondary: #4a454e;
    --text-muted: #827c88;
    --border-subtle: #e6e8ec;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 14px 30px rgba(124, 77, 255, 0.1);
}

html.dark-mode,
body.dark-mode {
    --bg-canvas: #0f0e15;
    --card-lime: #1e2617;
    --card-pink: #2b1722;
    --card-mint: #15271a;
    --card-peach: #2a1e15;
    --accent-purple: #9d77ff;
    --accent-purple-hover: #8657ff;
    --accent-purple-light: rgba(124, 77, 255, 0.18);
    --text-primary: #f3f2f7;
    --text-secondary: #b5b0be;
    --text-muted: #7c7789;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 14px 30px rgba(124, 77, 255, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

*::-webkit-scrollbar,
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html, body, .modal-box, textarea, .form-textarea, .drawer-menu-list, .editor-preview-container {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.modal-box::-webkit-scrollbar,
textarea::-webkit-scrollbar,
.form-textarea::-webkit-scrollbar,
.drawer-menu-list::-webkit-scrollbar,
.editor-preview-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

body {
    background-color: var(--bg-canvas) !important;
    color: var(--text-primary) !important;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.hidden {
    display: none !important;
}

.background-blobs {
    display: none !important;
}

.sphere {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: ambientDrift 8s ease-in-out infinite alternate;
}

.sphere-1 {
    width: 65px;
    height: 65px;
    top: 15px;
    right: 25px;
    background: radial-gradient(circle at 35% 30%, #b388ff 0%, #7c4dff 45%, #311b92 100%);
    box-shadow: inset -6px -6px 14px rgba(0, 0, 0, 0.4), inset 6px 6px 10px rgba(255, 255, 255, 0.7), 0 12px 25px rgba(124, 77, 255, 0.25);
}

.sphere-2 {
    width: 32px;
    height: 32px;
    top: 5px;
    right: 120px;
    background: radial-gradient(circle at 30% 30%, #f48fb1 0%, #d81b60 55%, #880e4f 100%);
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.35), inset 3px 3px 6px rgba(255, 255, 255, 0.7), 0 8px 16px rgba(216, 27, 96, 0.2);
    animation-duration: 6s;
    animation-delay: -2s;
}

.sphere-3 {
    width: 44px;
    height: 44px;
    top: 150px;
    right: 40px;
    background: radial-gradient(circle at 32% 32%, #d1c4e9 0%, #9575cd 50%, #4527a0 100%);
    box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.35), inset 4px 4px 8px rgba(255, 255, 255, 0.6), 0 10px 20px rgba(103, 58, 183, 0.2);
    animation-duration: 9s;
    animation-delay: -4s;
}

.sphere-4 {
    width: 38px;
    height: 38px;
    bottom: 120px;
    left: 45px;
    background: radial-gradient(circle at 35% 30%, #ffab91 0%, #f4511e 50%, #bf360c 100%);
    box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.4), inset 4px 4px 8px rgba(255, 255, 255, 0.65), 0 10px 20px rgba(244, 81, 30, 0.25);
    animation-duration: 7s;
    animation-delay: -1s;
}

.sphere-5 {
    width: 24px;
    height: 24px;
    bottom: 220px;
    left: 65px;
    background: radial-gradient(circle at 30% 30%, #f8bbd0 0%, #ec407a 50%, #ad1457 100%);
    box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.35), inset 3px 3px 5px rgba(255, 255, 255, 0.6), 0 6px 14px rgba(236, 64, 122, 0.2);
    animation-duration: 5s;
    animation-delay: -3s;
}

.sphere-6 {
    width: 60px;
    height: 60px;
    bottom: 40px;
    left: 50px;
    background: radial-gradient(circle at 32% 32%, #b39ddb 0%, #7e57c2 45%, #311b92 100%);
    box-shadow: inset -6px -6px 14px rgba(0, 0, 0, 0.4), inset 6px 6px 10px rgba(255, 255, 255, 0.7), 0 14px 28px rgba(126, 87, 194, 0.25);
    animation-duration: 8.5s;
    animation-delay: -5s;
}

@keyframes ambientDrift {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(6deg); }
    100% { transform: translateY(6px) rotate(-4deg); }
}

.app-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 32px 30px 32px;
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

main,
.folders-stage,
.gallery-stage,
.upload-stage,
.ai-chat-stage,
.dashboard-stage,
.main-content {
    flex: 1 0 auto;
}

.site-footer {
    margin-top: auto;
    width: 100%;
    text-align: center;
    padding: 2.5rem 1rem 1.5rem 1rem;
    position: relative;
    z-index: 5;
    border-top: 1px solid var(--border-subtle);
}

.site-footer p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.site-footer a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--accent-purple-hover);
    text-decoration: underline;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 0.5rem;
}

.footer-socials a,
.footer-social-link {
    font-size: 1.4rem;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-purple-light);
}

.footer-socials a:hover,
.footer-social-link:hover {
    color: var(--accent-purple);
    transform: translateY(-3px);
    background: rgba(124, 77, 255, 0.2);
}

.nav-domain-notice {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 18, 28, 0.94);
    border: 1px solid rgba(255, 170, 0, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 170, 0, 0.15);
    padding: 7px 16px;
    border-radius: 40px;
    font-size: 0.84rem;
    color: #f8fafc;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    max-width: 92vw;
    width: max-content;
}

.nav-domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 170, 0, 0.25);
    color: #fbbf24;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 14px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-domain-msg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.nav-domain-msg code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    color: #67e8f9;
    font-size: 0.82rem;
}

.nav-domain-link {
    color: #ffffff;
    background: #4f46e5;
    padding: 3px 9px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-domain-link:hover {
    background: #4338ca;
    color: #ffffff;
}

.nav-domain-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    margin-left: 2px;
    transition: all 0.2s ease;
    width: 22px;
    height: 22px;
}

.nav-domain-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

@media (max-width: 768px) {
    .nav-domain-notice {
        top: 70px;
        font-size: 0.76rem;
        padding: 6px 12px;
        gap: 6px;
        max-width: 95vw;
    }
    .nav-domain-msg {
        font-size: 0.74rem;
    }
    .nav-domain-tag {
        font-size: 0.68rem;
        padding: 2px 6px;
    }
}

.top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0 28px 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

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

.nav-links-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

body.dark-mode .nav-links-pill {
    background: #181722;
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-pill-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-pill-item:hover {
    color: var(--accent-purple);
    background: var(--accent-purple-light);
}

.nav-pill-item.active {
    background: var(--accent-purple);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.35);
}

.nav-pill-item i {
    font-size: 1.15rem;
}

.user-profile-bar {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.classic-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.classic-chip-btn i {
    font-size: 1rem;
    color: var(--accent-purple);
}

.classic-chip-btn:hover {
    background: #fbfbfe;
    color: var(--text-primary);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(124, 77, 255, 0.15);
}

body.dark-mode .classic-chip-btn {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #b5b0be;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .classic-chip-btn:hover {
    background: #2b2a3b;
    color: #ffffff;
    border-color: var(--accent-purple);
}

@media (max-width: 480px) {
    .classic-chip-btn span {
        display: none;
    }
    .classic-chip-btn {
        padding: 6px 8px;
    }
}

.drawer-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 12px 14px 4px 14px;
    margin-top: 8px;
}

.theme-mode-toggle {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.theme-mode-toggle:hover {
    background: #f4f5f9;
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: scale(1.05);
}

body.dark-mode .theme-mode-toggle {
    background: #181722;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
}

body.dark-mode .theme-mode-toggle:hover {
    background: #232230;
    color: var(--accent-purple);
}

.hamburger-btn {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
}

.hamburger-btn:hover {
    background: #f4f5f9;
    border-color: var(--accent-purple);
}

body.dark-mode .hamburger-btn {
    background: #181722;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .hamburger-btn span {
    background-color: #f3f2f7;
}

.side-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 14, 28, 0.35);
    backdrop-filter: blur(4px);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.side-drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 501;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

body.dark-mode .side-drawer {
    background: #171622;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.45);
}

.side-drawer-backdrop.active .side-drawer {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.drawer-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drawer-close-btn {
    background: #f1f2f6;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

body.dark-mode .drawer-close-btn {
    background: #232230;
    color: #b5b0be;
}

.drawer-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.drawer-item a,
.drawer-item button {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.15s ease;
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
}

.drawer-item a:hover,
.drawer-item button:hover {
    background: #f4f5f9;
    color: var(--accent-purple);
}

body.dark-mode .drawer-item a,
body.dark-mode .drawer-item button {
    color: #f3f2f7;
}

body.dark-mode .drawer-item a:hover,
body.dark-mode .drawer-item button:hover {
    background: #232230;
    color: var(--accent-purple);
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.page-hero-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-hero-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

.hero-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-pill-primary {
    background: var(--accent-purple);
    color: #ffffff !important;
    border: none;
    border-radius: 9999px;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.35);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-pill-primary:hover {
    background: var(--accent-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(124, 77, 255, 0.45);
}

.btn-pill-secondary {
    background: #ffffff;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-pill-secondary:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple) !important;
    background: var(--accent-purple-light);
}

body.dark-mode .btn-pill-secondary {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7 !important;
}

.breadcrumb-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

body.dark-mode .breadcrumb-pill {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.breadcrumb-pill a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.items-grid,
.folders-grid,
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    margin-top: 10px;
}

.folder-card,
.file-card {
    position: relative;
    border-radius: 22px;
    padding: 24px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
}

.folder-card:hover,
.file-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.folder-card:nth-child(4n+1),
.file-card:nth-child(4n+1) {
    background-color: var(--card-lime);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.folder-card:nth-child(4n+2),
.file-card:nth-child(4n+2) {
    background-color: var(--card-pink);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.folder-card:nth-child(4n+3),
.file-card:nth-child(4n+3) {
    background-color: var(--card-mint);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.folder-card:nth-child(4n+4),
.file-card:nth-child(4n+4) {
    background-color: var(--card-peach);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .folder-card:nth-child(4n+1),
body.dark-mode .file-card:nth-child(4n+1) {
    background-color: #1e2617 !important;
    border: 1px solid rgba(232, 243, 191, 0.2) !important;
}

body.dark-mode .folder-card:nth-child(4n+2),
body.dark-mode .file-card:nth-child(4n+2) {
    background-color: #2b1722 !important;
    border: 1px solid rgba(252, 211, 231, 0.2) !important;
}

body.dark-mode .folder-card:nth-child(4n+3),
body.dark-mode .file-card:nth-child(4n+3) {
    background-color: #15271a !important;
    border: 1px solid rgba(214, 240, 206, 0.2) !important;
}

body.dark-mode .folder-card:nth-child(4n+4),
body.dark-mode .file-card:nth-child(4n+4) {
    background-color: #2a1e15 !important;
    border: 1px solid rgba(254, 221, 192, 0.2) !important;
}

.folder-icon,
.file-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--accent-purple);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.dark-mode .folder-icon,
body.dark-mode .file-icon {
    background: rgba(255, 255, 255, 0.08);
}

.folder-card:nth-child(4n+1) .folder-icon { color: #5a7d20; }
.folder-card:nth-child(4n+2) .folder-icon { color: #d84587; }
.folder-card:nth-child(4n+3) .folder-icon { color: #2c8c6a; }
.folder-card:nth-child(4n+4) .folder-icon { color: #d16127; }

.folder-name,
.file-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    margin: 14px 0 4px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode .folder-card:nth-child(4n+1) .folder-name { color: #e8f3bf !important; }
body.dark-mode .folder-card:nth-child(4n+2) .folder-name { color: #fcd3e7 !important; }
body.dark-mode .folder-card:nth-child(4n+3) .folder-name { color: #d6f0ce !important; }
body.dark-mode .folder-card:nth-child(4n+4) .folder-name { color: #feddc0 !important; }

body.dark-mode .file-card:nth-child(4n+1) .file-name { color: #e8f3bf !important; }
body.dark-mode .file-card:nth-child(4n+2) .file-name { color: #fcd3e7 !important; }
body.dark-mode .file-card:nth-child(4n+3) .file-name { color: #d6f0ce !important; }
body.dark-mode .file-card:nth-child(4n+4) .file-name { color: #feddc0 !important; }

.folder-meta,
.file-meta {
    font-size: 0.85rem;
    color: var(--text-secondary) !important;
    font-weight: 500;
}

.item-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
}

.item-action-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.item-action-btn:hover {
    background: #ff5252;
    color: #ffffff;
    transform: scale(1.1);
}

body.dark-mode .item-action-btn {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    color: #b5b0be;
}

.file-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.file-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

body.dark-mode .file-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
}

.empty-folder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-folder i {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.empty-folder p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.drop-zone {
    background: #ffffff;
    border: 2px dashed rgba(124, 77, 255, 0.4);
    border-radius: 28px;
    padding: 60px 24px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-purple);
    background: var(--accent-purple-light);
    transform: scale(1.01);
}

body.dark-mode .drop-zone {
    background: #181724;
    border-color: rgba(124, 77, 255, 0.4);
}

.drop-zone i {
    font-size: 4rem;
    color: var(--accent-purple);
    margin-bottom: 12px;
    display: inline-block;
}

.drop-zone h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.drop-zone p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.folder-tree {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 14px 20px;
    box-shadow: var(--shadow-card);
}

body.dark-mode .file-item {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.file-item .file-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.file-item .file-size {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e6e8ec;
    border-radius: 9999px;
    overflow: hidden;
    margin: 20px 0;
    display: none;
}

.progress-bar.visible {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c4dff, #ff7bb0);
    border-radius: 9999px;
    transition: width 0.3s ease;
    width: 0%;
}

.gallery-grid {
    columns: 4 250px;
    column-gap: 20px;
    margin-top: 24px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    position: relative;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

body.dark-mode .gallery-item {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.gallery-item-overlay {
    padding: 14px 16px;
}

.gallery-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-pill {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-card);
}

body.dark-mode .stat-pill {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.stat-pill i {
    color: var(--accent-purple);
    font-size: 1.1rem;
}

.action-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(124, 77, 255, 0.25);
}

.action-btn:hover {
    background: var(--accent-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 77, 255, 0.35);
}

.gallery-badge-row {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.gallery-badge {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.badge-lock {
    background: rgba(255, 75, 75, 0.85);
    color: #ffffff;
}

.badge-final {
    background: rgba(124, 77, 255, 0.85);
    color: #ffffff;
}

.gallery-item-lock {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 16, 32, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 3;
}

.gallery-item-lock i {
    font-size: 2rem;
}

.gallery-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.gallery-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 4;
}

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

.gallery-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.18s ease;
}

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

.gallery-action-btn.danger {
    background: #ff5252;
    color: #ffffff;
}

.empty-gallery {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-gallery i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.empty-gallery p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.upload-options {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    display: none;
}

body.dark-mode .upload-options {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.upload-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.upload-preview img {
    width: 70px;
    height: 70px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}

.upload-preview-info .name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.upload-preview-info .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-opt-row {
    display: flex;
    gap: 20px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.upload-opt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.upload-pw-field {
    margin-bottom: 16px;
    display: none;
}

.upload-pw-field input {
    width: 100%;
    max-width: 380px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #fbfbfd;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

body.dark-mode .upload-pw-field input {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.upload-actions {
    display: flex;
    gap: 12px;
}

.upload-progress {
    display: none;
    margin-bottom: 24px;
}

.upload-progress.active {
    display: block;
}

.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: #e6e8ec;
    border-radius: 9999px;
    overflow: hidden;
}

body.dark-mode .progress-bar-wrap {
    background: rgba(255, 255, 255, 0.1);
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 10, 20, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    max-width: 85vw;
    max-height: 72vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -45px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: background 0.2s ease;
    z-index: 3001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.35);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-info {
    display: flex;
    gap: 16px;
    color: #f3f2f7;
    margin-top: 14px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
}

.lightbox-info .title {
    font-weight: 600;
}

.lightbox-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    transition: background 0.2s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-btn.danger {
    background: rgba(255, 82, 82, 0.35);
    border-color: rgba(255, 82, 82, 0.5);
}

.lightbox-btn.danger:hover {
    background: rgba(255, 82, 82, 0.6);
}

.confirm-modal-wrap,
.pw-modal-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 10, 20, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3500;
}

.confirm-box,
.pw-modal {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
}

body.dark-mode .confirm-box,
body.dark-mode .pw-modal {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.confirm-box h3,
.pw-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-box p,
.pw-modal p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.pw-error {
    color: #ff5252;
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: none;
}

.pw-modal input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #fbfbfd;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 12px;
}

body.dark-mode .pw-modal input {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.confirm-btns,
.pw-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.glass-btn {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
    border: none;
    padding: 8px 18px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

body.dark-mode .glass-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
}

.primary-btn {
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.primary-btn.danger-bg {
    background: #ff5252;
}

.skeleton-gallery-card {
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    break-inside: avoid;
    padding: 12px;
}

body.dark-mode .skeleton-gallery-card {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.skeleton-image-placeholder {
    height: 180px;
    background: #eceff1;
    animation: shimmer 1.5s ease-in-out infinite alternate;
    border-radius: 14px;
    will-change: opacity;
}

body.dark-mode .skeleton-image-placeholder {
    background: #1e1b29;
}

@keyframes shimmer {
    0% { opacity: 0.4; }
    100% { opacity: 0.85; }
}

.ai-chat-stage {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-bubble-row {
    display: flex;
    gap: 12px;
    max-width: 82%;
}

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

.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-content-box {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.message-bubble-row.user .message-content-box {
    background: linear-gradient(135deg, #7c4dff, #6236df);
    color: #ffffff;
    border: none;
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.3);
}

body.dark-mode .message-content-box {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.ai-suggestions-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ai-suggestion-card {
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: transform 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.ai-suggestion-card:hover {
    transform: translateY(-3px);
}

.ai-suggestion-card:nth-child(4n+1) { background-color: var(--card-lime); }
.ai-suggestion-card:nth-child(4n+2) { background-color: var(--card-pink); }
.ai-suggestion-card:nth-child(4n+3) { background-color: var(--card-mint); }
.ai-suggestion-card:nth-child(4n+4) { background-color: var(--card-peach); }

body.dark-mode .ai-suggestion-card:nth-child(4n+1) { background-color: #1e2617; border-color: rgba(232, 243, 191, 0.2); color: #e8f3bf; }
body.dark-mode .ai-suggestion-card:nth-child(4n+2) { background-color: #2b1722; border-color: rgba(252, 211, 231, 0.2); color: #fcd3e7; }
body.dark-mode .ai-suggestion-card:nth-child(4n+3) { background-color: #15271a; border-color: rgba(214, 240, 206, 0.2); color: #d6f0ce; }
body.dark-mode .ai-suggestion-card:nth-child(4n+4) { background-color: #2a1e15; border-color: rgba(254, 221, 192, 0.2); color: #feddc0; }

.chat-input-dock {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 8px 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

body.dark-mode .chat-input-dock {
    background: #181722;
    border-color: rgba(255, 255, 255, 0.08);
}

.chat-input-dock textarea {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: none;
    height: 24px;
    max-height: 120px;
    padding: 4px 8px;
}

body.dark-mode .chat-input-dock textarea {
    color: #f3f2f7;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.08);
}

.file-editor-modal,
.file-read-modal,
.modal,
.input-modal,
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 14, 28, 0.65);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.file-editor-modal:not(.hidden),
.file-read-modal:not(.hidden),
.modal:not(.hidden),
.input-modal:not(.hidden),
.edit-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.file-editor-content,
.file-read-content,
.modal-content,
.input-modal-content,
.edit-modal-content {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 780px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-primary);
    transform: scale(0.96);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.file-editor-modal:not(.hidden) .file-editor-content,
.file-read-modal:not(.hidden) .file-read-content,
.modal:not(.hidden) .modal-content,
.input-modal:not(.hidden) .input-modal-content,
.edit-modal:not(.hidden) .edit-modal-content {
    transform: scale(1);
}

body.dark-mode .file-editor-content,
body.dark-mode .file-read-content,
body.dark-mode .modal-content,
body.dark-mode .input-modal-content,
body.dark-mode .edit-modal-content {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.file-editor-header,
.file-read-header,
.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    flex-wrap: wrap;
}

.edit-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

body.dark-mode .edit-modal-header h3 {
    color: #f3f2f7;
}

body.dark-mode .file-editor-header,
body.dark-mode .file-read-header,
body.dark-mode .edit-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.file-editor-body,
.edit-modal-body {
    flex: 1;
    padding: 22px 24px;
    overflow-y: auto;
}

.file-editor-body textarea,
.file-read-body pre,
.edit-modal-body textarea {
    width: 100%;
    min-height: 180px;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
    background: #fbfbfd;
    color: var(--text-primary);
    outline: none;
    resize: vertical;
    line-height: 1.5;
}

body.dark-mode .file-editor-body textarea,
body.dark-mode .file-read-body pre,
body.dark-mode .edit-modal-body textarea {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.edit-modal-body input[type="password"],
.edit-modal-body input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #fbfbfd;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.edit-modal-body input[type="password"]:focus,
.edit-modal-body input[type="text"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

html.dark-mode .edit-modal-body input[type="password"],
body.dark-mode .edit-modal-body input[type="password"],
html.dark-mode .edit-modal-body input[type="text"],
body.dark-mode .edit-modal-body input[type="text"] {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.admin-toggles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.admin-toggle-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #f8f9fd;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-toggle-card:hover {
    background: #f1f3f9;
    border-color: rgba(124, 77, 255, 0.3);
    transform: translateY(-1px);
}

html.dark-mode .admin-toggle-card,
body.dark-mode .admin-toggle-card {
    background: #14131f;
    border-color: rgba(255, 255, 255, 0.08);
}

html.dark-mode .admin-toggle-card:hover,
body.dark-mode .admin-toggle-card:hover {
    background: #191827;
    border-color: rgba(124, 77, 255, 0.4);
}

.admin-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.admin-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.admin-toggle-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-toggle-track::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.admin-toggle-switch input:checked + .admin-toggle-track {
    background: linear-gradient(135deg, #7c4dff, #651fff);
    border-color: #651fff;
    box-shadow: 0 2px 10px rgba(101, 31, 255, 0.35);
}

.admin-toggle-switch input:checked + .admin-toggle-track::before {
    transform: translateX(20px);
}

.admin-toggle-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.admin-toggle-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-toggle-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

html.dark-mode .admin-toggle-title,
body.dark-mode .admin-toggle-title {
    color: #f3f2f7;
}

html.dark-mode .admin-toggle-desc,
body.dark-mode .admin-toggle-desc {
    color: #9d99ab;
}

.pw-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.pw-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.15rem;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 2;
}

.pw-input-wrapper input {
    width: 100%;
    padding: 12px 46px 12px 42px !important;
    border-radius: 14px !important;
    border: 1px solid var(--border-subtle) !important;
    background: #fbfbfd !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    font-family: 'JetBrains Mono', monospace !important;
    outline: none !important;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease !important;
}

.pw-input-wrapper input:focus {
    border-color: var(--accent-purple) !important;
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.18) !important;
}

html.dark-mode .pw-input-wrapper input,
body.dark-mode .pw-input-wrapper input {
    background: #11101a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f3f2f7 !important;
}

.pw-action-icon-btn {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    z-index: 2;
}

.pw-action-icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

html.dark-mode .pw-action-icon-btn:hover,
body.dark-mode .pw-action-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
}

.password-modal-box {
    max-width: 520px !important;
}

.password-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.pw-shield-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(101, 31, 255, 0.25));
    border: 1px solid rgba(124, 77, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7c4dff;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.password-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.pw-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

.password-modal-body {
    padding: 24px 26px;
}

.pw-note-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f7f8fc;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    gap: 12px;
}

html.dark-mode .pw-note-status-card,
body.dark-mode .pw-note-status-card {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.08);
}

.pw-target-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-purple);
}

.pw-strength-container {
    margin-top: 10px;
    margin-bottom: 12px;
}

.pw-strength-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 6px;
}

html.dark-mode .pw-strength-bar,
body.dark-mode .pw-strength-bar {
    background: rgba(255, 255, 255, 0.1);
}

.pw-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.pw-strength-text {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: right;
    color: var(--text-secondary);
}

.pw-features-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pw-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pw-tool-btn:hover {
    background: #f1f3f9;
    border-color: rgba(124, 77, 255, 0.4);
    color: var(--accent-purple);
}

html.dark-mode .pw-tool-btn,
body.dark-mode .pw-tool-btn {
    background: #151422;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
}

html.dark-mode .pw-tool-btn:hover,
body.dark-mode .pw-tool-btn:hover {
    background: #1b1a2c;
    border-color: rgba(124, 77, 255, 0.5);
    color: #a78bfa;
}

.pw-security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(124, 77, 255, 0.07);
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.pw-security-note i {
    color: #7c4dff;
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 1px;
}

html.dark-mode .pw-security-note,
body.dark-mode .pw-security-note {
    background: rgba(124, 77, 255, 0.12);
    border-color: rgba(124, 77, 255, 0.25);
    color: #c4bfd3;
}

.note-inspect-modal-box {
    max-width: 660px !important;
    border-radius: 24px !important;
}

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

.inspect-shield-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), rgba(101, 31, 255, 0.3));
    border: 1px solid rgba(124, 77, 255, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7c4dff;
    font-size: 1.4rem;
    flex-shrink: 0;
}

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

.inspect-id-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8b889e;
    letter-spacing: 0.05em;
}

.inspect-id-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.92rem;
    font-weight: 600;
    color: #c4b5fd;
}

.inspect-copy-id-btn {
    background: transparent;
    border: none;
    color: #8b889e;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.inspect-copy-id-btn:hover {
    color: #f3f2f7;
}

.security-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 1.25rem;
}

.security-card {
    background: #14131f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.security-card:hover {
    border-color: rgba(124, 77, 255, 0.35);
    background: #171624;
    transform: translateY(-1px);
}

.sec-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sec-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sec-icon-wrap.pw-active {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.sec-icon-wrap.pw-inactive {
    background: rgba(255, 255, 255, 0.05);
    color: #8b889e;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sec-icon-wrap.fin-active {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.sec-icon-wrap.fin-inactive {
    background: rgba(255, 255, 255, 0.05);
    color: #8b889e;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sec-card-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sec-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f3f2f7;
}

.sec-card-status {
    font-size: 0.78rem;
    color: #9d99ab;
}

.sec-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sec-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f3f2f7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sec-action-btn:hover {
    background: rgba(124, 77, 255, 0.25);
    border-color: rgba(124, 77, 255, 0.5);
    color: #c4b5fd;
}

.sec-action-btn.danger-outline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.sec-action-btn.danger-outline:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ffffff;
}

.sec-toggle-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #9d99ab;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sec-inline-strip-btn,
.sec-inline-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #a5a1b2;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sec-inline-strip-btn:hover,
.sec-inline-copy-btn:hover {
    background: rgba(124, 77, 255, 0.2);
    border-color: rgba(124, 77, 255, 0.4);
    color: #f3f2f7;
}

.content-meta-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-count-pill {
    font-size: 0.74rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #8b889e;
    font-family: 'JetBrains Mono', monospace;
}

.inspect-device-box {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86rem;
    color: #38bdf8;
    background: #11101a;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    word-break: break-all;
}

.maint-panel-card {
    background: #14131f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px;
    max-width: 1140px;
    width: 100%;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.maint-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.maint-header-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), rgba(101, 31, 255, 0.3));
    border: 1px solid rgba(124, 77, 255, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7c4dff;
    font-size: 1.6rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.maint-header-icon-wrap.active-warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.3));
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.maint-header-info h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f3f2f7;
    margin: 0 0 4px 0;
}

.maint-header-desc {
    font-size: 0.88rem;
    color: #9d99ab;
    margin: 0;
    line-height: 1.4;
}

.maint-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: #11101a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    gap: 16px;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

.maint-status-banner.is-active {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

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

.maint-status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.maint-status-banner.is-active .maint-status-indicator {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
    animation: pulse-maint 1.5s infinite;
}

.maint-status-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #f3f2f7;
    margin-bottom: 2px;
}

.maint-status-sub {
    font-size: 0.82rem;
    color: #9d99ab;
}

.maint-status-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.maint-toggle-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f3f2f7;
}

.maint-content-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 992px) {
    .maint-content-grid {
        grid-template-columns: 1fr;
    }
}

.maint-left-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.maint-left-column .maint-textarea-wrapper {
    flex: 1;
    display: flex;
}

.maint-left-column .maint-textarea-wrapper textarea {
    flex: 1;
    min-height: 180px;
}

.maint-right-column {
    display: flex;
    flex-direction: column;
}

.maint-right-column .maint-preview-container {
    height: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
}

.maint-right-column .maint-preview-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.maint-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.maint-field-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #f3f2f7;
}

.maint-char-count {
    font-size: 0.78rem;
    color: #8b889e;
    font-family: 'JetBrains Mono', monospace;
}

.maint-presets-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.maint-preset-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b889e;
    margin-right: 4px;
}

.maint-preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #c4bfd3;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maint-preset-chip:hover {
    background: rgba(124, 77, 255, 0.2);
    border-color: rgba(124, 77, 255, 0.4);
    color: #f3f2f7;
    transform: translateY(-1px);
}

.maint-textarea-wrapper textarea {
    width: 100% !important;
    min-height: 120px;
    background: #11101a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
    color: #f3f2f7 !important;
    font-size: 0.94rem !important;
    font-family: 'Outfit', sans-serif !important;
    line-height: 1.5 !important;
    resize: vertical !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.maint-textarea-wrapper textarea:focus {
    border-color: #7c4dff !important;
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2) !important;
}

.maint-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 6px;
}

.maint-info-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #8b889e;
}

.maint-info-pill i {
    color: #7c4dff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.maint-preview-container {
    background: #0d0c14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
    margin-top: 6px;
}

.maint-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.maint-preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #b388ff;
}

.maint-preview-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e5e2ee;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maint-preview-fullscreen-btn:hover {
    background: rgba(124, 77, 255, 0.2);
    border-color: rgba(124, 77, 255, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
}

.maint-preview-canvas {
    padding: 28px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, rgba(38, 30, 60, 0.4) 0%, rgba(13, 12, 20, 0.95) 75%);
}

.maint-preview-card {
    max-width: 500px;
    width: 100%;
    background: rgba(26, 24, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
}

.maint-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 9999px;
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid rgba(124, 77, 255, 0.35);
    color: #b388ff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.maint-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffab00;
    box-shadow: 0 0 10px #ffab00;
    animation: lmg-pulse 1.8s ease-in-out infinite;
}

.maint-preview-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.maint-preview-body {
    font-size: 0.92rem;
    color: #b5b0be;
    line-height: 1.55;
    margin: 0 0 20px 0;
    word-break: break-word;
    white-space: pre-wrap;
}

.maint-preview-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.maint-preview-btn-mock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    background: #7c4dff;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maint-preview-btn-mock:hover {
    background: #651fff;
}

.maint-btn-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.maint-action-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f3f2f7;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maint-action-preview-btn:hover {
    background: rgba(124, 77, 255, 0.2);
    border-color: #7c4dff;
    color: #ffffff;
    transform: translateY(-1px);
}

#maintenance-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0f0e15;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
}

#maintenance-preview-modal.hidden {
    display: none !important;
}

.maint-modal-topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(20, 18, 30, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.maint-modal-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b388ff;
    font-weight: 600;
    font-size: 0.9rem;
}

.maint-modal-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maint-modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.maint-modal-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    box-sizing: border-box;
}

.maint-modal-content .lmg-card {
    max-width: 540px;
    width: 100%;
    background: rgba(26, 24, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
}

.maint-modal-content .lmg-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid rgba(124, 77, 255, 0.4);
    color: #b388ff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.maint-modal-content .lmg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffab00;
    box-shadow: 0 0 10px #ffab00;
    animation: lmg-pulse 1.8s ease-in-out infinite;
}

.maint-modal-content h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: #ffffff;
    line-height: 1.25;
}

.maint-modal-content p {
    font-size: 1rem;
    color: #b5b0be;
    line-height: 1.6;
    margin: 0 0 26px 0;
    word-break: break-word;
    white-space: pre-wrap;
}

.maint-modal-content .lmg-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.maint-modal-content .lmg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.maint-modal-content .lmg-btn-primary {
    background: #7c4dff;
    color: #ffffff;
}

.maint-modal-content .lmg-btn-primary:hover {
    background: #651fff;
    transform: translateY(-1px);
}

#view-content,
#view-file-content {
    background: #f8f9fc !important;
    border: 1px solid var(--border-subtle) !important;
    padding: 1.2rem;
    border-radius: 14px;
    color: var(--text-primary) !important;
    font-family: 'JetBrains Mono', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 340px;
    overflow-y: auto;
    line-height: 1.6;
    font-size: 0.92rem;
}

body.dark-mode #view-content,
body.dark-mode #view-file-content {
    background: #11101a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #f3f2f7 !important;
}

#view-owner-token {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #6366f1;
    word-break: break-all;
    background: #f8f9fc;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

body.dark-mode #view-owner-token {
    background: #11101a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #38bdf8 !important;
}

.file-editor-footer,
.file-read-footer,
.edit-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.015);
}

body.dark-mode .file-editor-footer,
body.dark-mode .file-read-footer,
body.dark-mode .edit-modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: #f1f2f6;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #e4e7ee;
    transform: scale(1.05);
}

body.dark-mode .icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f3f2f7;
}

body.dark-mode .icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: #f1f2f6;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-btn:hover {
    background: #e4e7ee;
    transform: translateY(-1px);
}

body.dark-mode .glass-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f3f2f7;
}

body.dark-mode .glass-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.glass-btn.danger-bg,
.primary-btn.danger-bg {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.glass-btn.danger-bg:hover,
.primary-btn.danger-bg:hover {
    background: #dc2626 !important;
}

.glass-btn.warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #d97706 !important;
}

body.dark-mode .glass-btn.warning {
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.2rem;
}

.field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.dark-mode .field-label {
    color: #a5a1b2;
}

.toggle-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f7f8fc;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

body.dark-mode .toggle-item {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.08);
}

.modal-content.confirm-mode {
    max-width: 460px;
    padding: 28px;
    text-align: left;
}

.modal-content.confirm-mode h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-content.confirm-mode p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.input-modal-content {
    max-width: 440px;
    padding: 28px;
    border-radius: 24px;
}

.input-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.input-modal-content input {
    width: 100%;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: #fbfbfd;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    margin-bottom: 20px;
}

body.dark-mode .input-modal-content input {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
}

.input-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e1b28;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show,
.toast.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

body.dark-mode .toast {
    background: #2b2838;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 850px) {
    .app-wrapper {
        padding: 16px 18px 40px 18px;
    }

    .top-navbar {
        gap: 12px;
    }

    .nav-links-pill span {
        display: none;
    }

    .nav-pill-item {
        padding: 8px 10px;
    }

    .gallery-grid {
        columns: 2 160px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .folder-card,
    .file-card {
        padding: 16px;
        min-height: 140px;
        border-radius: 18px;
    }
}

.admin-stage {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 3rem 2.5rem;
    border-radius: 28px;
    text-align: center;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
}

body.dark-mode .login-card {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.login-card .shield-icon {
    font-size: 3.8rem;
    color: var(--accent-purple);
    margin-bottom: 1rem;
}

.login-card h2 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 700;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.login-card input[type="password"] {
    width: 100%;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: #fbfbfd;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    margin-bottom: 1.2rem;
    text-align: center;
}

body.dark-mode .login-card input[type="password"] {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.login-btn {
    width: 100%;
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 77, 255, 0.25);
    transition: transform 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    background: var(--accent-purple-hover);
}

.login-error {
    color: #ff5252;
    margin-top: 1rem;
    font-size: 0.88rem;
}

.admin-dashboard {
    display: none;
}

.admin-dashboard.active {
    display: block;
}

.logout-btn {
    background: rgba(255, 82, 82, 0.12);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.25);
    padding: 8px 18px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 82, 82, 0.2);
}

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

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

body.dark-mode .stat-card {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.stat-card:nth-child(6n+1) { background-color: var(--card-lime); }
.stat-card:nth-child(6n+2) { background-color: var(--card-pink); }
.stat-card:nth-child(6n+3) { background-color: var(--card-mint); }
.stat-card:nth-child(6n+4) { background-color: var(--card-peach); }
.stat-card:nth-child(6n+5) { background-color: var(--card-lime); }
.stat-card:nth-child(6n+6) { background-color: var(--card-pink); }

body.dark-mode .stat-card:nth-child(6n+1) { background-color: #1e2617 !important; border-color: rgba(232, 243, 191, 0.2) !important; }
body.dark-mode .stat-card:nth-child(6n+2) { background-color: #2b1722 !important; border-color: rgba(252, 211, 231, 0.2) !important; }
body.dark-mode .stat-card:nth-child(6n+3) { background-color: #15271a !important; border-color: rgba(214, 240, 206, 0.2) !important; }
body.dark-mode .stat-card:nth-child(6n+4) { background-color: #2a1e15 !important; border-color: rgba(254, 221, 192, 0.2) !important; }
body.dark-mode .stat-card:nth-child(6n+5) { background-color: #1e2617 !important; border-color: rgba(232, 243, 191, 0.2) !important; }
body.dark-mode .stat-card:nth-child(6n+6) { background-color: #2b1722 !important; border-color: rgba(252, 211, 231, 0.2) !important; }

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
    color: var(--accent-purple);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.admin-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

body.dark-mode .admin-tab:hover {
    background: rgba(255, 255, 255, 0.06);
}

.admin-tab.active {
    background: var(--accent-purple);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.25);
}

.admin-section {
    display: none;
}

.admin-section.active,
.admin-section:not(.hidden) {
    display: block;
}

.admin-section.hidden {
    display: none !important;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-search {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-search i {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.admin-search input {
    padding: 10px 18px 10px 40px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    box-shadow: var(--shadow-card);
    min-width: 260px;
    transition: all 0.2s ease;
}

.admin-search input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

body.dark-mode .admin-search input {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-search-input {
    flex: 1;
    max-width: 380px;
    padding: 10px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    box-shadow: var(--shadow-card);
}

body.dark-mode .admin-search-input {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.admin-table-wrap,
.admin-table-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
    overflow-x: auto;
}

body.dark-mode .admin-table-wrap,
body.dark-mode .admin-table-wrapper {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.table-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.table-badge.badge-owner {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.table-badge.badge-locked {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.table-badge.badge-immutable {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.table-badge.badge-open {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

body.dark-mode .table-badge.badge-owner {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

body.dark-mode .table-badge.badge-locked {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

body.dark-mode .table-badge.badge-immutable {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

body.dark-mode .table-badge.badge-open {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.content-preview {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

body.dark-mode .content-preview {
    color: #b5b0be;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-table th {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.dark-mode .admin-table th {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: #b5b0be;
}

body.dark-mode .admin-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.admin-table tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

body.dark-mode .admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table-btn.view {
    background: rgba(124, 77, 255, 0.12);
    color: var(--accent-purple);
}

.table-btn.delete {
    background: rgba(255, 82, 82, 0.12);
    color: #ff5252;
}

.table-btn.unlock {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
}

.upload-stage {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.upload-page {
    width: 100%;
}

.drop-zone {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 2px dashed rgba(124, 77, 255, 0.45);
    border-radius: 28px;
    padding: 70px 24px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-purple);
    background: var(--accent-purple-light);
    transform: scale(1.01);
}

body.dark-mode .drop-zone {
    background: #181724;
    border-color: rgba(124, 77, 255, 0.45);
}

body.dark-mode .drop-zone:hover,
body.dark-mode .drop-zone.dragover {
    background: rgba(124, 77, 255, 0.12);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.drop-zone i {
    font-size: 4.2rem;
    color: var(--accent-purple);
    margin-bottom: 16px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.drop-zone:hover i {
    transform: translateY(-4px);
}

.drop-zone p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.drop-zone small {
    font-size: 0.92rem;
    color: var(--text-secondary);
    display: block;
}

.ignore-config {
    margin-top: 24px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: none;
}

.ignore-config.visible {
    display: block;
}

body.dark-mode .ignore-config {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.ignore-config h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.ignore-config h3 i {
    color: var(--accent-purple);
}

.ignore-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ignore-tab {
    padding: 8px 20px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    background: #f4f5f8;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ignore-tab:hover {
    background: var(--accent-purple-light);
    color: var(--accent-purple);
}

.ignore-tab.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: #ffffff;
}

body.dark-mode .ignore-tab {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

body.dark-mode .ignore-tab.active {
    background: var(--accent-purple);
    color: #ffffff;
}

.ignore-textarea {
    width: 100%;
    min-height: 120px;
    background: #fbfbfe;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.ignore-textarea:focus {
    border-color: var(--accent-purple);
}

body.dark-mode .ignore-textarea {
    background: #111019;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.ignore-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.file-review {
    margin-top: 24px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: none;
}

.file-review.visible {
    display: block;
}

body.dark-mode .file-review {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.review-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.review-header h3 i {
    color: var(--accent-purple);
}

.review-stats {
    display: flex;
    gap: 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

.review-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-add {
    color: #10b981;
}

.stat-ignore {
    color: #ef4444;
}

.folder-name-input {
    background: #fbfbfe;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 0.95rem;
    outline: none;
    width: 100%;
    max-width: 440px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.folder-name-input:focus {
    border-color: var(--accent-purple);
}

body.dark-mode .folder-name-input {
    background: #111019;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bulk-btn {
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    background: #f4f5f8;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bulk-btn:hover {
    background: var(--accent-purple-light);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

body.dark-mode .bulk-btn {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

body.dark-mode .bulk-btn:hover {
    background: rgba(124, 77, 255, 0.2);
    color: #d8b4fe;
}

.file-list {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: #fbfbfe;
}

body.dark-mode .file-list {
    background: #111019;
    border-color: rgba(255, 255, 255, 0.08);
}

.file-list .file-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transition: background 0.15s ease;
}

body.dark-mode .file-list .file-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    background: transparent;
}

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

.file-list .file-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

body.dark-mode .file-list .file-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.file-list .file-item.ignored {
    opacity: 0.5;
}

.file-item .file-path {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    word-break: break-all;
    color: var(--text-primary);
}

.file-item .file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

.file-item .file-reason {
    font-size: 0.75rem;
    color: #ef4444;
    white-space: nowrap;
    padding: 3px 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
}

.file-toggle {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 76px;
}

.file-toggle.add {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.file-toggle.ignore {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.file-toggle:hover {
    transform: scale(1.04);
}

.upload-actions {
    margin-top: 24px;
    display: none;
    gap: 14px;
    justify-content: flex-end;
}

.upload-actions.visible {
    display: flex;
}

.upload-btn {
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.35);
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: var(--accent-purple-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(124, 77, 255, 0.45);
}

.upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.cancel-btn {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 26px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #f4f5f8;
}

body.dark-mode .cancel-btn {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.sub-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

body.dark-mode .sub-breadcrumb {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.sub-breadcrumb a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.sub-breadcrumb.hidden {
    display: none !important;
}

.file-editor-modal,
.file-read-modal,
.input-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 14, 21, 0.65);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1200;
    padding: 20px;
}

.file-editor-modal.hidden,
.file-read-modal.hidden,
.input-modal.hidden {
    display: none !important;
}

.file-editor-content,
.file-read-content {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 26px;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

body.dark-mode .file-editor-content,
body.dark-mode .file-read-content {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.file-editor-header,
.file-read-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 14px;
    flex-wrap: wrap;
}

body.dark-mode .file-editor-header,
body.dark-mode .file-read-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

#file-name-input {
    font-size: 1.25rem;
    font-weight: 700;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
}

.file-read-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.file-editor-actions,
.file-read-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.file-editor-actions .icon-btn,
.file-read-actions .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f5f8;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.file-editor-actions .icon-btn:hover,
.file-read-actions .icon-btn:hover {
    background: var(--accent-purple);
    color: #ffffff;
    border-color: var(--accent-purple);
}

.file-read-actions .icon-btn.danger:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

body.dark-mode .file-editor-actions .icon-btn,
body.dark-mode .file-read-actions .icon-btn {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.fe-immutable-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.fe-password-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

#fe-password-input {
    background: #f4f5f8;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    outline: none;
    width: 130px;
}

body.dark-mode #fe-password-input {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.file-editor-body {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 380px;
    padding: 20px 24px;
}

#file-content-area {
    width: 100%;
    height: 100%;
    min-height: 360px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.98rem;
    line-height: 1.65;
    resize: none;
}

.file-read-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 250px;
}

.file-read-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.file-read-body pre code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

body.dark-mode .file-read-body pre code {
    background: rgba(255, 255, 255, 0.08);
}

.file-editor-footer,
.file-read-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid var(--border-subtle);
    background: #fbfbfe;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

body.dark-mode .file-editor-footer,
body.dark-mode .file-read-footer {
    background: #12111c;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.fe-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 23, 36, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.fe-lock-overlay.hidden {
    display: none !important;
}

.lock-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 32px 28px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

body.dark-mode .lock-card {
    background: #1e1d2c;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lock-card .lock-icon {
    font-size: 3rem;
    color: var(--accent-purple);
    margin-bottom: 12px;
}

.lock-card h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.lock-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.lock-card .input-group {
    display: flex;
    gap: 8px;
}

.lock-card input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #f4f5f8;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

body.dark-mode .lock-card input {
    background: #111019;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.lock-card .unlock-btn {
    background: var(--accent-purple);
    border: none;
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lock-card .unlock-btn:hover {
    background: var(--accent-purple-hover);
}

.input-modal-content {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

body.dark-mode .input-modal-content {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.input-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

#input-modal-field {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #f4f5f8;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

#input-modal-field:focus {
    border-color: var(--accent-purple);
}

body.dark-mode #input-modal-field {
    background: #111019;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.input-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ai-chat-stage {
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 125px);
}

.ai-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.note-context-banner {
    background: rgba(124, 77, 255, 0.1);
    border: 1px dashed var(--accent-purple);
    border-radius: 14px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.note-context-banner i {
    font-size: 1.25rem;
    color: var(--accent-purple);
}

.note-context-banner .note-title-text {
    flex: 1;
    color: var(--text-secondary);
}

.note-context-banner .note-title-text strong {
    color: var(--text-primary);
}

.note-context-banner a {
    color: var(--accent-purple);
    font-weight: 600;
    text-decoration: none;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 30px 20px;
}

.welcome-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.5rem;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.35);
}

.welcome-screen h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-screen p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 440px;
    line-height: 1.6;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 520px;
    margin-top: 18px;
}

.suggestion-chip {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    background: var(--accent-purple);
    color: #ffffff;
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

body.dark-mode .suggestion-chip {
    background: #1e1d2c;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.chat-msg {
    display: flex;
    gap: 12px;
    max-width: 82%;
    animation: fadeIn 0.2s ease;
}

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

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

.chat-msg.bot {
    align-self: flex-start;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.chat-msg.user .msg-avatar {
    background: var(--accent-purple);
    color: #ffffff;
}

.chat-msg.bot .msg-avatar {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #ffffff;
}

.msg-bubble {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: var(--shadow-card);
    word-break: break-word;
}

.chat-msg.user .msg-bubble {
    background: var(--accent-purple);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot .msg-bubble {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

body.dark-mode .chat-msg.bot .msg-bubble {
    background: #1e1d2c;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.chat-input-dock {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 8px 10px 8px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body.dark-mode .chat-input-dock {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.chat-input-dock textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.96rem;
    max-height: 120px;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.08);
    background: var(--accent-purple-hover);
}

.message {
    display: flex;
    gap: 12px;
    max-width: 82%;
    animation: fadeIn 0.2s ease;
    margin-bottom: 6px;
}

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--accent-purple);
    color: #ffffff;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #ffffff;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: var(--shadow-card);
    word-break: normal;
    overflow-wrap: break-word;
}

.message.user .message-bubble {
    background: var(--accent-purple);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

body.dark-mode .message.assistant .message-bubble {
    background: #1e1d2c;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f3f2f7;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.message.user .message-time {
    text-align: right;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    animation: fadeIn 0.2s ease;
}

.typing-dots {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 12px 18px;
    display: flex;
    gap: 6px;
    box-shadow: var(--shadow-card);
}

body.dark-mode .typing-dots {
    background: #1e1d2c;
    border-color: rgba(255, 255, 255, 0.08);
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-purple);
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.error-bubble {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    margin: 8px 0;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 28px;
    margin: 40px auto 24px auto;
    max-width: 1200px;
    width: calc(100% - 40px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    z-index: 10;
    position: relative;
}

body.dark-mode .site-footer {
    background: rgba(24, 23, 36, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.site-footer p {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-footer p a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.site-footer p a:hover {
    color: var(--accent-purple-hover);
    text-decoration: underline;
}

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

.footer-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4f5f8;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-social-link:hover {
    background: var(--accent-purple);
    color: #ffffff;
    border-color: var(--accent-purple);
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 6px 18px rgba(124, 77, 255, 0.35);
}

body.dark-mode .footer-social-link {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #b5b0be;
}

body.dark-mode .footer-social-link:hover {
    background: var(--accent-purple);
    color: #ffffff;
}

@media (max-width: 640px) {
    .site-footer {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding: 16px 20px;
    }
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .app-wrapper {
        padding: 12px 14px 40px 14px !important;
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .top-navbar {
        padding: 6px 0 16px 0 !important;
        gap: 8px !important;
    }

    .nav-links-pill {
        display: none !important;
    }

    .brand-link {
        font-size: 1.15rem !important;
        gap: 8px !important;
    }

    .brand-logo-icon {
        width: 36px !important;
        height: 36px !important;
    }

    .brand-logo-icon svg {
        width: 36px !important;
        height: 36px !important;
    }

    .user-profile-bar {
        gap: 8px !important;
    }

    .classic-chip-btn {
        padding: 5px 10px !important;
        font-size: 0.78rem !important;
    }

    .page-header-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .hero-actions-bar {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .btn-pill-primary,
    .btn-pill-secondary {
        flex: 1 1 auto !important;
        justify-content: center !important;
        min-width: 120px !important;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
        gap: 10px !important;
    }

    .folder-card,
    .file-card {
        padding: 12px !important;
        min-height: 120px !important;
        border-radius: 14px !important;
    }

    .gallery-grid {
        columns: 2 135px !important;
        column-gap: 8px !important;
    }

    .gallery-card {
        margin-bottom: 8px !important;
    }

    .drop-zone-glass {
        padding: 2rem 1rem !important;
    }

    .bulk-actions-pill {
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 6px !important;
    }

    .bulk-pill-btn {
        flex: 1 1 auto !important;
        justify-content: center !important;
        text-align: center !important;
        min-width: 85px !important;
    }

    .chat-stage-wrapper {
        height: 100dvh !important;
        padding-bottom: 75px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .page-hero-title h1 {
        font-size: 1.35rem !important;
        gap: 6px !important;
    }

    .page-hero-title p {
        font-size: 0.82rem !important;
    }

    .action-bar {
        width: 100% !important;
    }

    .action-btn {
        flex: 1 1 auto !important;
        justify-content: center !important;
        padding: 9px 14px !important;
        font-size: 0.85rem !important;
    }

    .gallery-stats {
        gap: 8px !important;
    }

    .stat-pill {
        padding: 6px 12px !important;
        font-size: 0.78rem !important;
    }

    .upload-zone {
        padding: 32px 14px !important;
        border-radius: 18px !important;
    }

    .upload-zone h3 {
        font-size: 1rem !important;
    }

    .upload-zone p {
        font-size: 0.8rem !important;
    }

    .upload-zone i {
        font-size: 2.5rem !important;
    }

    .upload-options {
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .upload-preview {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .upload-preview img {
        width: 56px !important;
        height: 56px !important;
        border-radius: 10px !important;
    }

    .upload-opt-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .upload-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .upload-actions button {
        width: 100% !important;
        justify-content: center !important;
    }

    .upload-pw-field input {
        max-width: 100% !important;
    }

    .gallery-item img {
        border-radius: 10px !important;
    }

    .lightbox-inner {
        max-width: 96vw !important;
    }

    .lightbox-img {
        max-width: 94vw !important;
        max-height: 55vh !important;
        border-radius: 12px !important;
    }

    .lightbox-close {
        top: -36px !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 1.1rem !important;
    }

    .lightbox-nav {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.3rem !important;
    }

    .lightbox-nav.prev {
        left: 8px !important;
    }

    .lightbox-nav.next {
        right: 8px !important;
    }

    .lightbox-actions {
        gap: 6px !important;
    }

    .lightbox-btn {
        padding: 6px 12px !important;
        font-size: 0.78rem !important;
    }

    .lightbox-info {
        font-size: 0.78rem !important;
        gap: 8px !important;
    }

    .ai-chat-stage {
        height: calc(100vh - 100px) !important;
        height: calc(100dvh - 100px) !important;
    }

    .chat-messages-container {
        padding: 12px 6px !important;
        gap: 12px !important;
    }

    .message-bubble-row {
        max-width: 92% !important;
    }

    .message-avatar {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.95rem !important;
    }

    .message-content-box {
        padding: 12px 14px !important;
        font-size: 0.88rem !important;
        border-radius: 16px !important;
    }

    .ai-suggestions-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .chat-input-bar,
    .chat-input-dock {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .chat-input-bar textarea,
    .chat-input-bar input,
    .chat-input-dock textarea {
        font-size: 0.88rem !important;
    }

    .admin-tabs {
        gap: 6px !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 10px !important;
    }

    .admin-tab {
        padding: 8px 14px !important;
        font-size: 0.82rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .admin-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .admin-search-input {
        max-width: 100% !important;
    }

    .admin-table-wrap {
        border-radius: 16px !important;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 10px !important;
        font-size: 0.78rem !important;
    }

    .drop-zone {
        padding: 32px 16px !important;
        border-radius: 18px !important;
    }

    .drop-zone h3 {
        font-size: 1.05rem !important;
    }

    .drop-zone p {
        font-size: 0.82rem !important;
    }

    .drop-zone i {
        font-size: 2.5rem !important;
    }

    .file-item {
        padding: 10px 14px !important;
        border-radius: 12px !important;
    }

    .confirm-box,
    .pw-modal {
        padding: 20px !important;
        border-radius: 18px !important;
        width: 94% !important;
    }

    .confirm-box h3,
    .pw-modal h3 {
        font-size: 1.1rem !important;
    }

    .file-editor-content,
    .file-read-content,
    .modal-content,
    .input-modal-content {
        width: 96% !important;
        border-radius: 18px !important;
    }

    .breadcrumb-pill {
        padding: 6px 12px !important;
        font-size: 0.82rem !important;
        gap: 6px !important;
    }

    .login-card {
        padding: 2rem 1.5rem !important;
        border-radius: 20px !important;
    }

    .side-drawer {
        width: min(280px, 85vw) !important;
        padding: 18px !important;
    }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(124, 77, 255, 0.05) 0%, rgba(124, 77, 255, 0.15) 50%, rgba(124, 77, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.6s infinite ease-in-out;
    border-radius: 8px;
}

body.dark-mode .skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
}

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

.skeleton-folder-card {
    border-radius: 22px;
    padding: 24px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

body.dark-mode .skeleton-folder-card {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.skeleton-folder-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.skeleton-folder-title {
    width: 60%;
    height: 20px;
    margin-bottom: 8px;
}

.skeleton-folder-sub {
    width: 35%;
    height: 14px;
}

.skeleton-gallery-card {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

body.dark-mode .skeleton-gallery-card {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.skeleton-image-placeholder {
    width: 100%;
    height: 220px;
    border-radius: 0;
}

.skeleton-meta {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.skeleton-date {
    height: 14px;
    width: 45%;
}

.skeleton-badge {
    height: 18px;
    width: 30px;
    border-radius: 9999px;
}

.note-options-toggle-grid {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.toggle-option-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f7f8fc;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 220px;
}

.toggle-option-card:hover {
    background: #f0f2f8;
    border-color: rgba(124, 77, 255, 0.35);
    transform: translateY(-1px);
}

.toggle-switch-control {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.toggle-switch-track::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.toggle-switch-control input:checked + .toggle-switch-track {
    background: linear-gradient(135deg, #7c4dff, #651fff);
    border-color: #651fff;
    box-shadow: 0 2px 10px rgba(101, 31, 255, 0.35);
}

.toggle-switch-control input:checked + .toggle-switch-track::before {
    transform: translateX(20px);
}

.toggle-option-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.3;
}

body.dark-mode .toggle-option-card {
    background: #14131d;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .toggle-option-card:hover {
    background: #1a1926;
    border-color: rgba(124, 77, 255, 0.4);
}

body.dark-mode .toggle-switch-track {
    background-color: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .toggle-option-label {
    color: #f3f2f7;
}


