/* Waxrunner — shared design system
 * Dark theme, single accent green, geometric sans-serif, monospace eyebrow.
 * Used across landing, browse, optimize, results, analytics.
 */

@import url('fonts.css');

:root {
    /* ── Colors ─────────────────────────────────────────────────────── */
    --bg:            #0A0A0A;
    --bg-2:          #0D0D0D;
    --surface:       #141414;
    --surface-2:     #1A1A1A;
    --surface-3:     #1F1F1F;
    --border:        #232323;
    --border-strong: #2D2D2D;

    --text:   #F0EDEA;
    --text-2: #C7C3BC;
    --text-3: #A29E97;
    --text-4: #6E6A64;

    /* Warm friendly red — light enough to feel inviting, not alarming. */
    --accent:        #f45d5d;
    --accent-hover:  #ff7373;
    --accent-deep:   #d94747;
    --accent-soft:   rgba(244,93,93,0.10);
    --accent-line:   rgba(244,93,93,0.32);
    --accent-glow:   rgba(244,93,93,0.20);
    /* Kept green as the "savings / value" semantic only */
    --savings:       #3FB66A;
    --savings-soft:  rgba(63,182,106,0.10);

    /* Neutral primary accent for buttons / interactive states */
    --ink:           #F0EDEA;          /* same as --text */
    --ink-soft:      rgba(240,237,234,0.08);
    --ink-line:      rgba(240,237,234,0.18);

    --warn:  #fbbf24;
    --error: #DC5050;                  /* slightly desaturated red */
    --error-soft: rgba(220,80,80,0.10);
    --error-line: rgba(220,80,80,0.32);
    --error-glow: rgba(220,80,80,0.18);

    /* ── Typography ─────────────────────────────────────────────────── */
    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, sans-serif;
    --font-mono:    'Inter', system-ui, sans-serif;

    /* ── Radii / shadows ────────────────────────────────────────────── */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;

    --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
    isolation: isolate; /* lock z-index: -1 layer below body content */
}

/* ── Page-wide background video (faint loop behind every screen) ─────────
   Pinned to the viewport via fixed+z-index:-1 so no normal page element
   can layer it on top, and so the video CANNOT push body content down. */
.wax-page-bg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -1 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}
.wax-page-bg video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    transform: translate(-50%, -50%) !important;
    object-fit: cover !important;
    display: block !important;
    filter: brightness(0.4) saturate(0.5);
    opacity: 0.10;
}
/* Dark overlay over the video. Strength is driven by the body vibe class
   so we can A/B 3 levels of "how present is the loop" live. Default below
   matches the old whisper; .wax-vibe-* override it. */
.wax-page-bg::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.88) 60%, rgba(10,10,10,0.97) 100%),
        linear-gradient(180deg, rgba(10,10,10,0.70) 0%, rgba(10,10,10,0.92) 100%);
    pointer-events: none;
}

/* ── Background-video presence presets (toggle via the on-page switch) ──
   1 = subtle · 2 = medium (default) · 3 = bold/sexy */
.wax-vibe-1 .wax-page-bg video { opacity: 0.18; filter: brightness(0.50) saturate(0.60); }
.wax-vibe-1 .wax-page-bg::after {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(10,10,10,0.48) 0%, rgba(10,10,10,0.82) 60%, rgba(10,10,10,0.93) 100%),
        linear-gradient(180deg, rgba(10,10,10,0.58) 0%, rgba(10,10,10,0.86) 100%);
}
.wax-vibe-2 .wax-page-bg video { opacity: 0.32; filter: brightness(0.60) saturate(0.72); }
.wax-vibe-2 .wax-page-bg::after {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(10,10,10,0.32) 0%, rgba(10,10,10,0.70) 60%, rgba(10,10,10,0.85) 100%),
        linear-gradient(180deg, rgba(10,10,10,0.42) 0%, rgba(10,10,10,0.74) 100%);
}
.wax-vibe-3 .wax-page-bg video { opacity: 0.50; filter: brightness(0.72) saturate(0.88); }
.wax-vibe-3 .wax-page-bg::after {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(10,10,10,0.20) 0%, rgba(10,10,10,0.56) 60%, rgba(10,10,10,0.74) 100%),
        linear-gradient(180deg, rgba(10,10,10,0.30) 0%, rgba(10,10,10,0.62) 100%);
}
/* Results overlay scrim follows the same vibe so the loop bleeds through
   behind the story panel + cover gallery (cards stay opaque/readable). */
