/* ── TuneLab ──────────────────────────────────
   Navy-Violet gradient palette with light/dark
   theme support. Mouse glow, grain overlay,
   particles, sharp grid cards.
   ────────────────────────────────────────────────── */


/* ── Solide BC (logo wordmark) ────────────────── */
@font-face {
    font-family: 'Solide BC';
    src: url('/static/fonts/solide-bc.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Solide BC';
    src: url('/static/fonts/solide-italic-bc.woff') format('woff');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Ferro BC';
    src: url('/static/fonts/ferro-bc.woff') format('woff');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* ── Dark theme (default) ─────────────────────── */
:root {
    --bg-deep:       #08081a;
    --bg:            #0e0e24;
    --bg-mid:        #121030;
    --surface:       rgba(16, 14, 38, 0.88);
    --surface-solid: #100e26;
    --border:        rgba(30, 28, 68, 0.7);
    --border-solid:  #1e1c44;
    --border-hover:  rgba(60, 56, 120, 0.5);
    --text:          #e0e2f0;
    --text-dim:      #8a88a8;
    --text-muted:    #7a789a;
    --accent:        #60a0ff;
    --accent-dim:    rgba(96, 160, 255, 0.08);
    --accent-glow:   rgba(96, 160, 255, 0.15);
    --warm:          #e8906a;
    --warm-glow:     rgba(232, 144, 106, 0.3);
    --glow-color:    rgba(100, 80, 200, 0.05);
    --glow-card:     rgba(100, 80, 200, 0.06);
    --grain-opacity: 0.035;
    --grad-a:        rgba(100, 80, 200, 0.04);
    --grad-b:        rgba(96, 160, 255, 0.02);
    --body-font:     'DM Sans', system-ui, -apple-system, sans-serif;
    --heading-font:  'Barlow Condensed', sans-serif;
    --mono-font:     'DM Mono', monospace;
    --sidebar-width: 240px;
}

/* ── Light theme ──────────────────────────────── */
[data-theme="light"] {
    --bg-deep:       #e8e6f0;
    --bg:            #f8f7fc;
    --bg-mid:        #efedf8;
    --surface:       rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --border:        rgba(160, 150, 200, 0.4);
    --border-solid:  #c8c2d8;
    --border-hover:  rgba(140, 130, 190, 0.4);
    --text:          #1a1830;
    --text-dim:      #5a566e;
    --text-muted:    #6a688a;
    --accent:        #4f46e5;
    --accent-dim:    rgba(79, 70, 229, 0.06);
    --accent-glow:   rgba(79, 70, 229, 0.12);
    --warm:          #d06050;
    --warm-glow:     rgba(208, 96, 80, 0.25);
    --glow-color:    rgba(79, 70, 229, 0.03);
    --glow-card:     rgba(79, 70, 229, 0.04);
    --grain-opacity: 0.018;
    --grad-a:        rgba(79, 70, 229, 0.03);
    --grad-b:        rgba(96, 160, 255, 0.02);
    --sidebar-width: 240px;
}

/* ── Cross-document View Transitions (MPA) ─── */
@view-transition {
    navigation: auto;
}
::view-transition-old(root) {
    animation-duration: 150ms;
}
::view-transition-new(root) {
    animation-duration: 150ms;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--body-font);
    font-weight: 400;
    font-size: 15px;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    letter-spacing: 0.01em;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── grain overlay ────────────────────────────── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px;
    will-change: transform;
    mix-blend-mode: overlay;
}

/* ── page-wide mouse glow ─────────────────────── */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--glow-color),
        transparent 40%
    );
}

/* ── background gradient ──────────────────────── */
.bg-gradient {
    view-transition-name: bg-gradient;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 0%, var(--grad-a) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, var(--grad-b) 0%, transparent 40%),
        linear-gradient(170deg, var(--bg) 0%, var(--bg-deep) 30%, var(--bg-mid) 70%, var(--bg-deep) 100%);
}


[data-theme="light"] .upload-area {
    border-color: rgba(79, 70, 229, 0.35);
    background: radial-gradient(ellipse at 50% 0%, rgba(79, 70, 229, 0.05) 0%, transparent 70%), var(--surface);
}
[data-theme="light"] .upload-area:hover {
    border-color: rgba(79, 70, 229, 0.55);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.08), inset 0 1px 0 rgba(79, 70, 229, 0.1);
}
[data-theme="light"] .upload-icon .bar { background: var(--accent); }
[data-theme="light"] .privacy-badge {
    border-color: rgba(22, 163, 74, 0.25);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(79, 70, 229, 0.03));
    color: var(--text-dim);
    box-shadow: 0 0 12px rgba(22, 163, 74, 0.04);
}
[data-theme="light"] .privacy-badge svg { color: rgba(22, 163, 74, 0.85); }

