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

:root {
    /* Accent (hex written uppercase so the literal-to-variable
       conversion pass below never rewrites these definitions) */
    --yv-accent: #6366F1;
    --yv-accent-hover: #4F46E5;
    --yv-accent-rgb: 99, 102, 241;
    --yv-accent-text: #C7D2FE;

    /* Create / success (green) */
    --yv-create: #22C55E;
    --yv-create-hover: #16A34A;

    /* Surfaces */
    --yv-bg: #0B0C10;
    --yv-sidebar: #14161C;
    --yv-surface: #16181F;
    --yv-surface-2: #1C1F28;
    --yv-surface-3: #1E2129;
    --yv-panel: #14161D;

    /* Text */
    --yv-text: #E8EAED;
    --yv-text-soft: #C4C9D4;
    --yv-text-muted: #9CA3AF;
    --yv-text-dim: #6B7280;
    --yv-text-faint: #4B5563;

    /* Overlays & borders (overlay-rgb flips to black for light themes) */
    --yv-overlay-rgb: 255, 255, 255;
    --yv-border: rgba(var(--yv-overlay-rgb), 0.08);

    --yv-radius: 12px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--yv-bg);
    color: var(--yv-text);
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #1a1d2e 0%, var(--yv-bg) 60%);
}

.auth-container { width: 100%; max-width: 420px; padding: 1.5rem; }

.auth-card {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--yv-accent), #8b5cf6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.btn-primary {
    background: var(--yv-accent);
    border-color: var(--yv-accent);
}
.btn-primary:hover {
    background: var(--yv-accent-hover);
    border-color: var(--yv-accent-hover);
}

.form-control, .form-select {
    background: var(--yv-surface-2);
    border-color: var(--yv-border);
    color: var(--yv-text);
}
.form-control:focus, .form-select:focus {
    background: var(--yv-surface-2);
    border-color: var(--yv-accent);
    color: var(--yv-text);
    box-shadow: 0 0 0 3px rgba(var(--yv-accent-rgb), 0.2);
}

/* Vault layout — desktop first */
.vault-app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1040;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

.sidebar-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--yv-border);
}
.sidebar-mobile-brand {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-menu-toggle { display: none; flex-shrink: 0; }

.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: var(--yv-sidebar);
    border-top: 1px solid var(--yv-border);
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
    justify-content: space-around;
    gap: 0.15rem;
}
.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    border: none;
    background: transparent;
    color: var(--yv-text-muted);
    font-size: 0.62rem;
    font-weight: 500;
    padding: 0.35rem 0.15rem;
    border-radius: 8px;
    min-height: 48px;
}
.mobile-nav-btn i { font-size: 1.15rem; }
.mobile-nav-btn.active { color: var(--yv-accent-text); background: rgba(var(--yv-accent-rgb), 0.15); }

.editor-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

/* Component base styles below. All responsive overrides live at the END of
   this file so that, in a desktop-first stylesheet, the media queries are
   declared after the base rules they need to override. */

.vault-sidebar {
    width: 272px;
    min-width: 272px;
    background: var(--yv-sidebar);
    border-right: 1px solid var(--yv-border);
    display: flex;
    flex-direction: column;
}

/* Evernote-style sidebar top */
.sidebar-top {
    padding: 0.85rem 0.85rem 0.5rem;
    border-bottom: 1px solid var(--yv-border);
}

.sidebar-search {
    position: relative;
    margin-bottom: 0.65rem;
}
.sidebar-search i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--yv-text-dim);
    font-size: 0.85rem;
}
.sidebar-search input {
    padding: 0.45rem 0.75rem 0.45rem 2.1rem;
    border-radius: 8px;
    background: var(--yv-surface-3);
    border: 1px solid var(--yv-border);
    color: var(--yv-text);
    font-size: 0.88rem;
}
.sidebar-search input:focus {
    border-color: var(--yv-accent);
    box-shadow: 0 0 0 2px rgba(var(--yv-accent-rgb), 0.15);
}

.sidebar-create {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-create-note {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 999px;
    background: var(--yv-create);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.15s;
}
.btn-create-note:hover { background: var(--yv-create-hover); color: #fff; }

.btn-quick-action {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--yv-border);
    border-radius: 50%;
    background: var(--yv-surface-3);
    color: var(--yv-text-muted);
    font-size: 0.9rem;
    transition: all 0.15s;
}
.btn-quick-action:hover {
    background: rgba(var(--yv-overlay-rgb),0.08);
    color: var(--yv-text);
    border-color: rgba(var(--yv-overlay-rgb),0.15);
}

.text-accent { color: var(--yv-create) !important; }

.nav-divider {
    height: 1px;
    background: var(--yv-border);
    margin: 0.5rem 0.65rem;
}

.nav-sublist {
    padding-left: 0.25rem;
}

.nav-item-secondary {
    font-size: 0.85rem;
    opacity: 0.85;
}

.vault-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--yv-text-dim);
    padding: 0.5rem 0.75rem 0.35rem;
}

/* Collapsible section header (Projects) */
.nav-section-head {
    padding-right: 0.4rem;
}
.nav-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--yv-text-dim);
    cursor: pointer;
}
.nav-section-toggle:hover { color: var(--yv-text); }
.nav-section-toggle .bi-chevron-down,
.nav-section-toggle .bi-chevron-right { font-size: 0.65rem; }