.wax-vibe-1 .results.results-split { background: rgba(10,10,10,0.84); }
.wax-vibe-2 .results.results-split { background: rgba(10,10,10,0.66); }
.wax-vibe-3 .results.results-split { background: rgba(10,10,10,0.48); }

/* On-page A/B switch (bottom-left, unobtrusive) */
.wax-vibe-switch {
    position: fixed; left: 14px; bottom: 14px; z-index: 9998;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px; border-radius: 999px;
    background: rgba(10,10,10,0.72); border: 1px solid var(--border);
    backdrop-filter: blur(8px); font-family: var(--font-mono); font-size: 11px;
    color: var(--text-3); user-select: none;
}
.wax-vibe-switch span { padding: 0 4px; letter-spacing: 0.08em; }
.wax-vibe-switch button {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-2); font-family: var(--font-mono); font-size: 11px;
    cursor: pointer; transition: all .15s ease;
}
.wax-vibe-switch button:hover { color: var(--text); border-color: var(--text-4); }
.wax-vibe-switch button.active {
    background: var(--accent); color: #0A0A0A; border-color: var(--accent);
}

.font-display { font-family: var(--font-display); letter-spacing: -0.01em; }
.font-mono    { font-family: var(--font-mono); }

/* ── Top bar (logged-in nav) ────────────────────────────────────────── */
.appbar {
    position: relative; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,10,0.78);
    backdrop-filter: blur(10px);
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 500;
    font-size: 16px; letter-spacing: -0.01em;
    color: var(--text); text-decoration: none;
}
.brand .mark {
    width: 22px; height: 22px; border-radius: 50%;
    background:
        radial-gradient(circle at center,
            var(--bg) 0 3px,
            var(--accent) 3px 4px,
            var(--bg) 4px 6px,
            var(--text) 6px 7px,
            transparent 7px),
        conic-gradient(from 0deg, #1a1a1a, #2a2a2a, #1a1a1a);
    border: 1px solid var(--border-strong);
}
.brand .v {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-4); letter-spacing: 0.1em; margin-left: 4px;
}
.navlinks { display: flex; gap: 28px; }
.navlinks a {
    font-size: 13px; color: var(--text-3); text-decoration: none;
    font-family: var(--font-body); transition: color .15s ease;
}
.navlinks a.active { color: var(--text); }
.navlinks a:hover  { color: var(--text-2); }

.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    background: rgba(20,20,20,0.65);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 999px;
    font-size: 12.5px; color: var(--text-2);
}
.user-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); }
.user-chip strong { color: var(--text); font-weight: 500; }

/* ── Aligned app header (browse / optimize / runs) ──────────────────── */
.wax-appbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px;
    background: rgba(10,10,10,0.62);
    backdrop-filter: blur(20px) saturate(0.85);
    -webkit-backdrop-filter: blur(20px) saturate(0.85);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
/* Bokeh: faded loop of dj video, heavy blur, behind everything in the bar */
.wax-appbar .appbar-bokeh {
    position: absolute; inset: 0;
    width: 100%; height: 320%;          /* taller than bar so blur edges don't show */
    object-fit: cover;
    filter: blur(28px) brightness(0.7) saturate(0.7);
    opacity: 0.85;
    transform: translateY(-35%);
    pointer-events: none;
    z-index: 0;
}
.wax-appbar .appbar-bokeh-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0.30) 0%, rgba(10,10,10,0.60) 100%);
    pointer-events: none;
    z-index: 0;
}
.wax-appbar > *:not(.appbar-bokeh):not(.appbar-bokeh-overlay) {
    position: relative; z-index: 1;
}
.wax-appbar-left  { display: flex; align-items: center; gap: 28px; }
.wax-appbar-right { display: flex; align-items: center; gap: 14px; }