/* ── light theme depth & polish ──────────────── */
[data-theme="light"] .tool-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(79, 70, 229, 0.03);
}
[data-theme="light"] .tool-card:hover {
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .why-block {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(79, 70, 229, 0.03);
}
[data-theme="light"] .faq-item {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .faq-item:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.06);
}
[data-theme="light"] .faq-section h2 { color: var(--text); }
[data-theme="light"] .related-tool-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(79, 70, 229, 0.03);
}
[data-theme="light"] .related-tool-card:hover {
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.1);
}
[data-theme="light"] .category-section h2::before {
    background: var(--accent);
}
[data-theme="light"] .category-header::after {
    background: linear-gradient(90deg, #4f46e5, rgba(124, 59, 237, 0.4), transparent);
}
[data-theme="light"] .step-pill {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] footer::before {
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.25;
}

/* ── top bar ──────────────────────────────────── */
.top-bar {
    view-transition-name: header;
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: rgba(14, 14, 36, 0.72);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}
.top-bar::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, var(--accent) 50%, transparent 95%);
    opacity: 0.2;
    pointer-events: none;
}
[data-theme="light"] .top-bar {
    background: rgba(248, 247, 252, 0.82);
}
[data-theme="light"] .top-bar::after {
    opacity: 0.15;
}
.top-bar.top-bar-scrolled {
    background: rgba(8, 8, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(96, 160, 255, 0.1);
}
[data-theme="light"] .top-bar.top-bar-scrolled {
    background: rgba(255, 255, 255, 0.85);
}

/* ── logo ──────────────────────────────────────── */
.top-bar .logo {
    font-family: 'Ferro BC', 'Solide BC', var(--heading-font);
    font-weight: 700;
    font-style: italic;
    font-size: 2rem;
    background: linear-gradient(
        135deg,
        #60a0ff 0%,
        #a855f7 25%,
        #e040fb 50%,
        #60a0ff 75%,
        #a855f7 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift-stepped 40s steps(20) infinite;
    text-decoration: none;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    transition: filter 0.3s;
    filter: drop-shadow(0 0 8px rgba(96, 160, 255, 0.25));
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.top-bar .logo .logo-mark {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.top-bar .logo:hover .logo-mark {
    transform: scale(1.1) rotate(-3deg);
}
.top-bar .logo:hover {
    filter: drop-shadow(0 0 14px rgba(96, 160, 255, 0.5)) drop-shadow(0 0 30px rgba(168, 85, 247, 0.3));
}
[data-theme="light"] .top-bar .logo {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 25%, #a855f7 50%, #4f46e5 75%, #7c3aed 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift-stepped 40s steps(20) infinite;
    filter: drop-shadow(0 0 6px rgba(79, 70, 229, 0.2));
}
[data-theme="light"] .top-bar .logo:hover {
    filter: drop-shadow(0 0 12px rgba(79, 70, 229, 0.4)) drop-shadow(0 0 24px rgba(124, 58, 237, 0.25));
}

/* ── top-bar spotlight links ──────────────────── */
.top-bar-tools {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-left: 1.5rem;
}
.top-bar-tools a {
    color: var(--text-dim);
    font-family: var(--heading-font);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.3px;
    transition: color 0.15s;
}
.top-bar-tools a:hover {
    color: var(--text);
}
.top-bar-tools .nav-short {
    display: none;
}
.top-bar-tools .nav-trackid {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fbbf24;
    font-weight: 600;
    border: 1px solid rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.08);
    padding: 4px 14px;
    border-radius: 14px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.top-bar-tools .nav-trackid:hover {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}
.top-bar-tools .nav-trackid.active {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.5);
}
.top-bar-tools .nav-trackid svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}
[data-theme="light"] .top-bar-tools .nav-trackid {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.3);
    background: rgba(251, 191, 36, 0.1);
}
[data-theme="light"] .top-bar-tools .nav-trackid:hover {
    background: rgba(251, 191, 36, 0.2);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.top-search {
    flex: 1;
    max-width: 400px;
    margin: 0 1.5rem;
}
.top-search input {
    width: 100%;
    font-family: var(--mono-font);
    font-size: 0.78rem;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--accent-dim);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.top-search input::placeholder { color: var(--text-muted); }
.top-search input:focus {
    border-color: rgba(96, 160, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(96, 160, 255, 0.06);
}
[data-theme="light"] .top-search input {
    background: rgba(255, 255, 255, 0.8);
}

/* ── theme toggle ─────────────────────────────── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1;
    transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.theme-toggle:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--accent-dim);
    transform: scale(1.05);
}
.theme-toggle:active {
    transform: scale(0.95);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
:root .theme-toggle .icon-sun { display: inline; }
:root .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

.pricing-btn {
    display: inline-flex; align-items: center;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-family: var(--mono-font);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.pricing-btn:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--accent-dim);
}
.pricing-btn:active { transform: scale(0.95); }
@media (max-width: 600px) {
    .pricing-btn { display: none; }
}

.feedback-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.feedback-btn:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--accent-dim);
}
.feedback-btn:active { transform: scale(0.95); }
@media (max-width: 600px) {
    .feedback-label { display: none; }
}

/* ── layout grid ─────────────────────────────── */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: calc(100vh - 56px);
}
.layout.layout--sidebar-collapsed {
    grid-template-columns: 72px 1fr;
}
.layout-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── sidebar ─────────────────────────────────── */
.sidebar {
    view-transition-name: sidebar;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 30, 0.5);
    border-right: 1px solid var(--border);
    overflow: hidden;
    z-index: 30;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="light"] .sidebar {
    background: rgba(245, 244, 252, 0.9);
}

.sidebar-identify {
    display: block;
    margin: 12px 12px 8px;
    padding: 10px;
    background: linear-gradient(135deg, #60a0ff, #a060ff);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: filter 0.2s, transform 0.15s;
}
.sidebar-identify:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.sidebar-identify svg {
    vertical-align: -2px;
    margin-right: 4px;
}

/* ── sidebar popular ──────────────────────────── */
.sidebar-popular {
    padding: 0 0 4px;
}
.sidebar-category--popular {
    color: var(--accent);
    opacity: 1;
    font-weight: 700;
}
.sidebar-link--popular {
    font-size: 0.78rem;
    color: var(--text);
}
.sidebar-link--popular:hover {
    background: var(--accent-dim);
}
[data-theme="light"] .sidebar-link--popular {
    color: var(--text);
}
.sidebar-divider {
    border-top: 1px solid var(--border);
    margin: 4px 16px 4px;
}

.sidebar-tools {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-tools::-webkit-scrollbar { width: 4px; }
.sidebar-tools::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-category {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
    opacity: 0.7;
    padding: 12px 16px 4px;
    user-select: none;
}

.sidebar-link {
    display: block;
    font-family: var(--mono-font);
    font-size: 0.78rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 16px;
    border-left: 2px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sidebar-link:hover {
    color: var(--text);
    background: var(--accent-dim);
}
.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}
[data-theme="light"] .sidebar-link:hover {
    background: rgba(79, 70, 229, 0.06);
}
[data-theme="light"] .sidebar-link.active {
    background: rgba(79, 70, 229, 0.06);
}

.sidebar-bottom {
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-bottom-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono-font);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.sidebar-bottom-link:hover {
    color: var(--text);
    background: var(--accent-dim);
}

/* ── sidebar collapsed (72px rail) ───────────── */
.sidebar.is-collapsed {
    width: 72px;
    min-width: 72px;
    overflow: visible;
}
.sidebar.is-collapsed .sidebar-identify span { display: none; }
.sidebar.is-collapsed .sidebar-identify {
    margin: 8px auto;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar.is-collapsed .sidebar-identify svg { margin: 0; }
.sidebar.is-collapsed .sidebar-popular { display: none; }
.sidebar.is-collapsed .sidebar-divider { display: none; }
.sidebar.is-collapsed .sidebar-tools { display: none; }
.sidebar.is-collapsed .sidebar-bottom { display: none; }

.sidebar-rail {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    flex: 1;
}
.sidebar.is-collapsed .sidebar-rail { display: flex; }

.sidebar-rail-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dim);
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    position: relative;
    border: none;
    background: none;
    padding: 0;
}
.sidebar-rail-icon:hover {
    opacity: 0.9;
    background: var(--accent-dim);
    color: var(--accent);
}
.sidebar-rail-icon.active {
    opacity: 0.9;
    color: var(--accent);
}

.sidebar-rail-bottom {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}
.sidebar.is-collapsed .sidebar-rail-bottom { display: flex; }

.sidebar-collapse-toggle {
    margin-top: auto;
    opacity: 0.5;
}
.sidebar-collapse-toggle:hover { opacity: 0.8; }
.sidebar.is-collapsed .sidebar-collapse-toggle { display: none; }

.sidebar-expand-toggle {
    opacity: 0.5;
}
.sidebar-expand-toggle:hover {
    opacity: 0.9;
    background: var(--accent-dim);
    color: var(--accent);
}

/* ── flyout popover ──────────────────────────── */
.sidebar-flyout {
    position: absolute;
    left: 72px;
    top: 0;
    min-width: 180px;
    padding: 8px 0;
    background: rgba(16, 14, 38, 0.97);
    border: 1px solid rgba(96, 160, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, visibility 0.15s, transform 0.15s ease;
    pointer-events: none;
}
.sidebar-rail-icon:hover .sidebar-flyout,
.sidebar-rail-icon.is-flyout-open .sidebar-flyout,
.sidebar-flyout:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}
[data-theme="light"] .sidebar-flyout {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(79, 70, 229, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.sidebar-flyout-heading {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
    opacity: 0.7;
    padding: 4px 14px 6px;
}
.sidebar-flyout a {
    display: block;
    font-family: var(--mono-font);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 14px;
    transition: color 0.15s, background 0.15s;
}
.sidebar-flyout a:hover {
    color: var(--text);
    background: var(--accent-dim);
}
.sidebar-flyout a.active {
    color: var(--accent);
}

/* ── mobile bottom bar ───────────────────────── */
.bottom-bar {
    view-transition-name: bottom-bar;
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 35;
    height: 56px;
    background: rgba(14, 14, 36, 0.92);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
}
[data-theme="light"] .bottom-bar {
    background: rgba(248, 247, 252, 0.92);
}
.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-dim);
    text-decoration: none;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bottom-bar-item:hover,
.bottom-bar-item.active { color: var(--text); }
.bottom-bar-identify { color: var(--accent) !important; }
.bottom-bar-item svg { width: 20px; height: 20px; }

/* ── off-canvas sidebar ──────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 44;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sidebar-backdrop.is-visible {
    display: block;
    opacity: 1;
}
.sidebar-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 45;
    background: rgba(10, 10, 30, 0.98);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: none;
    flex-direction: column;
}
[data-theme="light"] .sidebar-offcanvas {
    background: rgba(248, 247, 252, 0.98);
}
.sidebar-offcanvas.is-open {
    transform: translateX(0);
}
.sidebar-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-offcanvas-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ── language dropdown ───────────────────────── */
.lang-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    background: rgba(16, 14, 38, 0.97);
    border: 1px solid rgba(96, 160, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
    z-index: 40;
    padding: 4px 0;
}
.lang-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
[data-theme="light"] .lang-dropdown {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(79, 70, 229, 0.15);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
}
.lang-option {
    display: block;
    width: 100%;
    text-align: left;
    font-family: var(--body-font);
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 6px 14px;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.lang-option:hover {
    color: var(--text);
    background: var(--accent-dim);
}
.lang-option.active {
    color: var(--accent);
}

/* ── top-bar responsive ───────────────────────── */
@media (max-width: 1024px) {
    .top-bar-tools .nav-full { display: none; }
    .top-bar-tools .nav-short { display: inline; }
    .top-bar-tools { gap: 0.8rem; margin-left: 1rem; }
}
@media (max-width: 767px) {
    .top-bar-tools { display: none; }
}

/* ── responsive: hide sidebar on mobile ──────── */
/* Both selectors needed: .layout.layout--sidebar-collapsed (2 classes) has
   higher specificity than .layout (1 class) and would otherwise keep the
   72px sidebar track, squeezing all content into it. */
@media (max-width: 1024px) {
    .layout,
    .layout.layout--sidebar-collapsed {
        grid-template-columns: 1fr;
    }
    .sidebar { display: none; }
    .bottom-bar { display: flex; }
    .sidebar-offcanvas { display: flex; }
    main { padding-bottom: 72px; }
}

/* ── main layout (wider for tools) ────────────── */
main {
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}
main a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-dim);
    text-underline-offset: 2px;
}
main a:hover {
    text-decoration-color: var(--accent);
}

/* ── hero ──────────────────────────────────────── */
/* ── hero section ────────────────────────────── */
.hero {
    text-align: center;
    padding: 4rem 0 2.5rem;
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

/* subtle animated mesh gradient behind hero */
.hero::before {
    content: "";
    position: absolute;
    inset: -40% -20%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(96, 160, 255, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 75% 60%, rgba(140, 80, 255, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 50% 10%, rgba(232, 144, 106, 0.04) 0%, transparent 70%);
    filter: blur(40px);
}
[data-theme="light"] .hero::before {
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(79, 70, 229, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 75% 60%, rgba(140, 80, 255, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 50% 10%, rgba(232, 144, 106, 0.03) 0%, transparent 70%);
}

/* ── Hero spotlight — mouse-follow glow ───────── */
.hero-spotlight {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(
        400px circle at var(--spot-x, 50%) var(--spot-y, 50%),
        rgba(96, 160, 255, 0.06) 0%,
        transparent 70%
    );
}
[data-theme="light"] .hero-spotlight {
    background: radial-gradient(
        400px circle at var(--spot-x, 50%) var(--spot-y, 50%),
        rgba(79, 70, 229, 0.04) 0%,
        transparent 70%
    );
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono-font);
    font-weight: 500;
    font-size: 0.62rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(96, 160, 255, 0.25);
    padding: 0.45rem 1.2rem;
    margin-bottom: 1.8rem;
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(96, 160, 255, 0.08) 0%, rgba(140, 80, 255, 0.04) 100%);
    box-shadow:
        0 0 16px rgba(96, 160, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: badgePulse 60s steps(20) infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 16px rgba(96, 160, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
    50%      { box-shadow: 0 0 24px rgba(96, 160, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
}
.hero-badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: badgeDot 2s ease-in-out infinite;
}
@keyframes badgeDot {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}
[data-theme="light"] .hero-badge {
    border-color: rgba(79, 70, 229, 0.3);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(140, 80, 255, 0.04) 100%);
    box-shadow: 0 0 16px rgba(79, 70, 229, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: var(--accent);
}

.hero h1 {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 1.2rem;
    background: linear-gradient(
        135deg,
        #e0e2f0 0%,
        #a78bfa 25%,
        #60a0ff 50%,
        #c084fc 75%,
        #e0e2f0 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift-stepped 60s steps(30) infinite;
    text-shadow: none;
}
@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes gradient-shift-stepped {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
/* Light theme: slightly richer gradient */
[data-theme="light"] .hero h1 {
    background: linear-gradient(
        135deg,
        #1e1b4b 0%,
        #4f46e5 25%,
        #7c3aed 50%,
        #4f46e5 75%,
        #1e1b4b 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift-stepped 60s steps(30) infinite;
}

.hero .subtitle {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
}

/* ── upload area ──────────────────────────────── */
.upload-area {
    position: relative;
    border: 2px dashed rgba(96, 160, 255, 0.4);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    min-height: 200px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(96, 160, 255, 0.1) 0%, transparent 70%),
        var(--surface);
    box-shadow: 0 0 0 1px rgba(96, 160, 255, 0.06), inset 0 1px 0 rgba(96, 160, 255, 0.08);
    transition: border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
    cursor: pointer;
    animation: uploadPulse 60s steps(20) infinite;
}

.upload-area::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(96, 160, 255, 0.08),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.upload-area:hover::before { opacity: 1; }
.upload-area:hover {
    border-color: rgba(96, 160, 255, 0.5);
    border-style: solid;
    box-shadow: 0 0 30px rgba(96, 160, 255, 0.08), inset 0 1px 0 rgba(96, 160, 255, 0.1);
}
.upload-area.drag-over {
    border-color: var(--accent);
    border-style: solid;
    box-shadow: 0 0 40px rgba(96, 160, 255, 0.15), inset 0 0 40px var(--accent-dim);
}

@keyframes uploadPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(96, 160, 255, 0); }
    50%      { box-shadow: 0 0 20px rgba(96, 160, 255, 0.04); }
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}
.upload-prompt p {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-family: var(--mono-font);
}

/* Model toggle pills */
.model-pill {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-family: var(--mono-font);
    cursor: pointer;
    transition: all 0.15s ease;
}
.model-pill:hover {
    border-color: var(--accent);
    color: var(--text);
}
.model-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.model-pill-size {
    opacity: 0.6;
    font-size: 0.65rem;
}

.upload-icon {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 0.3rem;
    height: 36px;
}
.upload-icon .bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: waveBar 1.4s ease-in-out infinite;
    opacity: 0.5;
}
.upload-icon .bar:nth-child(1) { height: 10px; animation-delay: 0.0s; }
.upload-icon .bar:nth-child(2) { height: 20px; animation-delay: 0.15s; }
.upload-icon .bar:nth-child(3) { height: 30px; animation-delay: 0.3s; }
.upload-icon .bar:nth-child(4) { height: 24px; animation-delay: 0.45s; }
.upload-icon .bar:nth-child(5) { height: 14px; animation-delay: 0.6s; }
.upload-icon .bar:nth-child(6) { height: 26px; animation-delay: 0.75s; }
.upload-icon .bar:nth-child(7) { height: 16px; animation-delay: 0.9s; }

@keyframes waveBar {
    0%, 100% { transform: scaleY(0.4); opacity: 0.25; }
    50%      { transform: scaleY(1); opacity: 0.7; }
}

/* ── buttons ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.65rem 1.6rem;
    border: none;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
}
.btn-primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 24px var(--accent-dim);
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

/* ── progress spinner ─────────────────────────── */
.hidden { display: none !important; }

.spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-wrap p {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: var(--mono-font);
    letter-spacing: 0.5px;
}

/* ── mode toggle ──────────────────────────────── */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    transition: background 0.2s;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--text);
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-label input:checked + .toggle-slider {
    background: var(--accent);
}
.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(16px);
}
.toggle-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── progress bar (legacy — still used by tools without renderUI) ─── */
.progress-bar {
    width: 100%;
    max-width: 320px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease-out;
}
.progress-wrap p {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: var(--mono-font);
    letter-spacing: 0.5px;
}

/* ── Progress UI (waveform + step dots + messages) ────────── */
.progress-wrap {
    display:flex;flex-direction:column;align-items:center;gap:0.5rem;width:100%;padding:0 1rem;min-height:60px;
}
.progress-waveform {
    display:flex;justify-content:center;gap:3px;height:36px;align-items:end;
}
.wbar {
    width:4px;border-radius:2px;height:40%;
    background:linear-gradient(to top,var(--accent),var(--accent-violet,#a78bfa));
    animation:wbar-wave 0.7s ease-in-out var(--d,0s) infinite alternate;
}
.wbar.frozen { animation:none; height:60%; opacity:0.5; }
@keyframes wbar-wave { from{height:25%} to{height:100%} }

.progress-step-label {
    font-size:1rem;color:var(--text-primary,#fff);font-weight:500;
}
.progress-fun-msg {
    height:1.2rem;overflow:hidden;
}
.progress-fun-msg span {
    display:block;font-size:0.72rem;color:var(--accent-violet,#a78bfa);font-style:italic;
    transition:opacity 0.4s,transform 0.4s;
}
.progress-eta {
    font-size:0.85rem;color:var(--accent);font-family:var(--mono-font);
}
.progress-dots-track {
    position:relative;width:100%;max-width:340px;margin:0 auto;
}
.progress-dots-bar {
    height:5px;background:var(--border);border-radius:3px;overflow:hidden;
}
.progress-dots-fill {
    height:100%;width:0%;border-radius:3px;transition:width 0.5s ease-out;
    background:linear-gradient(90deg,var(--accent),var(--accent-violet,#a78bfa));
}
.progress-dot {
    position:absolute;top:-5px;width:14px;height:14px;border-radius:50%;
    border:2px solid var(--bg-deep,#0d0d2b);background:var(--border);
    transform:translateX(-50%);transition:background 0.4s,box-shadow 0.4s;
}
.progress-dot.done { background:var(--accent); }
.progress-dot.active { background:var(--accent-violet,#a78bfa); animation:dot-pulse 1.5s ease-in-out infinite; }
@keyframes dot-pulse {
    0%,100%{box-shadow:0 0 0 0 rgba(167,139,250,0.4)}
    50%{box-shadow:0 0 0 6px rgba(167,139,250,0)}
}
/* Light theme overrides */
[data-theme="light"] .wbar {
    background:linear-gradient(to top,var(--accent),#7c3aed);
}
[data-theme="light"] .progress-dot {
    border-color:var(--bg-surface,#f4f0ff);
}
[data-theme="light"] .progress-dots-bar {
    background:#e0d4f5;
}

/* ── result card ──────────────────────────────── */
.result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    animation: result-in 0.3s ease-out;
    contain: content;
}
@keyframes result-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.result.match { border-left: 2px solid var(--accent); }
.result.no-match { border-left: 2px solid var(--warm); }
.result h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}
.result .track-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.6rem;
}
.result .track-info span {
    color: var(--text-dim);
    font-size: 0.82rem;
}
.result .meta {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--mono-font);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* ── tool grid (home page) ────────────────────── */
.features h2 {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    font-weight: 400;
    text-align: center;
    color: var(--text-dim);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

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

/* ── Trust strip ─────────────────────────────── */
/* ── trust strip ────────────────────────────── */
.trust-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
    padding: 1rem 1.5rem;
    margin-bottom: 2.5rem;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.trust-strip span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 100px;
    background: rgba(96, 160, 255, 0.04);
    border: 1px solid rgba(96, 160, 255, 0.1);
    transition: background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.trust-strip span:hover {
    background: rgba(96, 160, 255, 0.08);
    border-color: rgba(96, 160, 255, 0.18);
    color: var(--text-dim);
    box-shadow: 0 0 12px rgba(96, 160, 255, 0.06);
}
[data-theme="light"] .trust-strip span {
    background: rgba(79, 70, 229, 0.03);
    border-color: rgba(79, 70, 229, 0.1);
}
[data-theme="light"] .trust-strip span:hover {
    background: rgba(79, 70, 229, 0.07);
    border-color: rgba(79, 70, 229, 0.18);
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.05);
}
.trust-strip span::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(96, 160, 255, 0.12);
    color: var(--accent);
    font-size: 0.5rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
[data-theme="light"] .trust-strip span::before {
    background: rgba(79, 70, 229, 0.1);
}

/* ── Featured grid (3 large cards) ───────────── */
.featured-section {
    margin-bottom: 3rem;
    position: relative;
}
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.featured-card {
    padding: 2.2rem 1.8rem;
    border: 1px solid rgba(96, 160, 255, 0.12);
    border-left: none;
    background: rgba(14, 14, 42, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.25s ease, background 0.3s ease, box-shadow 0.35s ease, border-color 0.3s ease;
}
/* gradient top edge accent */
.featured-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(140, 80, 255, 0.7), var(--accent));
    opacity: 0.6;
    transition: opacity 0.3s;
}
.featured-card:hover::after { opacity: 1; }

.featured-card .tool-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.2rem;
    filter: drop-shadow(0 4px 16px rgba(96, 160, 255, 0.25));
    transition: transform 0.35s ease, filter 0.35s ease;
}
.featured-card:hover .tool-icon {
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 8px 24px rgba(96, 160, 255, 0.35));
}
.featured-card h3 { font-size: 1.08rem; }
.featured-card p { font-size: 0.85rem; }
.featured-card:hover {
    background: rgba(14, 14, 42, 0.6);
    border-color: rgba(96, 160, 255, 0.2);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(96, 160, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}
[data-theme="light"] .featured-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(79, 70, 229, 0.1);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
[data-theme="light"] .featured-card::after {
    background: linear-gradient(90deg, var(--accent), #7c3aed, var(--accent));
}
[data-theme="light"] .featured-card:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.08),
        0 0 20px rgba(79, 70, 229, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .featured-card:hover .tool-icon {
    filter: drop-shadow(0 8px 24px rgba(79, 70, 229, 0.2));
}

/* featured label ("Most Popular") */
.featured-label {
    display: inline-block;
    font-family: var(--mono-font);
    font-weight: 500;
    font-size: 0.55rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    padding: 0.25rem 0.8rem;
    border-radius: 4px;
    background: rgba(96, 160, 255, 0.04);
    border: 1px solid rgba(96, 160, 255, 0.08);
}
[data-theme="light"] .featured-label {
    background: rgba(79, 70, 229, 0.03);
    border-color: rgba(79, 70, 229, 0.08);
}

/* icon wrapper with ambient glow ring */
.featured-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: radial-gradient(circle, rgba(96, 160, 255, 0.06) 0%, transparent 70%);
    border: 1px solid rgba(96, 160, 255, 0.08);
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    position: relative;
}
.featured-icon-wrap .tool-icon {
    margin: 0;
}
.featured-card:hover .featured-icon-wrap {
    border-color: rgba(96, 160, 255, 0.18);
    box-shadow: 0 0 24px rgba(96, 160, 255, 0.1);
    background: radial-gradient(circle, rgba(96, 160, 255, 0.1) 0%, transparent 70%);
}
[data-theme="light"] .featured-icon-wrap {
    background: radial-gradient(circle, rgba(79, 70, 229, 0.04) 0%, transparent 70%);
    border-color: rgba(79, 70, 229, 0.08);
}
[data-theme="light"] .featured-card:hover .featured-icon-wrap {
    border-color: rgba(79, 70, 229, 0.18);
    box-shadow: 0 0 24px rgba(79, 70, 229, 0.08);
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
}

/* ── Stats strip ────────────────────────────── */
.stats-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin-bottom: 3rem;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(96, 160, 255, 0.12);
    border-radius: 14px;
    background:
        linear-gradient(90deg, rgba(96, 160, 255, 0.04), rgba(140, 80, 255, 0.03), rgba(96, 160, 255, 0.04)),
        rgba(14, 14, 36, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    position: relative;
}
/* animated gradient shimmer */
.stats-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(96, 160, 255, 0.06) 25%,
        rgba(140, 80, 255, 0.04) 50%,
        rgba(96, 160, 255, 0.06) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    pointer-events: none;
}
.stats-strip span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.6rem;
    position: relative;
    transition: background 0.3s;
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
}
.stats-strip span:hover {
    background: rgba(96, 160, 255, 0.06);
}
/* vertical dividers between stats */
.stats-strip span + span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: rgba(96, 160, 255, 0.15);
}
[data-theme="light"] .stats-strip {
    border-color: rgba(79, 70, 229, 0.12);
    background:
        linear-gradient(90deg, rgba(79, 70, 229, 0.03), rgba(140, 80, 255, 0.02), rgba(79, 70, 229, 0.03)),
        rgba(255, 255, 255, 0.6);
}
[data-theme="light"] .stats-strip::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(79, 70, 229, 0.04) 25%,
        rgba(140, 80, 255, 0.03) 50%,
        rgba(79, 70, 229, 0.04) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
}
[data-theme="light"] .stats-strip span:hover {
    background: rgba(79, 70, 229, 0.04);
}
[data-theme="light"] .stats-strip span + span::before {
    background: rgba(79, 70, 229, 0.12);
}

/* ── Why section ────────────────────────────── */
.why-section {
    margin-bottom: 3.5rem;
    text-align: center;
    position: relative;
    padding-top: 1rem;
}
/* subtle top divider */
.why-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96, 160, 255, 0.15), transparent);
}
[data-theme="light"] .why-section::before {
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.12), transparent);
}
.why-section h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.why-intro {
    font-size: 0.84rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    text-align: left;
}
.why-block {
    padding: 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color 0.3s, transform 0.3s ease, box-shadow 0.3s;
    position: relative;
}
.why-block:hover {
    border-color: rgba(96, 160, 255, 0.2);
    transform: translateY(-4px);
    box-shadow:
        0 12px 36px rgba(96, 160, 255, 0.08),
        0 0 0 1px rgba(96, 160, 255, 0.04);
}
[data-theme="light"] .why-block:hover {
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow:
        0 12px 36px rgba(79, 70, 229, 0.08),
        0 0 0 1px rgba(79, 70, 229, 0.04);
}
.why-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(96, 160, 255, 0.1), rgba(140, 80, 255, 0.06));
    border: 1px solid rgba(96, 160, 255, 0.15);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}
.why-block:hover .why-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(96, 160, 255, 0.12);
}
[data-theme="light"] .why-icon {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(140, 80, 255, 0.04));
    border-color: rgba(79, 70, 229, 0.15);
}
[data-theme="light"] .why-block:hover .why-icon {
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.1);
}
.why-block h3 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}
.why-block p {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ── Category sections ───────────────────────── */
.category-section {
    margin-bottom: 3.5rem;
    position: relative;
}
.category-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.6rem;
    position: relative;
}
.category-header::after {
    content: "";
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(168, 85, 247, 0.5), transparent);
    position: relative;
    top: -2px;
    transform-origin: left;
}
.category-section h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text);
    margin-bottom: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.category-section h2::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}
.category-count {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--accent-dim);
    border: 1px solid rgba(96, 160, 255, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
}
[data-theme="light"] .category-count {
    border-color: rgba(79, 70, 229, 0.12);
}
.category-intro {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 1.2rem;
    padding-left: 0;
    line-height: 1.65;
    max-width: 540px;
}

/* ── Tool cards ──────────────────────────────── */
.tool-card {
    position: relative;
    overflow: hidden;
    padding: 1.6rem 1.4rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: background 0.3s, border-color 0.3s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* icon background glow — sits behind icon */
.tool-card .tool-icon-wrap {
    position: relative;
    margin-bottom: 0.8rem;
}
.tool-card .tool-icon-wrap::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.tool-card:hover .tool-icon-wrap::before {
    opacity: 1;
}
/* mouse-follow glow overlay */
.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--glow-card),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    border-radius: inherit;
}
/* top accent line on hover */
.tool-card .tool-icon-wrap::after {
    content: "";
    position: absolute;
    top: -1.6rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 1px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.tool-card:hover .tool-icon-wrap::after {
    width: 40px;
}
/* Full-card click area via ::after on the anchor */
.tool-card h3 a {
    color: inherit;
    text-decoration: none;
}
.tool-card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover {
    background: var(--bg-mid);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow:
        0 12px 40px rgba(96, 160, 255, 0.1),
        0 4px 16px rgba(96, 160, 255, 0.06),
        0 0 0 1px rgba(96, 160, 255, 0.08);
}
[data-theme="light"] .tool-card:hover {
    box-shadow:
        0 12px 40px rgba(79, 70, 229, 0.1),
        0 4px 16px rgba(79, 70, 229, 0.04),
        0 0 0 1px rgba(79, 70, 229, 0.08);
}
/* ── Category-colored card hover glow ────────── */
/* 1. Tempo & Rhythm — blue */
.category-section:nth-child(1 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(96,160,255,.15), 0 0 0 1px rgba(96,160,255,.1);
    border-color: rgba(96,160,255,.25);
}
/* 2. Pitch & Harmony — violet */
.category-section:nth-child(2 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(168,85,247,.15), 0 0 0 1px rgba(168,85,247,.1);
    border-color: rgba(168,85,247,.25);
}
/* 3. Stems & Separation — green */
.category-section:nth-child(3 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(52,211,153,.15), 0 0 0 1px rgba(52,211,153,.1);
    border-color: rgba(52,211,153,.25);
}
/* 4. Edit & Analyze — orange */
.category-section:nth-child(4 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(232,144,106,.15), 0 0 0 1px rgba(232,144,106,.1);
    border-color: rgba(232,144,106,.25);
}
/* Light theme — stronger category glow */
[data-theme="light"] .category-section:nth-child(1 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(96,160,255,.2), 0 0 0 1px rgba(96,160,255,.12);
    border-color: rgba(96,160,255,.3);
}
[data-theme="light"] .category-section:nth-child(2 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(168,85,247,.2), 0 0 0 1px rgba(168,85,247,.12);
    border-color: rgba(168,85,247,.3);
}
[data-theme="light"] .category-section:nth-child(3 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(52,211,153,.2), 0 0 0 1px rgba(52,211,153,.12);
    border-color: rgba(52,211,153,.3);
}
[data-theme="light"] .category-section:nth-child(4 of .category-section) .tool-card:hover {
    box-shadow: 0 8px 30px rgba(232,144,106,.2), 0 0 0 1px rgba(232,144,106,.12);
    border-color: rgba(232,144,106,.3);
}

.tool-card:hover h3 a { color: var(--accent); }

.tool-icon {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    filter: drop-shadow(0 2px 8px rgba(96, 160, 255, 0.15));
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s;
}
.tool-card:hover .tool-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 4px 16px rgba(96, 160, 255, 0.3));
}
[data-theme="light"] .tool-card:hover .tool-icon {
    filter: drop-shadow(0 4px 16px rgba(79, 70, 229, 0.2));
}

