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

:root {
    /* Light Theme (Premium Slate & Indigo) */
    --bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --divider: #e2e8f0;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: rgba(79, 70, 229, 0.06);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.07);
    --radius: 12px;
    --radius-sm: 8px;
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Premium gradients */
    --bg-gradient: radial-gradient(circle at 50% 50%, #ffffff 0%, #f8fafc 100%);
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --avatar-gradient: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%);
}

[data-theme="dark"] {
    /* Dark Theme (Premium Deep Space & Indigo) */
    --bg: #090d16;
    --sidebar-bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --divider: #1e293b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-light: rgba(99, 102, 241, 0.12);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    
    --bg-gradient: radial-gradient(circle at 50% 50%, #0f172a 0%, #090d16 100%);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg);
    background-image: var(--bg-gradient);
    color: var(--text);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Auth Page Card Styling */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg);
    background-image: var(--bg-gradient);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 24px;
}

.auth-card {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--divider);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.auth-logo h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.auth-tabs {
    display: flex;
    background-color: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 32px;
    border: 1px solid var(--divider);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 150ms ease;
}

.auth-tab.active {
    background-color: var(--sidebar-bg);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.form-group input {
    background-color: var(--bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-submit-btn {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(79, 70, 229, 0.25);
}

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

.auth-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}

.auth-alert.error {
    background-color: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-alert.success {
    background-color: rgba(34, 197, 94, 0.08);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.15);
}

/* App Core Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Sidebar Layout & Typography */
.sidebar {
    width: 280px;
    min-width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--avatar-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.header-controls {
    display: flex;
    gap: 6px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--bg);
    color: var(--text);
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--divider);
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-family);
    font-size: 13px;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
}

/* Sidebar Trees & Navigation */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px 12px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.add-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
}

.add-btn:hover {
    background-color: var(--bg);
    color: var(--text);
}

.nested {
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nested.collapsed {
    display: none;
}

.folder-row, .section-row, .note-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
    color: var(--text);
    border: 1px solid transparent;
}

.folder-row:hover, .section-row:hover, .note-item:hover {
    background-color: var(--bg);
}

.folder-row .chevron, .section-row .chevron {
    display: flex;
    transition: transform 150ms ease;
}

.folder-row.collapsed .chevron, .section-row.collapsed .chevron {
    transform: rotate(-90deg);
}

.note-item {
    font-size: 13.5px;
    margin-left: 4px;
    border-left: 2px solid transparent;
}

.note-item.active {
    background-color: var(--accent-light);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

.icon-muted {
    color: var(--text-muted);
    display: flex;
}

.note-item.active .icon-muted {
    color: var(--accent);
}

.row-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 150ms ease;
}

.folder-row:hover .row-actions, .section-row:hover .row-actions, .note-item:hover .row-actions {
    opacity: 1;
}

@media (max-width: 768px) {
    .row-actions {
        opacity: 1 !important;
    }
}

@media (hover: none) {
    .row-actions {
        opacity: 1 !important;
    }
}

.row-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: flex;
}

.row-actions button:hover {
    background-color: var(--divider);
    color: var(--text);
}

.row-actions button.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.quick-notes-section {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 12px;
}

.sidebar-empty {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.sidebar-search-heading {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    padding: 4px 12px 12px;
}

/* Editor Section Styles */
.editor-container {
    flex: 1;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 5;
    position: relative;
}

.editor-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 20px;
    text-align: center;
    padding: 40px;
}

.editor-welcome svg {
    color: var(--accent);
}

.editor-welcome h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.editor-welcome p {
    font-size: 14px;
    max-width: 360px;
}

.editor-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Toolbar Area */
.editor-toolbar {
    height: 56px;
    border-bottom: 1px solid var(--divider);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--sidebar-bg);
}

.toolbar-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.toolbar-btn:hover {
    background-color: var(--bg);
    color: var(--text);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: var(--divider);
    margin: 0 4px;
}

.format-txt-btn {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 11px;
}