.wax-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s;
}
.wax-logo:hover { color: var(--text-2); }

.wax-nav { display: flex; gap: 6px; }
.wax-nav a {
    font-size: 13px;
    color: var(--text-3);
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 7px;
    transition: all 0.15s ease;
}
.wax-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.wax-nav a.active {
    color: var(--text);
    background: var(--ink-soft);
}

.wax-appbar .user-chip { padding: 5px 12px; font-size: 12px; }
.wax-appbar .btn-sm { padding: 7px 12px; font-size: 12.5px; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 20px; border-radius: 10px;
    font-family: var(--font-display); font-weight: 500;
    font-size: 15px; letter-spacing: 0.005em;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer; text-decoration: none;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

/* Neutral primary — no green. Reserved green now only for "savings" stats. */
.btn-primary {
    background: var(--ink);
    color: #0A0A0A;
    border-color: var(--ink);
    box-shadow: 0 6px 18px -10px rgba(255,255,255,0.18);
}
.btn-primary:hover { background: #ffffff; color: #0A0A0A; border-color: #ffffff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); }

/* Shiny CTA — hero pill with animated sheen */
.btn-shine {
    position: relative;
    display: inline-flex; align-items: center; gap: 12px;
    padding: 18px 36px; border-radius: 999px;
    font-family: var(--font-display); font-weight: 500; font-size: 17px;
    color: #0A0A0A;
    background: linear-gradient(180deg, #ffffff 0%, #e8e6e2 100%);
    border: 1px solid rgba(255,255,255,0.6);
    cursor: pointer; overflow: hidden; text-decoration: none;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 -2px 6px rgba(0,0,0,0.08) inset,
        0 12px 32px -8px rgba(255,255,255,0.25),
        0 24px 60px -12px rgba(0,0,0,0.6);
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn-shine:hover {
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 -2px 6px rgba(0,0,0,0.08) inset,
        0 16px 40px -8px rgba(255,255,255,0.4),
        0 28px 80px -12px rgba(0,0,0,0.7);
}
.btn-shine::before {
    content: ""; position: absolute;
    top: 0; left: -120%; width: 80%; height: 100%;
    background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
    transform: skewX(-18deg);
    animation: wax-shine 3.5s ease-in-out infinite;
}
@keyframes wax-shine {
    0%, 35% { left: -120%; }
    60%     { left: 140%; }
    100%    { left: 140%; }
}
.btn-shine svg { stroke: #0A0A0A; flex-shrink: 0; }

/* ── Surfaces / chips / pills ───────────────────────────────────────── */
.card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
}

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px; font-family: var(--font-body);
    cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { border-color: var(--ink-line); color: var(--text); background: var(--ink-soft); }
.chip svg { opacity: 0.6; }

/* Selection-state pills — only "all selected" shows green to signal value/done */
.sel-all     { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.sel-partial { color: var(--warn);   border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.08); }
.sel-none    { color: var(--text-3); border-color: var(--border); background: var(--surface); }

/* ── Stat tile ──────────────────────────────────────────────────────── */
.stat {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--r-lg);
    padding: 18px 20px;
}
.stat .lbl {
    font-size: 11px; font-family: var(--font-mono);
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-3); margin-bottom: 10px;
}
.stat .val {
    font-family: var(--font-display); font-weight: 300;
    font-size: 28px; color: var(--text);
    letter-spacing: -0.02em;
}
.stat .sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* Eyebrow / divider / kbd */
.eyebrow {
    font-family: var(--font-mono); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.18em;
    color: var(--text-3);
}
.hr  { height: 1px; background: var(--border); border: none; margin: 0; }
.kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; background: var(--surface); }

/* Inputs */
.input {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px; border-radius: 8px;
    font-family: var(--font-body); font-size: 14px;
    outline: none; transition: border-color .15s ease;
}
.input:focus { border-color: var(--ink-line); }
.input::placeholder { color: var(--text-4); }

/* Cover-art placeholder (when no thumbnail) */
.cover-ph {
    position: relative;
    background: linear-gradient(135deg, #1c1c1c 0%, #141414 100%);
    border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.cover-ph::before {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.018) 0 6px,
        transparent 6px 14px);
}
.cover-ph .label {
    position: relative;
    font-family: var(--font-mono); font-size: 9px;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-4);
}

