:root {
    --nv-accent: #6366f1;
    --nv-accent-dark: #4f46e5;
    --nv-accent-soft: rgba(99,102,241,.10);
    --nv-accent-soft-2: rgba(99,102,241,.16);
    --nv-accent-ring: rgba(99,102,241,.12);
    --nv-accent-shadow: rgba(99,102,241,.30);
}

@media (prefers-color-scheme: dark) {
    :root {
        --nv-ink: #e2e4ed;
        --nv-ink-2: #acaebb;
        --nv-muted: #9094a0;
        --nv-faint: #707283;
        --nv-line: #272838;
        --nv-line-strong: #363748;
        --nv-bg: #111219;
        --nv-bg-2: #191a25;
        --nv-surface: #1e1f2c;
        --nv-dark-1: #0c0d13;
        --nv-dark-2: #161720;
        color-scheme: dark;
    }

    .fm-app, .fm-settings-body {
        --c-bg: #191a25;
        --c-surface: #1e1f2c;
        --c-border: #2d2e3f;
        --c-divider: #232435;
        --c-hover: #232435;
        --c-thumb: #272839;
        --c-text: #e2e4ed;
        --c-text2: #acaebb;
        --c-muted: #9094a0;
        --c-faint: #707283;
    }

    .nv-header {
        background: rgba(17,18,25,.92);
        border-bottom-color: var(--nv-line);
    }

    .nv-alert--error { color: #fca5a5; }
    .nv-alert--success { color: #6ee7b7; }
    .nv-dl-choice__title { background: var(--nv-bg-2); }
    .nv-dl-choice--premium .nv-dl-choice__title { background: var(--nv-accent-soft); }

    html:not(.nv-light) .nv-brand .nv-logo--light,
    html:not(.nv-light) .fm-brand .nv-logo--light { display: none !important; }
    html:not(.nv-light) .nv-brand .nv-logo--dark,
    html:not(.nv-light) .fm-brand .nv-logo--dark { display: block !important; }
}

/* density: compact */
.nv-section { padding: 42px 0; }
.nv-section--tight { padding: 26px 0; }
.nv-card { padding: 18px; }
.nv-panel { padding: 28px; }
.nv-header__inner { height: 58px; }
.fm-scroller { padding: 12px; }
.fm-grid { gap: 10px; }
.fm-row { padding: 7px 12px; }
.fm-topbar { height: 50px; }
.fm-toolbar { min-height: 48px; padding: 6px 14px; }
.fm-tree-row { height: 28px; }
.fm-nav-item { height: 32px; }
.fm-rail-btn { width: 32px; height: 32px; }
.fm-card__body { padding: 7px 9px 10px; }
.fm-det-row { padding: 7px 11px; }
.fm-settings { padding: 16px; }
.fm-panel { padding: 16px; }

/* user: forced dark */
html.nv-dark {     --nv-ink: #e2e4ed;
    --nv-ink-2: #acaebb;
    --nv-muted: #9094a0;
    --nv-faint: #707283;
    --nv-line: #272838;
    --nv-line-strong: #363748;
    --nv-bg: #111219;
    --nv-bg-2: #191a25;
    --nv-surface: #1e1f2c;
    --nv-dark-1: #0c0d13;
    --nv-dark-2: #161720;
    color-scheme: dark;
}
html.nv-dark .fm-app, .fm-settings-body {
    --c-bg: #191a25;
    --c-surface: #1e1f2c;
    --c-border: #2d2e3f;
    --c-divider: #232435;
    --c-hover: #232435;
    --c-thumb: #272839;
    --c-text: #e2e4ed;
    --c-text2: #acaebb;
    --c-muted: #9094a0;
    --c-faint: #707283;
}
html.nv-dark .nv-header { background: rgba(17,18,25,.92); border-bottom-color: var(--nv-line); }
html.nv-dark .nv-btn--ghost { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: var(--nv-ink); }
html.nv-dark .nv-btn--ghost:hover { background: rgba(255,255,255,.09); }
html.nv-dark .nv-input, html.nv-dark .nv-select, html.nv-dark .nv-textarea, html.nv-dark .nv-search-box input { color-scheme: dark; background: var(--nv-surface); color: var(--nv-ink); }
html.nv-dark input:-webkit-autofill, html.nv-dark input:-webkit-autofill:hover, html.nv-dark input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px #1e1f2c inset; -webkit-text-fill-color: #e2e4ed; }
html.nv-dark .nv-alert--error { color: #fca5a5; }
html.nv-dark .nv-alert--success { color: #6ee7b7; }
html.nv-dark .nv-dl-choice__title { background: var(--nv-bg-2); }
html.nv-dark .nv-dl-choice--premium .nv-dl-choice__title { background: var(--nv-accent-soft); }
html.nv-dark .nv-brand .nv-logo--light, html.nv-dark .fm-brand .nv-logo--light { display: none !important; }
html.nv-dark .nv-brand .nv-logo--dark, html.nv-dark .fm-brand .nv-logo--dark { display: block !important; }

/* user: forced light */
html.nv-light {     --nv-ink: #1b1c20;
    --nv-ink-2: #42434b;
    --nv-muted: #6b6d77;
    --nv-faint: #abadb6;
    --nv-line: #ececef;
    --nv-line-strong: #d7d8de;
    --nv-bg: #ffffff;
    --nv-bg-2: #f6f6f8;
    --nv-surface: #ffffff;
    color-scheme: light;
}
html.nv-light .fm-app, .fm-settings-body {
    --c-bg: #f6f6f8;
    --c-surface: #ffffff;
    --c-border: #ececef;
    --c-divider: #f1f1f3;
    --c-hover: #fafafb;
    --c-thumb: #eef0f4;
    --c-text: #1b1c20;
    --c-text2: #42434b;
    --c-muted: #9a9ca6;
    --c-faint: #cfcfd6;
}
html.nv-light .nv-header { background: rgba(255,255,255,.88); border-bottom-color: var(--nv-line); }
html.nv-light .nv-btn--ghost { border-color: var(--nv-line); background: var(--nv-surface); color: var(--nv-ink); }
html.nv-light .nv-alert--error { color: #a5271d; }
html.nv-light .nv-alert--success { color: #0e6f4a; }
html.nv-light .nv-brand .nv-logo--light, html.nv-light .fm-brand .nv-logo--light { display: block !important; }
html.nv-light .nv-brand .nv-logo--dark, html.nv-light .fm-brand .nv-logo--dark { display: none !important; }