/* Project view */
.project-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.project-view-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--yv-text);
    display: flex;
    align-items: center;
}
.project-body { padding: 0.5rem 0.25rem 1.5rem; }
.project-task-section { margin-bottom: 1.25rem; }
.project-task-section-head {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--yv-text-dim);
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.project-task-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.project-task-row:hover { background: rgba(var(--yv-overlay-rgb), 0.05); }
.project-task-row.done .project-task-title {
    text-decoration: line-through;
    color: var(--yv-text-dim);
}
.project-task-main { min-width: 0; flex: 1; }
.project-task-title {
    font-size: 0.92rem;
    color: var(--yv-text);
    line-height: 1.3;
}
.project-task-sub {
    font-size: 0.78rem;
    color: var(--yv-text-dim);
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Project tabs */
.project-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 0.25rem;
    border-bottom: 1px solid var(--yv-border);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.project-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    color: var(--yv-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.project-tab:hover { color: var(--yv-text); }
.project-tab.active {
    color: var(--yv-accent-text);
    border-bottom-color: var(--yv-accent);
}
.project-tab-actions {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.75rem 0.6rem;
}

/* Project notes */
.project-note-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
    padding: 0 0.5rem;
}
.project-note-card {
    border: 1px solid var(--yv-border);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.project-note-card:hover {
    background: rgba(var(--yv-overlay-rgb), 0.05);
    border-color: var(--yv-accent);
}
.project-note-title { font-size: 0.9rem; color: var(--yv-text); }
.project-note-sub { font-size: 0.75rem; color: var(--yv-text-dim); margin-top: 0.3rem; }

/* Project files */
.project-files-list { padding: 0 0.5rem; }
.project-file-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--yv-border);
}
.project-file-main {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    cursor: pointer;
}
.project-file-main:hover .project-file-name { color: var(--yv-accent, #6ea8fe); text-decoration: underline; }
.project-file-name {
    color: var(--yv-text);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-file-meta {
    font-size: 0.75rem;
    color: var(--yv-text-dim);
    white-space: nowrap;
}
.project-file-actions { display: flex; gap: 0.35rem; }

/* Cloud storage (MEGA-style drive) */
.storage-panel {
    position: relative;
    background: var(--yv-bg, #0b0c10);
    border: none;
    border-radius: 0;
    overflow: hidden;
    height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
    padding: 0 1.25rem 1rem;
}
.storage-panel-glow {
    position: absolute;
    top: -80px;
    left: 10%;
    right: 10%;
    height: 200px;
    background: radial-gradient(ellipse, rgba(var(--yv-accent-rgb), 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.storage-panel > *:not(.storage-panel-glow) { position: relative; z-index: 1; }
.storage-search-wrap {
    position: relative;
    max-width: 720px;
    margin: 0.5rem 0 1rem;
}
.storage-search-wrap .bi-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--yv-accent);
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0.75;
}
.storage-search-cloud {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--yv-accent);
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.55;
}
.storage-search-input {
    width: 100%;
    height: 2.75rem;
    padding: 0 2.75rem;
    border: 1px solid var(--yv-border);
    border-radius: 999px;
    background: var(--yv-surface-2, #1a1d24);
    color: var(--yv-text);
    font-size: 0.92rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.storage-search-input::placeholder { color: var(--yv-text-muted); }
.storage-search-input:focus {
    outline: none;
    border-color: rgba(var(--yv-accent-rgb), 0.45);
    box-shadow: 0 0 0 3px rgba(var(--yv-accent-rgb), 0.15);
}
.storage-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.btn-storage-upload {
    background: linear-gradient(135deg, var(--yv-accent), #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.55rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 2px 10px rgba(var(--yv-accent-rgb), 0.35);
    transition: transform 0.12s, box-shadow 0.12s;
}
.btn-storage-upload:hover {
    background: linear-gradient(135deg, var(--yv-accent-hover), #7c3aed);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--yv-accent-rgb), 0.4);
}
.btn-storage-secondary {
    background: var(--yv-surface-2, #1a1d24);
    color: var(--yv-text);
    border: 1px solid var(--yv-border);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.55rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: border-color 0.12s, background 0.12s;
}
.btn-storage-secondary:hover {
    background: rgba(var(--yv-accent-rgb), 0.08);
    color: var(--yv-text);
    border-color: rgba(var(--yv-accent-rgb), 0.3);
}
.storage-nav-card {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.storage-nav-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.storage-nav-left {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}
.storage-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: var(--yv-text);
    min-width: 0;
}
.storage-crumb-link {
    background: none;
    border: 0;
    color: var(--yv-text-muted);
    padding: 0.1rem 0.2rem;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.12s, background 0.12s;
}
.storage-crumb-link:hover {
    color: var(--yv-accent);
    background: rgba(var(--yv-accent-rgb), 0.08);
    text-decoration: none;
}
.storage-crumb-current {
    color: var(--yv-accent-text);
    font-weight: 600;
    background: rgba(var(--yv-accent-rgb), 0.12);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}
.storage-crumb-sep {
    color: var(--yv-text-faint);
    margin: 0 0.1rem;
    font-size: 0.75rem;
}
.storage-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.storage-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--yv-border);
    color: var(--yv-text-muted);
    background: var(--yv-surface-2);
}
.storage-stat-folders i { color: #f5b800; }
.storage-stat-files i { color: var(--yv-accent); }
.storage-stat-used i { color: #8b5cf6; }

.storage-stats-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.storage-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    min-width: 0;
}
.storage-stat-card.storage-stat-primary {
    border-color: rgba(var(--yv-accent-rgb), 0.25);
    background: linear-gradient(135deg, rgba(var(--yv-accent-rgb), 0.08), var(--yv-surface));
}
.storage-stat-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(var(--yv-accent-rgb), 0.12);
    color: var(--yv-accent);
    font-size: 1.1rem;
}
.storage-stat-body { min-width: 0; flex: 1; }
.storage-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--yv-text-dim);
    margin-bottom: 0.15rem;
}
.storage-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--yv-text);
    line-height: 1.2;
}
.storage-stat-sub {
    font-size: 0.76rem;
    color: var(--yv-text-muted);
    margin-top: 0.2rem;
}
.storage-view-toggle {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-radius: 10px;
    padding: 0.2rem;
}
.storage-view-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--yv-text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
}
.storage-view-btn:hover { color: var(--yv-text); }
.storage-view-btn.active {
    color: var(--yv-accent-text);
    background: rgba(var(--yv-accent-rgb), 0.18);
    box-shadow: 0 1px 4px rgba(var(--yv-accent-rgb), 0.2);
}
.storage-filters-bar {
    display: flex;
    align-items: center;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--yv-border);
}
.storage-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.storage-filter-select {
    appearance: none;
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-radius: 999px;
    color: var(--yv-text);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.38rem 1.75rem 0.38rem 0.9rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236366f1' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.storage-filter-select:focus {
    outline: none;
    border-color: rgba(var(--yv-accent-rgb), 0.45);
    box-shadow: 0 0 0 2px rgba(var(--yv-accent-rgb), 0.12);
}
.storage-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.storage-content-card {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
/* List view */
.storage-list-wrap { width: 100%; }
.storage-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.storage-list-table thead th {
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--yv-text-dim);
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--yv-border);
    background: var(--yv-surface-2);
    white-space: nowrap;
}
.storage-list-table tbody td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--yv-border);
    vertical-align: middle;
    color: var(--yv-text);
}
.storage-list-table tbody tr:last-child td { border-bottom: none; }
.storage-list-row {
    cursor: pointer;
    transition: background 0.12s;
}
.storage-list-row:hover { background: rgba(var(--yv-accent-rgb), 0.05); }
.storage-col-check { width: 2.5rem; }
.storage-col-date { width: 11rem; color: var(--yv-text-muted); font-size: 0.84rem; }
.storage-col-type { width: 7.5rem; }
.storage-col-size { width: 6.5rem; text-align: right; color: var(--yv-text-muted); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.storage-col-menu { width: 5.5rem; text-align: right; }
.storage-list-table tbody .storage-col-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}
.storage-list-icon-badge {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.storage-badge-folder { color: #f5b800; background: rgba(245, 184, 0, 0.15); }
.storage-badge-excel { color: #fff; background: #217346; }
.storage-badge-pdf { color: #fff; background: #c0392b; }
.storage-badge-zip { color: #64748b; background: #e2e8f0; }
.storage-badge-image { color: #3b82f6; background: rgba(59, 130, 246, 0.12); }
.storage-badge-audio { color: #a855f7; background: rgba(168, 85, 247, 0.12); }
.storage-badge-video { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.storage-badge-doc { color: #64748b; background: #f1f5f9; }
.storage-badge-file { color: #64748b; background: rgba(var(--yv-overlay-rgb), 0.06); }
.storage-list-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.storage-type-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--yv-surface-2);
    color: var(--yv-text-muted);
    border: 1px solid var(--yv-border);
}
.storage-type-folder {
    color: #b45309;
    background: rgba(245, 184, 0, 0.12);
    border-color: rgba(245, 184, 0, 0.25);
}
.storage-row-menu-wrap {
    display: inline-flex;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity 0.12s;
}
.storage-list-row:hover .storage-row-menu-wrap { opacity: 1; }
.storage-row-menu-btn {
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--yv-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.storage-row-menu-btn:hover {
    background: rgba(var(--yv-accent-rgb), 0.1);
    color: var(--yv-accent);
}
.storage-row-menu-btn.danger:hover { background: rgba(248, 113, 113, 0.12); color: #ef4444; }
/* Grid view */
.storage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 1.25rem 1rem;
    padding: 1.25rem;
}
.storage-grid-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    text-align: center;
    border-radius: 12px;
    transition: background 0.12s, transform 0.12s;
}
.storage-grid-tile:hover {
    background: rgba(var(--yv-accent-rgb), 0.06);
    transform: translateY(-2px);
}
.storage-grid-thumb {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: var(--yv-surface-2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.storage-thumb-folder { color: #f5b800; background: rgba(245, 184, 0, 0.12); }
.storage-thumb-excel { color: #fff; background: #217346; font-size: 2rem; }
.storage-thumb-pdf { color: #fff; background: #c0392b; }
.storage-thumb-zip { color: #64748b; background: #e2e8f0; }
.storage-thumb-image { color: #3b82f6; background: rgba(59, 130, 246, 0.12); }
.storage-thumb-audio { color: #a855f7; background: rgba(168, 85, 247, 0.12); }
.storage-thumb-video { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.storage-thumb-doc { color: #64748b; background: #f1f5f9; }
.storage-thumb-file { color: #64748b; background: rgba(var(--yv-overlay-rgb), 0.06); }
.storage-grid-name {
    font-size: 0.78rem;
    color: var(--yv-text);
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    font-weight: 500;
}
.storage-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--yv-text-dim);
    min-height: 320px;
    margin: 1rem;
    border-radius: 16px;
    border: 2px dashed rgba(var(--yv-accent-rgb), 0.2);
    background: rgba(var(--yv-accent-rgb), 0.04);
}
.storage-empty-icon-wrap {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--yv-accent-rgb), 0.15), rgba(139, 92, 246, 0.15));
    margin-bottom: 1rem;
}
.storage-empty-icon-wrap i {
    font-size: 2rem;
    color: var(--yv-accent);
}
.storage-empty p { margin-bottom: 0.35rem; color: var(--yv-text); font-size: 1.05rem; font-weight: 600; }
.storage-empty-sub { font-size: 0.85rem; color: var(--yv-text-muted); margin-bottom: 0; }
.storage-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}
@media (max-width: 768px) {
    .storage-panel {
        height: auto;
        min-height: calc(100vh - 130px);
        padding: 0 0.75rem 1rem;
    }
    .storage-stats-bar {
        grid-template-columns: 1fr;
    }
    .storage-col-date,
    .storage-col-type { display: none; }
    .storage-row-menu-wrap { opacity: 1; }
    .storage-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); padding: 1rem; }
    .storage-grid-thumb { width: 76px; height: 76px; font-size: 1.85rem; }
}

/* Project milestones */
.project-milestone-list { padding: 0 0.5rem; }
.project-milestone-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--yv-border);
}
.project-milestone-main { flex: 1; min-width: 0; }
.project-milestone-title { font-size: 0.9rem; color: var(--yv-text); }
.project-milestone-row.done .project-milestone-title {
    text-decoration: line-through;
    color: var(--yv-text-dim);
}
.project-milestone-sub {
    font-size: 0.78rem;
    color: var(--yv-text-dim);
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Labels */
.task-labels { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.task-label-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.task-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    line-height: 1.4;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.task-label-x {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}
.task-label-x:hover { opacity: 1; }
.project-task-title + .task-labels,
.project-task-main .task-labels { margin-top: 0.25rem; }

/* Sub-tasks */
.project-subtask-list {
    margin-left: 2.1rem;
    border-left: 2px solid var(--yv-border);
    padding-left: 0.4rem;
}

/* Overview dashboard */
.project-overview { padding: 0.25rem 0.5rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.project-progress-card {
    border: 1px solid var(--yv-border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
.project-progress-top { display: flex; justify-content: space-between; align-items: baseline; }
.project-progress-label { font-size: 0.8rem; color: var(--yv-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.project-progress-pct { font-size: 1.4rem; font-weight: 700; color: var(--yv-text); }
.project-progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(var(--yv-overlay-rgb), 0.12);
    overflow: hidden;
    margin: 0.5rem 0 0.4rem;
}
.project-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--yv-accent), #22c55e);
    transition: width 0.4s ease;
}
.project-progress-sub { font-size: 0.78rem; color: var(--yv-text-dim); }

.project-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 0.6rem;
}
.project-stat {
    border: 1px solid var(--yv-border);
    border-radius: 10px;
    padding: 0.65rem 0.5rem;
    text-align: center;
}
.project-stat-num { font-size: 1.35rem; font-weight: 700; color: var(--yv-text); line-height: 1; }
.project-stat-label { font-size: 0.72rem; color: var(--yv-text-dim); margin-top: 0.25rem; }
.project-stat.doing .project-stat-num { color: #3b82f6; }
.project-stat.done .project-stat-num { color: #22c55e; }
.project-stat.danger .project-stat-num { color: #ef4444; }
.project-stat.warn .project-stat-num { color: #f59e0b; }

.project-overview-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 780px) { .project-overview-cols { grid-template-columns: 1fr; } }
.project-overview-card {
    border: 1px solid var(--yv-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}
.project-overview-card-head {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--yv-text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.project-focus-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.25rem;
    border-radius: 8px;
    cursor: pointer;
}
.project-focus-row:hover { background: rgba(var(--yv-overlay-rgb), 0.05); }
.project-focus-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.project-focus-title { flex: 1; min-width: 0; color: var(--yv-text); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-focus-due { font-size: 0.76rem; color: var(--yv-text-dim); white-space: nowrap; }
.project-focus-due.overdue { color: #ef4444; font-weight: 600; }
.project-next-ms { font-size: 0.9rem; color: var(--yv-text); }

/* Kanban board */
.board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0.25rem 0.5rem 1.5rem;
    align-items: start;
}
@media (max-width: 780px) { .board-grid { grid-template-columns: 1fr; } }
.board-col {
    background: rgba(var(--yv-overlay-rgb), 0.03);
    border: 1px solid var(--yv-border);
    border-radius: 12px;
    overflow: hidden;
}
.board-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--yv-text);
    border-top: 3px solid var(--yv-accent);
}
.board-col-count {
    font-size: 0.72rem;
    color: var(--yv-text-dim);
    background: rgba(var(--yv-overlay-rgb), 0.08);
    border-radius: 999px;
    padding: 0 0.45rem;
}
.board-col-body { padding: 0.5rem; min-height: 60px; display: flex; flex-direction: column; gap: 0.5rem; }
.board-col-body.drag-over { background: rgba(var(--yv-accent-rgb), 0.08); outline: 2px dashed var(--yv-accent); outline-offset: -4px; }
.board-card {
    background: var(--yv-bg, #1a1a1a);
    border: 1px solid var(--yv-border);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.board-card.dragging { opacity: 0.5; }
.board-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem; }
.board-card-title { font-size: 0.88rem; color: var(--yv-text); line-height: 1.3; }
.board-card-check { background: none; border: 0; color: var(--yv-text-dim); cursor: pointer; padding: 0; font-size: 1rem; }
.board-card-check:hover { color: #22c55e; }
.board-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.74rem; color: var(--yv-text-dim); }
.board-card-due.overdue { color: #ef4444; font-weight: 600; }
.board-card-prio { text-transform: capitalize; }
.board-card-prio.priority-high { color: #ef4444; }
.board-card-prio.priority-low { color: #10b981; }
.board-add {
    background: none;
    border: 1px dashed var(--yv-border);
    border-radius: 8px;
    color: var(--yv-text-dim);
    padding: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
}
.board-add:hover { color: var(--yv-text); border-color: var(--yv-accent); }

.nav-item-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--yv-text-soft);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.15s;
}
.nav-item-btn i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.nav-item-btn:hover { background: rgba(var(--yv-overlay-rgb),0.06); color: #fff; }
.nav-item-btn.active {
    background: rgba(var(--yv-accent-rgb), 0.18);
    color: var(--yv-accent-text);
}

.notebook-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--yv-text-muted);
    transition: all 0.15s;
}
.notebook-item:hover { background: rgba(var(--yv-overlay-rgb),0.05); color: var(--yv-text); }
.notebook-item.active {
    background: rgba(var(--yv-accent-rgb), 0.12);
    color: var(--yv-accent-text);
}

.vault-sidebar-footer {
    padding: 0.65rem 0.85rem;
    border-top: 1px solid var(--yv-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}
.user-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yv-accent), #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-info { min-width: 0; }
.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--yv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-email {
    font-size: 0.68rem;
    color: var(--yv-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}
.footer-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--yv-text-dim);
    text-decoration: none;
    transition: all 0.15s;
}
.footer-btn:hover {
    background: rgba(var(--yv-overlay-rgb),0.06);
    color: var(--yv-text);
}

.vault-topbar {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--yv-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--yv-surface);
    min-height: 52px;
}
.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--yv-text);
}

.vault-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--yv-bg);
}

.vault-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Notes list */
.note-card {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: var(--yv-radius);
    padding: 1rem 1.15rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.note-card:hover {
    border-color: rgba(var(--yv-accent-rgb), 0.4);
    transform: translateY(-1px);
}
.note-card.active {
    border-color: var(--yv-accent);
    box-shadow: 0 0 0 1px rgba(var(--yv-accent-rgb), 0.3);
}
.note-card h6 { margin: 0 0 0.25rem; font-weight: 600; font-size: 0.92rem; }
.note-card .note-preview {
    font-size: 0.78rem;
    color: var(--yv-text-muted);
    line-height: 1.35;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.note-card .meta {
    font-size: 0.72rem;
    color: var(--yv-text-dim);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.rem-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(var(--yv-accent-rgb), 0.15);
    color: #a5b4fc;
    border-radius: 6px;
    padding: 0.05rem 0.4rem;
    font-size: 0.68rem;
}
.rem-pill.overdue { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.card-tags { margin-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.card-tag {
    font-size: 0.66rem;
    color: var(--yv-text-muted);
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-radius: 5px;
    padding: 0.05rem 0.35rem;
}

/* Sidebar counts */
.nav-count {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--yv-text-dim);
    background: rgba(var(--yv-overlay-rgb), 0.06);
    border-radius: 10px;
    padding: 0 0.4rem;
    min-width: 1.2rem;
    text-align: center;
}
.notebook-item .nb-del {
    color: var(--yv-text-dim);
    opacity: 0;
    transition: opacity 0.15s;
}
.notebook-item:hover .nb-del { opacity: 1; }

/* Editor meta row (tags + reminder) */
.editor-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--yv-border);
    background: var(--yv-panel);
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(var(--yv-accent-rgb), 0.15);
    color: var(--yv-accent-text);
    border-radius: 6px;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
}
.tag-chip .tag-x {
    border: none;
    background: none;
    color: var(--yv-accent-text);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font-size: 0.95rem;
}
.tag-input {
    flex: 1;
    min-width: 120px;
    background: transparent;
    border: none;
    color: var(--yv-text);
    font-size: 0.8rem;
    outline: none;
}
.reminder-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(var(--yv-accent-rgb), 0.15);
    color: #a5b4fc;
    border-radius: 6px;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
}
.reminder-badge.overdue { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }

#btnPinNote.active { border-color: #f59e0b; }

/* Editor footer */
.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--yv-border);
    font-size: 0.72rem;
    color: var(--yv-text-dim);
    background: var(--yv-panel);
}

.auto-save-status {
    font-size: 0.72rem;
    color: var(--yv-text-dim);
    min-height: 1em;
    transition: color 0.2s ease;
}
.auto-save-status.auto-save-saving { color: #a5b4fc; }
.auto-save-status.auto-save-saved { color: #86efac; }
.auto-save-status.auto-save-error { color: #fca5a5; }

.task-modal-footer .auto-save-status {
    align-self: center;
}

/* Trash banner */
.trash-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: rgba(239, 68, 68, 0.12);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 0.85rem;
}

.dropdown-menu-dark {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
}
.dropdown-menu-dark .dropdown-item { color: var(--yv-text-soft); }
.dropdown-menu-dark .dropdown-item:hover { background: rgba(var(--yv-accent-rgb),0.15); color: #fff; }

/* Editor panel */
.editor-panel {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: var(--yv-radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.editor-panel .editor-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--yv-border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.editor-panel .editor-header input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--yv-text);
    outline: none;
}

.editor-panel .ql-toolbar {
    border: none !important;
    border-bottom: 1px solid var(--yv-border) !important;
    background: var(--yv-surface-2);
}
.editor-panel .ql-container {
    border: none !important;
    flex: 1;
    font-size: 0.95rem;
}
.editor-panel .ql-editor {
    min-height: 280px;
    color: var(--yv-text);
}

/* Thicker strikethrough line */
.ql-editor s {
    text-decoration-thickness: 3px;
}

/* Strikethrough color picker (toolbar) */
.ql-strike-color {
    position: relative;
    display: inline-block;
}
.ql-strike-color-btn {
    position: relative;
    width: 28px;
    height: 24px;
    padding: 3px 5px;
    background: none;
    border: none;
    cursor: pointer;
}
.ql-strike-color-btn .ql-stroke {
    stroke: #ccc;
    fill: none;
    stroke-width: 1.4;
}
.ql-strike-color-btn:hover .ql-stroke,
.ql-strike-color.open .ql-strike-color-btn .ql-stroke { stroke: var(--yv-accent); }
.ql-strike-color-bar {
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 2px;
    height: 3px;
    border-radius: 2px;
    background: #e74c3c;
}
.ql-strike-color-popover {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 150px;
    margin-top: 4px;
    padding: 8px;
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.ql-strike-color.open .ql-strike-color-popover { display: grid; }
.ql-strike-color-swatch {
    width: 100%;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(var(--yv-overlay-rgb), 0.15);
    border-radius: 5px;
    cursor: pointer;
}
.ql-strike-color-swatch:hover { outline: 2px solid var(--yv-accent); }
.ql-strike-color-custom {
    position: relative;
    height: 22px;
    border: 1px dashed rgba(var(--yv-overlay-rgb), 0.35);
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
}
.ql-strike-color-custom input[type="color"] {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}
.ql-strike-color-reset {
    grid-column: 1 / -1;
    padding: 4px 0;
    font-size: 0.72rem;
    color: var(--yv-accent-text);
    background: rgba(var(--yv-accent-rgb), 0.12);
    border: 1px solid rgba(var(--yv-accent-rgb), 0.35);
    border-radius: 5px;
    cursor: pointer;
}
.ql-strike-color-reset:hover { background: rgba(var(--yv-accent-rgb), 0.25); }

.split-view {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem;
    height: calc(100vh - 130px);
}

/* Password table */
.pw-table {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: var(--yv-radius);
    overflow: hidden;
}
.pw-table table { margin: 0; }
.pw-table th {
    background: var(--yv-surface-2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--yv-text-dim);
    border-color: var(--yv-border);
}
.pw-table td { border-color: var(--yv-border); vertical-align: middle; }

/* Unlock overlay */
.unlock-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 12, 16, 0.92);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.unlock-box {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.unlock-box .lock-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--yv-accent), #8b5cf6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--yv-text-dim);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: 0.4; }

.attachments-list {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--yv-border);
}
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    margin: 0.25rem 0.25rem 0 0;
}

.voice-notes-section {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--yv-border);
    background: rgba(var(--yv-accent-rgb), 0.04);
}
.voice-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.voice-note-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-radius: 10px;
}
.btn-play-voice {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--yv-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}
.btn-play-voice:hover { background: var(--yv-accent-hover); }
.btn-play-voice.playing { background: #ef4444; }
.voice-note-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.voice-note-name {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.voice-note-meta {
    font-size: 0.72rem;
    color: var(--yv-text-muted);
}
.voice-record-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #f87171;
    font-weight: 500;
}
.recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: voice-pulse 1.2s ease-in-out infinite;
}
.btn-record-voice.recording {
    pointer-events: none;
    opacity: 0.6;
}

/* ── Tasks (Evernote-style) ─────────────────────────────────── */
.tasks-panel {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: var(--yv-radius);
    overflow: hidden;
    height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
}
.tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--yv-border);
    flex-wrap: wrap;
}
.tasks-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.task-tab {
    border: none;
    background: transparent;
    color: var(--yv-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border-bottom: 2px solid transparent;
}
.task-tab:hover { color: var(--yv-text); background: rgba(var(--yv-overlay-rgb),0.04); }
.task-tab.active {
    color: var(--yv-text);
    border-bottom-color: var(--yv-accent);
    background: rgba(var(--yv-accent-rgb),0.1);
}
.task-find-wrap {
    position: relative;
    min-width: 180px;
}
.task-find-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--yv-text-dim);
    font-size: 0.8rem;
}
.task-find-wrap input {
    padding-left: 2rem;
    background: var(--yv-surface-2);
    border-color: var(--yv-border);
    color: var(--yv-text);
    border-radius: 8px;
}
.tasks-table-wrap { flex: 1; overflow-y: auto; }
.tasks-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--yv-text-dim);
    border-color: var(--yv-border);
    background: var(--yv-panel);
    position: sticky;
    top: 0;
    z-index: 1;
}
.tasks-table td {
    border-color: var(--yv-border);
    vertical-align: middle;
    font-size: 0.88rem;
}
.task-row { cursor: pointer; }
.task-row:hover { background: rgba(var(--yv-overlay-rgb),0.03); }
.task-row.done .task-row-title { text-decoration: line-through; color: var(--yv-text-dim); }
.task-check-btn {
    width: 22px;
    height: 22px;
    border: 2px solid var(--yv-text-dim);
    border-radius: 50%;
    background: transparent;
    color: var(--yv-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.6rem;
    flex-shrink: 0;
    padding: 0;
    font-size: 0.75rem;
}
.task-check-btn.done {
    border-color: var(--yv-create);
    background: var(--yv-create);
    color: #fff;
}
.task-row-title {
    display: flex;
    align-items: center;
}
.task-row-title .bi-bell { color: #a5b4fc; font-size: 0.8rem; margin-left: 0.35rem; }
.task-row-title .bi-flag-fill { color: #f59e0b; font-size: 0.75rem; margin-left: 0.35rem; }
.priority-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}
.priority-low { background: rgba(34,197,94,0.15); color: #86efac; }
.priority-medium { background: rgba(234,179,8,0.15); color: #fde047; }
.priority-high { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* Task modal */
.task-modal { border-radius: 12px; overflow: hidden; }
.task-modal-top { padding: 1rem 1.25rem 0.5rem; }
.task-nb-select {
    max-width: 220px;
    background: var(--yv-surface-2);
    border-color: var(--yv-border);
    color: var(--yv-text);
}
.task-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--yv-border);
}
.task-circle-check {
    width: 28px;
    height: 28px;
    border: 2px solid var(--yv-text-dim);
    border-radius: 50%;
    background: transparent;
    color: var(--yv-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}
.task-circle-check.done {
    border-color: var(--yv-create);
    background: var(--yv-create);
    color: #fff;
}
.task-title-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--yv-text);
    outline: none;
}
.task-field-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--yv-border);
    align-items: start;
}
.task-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--yv-text-muted);
    font-size: 0.85rem;
    padding-top: 0.25rem;
}
.task-field-label i { width: 1rem; text-align: center; }
.task-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.task-pill {
    border: 1px solid var(--yv-border);
    background: var(--yv-surface-2);
    color: var(--yv-text-soft);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    transition: all 0.15s;
}
.task-pill:hover { background: rgba(var(--yv-overlay-rgb),0.06); color: #fff; }
.task-pill.active {
    background: rgba(var(--yv-accent-rgb),0.2);
    border-color: var(--yv-accent);
    color: var(--yv-accent-text);
}
.task-pill-clear { color: var(--yv-text-dim); }
#taskEditor { min-height: 100px; }
#taskEditor .ql-toolbar {
    border: 1px solid var(--yv-border) !important;
    border-radius: 8px 8px 0 0;
    background: var(--yv-surface-2);
}
#taskEditor .ql-container {
    border: 1px solid var(--yv-border) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px;
    min-height: 80px;
    color: var(--yv-text);
}