/* tool type badge */
.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--mono-font);
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    margin-bottom: 0.4rem;
    white-space: nowrap;
}
.tool-badge--ai {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.15);
}
.tool-badge--realtime {
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.15);
}
.tool-badge--browser {
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(96, 160, 255, 0.12);
}
[data-theme="light"] .tool-badge--ai {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.15);
}
[data-theme="light"] .tool-badge--realtime {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.15);
}
[data-theme="light"] .tool-badge--browser {
    color: var(--accent);
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(79, 70, 229, 0.12);
}

.tool-card h3 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    text-align: center;
    transition: color 0.2s;
}
.tool-card p {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.65;
    text-align: center;
}

/* ── Tool grid staggered entrance ────────────── */
.tool-grid {
    counter-reset: card;
}
.tool-card {
    counter-increment: card;
}

/* ── entrance animations ────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero { animation: fadeUp 0.5s ease-out both; }
.trust-strip { animation: fadeUp 0.5s ease-out 0.1s both; }
.featured-section { animation: fadeUp 0.5s ease-out 0.15s both; }
.featured-card:nth-child(1) { animation: fadeUp 0.4s ease-out 0.2s both; }
.featured-card:nth-child(2) { animation: fadeUp 0.4s ease-out 0.3s both; }
.featured-card:nth-child(3) { animation: fadeUp 0.4s ease-out 0.4s both; }
.stats-strip { animation: fadeUp 0.4s ease-out 0.45s both; }
.why-section { animation: fadeUp 0.5s ease-out 0.5s both; }

/* ── scroll-triggered reveals (IntersectionObserver-driven) ──
   Initial hidden state applied unconditionally; JS adds .revealed
   on viewport entry, triggering the transition. See static/scroll-reveal.js.
*/
.category-section,
.faq-section,
.related-tools,
.popular-tracklists {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease-out, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.category-section.revealed,
.faq-section.revealed,
.related-tools.revealed,
.popular-tracklists.revealed {
    opacity: 1;
    transform: none;
}

.category-section .tool-card {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.category-section.revealed .tool-card {
    opacity: 1;
    transform: none;
}

/* Staggered reveal of cards once parent section is revealed */
.category-section.revealed .tool-card:nth-child(1) { transition-delay: 0.00s; }
.category-section.revealed .tool-card:nth-child(2) { transition-delay: 0.06s; }
.category-section.revealed .tool-card:nth-child(3) { transition-delay: 0.12s; }
.category-section.revealed .tool-card:nth-child(4) { transition-delay: 0.18s; }
.category-section.revealed .tool-card:nth-child(5) { transition-delay: 0.24s; }
.category-section.revealed .tool-card:nth-child(6) { transition-delay: 0.30s; }

.category-header::after {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.category-section.revealed .category-header::after { transform: scaleX(1); }

/* ── metronome ────────────────────────────────── */
.metronome-wrap {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.metronome-display {
    margin-bottom: 1.5rem;
}

.bpm-display {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 5rem;
    line-height: 1;
    color: var(--text);
}
.bpm-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.beat-dots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.beat-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border-hover);
    background: rgba(96, 160, 255, 0.06);
    transition: background 0.08s, box-shadow 0.08s, transform 0.08s;
}
.beat-dot.active { transform: scale(1.15); }
.beat-dot.active {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.beat-dot.accent.active {
    background: var(--warm);
    box-shadow: 0 0 12px var(--warm-glow);
}

.bpm-slider {
    width: 100%;
    margin-bottom: 1.5rem;
    accent-color: var(--accent);
}

.metronome-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.metronome-play {
    min-width: 100px;
}
.metronome-play.playing {
    background: var(--warm);
}

.metronome-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.metronome-select {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono-font);
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
}

/* ── tap BPM ──────────────────────────────────── */
.tap-wrap {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.tap-display {
    margin-bottom: 0.5rem;
}

.tap-bpm {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 6rem;
    line-height: 1;
    color: var(--text);
}
.tap-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.tap-stability {
    font-family: var(--mono-font);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    min-height: 1.2em;
}
.tap-stability.stable { color: var(--accent); }
.tap-stability.moderate { color: var(--warm); }
.tap-stability.unstable { color: var(--text-dim); }

.tap-area {
    width: 100%;
    padding: 4rem 3rem;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-solid) 100%);
    border: 2px solid var(--border-hover);
    color: var(--text);
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.tap-area::after {
    content: "press any key or click";
    display: block;
    font-family: var(--mono-font);
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-top: 0.8rem;
}
.tap-area:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-dim);
}
.tap-area:active, .tap-area.tapped {
    background: var(--accent-dim);
    border-color: var(--accent);
    transform: scale(0.97);
    box-shadow: 0 0 40px var(--accent-glow);
}

.tap-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tap-info {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Camelot wheel ────────────────────────────── */
.camelot-wrap {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.camelot-svg-container {
    width: 360px;
    max-width: 100%;
}

#camelot-svg {
    width: 100%;
    height: auto;
}

.camelot-info {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.camelot-hint {
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 0.8rem;
}

.camelot-selected {
    margin-bottom: 1rem;
}

.camelot-code {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 3rem;
    color: var(--text);
    line-height: 1;
}

.camelot-key {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.camelot-compat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.compat-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-right: 0.3rem;
}

.compat-tag {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border);
    color: var(--accent);
    letter-spacing: 0.3px;
}

.key-compat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ── pitch detector / tuner ──────────────────── */
.tuner-wrap {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.tuner-gauge {
    margin-bottom: 2rem;
}

.tuner-cents-bar {
    position: relative;
    height: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.tuner-cents-center {
    position: absolute;
    left: 50%;
    top: -2px;
    width: 2px;
    height: 12px;
    background: var(--text-muted);
    transform: translateX(-50%);
}

.tuner-cents-indicator {
    position: absolute;
    left: 50%;
    top: -3px;
    width: 10px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.1s ease;
}
.tuner-cents-indicator.in-tune {
    background: #4ade80;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.tuner-cents-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    color: var(--text-muted);
}

.tuner-display {
    margin-bottom: 2rem;
}

.tuner-note {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 5rem;
    line-height: 1;
    color: var(--text);
}

.tuner-freq {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.tuner-cents {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tuner-hint {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
}

/* ── audio cutter ─────────────────────────────── */
.cutter-wrap {
    margin-top: 1.5rem;
}

.waveform-container {
    position: relative;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

#waveform-canvas {
    display: block;
    width: 100%;
}

.trim-handle {
    position: absolute;
    top: 0;
    width: 8px;
    height: 100%;
    background: var(--accent);
    cursor: ew-resize;
    z-index: 5;
    opacity: 0.8;
}
.trim-handle:hover { opacity: 1; }
.trim-handle-left { left: 0; border-radius: 2px 0 0 2px; }
.trim-handle-right { left: 100%; transform: translateX(-100%); border-radius: 0 2px 2px 0; }

.trim-region {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--accent-dim);
    pointer-events: none;
    z-index: 2;
}

.playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--warm);
    z-index: 6;
    pointer-events: none;
}

.cutter-times {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 0.5rem 0;
}

.cutter-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

/* ── pills (genre selector etc.) ─────────────── */
.pill {
    background: var(--bg-card, var(--surface));
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── about page ──────────────────────────────── */
.about-content {
    max-width: 640px;
    margin: 0 auto;
}
.about-content h2 {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 2rem 0 0.8rem;
    color: var(--text);
}
.about-content p, .about-content li {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.7;
}
.about-content ul {
    padding-left: 1.2rem;
}
.about-content li {
    margin-bottom: 0.4rem;
}
.about-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(96, 160, 255, 0.3);
    transition: color 0.2s, border-color 0.2s;
}
.about-content a:hover {
    color: #fff;
    border-color: var(--accent);
}
[data-theme="light"] .about-content a:hover {
    color: #1a1a2e;
}

/* ── Mix Analyzer Report Card ────────────────── */

/* Score hero */
/* ── Flow Score ────────────────────────────────── */
.flow-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 0 0.8rem;
}
.flow-label {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    flex-shrink: 0;
    min-width: 3rem;
}
.flow-bar-track {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    background: var(--border);
    overflow: hidden;
    position: relative;
}
.flow-bar-track::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 5px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 9px,
        rgba(255,255,255,0.03) 9px,
        rgba(255,255,255,0.03) 10px
    );
}
.flow-bar-fill {
    height: 100%;
    width: 100%;
    border-radius: 5px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    box-shadow: 0 0 12px rgba(96, 160, 255, 0.3);
    will-change: transform;
}
.flow-pct {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    min-width: 3.5rem;
    text-align: right;
}

/* ── Flow Sub-Scores ──────────────────────────── */
.flow-sub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1.5rem;
    padding: 0.6rem 0;
}
.flow-sub-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.flow-sub-label {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    min-width: 7rem;
    flex-shrink: 0;
}
.flow-sub-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}
.flow-sub-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.flow-sub-val {
    font-family: var(--mono-font);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    min-width: 1.5rem;
    text-align: right;
}

/* ── Flow Summary + Callouts ──────────────────── */
.flow-summary {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}
.flow-callouts {
    padding: 0 0 0.5rem;
}
.flow-callout {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    padding: 0.3rem 0;
    color: var(--text-muted);
}
.flow-callout.warning { color: #f59e0b; }
.flow-callout.info { color: var(--text-dim); }

/* ── Filter Toggles ───────────────────────────── */
.mix-filter-toggles {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
}
.filter-btn {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-dim);
}
.filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Report waveform area */
.mix-waveform-wrap {
    position: relative;
    border-radius: 8px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.mix-waveform-wrap canvas {
    display: block;
    width: 100%;
    cursor: crosshair;
}
.mix-wf-time-axis {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    font-family: var(--mono-font);
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 0.6rem;
}

/* Transition markers tooltip on hover */
.mix-marker-tooltip {
    position: absolute;
    top: -24px;
    transform: translateX(-50%);
    font-family: var(--mono-font);
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

/* ── Waveform Pins ─────────────────────────────── */
#waveform-pins {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    pointer-events: none;
}
.waveform-pin {
    position: absolute;
    top: -14px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.15s, box-shadow 0.15s;
    z-index: 2;
    /* 44px touch target via padding */
    padding: 0;
    margin: -8px;
    box-sizing: content-box;
}
.waveform-pin::before {
    content: "";
    position: absolute;
    inset: -8px;
}
.waveform-pin:hover {
    transform: translateX(-50%) scale(1.15);
}
.waveform-pin-green {
    background: rgba(74, 222, 128, 0.15);
    border-color: #4ade80;
    color: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}
.waveform-pin-green:hover { box-shadow: 0 0 14px rgba(74, 222, 128, 0.5); }
.waveform-pin-amber {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}
.waveform-pin-amber:hover { box-shadow: 0 0 14px rgba(245, 158, 11, 0.5); }
.waveform-pin-red {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}
.waveform-pin-red:hover { box-shadow: 0 0 14px rgba(239, 68, 68, 0.5); }

/* ── Coaching Cards ───────────────────────────── */
.coaching-card {
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, opacity 0.3s;
}
.coaching-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-solid);
}
.coaching-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}
.coaching-green { border-left-color: #4ade80; }
.coaching-amber { border-left-color: #f59e0b; }
.coaching-red   { border-left-color: #ef4444; }

/* Intentional: grayed out */
.coaching-card.intentional {
    opacity: 0.45;
    border-left-color: var(--border) !important;
}
.coaching-card.intentional .coaching-tip { display: none; }
.coaching-card.intentional .coaching-intent-btn {
    opacity: 0.7;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

/* Flash animation on pin click */
.coaching-card.flash {
    animation: cardFlash 0.6s ease-out;
}
@keyframes cardFlash {
    0%   { background: var(--accent-dim); box-shadow: 0 0 12px var(--accent-glow); }
    100% { background: var(--surface); box-shadow: none; }
}

/* Card header */
.coaching-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.coaching-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    flex-shrink: 0;
}
.coaching-icon-green {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.2);
}
.coaching-icon-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
}
.coaching-icon-red {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.2);
}
.coaching-time {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}

/* Labels row */
.coaching-labels {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
}

/* Key + drift line */
.coaching-key-line {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

/* Coaching tip */
.coaching-tip {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-dim);
    padding: 0.5rem 0.6rem;
    margin-top: 0.3rem;
    background: rgba(96, 160, 255, 0.04);
    border-radius: 6px;
    border-left: 2px solid var(--accent);
}

/* Mark as intentional button */
.coaching-intent-btn {
    font-family: var(--mono-font);
    font-size: 0.55rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 0.4rem;
    transition: all 0.2s;
}
.coaching-intent-btn:hover {
    border-color: var(--text-dim);
    color: var(--text-dim);
}
.coaching-intent-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

/* Light theme coaching overrides */
[data-theme="light"] .coaching-tip {
    background: rgba(79, 70, 229, 0.04);
    border-left-color: var(--accent);
}
[data-theme="light"] .flow-bar-fill {
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.2);
}
[data-theme="light"] .waveform-pin-green { background: rgba(34, 197, 94, 0.12); }
[data-theme="light"] .waveform-pin-amber { background: rgba(217, 119, 6, 0.12); }
[data-theme="light"] .waveform-pin-red   { background: rgba(220, 38, 38, 0.12); }
[data-theme="light"] .coaching-icon-green { background: rgba(34, 197, 94, 0.1); }
[data-theme="light"] .coaching-icon-amber { background: rgba(217, 119, 6, 0.1); }
[data-theme="light"] .coaching-icon-red   { background: rgba(220, 38, 38, 0.1); }