/* Toolbar Tooltip Engine */
.toolbar-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background-color: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 20;
    box-shadow: var(--shadow);
}

.toolbar-btn:hover::after {
    opacity: 0.95;
    transform: translateX(-50%) scale(1);
}

/* Main Text & Format Typography */
.editor-body {
    flex: 1;
    padding: 40px 60px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

.note-title-input {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-family: var(--font-family);
    outline: none;
    width: 100%;
}

.note-title-input::placeholder {
    color: var(--text-muted);
    opacity: 0.3;
}

.note-content-editor {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
    outline: none;
    font-family: var(--font-family);
    min-height: 300px;
}

.note-content-editor:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    opacity: 0.3;
    pointer-events: none;
}

.note-content-editor h1 { font-size: 30px; font-weight: 700; margin: 24px 0 12px; letter-spacing: -0.02em; }
.note-content-editor h2 { font-size: 24px; font-weight: 700; margin: 20px 0 10px; letter-spacing: -0.01em; }
.note-content-editor h3 { font-size: 20px; font-weight: 600; margin: 16px 0 8px; }
.note-content-editor h4 { font-size: 18px; font-weight: 600; margin: 14px 0 6px; }
.note-content-editor p { margin-bottom: 16px; }

/* 6-Level Bullet Points Hierarchy styling */
.note-content-editor ul { list-style-type: disc; margin-left: 24px; margin-bottom: 16px; }
.note-content-editor ul ul { list-style-type: circle; }
.note-content-editor ul ul ul { list-style-type: square; }
.note-content-editor ul ul ul ul { list-style-type: disc; }
.note-content-editor ul ul ul ul ul { list-style-type: circle; }
.note-content-editor ul ul ul ul ul ul { list-style-type: square; }
.note-content-editor li { margin-bottom: 6px; }

/* Note wiki Link Pills styling */
.note-pill {
    display: inline-flex;
    align-items: center;
    background-color: var(--accent-light);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
}

.note-pill:hover {
    border-color: var(--accent);
    background-color: var(--divider);
}

/* Footer elements */
.editor-footer {
    height: 48px;
    border-top: 1px solid var(--divider);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--sidebar-bg);
}

.lock-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.lock-toggle:hover {
    color: var(--text);
}

/* Modal Window styles (Glassmorphism & animations) */
dialog::backdrop {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.dialog {
    border: 1px solid var(--divider);
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 420px;
    margin: auto;
    outline: none;
    animation: dialogAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="dark"] .dialog {
    background-color: rgba(15, 23, 42, 0.8);
}

@keyframes dialogAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dialog-card {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dialog-header {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dialog-body input {
    width: 100%;
    background-color: var(--bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
}

.dialog-body input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    font-family: var(--font-family);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

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

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.2);
    transform: translateY(-1px);
}

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

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--divider);
    color: var(--text);
    padding: 14px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 13.5px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Code and Table block styling inside the editor */
.note-content-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.note-content-editor th, .note-content-editor td {
    border: 1px solid var(--divider);
    padding: 12px 14px;
    text-align: left;
    min-width: 60px;
}

.note-content-editor th {
    background-color: var(--sidebar-bg);
    font-weight: 600;
    color: var(--text);
}

.note-content-editor tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.6);
}

[data-theme="dark"] .note-content-editor tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.4);
}

.note-content-editor tr:hover {
    background-color: var(--accent-light);
}