/* Project note modal editor */
.project-note-editor-wrap {
    padding: 0.85rem 1.25rem 1rem;
}
#projectNoteEditor {
    width: 100%;
    min-height: 180px;
}
#projectNoteEditor .ql-toolbar {
    border: 1px solid var(--yv-border) !important;
    border-radius: 8px 8px 0 0;
    background: var(--yv-surface-2);
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.25rem;
}
#projectNoteEditor .ql-container {
    border: 1px solid var(--yv-border) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px;
    min-height: 140px;
    color: var(--yv-text);
}
#projectNoteEditor .ql-editor {
    min-height: 120px;
}

.task-modal-footer { padding: 0.75rem 1.25rem; }

/* Voice input */
.btn-voice.voice-active,
.task-voice-btn.voice-active {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
    animation: voice-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.editor-voice-bar {
    padding: 0.4rem 1.25rem 0;
    border-bottom: 1px solid var(--yv-border);
    background: var(--yv-panel);
}
.task-voice-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--yv-border);
    border-radius: 50%;
    background: var(--yv-surface-2);
    color: var(--yv-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

/* ── Sync status indicator ──────────────────────────────────── */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--yv-text-soft);
    background: rgba(var(--yv-accent-rgb), 0.1);
    border: 1px solid rgba(var(--yv-accent-rgb), 0.22);
    white-space: nowrap;
    max-width: min(220px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.sync-status.sync-active {
    color: #a5b4fc;
    background: rgba(var(--yv-accent-rgb), 0.16);
    border-color: rgba(var(--yv-accent-rgb), 0.35);
}
.sync-status.sync-success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
}
.sync-status.sync-offline {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
}
.sync-status.sync-error {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
}
.sync-status-icon {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.sync-status.sync-active .sync-status-icon i {
    animation: sync-spin 1s linear infinite;
}
@keyframes sync-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Notification center ────────────────────────────────────── */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notif-wrap { position: relative; }
.notif-bell {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.05rem;
}
.notif-bell i { transition: transform 0.2s; }
.notif-bell:hover i { transform: rotate(-12deg); }
.notif-wrap:has(.notif-panel.open) .notif-bell {
    background: rgba(var(--yv-accent-rgb), 0.18);
    border-color: var(--yv-accent);
    color: var(--yv-accent-text);
}
.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f43f5e, #ef4444);
    color: #fff;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--yv-surface);
    animation: notif-pop 0.25s ease;
}
@keyframes notif-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.notif-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: transparent;
}
.notif-backdrop.show { display: block; }