/* Transition detail (expanded below waveform) */
.mix-detail-card {
    padding: 1rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-left: 3px solid var(--accent);
    margin-bottom: 1rem;
    animation: fadeSlideIn 0.25s ease-out;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.mix-detail-header {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.mix-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
}
.mix-detail-item label {
    display: block;
    font-family: var(--mono-font);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}
.mix-detail-item span {
    font-family: var(--mono-font);
    font-size: 0.8rem;
}

/* (Issues list removed — issues now inline in coaching cards + flow callouts) */

/* Status colors */
.clr-locked      { color: #4ade80; }
.clr-slight-drift { color: #f59e0b; }
.clr-lost        { color: #ef4444; }
.clr-error       { color: #ef4444; }
.bg-locked       { background: #4ade80; }
.bg-slight-drift { background: #f59e0b; }
.bg-lost         { background: #ef4444; }
.bg-error        { background: #ef4444; }

/* "Analyze another" link */
.mix-analyze-again {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--accent);
    cursor: pointer;
    margin-top: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.mix-analyze-again:hover { opacity: 1; }

/* No transitions banner */
.mix-info-banner {
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .flow-bar-row { gap: 0.6rem; }
    .flow-pct { font-size: 1.5rem; }
    .flow-sub-grid { grid-template-columns: 1fr; gap: 0.4rem; }
    .flow-sub-label { min-width: 6rem; }
    .mix-filter-toggles { justify-content: center; }
    .coaching-card { padding: 0.6rem 0.7rem; }
    .mix-detail-grid { grid-template-columns: 1fr 1fr; }
    .waveform-pin { width: 24px; height: 24px; line-height: 20px; font-size: 0.6rem; }
}

/* ── audio-to-midi ───────────────────────────── */
.midi-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.midi-stat {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
}
.midi-stat-label {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.midi-stat-value {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--accent);
}
.piano-roll-wrap {
    position: relative;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.piano-roll-wrap canvas {
    display: block;
    width: 100%;
    cursor: grab;
}
.piano-roll-wrap canvas:active {
    cursor: grabbing;
}
.midi-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── pitch shifter ───────────────────────────── */
.ps-controls {
    max-width: 600px;
    margin: 1.5rem auto 0;
}
.ps-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.ps-label {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 42px;
}
.ps-slider {
    flex: 1;
    accent-color: var(--accent);
}
.ps-value {
    font-family: var(--mono-font);
    font-size: 0.9rem;
    color: var(--text);
    min-width: 50px;
    text-align: right;
}
.ps-step-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    min-width: unset !important;
    font-family: var(--mono-font) !important;
}
.ps-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ── ad slots (empty placeholders) ────────────── */
.ad-slot {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}
.ad-leaderboard {
    min-height: 0;
    margin-top: 0.5rem;
}
.ad-rectangle {
    min-height: 0;
    margin-bottom: 0.5rem;
}

/* ── footer ───────────────────────────────────── */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2.5rem 2rem 2rem;
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 0.65rem;
    border-top: none;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}
.footer-links a {
    position: relative;
    padding: 0.3rem 0.85rem;
}
.footer-links a:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background: var(--border);
}
footer a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.25s;
    position: relative;
}
footer a:hover { color: var(--text); }
footer .footer-links a::before {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 0.85rem;
    right: 0.85rem;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}
footer .footer-links a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}
footer p {
    line-height: 1.8;
}
footer p a {
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
    transition: color 0.25s, text-decoration-color 0.25s;
}
footer p a:hover {
    text-decoration-color: var(--accent);
    color: var(--text);
}
.footer-brand {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none !important;
}
.footer-brand:hover { color: var(--accent); }

/* ── drum machine ────────────────────────────── */
.dm-wrap {
    max-width: 900px;
    margin: 0 auto 2rem;
}

.dm-transport {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.dm-play-btn {
    min-width: 5rem;
}
.dm-play-btn.playing {
    background: var(--warm);
}

.dm-ctrl-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dm-ctrl-label {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dm-bpm-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    min-width: unset;
}

.dm-bpm-val {
    font-family: var(--heading-font);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 2.5rem;
    text-align: center;
}

.dm-slider {
    width: 80px;
    accent-color: var(--accent);
}

.dm-swing-val {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--text-dim);
    min-width: 2rem;
}

.dm-select {
    font-family: var(--body-font);
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    background: var(--surface-solid);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

/* Desktop grid */
.dm-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dm-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dm-label {
    width: 50px;
    padding: 0.4rem 0.3rem;
    font-family: var(--mono-font);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.dm-label:hover {
    color: var(--text);
    background: var(--accent-dim);
}

.dm-steps {
    display: flex;
    gap: 2px;
    flex: 1;
}

.dm-cell {
    flex: 1;
    aspect-ratio: 1;
    max-height: 36px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
}
.dm-cell.dm-cell-alt {
    background: var(--accent-dim);
}
.dm-cell:hover {
    border-color: var(--border-hover);
}
.dm-cell.active {
    background: var(--ch-color, var(--accent));
    border-color: var(--ch-color, var(--accent));
    box-shadow: 0 0 6px color-mix(in srgb, var(--ch-color, var(--accent)) 40%, transparent);
}
.dm-cell.playhead::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--text);
    border-radius: 3px;
    opacity: 0.5;
}

.dm-vol-wrap {
    width: 60px;
    flex-shrink: 0;
}
.dm-vol {
    width: 100%;
    accent-color: var(--accent);
}

/* Mobile pads */
.dm-pads {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.dm-pad {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-dim);
    font-family: var(--mono-font);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dm-pad:active {
    transform: scale(0.95);
}
.dm-pad.selected {
    background: color-mix(in srgb, var(--pad-color) 20%, transparent);
    border-color: var(--pad-color);
    color: var(--text);
    box-shadow: 0 0 12px color-mix(in srgb, var(--pad-color) 30%, transparent);
}

/* Mobile mini-sequencer */
.dm-mobile-seq {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dm-mini-seq {
    display: flex;
    gap: 3px;
}

.dm-mini-cell {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.1s;
}
.dm-mini-cell.dm-cell-alt {
    background: var(--accent-dim);
}
.dm-mini-cell.active {
    background: var(--ch-color, var(--accent));
    border-color: var(--ch-color, var(--accent));
}
.dm-mini-cell.playhead::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--text);
    border-radius: 3px;
    opacity: 0.5;
}
.dm-mini-cell {
    position: relative;
}

.dm-ch-vol-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* SEO content */
.seo-content {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.7;
}
.seo-content h2, .seo-content h3 {
    font-family: var(--heading-font);
    color: var(--text);
    margin: 1.5rem 0 0.5rem;
}
.seo-content h2 { font-size: 1.3rem; }
.seo-content h3 { font-size: 1rem; }
.seo-content p { margin-bottom: 0.8rem; }

/* ── seo components ──────────────────────────── */
.breadcrumb {
    max-width: 700px;
    margin: 0 auto 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--mono-font);
    border-radius: 999px;
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}
.breadcrumb li:not(:last-child)::after {
    content: '>';
    margin-left: 0.4rem;
    opacity: 0.5;
}
.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}
.breadcrumb [aria-current] {
    color: var(--text-muted);
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(80, 200, 120, 0.3);
    border-radius: 100px;
    font-size: 0.7rem;
    color: rgba(80, 200, 120, 0.85);
    font-family: var(--mono-font);
    letter-spacing: 0.02em;
    margin: 0.5rem auto 1rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(80, 200, 120, 0.1), rgba(96, 160, 255, 0.05));
    box-shadow: 0 0 20px rgba(80, 200, 120, 0.06), inset 0 1px 0 rgba(80, 200, 120, 0.08);
}
.privacy-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: rgba(80, 200, 120, 0.9);
}

.how-to-section {
    max-width: 700px;
    margin: 2.5rem auto 0;
}
.how-to-section h2 {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 1rem;
    text-align: center;
}
.steps-pills {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.step-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text);
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}
.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.faq-section {
    max-width: 720px;
    margin: 4rem auto 0;
    padding: 2rem 0 0;
    border: none;
    position: relative;
}
.faq-section::before {
    content: "";
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin: 0 auto 2rem;
    border-radius: 1px;
}
.faq-section h2 {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.6rem;
    overflow: hidden;
    background: transparent;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.faq-item:hover {
    border-color: var(--border-hover);
    background: rgba(96, 160, 255, 0.03);
    box-shadow: 0 2px 12px rgba(96, 160, 255, 0.04);
}
.faq-item summary {
    padding: 1rem 1.4rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: color 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }
/* custom chevron indicator */
.faq-item summary::after {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid rgba(96, 160, 255, 0.12);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s;
    /* chevron arrow via borders */
    display: flex;
    align-items: center;
    justify-content: center;
}
/* chevron drawn with box-shadow trick */
.faq-item summary::after {
    content: '';
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
    opacity: 0.5;
    margin-right: 2px;
}
.faq-item:hover summary::after { opacity: 0.9; }
.faq-item[open] summary::after {
    transform: rotate(-135deg);
    opacity: 0.9;
}
.faq-item[open] {
    border-color: rgba(96, 160, 255, 0.25);
    background: rgba(96, 160, 255, 0.04);
    box-shadow: 0 4px 20px rgba(96, 160, 255, 0.06);
}
.faq-item[open] summary {
    color: var(--accent);
    border-bottom: 1px solid rgba(96, 160, 255, 0.1);
}
.faq-answer {
    padding: 0.8rem 1.4rem 1.2rem;
    font-size: 0.82rem;
    line-height: 1.75;
    color: var(--text-dim);
}
[data-theme="light"] .faq-section::before {
    background: linear-gradient(90deg, var(--accent), transparent);
}
[data-theme="light"] .faq-section h2 { color: var(--text); }
[data-theme="light"] .faq-item {
    border-color: rgba(79, 70, 229, 0.12);
    background: rgba(79, 70, 229, 0.02);
}
[data-theme="light"] .faq-item:hover {
    border-color: rgba(79, 70, 229, 0.2);
    background: rgba(79, 70, 229, 0.04);
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.04);
}
[data-theme="light"] .faq-item[open] {
    border-color: rgba(79, 70, 229, 0.25);
    background: rgba(79, 70, 229, 0.04);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.06);
}
[data-theme="light"] .faq-item[open] summary {
    border-bottom-color: rgba(79, 70, 229, 0.1);
}
[data-theme="light"] .faq-item summary::after {
    border-right-color: var(--accent);
    border-bottom-color: var(--accent);
}

.related-tools,
.popular-tracklists {
    max-width: 700px;
    margin: 2.5rem auto 0;
}
.related-tools h2,
.popular-tracklists h2 {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 1rem;
}
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
}
.related-tool-card {
    display: block;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}
.related-tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.related-tool-card h3 {
    font-family: var(--heading-font);
    font-size: 0.85rem;
    color: var(--text);
    margin: 0.4rem 0 0.2rem;
}
.related-tool-card p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}
.related-tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    filter: drop-shadow(0 2px 6px rgba(96, 160, 255, 0.12));
}

.results-crosslink {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}
.results-crosslink:hover {
    background: var(--accent);
    color: #fff;
}

/* ── Track ID home banner ────────────────────── */
.trackid-banner { margin-bottom: 1.5rem; }
.trackid-banner-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 1.8rem;
    background: linear-gradient(135deg, rgba(232,144,106,0.06), rgba(96,160,255,0.04));
    border: 1px solid rgba(232,144,106,0.15);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.trackid-banner-link:hover {
    border-color: rgba(232,144,106,0.35);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(232,144,106,0.08);
}
.trackid-banner-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    flex-shrink: 0;
}
.trackid-banner-bars span {
    width: 4px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(to top, var(--accent), var(--warm));
    height: var(--h);
    transform-origin: bottom;
    animation: tidBarPulse 2.4s ease-in-out infinite alternate;
    animation-delay: var(--d);
    opacity: 0.6;
}
.trackid-banner-content { flex: 1; min-width: 0; }
.trackid-banner-badge {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: var(--warm);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}
.trackid-banner-content h3 {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
}
.trackid-banner-content h3 em {
    font-style: italic;
    font-family: 'Ferro BC', var(--heading-font), sans-serif;
    color: var(--warm);
}
.trackid-banner-content p {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.5;
}
.trackid-banner-arrow {
    flex-shrink: 0;
    color: var(--warm);
    opacity: 0.4;
    transition: opacity 0.25s, transform 0.25s;
}
.trackid-banner-link:hover .trackid-banner-arrow {
    opacity: 1;
    transform: translateX(4px);
}
[data-theme="light"] .trackid-banner-link {
    background: linear-gradient(135deg, rgba(232,144,106,0.08), rgba(79,70,229,0.04));
}

/* ── Promo Banners (shared base) ─────────────── */
.promo-banner { margin-bottom: 1rem; }
.promo-banner-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 1.8rem;
    border: 1px solid rgba(var(--promo-rgb), 0.15);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    background: linear-gradient(135deg, rgba(var(--promo-rgb), 0.06), rgba(var(--promo-rgb), 0.02));
}
.promo-banner-link:hover {
    border-color: rgba(var(--promo-rgb), 0.35);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(var(--promo-rgb), 0.08);
}
.promo-banner-visual { flex-shrink: 0; }
.promo-banner-content { flex: 1; min-width: 0; }
.promo-banner-badge {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: rgb(var(--promo-rgb));
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}
.promo-banner-content h3 {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
}
.promo-banner-content h3 em {
    font-style: italic;
    font-family: 'Ferro BC', var(--heading-font), sans-serif;
    color: rgb(var(--promo-rgb));
}
.promo-banner-content p {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.5;
}
.promo-banner-arrow {
    flex-shrink: 0;
    color: rgb(var(--promo-rgb));
    opacity: 0.4;
    transition: opacity 0.25s, transform 0.25s;
}
.promo-banner-link:hover .promo-banner-arrow {
    opacity: 1;
    transform: translateX(4px);
}
[data-theme="light"] .promo-banner-link {
    background: linear-gradient(135deg, rgba(var(--promo-rgb), 0.08), rgba(var(--promo-rgb), 0.03));
}

/* ── Clinic variant (green) ──────────────────── */
.promo-banner--clinic { --promo-rgb: 74, 222, 128; }
.promo-banner--clinic .promo-banner-badge { color: #0a1a0f; }
.clinic-cross {
    opacity: 0.6;
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.25));
    animation: clinicPulse 3s ease-in-out infinite;
}
@keyframes clinicPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 0.8; }
}

/* ── Mix Analyzer variant (blue-purple) ──────── */
.promo-banner--mixer { --promo-rgb: 147, 130, 255; }
.promo-banner--mixer .promo-banner-badge { color: #0c0a1f; }
.mixer-eq {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 48px;
    flex-shrink: 0;
}
.mixer-eq span {
    width: 3px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(to top, rgba(96,160,255,0.7), rgb(147,130,255));
    height: var(--h);
    transform-origin: bottom;
    animation: mixerPulse 1.8s ease-in-out infinite alternate;
    animation-delay: var(--d);
    opacity: 0.55;
}
@keyframes mixerPulse {
    0%   { transform: scaleY(1.00); opacity: 0.4; }
    100% { transform: scaleY(0.82); opacity: 0.75; }
}

/* ── Auto-Master variant (amber/gold) ────────── */
.promo-banner--master { --promo-rgb: 251, 191, 36; }
.promo-banner--master .promo-banner-badge { color: #1a1400; }
.master-meters {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 48px;
    flex-shrink: 0;
}
.master-meters span {
    width: 8px;
    border-radius: 2px;
    background: linear-gradient(to top, #22c55e 0%, #fbbf24 55%, #ef4444 92%);
    height: var(--h);
    transform-origin: bottom;
    animation: meterFill 2.5s ease-in-out infinite alternate;
    animation-delay: var(--d);
    opacity: 0.55;
}
@keyframes meterFill {
    0%   { transform: scaleY(0.65); opacity: 0.35; }
    100% { transform: scaleY(1.00); opacity: 0.75; }
}

/* ── Playlist Analyzer variant (cyan) ──────────── */
.promo-banner--playlist { --promo-rgb: 56, 189, 248; }
.promo-banner--playlist .promo-banner-badge { color: #021a2a; }
.playlist-scan-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
}
.playlist-scan { display: block; overflow: visible; }
.playlist-scan rect {
    transition: opacity 0.3s;
}
.playlist-scan-wrap .scan-laser {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 2px;
    background: rgb(56, 189, 248);
    opacity: 0.8;
    pointer-events: none;
    transform: translateY(6px);
    animation: laserScan 2.4s ease-in-out infinite;
    will-change: transform;
}
.promo-banner-link:hover .playlist-scan rect {
    opacity: 0.35 !important;
}
@keyframes laserScan {
    0%   { transform: translateY(6px);  opacity: 0.3; }
    15%  { opacity: 0.9; }
    50%  { transform: translateY(44px); opacity: 0.9; }
    65%  { opacity: 0.3; }
    100% { transform: translateY(6px);  opacity: 0.3; }
}

/* ── Track ID hub (/trackid) ─────────────────── */
.tid-hero {
    padding: 2rem 0 0;
    text-align: center;
}
.tid-hero-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}
.tid-hero-text { text-align: left; max-width: 520px; }

.tid-badge {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--warm);
    background: rgba(232,144,106,0.08);
    border: 1px solid rgba(232,144,106,0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    animation: fadeUp 0.6s ease both;
}
.tid-hero h1 {
    font-family: var(--heading-font);
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text);
    margin: 0 0 0.8rem;
    animation: fadeUp 0.6s ease both 0.1s;
}
.tid-hero h1 em {
    font-style: italic;
    font-family: 'Ferro BC', var(--heading-font), sans-serif;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.tid-hero-sub {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0;
    animation: fadeUp 0.6s ease both 0.2s;
}

/* Frequency bar visualizer */
.tid-hero-viz {
    flex-shrink: 0;
    animation: fadeUp 0.6s ease both 0.3s;
}
.tid-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 0 0.5rem;
}
.tid-bars span {
    width: 6px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(to top, var(--accent), var(--warm));
    height: var(--h);
    transform-origin: bottom;
    animation: tidBarPulse 2.4s ease-in-out infinite alternate;
    animation-delay: var(--d);
    opacity: 0.7;
}
@keyframes tidBarPulse {
    0%   { transform: scaleY(1.0); opacity: 0.5; }
    50%  { transform: scaleY(0.6); opacity: 0.8; }
    100% { transform: scaleY(1.0); opacity: 0.5; }
}

/* Stats ribbon */
.tid-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    margin: 0 auto 2.5rem;
    max-width: 680px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    animation: fadeUp 0.6s ease both 0.35s;
}
.tid-stat { text-align: center; }
.tid-stat-num {
    display: block;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.tid-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}
.tid-stat-sep {
    width: 1px;
    height: 32px;
    background: var(--border);
    flex-shrink: 0;
}

/* Feature cards */
.tid-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}
.tid-card {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.5rem 1.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    position: relative;
    overflow: hidden;
}
.tid-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: inherit;
}
.tid-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.tid-card:hover::before { opacity: 1; }
.tid-card--sets::before  { background: linear-gradient(135deg, rgba(96,160,255,0.04), transparent 60%); }
.tid-card--identify::before { background: linear-gradient(135deg, rgba(232,144,106,0.06), transparent 60%); }
.tid-card--chart::before { background: linear-gradient(135deg, rgba(120,200,160,0.05), transparent 60%); }
.tid-card--radio::before { background: linear-gradient(135deg, rgba(224,88,88,0.05), transparent 60%); }