/* ── Focus ──────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── Subtle scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Browse layout: sidebar + main + sticky bottom bar ──────────────── */
.wax-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: calc(100vh - 56px);
    align-items: start;
    transition: grid-template-columns 0.32s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.wax-shell.collapsed {
    grid-template-columns: 0 1fr;
}

.wax-sidebar {
    position: sticky; top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    padding: 18px 16px 100px;
    transition: transform 0.32s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.2s ease;
}
.wax-shell.collapsed .wax-sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Sidebar header bar — title + close button (X) */
.sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 4px 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.sidebar-head .lbl {
    /* Was small-caps mono in dark grey (--text-3) — read as background label.
       Now styled like the Run-preferences sheet h3: display font, bright. */
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    text-transform: none;
}
.sidebar-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-3);
    width: 26px; height: 26px;
    border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sidebar-close:hover { color: var(--text); border-color: var(--border-strong); background: var(--ink-soft); }

/* Floating vinyl button — visible when sidebar is collapsed */
.vinyl-toggle {
    position: fixed;
    left: 18px;
    /* Pushed below the sticky appbar (~56px tall) + breathing room so the
       badge no longer crosses into the header band. */
    top: 96px;
    width: 56px; height: 56px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 60;
    opacity: 0;
    transform: translateX(-100%) rotate(0deg);
    transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.4, 0.0, 0.2, 1);
    padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.wax-shell.collapsed ~ .vinyl-toggle,
.vinyl-toggle.visible {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
}
.vinyl-toggle:hover { animation: vinyl-spin 1.4s linear infinite; }
.vinyl-toggle svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6)); }

@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.applied-filters {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 0 14px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 14px;
    min-height: 0;
}
.applied-filters:empty { display: none; }
.applied-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px 4px 10px;
    font-size: 11.5px;
    background: var(--ink-soft);
    color: var(--text);
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.12s ease;
}
.applied-chip:hover { background: rgba(255,255,255,0.14); }
.applied-chip .x {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.20);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px;
    line-height: 1;
}
.applied-chip-clear {
    background: transparent;
    color: var(--text-3);
    border: 1px solid var(--border);
}
.applied-chip-clear:hover { color: var(--error); border-color: var(--error-line); background: var(--error-soft); }

.sidebar-search {
    position: relative;
    margin-bottom: 18px;
}
.sidebar-search input {
    width: 100%;
    padding: 9px 12px 9px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}
.sidebar-search input:focus { border-color: var(--ink-line); }
.sidebar-search input::placeholder { color: var(--text-4); }
.sidebar-search .icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-4);
    pointer-events: none;
}

.sidebar-section {
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
}
.sidebar-section:last-of-type { border-bottom: none; }

.sidebar-section-head {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 12px 4px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 13.5px;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease;
}
.sidebar-section-head:hover { color: var(--text-2); }
.sidebar-section-head .right { display: flex; align-items: center; gap: 8px; }
.sidebar-section-head .badge {
    background: var(--ink-soft);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    min-width: 18px; text-align: center;
    border: 1px solid var(--accent-line);
}
.sidebar-section-head .chev {
    color: var(--text-3);
    transition: transform 0.18s ease;
}
.sidebar-section.open .chev { transform: rotate(180deg); }