.notif-panel {
    position: fixed;
    top: 60px;
    right: 14px;
    z-index: 1060;
    width: 380px;
    max-width: calc(100vw - 28px);
    max-height: min(72vh, 600px);
    background: var(--yv-surface);
    border: 1px solid rgba(var(--yv-overlay-rgb), 0.1);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: top right;
    animation: notif-panel-in 0.16s ease;
}
.notif-panel.open { display: flex; }
@keyframes notif-panel-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.95rem 0.7rem;
    border-bottom: 1px solid var(--yv-border);
    background: linear-gradient(180deg, rgba(var(--yv-accent-rgb), 0.1), transparent);
}
.notif-head-left { display: flex; align-items: center; gap: 0.5rem; }
.notif-title { font-size: 1rem; font-weight: 700; color: var(--yv-text); letter-spacing: -0.01em; }
.notif-head-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--yv-accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.notif-head-actions {
    display: flex;
    gap: 0.2rem;
    background: rgba(var(--yv-overlay-rgb), 0.04);
    border: 1px solid var(--yv-border);
    border-radius: 9px;
    padding: 2px;
}
.notif-head-btn {
    width: 30px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--yv-text-muted);
    border-radius: 7px;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.notif-head-btn:hover { background: rgba(var(--yv-overlay-rgb), 0.09); color: var(--yv-text); }