.tid-card-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
}
.tid-card--sets .tid-card-icon { color: var(--accent); }
.tid-card--identify .tid-card-icon { color: var(--warm); }
.tid-card--chart .tid-card-icon { color: #78c8a0; }
.tid-card--radio .tid-card-icon { color: #e05858; }

.tid-card-content { flex: 1; min-width: 0; }
.tid-card-content h2 {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    letter-spacing: -0.01em;
}
.tid-card:hover .tid-card-content h2 { color: var(--accent); }
.tid-card--identify:hover .tid-card-content h2 { color: var(--warm); }
.tid-card--chart:hover .tid-card-content h2 { color: #78c8a0; }
.tid-card--radio:hover .tid-card-content h2 { color: #e05858; }
.tid-card-content p {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.55;
    margin: 0 0 0.8rem;
}

.tid-card-arrow {
    flex-shrink: 0;
    align-self: center;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s, transform 0.25s;
}
.tid-card:hover .tid-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Platform pills in sets card */
.tid-card-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tid-plat-pill {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(96,160,255,0.12);
    letter-spacing: 0.02em;
}

/* Method pills in identify card */
.tid-card-methods {
    display: flex;
    gap: 0.5rem;
}
.tid-method-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    background: rgba(232,144,106,0.08);
    color: var(--warm);
    border: 1px solid rgba(232,144,106,0.15);
}

/* Radio pills in radio card */
.tid-card-radio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tid-radio-pill {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(224,88,88,0.08);
    color: #e05858;
    border: 1px solid rgba(224,88,88,0.15);
    letter-spacing: 0.02em;
}

/* Podium in chart card */
.tid-card-podium {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.tid-podium-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.tid-podium-rank {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
    color: #78c8a0;
}
.tid-podium-entry:first-child .tid-podium-rank { color: #ffd700; }
.tid-podium-entry:nth-child(2) .tid-podium-rank { color: #c0c0c0; }
.tid-podium-entry:nth-child(3) .tid-podium-rank { color: #cd7f32; }
.tid-podium-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Recent sets grid */
.tid-recent { margin-bottom: 3rem; }
.tid-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}
.tid-section-header h2 {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.tid-see-all {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.tid-see-all:hover { text-decoration: underline; }

.tid-recent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.tid-recent-card {
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.tid-recent-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}
.tid-recent-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg);
}
.tid-recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.tid-recent-card:hover .tid-recent-thumb img { transform: scale(1.04); }
.tid-recent-plat {
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    backdrop-filter: blur(4px);
    letter-spacing: 0.03em;
}
.tid-recent-info { padding: 0.8rem 1rem; }
.tid-recent-info h3 {
    font-family: var(--heading-font);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tid-recent-title {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin: 0 0 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tid-recent-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* CTA strip */
.tid-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.tid-cta p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.tid-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: var(--warm);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s;
}
.tid-cta-btn:hover { filter: brightness(1.15); }

/* Light theme overrides */
[data-theme="light"] .tid-card { background: rgba(255,255,255,0.8); }
[data-theme="light"] .tid-stats { background: rgba(255,255,255,0.8); }
[data-theme="light"] .tid-recent-card { background: rgba(255,255,255,0.8); }
[data-theme="light"] .tid-cta { background: rgba(255,255,255,0.8); }
[data-theme="light"] .tid-bars span {
    background: linear-gradient(to top, var(--accent), #e8906a);
    opacity: 0.5;
}

/* ── responsive ───────────────────────────────── */
@media (max-width: 900px) {
    .featured-grid { grid-template-columns: 1fr; gap: 10px; }
    .why-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .category-header::after { display: none; }
    .camelot-wrap { flex-direction: column; align-items: center; }
    .camelot-info { max-width: 100%; text-align: center; }
    .tid-hero-inner { flex-direction: column; gap: 1.5rem; text-align: center; }
    .tid-hero-text { text-align: center; }
    .tid-recent-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .top-bar { padding: 0 1.2rem; }
    main { padding: 1.2rem; }
    .hero { padding: 2.5rem 0 1.5rem; }
    .hero h1 { font-size: 2.2rem; }
    .upload-area { padding: 2rem 1.2rem; }
    .tool-grid { grid-template-columns: 1fr; gap: 8px; }
    .why-grid { grid-template-columns: 1fr; gap: 8px; }
    .trust-strip { gap: 0.3rem 0.4rem; font-size: 0.55rem; }
    .trust-strip span { padding: 0.25rem 0.55rem; }
    .stats-strip { flex-direction: column; border-radius: 12px; }
    .tid-hero h1 { font-size: 2.5rem; }
    .tid-stats { flex-wrap: wrap; gap: 1rem; padding: 1rem 1.2rem; }
    .tid-stat-sep { display: none; }
    .tid-recent-grid { grid-template-columns: 1fr; }
    .tid-cta { flex-direction: column; text-align: center; }
    .tid-bars { height: 80px; }
    .tid-bars span { width: 5px; }
    .tid-card { flex-wrap: wrap; }
    .tid-card-arrow { display: none; }
    .stats-strip span { padding: 0.7rem 1rem; font-size: 0.55rem; }
    .stats-strip span + span::before { left: 15%; right: 15%; top: 0; bottom: auto; width: auto; height: 1px; }
    .btn { padding: 0.6rem 1.2rem; font-size: 0.8rem; }
    .tap-area { padding: 5rem 2rem; }
    .bpm-display, .tap-bpm { font-size: 4rem; }

    /* Drum machine mobile layout */
    .dm-grid { display: none; }
    .dm-pads { display: grid; }
    .dm-mobile-seq { display: flex; }
    .dm-transport { gap: 0.5rem; }
    .dm-transport .dm-ctrl-group { flex-wrap: wrap; }

    /* SEO components mobile */
    .steps-pills { flex-direction: column; align-items: stretch; }
    .step-pill { max-width: 100%; }
    .related-tools-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Auto-Master ─────────────────────────────── */
.slider-group { display: flex; flex-direction: column; gap: 0.25rem; }
.slider-label { font-size: 0.7rem; font-family: var(--mono-font); color: var(--text-dim); letter-spacing: 0.5px; }
.slider-ends { display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--text-muted); }
.slider-value { font-size: 0.7rem; font-family: var(--mono-font); color: var(--accent); text-align: center; }
.slider { width: 100%; accent-color: var(--accent); }
.ab-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ab-btn { padding: 0.35rem 0.75rem; font-size: 0.8rem; font-family: var(--mono-font); background: transparent; color: var(--text-dim); border: none; cursor: pointer; transition: background 0.2s, color 0.2s; }
.ab-btn.active { background: var(--accent); color: #fff; }
.ab-btn:hover:not(.active) { background: var(--accent-dim); }

@media (max-width: 600px) {
    #advanced-panel .slider-group { grid-template-columns: 1fr; }
    #results-section > div:first-child { grid-template-columns: 1fr !important; }
}

/* ── Song Analyzer ─────────────────────────────── */
.analyzer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 24px auto;
  max-width: 960px;
}
.analyzer-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.analyzer-card.wide { grid-column: span 2; }
.analyzer-card:nth-child(4) { grid-column: 1 / 3; }
.analyzer-card:nth-child(5) { grid-column: 3 / 4; }

.card-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.card-body { min-height: 80px; }

/* Skeleton shimmer */
.card-body.skeleton .skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(96,160,255,0.08) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  margin-bottom: 10px;
}
.card-body.skeleton .skeleton-line.short { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Result content fade-in */
.card-body.loaded { animation: cardFadeIn 0.3s ease; }
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Key card */
.key-result-value { font-size: 2.5rem; font-weight: 700; color: var(--text); }
.key-result-sub { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }

/* BPM card */
.bpm-result-value { font-size: 2.5rem; font-weight: 700; color: var(--text); }
.bpm-result-sub { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }

/* Chords card */
.chord-timeline { max-height: 200px; overflow-y: auto; font-size: 0.85rem; }
.chord-row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.chord-time { color: var(--text-dim); min-width: 50px; font-family: var(--font-mono); }
.chord-name { color: var(--text); font-weight: 600; }

/* MIDI card */
.midi-roll-container { height: 120px; border-radius: 6px; overflow: hidden; background: var(--bg-deep); }
.midi-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Stems card */
.stem-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stem-label { font-size: 0.8rem; color: var(--text-dim); min-width: 80px; }
.stem-waveform { flex: 1; height: 40px; background: var(--bg-deep); border-radius: 4px; overflow: hidden; }
.stem-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.stem-mobile-gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100px; color: var(--text-dim); text-align: center; font-size: 0.85rem;
}

/* Refined badge */
.badge-refined {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(96,160,255,0.12);
  color: var(--accent);
  margin-left: 8px;
  vertical-align: middle;
}

/* Card action buttons */
.card-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
}
.card-btn:hover { border-color: var(--accent); }

/* Card error state */
.card-error { color: var(--text-dim); font-size: 0.85rem; text-align: center; padding: 20px 10px; }

/* Card progress */
.card-progress { height: 3px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.card-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; width: 0%; }

/* Responsive: single column on mobile */
@media (max-width: 768px) {
  .analyzer-grid { grid-template-columns: 1fr; }
  .analyzer-card.wide,
  .analyzer-card:nth-child(4),
  .analyzer-card:nth-child(5) { grid-column: 1; }
}

/* ── OPFS cross-tool workflow ─────────────────── */
.opfs-suggestions { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.opfs-suggest-group { margin-bottom: 0.75rem; }
.opfs-suggestions-label { display: block; font-size: 0.7rem; font-family: var(--mono-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }
.opfs-suggest-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.opfs-suggest-btn { display: inline-block; padding: 0.35rem 0.75rem; font-size: 0.8rem; font-family: var(--mono-font); color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; transition: background 0.2s, color 0.2s; cursor: pointer; }
.opfs-suggest-btn:hover { background: var(--accent); color: #fff; }
.opfs-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.opfs-recent-label { font-size: 0.65rem; font-family: var(--mono-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.opfs-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.6rem; font-size: 0.75rem; font-family: var(--mono-font); color: var(--text-dim); background: transparent; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: border-color 0.2s, color 0.2s; white-space: nowrap; max-width: 220px; }
.opfs-chip span:first-child { overflow: hidden; text-overflow: ellipsis; }
.opfs-chip:hover { border-color: var(--accent); color: var(--accent); }
.opfs-chip-tag { font-size: 0.6rem; padding: 0.05rem 0.3rem; border-radius: 3px; font-weight: 600; letter-spacing: 0.03em; flex-shrink: 0; }
.opfs-chip-tag-turbo { background: rgba(96, 160, 255, 0.15); color: var(--accent); }
.opfs-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(1rem); padding: 0.6rem 1.2rem; font-size: 0.85rem; font-family: var(--mono-font); color: #fff; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; opacity: 0; transition: opacity 0.3s, transform 0.3s; z-index: 9999; pointer-events: none; }
.opfs-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Next-steps bar ──────────────────────────── */
.next-steps-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border); }
.next-steps-title { font-size: 0.7rem; font-family: var(--mono-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-right: 0.25rem; }
.next-steps-btn { padding: 0.35rem 0.85rem; font-size: 0.8rem; font-family: var(--mono-font); color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 6px; cursor: pointer; transition: background 0.2s, color 0.2s; white-space: nowrap; }
.next-steps-btn:hover { background: var(--accent); color: #fff; }

/* ── reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    /* Kill decorative animations entirely (0.01s doesn't stop them, just loops fast) */
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    /* Keep functional animations that communicate state */
    .upload-icon .bar         { animation: waveBar 1.4s ease-in-out infinite !important; }
    .spinner                  { animation: spin 0.9s linear infinite !important; }
    .progress-dot.active      { animation: dot-pulse 1.5s ease-in-out infinite !important; }
    .wbar                     { animation: wbar-wave 0.7s ease-in-out var(--d, 0s) infinite alternate !important; }
}

/* === Turbo Nav Button === */
.turbo-nav { position: relative; z-index: 10; }
.turbo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(96,160,255,0.08), rgba(168,85,247,0.08));
  border: 1px solid rgba(96,160,255,0.35);
  color: var(--accent); padding: 6px 14px; border-radius: 8px;
  font-family: var(--mono-font); font-size: 0.85rem;
  cursor: pointer; transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
.turbo-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(96,160,255,0.12), rgba(168,85,247,0.12));
  opacity: 0; transition: opacity 0.25s;
}
.turbo-btn:hover::before { opacity: 1; }
.turbo-btn:hover {
  border-color: rgba(96,160,255,0.6);
  box-shadow: 0 0 16px rgba(96,160,255,0.15), 0 0 4px rgba(168,85,247,0.1);
  transform: translateY(-1px);
}
.turbo-btn.turbo-active {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-color: transparent; color: #fff;
  box-shadow: 0 0 20px rgba(96,160,255,0.3), 0 0 40px rgba(168,85,247,0.15);
  animation: turbo-glow 2.5s ease-in-out infinite;
}
.turbo-btn.turbo-active::before { display: none; }
@keyframes turbo-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(96,160,255,0.3), 0 0 24px rgba(168,85,247,0.1); }
  50% { box-shadow: 0 0 20px rgba(96,160,255,0.5), 0 0 40px rgba(168,85,247,0.2); }
}
.turbo-icon { font-size: 1rem; filter: saturate(1.2); }

/* === Turbo Dropdown (Wallet) === */
.turbo-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 0; min-width: 280px;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); z-index: 100;
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(96,160,255,0.06);
  overflow: hidden;
}
.turbo-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}
/* Top accent bar */
.turbo-dropdown::before {
  content: ''; display: block; height: 2px;
  background: linear-gradient(90deg, var(--accent), #a855f7, var(--accent));
  background-size: 200% 100%;
  animation: turbo-gradient-slide 3s linear infinite;
}
@keyframes turbo-gradient-slide {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.turbo-dropdown-inner { padding: 16px; }
.turbo-user-row {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(96,160,255,0.1);
}
.turbo-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(96,160,255,0.15); flex-shrink: 0;
  object-fit: cover;
}
.turbo-user-name {
  flex: 1; font-size: 0.85rem; color: var(--text);
  font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.turbo-logout-btn {
  background: none; border: 1px solid rgba(96,160,255,0.15);
  color: var(--text-dim); font-size: 0.75rem; padding: 3px 10px;
  border-radius: 6px; cursor: pointer; flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
.turbo-logout-btn:hover {
  color: #ff6b6b; border-color: rgba(255,107,107,0.3);
}
.turbo-dropdown-header {
  font-family: var(--mono-font); font-size: 0.9rem;
  color: var(--text); margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.turbo-dropdown-header .turbo-icon { font-size: 0.9rem; }
.turbo-dropdown-balance {
  color: var(--accent); font-weight: 500;
}
.turbo-boosts, .turbo-pass-info {
  font-size: 0.8rem; color: var(--text-dim); margin-bottom: 8px;
}
.turbo-boosts .turbo-boosts-value {
  color: #22c55e; font-family: var(--mono-font); font-weight: 500;
}
.turbo-divider {
  border: none; border-top: 1px solid var(--border); margin: 12px 0;
}
.turbo-options-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-family: var(--heading-font); font-weight: 600;
  margin-bottom: 8px;
}
.plan-menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.plan-menu a {
  display: block; padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none;
  font-family: var(--body-font); font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.plan-menu a:hover {
  background: rgba(96,160,255,0.08); color: var(--accent);
}
.turbo-options { display: flex; flex-direction: column; gap: 8px; }
.turbo-option {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(96,160,255,0.04); border: 1px solid var(--border);
  color: var(--text); padding: 12px 14px; border-radius: 10px;
  font-family: var(--body-font); font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s ease;
  position: relative; text-decoration: none;
}
.turbo-option:hover {
  border-color: var(--accent);
  background: rgba(96,160,255,0.08);
  box-shadow: 0 2px 12px rgba(96,160,255,0.1);
}
.turbo-option:active { transform: scale(0.98); }
.turbo-option .turbo-option-name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.9rem;
}
.turbo-option > span:last-child {
  color: var(--text-dim); font-family: var(--mono-font); font-size: 0.8rem;
  font-weight: 400; white-space: nowrap;
}
.turbo-option .turbo-best-value {
  font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.8px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff; padding: 3px 8px; border-radius: 99px;
  font-family: var(--heading-font); font-weight: 700;
  line-height: 1.3; white-space: nowrap;
}
.turbo-option--recommended {
  border-color: rgba(96,160,255,0.25);
  background: rgba(96,160,255,0.06);
}
.turbo-option--recommended:hover {
  border-color: var(--accent);
  background: rgba(96,160,255,0.1);
  box-shadow: 0 2px 12px rgba(96,160,255,0.15);
}
.turbo-topup-btn {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff; font-family: var(--heading-font);
  font-size: 0.95rem; letter-spacing: 0.5px; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.turbo-topup-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.turbo-topup-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(96,160,255,0.25), 0 2px 8px rgba(168,85,247,0.15);
}
.turbo-topup-btn:hover::after { opacity: 1; }
.turbo-topup-btn:active { transform: translateY(0) scale(0.98); }

/* === Auth Modal === */
.turbo-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 500;
  backdrop-filter: blur(12px) saturate(0.8);
  -webkit-backdrop-filter: blur(12px) saturate(0.8);
}
.turbo-modal-overlay.open { display: flex; }
.turbo-modal {
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 20px; padding: 2.25rem 2rem 2rem;
  max-width: 420px; width: 92%;
  position: relative;
  animation: modal-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.4),
    0 0 0 1px rgba(96,160,255,0.1),
    0 0 60px rgba(96,160,255,0.06),
    0 0 120px rgba(168,85,247,0.04);
}
/* Gradient border effect via background-clip */
.turbo-modal::before {
  content: ''; position: absolute; inset: -1px;
  border-radius: 21px; padding: 1px;
  background: linear-gradient(160deg, rgba(96,160,255,0.35), rgba(168,85,247,0.2), rgba(96,160,255,0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.turbo-modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.turbo-modal-close:hover {
  color: var(--text); background: var(--accent-dim);
}
/* Modal header with bolt icon */
.turbo-modal-header-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin: 0 auto 12px;
  background: linear-gradient(135deg, rgba(96,160,255,0.12), rgba(168,85,247,0.12));
  border-radius: 14px; font-size: 1.5rem;
  box-shadow: 0 0 24px rgba(96,160,255,0.1);
}
.turbo-modal-title {
  font-family: var(--heading-font); font-size: 1.35rem;
  margin-bottom: 0.5rem; text-align: center;
  font-weight: 600; letter-spacing: 0.3px;
}
.turbo-modal-subtitle {
  text-align: center; color: var(--text-dim); font-size: 0.82rem;
  margin-bottom: 1.5rem; line-height: 1.4;
}

/* Auth buttons */
.turbo-auth-buttons { display: flex; flex-direction: column; gap: 10px; }
.turbo-auth-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 16px; border-radius: 12px;
  font-family: var(--body-font); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
  border: 1px solid var(--border); position: relative;
  background: var(--surface); color: var(--text);
}
.turbo-auth-btn:hover {
  border-color: rgba(96,160,255,0.4);
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.turbo-auth-btn:active { transform: translateY(0) scale(0.99); }
.turbo-auth-btn svg { flex-shrink: 0; }

/* "3 free boosts" banner — shared incentive above all auth methods */
.turbo-auth-bonus {
  font-size: 0.75rem;
  font-family: var(--heading-font); font-weight: 600;
  letter-spacing: 0.4px; text-transform: uppercase;
  text-align: center;
  background: linear-gradient(135deg, rgba(96,160,255,0.15), rgba(168,85,247,0.15));
  color: var(--accent);
  padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid rgba(96,160,255,0.2);
  margin-bottom: 1rem;
  animation: turbo-badge-glow 3s ease-in-out infinite;
}
@keyframes turbo-badge-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(96,160,255,0.1); }
  50% { box-shadow: 0 0 16px rgba(96,160,255,0.2), 0 0 4px rgba(168,85,247,0.1); }
}

/* Divider */
.turbo-auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--text-muted); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  font-family: var(--heading-font);
}
.turbo-auth-divider::before, .turbo-auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Email input */
.turbo-auth-email { display: flex; flex-direction: column; gap: 10px; }
.turbo-auth-input {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: var(--body-font); font-size: 0.9rem;
  outline: none; transition: all 0.2s ease; box-sizing: border-box;
}
.turbo-auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 12px rgba(96,160,255,0.06);
}
.turbo-auth-input::placeholder { color: var(--text-muted); }
.turbo-auth-send {
  background: linear-gradient(135deg, var(--accent), #7c6bff);
  color: #fff; border: none; font-weight: 500;
  box-shadow: 0 2px 8px rgba(96,160,255,0.2);
}
.turbo-auth-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(96,160,255,0.3);
}
.turbo-auth-send:active { transform: translateY(0) scale(0.98); }

/* Footer */
.turbo-auth-footer {
  text-align: center; color: var(--text-muted); font-size: 0.78rem;
  margin-top: 18px; display: flex; align-items: center;
  justify-content: center; gap: 6px;
}
.turbo-auth-footer-lock {
  display: inline-flex; opacity: 0.5;
}
/* OTP code input */
.turbo-auth-code-input {
  text-align: center; font-size: 1.6rem; letter-spacing: 0.25em;
  font-family: var(--mono-font); font-weight: 700;
}
.turbo-auth-code-msg {
  color: var(--text-dim); font-size: 0.85rem; margin: 0 0 12px; text-align: center;
}
.turbo-auth-code-msg strong { color: var(--text); }
.turbo-auth-resend-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 0.82rem; font-family: inherit; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.turbo-auth-resend-btn:disabled { opacity: 0.4; cursor: default; }

/* === Light theme overrides === */
[data-theme="light"] .turbo-btn {
  background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(168,85,247,0.04));
  border-color: rgba(79,70,229,0.3);
}
[data-theme="light"] .turbo-btn:hover {
  border-color: rgba(79,70,229,0.5);
  box-shadow: 0 0 16px rgba(79,70,229,0.1);
}
[data-theme="light"] .turbo-btn.turbo-active {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  box-shadow: 0 0 20px rgba(79,70,229,0.2);
}
[data-theme="light"] .turbo-dropdown {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 0 0 1px rgba(79,70,229,0.06);
}
[data-theme="light"] .turbo-dropdown::before {
  background: linear-gradient(90deg, var(--accent), #7c3aed, var(--accent));
  background-size: 200% 100%;
}
[data-theme="light"] .turbo-modal {
  box-shadow:
    0 24px 80px rgba(0,0,0,0.1),
    0 0 0 1px rgba(79,70,229,0.08),
    0 0 40px rgba(79,70,229,0.04);
}
[data-theme="light"] .turbo-modal::before {
  background: linear-gradient(160deg, rgba(79,70,229,0.25), rgba(168,85,247,0.15), rgba(79,70,229,0.08));
}
[data-theme="light"] .turbo-auth-bonus {
  background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(124,59,237,0.1));
  border-color: rgba(79,70,229,0.2);
}
[data-theme="light"] .turbo-auth-send {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
}
[data-theme="light"] .turbo-topup-btn {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
}