.note-content-editor pre {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.note-content-editor code {
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 13.5px;
    color: var(--text);
    background-color: var(--sidebar-bg);
    padding: 3px 6px;
    border-radius: 4px;
}

.note-content-editor pre code {
    padding: 0;
    border-radius: 0;
    background-color: transparent;
    display: block;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Hide Mobile Elements and handles by default */
.menu-toggle-btn, .menu-toggle-divider, .sidebar-backdrop, .mobile-fab, .welcome-menu-btn, .dialog-handle {
    display: none;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS OVERRIDES
   ========================================================================== */
@media (max-width: 768px) {
    /* Viewport layout transitions - Native Slide style */
    .app-container {
        width: 200vw;
        height: 100vh;
        height: 100dvh;
        display: flex;
        flex-direction: row;
        overflow: hidden;
        position: relative;
        transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    body.view-mode-list .app-container {
        transform: translateX(0);
    }

    body.view-mode-editor .app-container {
        transform: translateX(-100vw);
    }

    .sidebar {
        width: 100vw;
        min-width: 100vw;
        max-width: 100vw;
        height: 100%;
        border-right: none;
        position: static;
        box-shadow: none;
        display: flex;
        flex-direction: column;
    }

    .editor-container {
        width: 100vw;
        min-width: 100vw;
        max-width: 100vw;
        height: 100%;
        position: static;
        display: flex;
        flex-direction: column;
    }

    /* Disable drawer styles since we're using page transition */
    .sidebar-backdrop {
        display: none !important;
    }

    /* Hide welcome editor view on mobile so we only see editor-view when editing */
    .editor-welcome {
        display: none !important;
    }

    /* Menu toggle back button */
    .menu-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        height: 36px;
    }
    
    .menu-toggle-btn .hamburger-icon {
        display: none;
    }
    
    .menu-toggle-btn .back-icon {
        display: block;
        color: var(--accent);
    }
    
    .menu-toggle-divider {
        display: block;
    }

    /* Tree Navigation touch improvements */
    .sidebar-content {
        padding: 16px 12px;
        -webkit-overflow-scrolling: touch;
    }

    .folder-row, .section-row, .note-item {
        padding: 12px 14px;
        font-size: 15.5px;
        margin-bottom: 2px;
        min-height: 48px; /* Safe Touch target size */
    }

    .note-item {
        font-size: 14.5px;
        padding-left: 16px;
    }

    /* Row actions always visible on mobile since hover doesn't exist */
    .row-actions {
        opacity: 0.8;
        display: flex;
        gap: 6px;
    }
    
    .row-actions button {
        padding: 6px;
        border-radius: 50%;
        background-color: var(--accent-light);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Floating Action Button for list view only */
    .mobile-fab {
        display: flex;
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--accent-gradient);
        color: white;
        border: none;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.4);
        cursor: pointer;
        z-index: 80;
        transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease;
    }

    body.view-mode-editor .mobile-fab {
        display: none !important;
    }

    /* Bottom Sheets dialog style on mobile */
    .dialog {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        border-radius: 24px 24px 0 0;
        border: none;
        border-top: 1px solid var(--divider);
        background-color: var(--sidebar-bg);
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        animation: slideUpBottomSheet 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
        padding: 0;
    }

    [data-theme="dark"] .dialog {
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
        background-color: var(--sidebar-bg);
    }

    @keyframes slideUpBottomSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    .dialog-handle {
        display: block;
        width: 36px;
        height: 5px;
        background-color: var(--divider);
        border-radius: 3px;
        margin: 12px auto 0 auto;
    }

    .dialog-card {
        padding: 8px 24px 32px 24px;
        gap: 16px;
    }

    /* Editor body spacing */
    .editor-body {
        padding: 20px 16px 80px 16px;
        gap: 16px;
    }

    .note-title-input {
        font-size: 24px;
    }

    .note-content-editor {
        font-size: 15px;
        min-height: calc(100dvh - 220px);
    }

    /* Sticky, blur toolbar for mobile formatting */
    .editor-toolbar {
        padding: 0 16px;
        gap: 4px;
        overflow-x: auto;
        white-space: nowrap;
        background-color: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        -webkit-overflow-scrolling: touch;
    }
    
    [data-theme="dark"] .editor-toolbar {
        background-color: rgba(15, 23, 42, 0.85);
    }

    .editor-toolbar::-webkit-scrollbar {
        display: none;
    }

    /* Full-screen auth cards for native feel on mobile */
    .auth-container {
        padding: 0;
        height: 100vh;
        height: 100dvh;
    }

    .auth-card {
        max-width: 100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        padding: 48px 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-shadow: none;
    }
}