.notif-head-btn.active { background: rgba(var(--yv-accent-rgb), 0.22); color: var(--yv-accent-text); }

.notif-list { overflow-y: auto; padding: 0.4rem 0.45rem 0.55rem; }
.notif-list::-webkit-scrollbar { width: 8px; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(var(--yv-overlay-rgb), 0.1); border-radius: 8px; }
.notif-group-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--yv-text-dim);
    padding: 0.7rem 0.6rem 0.3rem;
}
.notif-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.65rem;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.notif-item:hover { background: rgba(var(--yv-overlay-rgb), 0.06); }
.notif-item:active { transform: scale(0.99); }
.notif-item.overdue::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: #ef4444;
}
.notif-item.read { opacity: 0.6; }
.notif-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.notif-main { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--yv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}
.notif-item-sub {
    font-size: 0.73rem;
    color: var(--yv-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-kind { color: #a5b4fc; font-weight: 500; }
.notif-dot-sep { margin: 0 0.3rem; color: var(--yv-text-faint); }
.notif-when {
    font-size: 0.7rem;
    color: var(--yv-text-dim);
    flex-shrink: 0;
    white-space: nowrap;
    align-self: flex-start;
    padding-top: 0.1rem;
}
.notif-when.overdue { color: #fca5a5; font-weight: 600; }
.notif-unread-dot {
    position: absolute;
    right: 0.5rem;
    bottom: 0.55rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yv-accent);
    box-shadow: 0 0 0 3px rgba(var(--yv-accent-rgb), 0.18);
}
.notif-empty {
    text-align: center;
    color: var(--yv-text-dim);
    padding: 3rem 1rem;
}
.notif-empty i {
    font-size: 2.6rem;
    display: block;
    margin-bottom: 0.7rem;
    color: var(--yv-create);
    opacity: 0.7;
}
.notif-empty p { margin: 0; font-size: 0.88rem; font-weight: 500; }

@media (max-width: 575.98px) {
    .notif-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 78vh;
        border-radius: 18px 18px 0 0;
        animation: notif-sheet-in 0.2s ease;
    }
    @keyframes notif-sheet-in {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .notif-backdrop.show { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); }
}

/* ── Planner ────────────────────────────────────────────────── */
.planner-panel {
    background: var(--yv-surface);
    border: 1px solid var(--yv-border);
    border-radius: var(--yv-radius);
    overflow: hidden;
    height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
}
.planner-toolbar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--yv-border);
}
.planner-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.planner-tab {
    border: none;
    background: transparent;
    color: var(--yv-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.planner-tab:hover { color: var(--yv-text); background: rgba(var(--yv-overlay-rgb),0.04); }
.planner-tab.active {
    color: var(--yv-text);
    border-bottom-color: var(--yv-accent);
    background: rgba(var(--yv-accent-rgb),0.1);
}
.planner-date-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--yv-border);
    background: var(--yv-panel);
}
.planner-range-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--yv-text);
    margin-left: 0.35rem;
}
.planner-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Cards */
.planner-card-list { display: flex; flex-direction: column; gap: 0.5rem; }
.planner-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-left: 3px solid var(--yv-accent);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.planner-card:hover { background: rgba(var(--yv-overlay-rgb),0.04); transform: translateY(-1px); }
.planner-card.done { opacity: 0.55; }
.planner-card.done .planner-card-title { text-decoration: line-through; color: var(--yv-text-dim); }
.planner-card-main { flex: 1; min-width: 0; }
.planner-card-title { font-size: 0.92rem; font-weight: 600; color: var(--yv-text); }
.planner-card-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--yv-text-muted);
    margin-top: 0.2rem;
}
.planner-card-sub i { font-size: 0.72rem; }
.planner-sub-sep { color: var(--yv-text-faint); }
.planner-card-badge { color: var(--yv-text-dim); font-size: 0.95rem; flex-shrink: 0; }
.planner-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--yv-text-dim);
    border-radius: 50%;
    background: transparent;
    color: var(--yv-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    font-size: 0.78rem;
}
.planner-check.done { border-color: var(--yv-create); background: var(--yv-create); color: #fff; }
.planner-type-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.72rem;
}