/* === Turbo Nudge === */
.turbo-nudge {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.turbo-nudge.hidden { display: none; }
.turbo-nudge-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem; max-width: 380px; width: 90vw;
  animation: modal-in 0.2s ease-out;
}
.turbo-nudge-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 1rem;
}
.turbo-nudge-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.turbo-cap-green  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.turbo-cap-yellow { background: #eab308; box-shadow: 0 0 6px rgba(234,179,8,0.4); }
.turbo-cap-red    { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.turbo-nudge-title {
  font-family: var(--heading-font); font-size: 1rem; font-weight: 600;
}
.turbo-nudge-comparison {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 1.25rem;
}
.turbo-nudge-eta {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; border-radius: 8px; border: 1px solid var(--border);
}
.turbo-nudge-server {
  border-color: var(--accent); background: rgba(96,160,255,0.05);
}
.turbo-nudge-label {
  font-size: 0.75rem; color: var(--text-dim); margin-bottom: 4px;
}
.turbo-nudge-time {
  font-family: var(--mono-font); font-size: 1.1rem; font-weight: 600;
}
.turbo-nudge-server .turbo-nudge-time { color: var(--accent); }
.turbo-nudge-actions { display: flex; gap: 8px; }
.turbo-nudge-actions .btn { flex: 1; padding: 10px 12px; font-size: 0.85rem; }
.turbo-nudge-blocked {
  text-align: center; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1rem;
}
.turbo-nudge-badge {
  font-size: 0.65rem; font-weight: 600; color: var(--accent);
  margin-top: 4px; letter-spacing: 0.5px;
}
.turbo-cap-yellow, .turbo-cap-red {
  animation: turbo-pulse 2s ease-in-out infinite;
}
@keyframes turbo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Turbo progress overlay — shown during server-side processing */
/* Old turbo-progress-overlay removed — all progress uses inline ProcessingTracker waveform UI */

/* ── Choice screen — browser vs turbo two-card choice ──────────────── */
.turbo-choice-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.turbo-choice-overlay.hidden { display: none; }
.turbo-choice-container {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; max-width: 520px; width: 92vw;
  animation: modal-in 0.2s ease-out;
}
.turbo-choice-heading {
  text-align: center; font-family: var(--heading-font);
  font-size: 1.1rem; font-weight: 600; margin: 0 0 1.25rem;
}
.turbo-choice-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.turbo-choice-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.turbo-choice-card:hover {
  border-color: var(--text-dim);
}
.turbo-choice-accent {
  border-color: var(--accent);
  background: rgba(96,160,255,0.04);
}
.turbo-choice-accent:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(96,160,255,0.15);
}
.choice-card-disabled {
  opacity: 0.4; pointer-events: none;
}
.choice-card-icon {
  font-size: 1.8rem; margin-bottom: 0.5rem;
}
.choice-card-title {
  font-family: var(--heading-font); font-size: 0.95rem;
  font-weight: 600; margin-bottom: 0.5rem;
}
.choice-card-eta {
  font-family: var(--mono-font); font-size: 0.85rem;
  color: var(--text-dim); margin-bottom: 0.5rem; min-height: 1.2em;
}
.choice-card-privacy {
  font-size: 0.72rem; color: var(--text-dim);
  margin-bottom: 0.75rem; line-height: 1.3;
}
.choice-card-btn {
  width: 100%; padding: 8px 12px; font-size: 0.85rem;
  margin-top: auto;
}
.turbo-choice-warning {
  text-align: center; font-size: 0.78rem; color: #eab308;
  margin-top: 1rem; padding: 0.5rem; border-radius: 6px;
  background: rgba(234,179,8,0.08);
}
.turbo-choice-warning.hidden { display: none; }
@media (max-width: 480px) {
  .turbo-choice-cards { grid-template-columns: 1fr; }
}

/* ── Processing mode badge ─────────────────────────────────────────── */
.processing-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 8px;
  font-size: 0.85rem; margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}