.sidebar-section-body {
    display: none;
    padding: 4px 4px 12px;
    max-height: 280px;
    overflow-y: auto;
}
/* Section reveals when section itself OR a nested filter-dropdown is .open */
.sidebar-section.open .sidebar-section-body { display: block; }
.sidebar-section:has(.filter-dropdown.open) .sidebar-section-body { display: block; }
.sidebar-section:has(.filter-dropdown.open) .chev { transform: rotate(180deg); }

.sidebar-data-actions {
    display: flex; flex-direction: column; gap: 6px;
    padding: 14px 0 4px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}
.sidebar-data-actions .data-btn {
    display: flex; align-items: center; gap: 9px;
    width: 100%;
    padding: 9px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-2);
    font-family: var(--font-body);
    font-size: 12.5px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}
.sidebar-data-actions .data-btn:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.sidebar-data-actions .data-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sidebar-data-actions .data-btn .ic { font-size: 14px; }
.sidebar-data-actions .data-btn .sub {
    display: block;
    color: var(--text-4);
    font-size: 10.5px;
    margin-top: 2px;
}

.wax-main { padding: 22px 28px 120px; min-width: 0; }

/* Sticky bottom selection bar — hidden when no selection */
.wax-bottombar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 80;
    padding: 14px 28px;
    background: rgba(13,13,13,0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    transform: translateY(110%);
    transition: transform 0.32s cubic-bezier(.2,.7,.2,1);
}
.wax-bottombar.show { transform: translateY(0); }
.wax-bottombar-content {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.wax-bottombar .status {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-2);
    font-size: 14px;
}
.wax-bottombar .status .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(21,163,74,0.5);
    animation: bb-pulse 2.4s ease-out infinite;
}
@keyframes bb-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(21,163,74,0.45); }
    70%  { box-shadow: 0 0 0 9px rgba(21,163,74,0); }
    100% { box-shadow: 0 0 0 0 rgba(21,163,74,0); }
}
.wax-bottombar .status strong { color: var(--text); font-weight: 600; font-family: var(--font-display); }
.wax-bottombar .actions { display: flex; align-items: center; gap: 10px; }

@media (max-width: 900px) {
    .wax-shell { grid-template-columns: 1fr; }
    .wax-sidebar {
        position: relative; top: 0; height: auto;
        border-right: none; border-bottom: 1px solid var(--border);
    }
    .wax-bottombar-content { flex-direction: column; align-items: stretch; gap: 10px; }
}

/* ── "Through the groove" page transition ───────────────────────────── */
/* Fade-in for inbound page (browse / optimize) coming from landing */
/* Opacity-only: any transform here (even the retained `none`, which computes
   to an identity matrix under animation-fill-mode: both) turns .wax-page-target
   into a containing block and unsticks the fixed bottom bar. Fade only. */
@keyframes wax-page-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}
.wax-page-in { animation: wax-page-in 0.45s cubic-bezier(.2,.7,.2,1) both; }

/* Used by landing during transition: fade out everything except video,
   brighten the video, then fade to dark. */
body.wax-transition .wax-fade-out {
    animation: wax-content-fade 0.32s ease-out both;
}
@keyframes wax-content-fade {
    to { opacity: 0; transform: translateY(-6px); }
}
body.wax-transition .bg-video {
    animation: wax-video-bloom 0.55s ease-out both 0.05s;
}
@keyframes wax-video-bloom {
    to {
        filter: grayscale(0) brightness(1.1) contrast(1.05) saturate(1.15);
    }
}
body.wax-transition .bg-radial,
body.wax-transition .bg-bottom-fade {
    animation: wax-vignette-clear 0.55s ease-out both 0.05s;
}
@keyframes wax-vignette-clear { to { opacity: 0; } }

body.wax-transition .wax-blackout {
    position: fixed; inset: 0; z-index: 99;
    background: var(--bg); opacity: 0; pointer-events: none;
    animation: wax-blackout-in 0.28s ease-in 0.55s both;
}
@keyframes wax-blackout-in { to { opacity: 1; } }