/* Goal progress */
.planner-progress-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.45rem; }
.planner-progress {
    flex: 1;
    height: 6px;
    background: rgba(var(--yv-overlay-rgb),0.08);
    border-radius: 999px;
    overflow: hidden;
    max-width: 260px;
}
.planner-progress-bar { height: 100%; border-radius: 999px; transition: width 0.2s; }
.planner-progress-pct { font-size: 0.72rem; color: var(--yv-text-muted); }

/* Daily sections */
.planner-day-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.planner-section-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--yv-text-dim);
    margin-bottom: 0.5rem;
}
.planner-section-count {
    margin-left: 0.25rem;
    background: rgba(var(--yv-overlay-rgb),0.06);
    border-radius: 10px;
    padding: 0 0.4rem;
    font-size: 0.7rem;
}

/* Grouped lists */
.planner-group-head {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--yv-text-dim);
    margin: 0.85rem 0 0.15rem;
}
.planner-grouped .planner-group-head:first-child { margin-top: 0; }

/* Goals grid */
.planner-goal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.planner-goal-grid .planner-card { align-items: flex-start; }

/* Weekly grid */
.planner-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    min-height: 100%;
}
.planner-week-col {
    background: var(--yv-panel);
    border: 1px solid var(--yv-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    overflow: hidden;
}
.planner-week-col.today { border-color: var(--yv-accent); box-shadow: 0 0 0 1px rgba(var(--yv-accent-rgb),0.3); }
.planner-week-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--yv-border);
    cursor: pointer;
}
.planner-week-head:hover { background: rgba(var(--yv-overlay-rgb),0.04); }
.planner-week-day { font-size: 0.68rem; text-transform: uppercase; color: var(--yv-text-dim); letter-spacing: 0.04em; }
.planner-week-num { font-size: 1.05rem; font-weight: 700; color: var(--yv-text); }
.planner-week-col.today .planner-week-num { color: var(--yv-accent-text); }
.planner-week-items {
    flex: 1;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.planner-chip {
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-left: 3px solid var(--yv-accent);
    border-radius: 6px;
    padding: 0.3rem 0.4rem;
    cursor: pointer;
    transition: background 0.15s;
}
.planner-chip:hover { background: rgba(var(--yv-overlay-rgb),0.05); }
.planner-chip.done { opacity: 0.5; }
.planner-chip.done .planner-chip-title { text-decoration: line-through; }
.planner-chip-time { display: block; font-size: 0.62rem; color: var(--yv-text-muted); }
.planner-chip-title {
    display: block;
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--yv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.planner-week-add {
    border: 1px dashed var(--yv-border);
    background: transparent;
    color: var(--yv-text-dim);
    border-radius: 6px;
    padding: 0.2rem;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}
.planner-week-col:hover .planner-week-add { opacity: 1; }
.planner-week-add:hover { color: var(--yv-accent-text); border-color: var(--yv-accent); }

/* Monthly grid */
.planner-month-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.planner-month-weekdays span {
    text-align: center;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--yv-text-dim);
    font-weight: 600;
}
.planner-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(96px, 1fr);
    gap: 0.4rem;
}
.planner-month-cell {
    background: var(--yv-panel);
    border: 1px solid var(--yv-border);
    border-radius: 8px;
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    min-height: 96px;
}
.planner-month-cell.muted { opacity: 0.45; }
.planner-month-cell.today {
    border-color: var(--yv-accent);
    box-shadow: 0 0 0 1px rgba(var(--yv-accent-rgb), 0.3);
}
.planner-month-cell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.planner-month-num {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--yv-text-soft);
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.planner-month-num:hover { background: rgba(var(--yv-overlay-rgb), 0.08); color: #fff; }
.planner-month-cell.today .planner-month-num {
    background: var(--yv-accent);
    color: #fff;
}
.planner-month-add {
    border: none;
    background: transparent;
    color: var(--yv-text-dim);
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.2rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.planner-month-cell:hover .planner-month-add { opacity: 1; }
.planner-month-add:hover { color: var(--yv-accent-text); }
.planner-month-items {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}
.planner-month-chip {
    background: var(--yv-surface-2);
    border: 1px solid var(--yv-border);
    border-left: 3px solid var(--yv-accent);
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
    cursor: pointer;
    transition: background 0.15s;
}
.planner-month-chip:hover { background: rgba(var(--yv-overlay-rgb), 0.06); }
.planner-month-chip.done { opacity: 0.5; }
.planner-month-chip.done .planner-month-chip-title { text-decoration: line-through; }
.planner-month-chip-title {
    display: block;
    font-size: 0.68rem;
    color: var(--yv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.planner-month-more {
    font-size: 0.64rem;
    color: var(--yv-text-muted);
    cursor: pointer;
    padding: 0 0.3rem;
}
.planner-month-more:hover { color: var(--yv-accent-text); }

/* Planner modal extras */
.planner-color-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.planner-color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
}
.planner-color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(var(--yv-overlay-rgb),0.25); }

@media (max-width: 991.98px) {
    .planner-panel { height: auto; min-height: calc(100dvh - 8.5rem); }
    .planner-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }
    .planner-tab { white-space: nowrap; flex-shrink: 0; }
    .planner-week-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .planner-week-col { min-height: auto; }
    .planner-week-head { flex-direction: row; gap: 0.5rem; justify-content: flex-start; }
    .planner-month-grid { grid-auto-rows: minmax(64px, 1fr); gap: 0.2rem; }
    .planner-month-weekdays { gap: 0.2rem; }
    .planner-month-weekdays span { font-size: 0.58rem; }
    .planner-month-cell { min-height: 64px; padding: 0.2rem; }
    .planner-month-add { display: none; }
    .planner-month-chip-title { font-size: 0.6rem; }
    #plannerModal .modal-dialog { margin: 0; max-width: 100%; min-height: 100dvh; }
    #plannerModal .modal-content { min-height: 100dvh; border-radius: 0; }
    .planner-goal-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   Kept at the end of the file so these rules win over the
   desktop-first base styles declared above (equal specificity →
   later declaration wins).
   ════════════════════════════════════════════════════════════ */

/* ── Tablet & mobile (below 992px) ─────────────────────────── */
@media (max-width: 991.98px) {
    .btn-menu-toggle { display: inline-flex; }

    .vault-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1050;
        width: min(300px, 88vw);
        min-width: 0;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
    }
    .vault-sidebar.open { transform: translateX(0); }

    .sidebar-mobile-header { display: flex; }

    .vault-main {
        width: 100%;
        min-width: 0;
    }

    .vault-topbar {
        padding: 0.65rem 0.85rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .topbar-title {
        font-size: 0.95rem;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .vault-content {
        padding: 0.75rem;
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav { display: flex; }

    /* Notes: list OR editor, not both */
    .split-view {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        height: auto;
        min-height: calc(100dvh - 8.5rem);
    }
    #notesView.editing #notesListPanel { display: none; }
    #notesView:not(.editing) #editorPanel { display: none; }

    .editor-panel .editor-header {
        flex-wrap: wrap;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .editor-panel .editor-header input {
        width: 100%;
        flex: 1 1 100%;
        font-size: 1.05rem;
        order: 1;
    }
    #btnBackNotes { order: 0; }
    .editor-header-actions {
        order: 2;
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
    .editor-panel .editor-header .btn,
    .editor-panel .editor-header .form-select {
        min-height: 40px;
        font-size: 0.8rem;
    }
    #btnVoiceNoteTitle { min-width: 40px; min-height: 40px; }

    .editor-meta-row { padding: 0.5rem 0.75rem; }
    .editor-panel .ql-editor { min-height: 200px; }
    .attachments-list { padding: 0.65rem 0.75rem; }

    /* Tables scroll horizontally */
    .pw-table,
    .tasks-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .pw-table table { min-width: 520px; }
    .tasks-table { min-width: 560px; }

    .tasks-panel {
        height: auto;
        min-height: calc(100dvh - 8.5rem);
    }
    .tasks-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .tasks-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }
    .task-tab { white-space: nowrap; flex-shrink: 0; }
    .task-find-wrap { width: 100%; min-width: 0; }

    /* Task modal — near full screen */
    #taskModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100dvh;
    }
    #taskModal .modal-content {
        min-height: 100dvh;
        border-radius: 0;
    }

    /* Project note modal — same full-screen treatment on mobile */
    #projectNoteModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100dvh;
    }
    #projectNoteModal .modal-content {
        min-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    #projectNoteModal .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #projectNoteModal .task-title-row {
        padding: 0.5rem 1rem 0.85rem;
    }
    #projectNoteModal .project-note-editor-wrap {
        padding: 0.75rem 1rem 1rem;
    }
    #projectNoteEditor .ql-toolbar {
        display: flex;
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }
    #projectNoteEditor .ql-editor {
        min-height: calc(100dvh - 280px);
    }
    #projectNoteModal .task-modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    }
    #projectNoteModal .task-modal-footer .btn-primary {
        flex: 1;
        min-width: 120px;
    }

    .task-field-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .task-title-input { font-size: 1.1rem; }

    .unlock-box {
        margin: 1rem;
        padding: 1.5rem;
    }

    .toast-container {
        bottom: calc(4.5rem + env(safe-area-inset-bottom)) !important;
    }

    .notebook-item .nb-del { opacity: 1; }

    .nav-item-btn,
    .btn-create-note,
    .btn-quick-action {
        min-height: 44px;
    }
}