.processing-badge.hidden { display: none; }
.badge-local {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #22c55e;
}
.badge-turbo {
  background: rgba(96,160,255,0.1);
  border: 1px solid rgba(96,160,255,0.3);
  color: var(--accent);
}
.badge-sub {
  font-size: 0.75rem; opacity: 0.7; margin-left: auto;
}
[data-theme="light"] .badge-local { background: rgba(34,197,94,0.08); color: #16a34a; }
[data-theme="light"] .badge-turbo { background: rgba(79,70,229,0.08); color: var(--accent); }

/* ── Escape hatch — switch to turbo mid-processing ─────────────────── */
.escape-hatch {
  text-align: center; margin-top: 0.75rem;
  transition: opacity 0.3s ease;
}
.escape-hatch.hidden { display: none; }
.escape-hatch-btn {
  background: transparent; border: 1px solid var(--accent);
  color: var(--accent); padding: 0.4rem 1rem; border-radius: 6px;
  cursor: pointer; font-size: 0.85rem; transition: all 0.2s ease;
}
.escape-hatch-btn:hover {
  background: rgba(96,160,255,0.1);
}

/* ── Mashup Maker ──────────────────────────────────────────────────── */
.mashup-drop { min-height: 160px; display: flex; align-items: center; justify-content: center; }

.mashup-fader-col {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1rem; background: var(--bg-deep); border-radius: 8px;
}
.mashup-fader {
    writing-mode: vertical-lr;
    direction: rtl;
    height: 120px; width: 32px;
    accent-color: var(--accent);
}

.badge { padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.75rem; background: var(--bg-deep); }
.badge-green { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.badge-yellow { background: rgba(234,179,8,0.12); color: #eab308; border: 1px solid rgba(234,179,8,0.3); }
.badge-red { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 1.5rem; max-width: 90vw;
}

@media (max-width: 640px) {
    .mashup-faders { grid-template-columns: repeat(2, 1fr) !important; }
    .mashup-fader { height: 80px; }
}

/* Lossless Checker */
/* Spectrogram toolbar */
.spectrogram-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.toolbar-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-right: 0.15rem;
    user-select: none;
}
.overlay-toggle,
.zoom-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    padding: 0.2rem 0.5rem 0.2rem 0.35rem;
    height: 28px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    line-height: 1;
}
.overlay-toggle:hover,
.zoom-reset:hover {
    color: var(--text);
    border-color: var(--text-muted);
}
.overlay-toggle.active {
    color: #fff;
    border-color: transparent;
}
.overlay-toggle[data-layer="cutoff"].active  { background: rgba(255, 64, 64, 0.25); border-color: rgba(255, 64, 64, 0.5); color: #ff6060; }
.overlay-toggle[data-layer="holes"].active   { background: rgba(255, 160, 0, 0.2); border-color: rgba(255, 160, 0, 0.5); color: #ffa000; }
.overlay-toggle[data-layer="sbr"].active     { background: rgba(60, 120, 255, 0.2); border-color: rgba(60, 120, 255, 0.5); color: #5a9aff; }
.overlay-toggle[data-layer="preecho"].active { background: rgba(255, 230, 0, 0.18); border-color: rgba(255, 230, 0, 0.5); color: #ffe600; }
.overlay-toggle.overlay-no-data {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}
.overlay-toggle.overlay-no-data .ol-swatch { opacity: 0.3; }
.overlay-toggle.overlay-no-data .ol-label::after {
    content: " \2013  n/a";
    font-size: 0.6rem;
    opacity: 0.7;
}
.ol-swatch {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    flex-shrink: 0;
}
.ol-label {
    white-space: nowrap;
}
.toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 0.2rem;
}
/* Spectrogram legend strip */
.spectrogram-legend {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.35rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.legend-swatch {
    display: inline-block;
    width: 10px;
    height: 3px;
    border-radius: 1px;
    flex-shrink: 0;
}
.legend-sep {
    width: 1px;
    height: 12px;
    background: var(--border);
}
.legend-hint {
    color: var(--text-muted);
    opacity: 0.7;
}
/* Verdict guide */
.verdict-guide {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
    background: var(--bg-card);
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text);
    margin: 0.25rem 0 0.75rem;
}
.verdict-guide strong {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}
.verdict-guide-clean      { border-left-color: #16a34a; }
.verdict-guide-transcoded { border-left-color: #dc2626; }
.verdict-guide-upsampled  { border-left-color: #ea580c; }
.verdict-guide-upscaled   { border-left-color: #ea580c; }
.verdict-guide ul {
    margin: 0.4rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.78rem;
}
.verdict-guide li {
    margin-bottom: 0.15rem;
}
.spectrogram-wrap {
    margin: 1.5rem 0 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    position: relative;
}
#overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
#spectrogram-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
}
.freq-slider-wrap {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3;
    gap: 0.25rem;
    padding: 4px 0;
}
.freq-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    appearance: slider-vertical;
    width: 20px;
    height: calc(50% - 8px);
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}
.spectrogram-wrap:hover .freq-slider {
    opacity: 0.7;
}
.freq-slider:active {
    opacity: 1 !important;
}
.zoom-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 4;
}
.zoom-toast.visible {
    opacity: 1;
}
.lossless-result-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 0 0.75rem;
}
.lossless-result-panel .btn { align-self: flex-start; }
/* JS sets className = 'verdict verdict-{clean|transcoded|...}' */
.verdict,
.verdict-badge {
    display: inline-block;
    padding: 0.45rem 1.4rem;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    align-self: flex-start;
}
.verdict-clean      { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; box-shadow: 0 2px 12px rgba(22, 163, 74, 0.3); }
.verdict-transcoded { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3); }
.verdict-upsampled  { background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff; box-shadow: 0 2px 12px rgba(234, 88, 12, 0.3); }
.verdict-upscaled   { background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff; box-shadow: 0 2px 12px rgba(234, 88, 12, 0.3); }
.verdict-unknown    { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }
.verdict-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 40rem;
    line-height: 1.5;
}
/* Metadata grid — card-based grouped metrics */
.file-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 2px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
}
.file-meta dt {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0.65rem 0;
    background: var(--bg-card);
    line-height: 1;
}
.file-meta dd {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    padding: 0.15rem 0.65rem 0.55rem;
    background: var(--bg-card);
    line-height: 1.3;
}
.meta-line {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}
/* Spectrogram reading guide — reuses faq-item styling */
.content-section {
    max-width: 720px;
    margin: 3rem auto 0;
    padding: 2rem 0 0;
}
.content-section h2 {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.content-section > p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.content-section table {
    border-collapse: collapse;
    font-size: 0.8rem;
}
.content-section th {
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}
.content-section td {
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
    color: var(--text-muted);
}

/* -- Stem Player --------------------------------------------------------- */
:root {
  --stem-vocals: #c9a0ff;
  --stem-instrumental: #50d890;
}
[data-theme="light"] {
  --stem-vocals: #7c4dff;
  --stem-instrumental: #2e7d32;
}

.stem-player {
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(96, 160, 255, 0.1);
}

.stem-row {
  display: grid;
  grid-template-columns: 36px 88px 1fr 100px 36px;
  gap: 10px;
  align-items: center;
  height: 56px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.stem-row:last-of-type {
  border-bottom: none;
}

.stem-mute-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--stem-color) 30%, transparent);
  background: color-mix(in srgb, var(--stem-color) 15%, transparent);
  color: var(--stem-color);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.stem-mute-btn:hover {
  background: color-mix(in srgb, var(--stem-color) 25%, transparent);
}
.stem-mute-btn.muted {
  opacity: 0.4;
}

.stem-label {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stem-wave-wrap {
  height: 40px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.stem-wave {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stem-vol {
  width: 90px;
  cursor: pointer;
}

.stem-download {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
}
.stem-download:hover {
  color: var(--accent);
  background: rgba(96, 160, 255, 0.1);
}

.stem-transport {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.stem-transport-btn {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.stem-transport-btn:hover {
  filter: brightness(1.15);
}

.stem-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  min-width: 80px;
}

.stem-filename {
  flex: 1;
  text-align: right;
  font-size: 0.65rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .stem-row {
    grid-template-columns: 36px 1fr 36px;
    grid-template-rows: auto auto;
    height: auto;
    padding: 8px 12px;
    gap: 6px;
  }
  .stem-label {
    grid-column: 2;
  }
  .stem-wave-wrap {
    grid-column: 1 / -1;
    height: 36px;
  }
  .stem-vol {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ── Trust badges ─────────────────────────────────────────── */
.upload-trust-badge{text-align:center;font-size:.72rem;color:var(--text-dim);margin-top:.5rem}
.trust-badge-main{display:flex;align-items:center;justify-content:center;gap:.25rem}
.trust-badge-main svg{flex-shrink:0}
.trust-badge-device{font-size:.65rem;color:var(--text-muted);margin-top:.15rem}
.processing-trust-badge{display:flex;align-items:center;justify-content:center;gap:.25rem;font-size:.7rem;color:var(--text-dim);margin-top:.5rem}

/* ── Cloud confirm dialog ─────────────────────────────────── */
.cloud-confirm-overlay{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px)}
.cloud-confirm-modal{background:var(--bg-card);border:1px solid var(--border);border-radius:1rem;padding:1.5rem 2rem;max-width:380px;width:90%;text-align:center}
.cloud-confirm-modal h3{margin:0 0 .75rem;font-size:1.1rem}
.cloud-confirm-modal p{margin:0 0 1.25rem;font-size:.85rem;color:var(--text-muted);line-height:1.5}
.cloud-confirm-actions{display:flex;gap:.75rem;justify-content:center}

/* ── Processing router — override modal ───────────────────── */
.override-modal-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.6);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center}
.override-modal-overlay.hidden{display:none}
.override-modal{background:var(--bg-card);border-radius:12px;padding:1.5rem;max-width:400px;width:90%;box-shadow:0 8px 32px rgba(0,0,0,.3)}
.override-modal h3{margin:0 0 .5rem}
.override-modal p{color:var(--text-muted);font-size:.85rem;margin-bottom:1rem}
.override-btn{display:flex;flex-direction:column;width:100%;text-align:left;padding:.75rem 1rem;margin-bottom:.5rem;border-radius:8px;border:1px solid var(--border);background:transparent;cursor:pointer;color:var(--text);font-size:.9rem}
.override-btn:hover{border-color:var(--accent)}
.override-active{border-color:var(--accent);background:rgba(96,160,255,.08)}
.override-sub{font-size:.75rem;color:var(--text-dim);margin-top:.25rem}
.override-premium{opacity:.7}

/* Clickable trust badge */
.badge-clickable{cursor:pointer}
.badge-clickable:hover .trust-badge-main{color:var(--accent)}

.track-badge{display:inline-block;padding:2px 8px;border-radius:99px;font-size:.75rem;font-weight:500;background:rgba(96,160,255,.12);color:var(--accent,#60a0ff);font-family:var(--font-mono,'DM Mono',monospace);white-space:nowrap}

/* ── Track Shelf ──────────────────────────────────────────────────────── */
.track-shelf{position:relative;display:inline-block}
.track-shelf[hidden]{display:none}
.track-shelf-btn{display:flex;align-items:center;gap:6px;background:rgba(96,160,255,.12);border:1px solid rgba(96,160,255,.2);border-radius:8px;padding:5px 12px;color:#60a0ff;font-weight:600;font-size:12px;cursor:pointer;font-family:inherit;transition:border-color .2s}
.track-shelf-btn:hover{border-color:rgba(96,160,255,.4)}
.track-shelf-icon{font-size:14px}
.track-shelf-count{background:#60a0ff;color:#fff;border-radius:99px;padding:1px 7px;font-size:10px;font-weight:700;min-width:16px;text-align:center}
.track-shelf-dropdown{position:absolute;right:0;top:calc(100% + 8px);width:300px;background:#111130;border:1px solid rgba(96,160,255,.15);border-radius:12px;overflow:hidden;box-shadow:0 12px 32px rgba(0,0,0,.5);z-index:200;animation:trackShelfIn .2s ease}
.track-shelf-header{padding:8px 14px;color:#888;font-size:10px;text-transform:uppercase;letter-spacing:1px;font-weight:600}
.track-shelf-card{padding:10px 14px;border-bottom:1px solid rgba(255,255,255,.04);cursor:pointer;display:flex;align-items:center;gap:10px;transition:background .15s}
.track-shelf-card:hover{background:rgba(96,160,255,.06)}
.track-shelf-card--active{background:rgba(96,160,255,.06)}
.track-shelf-card--expired{opacity:.5}
.track-shelf-avatar{width:32px;height:32px;border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:#fff;font-size:14px}
.track-shelf-card-info{flex:1;min-width:0}
.track-shelf-card-name{color:#eee;font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track-shelf-card-duration{color:#555;font-size:10px;font-weight:400;margin-left:6px}
.track-shelf-card-badges{display:flex;gap:4px;margin-top:3px;flex-wrap:wrap}
.track-badge--turbo{background:rgba(168,85,247,.12);color:#a855f7}
.track-shelf-empty{padding:16px 14px;text-align:center;color:#555;font-size:12px;font-style:italic}
.track-shelf-footer{padding:8px 14px;background:rgba(255,255,255,.02);text-align:center;border-top:1px solid rgba(255,255,255,.04)}
.track-shelf-footer a{color:#60a0ff;text-decoration:none;font-size:11px;font-weight:500}
.track-shelf-footer a:hover{text-decoration:underline}
@keyframes trackShelfIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:640px){.track-shelf-label{display:none}.track-shelf-dropdown{width:90vw;right:-40px}}
[data-theme="light"] .track-shelf-btn{background:rgba(79,70,229,.08);border-color:rgba(79,70,229,.15);color:#4f46e5}
[data-theme="light"] .track-shelf-count{background:#4f46e5}
[data-theme="light"] .track-shelf-dropdown{background:rgba(255,255,255,.95);border-color:rgba(79,70,229,.15);box-shadow:0 8px 24px rgba(0,0,0,.1)}
[data-theme="light"] .track-shelf-card:hover{background:rgba(79,70,229,.04)}
[data-theme="light"] .track-shelf-card--active{background:rgba(79,70,229,.06)}
[data-theme="light"] .track-shelf-card-name{color:#1a1a2e}
[data-theme="light"] .track-badge--turbo{background:rgba(168,85,247,.08);color:#7c3aed}

/* ═══════════════════════════════════════════════════════
   SET PAGES — /sets/{slug} tracklist pages
   ═══════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────── */
.set-hero {
    position: relative;
    padding: 3rem 0 2rem;
    margin: -1rem calc(-1 * var(--page-gutter, 1rem)) 0;
    padding-left: var(--page-gutter, 1rem);
    padding-right: var(--page-gutter, 1rem);
    overflow: hidden;
}
.set-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.3);
    z-index: -1;
    transform: scale(1.1);
}
.set-hero h1 {
    font-size: 2rem;
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.set-hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    margin: 0.25rem 0 0.75rem;
}
.set-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.set-hero-stat {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

/* ── YouTube Embed + Now Playing ────────────────── */
.set-embed-wrap {
    position: relative;
    margin: 1.5rem 0 0;
}
.set-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    background: var(--bg-card, #111);
}
.set-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
/* Now Playing overlay — bottom of embed */
.set-nowplaying {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.75rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 0 0 10px 10px;
    opacity: 0;
    transition: opacity 0.3s;
    min-height: 2rem;
}
.set-nowplaying.set-np-visible {
    opacity: 1;
}
.set-np-label {
    font-family: var(--mono-font);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}
.set-np-track {
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.set-np-meta {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Track Timeline ─────────────────────────────── */
.set-timeline-wrap {
    margin: 0 0 1rem;
}
.set-timeline {
    position: relative;
    height: 32px;
    background: var(--bg-card, #111);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}
.set-tl-seg {
    position: absolute;
    top: 0;
    height: 100%;
    transition: opacity 0.2s, filter 0.2s;
    border-right: 1px solid rgba(0,0,0,0.3);
    opacity: 0.7;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 4px;
}
.set-tl-seg:hover {
    opacity: 1;
    filter: brightness(1.3);
    z-index: 1;
}
.set-tl-seg.seg-active {
    opacity: 1;
    filter: brightness(1.2);
}
/* Chapter label inside segment */
.set-tl-label {
    font-family: var(--mono-font);
    font-size: 0.5rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    letter-spacing: 0.3px;
}
.set-tl-seg.seg-active .set-tl-label {
    color: #fff;
    font-weight: 600;
}
.set-tl-seg.seg-first   { background: rgba(96, 160, 255, 0.5); }
.set-tl-seg.seg-ok       { background: rgba(74, 222, 128, 0.45); }
.set-tl-seg.seg-tension  { background: rgba(245, 158, 11, 0.45); }
.set-tl-seg.seg-clash    { background: rgba(239, 68, 68, 0.45); }
.set-tl-seg.seg-unknown  { background: rgba(255, 255, 255, 0.12); }

.set-tl-playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
    z-index: 2;
    transition: left 0.25s linear;
    pointer-events: none;
}
.set-tl-times {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono-font);
    font-size: 0.55rem;
    color: var(--text-muted);
    padding: 0.2rem 0.1rem 0;
}

/* ── Scoring Section ───────────────────────────── */
.set-scoring {
    padding: 1rem 0;
}
.set-scoring .flow-bar-row {
    gap: 0.75rem;
}
.set-grade {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
}
.set-grade.score-green { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.set-grade.score-blue  { background: rgba(96, 160, 255, 0.15); color: #60a0ff; }
.set-grade.score-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.set-grade.score-red   { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.set-sub-scores {
    grid-template-columns: repeat(3, 1fr);
}

/* ── Stats Strip ───────────────────────────────── */
.set-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}
.set-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.set-stat-label {
    font-family: var(--mono-font);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}
.set-stat-value {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

/* ── Section Titles ────────────────────────────── */
/* ── Narrative ──────────────────────────────────── */
.set-narrative {
    position: relative;
    display: flex;
    gap: 0;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(135deg,
            rgba(96, 160, 255, 0.07) 0%,
            rgba(100, 80, 200, 0.05) 40%,
            rgba(96, 160, 255, 0.02) 100%),
        var(--surface);
    border: 1px solid rgba(96, 160, 255, 0.15);
    box-shadow:
        0 2px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.set-narrative-accent {
    width: 4px;
    flex-shrink: 0;
    background: linear-gradient(180deg,
        var(--accent),
        rgba(100, 80, 200, 0.7),
        rgba(96, 160, 255, 0.3));
}
.set-narrative-body {
    position: relative;
    padding: 1.8rem 2rem 1.8rem 1.6rem;
}
.set-narrative-quote {
    position: absolute;
    top: 0.4rem;
    left: 0.8rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    opacity: 0.25;
    pointer-events: none;
    user-select: none;
}
.set-narrative p {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text);
    margin: 0 0 1rem;
    max-width: 72ch;
    letter-spacing: 0.01em;
}
.set-narrative p:last-child {
    margin-bottom: 0;
}
.set-narrative p:first-of-type::first-line {
    font-weight: 600;
    letter-spacing: 0.02em;
}
.set-narrative p:first-of-type::first-letter {
    font-family: var(--heading-font);
    font-size: 2.4rem;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin: 0.1rem 0.5rem 0 0;
    color: var(--accent);
}
[data-theme="light"] .set-narrative {
    background:
        linear-gradient(135deg,
            rgba(79, 70, 229, 0.05) 0%,
            rgba(79, 70, 229, 0.02) 50%,
            transparent 100%),
        var(--surface);
    border-color: rgba(79, 70, 229, 0.15);
}
[data-theme="light"] .set-narrative p::first-letter {
    color: var(--accent);
}

/* ── Section Titles ────────────────────────────── */
.set-section {
    padding: 1.5rem 0 0.5rem;
}
.set-section-title {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0;
}
.set-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

/* ── Export ─────────────────────────────────────── */
.set-export {
    position: relative;
}
.set-export-btn {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.set-export-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.set-export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.3rem;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 10;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.set-export-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.set-export-menu button {
    display: block;
    width: 100%;
    text-align: left;
    font-family: var(--mono-font);
    font-size: 0.65rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.set-export-menu button:hover {
    background: var(--accent-dim);
    color: var(--accent);
}
.set-export-menu button + button {
    border-top: 1px solid var(--border);
}
.set-export-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    font-family: var(--mono-font);
    font-size: 0.7rem;
    padding: 0.5rem 1.2rem;
    background: var(--surface-solid);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
    pointer-events: none;
}
.set-export-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Tracklist ─────────────────────────────────── */
.set-tracklist {
    display: flex;
    flex-direction: column;
    gap: 2px;
    counter-reset: track;
}
.set-track {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-radius: 6px;
    background:
        linear-gradient(135deg,
            hsla(var(--hue), 40%, 50%, 0.04) 0%,
            transparent 60%),
        var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.25s, transform 0.2s, box-shadow 0.3s;
}
.set-track:nth-child(even) {
    background:
        linear-gradient(135deg,
            hsla(var(--hue), 40%, 50%, 0.04) 0%,
            transparent 60%),
        var(--surface-solid);
}
.set-track:hover {
    border-color: hsla(var(--hue), 60%, 60%, 0.4);
    transform: translateX(3px);
    box-shadow:
        -3px 0 0 hsla(var(--hue), 60%, 60%, 0.5),
        0 2px 12px rgba(0,0,0,0.15);
    z-index: 1;
}
.set-track:hover .set-track-shine {
    opacity: 1;
}
.set-track-active {
    border-color: var(--accent) !important;
    background:
        linear-gradient(135deg,
            rgba(96,160,255,0.08) 0%,
            transparent 60%),
        var(--surface);
    box-shadow:
        -3px 0 0 var(--accent),
        0 0 16px var(--accent-glow),
        inset 0 0 30px rgba(96,160,255,0.03);
    transform: translateX(3px);
}
.set-track-active .set-track-pos {
    color: var(--accent);
}
/* Shine sweep on hover */
.set-track-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 40%,
        rgba(255,255,255,0.03) 45%,
        rgba(255,255,255,0.05) 50%,
        rgba(255,255,255,0.03) 55%,
        transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.set-track-unid {
    opacity: 0.35;
}
.set-track-unid:hover { transform: none; box-shadow: none; }

/* Gutter: position number + harmonic dot */
.set-track-gutter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 2.5rem;
    padding: 0.6rem 0;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}
.set-track-pos {
    font-family: var(--heading-font);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.2s;
}
.set-track:hover .set-track-pos {
    color: hsla(var(--hue), 60%, 70%, 1);
}
.set-track-info {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.set-track-row-top {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    justify-content: space-between;
}
.set-track-row-bottom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}
.set-track-name {
    font-size: 0.82rem;
    color: var(--text);
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.set-track-artist {
    font-weight: 600;
}
.set-track-sep {
    color: var(--text-muted);
    margin: 0 0.15rem;
    font-weight: 300;
}
.set-track-title {
    font-weight: 400;
    color: var(--text-dim);
}
.set-track:hover .set-track-title { color: var(--text); }
.set-track-unid-label {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.set-track-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* ── Pills (redesigned) ───────────────────────── */
.set-pill {
    font-family: var(--mono-font);
    font-size: 0.55rem;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}
.set-pill-bpm {
    border-color: rgba(96, 160, 255, 0.25);
    color: var(--accent);
    background: rgba(96, 160, 255, 0.06);
}
.set-pill-key {
    border-color: rgba(74, 222, 128, 0.25);
    color: #4ade80;
    background: rgba(74, 222, 128, 0.06);
}
.set-pill-year {
    border-color: var(--border);
    color: var(--text-muted);
}
.set-pill-time {
    border-color: rgba(96, 160, 255, 0.2);
    color: var(--text-muted);
    background: rgba(96, 160, 255, 0.04);
    cursor: pointer;
    font-weight: 500;
}
.set-pill-time:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(96, 160, 255, 0.1);
    box-shadow: 0 0 6px rgba(96, 160, 255, 0.2);
}

/* ── Harmonic Dot ──────────────────────────────── */
.set-harmonic-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.set-harmonic-ok      { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.set-harmonic-tension { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.set-harmonic-clash   { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }

/* ── Store Links ───────────────────────────────── */
/* Each icon uses its own brand fill colors (baked into the SVGs); CSS here just
   handles sizing, alignment, and hover. Matched heights (22px) keep the flex row
   baseline clean across the wordmark + square icons. */
.set-store-links {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    white-space: nowrap;
}
.set-store-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.15s, filter 0.15s;
}
.set-store-link:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}
.set-store-link svg {
    display: block;
    width: 22px;
    height: 22px;
}

/* Beatport wordmark — wider than tall; keep height in line with square icons. */
.set-store-link--beatport {
    color: #94D500;
}
.set-store-link--beatport svg {
    width: 70px;
    height: 19px;
}
.set-store-link--beatport:hover {
    color: #A4E510;
    filter: drop-shadow(0 1px 4px rgba(148, 213, 0, 0.4));
}

/* Apple Music — subordinate to Beatport. Smaller + muted so the purchase CTA stays dominant. */
.set-store-link--apple {
    opacity: 0.7;
}
.set-store-link--apple svg {
    width: 16px;
    height: 16px;
}
.set-store-link--apple:hover {
    opacity: 1;
}

/* ── Related & Cross-Links ─────────────────────── */
.set-related {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.set-related-link {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
}
.set-related-link:hover { color: var(--accent); }
.set-related-grade {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}
.set-related-shared {
    font-family: var(--mono-font);
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    opacity: 0.7;
}

/* ── Track Cross-Link Badges ─────────────────────── */
.set-pill-shared {
    border-color: rgba(168, 130, 255, 0.25);
    color: #a882ff;
    background: rgba(168, 130, 255, 0.06);
}
.set-pill-expand {
    cursor: pointer;
}
.set-pill-expand:hover {
    color: #c4a8ff;
    border-color: rgba(168, 130, 255, 0.5);
    background: rgba(168, 130, 255, 0.12);
}
.set-pill-expand[aria-expanded="true"] {
    background: rgba(168, 130, 255, 0.15);
    border-color: rgba(168, 130, 255, 0.4);
}
.track-appearances {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    padding: 0.3rem 0 0;
    width: 100%;
}
.track-app-link {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid var(--border);
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.track-app-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.track-app-more {
    font-size: 0.65rem;
    color: var(--text-muted);
    align-self: center;
}
.set-crosslinks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1.5rem 0;
}

/* ── Platform Pill ─────────────────────────────── */
.platform-pill {
    font-family: var(--mono-font);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    background: var(--accent-dim, rgba(96,160,255,0.1));
    color: var(--accent);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   SETS HUB — /sets browsing page
   ═══════════════════════════════════════════════════════ */
.sets-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.sets-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.sets-platforms .pill-count {
    font-size: 0.55rem;
    opacity: 0.6;
    margin-left: 0.2rem;
}
.sets-sort select {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}

/* ── Set Cards Grid ────────────────────────────── */
.sets-grid {
    display: grid;
    /* minmax(0, 1fr) lets columns shrink below their content's min-content;
       without it, long unwrapping titles inside cards expand the track and
       blow out main's max-width on wide viewports. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.sets-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.15s;
}
.sets-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.sets-card-thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--bg-card, #111);
}
.sets-card-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sets-card-grade {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    backdrop-filter: blur(4px);
}
.sets-card-grade.score-green { background: rgba(74,222,128,0.2); color: #4ade80; }
.sets-card-grade.score-blue  { background: rgba(96,160,255,0.2); color: #60a0ff; }
.sets-card-grade.score-amber { background: rgba(245,158,11,0.2); color: #f59e0b; }
.sets-card-grade.score-red   { background: rgba(239,68,68,0.2); color: #ef4444; }

.sets-card-body {
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.sets-card-dj {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sets-card-event {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sets-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    font-family: var(--mono-font);
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────
   PHASE 2 — facet hubs, pagination, card cross-link tags
   Refined neon-brutalist accents on the existing navy-violet base.
   ───────────────────────────────────────────────────────── */

/* ── Facet hub hero (platform + genre pages) ── */
.sets-facet-hero {
    position: relative;
}
.sets-facet-eyebrow {
    display: block;
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.65;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    margin-bottom: 0.4rem;
}
.sets-facet-title h1 {
    margin: 0;
    line-height: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.sets-facet-name {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: clamp(2.6rem, 7.5vw, 5rem);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    line-height: 0.95;
}
.sets-facet-suffix {
    font-family: var(--mono-font);
    font-weight: 400;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding-left: 0.15em;
}
.sets-facet-meta {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0.85rem 0 0;
    font-family: var(--mono-font);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.sets-facet-count {
    color: var(--text);
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}
.sets-facet-meta-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.65rem;
}
.sets-facet-meta-sep {
    color: var(--accent);
    opacity: 0.4;
    margin: 0 0.2rem;
}
.sets-facet-page {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}
.sets-facet-page-of {
    color: var(--text-muted);
}

/* ── Pagination — number-as-typography + animated arrows ── */
.sets-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2.5rem 0 1.5rem;
    font-family: var(--mono-font);
    position: relative;
}
.sets-pagination::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 80%);
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--border) 18%,
        var(--border) 82%,
        transparent 100%
    );
    z-index: 0;
}
.sets-pagination > * {
    position: relative;
    z-index: 1;
    background: var(--bg);
    padding: 0 0.5rem;
}
.sets-pagination-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text);
    text-decoration: none;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sets-pagination-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.sets-pagination-arrow {
    display: inline-block;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sets-pagination-prev:hover .sets-pagination-arrow {
    transform: translateX(-3px);
}
.sets-pagination-next:hover .sets-pagination-arrow {
    transform: translateX(3px);
}
.sets-pagination-disabled {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border: 1px dashed var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    opacity: 0.4;
    cursor: not-allowed;
}
.sets-pagination-current {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--text);
    font-size: 1rem;
    letter-spacing: 0.02em;
}
.sets-pagination-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
    font-weight: 600;
}
.sets-pagination-divider {
    color: var(--accent);
    opacity: 0.55;
    font-weight: 300;
    transform: skewX(-10deg);
    display: inline-block;
}
.sets-pagination-total {
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Facets nav blocks on root hub ── */
.sets-facets-nav {
    margin: 2.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.sets-facets-nav .set-section-title {
    font-family: var(--mono-font);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-muted);
}
.sets-facets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}
.sets-facets-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
    position: relative;
}
.sets-facets-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 1px;
    width: 0;
    background: var(--accent);
    transition: width 0.22s ease;
}
.sets-facets-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.sets-facets-link:hover::after {
    width: 100%;
}
.sets-facets-count {
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}
.sets-facets-link:hover .sets-facets-count {
    color: var(--accent);
    opacity: 0.75;
}

/* ── Card cross-link tags (platform + genre, sibling row) ── */
.sets-card-wrap {
    display: flex;
    flex-direction: column;
}
.sets-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
    padding: 0 0.2rem;
    font-family: var(--mono-font);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.sets-card-tag,
.sets-card-genre {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    line-height: 1.2;
}
.sets-card-tag:hover,
.sets-card-genre:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}
.sets-card-genre {
    border-style: dashed;
}
@media (max-width: 600px) {
    .sets-card-tags { display: none; }
    .sets-pagination {
        gap: 0.85rem;
        margin: 1.75rem 0 1rem;
    }
    .sets-pagination::before { display: none; }
    .sets-pagination-link,
    .sets-pagination-disabled { padding: 0.45rem 0.7rem; font-size: 0.72rem; }
    .sets-facet-meta { flex-wrap: wrap; gap: 0.3rem 0.45rem; }
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 900px) {
    .sets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .set-sub-scores { grid-template-columns: 1fr; }
    .set-hero h1 { font-size: 1.5rem; }
}
@media (max-width: 600px) {
    .sets-grid { grid-template-columns: 1fr; }
    .set-hero { padding: 2rem 0 1.5rem; }
    .set-track-gutter { min-width: 2rem; }
    .set-track-row-top { flex-wrap: wrap; }
    .set-track-row-bottom { flex-wrap: wrap; }
    .sets-filters { flex-direction: column; align-items: flex-start; }
}

/* ── Light Theme ───────────────────────────────── */
[data-theme="light"] .set-hero-bg { filter: blur(20px) brightness(0.5); }
[data-theme="light"] .set-hero h1 { color: #fff; }
[data-theme="light"] .set-track:hover {
    box-shadow: -3px 0 0 hsla(var(--hue), 50%, 45%, 0.6), 0 2px 8px rgba(0,0,0,0.08);
}
[data-theme="light"] .set-track-shine {
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
}


/* ═══════════════════════════════════════════════════════
   TOP TRACKS — /trackid/top-tracks chart page
   ═══════════════════════════════════════════════════════ */

/* ── Controls ─────────────────────────────────── */
.tt-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.tt-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.tt-platforms .pill-count {
    font-size: 0.55rem;
    opacity: 0.6;
    margin-left: 0.2rem;
}
.tt-sort select {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}

/* ── Chart Rows ───────────────────────────────── */
.tt-chart {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tt-row {
    display: grid;
    grid-template-columns: 3.5rem 1fr 7rem 2.5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.tt-row:hover {
    border-color: var(--accent);
    transform: translateX(3px);
    box-shadow: -3px 0 0 var(--accent), 0 2px 12px rgba(0,0,0,0.15);
}

/* ── Rank Number ──────────────────────────────── */
.tt-rank {
    display: flex;
    align-items: center;
    justify-content: center;
}
.tt-trophy {
    display: block;
    font-size: 1.2rem;
    line-height: 1;
    margin-bottom: 2px;
}
.tt-rank-num {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1;
}
/* Gold/Silver/Bronze for top 3 */
.tt-row:nth-child(1) .tt-rank-num { color: #fbbf24; font-size: 1.6rem; }
.tt-row:nth-child(2) .tt-rank-num { color: #94a3b8; font-size: 1.5rem; }
.tt-row:nth-child(3) .tt-rank-num { color: #d97706; font-size: 1.5rem; }
.tt-row:nth-child(1) { border-color: rgba(251,191,36,0.3); background: linear-gradient(90deg, rgba(251,191,36,0.05) 0%, transparent 40%); }
.tt-row:nth-child(2) { border-color: rgba(148,163,184,0.3); background: linear-gradient(90deg, rgba(148,163,184,0.04) 0%, transparent 40%); }
.tt-row:nth-child(3) { border-color: rgba(217,119,6,0.3); background: linear-gradient(90deg, rgba(217,119,6,0.04) 0%, transparent 40%); }

/* ── Track Info ───────────────────────────────── */
.tt-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}
.tt-main {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    min-width: 0;
}
.tt-artist {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
}
.tt-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}
.tt-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tt-meta {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.tt-pill-label {
    background: rgba(139,92,246,0.15) !important;
    color: #a78bfa !important;
}
.tt-platforms-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.tt-platforms-row .platform-pill {
    font-size: 0.5rem;
    padding: 0.05rem 0.3rem;
    opacity: 0.7;
}

/* ── Stats Column ─────────────────────────────── */
.tt-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.tt-sets-count {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    line-height: 1;
}
.tt-sets-label {
    font-family: var(--mono-font);
    font-size: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tt-featured-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}
.tt-featured-pill {
    font-size: 0.55rem;
    font-family: var(--mono-font);
    color: var(--text-dim);
    background: var(--border);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14ch;
    transition: color 0.2s, background 0.2s;
}
.tt-featured-pill:hover {
    color: var(--accent);
    background: rgba(96, 160, 255, 0.12);
}
.tt-featured-more {
    font-size: 0.5rem;
    font-family: var(--mono-font);
    color: var(--text-muted);
}
.tt-heat-bar {
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.tt-heat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 2px;
    transition: width 0.3s;
}

/* ── Store Links ──────────────────────────────── */
.tt-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
    .tt-row {
        grid-template-columns: 2.5rem 1fr 5rem;
    }
    .tt-links { display: none; }
    .tt-rank-num { font-size: 1.1rem; }
    .tt-row:nth-child(1) .tt-rank-num { font-size: 1.3rem; }
    .tt-row:nth-child(2) .tt-rank-num,
    .tt-row:nth-child(3) .tt-rank-num { font-size: 1.2rem; }
}
@media (max-width: 600px) {
    .tt-row {
        grid-template-columns: 2rem 1fr 4rem;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    .tt-controls { flex-direction: column; align-items: flex-start; }
    .tt-main { flex-direction: column; gap: 0; }
    .tt-artist { font-size: 0.78rem; }
    .tt-title { font-size: 0.7rem; }
    .tt-platforms-row { display: none; }
    .tt-featured-row { display: none; }
    .tt-sets-count { font-size: 0.9rem; }
}

/* ── Light Theme ──────────────────────────────── */
[data-theme="light"] .set-pill-shared {
    border-color: rgba(128, 90, 213, 0.3);
    color: #7c3aed;
    background: rgba(128, 90, 213, 0.08);
}
[data-theme="light"] .track-app-link {
    color: var(--text-dim);
}
[data-theme="light"] .track-app-link:hover {
    color: var(--accent);
}
[data-theme="light"] .tt-row:hover {
    box-shadow: -3px 0 0 var(--accent), 0 2px 8px rgba(0,0,0,0.08);
}


/* ═══════════════════════════════════════════════════════
   IDENTIFY — /trackid/identify song identification
   ═══════════════════════════════════════════════════════ */

/* ── Tabs ─────────────────────────────────────── */
.id-input-section {
    max-width: 640px;
    margin: 0 auto 2rem;
}
.id-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 1rem;
}
.id-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.id-tab:first-child { border-radius: 8px 0 0 8px; }
.id-tab:last-child { border-radius: 0 8px 8px 0; }
.id-tab:hover { color: var(--text); border-color: var(--accent); }
.id-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.id-tab svg { opacity: 0.7; }
.id-tab.active svg { opacity: 1; }

/* ── Panels ───────────────────────────────────── */
.id-panel { display: none; }
.id-panel.active { display: block; }

/* ── URL Form ─────────────────────────────────── */
.id-url-form {
    display: flex;
    gap: 0.5rem;
}
.id-url-input {
    flex: 1;
    padding: 0.7rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--mono-font);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}
.id-url-input:focus { border-color: var(--accent); }
.id-url-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.id-submit-btn {
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.id-submit-btn:hover { opacity: 0.85; }
.id-hint {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ── Dropzone ─────────────────────────────────── */
.id-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    border: 2px dashed var(--border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.id-dropzone:hover,
.id-dropzone.id-dragover {
    border-color: var(--accent);
    background: rgba(96, 160, 255, 0.04);
}
.id-drop-text {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.id-file-label {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}
.id-drop-hint {
    margin-top: 0.3rem;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ── Mic ──────────────────────────────────────── */
.id-mic-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}
.id-mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.3s;
}
.id-mic-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.id-mic-btn.id-mic-recording {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    animation: id-mic-pulse 1.5s infinite;
}
@keyframes id-mic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.id-mic-status {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.id-mic-timer {
    font-family: var(--mono-font);
    font-size: 1.2rem;
    color: var(--accent);
    margin-top: 0.25rem;
    min-height: 1.5rem;
}

/* ── Progress ─────────────────────────────────── */
.id-progress {
    max-width: 640px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

/* ── Scanner waveform animation ─────────────── */
.id-scanner {
    position: relative;
    height: 80px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(96, 160, 255, 0.03);
}
[data-theme="light"] .id-scanner {
    background: rgba(79, 70, 229, 0.03);
}
.id-scanner-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
    padding: 0 1rem;
}
.id-scanner-bars span {
    display: block;
    width: 3px;
    min-height: 4px;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0.4;
    animation: idScanPulse 1.8s ease-in-out infinite;
}
/* Stagger the 30 bars with varying heights and delays */
.id-scanner-bars span:nth-child(1)  { animation-delay: 0.00s; height: 18%; }
.id-scanner-bars span:nth-child(2)  { animation-delay: 0.06s; height: 28%; }
.id-scanner-bars span:nth-child(3)  { animation-delay: 0.12s; height: 42%; }
.id-scanner-bars span:nth-child(4)  { animation-delay: 0.18s; height: 35%; }
.id-scanner-bars span:nth-child(5)  { animation-delay: 0.24s; height: 55%; }
.id-scanner-bars span:nth-child(6)  { animation-delay: 0.30s; height: 70%; }
.id-scanner-bars span:nth-child(7)  { animation-delay: 0.36s; height: 50%; }
.id-scanner-bars span:nth-child(8)  { animation-delay: 0.42s; height: 82%; }
.id-scanner-bars span:nth-child(9)  { animation-delay: 0.48s; height: 60%; }
.id-scanner-bars span:nth-child(10) { animation-delay: 0.54s; height: 45%; }
.id-scanner-bars span:nth-child(11) { animation-delay: 0.60s; height: 72%; }
.id-scanner-bars span:nth-child(12) { animation-delay: 0.66s; height: 90%; }
.id-scanner-bars span:nth-child(13) { animation-delay: 0.72s; height: 65%; }
.id-scanner-bars span:nth-child(14) { animation-delay: 0.78s; height: 48%; }
.id-scanner-bars span:nth-child(15) { animation-delay: 0.84s; height: 78%; }
.id-scanner-bars span:nth-child(16) { animation-delay: 0.90s; height: 55%; }
.id-scanner-bars span:nth-child(17) { animation-delay: 0.96s; height: 85%; }
.id-scanner-bars span:nth-child(18) { animation-delay: 1.02s; height: 62%; }
.id-scanner-bars span:nth-child(19) { animation-delay: 1.08s; height: 40%; }
.id-scanner-bars span:nth-child(20) { animation-delay: 1.14s; height: 68%; }
.id-scanner-bars span:nth-child(21) { animation-delay: 1.20s; height: 50%; }
.id-scanner-bars span:nth-child(22) { animation-delay: 1.26s; height: 75%; }
.id-scanner-bars span:nth-child(23) { animation-delay: 1.32s; height: 58%; }
.id-scanner-bars span:nth-child(24) { animation-delay: 1.38s; height: 38%; }
.id-scanner-bars span:nth-child(25) { animation-delay: 1.44s; height: 65%; }
.id-scanner-bars span:nth-child(26) { animation-delay: 1.50s; height: 45%; }
.id-scanner-bars span:nth-child(27) { animation-delay: 1.56s; height: 30%; }
.id-scanner-bars span:nth-child(28) { animation-delay: 1.62s; height: 52%; }
.id-scanner-bars span:nth-child(29) { animation-delay: 1.68s; height: 22%; }
.id-scanner-bars span:nth-child(30) { animation-delay: 1.74s; height: 15%; }
@keyframes idScanPulse {
    0%, 100% { transform: scaleY(0.4); opacity: 0.3; }
    50%      { transform: scaleY(1);   opacity: 0.7; }
}
/* Sweeping scan line */
.id-scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--accent) 40%, var(--accent) 60%, transparent 100%);
    box-shadow: 0 0 8px var(--accent), 0 0 20px rgba(96, 160, 255, 0.3);
    animation: idScanSweep 3s linear infinite;
    opacity: 0.8;
}
@keyframes idScanSweep {
    0%   { left: 0;    opacity: 0; }
    5%   { opacity: 0.8; }
    95%  { opacity: 0.8; }
    100% { left: 100%; opacity: 0; }
}

.id-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}
.id-progress-status {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}
.id-progress-tracks {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    color: var(--accent);
}
.id-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.id-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.id-progress-message {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ── Error ────────────────────────────────────── */
.id-error {
    max-width: 640px;
    margin: 0 auto 2rem;
    padding: 1.25rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    text-align: center;
}
.id-error-text {
    color: #ef4444;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.id-retry-btn {
    padding: 0.45rem 1.2rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    cursor: pointer;
}
.id-retry-btn:hover { border-color: var(--accent); }

/* ── Results ──────────────────────────────────── */
/* ── Identify: Results Reveal ────────────────── */
.id-results-visible {
    animation: id-reveal 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes id-reveal {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ── Identify: Timeline Segment Stagger ──────── */
.id-results .set-tl-seg {
    opacity: 0;
    animation: id-seg-in 0.4s ease-out forwards;
}
@keyframes id-seg-in {
    from { opacity: 0; transform: scaleY(0.4); }
    to { opacity: 0.7; transform: scaleY(1); }
}
.id-results .set-tl-seg:hover {
    opacity: 1;
}
.id-results .set-tl-seg.seg-active {
    opacity: 1;
}

.id-results-header {
    margin-bottom: 1.5rem;
}
.id-results-title {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}
.id-results-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Streaming Links (Odesli) ─────────────────── */
.id-streaming {
    margin-top: 0.35rem;
    min-height: 1.3rem;
}
.id-streaming-loading {
    display: flex;
    gap: 0.25rem;
    padding: 0.35rem 0;
}
.id-streaming-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.3;
    animation: id-dot-pulse 1.4s ease-in-out infinite;
}
.id-streaming-dot:nth-child(2) { animation-delay: 0.2s; }
.id-streaming-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes id-dot-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
    40% { opacity: 1; transform: scale(1.4); }
}

.id-streaming-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.id-slink {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem 0.2rem 0.4rem;
    border-radius: 100px;
    font-family: var(--body-font);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    text-decoration: none;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(6px);
    animation: id-slink-in 0.35s ease-out forwards;
}
[data-theme="light"] .id-slink {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}
.id-slink:hover {
    transform: translateY(-2px);
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--brand, var(--accent));
    box-shadow: 0 4px 16px -4px var(--brand, rgba(96, 160, 255, 0.3));
}
[data-theme="light"] .id-slink:hover {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 16px -4px var(--brand, rgba(79, 70, 229, 0.25));
}
.id-slink-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand, var(--accent));
    box-shadow: 0 0 6px var(--brand, var(--accent));
    flex-shrink: 0;
    transition: box-shadow 0.25s;
}
.id-slink:hover .id-slink-dot {
    box-shadow: 0 0 10px var(--brand, var(--accent));
}
@keyframes id-slink-in {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 600px) {
    .id-url-form { flex-direction: column; }
    .id-submit-btn { width: 100%; }
    .id-tab { font-size: 0.65rem; padding: 0.5rem 0.3rem; }
    .id-tab svg { width: 14px; height: 14px; }
    .id-slink { font-size: 0.52rem; padding: 0.15rem 0.45rem 0.15rem 0.3rem; }
    .id-slink-dot { width: 5px; height: 5px; }
}

/* -- Similar Song Finder: analysis bar -------------------- */
.analysis-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    margin: 1rem auto;
    max-width: 720px;
    background: var(--bg-card, #111);
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    font-size: 1rem;
    position: sticky;
    top: 60px;
    z-index: 10;
}
.analysis-bpm-label { white-space: nowrap; }
.tolerance-label { white-space: nowrap; font-size: 0.875rem; }
.tolerance-select {
    background: var(--bg-deep, #08081a);
    color: var(--text, #eee);
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* -- Similar Song Finder: results grid -------------------- */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-width: 960px;
    margin: 1rem auto;
    padding: 0 1rem;
}
.result-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #111);
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.result-card:hover { border-color: var(--accent, #60a0ff); }
.card-art {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.card-info {
    padding: 0.75rem 1rem 0.5rem;
    flex: 1;
}
.card-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-artist {
    font-size: 0.825rem;
    color: var(--text-muted, #999);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bpm-badge {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent, #60a0ff);
    color: #fff;
    border-radius: 999px;
}
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid var(--border, #333);
}
.preview-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    color: var(--text, #eee);
    cursor: pointer;
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
}
.preview-btn:hover { border-color: var(--accent, #60a0ff); }
.play-icon { font-size: 0.9rem; flex-shrink: 0; }
.preview-progress {
    flex: 1;
    height: 3px;
    background: var(--border, #333);
    border-radius: 2px;
    overflow: hidden;
}
.preview-fill {
    height: 100%;
    width: 0%;
    background: var(--accent, #60a0ff);
    transition: width 0.25s linear;
}
.deezer-link {
    font-size: 0.75rem;
    color: var(--text-muted, #999);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.deezer-link:hover { color: var(--accent, #60a0ff); }

.status-msg {
    text-align: center;
    margin: 1rem auto;
    max-width: 720px;
    color: var(--text-muted, #999);
}
.status-msg.error { color: var(--danger, #ff6b6b); }

/* ── Spotify Playlist Analyzer ───────────────────────────────────── */
.spa-genre-pill { display: inline-block; padding: 0.15rem 0.5rem; margin: 0.15rem 0.15rem 0 0;
  background: rgba(96,160,255,0.15); border-radius: 999px; font-size: 0.75rem; color: var(--text-muted); }
.spa-banner { margin-top: 0.75rem; padding: 0.5rem 0.75rem; background: rgba(96,160,255,0.1);
  border-left: 3px solid var(--accent); border-radius: 4px; font-size: 0.85rem; }
#spa-clash-strip { display: flex; gap: 2px; min-height: 24px; }
.spa-clash-pill { flex: 1; border-radius: 2px; min-width: 4px; height: 24px; }
.spa-clash-pill.spa-clash-ok       { background: #10b981; }
.spa-clash-pill.spa-clash-warm     { background: #34d399; }
.spa-clash-pill.spa-clash-tension  { background: #fb923c; }
.spa-clash-pill.spa-clash-clash    { background: #ef4444; }
.spa-clash-pill.spa-clash-unknown  { background: var(--border); }
.spa-health-empty { color: var(--text-muted); font-style: italic; }
.spa-source { font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 4px;
  background: rgba(96,160,255,0.1); color: var(--text-muted); }
.spa-source-tunelab-ml { color: #fbbf24; background: rgba(251,191,36,0.1); }
.spa-source-acousticbrainz { color: #34d399; background: rgba(52,211,153,0.1); }
@media (max-width: 768px) {
  #spa-charts > div { grid-template-columns: 1fr !important; }
  #spa-health > div { grid-template-columns: 1fr 1fr !important; }
}

/* ── Cloud Assist Toggle ───────────────────────────────────────────────
   The host is .upload-trust-badge[data-tool-id]. The macro renders the
   skeleton server-side; cloud-toggle.js attaches behavior. Server text
   matches JS-set text exactly to prevent layout shift on hydration. */

.upload-trust-badge.cloud-toggle--mounted {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(96, 160, 255, 0.04);
    border: 1px solid rgba(96, 160, 255, 0.15);
    border-radius: 0.5rem;
}

.cloud-toggle__tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    padding: 0.2rem;
}

.cloud-toggle__tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted, #8a8a9e);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.3rem;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.cloud-toggle__tab:hover:not(.cloud-toggle__tab--active):not(.cloud-toggle__tab--disabled) {
    color: var(--text, #e0e0e0);
}

.cloud-toggle__tab--active {
    background: var(--accent, #60a0ff);
    color: #fff;
    font-weight: 600;
}

.cloud-toggle__tab--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cloud-toggle__tab-title {
    display: block;
}

.cloud-toggle__tab-sub {
    display: block;
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 2px;
}

.cloud-toggle__sublabel {
    font-size: 0.75rem;
    color: var(--text-muted, #8a8a9e);
    line-height: 1.4;
    text-align: center;
    padding: 0 0.5rem;
}

.cloud-toggle__auth-cta {
    display: block;
    color: var(--text-muted, #8a8a9e);
    padding: 0.2rem 0.5rem;
    font-family: inherit;
    font-size: 0.72rem;
    text-align: center;
}

.cloud-toggle__sublabel.hidden,
.cloud-toggle__auth-cta.hidden {
    display: none;
}

/* Hide tab subtitles once Cloud is active — sublabel below carries the
   explanation, so subtitles become noise after the decision is made.
   Also covers the forced-cloud (mobile / no-SAB) case where "On your
   device" would actively mislead. */
.cloud-toggle--cloud-active .cloud-toggle__tab-sub {
    display: none;
}

/* ── Purchase Disabled (Reopening Soon state) ───────────────── */
.purchase-disabled {
    opacity: 0.72;
    cursor: not-allowed;
    position: relative;
    filter: grayscale(0.25);
    transition: opacity 120ms ease;
}
.purchase-disabled:hover {
    opacity: 0.85;
}
.purchase-disabled-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-solid);
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.9rem 1.2rem;
    font-size: 0.9rem;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}
.purchase-disabled-toast.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.purchase-disabled-toast a {
    color: var(--accent);
    text-decoration: none;
}
.purchase-disabled-toast a:hover {
    text-decoration: underline;
}