/* ── Small phones (below 576px) ────────────────────────────── */
@media (max-width: 575.98px) {
    .sidebar-create { flex-wrap: wrap; }
    .btn-create-note { min-width: calc(100% - 160px); }
    .editor-header-actions .btn-export-note,
    .editor-header-actions #noteNotebook {
        display: none;
    }
    .vault-content { padding: 0.5rem; }
    .note-card { padding: 0.85rem; }
    .auth-card { padding: 1.5rem; }
    .mobile-nav-btn span { font-size: 0.58rem; }
}

/* ── Desktop (992px+) ──────────────────────────────────────── */
@media (min-width: 992px) {
    .vault-sidebar {
        position: relative;
        transform: none !important;
    }
    .sidebar-mobile-header,
    .mobile-bottom-nav,
    .btn-menu-toggle {
        display: none !important;
    }
    .vault-content {
        padding-bottom: 1.25rem;
    }
    #btnBackNotes { display: none !important; }
}

/* ── Large desktop ─────────────────────────────────────────── */
@media (min-width: 1200px) {
    .split-view {
        grid-template-columns: 360px 1fr;
    }
    .vault-sidebar {
        width: 280px;
        min-width: 280px;
    }
}

/* ════════════════════════════════════════════════════════════
   THEMES
   Each theme just re-points the semantic variables defined in
   :root (which is the default "Midnight" theme). html[data-theme]
   beats :root on specificity, so order here doesn't matter.
   ════════════════════════════════════════════════════════════ */

/* Ocean — deep navy with a sky-blue accent */
html[data-theme="ocean"] {
    --yv-bg: #070d18;
    --yv-sidebar: #0a1322;
    --yv-surface: #0e1828;
    --yv-surface-2: #142235;
    --yv-surface-3: #1a2c44;
    --yv-panel: #0c1521;
    --yv-accent: #38bdf8;
    --yv-accent-hover: #0ea5e9;
    --yv-accent-rgb: 56, 189, 248;
    --yv-accent-text: #bae6fd;
}

/* Forest — muted green-charcoal with an emerald accent */
html[data-theme="forest"] {
    --yv-bg: #0a0f0c;
    --yv-sidebar: #0e1512;
    --yv-surface: #111815;
    --yv-surface-2: #18211c;
    --yv-surface-3: #1f2b24;
    --yv-panel: #0f1713;
    --yv-accent: #34d399;
    --yv-accent-hover: #10b981;
    --yv-accent-rgb: 52, 211, 153;
    --yv-accent-text: #a7f3d0;
}

/* Sunset — warm dark brown with an amber accent */
html[data-theme="sunset"] {
    --yv-bg: #140f0b;
    --yv-sidebar: #1c140d;
    --yv-surface: #201610;
    --yv-surface-2: #2a1d14;
    --yv-surface-3: #35261a;
    --yv-panel: #1a120c;
    --yv-accent: #fb923c;
    --yv-accent-hover: #f97316;
    --yv-accent-rgb: 251, 146, 60;
    --yv-accent-text: #fed7aa;
}

/* Rosé — deep plum with a pink accent */
html[data-theme="rose"] {
    --yv-bg: #120a10;
    --yv-sidebar: #1a0f17;
    --yv-surface: #1d111a;
    --yv-surface-2: #281622;
    --yv-surface-3: #341d2c;
    --yv-panel: #190e15;
    --yv-accent: #f472b6;
    --yv-accent-hover: #ec4899;
    --yv-accent-rgb: 244, 114, 182;
    --yv-accent-text: #fbcfe8;
}

/* Light — bright surfaces, indigo accent. Flipping --yv-overlay-rgb
   to black makes every white hover/border tint adapt automatically. */
html[data-theme="light"] {
    --yv-bg: #eef0f3;
    --yv-sidebar: #ffffff;
    --yv-surface: #ffffff;
    --yv-surface-2: #f1f3f5;
    --yv-surface-3: #e7eaee;
    --yv-panel: #f7f8fa;
    --yv-text: #1e2330;
    --yv-text-soft: #2c3340;
    --yv-text-muted: #5a6472;
    --yv-text-dim: #8a93a2;
    --yv-text-faint: #b3bac4;
    --yv-overlay-rgb: 0, 0, 0;
    --yv-border: rgba(var(--yv-overlay-rgb), 0.12);
    --yv-accent: #6366f1;
    --yv-accent-hover: #4f46e5;
    --yv-accent-rgb: 99, 102, 241;
    --yv-accent-text: #4338ca;
}

/* Light-theme fixes for components that hard-code Bootstrap's dark classes */
html[data-theme="light"] body { background: var(--yv-bg); }
html[data-theme="light"] .modal-content.bg-dark {
    background: var(--yv-surface) !important;
    color: var(--yv-text);
}
html[data-theme="light"] .border-secondary { border-color: var(--yv-border) !important; }
html[data-theme="light"] .btn-close-white { filter: none; }
html[data-theme="light"] .dropdown-menu-dark .dropdown-item:hover {
    color: var(--yv-accent-text);
    background: rgba(var(--yv-accent-rgb), 0.12);
}
html[data-theme="light"] .ql-snow .ql-stroke { stroke: var(--yv-text-muted); }
html[data-theme="light"] .ql-snow .ql-fill { fill: var(--yv-text-muted); }
html[data-theme="light"] .ql-snow .ql-picker { color: var(--yv-text-muted); }

/* Cloud drive — light theme polish */
html[data-theme="light"] .storage-panel {
    background: linear-gradient(180deg, #e8ecff 0%, #eef0f3 140px, var(--yv-bg) 280px);
}
html[data-theme="light"] .storage-panel-glow {
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.18) 0%, transparent 65%);
}
html[data-theme="light"] .storage-search-input {
    background: #fff;
    border-color: rgba(var(--yv-accent-rgb), 0.18);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
}
html[data-theme="light"] .storage-search-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--yv-accent-rgb), 0.15), 0 4px 16px rgba(99, 102, 241, 0.1);
}
html[data-theme="light"] .storage-nav-card {
    background: #fff;
    border-color: rgba(var(--yv-accent-rgb), 0.12);
    box-shadow: 0 4px 20px rgba(30, 35, 48, 0.06);
}
html[data-theme="light"] .storage-content-card {
    background: #fff;
    border-color: rgba(var(--yv-accent-rgb), 0.1);
    box-shadow: 0 6px 28px rgba(30, 35, 48, 0.07);
}
html[data-theme="light"] .storage-list-table thead th {
    background: #f7f8fc;
    color: var(--yv-text-muted);
}
html[data-theme="light"] .storage-list-row:hover {
    background: rgba(var(--yv-accent-rgb), 0.04);
}
html[data-theme="light"] .storage-crumb-current {
    color: var(--yv-accent);
    background: rgba(var(--yv-accent-rgb), 0.1);
}
html[data-theme="light"] .storage-view-toggle {
    background: #f7f8fc;
}
html[data-theme="light"] .storage-view-btn.active {
    color: var(--yv-accent);
    background: #fff;
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.15);
}
html[data-theme="light"] .storage-badge-zip,
html[data-theme="light"] .storage-badge-doc,
html[data-theme="light"] .storage-thumb-zip,
html[data-theme="light"] .storage-thumb-doc {
    color: #475569;
    background: #e8edf3;
}
html[data-theme="light"] .storage-badge-file,
html[data-theme="light"] .storage-thumb-file {
    background: #f1f5f9;
    color: #64748b;
}
html[data-theme="light"] .storage-empty {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-color: rgba(var(--yv-accent-rgb), 0.25);
}
html[data-theme="light"] .storage-grid-tile:hover {
    background: rgba(var(--yv-accent-rgb), 0.05);
}
html[data-theme="light"] .storage-grid-thumb {
    box-shadow: 0 3px 12px rgba(30, 35, 48, 0.08);
}
html[data-theme="light"] .storage-stat-chip {
    background: #f7f8fc;
    border-color: rgba(var(--yv-accent-rgb), 0.12);
}
html[data-theme="light"] .storage-filter-select {
    background-color: #f7f8fc;
    border-color: rgba(var(--yv-accent-rgb), 0.15);
}
html[data-theme="light"] .btn-storage-secondary {
    background: #fff;
    border-color: rgba(var(--yv-accent-rgb), 0.2);
}
html[data-theme="light"] .btn-storage-secondary:hover {
    background: rgba(var(--yv-accent-rgb), 0.06);
    border-color: rgba(var(--yv-accent-rgb), 0.35);
}
html[data-theme="light"] .storage-stats-bar .storage-stat-card {
    background: #fff;
    border-color: rgba(var(--yv-accent-rgb), 0.12);
    box-shadow: 0 4px 16px rgba(30, 35, 48, 0.06);
}
html[data-theme="light"] .storage-stat-card.storage-stat-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), #fff);
}

/* Dark theme zip/doc badge fix */
html:not([data-theme="light"]) .storage-badge-zip,
html:not([data-theme="light"]) .storage-badge-doc,
html:not([data-theme="light"]) .storage-thumb-zip,
html:not([data-theme="light"]) .storage-thumb-doc {
    color: #94a3b8;
    background: #2a2d35;
}

/* ── Theme picker swatches ──────────────────────────────────── */
.theme-menu-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--yv-text-dim);
    padding: 0.4rem 0.85rem 0.15rem;
}
.theme-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem 0.6rem;
    max-width: 220px;
}
.theme-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    transition: transform 0.12s ease;
}
.theme-swatch:hover { transform: scale(1.1); }
.theme-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--yv-accent);
}
.theme-swatch[data-sw="midnight"] { background: linear-gradient(135deg, #0b0c10 48%, #6366f1 48%); }
.theme-swatch[data-sw="ocean"]    { background: linear-gradient(135deg, #0a1322 48%, #38bdf8 48%); }
.theme-swatch[data-sw="forest"]   { background: linear-gradient(135deg, #0e1512 48%, #34d399 48%); }
.theme-swatch[data-sw="sunset"]   { background: linear-gradient(135deg, #1c140d 48%, #fb923c 48%); }
.theme-swatch[data-sw="rose"]     { background: linear-gradient(135deg, #1a0f17 48%, #f472b6 48%); }
.theme-swatch[data-sw="light"]    { background: linear-gradient(135deg, #ffffff 48%, #6366f1 48%); }

/* ── File preview modal ─────────────────────────────────────── */
.preview-modal #previewBody {
    min-height: 60vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
}
.preview-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c0c0e;
    padding: 1rem;
    min-height: 60vh;
}
.preview-image {
    max-width: 100%;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 6px;
}
.preview-frame {
    width: 100%;
    height: 78vh;
    border: 0;
    background: #fff;
}
.preview-video {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 6px;
}
.preview-audio {
    flex-direction: column;
    gap: 1.25rem;
}
.preview-audio i { font-size: 4rem; color: var(--yv-text-dim); }
.preview-audio audio { width: min(520px, 90%); }
.preview-text {
    flex: 1;
    margin: 0;
    padding: 1.25rem 1.5rem;
    background: #0c0c0e;
    color: var(--yv-text);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}
.preview-fallback {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    min-height: 50vh;
}
.preview-fallback i { font-size: 3rem; }
.attachment-chip-name,
.file-name-link {
    color: var(--yv-text);
    text-decoration: none;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-chip-name:hover,
.file-name-link:hover { color: var(--yv-accent, #6ea8fe); text-decoration: underline; }
