/* Base Styles */
:root {
    /* --primary-dark is defined in variables.css; do NOT self-reference it here
       (a `--primary-dark: var(--primary-dark)` cycle resolves to empty and silently
       kills every gradient that uses it). */
    --secondary-color: var(--text-secondary);
    --success-color: var(--success);
    --danger-color: var(--danger);
    --warning-color: var(--warning);
    --info-color: var(--info);
    --light-color: var(--surface-elevated);
    --dark-color: var(--text-color);
    --border-radius: var(--radius);
    --box-shadow: var(--shadow-md);
    --transition: all 0.3s ease;
    --ai-gradient: var(--gradient-accent);
    --font-family: var(--font-sans);
    --text-primary: var(--text-color);
    color-scheme: dark;
}

[data-theme="light"] {
    color-scheme: light;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--ios-chrome-bg, var(--background-color));
    background-image: var(--gradient-bg);
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ======================
   MODERN MINIMALISTIC HEADER
   ====================== */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    left: 0;
    right: 0;
    /* Floating header: the visible glass bar is .header-container. This wrapper
       stays transparent and only provides the top gap (below the dynamic island
       / notch on iOS via safe-area-inset-top) plus side gutters so the bar
       floats off the screen edges. The iOS status-bar tint now comes from the
       page background + the synced theme-color meta, not from this element.
       pointer-events:none lets clicks pass through the transparent frame; the
       bar itself re-enables them. */
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
    background: transparent;
    transition: padding 0.3s ease;
    pointer-events: none;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px;
    width: 100%;
    box-sizing: border-box;
    pointer-events: auto;
    /* Floating glass pill: translucent card-bg fill over a transparent base so
       the backdrop-filter blur shows through (expressed as a flat gradient
       image, matching the iOS glass-overlay convention used elsewhere). */
    background-color: transparent;
    background-image: linear-gradient(var(--card-bg), var(--card-bg));
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* Enhanced scrolled state — tighten the gap and lift the floating pill */
header.scrolled {
    padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
    padding-bottom: 6px;
}

header.scrolled .header-container {
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ======================
   APP BRAND SECTION
   ====================== */

.app-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.app-brand:hover {
    transform: translateY(-1px);
}

.app-logo {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.15));
}

.app-brand:hover .app-logo {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.25));
}

/* ======================
   HEADER RIGHT SECTION
   ====================== */

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: space-between;
    margin-left: 20px;
}

.app-title {
    flex: 1;
    margin: 0 20px;
}

.app-title-heading {
    display: block;
    max-width: 100%;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.free-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    background: var(--chip-bg);
    color: var(--chip-text);
    border: 1px solid var(--chip-border);
    border-radius: var(--chip-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 12px;
    box-shadow: var(--chip-shadow);
    animation: none;
    position: relative;
    overflow: hidden;
}

.free-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.8s ease;
}

.free-badge:hover::before {
    left: 100%;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ======================
   HEADER ACTIONS
   ====================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ======================
   RESPONSIVE DESIGN
   ====================== */

@media (max-width: 1024px) {
    .header-right {
        gap: 15px;
    }
    
    .app-title {
        margin: 0 15px;
    }
    
    .app-title-heading {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 10px 15px;
        min-height: 70px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
        min-width: 0;
    }
    
    .app-title {
        flex: 1;
        min-width: 0;
        margin: 0;
    }
    
    .app-title-heading {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .app-logo {
        /* Size controlled by logo component size classes from auth.css */
    }
    
    .free-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
        margin-left: 8px;
    }
    
    .header-actions {
        gap: 12px;
        flex-shrink: 0;
    }
    
    .user-menu-container {
        flex-shrink: 0;
        margin-left: 10px;
    }
    
    .user-menu-trigger {
        padding: 8px 12px;
    }
    
    .auth-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 8px 15px;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    
    .app-brand {
        flex-shrink: 0;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0; /* Allow text truncation */
    }
    
    .app-title {
        flex: 1;
        min-width: 0; /* Allow text truncation */
        margin: 0;
    }
    
    .app-title-heading {
        font-size: 0.9rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }
    
    .header-actions {
        gap: 8px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    
    /* User menu container - now outside header-right */
    .user-menu-container {
        flex-shrink: 0;
        margin-left: 8px;
    }
    
    .free-badge {
        display: none; /* Hide on very small screens */
    }
    
    .app-logo {
        /* Size controlled by logo component size classes from auth.css */
    }
    
    /* Make user menu more compact */
    .user-menu-trigger {
        padding: 6px 8px;
        font-size: 0.85rem;
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-name {
        display: none; /* Hide username text on very small screens */
    }
    
    .auth-btn {
        padding: 6px 8px;
        font-size: 0.85rem;
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .auth-btn span {
        display: none; /* Hide text, show only icons */
    }
    
    .auth-btn svg {
        width: 18px;
        height: 18px;
    }
    

}



/* ======================
   HEADER SPACING
   ====================== */

.header-spacing {
    height: 80px; /* Adjust based on header height */
    width: 100%;
}

@media (max-width: 768px) {
    .header-spacing {
        height: 70px;
    }
}

@media (max-width: 480px) {
    .header-spacing {
        height: 70px; /* Optimized for new compact layout */
    }
}

/* Minimal Logo */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-img {
    height: 32px;
    width: auto;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

/* Minimal Navigation */
.nav-menu {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
    font-weight: 400;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        display: none;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-link {
        padding: 1rem 2rem;
    }
    
    .menu-toggle {
        display: block;
    }
}

/* Header actions */
.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: rgba(56, 189, 248, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feedback-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(56, 189, 248, 0.06) 0%,
        rgba(56, 189, 248, 0.12) 50%,
        rgba(56, 189, 248, 0.06) 100%
    );
    background-size: 200% 200%;
    animation: feedback-pulse 3s infinite ease-in-out;
    z-index: -1;
}

@keyframes feedback-pulse {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.feedback-button svg {
    margin-right: 2px;
    width: 18px;
    height: 18px;
    fill: var(--primary-color);
}

.feedback-button:hover {
    background-color: rgba(56, 189, 248, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.12);
}

.feedback-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(56, 189, 248, 0.1);
}

.feedback-button-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: var(--danger);
    border-radius: 50%;
    animation: pulse-feedback 2s infinite;
}

@keyframes pulse-feedback {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(231, 76, 60, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Beta tag */
.beta-tag {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--chip-bg);
    color: var(--danger);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 7px;
    border: 1px solid rgba(248, 113, 113, 0.24);
    border-radius: var(--chip-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Floating API button */
.fab-api {
    position: fixed;
    bottom: 95px;
    right: 20px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.fab-api::after {
    content: 'Join API';
}

.fab-api:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: var(--primary-light);
    text-decoration: none;
}

@media (max-width: 768px) {
    .fab-api {
        padding: 12px 16px;
        border-radius: var(--radius-md);
        font-size: 12px;
        bottom: 80px;
        right: 16px;
    }
}

/* Floating feedback button for mobile */
.floating-feedback-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s ease;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.floating-feedback-button.visible {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.floating-feedback-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.floating-feedback-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.25);
}

@media (max-width: 768px) {
    .floating-feedback-button {
        padding: 10px;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }
    
    .floating-feedback-button span {
        display: none;
    }
    
    .floating-feedback-button svg {
        margin-right: 0;
    }
}

/* App logo and brand styles - Uses standardized logo system from auth.css */
.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Legacy app-logo class - now inherits from standardized logo system */
.app-logo {
    /* Inherits from .logo-md in auth.css */
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    flex-shrink: 0;
}

/* Apply logo-md size to app-logo for consistency */
.app-brand .app-logo {
    /* Size controlled by logo component size parameter */
}

.app-title {
    margin: 0;
    transition: all 0.3s ease;
}

.app-title-heading {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-color);
    margin: 0;
    transition: color 0.3s ease;
}

/* Adjust app brand when header is scrolled */
header.scrolled .app-brand {
    transform: scale(0.95);
}

header.scrolled .app-logo {
    /* Size controlled by logo component - scrolled state uses transform instead */
    transform: scale(0.9);
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@media (max-width: 768px) {
    .app-brand {
        gap: 8px;
    }
    
    .app-logo {
        /* Size controlled by logo component */
    }
    
    .app-title-heading {
        font-size: 1.15rem;
    }
    
    .feedback-button {
        padding: 6px 10px;
        font-size: 12px;
        height: 28px;
    }
    
}

/* Intro Section */
.intro-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2.5rem;
    text-align: center;
    display: none; /* Hide by default */
}

/* Show intro section only when results section is hidden */
.results-section[style*="display: none"] ~ .intro-section {
    display: block;
}

.intro-content {
    max-width: 900px;
    margin: 0 auto;
}

.intro-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.intro-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    .intro-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .intro-section h2 {
        font-size: 1.5rem;
    }
    
    .intro-section p {
        font-size: 1rem;
    }
}

/* Upload Section */
.upload-section {
    padding-top: 30px;
    margin-bottom: 60px;
}

.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 30px;
    background-color: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 2px dashed rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Arrow indicator pointing to button */
.upload-area::after {
    content: "";
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 20px solid var(--text-secondary);
    animation: bounce 1.5s infinite;
    z-index: 1;
    display: none; /* Hidden initially, shown after page load with JS */
}

.upload-area.show-indicator::after {
    display: block;
}

/* Button wrapper to ensure button stays in place */
.button-wrapper {
    position: relative;
    margin-top: 30px;
    margin-bottom: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.upload-area:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.5);
    background-color: var(--surface-elevated);
    box-shadow: var(--shadow-hover), 0 0 40px rgba(56, 189, 248, 0.06);
}

/* Upload UI Enhancements */
.upload-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.upload-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.upload-copy-mobile {
    display: none;
}

.upload-model-picker {
    width: 100%;
    margin: 14px 0 8px;
    --upload-model-surface: linear-gradient(180deg, rgba(9, 15, 43, 0.96), rgba(15, 22, 56, 0.9));
    --upload-model-surface-hover: linear-gradient(180deg, rgba(12, 20, 52, 0.98), rgba(20, 30, 70, 0.94));
    --upload-model-border: rgba(96, 165, 250, 0.2);
    --upload-model-border-strong: rgba(125, 211, 252, 0.5);
    --upload-model-shadow: 0 16px 34px rgba(2, 6, 23, 0.34);
    --upload-model-shadow-strong: 0 24px 50px rgba(15, 23, 42, 0.42);
    --upload-model-badge-bg: rgba(96, 165, 250, 0.14);
    --upload-model-badge-border: rgba(147, 197, 253, 0.18);
    --upload-model-badge-color: #38bdf8;
    --upload-model-copy-color: rgba(226, 232, 240, 0.78);
    --upload-model-meta-color: rgba(248, 250, 252, 0.9);
    --upload-model-title-color: #f8fafc;
    --upload-model-ring: rgba(59, 130, 246, 0.24);
    --upload-model-radio-border: rgba(191, 219, 254, 0.44);
    --upload-model-radio-bg: rgba(7, 11, 30, 0.54);
}

.upload-genre-picker {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid rgba(125, 211, 252, 0.36);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.62);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.24);
}

.upload-genre-label {
    display: block;
    margin-bottom: 10px;
    color: var(--upload-model-title-color);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.25;
}

.upload-genre-select-frame {
    position: relative;
}

.upload-genre-select {
    appearance: none;
    width: 100%;
    min-height: 56px;
    padding: 0 52px 0 16px;
    border: 2px solid var(--upload-model-border-strong);
    border-radius: var(--radius-md);
    background: rgba(7, 11, 30, 0.86);
    color: var(--upload-model-title-color);
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
    touch-action: manipulation;
}

.upload-genre-select:hover {
    border-color: rgba(186, 230, 253, 0.78);
    background: rgba(7, 11, 30, 0.96);
}

.upload-genre-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: rgba(224, 242, 254, 0.92);
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.upload-genre-select-icon {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 11px;
    height: 11px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: rgba(248, 250, 252, 0.88);
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.upload-genre-help {
    margin: 10px 0 0;
    color: var(--upload-model-copy-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.upload-model-grid {
    display: grid;
    gap: 14px;
    width: 100%;
}

.upload-model-featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

.upload-model-other-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(10, 16, 40, 0.72), rgba(8, 13, 32, 0.48));
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
}

.upload-model-other-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--upload-model-title-color);
}

.upload-model-other-head > span:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.upload-model-other-eyebrow,
.upload-model-other-count,
.upload-model-other-trigger-meta,
.upload-model-other-option-meta {
    color: var(--upload-model-copy-color);
    font-size: 0.78rem;
    font-weight: 700;
}

.upload-model-other-eyebrow {
    text-transform: uppercase;
}

.upload-model-other-count {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid rgba(147, 197, 253, 0.14);
    border-radius: var(--chip-radius-sm);
    background: rgba(96, 165, 250, 0.1);
}

.upload-model-other-trigger {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--upload-model-border-strong);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.72);
    color: var(--text-color);
    font-size: 16px;
    font-weight: 700;
    padding: 10px 12px 10px 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    touch-action: manipulation;
}

.upload-model-other-trigger:hover,
.upload-model-other-trigger:focus-visible {
    border-color: rgba(125, 211, 252, 0.72);
    background: rgba(17, 24, 49, 0.9);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
    outline: none;
}

.upload-model-other-trigger-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.upload-model-other-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-model-other-trigger-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-pill);
    background: rgba(96, 165, 250, 0.14);
    border: 1px solid rgba(147, 197, 253, 0.18);
    position: relative;
    flex: 0 0 auto;
}

.upload-model-other-trigger-icon::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 10px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(191, 219, 254, 0.86);
    border-bottom: 2px solid rgba(191, 219, 254, 0.86);
    transform: rotate(45deg);
    transition: transform 0.2s ease, top 0.2s ease;
}

.upload-model-other-trigger[aria-expanded="true"] .upload-model-other-trigger-icon::before {
    top: 12px;
    transform: rotate(225deg);
}

.upload-model-other-menu {
    display: grid;
    gap: 6px;
    max-height: min(420px, 46dvh);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(147, 197, 253, 0.16);
    border-radius: var(--radius-lg);
    background: rgba(6, 10, 28, 0.96);
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.36);
}

.upload-model-other-menu[hidden] {
    display: none;
}

.upload-model-other-option {
    width: 100%;
    min-height: 50px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--upload-model-title-color);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.upload-model-other-option:hover,
.upload-model-other-option:focus-visible,
.upload-model-other-option.is-selected {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(125, 211, 252, 0.28);
    outline: none;
}

.upload-model-other-option:active {
    transform: scale(0.99);
}

.upload-model-other-option-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 750;
}

.upload-model-other-card-slot {
    min-width: 0;
}

.upload-model-picker-label {
    margin-bottom: 14px;
    text-align: center;
}

.upload-model-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 224px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--upload-model-border);
    background: var(--upload-model-surface);
    box-shadow: var(--upload-model-shadow);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.upload-model-card--other {
    display: none;
    min-height: 0;
    margin-top: 2px;
}

.upload-model-card--other.upload-model-card--other-active {
    display: flex;
}

.upload-model-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.12), transparent 42%),
        radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.1), transparent 36%);
    opacity: 0.75;
    pointer-events: none;
}

.upload-model-card > * {
    position: relative;
    z-index: 1;
}

.upload-model-card:hover {
    transform: translateY(-1px);
    background: var(--upload-model-surface-hover);
    border-color: var(--upload-model-border-strong);
    box-shadow: var(--upload-model-shadow-strong);
}

.upload-model-card:has(.upload-model-input:checked) {
    background:
        linear-gradient(160deg, rgba(37, 99, 235, 0.22), rgba(124, 58, 237, 0.12)),
        var(--upload-model-surface-hover);
    border-color: var(--upload-model-border-strong);
    box-shadow:
        0 0 0 1px var(--upload-model-ring),
        var(--upload-model-shadow-strong);
}

.upload-model-card:has(.upload-model-input:focus-visible) {
    outline: 2px solid rgba(56, 189, 248, 0.58);
    outline-offset: 3px;
}

.upload-model-card--locked {
    opacity: 0.62;
    cursor: not-allowed;
    filter: saturate(0.75);
}

.upload-model-card--needs-credits {
    border-color: rgba(251, 191, 36, 0.34);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.3);
}

.upload-model-card--selected-blocked {
    opacity: 0.9;
    border-color: rgba(251, 191, 36, 0.78);
    box-shadow:
        0 0 0 2px rgba(251, 191, 36, 0.2),
        0 20px 42px rgba(15, 23, 42, 0.34);
}

.upload-model-card--needs-credits::before {
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.14), transparent 42%),
        radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.12), transparent 36%);
}

.upload-model-input {
    appearance: none;
    -webkit-appearance: none;
    margin: 0 0 4px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--upload-model-radio-border);
    background: var(--upload-model-radio-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.upload-model-input::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
    transform: scale(0.4);
    opacity: 0;
    background: linear-gradient(135deg, #38bdf8, #a855f7);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.upload-model-input:checked {
    border-color: rgba(125, 211, 252, 0.9);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.12);
    transform: scale(1.02);
}

.upload-model-input:checked::after {
    opacity: 1;
    transform: scale(1);
}

.upload-model-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.upload-model-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.upload-model-title {
    color: var(--upload-model-title-color);
    font-size: 1.08rem;
    line-height: 1.25;
}

.upload-model-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: var(--chip-radius-sm);
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    box-shadow: var(--chip-shadow);
    color: var(--chip-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.upload-model-copy {
    color: var(--upload-model-copy-color);
    font-size: 0.9rem;
    line-height: 1.45;
}

.upload-model-meta {
    color: var(--upload-model-meta-color);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: auto;
}

.upload-model-card--with-usage-chip .upload-model-meta {
    display: none !important;
}

.upload-model-usage-chip {
    width: fit-content;
    min-width: min(100%, 154px);
    margin-top: auto;
    padding: 7px 9px;
}

.upload-model-usage-chip[hidden] {
    display: none !important;
}

.upload-model-usage-chip--topup {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(245, 158, 11, 0.1);
}

.upload-model-usage-chip--locked {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(71, 85, 105, 0.14);
}

[data-theme="light"] .upload-model-picker {
    --upload-model-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 255, 0.94));
    --upload-model-surface-hover: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(234, 243, 255, 0.96));
    --upload-model-border: rgba(37, 99, 235, 0.12);
    --upload-model-border-strong: rgba(37, 99, 235, 0.28);
    --upload-model-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    --upload-model-shadow-strong: 0 18px 36px rgba(15, 23, 42, 0.12);
    --upload-model-badge-bg: rgba(37, 99, 235, 0.1);
    --upload-model-badge-border: rgba(37, 99, 235, 0.08);
    --upload-model-badge-color: #0ea5e9;
    --upload-model-copy-color: rgba(15, 23, 42, 0.66);
    --upload-model-meta-color: rgba(15, 23, 42, 0.88);
    --upload-model-title-color: #0f172a;
    --upload-model-ring: rgba(37, 99, 235, 0.14);
    --upload-model-radio-border: rgba(71, 85, 105, 0.42);
    --upload-model-radio-bg: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .upload-model-other-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 255, 0.72));
    border-color: rgba(37, 99, 235, 0.12);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .upload-model-other-trigger {
    background: rgba(255, 255, 255, 0.94);
    color: var(--upload-model-title-color);
}

[data-theme="light"] .upload-model-other-menu {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .upload-model-other-option:hover,
[data-theme="light"] .upload-model-other-option:focus-visible,
[data-theme="light"] .upload-model-other-option.is-selected {
    background: rgba(37, 99, 235, 0.08);
}

[data-theme="light"] .upload-model-other-trigger-icon {
    background: rgba(37, 99, 235, 0.08);
}

[data-theme="light"] .upload-model-other-trigger-icon::before {
    border-color: rgba(37, 99, 235, 0.78);
}

[data-theme="light"] .upload-genre-picker {
    border-color: rgba(37, 99, 235, 0.2);
    background: rgba(241, 245, 249, 0.86);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .upload-genre-select {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(37, 99, 235, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .upload-genre-select:hover {
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.58);
}

[data-theme="light"] .upload-genre-select-icon {
    color: rgba(15, 23, 42, 0.74);
}

[data-theme="light"] .upload-model-usage-chip--topup {
    background: rgba(245, 158, 11, 0.1);
}

[data-theme="light"] .upload-model-usage-chip--locked {
    background: rgba(71, 85, 105, 0.08);
}

@media (min-width: 900px) {
    .upload-model-featured-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1320px) {
    .upload-model-featured-grid {
        gap: 14px;
    }
}

@media (max-width: 760px) {
    .upload-model-grid {
        gap: 12px;
    }

    .upload-model-other-panel {
        padding: 10px;
    }

    .upload-model-other-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .upload-model-other-option {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .upload-model-card {
        min-height: 0;
    }
}

.upload-icon {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.upload-button {
    background: var(--gradient-primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--radius-pill);
    padding: 14px 32px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15), 0 0 40px rgba(168, 85, 247, 0.08);
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: pulse-button 2s infinite;
}

.upload-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.25), 0 0 60px rgba(168, 85, 247, 0.12);
}

.upload-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    transition: width 0.5s, height 0.5s;
}

.upload-button:hover::before {
    width: 300px;
    height: 300px;
}

@keyframes pulse-button {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.track-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
    justify-content: center;
}

/* Info Tooltip */
.info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    z-index: 1000;
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: var(--transition);
}

.info-icon:hover {
    opacity: 1;
}

.tooltip-content {
    visibility: hidden;
    width: 220px;
    background-color: var(--text-color);
    color: var(--text-heading);
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
    line-height: 1.4;
    font-weight: normal;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}

.info-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.checkbox-container:hover {
    background-color: var(--surface-elevated);
}

.checkbox-container.checked {
    color: var(--primary-color);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background-color: var(--surface-elevated);
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-text {
    user-select: none;
}

/* Enhanced Progress Bar */
.progress-container {
    margin-top: 20px;
    width: 100%;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: start;
}

/* Stage text and percentage on the same row */
.progress-container > #progress-stage {
    grid-column: 1;
    grid-row: 1;
    font-weight: 600;
    color: var(--text-color);
    align-self: center;
}

.progress-container > #progress-percentage {
    grid-column: 2;
    grid-row: 1;
    font-weight: 700;
    color: var(--primary-color);
    align-self: center;
}

/* Other progress container children span full width */
.progress-container > .progress-bar-container,
.progress-container > #progress-text,
.progress-container > .progress-steps {
    grid-column: 1 / -1;
}

/* Note: Progress icon and spinner animation removed per user request */

.progress-bar-container {
    position: relative;
    background-color: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-pill);
    overflow: hidden;
    height: 8px;
    margin-bottom: 15px;
}

.progress-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: var(--radius-pill);
}

/* Sheen sweeps the dead 'queued/connecting' window where the real bar sits near 0% and
   nothing moves — the exact stretch the user called static. Scoped to the pre-progress
   statuses only; it stops the instant real progress ('receiving') takes over, so the two
   are never on screen together. translateX stays inside the clipped track. */
.progress-container[data-realtime-status="starting"] .progress-bar-container::after,
.progress-container[data-realtime-status="connecting"] .progress-bar-container::after,
.progress-container[data-realtime-status="connected"] .progress-bar-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.35), transparent);
    transform: translateX(-100%);
    animation: progress-sheen 1.4s ease-in-out infinite;
}

@keyframes progress-sheen {
    to { transform: translateX(250%); }
}

#progress-text {
    text-align: center;
    margin: 15px 0;
    color: var(--text-secondary);
    font-weight: 500;
}

.realtime-mode-indicator {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-self: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.08);
    font-size: 0.82rem;
    font-weight: 600;
}

.realtime-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.progress-container[data-realtime-status="receiving"] .realtime-indicator-dot,
.progress-container[data-realtime-status="complete"] .realtime-indicator-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.progress-container[data-realtime-status="reconnecting"] .realtime-indicator-dot,
.progress-container[data-realtime-status="degraded"] .realtime-indicator-dot {
    background: var(--warning, #f59e0b);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 10px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    right: calc(-50% + 10px);
    height: 2px;
    width: calc(100% - 20px);
    background-color: rgba(99, 102, 241, 0.1);
    z-index: 1;
}

.progress-step.active:not(:last-child)::after,
.progress-step.completed:not(:last-child)::after {
    background-color: var(--primary-color);
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.progress-step.active .step-indicator {
    background-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* Pulse the active step only once real progress is streaming. Backend steps 2-15 all map to
   the single 'Analyze' UI step, so without this the screen looks frozen for most of the run.
   Scoped to 'receiving' so it is mutually exclusive with the dead-window sheen — at most one
   ambient loop is ever visible at a time. */
.progress-container[data-realtime-status="receiving"] .progress-step.active .step-indicator {
    animation: step-pulse 1.8s ease-in-out infinite;
}

@keyframes step-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12); }
    50% { box-shadow: 0 0 0 7px rgba(99, 102, 241, 0.05); }
}

.progress-step.completed .step-indicator {
    background-color: var(--success);
}

.progress-step.active .step-indicator::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--card-bg);
}

.progress-step.completed .step-indicator::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.progress-step span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

.progress-step.active span {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed span {
    color: var(--success);
    font-weight: 600;
}

/* Results Actions */
.results-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 24px;
    padding: 10px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .results-actions {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.action-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: white;
    background: linear-gradient(135deg, #3db5eb, #2f95ca);
    border-color: rgba(56, 189, 248, 0.25);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.action-button svg {
    margin-right: 0;
    flex-shrink: 0;
}

/* Short labels are mobile-only; desktop shows the full label. */
.action-label-short {
    display: none;
}

/* ---- Share modal panel ---- */
.share-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.share-link-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.share-link-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-color);
    font-size: 0.9rem;
}

.share-link-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.share-copy-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.5);
    cursor: pointer;
    font-weight: 650;
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #22b6e6);
    box-shadow: 0 8px 24px rgba(79, 90, 230, 0.4);
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background-color 0.2s ease;
}

.share-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(79, 90, 230, 0.55);
}

.share-copy-btn.copied {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: rgba(16, 185, 129, 0.5);
}

.share-socials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.share-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px 8px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease;
}

.share-social svg {
    width: 22px;
    height: 22px;
}

.share-social:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.share-social.x:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.share-social.li:hover {
    border-color: #0a66c2;
    color: #4aa3ff;
}

.share-social.fb:hover {
    border-color: #1877f2;
    color: #5a9bff;
}

.share-native-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.share-native-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(120, 180, 255, 0.45);
}

[data-theme="light"] .share-native-btn {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.12);
}

.share-note {
    font-size: 0.82rem;
    color: var(--text-muted, #94a3b8);
    margin: 0;
    text-align: center;
}

[data-theme="light"] .share-link-input {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .share-social {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    .share-copy-btn,
    .share-social {
        transition: none;
    }
    .share-copy-btn:hover,
    .share-social:hover {
        transform: none;
    }
}

.action-button::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
    transition: opacity 0.2s ease;
}

.action-button:hover:not(:disabled):not([aria-disabled="true"]) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-button:hover:not(:disabled):not([aria-disabled="true"])::after {
    opacity: 1;
}

.action-button:active:not(:disabled):not([aria-disabled="true"]) {
    transform: translateY(0);
}

.action-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.26), var(--shadow-md);
}

/* Button flash feedback — replaces toast notifications */
.action-button .btn-flash-text {
    display: none;
}

.action-button.btn-flashed .btn-flash-text {
    display: inline;
}

.action-button.btn-flashed svg,
.action-button.btn-flashed > :not(.btn-flash-text) {
    display: none;
}

.action-button.btn-flashed {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Secondary = translucent glass pill so the primary CTA stands alone. */
.action-button-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.action-button-secondary:hover:not(:disabled):not([aria-disabled="true"]) {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(120, 180, 255, 0.45);
}

[data-theme="light"] .action-button-secondary {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: none;
}

/* Primary = the single dominant CTA: vivid indigo->cyan gradient with a glow ring. */
.action-button-primary {
    background: linear-gradient(135deg, #6366f1, #22b6e6);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 10px 30px rgba(79, 90, 230, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.action-button-primary:hover:not(:disabled):not([aria-disabled="true"]) {
    background: linear-gradient(135deg, #6f78f5, #33c0ef);
    box-shadow: 0 16px 40px rgba(79, 90, 230, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Tactile press-scale on the pills (modern micro-interaction). */
.results-actions .action-button:active:not(:disabled):not([aria-disabled="true"]) {
    transform: scale(0.97);
}

/* Respect reduced-motion: no lift/transition for users who opt out. */
@media (prefers-reduced-motion: reduce) {
    .action-button {
        transition: none;
    }
    .action-button:hover:not(:disabled):not([aria-disabled="true"]),
    .results-actions .action-button:active:not(:disabled):not([aria-disabled="true"]) {
        transform: none;
    }
}

.action-button-danger {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.18), rgba(239, 68, 68, 0.1));
    border-color: rgba(248, 113, 113, 0.36);
    color: #fecaca;
    box-shadow: none;
}

.action-button-danger:hover:not(:disabled):not([aria-disabled="true"]) {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.26), rgba(239, 68, 68, 0.16));
    border-color: rgba(248, 113, 113, 0.52);
    box-shadow: 0 8px 22px rgba(127, 29, 29, 0.18);
}

.action-button-danger:focus-visible {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28), var(--shadow-md);
}

[data-theme="light"] .action-button-danger {
    color: #b91c1c;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.92), rgba(254, 242, 242, 0.78));
    border-color: rgba(185, 28, 28, 0.28);
}

.action-button:disabled,
.action-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 1;
    transform: none;
    box-shadow: none;
    background: var(--surface-elevated);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.action-button:disabled::after,
.action-button[aria-disabled="true"]::after {
    display: none;
}

.action-button:disabled svg,
.action-button[aria-disabled="true"] svg {
    opacity: 0.75;
}

@media (min-width: 769px) {
    .results-actions {
        grid-template-columns: repeat(2, minmax(180px, auto)) minmax(180px, auto);
        align-items: center;
        justify-content: start;
        gap: 10px;
        padding: 12px;
    }

    .results-actions .action-button {
        width: auto;
        min-width: 200px;
    }

    #delete-track-btn {
        justify-self: end;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .action-button {
        min-height: 46px;
        font-size: 0.9rem;
        padding: 11px 14px;
    }

    .action-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Results Section */
.results-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.results-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
    font-weight: 700;
}

/* Overall Score */
.overall-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
}


/* Animations */
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes particleFade {
    0% { transform: translate(0, 0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)); opacity: 0; }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Score achieved animations */
.score-achieved {
    animation: scoreAchieved 0.8s ease-out;
}

@keyframes scoreAchieved {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* When score changes to a new value */
.score-updated {
    animation: fadeIn 0.5s ease-out;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    border-bottom: none;
    padding: 0 10px;
}

.tab-button {
    padding: 12px 20px;
    margin: 0 3px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--primary-color);
    background-color: var(--card-bg);
}

.tab-button.active {
    color: white;
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.12);
}

/* Tab Content */
.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-pane.active {
    display: block;
    opacity: 1;
}

/* Score Cards */
.score-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius, var(--border-radius));
    padding: 28px 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.4s ease;
    z-index: 1;
}

.score-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(56, 189, 248, 0) 0%, 
        rgba(56, 189, 248, 0.08) 50%, 
        rgba(56, 189, 248, 0) 100%);
    z-index: 0;
    animation: shine 8s infinite;
}

.score-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.score-card h3 {
    position: relative;
    margin-bottom: 5px;
    color: var(--text-heading);
    font-weight: 600;
    font-size: 1rem;
    z-index: 2;
}

.score-card h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-xs);
    transition: width 0.3s ease;
}

.score-card:hover h3::after {
    width: 80px;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-heading);
    margin: 20px 0 10px;
    position: relative;
    display: inline-block;
    z-index: 2;
    transition: all 0.3s ease;
    letter-spacing: -0.02em;
}

.score-value::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.score-value::after {
    content: attr(data-label);
    position: absolute;
    bottom: -5px;
    right: -15px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.7;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.score-card:hover .score-value::before {
    opacity: 1;
    animation: pulse-glow 2s infinite;
}

.score-card:hover .score-value {
    transform: scale(1.05);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.score-card:hover .score-value::after {
    opacity: 1;
}

/* Frequency score special styling */
#frequency-score {
    color: var(--primary-light, var(--primary-color));
    position: relative;
    z-index: 2;
}

/* Animated particles for frequency score */
.frequency-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.frequency-particle {
    position: absolute;
    background-color: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
}

/* Circular progress indicator for frequency score */
.frequency-meter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) 0%, 
        var(--primary-color) var(--score-percentage), 
        rgba(56, 189, 248, 0.08) var(--score-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
    z-index: 0;
    opacity: .0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.03);
}

.frequency-meter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background-color: var(--background-color);
    z-index: 1;
}

.score-card:hover .frequency-meter {
    opacity: 0;
}

/* Animations */
@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

@keyframes pulse-glow {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.5; }
}

@keyframes pulse-gradient {
    0% { opacity: 0.4; filter: blur(8px); }
    100% { opacity: 0.9; filter: blur(12px); }
}

@keyframes float-particle {
    0% { transform: translate(0, 0); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)); opacity: 0; }
}

.score-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.score-container .score-card {
    flex: 1;
}

/* Analysis Card */
.analysis-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.analysis-card h3 {
    margin-bottom: 15px;
    color: var(--text-heading);
}

.analysis-card ul {
    list-style-type: none;
}

.analysis-card li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.analysis-card li:last-child {
    border-bottom: none;
}

.voice-ai-disclaimer {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--border-color);
    border-radius: var(--radius-xs);
    line-height: 1.5;
}

/* Metrics Container */
.metrics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.metric {
    flex: 1;
    min-width: 200px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.metric h4 {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Chart Container */
/* Secondary mood tags (top moods beyond the primary one) */
.mood-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.mood-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: var(--radius-pill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

/* Streaming loudness targets — platform card grid */
.streaming-targets-section {
    margin: 8px 0 26px;
}

.streaming-targets-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
}

.streaming-targets-hint {
    margin: 0 0 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-secondary, #94a3b8);
}

.streaming-targets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.streaming-target {
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.streaming-target:hover {
    transform: translateY(-2px);
    border-color: rgba(125, 211, 252, 0.4);
}

.streaming-target-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.streaming-target-name {
    font-weight: 700;
    font-size: 0.92rem;
}

.streaming-target-peak {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.streaming-target-peak--ok {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
}

.streaming-target-peak--over {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

.streaming-target-gain {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.streaming-target-gain--down { color: #fbbf24; }
.streaming-target-gain--up { color: #7dd3fc; }
.streaming-target-gain--ontarget { color: #4ade80; }
.streaming-target-gain--unknown {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.85rem;
    font-weight: 600;
}

.streaming-target-sub {
    margin-top: 6px;
    font-size: 0.74rem;
    color: var(--text-secondary, #94a3b8);
}

.chart-container {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px var(--border-color);
    padding: 32px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.08);
}

.chart-container h3 {
    margin-bottom: 24px;
    color: var(--text-color);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.chart-container h3::before {
    content: '📊';
    font-size: 1.2rem;
}

/* Modern Genre Chart Styling */
.chart-container canvas {
    position: relative;
    z-index: 1;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    padding: 16px;
    
}

/* Genre Chart Specific Styling */
#genre-tab .chart-container {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(56, 189, 248, 0.04) 100%);
}

[data-theme="light"] #genre-tab .chart-container {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(248, 250, 252, 0.98) 100%);
}

#genre-tab .chart-container h3::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
}

#genre-tab .chart-container::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: var(--radius-xs);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#genre-tab .chart-container:hover::after {
    opacity: 1;
}

#genre-tab .metrics-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.genre-score-card {
    padding: 26px 22px;
}

.genre-overview-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    max-width: 760px;
    margin: 24px auto 0;
}

.genre-primary {
    min-width: 0;
    text-align: left;
}

.genre-name {
    color: var(--text-heading);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.genre-confidence {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 600;
}

.genre-reliability-note {
    max-width: 520px;
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.genre-intent-card {
    border-color: rgba(56, 189, 248, 0.22);
}

.genre-intent-score {
    color: var(--text-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.genre-intent-label {
    margin: 8px 0 0;
    color: var(--text-color);
    font-weight: 700;
}

.genre-intent-note {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.genre-intent-card--strong .genre-intent-score { color: var(--success); }
.genre-intent-card--moderate .genre-intent-score { color: var(--warning); }
.genre-intent-card--low .genre-intent-score,
.genre-intent-card--unknown .genre-intent-score { color: var(--text-secondary); }

.genre-meta-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(104px, 1fr));
    gap: 12px;
}

.genre-meta-pill {
    min-height: 66px;
    padding: 12px 14px;
    border: 1px solid var(--chip-border);
    border-radius: var(--chip-radius);
    background: var(--chip-bg);
    box-shadow: var(--chip-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.genre-meta-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.genre-meta-value {
    color: var(--text-color);
    font-size: 1.18rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.genre-spectrum {
    position: relative;
    z-index: 1;
    padding-top: 8px;
}

.genre-spectrum-map {
    position: relative;
    width: 100%;
    max-width: 540px;
    min-height: 380px;
    margin: 0 auto;
    border: 1px solid rgba(56, 189, 248, 0.13);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.045), rgba(168, 85, 247, 0.04));
    overflow: hidden;
}

.genre-bubble {
    position: absolute;
    left: calc(var(--genre-x) - (var(--genre-size) / 2));
    top: calc(var(--genre-y) - (var(--genre-size) / 2));
    z-index: var(--genre-layer);
    width: var(--genre-size);
    height: var(--genre-size);
    border: 0;
    border-radius: var(--radius-pill);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.genre-bubble--high {
    background: linear-gradient(135deg, #16a34a, #059669);
}

.genre-bubble--medium {
    background: linear-gradient(135deg, #d97706, #c2410c);
}

.genre-bubble--low {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.genre-bubble:hover,
.genre-bubble:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34), 0 0 20px rgba(56, 189, 248, 0.16);
}

.genre-bubble:focus-visible {
    outline: 3px solid rgba(125, 211, 252, 0.86);
    outline-offset: 3px;
}

.genre-bubble-name {
    max-width: 100%;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.genre-bubble-score {
    font-size: 0.9rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.genre-spectrum-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.genre-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid var(--chip-border);
    border-radius: var(--chip-radius);
    color: var(--chip-text-muted);
    background: var(--chip-bg);
    box-shadow: var(--chip-shadow);
    font-size: 0.78rem;
    font-weight: 700;
}

.genre-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
}

.genre-legend-item--high .genre-legend-swatch {
    background: #16a34a;
}

.genre-legend-item--medium .genre-legend-swatch {
    background: #d97706;
}

.genre-legend-item--low .genre-legend-swatch {
    background: #dc2626;
}

.genre-spectrum-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 540px;
    margin: 18px auto 0;
}

.genre-spectrum-stat {
    min-height: 70px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.035);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.genre-spectrum-stat-value {
    color: var(--primary-light, var(--primary-color));
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.genre-spectrum-stat-label,
.genre-empty-state {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.genre-empty-state {
    margin: 20px 0;
    text-align: center;
}

@media (max-width: 768px) {
    #genre-tab .metrics-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .genre-score-card {
        padding: 22px 16px;
    }

    .genre-overview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 22px;
        text-align: center;
    }

    .genre-primary {
        text-align: center;
    }

    .genre-name {
        font-size: 1.75rem;
    }

    .genre-meta-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .genre-meta-pill {
        min-height: 58px;
        border-radius: var(--radius-lg);
    }

    .genre-spectrum-map {
        display: grid;
        gap: 10px;
        min-height: 0;
        padding: 12px;
        overflow: visible;
    }

    .genre-bubble {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        height: auto;
        min-height: 58px;
        border-radius: var(--radius-lg);
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 13px 14px;
    }

    .genre-bubble:hover,
    .genre-bubble:focus-visible {
        transform: none;
    }

    .genre-bubble-name {
        font-size: 0.95rem;
    }

    .genre-bubble-score {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .genre-meta-strip,
    .genre-spectrum-stats {
        grid-template-columns: 1fr;
    }
}

/* Chart Loading State */
.chart-container.loading {
    position: relative;
}

.chart-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(56, 189, 248, 0.06);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: chart-loading-spin 1s linear infinite;
    z-index: 2;
}

@keyframes chart-loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chart Error State */
.chart-container.error {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(254, 242, 242, 0.98);
}

.chart-container.error h3 {
    color: var(--danger);
}

.chart-container.error::before {
    background: 
        radial-gradient(circle at 20% 80%, rgba(239, 68, 68, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(220, 38, 38, 0.02) 0%, transparent 50%);
}

/* Chart Success State */
.chart-container.loaded {
    border-color: rgba(16, 185, 129, 0.2);
}

.chart-container.loaded::after {
    content: '✓';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    animation: chart-success-appear 0.5s ease-out 0.3s forwards;
}

@keyframes chart-success-appear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Chart Container */
@media (max-width: 768px) {
    .chart-container {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
        margin-bottom: 24px;
    }
    
    .chart-container h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .chart-container canvas {
        padding: 12px;
        border-radius: var(--radius-md);
    }
}

@media (max-width: 480px) {
    .chart-container {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }
    
    .chart-container h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
        flex-direction: column;
        gap: 8px;
    }
}

/* Visualization Grid */
.visualization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.visualization-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 15px;
}

.visualization-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 18px;
}

.visualization-container {
    position: relative;
    width: 100%;
    background-color: var(--background-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visualization-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

.visualization-container.error {
    border: 2px solid var(--danger);
}

.visualization-container.error img {
    opacity: 0.5;
}

.visualization-container.loaded {
    border: 2px solid var(--success);
}

.stereo-info.error {
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

.visualization-container.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.visualization-container.loading img {
    opacity: 0.5;
}

/* Regenerate button */
.regenerate-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: var(--card-bg);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 2;
}

.visualization-container:hover .regenerate-btn {
    opacity: 1;
}

.regenerate-btn:hover {
    background-color: var(--card-bg);
}

.regenerate-btn svg {
    color: var(--primary-color);
}

/* Stereo info */
.stereo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    font-size: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    z-index: 1;
}

.stereo-info.success {
    background-color: rgba(40, 167, 69, 0.8);
}

.stereo-info.warning {
    background-color: rgba(255, 193, 7, 0.8);
    color: var(--text-color);
}

.stereo-info.info {
    background-color: rgba(23, 162, 184, 0.8);
}

/* AI Insights Styles */
.ai-insights-container {
    padding: 20px;
}

.ai-header {
    text-align: center;
    margin-bottom: 30px;
}

.ai-header h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-powered-by {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ai-quality-banner {
    margin-bottom: 24px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid color-mix(in srgb, var(--primary-color) 14%, transparent);
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--primary-color) 12%, transparent), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 94%, white 6%) 0%, var(--card-bg) 100%);
    box-shadow: var(--shadow-md);
}

.ai-quality-banner[hidden] {
    display: none !important;
}

.ai-quality-banner[data-quality-tier="free"] {
    border-color: rgba(245, 158, 11, 0.22);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 44%),
        linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 94%, white 6%) 0%, var(--card-bg) 100%);
}

.ai-quality-banner[data-quality-tier="premium"] {
    border-color: rgba(56, 189, 248, 0.22);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 40%),
        linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 92%, white 8%) 0%, var(--card-bg) 100%);
}

.ai-quality-banner[data-quality-tier="warning"] {
    border-color: rgba(244, 63, 94, 0.24);
    background:
        radial-gradient(circle at top right, rgba(244, 63, 94, 0.14), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 93%, white 7%) 0%, var(--card-bg) 100%);
}

.ai-quality-banner-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ai-quality-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(245, 158, 11, 0.24);
    border-radius: var(--chip-radius-sm);
    box-shadow: var(--chip-shadow);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--chip-bg);
    color: #f59e0b;
}

.ai-quality-banner[data-quality-tier="premium"] .ai-quality-badge {
    color: var(--primary-color);
    border-color: rgba(56, 189, 248, 0.24);
}

.ai-quality-banner[data-quality-tier="warning"] .ai-quality-badge {
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.24);
}

#ai-quality-title {
    color: var(--text-color);
}

.ai-quality-banner p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-sections-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.ai-section-card {
    flex: 1;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.ai-section-card h4 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.2rem;
}

.ai-section-card ul {
    list-style-type: none;
}

.ai-section-card li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.ai-section-card li:last-child {
    border-bottom: none;
}

/* Plugin-aware advice preview (results-page Studio Profile card) */
.ai-plugin-preview {
    margin: 14px 0 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ai-plugin-preview__row {
    margin: 0;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.ai-plugin-preview__row--aware {
    border-top: 1px solid var(--border-color);
    background: var(--surface-elevated);
    color: var(--text-color);
}

.ai-plugin-preview__tag {
    display: block;
    margin-bottom: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ai-plugin-preview__tag--aware {
    color: var(--primary-color);
}

.ai-plugin-preview__note {
    margin: 0 0 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Locked teaser (free users): blur only the labeled example rows */
.ai-plugin-preview--locked .ai-plugin-preview__row {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

/* Live "Your chain" (supporters) */
.plugin-chain-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plugin-chain-skeleton {
    animation: plugin-chain-pulse 1.2s ease-in-out infinite;
}

@keyframes plugin-chain-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.plugin-chain-moves {
    list-style: none;
    margin: 12px 0 6px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.plugin-chain-moves li {
    padding: 10px 14px;
    font-size: 0.92rem;
    color: var(--text-color);
}

.plugin-chain-moves li + li {
    border-top: 1px solid var(--border-color);
}

.plugin-chain-moves strong {
    color: var(--primary-color);
}

@media (prefers-reduced-motion: reduce) {
    .plugin-chain-skeleton { animation: none; }
}

/* Per-dimension "Get tips from my Gear" sections */
.gear-tips {
    margin: 12px 0 20px;
}

.gear-tips--upgrade {
    border: 1px solid color-mix(in srgb, var(--primary-color) 24%, transparent);
    background: linear-gradient(135deg, var(--surface-elevated), color-mix(in srgb, var(--primary-color) 8%, var(--surface-elevated)));
}

.gear-tips--upgrade .btn-api-primary {
    display: flex;
    justify-content: center;
    width: 100%;
}

.gear-tips-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.gear-tips-header h4 {
    margin: 0;
}

.gear-tips-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--chip-radius-sm);
    background: var(--chip-bg);
    color: var(--primary-color);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.gear-tips-subtext {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.85;
}

.gear-tips-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.gear-tips-chain-link {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.gear-tips-chain-link:hover {
    color: var(--primary-color);
}

.gear-tips-subheading {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.gear-tips-move {
    animation: gear-tip-in 0.35s ease both;
}

.gear-tips-moves {
    animation: gear-tip-in 0.35s ease both;
}

@keyframes gear-tip-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.gear-tips-locked-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.gear-tips-lock {
    font-size: 0.9rem;
}

.gear-tips-fav {
    color: var(--warning);
}

@media (prefers-reduced-motion: reduce) {
    .gear-tips-move { animation: none; }
    .gear-tips-moves { animation: none; }
}

.ai-suggestions-card {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.ai-suggestions-card h4 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.2rem;
}

.ai-suggestions-card ul {
    list-style-type: none;
}

.ai-suggestions-card li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 30px;
}

.ai-suggestions-card li:before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 12px;
}

.ai-suggestions-card li:last-child {
    margin-bottom: 0;
}

.ai-genre-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.ai-genre-card h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.ai-genre-card p {
    line-height: 1.6;
    color: var(--text-color);
}

.ai-reference-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.ai-reference-card h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.ai-reference-card ul {
    list-style-type: none;
}

.ai-reference-card li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.ai-reference-card li:before {
    content: "🎵";
    position: absolute;
    left: 0;
    top: 2px;
}

.ai-reference-card li:last-child {
    margin-bottom: 0;
}

.ai-processing-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.ai-processing-card h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.ai-processing-card ul {
    list-style-type: none;
}

.ai-processing-card li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.ai-processing-card li:before {
    content: "⚙️";
    position: absolute;
    left: 0;
    top: 2px;
}

.ai-processing-card li:last-child {
    margin-bottom: 0;
}

.ai-translation-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.ai-translation-card h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.ai-translation-card ul {
    list-style-type: none;
}

.ai-translation-card li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
}

.ai-translation-card li:before {
    content: "🔊";
    position: absolute;
    left: 0;
    top: 2px;
}

.ai-translation-card li:last-child {
    margin-bottom: 0;
}

/* Transients tab styles */
#transients-chart {
    width: 100%;
    max-height: 300px;
    margin-top: 10px;
}

.transients-visualization {
    width: 100%;
    height: auto;
    margin-top: 10px;
    border-radius: var(--border-radius);
}

.ai-error {
    background-color: color-mix(in srgb, var(--danger) 15%, var(--card-bg));
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
}

/* Footer styles */
footer,
.site-footer {
    color: var(--text-color);
}

.site-footer {
    --footer-text: #f8fafc;
    --footer-muted: rgba(203, 213, 225, 0.76);
    --footer-border: rgba(148, 163, 184, 0.16);
    margin-top: 56px;
    padding: 28px 0 calc(40px + env(safe-area-inset-bottom));
    background:
        linear-gradient(180deg, #0b0d24 0%, #070717 100%);
    border-top: 1px solid rgba(56, 189, 248, 0.14);
    color: var(--footer-text);
    box-shadow: 0 -18px 48px rgba(2, 6, 23, 0.28);
    position: relative;
    z-index: 2;
    isolation: isolate;
    overflow: hidden;
}

.footer-shell {
    width: min(100%, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-brand,
.footer-nav,
.footer-bottom {
    min-width: 0;
}

.footer-brand {
    display: grid;
    gap: 14px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--footer-border);
}

.footer-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: var(--footer-text);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 800;
}

.footer-brand-mark .footer-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    filter: drop-shadow(0 12px 22px rgba(34, 211, 238, 0.18));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.footer-brand-mark:hover .footer-logo {
    filter: drop-shadow(0 14px 26px rgba(34, 211, 238, 0.24));
    transform: translateY(-1px);
}

.footer-brand p {
    max-width: 640px;
    color: var(--footer-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.footer-cta-row {
    display: grid;
    gap: 10px;
}

.footer-cta,
.footer-support-link,
.footer-links a {
    min-height: 44px;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.footer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    color: var(--text-on-primary);
    background: var(--gradient-primary);
    font-weight: 800;
}

.footer-cta--secondary {
    color: var(--footer-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--footer-border);
}

.footer-nav {
    display: grid;
    gap: 0;
    padding: 22px 0;
}

.footer-section {
    min-width: 0;
    border-bottom: 1px solid var(--footer-border);
}

.footer-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
    margin: 0;
    color: var(--footer-text);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    list-style: none;
    text-transform: uppercase;
}

.footer-title::-webkit-details-marker {
    display: none;
}

.footer-title::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--primary-light);
    border-bottom: 2px solid var(--primary-light);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.footer-section[open] .footer-title::after {
    transform: rotate(225deg);
}

.footer-links {
    display: grid;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section[open] .footer-links {
    padding: 0 0 14px;
}

.footer-links a {
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--footer-muted);
    font-size: 0.96rem;
    line-height: 1.35;
}

.footer-cta:hover,
.footer-links a:hover,
.footer-support-link:hover {
    color: var(--primary-light);
    transform: translateY(-1px);
}

.footer-cta:focus-visible,
.footer-links a:focus-visible,
.footer-support-link:focus-visible,
.footer-brand-mark:focus-visible {
    outline: 3px solid var(--input-focus);
    outline-offset: 3px;
}

.footer-bottom {
    display: grid;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--footer-border);
    color: var(--footer-muted);
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-support-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: var(--primary-light);
    font-weight: 800;
}

@media (min-width: 640px) {
    .footer-cta-row {
        display: flex;
        flex-wrap: wrap;
    }

    .footer-cta {
        min-width: 170px;
        padding: 0 18px;
    }

    .footer-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 22px;
    }

    .footer-section {
        border-bottom: 0;
    }

    .footer-title {
        min-height: auto;
        margin: 0 0 10px;
        cursor: default;
        pointer-events: none;
    }

    .footer-title::after {
        display: none;
    }

    .footer-section[open] .footer-links {
        padding: 0;
    }
}

@media (min-width: 900px) {
    .site-footer {
        margin-top: 72px;
        padding: 36px 0 calc(36px + env(safe-area-inset-bottom));
    }

    .footer-shell {
        padding: 0 28px;
    }

    .footer-brand {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 28px;
    }

    .footer-brand p {
        grid-column: 1;
    }

    .footer-cta-row {
        grid-column: 2;
        grid-row: 1 / span 2;
        justify-content: end;
        align-self: center;
    }

    .footer-bottom {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .fab-api {
        display: none !important;
    }
}

.instrumental-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding: 5px 9px;
    background: var(--chip-bg);
    color: var(--chip-text);
    border: 1px solid var(--chip-border);
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--chip-radius-sm);
    box-shadow: var(--chip-shadow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Screen reader only text - hidden visually but available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* About Page Styles */
.about-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.about-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.about-section h3 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--text-secondary);
}

.about-section h4 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-secondary);
}

.about-section p {
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
}

.tech-grid, .ai-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tech-card, .ai-feature {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.tech-card:hover, .ai-feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.library-section ul {
    list-style-type: none;
    padding-left: 0;
}

.library-section li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.library-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.workflow-section ol {
    counter-reset: workflow-counter;
    list-style-type: none;
    padding-left: 0;
}

.workflow-section li {
    margin-bottom: 1rem;
    padding-left: 2.5rem;
    position: relative;
    counter-increment: workflow-counter;
}

.workflow-section li:before {
    content: counter(workflow-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.privacy-section {
    background-color: var(--surface-elevated);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid var(--primary-color);
}

.cta-section {
    text-align: center;
    margin: 3rem 0;
    padding: 2rem;
    background-color: var(--surface-elevated);
    border-radius: var(--radius-sm);
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-xs);
    text-decoration: none;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: var(--primary-dark);
}

/* Locked-tab upgrade modal */
.locked-upgrade-modal {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.locked-upgrade-copy {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
}

.locked-upgrade-free-note {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: var(--chip-radius);
    background: var(--chip-bg-strong);
    border: 1px solid var(--chip-border-strong);
    box-shadow: var(--chip-shadow);
    color: var(--chip-text);
    font-size: 0.88rem;
    font-weight: 700;
}

.locked-upgrade-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.locked-upgrade-benefits li {
    position: relative;
    padding-left: 22px;
    color: var(--text-secondary);
}

.locked-upgrade-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success);
    font-weight: 700;
}

.locked-upgrade-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.locked-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.locked-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.locked-upgrade-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), var(--shadow-sm);
}

.locked-upgrade-btn-primary {
    background: linear-gradient(135deg, #2cbaf4, #1f9ce0);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #fff;
}

.locked-upgrade-btn-primary:hover {
    background: linear-gradient(135deg, #3ac3f8, #2aa8eb);
}

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

.locked-upgrade-btn-secondary:hover {
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .locked-upgrade-actions {
        flex-direction: column;
    }

    .locked-upgrade-btn {
        width: 100%;
    }

    .locked-upgrade-copy {
        font-size: 1rem;
    }
}

/* Make the about page responsive */
@media (max-width: 768px) {
    .tech-grid, .ai-features {
        grid-template-columns: 1fr;
    }
    
    .about-section {
        padding: 1rem;
    }
    
    .about-section h2 {
        font-size: 1.8rem;
    }
    
    .about-section h3 {
        font-size: 1.5rem;
    }
}

/* Tech Card Expandable Styles */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    position: relative;
}

.tech-card {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    border: 1px solid rgba(56, 189, 248, 0.03);
    backdrop-filter: var(--glass-blur);
}

.tech-card.expanded {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 2;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    background: var(--card-bg);
}

.tech-card:not(.expanded):hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.06);
    border-color: var(--border-color);
}

.tech-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.tech-card-header h4 {
    margin: 0;
    flex: 1;
    padding-right: 1.5rem;
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
}

.expand-button {
    background: none;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin: -0.5rem;
}

.expand-button svg {
    width: 24px;
    height: 24px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand-button:hover {
    opacity: 1;
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.expand-button.expanded {
    background-color: rgba(56, 189, 248, 0.06);
    opacity: 1;
}

.expand-button.expanded svg {
    transform: rotate(180deg);
}

.tech-card-preview {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.05rem;
    transition: opacity 0.3s ease;
}

.tech-card.expanded .tech-card-preview {
    opacity: 0.85;
}

.tech-card-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(56, 189, 248, 0.015);
    border-radius: var(--radius-md);
    padding: 0;
    margin-top: 1rem;
    border: 1px solid transparent;
}

.tech-card-details.expanded {
    max-height: 2000px;
    opacity: 1;
    padding: 2rem;
    border-color: var(--border-color);
}

.detail-section {
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-card-details.expanded .detail-section {
    opacity: 1;
    transform: translateY(0);
}

.detail-section h5 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.detail-section ul {
    list-style: none;
    padding-left: 1.5rem;
}

.detail-section li {
    position: relative;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.detail-section li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: -1.5rem;
    font-size: 1.4em;
    line-height: 1;
    opacity: 0.8;
}

.tech-card-cta {
    margin-top: 2.5rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-card-details.expanded .tech-card-cta {
    opacity: 1;
    transform: translateY(0);
}

.analyze-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
    font-size: 1.05rem;
}

.analyze-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.2);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tech-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .tech-card.expanded {
        position: relative;
        margin: -1rem;
        width: calc(100% + 2rem);
    }

    .tech-card-header h4 {
        font-size: 1.25rem;
    }

    .expand-button {
        width: 40px;
        height: 40px;
    }

    .tech-card-details.expanded {
        padding: 1.5rem;
    }
}

/* Accessibility helpers */
.skip-link {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 16px;
    z-index: 2000;
    padding: 10px 14px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: #0a0a1a;
    font-weight: 800;
    transform: translateY(calc(-100% - 24px));
}

.skip-link:focus {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Ensure interactive elements have visible focus states.
   :focus-visible, not :focus — [tabindex] also matches main#main-content and
   section#results-section (both tabindex="-1"), which browsers focus on click,
   drawing a ring around the whole region. Keyboard focus still shows the ring,
   and text inputs still get it on click because browsers always treat
   text-entry focus as focus-visible. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Rest of CSS */
.tab-pane#spatial-tab {
    padding: 20px;
}

.tab-pane#spatial-tab .score-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius, 10px);
    padding: 28px 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.tab-pane#spatial-tab .metrics-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.tab-pane#spatial-tab .metric {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.tab-pane#spatial-tab .metric h4 {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.tab-pane#spatial-tab .metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.tab-pane#spatial-tab .analysis-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.tab-pane#spatial-tab .analysis-card h3 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.tab-pane#spatial-tab .analysis-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tab-pane#spatial-tab .analysis-card li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.tab-pane#spatial-tab .analysis-card li:last-child {
    border-bottom: none;
}

.tab-pane#spatial-tab .visualization-container {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-top: 20px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.tab-pane#spatial-tab .visualization-container:hover {
    transform: scale(1.02);
}

.tab-pane#spatial-tab .visualization-container img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xs);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-pane#spatial-tab .metrics-container {
        grid-template-columns: 1fr;
    }
    
    .tab-pane#spatial-tab .metric {
        margin-bottom: 15px;
    }
    
    .tab-pane#spatial-tab .visualization-container {
        margin-top: 15px;
    }
}

.score-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 0.5em;
    text-align: center;
}

.metric-description {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 0.25em;
    text-align: center;
}

.analysis-description {
    background-color: var(--surface-elevated);
    border-radius: var(--radius-sm);
    padding: 1em;
    margin-bottom: 1em;
}

.analysis-description p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.5;
}

.visualization-help {
    font-size: 0.95em;
    color: var(--text-color);
    margin: 1em 0;
}

.visualization-legend {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5em 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5em;
}

.visualization-legend li {
    background-color: var(--surface-elevated);
    padding: 0.5em 1em;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--text-secondary);
}

.visualization-legend li strong {
    color: var(--text-color);
    margin-right: 0.5em;
}

#spatial-tab .visualization-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5em;
    margin-top: 2em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#spatial-tab .visualization-container h3 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.2em;
}

#regenerate-spatial-btn {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin: 1em auto 0;
    padding: 0.5em 1em;
    background-color: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

#regenerate-spatial-btn:hover {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

#regenerate-spatial-btn svg {
    transition: transform 0.3s ease;
}

#regenerate-spatial-btn:hover svg {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .visualization-legend {
        grid-template-columns: 1fr;
    }
    
    #spatial-tab .visualization-container {
        padding: 1em;
    }
    
    .metric-description {
        font-size: 0.8em;
    }
}

/* AI Frequency Card */
.ai-frequency-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ai-frequency-card .ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ai-frequency-card .ai-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
}

.ai-frequency-card .ai-section-card {
    margin-top: 15px;
    padding-bottom: 10px;
}

.ai-frequency-card .ai-section-card h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.ai-frequency-card ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
}

.ai-frequency-card ul li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: var(--text-color);
}

.ai-origin-card {
    --ai-origin-hue: 199;
    display: grid;
    align-items: stretch;
    gap: 18px;
    padding: 20px;
    background:
        radial-gradient(circle at top right, hsla(var(--ai-origin-hue), 70%, 55%, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        var(--card-bg);
    border-color: hsla(var(--ai-origin-hue), 55%, 55%, 0.24);
}

.ai-origin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.ai-origin-card-head > div {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.ai-origin-card h3 {
    color: var(--text-heading, var(--text-color));
    font-size: 1.3rem;
}

.ai-origin-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.55;
}

.ai-origin-eyebrow,
.ai-origin-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.ai-origin-eyebrow {
    gap: 7px;
    color: var(--text-secondary);
}

.ai-origin-eyebrow span,
.ai-origin-status-pill {
    padding: 6px 8px;
    border: 1px solid hsla(var(--ai-origin-hue), 55%, 55%, 0.35);
    border-radius: var(--radius-sm);
    color: hsl(var(--ai-origin-hue), 68%, 62%);
    background: hsla(var(--ai-origin-hue), 70%, 50%, 0.1);
    letter-spacing: 0;
}

.ai-origin-status-pill {
    flex: 0 0 auto;
}

.ai-origin-card-body {
    display: grid;
    grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
    gap: 18px;
    align-items: end;
}

.ai-origin-probability-block {
    display: grid;
    gap: 7px;
    justify-items: start;
    min-width: 0;
}

.ai-origin-probability-block .score-value {
    margin: 0;
    color: hsl(var(--ai-origin-hue), 68%, 58%);
    font-size: clamp(2.4rem, 8vw, 4rem);
    line-height: 0.9;
}

.ai-origin-probability-block > span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.ai-origin-card-summary {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.ai-origin-card-summary strong {
    color: var(--text-heading, var(--text-color));
    font-size: 1rem;
    line-height: 1.25;
}

.ai-origin-confidence-track {
    height: 8px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.ai-origin-confidence-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: hsl(var(--ai-origin-hue), 68%, 58%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.15, 1), background 0.25s ease;
}

.ai-origin-segments {
    display: grid;
    gap: 12px;
}

.ai-origin-segment,
.ai-origin-segment-empty {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: var(--card-bg);
}

.ai-origin-segment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.ai-origin-segment-top span {
    flex: 0 0 auto;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-color);
}

.ai-origin-segment p,
.ai-origin-segment-empty {
    margin: 0;
    color: var(--text-color);
    line-height: 1.45;
}

[data-theme="light"] .ai-origin-card {
    background:
        radial-gradient(circle at top right, hsla(var(--ai-origin-hue), 70%, 45%, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.03), rgba(15, 23, 42, 0.01)),
        var(--card-bg);
}

[data-theme="light"] .ai-origin-confidence-track {
    background: rgba(15, 23, 42, 0.1);
}

@media (prefers-reduced-motion: reduce) {
    .ai-origin-confidence-track span {
        transition: none;
    }
}

@media (max-width: 560px) {
    .ai-origin-card {
        padding: 18px;
    }

    .ai-origin-card-head,
    .ai-origin-card-body {
        grid-template-columns: 1fr;
    }

    .ai-origin-card-head {
        display: grid;
    }

    .ai-origin-status-pill {
        justify-self: start;
    }
}

/* Modern Buttons */
.btn {
    --btn-gradient: var(--gradient-accent);
    position: relative;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-weight: 600;
    color: white;
    background: var(--btn-gradient);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--btn-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

/* Modern Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius);
    border: var(--glass-border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 20px;
}

/* ======================
   LAYOUT IMPROVEMENTS
   ====================== */

/* Base Layout Structure */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 
        [full-start] minmax(2rem, 1fr) 
        [main-start] minmax(0, 1200px) [main-end]
        minmax(2rem, 1fr) [full-end];
}

.container > * {
    grid-column: main;
}

.full-bleed {
    grid-column: full;
    width: 100%;
}

/* Main Content Sections */
.main-content {
    display: grid;
    gap: 3rem;
    padding: 3rem 0;
}

.section {
    display: grid;
    gap: 2rem;
}

/* Responsive Grid Adjustments */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
        grid-template-columns: 
            [full-start] minmax(1.5rem, 1fr) 
            [main-start] minmax(0, 100%) [main-end]
            minmax(1.5rem, 1fr) [full-end];
    }
}

@media (max-width: 768px) {
    .main-content {
        gap: 2rem;
        padding: 2rem 0;
    }
}

/* Dynamic Range score special styling */
#dynamics-score {
    color: var(--primary-light, var(--primary-color));
    position: relative;
    z-index: 2;
}

/* Animated particles for dynamics score */
.dynamics-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.dynamics-particle {
    position: absolute;
    background-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
}

/* Circular progress indicator for dynamics score */
.dynamics-meter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent) 0%, 
        var(--accent) var(--dynamics-percentage), 
        rgba(56, 189, 248, 0.08) var(--dynamics-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
    z-index: 0;
    opacity: .0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 0 5px rgba(168, 85, 247, 0.05);
}

.dynamics-meter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background-color: var(--background-color);
    z-index: 1;
}

/* Stereo Width Score */
#width-score {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    color: var(--text-heading);
    font-size: 2.8rem;
}

#width-score::after {
    content: attr(data-label);
    font-size: 1rem;
    position: absolute;
    right: -1.5rem;
    top: 0.5rem;
    opacity: 0.7;
}

/* Stereo Phase Score */
#phase-score {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    color: var(--text-heading);
    font-size: 2.8rem;
}

#phase-score::after {
    content: attr(data-label);
    font-size: 1rem;
    position: absolute;
    right: -1.5rem;
    top: 0.5rem;
    opacity: 0.7;
}

/* Stereo Width Meter */
.stereo-width-meter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    z-index: 0;
    opacity: 0.1;
    transition: all 0.3s ease;
}

.stereo-width-meter::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    background-color: var(--background-color);
    z-index: 1;
}

/* Stereo Width Score Card Hover Effects */
.score-card:has(#width-score):hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.score-card:has(#width-score):hover .stereo-width-meter {
    opacity: 0.3;
}

.score-card:has(#width-score):hover #width-score {
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* Stereo Width Particles Container */
.stereo-width-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

/* Stereo Width Particle Animation */
@keyframes stereo-width-particle-float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

/* Stereo Phase Meter */
.stereo-phase-meter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent) 0%, 
        var(--accent) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
    z-index: 0;
    opacity: 0.1;
    transition: all 0.3s ease;
}

.stereo-phase-meter::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    background: var(--card-bg);
    z-index: 1;
}

/* Stereo Phase Score Card Hover Effects */
.score-card:has(#phase-score):hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.score-card:has(#phase-score):hover .stereo-phase-meter {
    opacity: 0.3;
}

.score-card:has(#phase-score):hover #phase-score {
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* Phase Wave Animation */
.stereo-phase-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    overflow: hidden;
}

.stereo-phase-wave::before,
.stereo-phase-wave::after {
    content: '';
    position: absolute;
    left: 0;
    width: 200%;
    height: 100%;
    background-repeat: repeat-x;
    opacity: 0.15;
    animation: phaseWaveAnimation var(--before-duration, 13s) linear infinite;
}

.stereo-phase-wave::before {
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='%235e60ce' opacity='.25'%3E%3C/path%3E%3C/svg%3E");
}

.stereo-phase-wave::after {
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='%2348bfe3' opacity='.25'%3E%3C/path%3E%3C/svg%3E");
    animation-duration: var(--after-duration, 7s);
    animation-direction: reverse;
}

@keyframes phaseWaveAnimation {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Stereo Phase Particles Container */
.stereo-phase-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

/* Stereo Phase Particle Animation */
@keyframes stereo-phase-particle-float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

/* Score Card Meter Color Classes for Width */
.stereo-width-meter.excellent {
    background: conic-gradient(
        var(--success) 0%, 
        var(--success) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

.stereo-width-meter.good {
    background: conic-gradient(
        var(--info) 0%, 
        var(--info) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

.stereo-width-meter.average {
    background: conic-gradient(
        var(--warning) 0%, 
        var(--warning) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

.stereo-width-meter.poor {
    background: conic-gradient(
        var(--danger) 0%, 
        var(--danger) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) var(--width-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

/* Score Card Meter Color Classes for Phase */
.stereo-phase-meter.excellent {
    background: conic-gradient(
        var(--success) 0%, 
        var(--success) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

.stereo-phase-meter.good {
    background: conic-gradient(
        var(--info) 0%, 
        var(--info) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

.stereo-phase-meter.average {
    background: conic-gradient(
        var(--warning) 0%, 
        var(--warning) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

.stereo-phase-meter.poor {
    background: conic-gradient(
        var(--danger) 0%, 
        var(--danger) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) var(--phase-percentage), 
        rgba(56, 189, 248, 0.08) 100%
    );
}

/* Stereo Width Particle */
.stereo-width-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: rgba(56, 189, 248, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    animation: stereo-width-particle-float 1s ease-out forwards;
}

@keyframes stereo-width-particle-float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

/* Stereo Phase Particle */
.stereo-phase-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: rgba(56, 189, 248, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    animation: stereo-phase-particle-float 1s ease-out forwards;
}

@keyframes stereo-phase-particle-float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

.dynamics-particles,
.stereo-width-particles,
.stereo-phase-particles {
    display: none; /* Hide particle containers */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

/* Header right column container */
.header-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

@media (min-width: 769px) {
    .header-right {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .app-title {
        margin-bottom: 0;
    }
    
    .header-actions {
        margin-left: auto;
    }
}

/* Feedback button */
.feedback-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    height: 36px;
}

/* Heart counter on coffee button */
.heart-count {
    position: absolute;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
}

.heart-count::before {
    content: '♥';
    margin-right: 3px;
    font-size: 14px;
    color: white;
}

@media (max-width: 480px) {
    .heart-count {
        font-size: 11px;
        right: 8px;
    }
    
    .heart-count::before {
        font-size: 12px;
    }
}

/* About page title */
.about-title {
    margin-bottom: 30px;
}

.about-title h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.about-title p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .about-title h2 {
        font-size: 1.5rem;
    }
    
    .about-title p {
        font-size: 0.95rem;
    }
}

.upload-container {
    position: relative;
    margin: 40px auto;
    max-width: 800px;
}

/* Processing indicator removed - using progress-bar for all feedback */

.upload-help-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
    opacity: 0.8;
}

/* Studio Profile CTA — a prominent "make the most of the wait" card shown during analysis,
   inviting the user to add their plugins so AI feedback adapts to their real gear. The analysis
   keeps running in the background, so following the CTA is safe (see nav status indicator). */
.studio-profile-nudge {
    position: relative;
    margin-top: 18px;
    padding: 20px 22px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(56, 189, 248, 0.06));
    text-align: left;
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.4s ease, padding 0.4s ease;
}

.studio-profile-nudge.is-dismissed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

.studio-profile-nudge__dismiss {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 18px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.studio-profile-nudge__dismiss:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.14);
}

.studio-profile-nudge__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.studio-profile-nudge__title {
    margin: 0 0 8px;
    padding-right: 28px;
    font-size: 19px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-color);
}

.studio-profile-nudge__copy {
    margin: 0 0 16px;
    max-width: 48ch;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.studio-profile-nudge__meter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.studio-profile-nudge__track {
    flex: 1;
    height: 8px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.12);
    overflow: hidden;
}

.studio-profile-nudge__fill {
    height: 100%;
    width: var(--sp-fill, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    animation: sp-nudge-fill 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.25s both;
}

@keyframes sp-nudge-fill {
    from { width: 0; }
    to { width: var(--sp-fill, 0%); }
}

.studio-profile-nudge__count {
    font-size: 14px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.studio-profile-nudge__count strong {
    color: var(--primary-color);
    font-size: 16px;
}

.studio-profile-nudge__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.studio-profile-nudge__cta span { transition: transform 0.15s ease; }

.studio-profile-nudge__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32);
}

.studio-profile-nudge__cta:hover span { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
    .studio-profile-nudge { transition: opacity 0.2s ease; }
    .studio-profile-nudge__fill { animation: none; }
    .studio-profile-nudge__cta,
    .studio-profile-nudge__cta span { transition: none; }
    .studio-profile-nudge__cta:hover { transform: none; }
    .studio-profile-nudge__cta:hover span { transform: none; }
    .progress-container[data-realtime-status] .progress-bar-container::after { animation: none; display: none; }
    .progress-container[data-realtime-status="receiving"] .progress-step.active .step-indicator { animation: none; }
}

/* Background-analysis status pill in the header (driven by analysis-tracker.js).
   Lets the user navigate away (e.g. to add plugins) without losing their analysis. */
.analysis-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.analysis-status-pill[hidden] { display: none; }

.analysis-status-pill:hover { background: rgba(99, 102, 241, 0.2); }

.analysis-status-pill__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    flex: 0 0 auto;
    animation: analysis-pill-pulse 1.4s ease-in-out infinite;
}

.analysis-status-pill--done {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.4);
}

.analysis-status-pill--done .analysis-status-pill__dot {
    background: var(--success, #22c55e);
    animation: none;
}

.analysis-status-pill__view { color: var(--primary-color); }
.analysis-status-pill--done .analysis-status-pill__view { color: var(--success, #22c55e); }

@keyframes analysis-pill-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
    .analysis-status-pill__dot { animation: none; }
}

.upload-area--auth-required {
    cursor: default;
    border-color: rgba(56, 189, 248, 0.34);
}

.upload-area--auth-required .upload-icon {
    opacity: 0.9;
}

.upload-auth-gate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.upload-auth-gate__primary,
.upload-auth-gate__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    font-size: 0.96rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.upload-auth-gate__primary {
    min-width: 210px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #2ea9f5, #8b5cf6);
    color: #fff;
    box-shadow: 0 18px 34px rgba(59, 130, 246, 0.24);
}

.upload-auth-gate__secondary {
    min-width: 120px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-heading);
}

.upload-auth-gate__primary:hover,
.upload-auth-gate__secondary:hover {
    transform: translateY(-1px);
}

.upload-auth-gate--pulse .upload-auth-gate__primary {
    animation: upload-auth-pulse 0.85s ease;
}

@keyframes upload-auth-pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.38); }
    100% { box-shadow: 0 0 0 18px rgba(56, 189, 248, 0); }
}

@media (max-width: 560px) {
    .upload-auth-gate {
        flex-direction: column;
        width: 100%;
    }

    .upload-auth-gate__primary,
    .upload-auth-gate__secondary {
        width: min(100%, 320px);
    }
}

.button-wrapper {
    position: relative;
    margin-top: 30px;
    margin-bottom: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Arrow indicator positioned relative to button wrapper */
.button-wrapper::before {
    content: "";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid var(--text-secondary);
    animation: bounce 1.5s infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.show-button-indicator .button-wrapper::before {
    opacity: 1;
}

/* Track type prompt -- shown after file select, before analysis */
.track-type-prompt {
    max-width: 940px;
    margin: 0 auto 30px;
    padding: 28px;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 28%),
        radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.12), transparent 30%),
        var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.28);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.track-type-prompt.hidden-until-file {
    display: none;
}

.upload-setup-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.upload-setup-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.upload-setup-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 4px;
}

.upload-stepper-step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.45;
    transition: opacity 0.3s ease;
}

.upload-stepper-step.is-active {
    opacity: 1;
}

.upload-stepper-step.is-complete {
    opacity: 0.75;
}

.upload-stepper-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.upload-stepper-step.is-active .upload-stepper-icon {
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.upload-stepper-step.is-complete .upload-stepper-icon {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(125, 211, 252, 0.35);
    color: var(--primary-light);
}

.upload-stepper-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.upload-stepper-step.is-active .upload-stepper-label {
    color: var(--text-heading);
}

.upload-stepper-connector {
    width: 48px;
    height: 2px;
    background: rgba(148, 163, 184, 0.2);
    margin: 0 12px;
    border-radius: var(--radius-xs);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

.upload-stepper-connector.is-filled {
    background: rgba(56, 189, 248, 0.4);
}

.track-type-question {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.upload-setup-copy {
    max-width: 620px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.upload-selection-label,
.upload-selection-value,
.upload-selection-credit,
.upload-selection-separator {
    font-size: 0.86rem;
    line-height: 1.4;
}

.upload-selection-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.upload-selection-value,
.upload-selection-credit {
    color: var(--text-heading);
    font-weight: 700;
}

.upload-selection-separator {
    color: var(--text-secondary);
    opacity: 0.65;
}

.upload-setup-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-setup-panel[hidden],
.upload-setup-head[hidden],
.upload-selection-summary[hidden] {
    display: none !important;
}

.upload-credit-topup-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(251, 191, 36, 0.32);
    background:
        linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(14, 165, 233, 0.1)),
        rgba(15, 23, 42, 0.62);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.24);
    text-align: left;
}

.upload-credit-topup-panel[hidden] {
    display: none !important;
}

.upload-credit-topup-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.upload-credit-topup-kicker {
    color: #facc15;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.upload-credit-topup-copy h3 {
    margin: 0;
    color: var(--text-heading);
    font-size: clamp(1rem, 2.6vw, 1.18rem);
    line-height: 1.2;
}

.upload-credit-topup-copy p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.upload-credit-topup-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    min-width: 150px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #fbbf24, #38bdf8);
    color: #07111f;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(251, 191, 36, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.upload-credit-topup-button:hover,
.upload-credit-topup-button:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 18px 36px rgba(56, 189, 248, 0.2);
}

.upload-credit-topup-button:disabled {
    cursor: not-allowed;
    opacity: 0.56;
    filter: saturate(0.72);
    transform: none;
    box-shadow: none;
}

.upload-credit-topup-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 3px;
}

.upload-setup-status {
    padding: 15px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.42);
    color: var(--text-secondary);
    text-align: left;
    line-height: 1.55;
}

.upload-setup-status--ready {
    border-color: rgba(56, 189, 248, 0.22);
    background: rgba(14, 165, 233, 0.1);
    color: var(--text-heading);
}

.upload-setup-status--topup {
    border-color: rgba(251, 191, 36, 0.28);
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-heading);
}

.upload-setup-status--locked {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(71, 85, 105, 0.14);
    color: var(--text-heading);
}

.upload-setup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.upload-setup-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.42);
    color: var(--text-heading);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.upload-setup-action:hover {
    transform: translateY(-1px);
    border-color: rgba(125, 211, 252, 0.34);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.24);
}

.upload-setup-action[hidden] {
    display: none !important;
}

.upload-setup-action--primary {
    border-color: transparent;
    background: linear-gradient(135deg, #2ea9f5, #8b5cf6);
    color: #fff;
    box-shadow: 0 18px 36px rgba(59, 130, 246, 0.24);
}

.upload-setup-action--secondary {
    background: rgba(15, 23, 42, 0.52);
}

.upload-setup-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.track-type-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.track-type-btn {
    flex: 1;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--surface-elevated);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
}

.track-type-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    color: var(--text-heading);
}

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

.track-type-btn svg {
    stroke: var(--primary-light);
    transition: stroke 0.2s ease;
}

.track-type-btn:hover svg {
    stroke: var(--primary-color);
}

.track-type-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.14), rgba(14, 165, 233, 0.08));
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18), 0 18px 34px rgba(15, 23, 42, 0.22);
}

@media (max-width: 480px) {
    .track-type-buttons {
        flex-direction: column;
        align-items: center;
    }
    .track-type-btn {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .upload-credit-topup-panel {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }

    .upload-credit-topup-button {
        width: 100%;
    }
}

.upload-selection-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 6px;
}

.upload-selection-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(125, 211, 252, 0.18);
    background: rgba(15, 23, 42, 0.4);
    color: var(--text-heading);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.upload-selection-edit:hover {
    border-color: rgba(125, 211, 252, 0.32);
}

.upload-credit-hint {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

[data-theme="light"] .track-type-prompt {
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 28%),
        radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.08), transparent 30%),
        rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .upload-setup-status,
[data-theme="light"] .upload-selection-edit,
[data-theme="light"] .upload-setup-action--secondary {
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] .upload-credit-topup-panel {
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(14, 165, 233, 0.08)),
        rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .upload-credit-topup-kicker {
    color: #b45309;
}

.track-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
}

.checkbox-container {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    background-color: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.checkbox-container:hover {
    transform: translateY(-2px);
    background-color: var(--surface-elevated);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
}

.checkbox-container.checked {
    background-color: var(--surface-elevated);
    border: 1px solid rgba(56, 189, 248, 0.3);
    transform: scale(1.02);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.1);
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-heading);
    font-family: var(--font-sans);
}

main {
    padding-top: 0px;
    min-height: 80vh;
}

@media (max-width: 768px) {
    main {
        padding-top: 0px;
    }
    
    .upload-section {
        padding-top: 20px;
        margin-bottom: 40px;
    }
}

.header-spacing {
    height: 20px;
    width: 100%;
    display: block;
    background: transparent;
}

@media (max-width: 768px) {
    .header-spacing {
        height: 15px;
    }
}

/* Cache notification styling */
.cache-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 320px;
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    overflow: hidden;
    animation: slide-in 0.3s ease-out forwards;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 12px;
}

.notification-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-text {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
}

.notification-text p {
    margin: 0;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: color 0.2s;
}

.notification-close:hover {
    color: var(--text-color);
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Interactive 3D Visualization */
.visualization-3d-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--background-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.interactive-visualization iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.toggle-view-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0,0,0,0.7);
    color: var(--text-heading);
    border: none;
    border-radius: var(--radius-xs);
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.toggle-view-btn:hover {
    background-color: rgba(0,0,0,0.9);
}

.interactive-controls {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    background-color: var(--card-bg);
    padding: 5px 8px;
    border-radius: var(--radius-xs);
    z-index: 5;
}

.interactive-visualization .interactive-controls {
    display: block;
}

.interactive-tip {
    margin: 0;
    font-style: italic;
}

.delete-button {
    margin-left: 0;
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.18), rgba(239, 68, 68, 0.1));
    border-color: rgba(248, 113, 113, 0.36);
    color: #fecaca;
    box-shadow: none;
}

.delete-button:hover:not(:disabled):not([aria-disabled="true"]) {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.26), rgba(239, 68, 68, 0.16));
    border-color: rgba(248, 113, 113, 0.52);
}

.delete-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28), var(--shadow-md);
}

.delete-button svg {
    margin-right: 0;
}

/* Confirmation modal for delete action */
.delete-confirmation-modal.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 16px;
    background: rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.delete-confirmation-modal.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.delete-confirmation-modal .modal-content {
    width: min(100%, 440px);
    height: auto;
    max-width: 440px;
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 16px;
    padding: 22px;
    background:
        linear-gradient(145deg, rgba(248, 113, 113, 0.12), rgba(56, 189, 248, 0.04)),
        var(--card-bg);
    border: 1px solid rgba(248, 113, 113, 0.22);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 34px rgba(248, 113, 113, 0.08);
    position: relative;
    overflow: visible;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.22s ease;
}

.delete-confirmation-modal.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.delete-confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    color: #fecaca;
    background: rgba(248, 113, 113, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.26);
}

.delete-confirmation-copy {
    min-width: 0;
    padding-right: 34px;
}

.delete-confirmation-kicker {
    display: block;
    margin-bottom: 4px;
    color: #fecaca;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.delete-confirmation-modal .modal-title {
    min-height: 0;
    margin: 0 0 8px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--text-heading);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.delete-confirmation-modal p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.delete-confirmation-status {
    min-height: 20px;
    margin-top: 10px !important;
    color: #fecaca !important;
    font-size: 0.88rem;
}

.delete-confirmation-buttons {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 2px;
}

.delete-confirmation-buttons button {
    min-height: 48px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.2;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    touch-action: manipulation;
}

.cancel-delete-btn {
    background: var(--surface-elevated);
    color: var(--text-color);
    border-color: var(--border-color) !important;
}

.cancel-delete-btn:hover,
.cancel-delete-btn:focus-visible {
    background: color-mix(in srgb, var(--surface-elevated) 86%, white);
    border-color: rgba(56, 189, 248, 0.28) !important;
}

.confirm-delete-btn {
    background: #dc2626;
    color: white;
    box-shadow: 0 10px 26px rgba(220, 38, 38, 0.22);
}

.confirm-delete-btn:hover,
.confirm-delete-btn:focus-visible {
    background: #b91c1c;
    border-color: rgba(254, 202, 202, 0.34);
    box-shadow: 0 14px 32px rgba(220, 38, 38, 0.28);
}

.delete-confirmation-buttons button:active:not(:disabled) {
    transform: translateY(1px);
}

.delete-confirmation-buttons button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

.delete-confirmation-buttons button:disabled {
    cursor: progress;
    opacity: 0.72;
    transform: none;
}

.delete-confirmation-modal .close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .delete-button {
    color: #b91c1c;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.92), rgba(254, 242, 242, 0.78));
    border-color: rgba(185, 28, 28, 0.28);
}

[data-theme="light"] .delete-confirmation-modal .modal-content {
    background:
        linear-gradient(145deg, rgba(254, 226, 226, 0.9), rgba(255, 255, 255, 0.86)),
        var(--card-bg);
    border-color: rgba(185, 28, 28, 0.18);
}

[data-theme="light"] .delete-confirmation-icon,
[data-theme="light"] .delete-confirmation-kicker,
[data-theme="light"] .delete-confirmation-status {
    color: #b91c1c !important;
}

[data-theme="light"] .delete-confirmation-icon {
    background: rgba(254, 226, 226, 0.9);
    border-color: rgba(185, 28, 28, 0.22);
}

@media (min-width: 600px) {
    .delete-confirmation-modal.modal-overlay {
        align-items: center;
    }

    .delete-confirmation-buttons {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .delete-confirmation-modal.modal-overlay {
        padding: 12px;
    }

    .delete-confirmation-modal .modal-content {
        gap: 14px;
        padding: 20px 16px 16px;
        border-radius: var(--radius-lg);
    }

    .delete-confirmation-copy {
        padding-right: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .delete-confirmation-modal.modal-overlay,
    .delete-confirmation-modal .modal-content,
    .delete-confirmation-buttons button {
        transition: none;
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-xs);
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 350px;
}

.notification.success {
    background-color: var(--success);
}

.notification.error {
    background-color: var(--danger);
}

.notification.info {
    background-color: var(--info);
}

.notification.warning {
    background-color: var(--warning);
}

/* Enhanced progress styles */
.progress-log-container {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0,0,0,0.03);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-top: 20px;
}

.analysis-summary {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analysis-summary h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.analysis-summary pre {
    background-color: var(--surface-elevated);
    padding: 10px;
    border-radius: var(--radius-xs);
    overflow-x: auto;
    font-size: 13px;
}

.log-active {
    color: var(--primary-color);
    font-weight: bold;
}

.log-completed {
    color: var(--success);
    font-weight: bold;
}

/* Clarity Chart Styles */
.clarity-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background-color: rgba(240, 240, 245, 0.5);
    border-radius: var(--radius-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border-radius: var(--radius-xs);
}

.clarity-chart-description {
    margin-top: 12px;
    padding: 10px;
    background-color: rgba(240, 240, 245, 0.7);
    border-radius: var(--radius-sm);
    border-left: 4px solid rgba(74, 107, 255, 0.5);
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 15px;
}

.clarity-components {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    padding: 15px;
    font-size: 0.95em;
}

.clarity-component {
    display: grid;
    grid-template-columns: 160px 150px 1fr 120px 120px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.clarity-component:last-child {
    border-bottom: none;
}

.component-label {
    font-weight: bold;
}

.component-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--accent-light);
}

.component-calculation {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.9em;
    color: var(--text-secondary);
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-score {
    font-weight: bold;
    color: var(--accent-light);
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-xs);
    padding: 4px;
}

.component-weight {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

.clarity-formula {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    text-align: center;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

.clarity-note {
    margin-top: 15px;
    padding: 12px;
    background-color: rgba(74, 107, 255, 0.1);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    font-style: italic;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .clarity-legend {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .clarity-components {
        padding: 10px;
    }
    
    .clarity-component {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .component-label, .component-value, .component-calculation, .component-score, .component-weight {
        width: 100%;
    }
    
    .clarity-formula {
        font-size: 0.85em;
        padding: 8px;
        overflow-x: auto;
    }
}

.clarity-component.harmonic-data,
.clarity-component.transient-data {
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-top: 8px;
}

.clarity-component.harmonic-data {
    border-left: 3px solid rgba(255, 193, 7, 0.7);
}

.clarity-component.transient-data {
    border-left: 3px solid rgba(0, 200, 83, 0.7);
}

.component-label {
    font-weight: bold;
}

.component-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--accent-light);
}

.component-calculation {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.9em;
    color: var(--text-secondary);
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-score {
    font-weight: bold;
    color: var(--accent-light);
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-xs);
    padding: 4px;
}

.component-weight {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

.clarity-formula {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    text-align: center;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

.clarity-note {
    margin-top: 15px;
    padding: 12px;
    background-color: rgba(74, 107, 255, 0.1);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    font-style: italic;
    color: var(--text-secondary);
}

/* Radar chart styles */
.radar-container {
    margin: 30px 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.radar-container h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
    color: var(--text-color);
}

.radar-description {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

#clarity-radar-chart {
    max-height: 400px;
    margin: 0 auto;
}

/* Clarity Insights styles */
.clarity-insights {
    margin: 30px 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.clarity-insights h3 {
    margin-bottom: 20px;
    font-size: 1.3em;
    color: var(--text-color);
    text-align: center;
}

/* Summary section styles */
.insights-summary {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    padding: 15px;
}

.insight-summary-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px;
}

.summary-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent) calc(var(--percent) * 1%), 
        rgba(255, 255, 255, 0.1) calc(var(--percent) * 1%) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.summary-score-circle::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.summary-score-circle span {
    position: relative;
    z-index: 1;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
}

.insight-summary-score p {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.insight-summary-text {
    flex: 1;
}

.insight-summary-text p {
    margin-bottom: 10px;
    line-height: 1.4;
}

.insight-summary-strengths {
    font-size: 0.9em;
}

/* Category styles */
.insights-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.insights-category {
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    padding: 15px;
}

.insights-category h4 {
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1em;
    color: var(--text-color);
}

.insights-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Insight item styles */
.insight {
    position: relative;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.insight-meter {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--score);
    background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(255, 255, 255, 0.05));
    z-index: 0;
    transition: width 1s ease-in-out;
}

.insight-content {
    position: relative;
    z-index: 1;
    padding: 15px;
}

.insight h5 {
    margin-bottom: 8px;
    font-size: 1em;
    font-weight: 600;
}

.insight p {
    margin-bottom: 10px;
    font-size: 0.9em;
    line-height: 1.4;
}

.insight-recommendation {
    display: none;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-xs);
    padding: 12px;
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.4;
    transition: all 0.3s ease;
    transform: translateY(10px);
    opacity: 0;
}

.insight.expanded {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.insight.expanded .insight-recommendation {
    display: block;
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.insight.positive {
    border-left: 3px solid rgba(0, 200, 83, 0.7);
}

.insight.warning {
    border-left: 3px solid rgba(255, 193, 7, 0.7);
}

.insight.neutral {
    border-left: 3px solid rgba(74, 107, 255, 0.7);
}

.insights-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-style: italic;
}

@media (max-width: 768px) {
    .insights-summary {
        flex-direction: column;
        text-align: center;
    }
    
    .insight-summary-score {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .insights-categories {
        grid-template-columns: 1fr;
    }
    
    .insights-category {
        padding: 10px;
    }
    
    .insight-content {
        padding: 12px;
    }
    
    .insight-recommendation {
        padding: 10px;
    }
}

.clarity-component.fft-params {
    background: rgba(74, 107, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-top: 4px;
    margin-bottom: 12px;
    border-left: 3px solid rgba(74, 107, 255, 0.7);
}

/* Inline styles moved from HTML */
.inline-svg-style {
    margin-right: 8px;
    vertical-align: -3px;
}

.legend-color-blue {
    background: rgba(74, 107, 255, 0.7);
}

.legend-color-red {
    background: rgba(255, 99, 132, 0.7);
}

.legend-color-green {
    background: rgba(75, 192, 192, 0.7);
}

.full-width-iframe {
    width: 100%;
    height: 700px;
    border: none;
    display: block;
}

.free-badge {
    display: inline-flex;
    align-items: center;
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid var(--chip-border);
    border-radius: var(--chip-radius-sm);
    box-shadow: var(--chip-shadow);
    margin-left: 10px;
    vertical-align: middle;
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* ======================
   MODERN USER MENU STYLES
   ====================== */

/* User Menu Container */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    margin:0 15px;
}

/* Authenticated User Dropdown */
.user-menu-dropdown {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.user-menu-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.user-menu-trigger[aria-expanded="true"] {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.user-menu-trigger[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    overflow: hidden;
}

.user-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-avatar-initial {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}



.user-name {
    font-weight: 600;
    color: inherit;
    transition: color 0.3s ease;
}

.chevron-icon {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.user-menu-trigger[aria-expanded="true"] .chevron-icon {
    opacity: 1;
}

/* Dropdown Content */
.user-menu-dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.user-menu-dropdown.active .user-menu-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* User Info Section */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.user-info-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.user-info-text {
    flex: 1;
    min-width: 0;
}

.user-info-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info-email {
    font-size: 13px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Menu Divider */
.menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0;
}

/* Navigation Items */
.user-menu-nav {
    padding: 8px 0;
}

.user-menu-section {
    padding: 12px;
    background: color-mix(in srgb, var(--card-bg) 92%, transparent);
}

.user-menu-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding: 0 8px;
}

.user-menu-section-head span {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.user-menu-section-head a {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.user-menu-section-head a:hover,
.user-menu-section-head a:focus {
    color: var(--primary-light);
    text-decoration: none;
}

.user-menu-history-list {
    display: grid;
    gap: 6px;
}

.user-menu-history-item {
    padding: 11px 12px;
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface-elevated) 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-color) 8%, transparent);
}

.user-menu-history-item::before {
    display: none;
}

.user-menu-history-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    width: 100%;
}

.user-menu-history-title {
    display: block;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-history-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    position: relative;
}

.user-menu-item:hover,
.user-menu-item:focus {
    background: var(--card-bg);
    color: var(--primary-color);
    text-decoration: none;
}

.user-menu-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.user-menu-item:hover svg,
.user-menu-item:focus svg {
    opacity: 1;
}

.user-menu-item span {
    font-weight: 500;
}

/* Logout Form Styling */
.logout-form {
    width: 100%;
    margin: 0;
}

.logout-btn {
    color: var(--danger);
    font-family: inherit;
    text-align: left;
}

.logout-btn:hover,
.logout-btn:focus {
    background: rgba(220, 53, 69, 0.05);
    color: var(--danger);
}

/* Guest Menu */
.guest-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.login-btn {
    background: var(--surface-elevated);
    color: var(--primary-light);
    border-color: rgba(56, 189, 248, 0.2);
}

.login-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--text-heading);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
    text-decoration: none;
}

.register-btn {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.15), 0 0 30px rgba(168, 85, 247, 0.08);
}

.register-btn:hover {
    background: var(--gradient-accent);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.25), 0 0 40px rgba(168, 85, 247, 0.12);
    text-decoration: none;
    color: white;
}

.auth-btn svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.auth-btn span {
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .user-menu-container {
        margin-left: 8px;
    }
    
    .user-menu-trigger {
        padding: 6px 10px;
        font-size: 13px;
        gap: 6px;
    }
    
    .user-avatar {
        width: 20px;
        height: 20px;
    }
    
    .user-avatar svg {
        width: 16px;
        height: 16px;
    }
    
    .user-name {
        display: none; /* Hide username on very small screens */
    }
    
    .user-menu-dropdown-content {
        right: -10px;
        min-width: 260px;
    }
    
    .user-info {
        padding: 16px;
    }
    
    .user-info-avatar {
        width: 40px;
        height: 40px;
    }
    
    .user-info-name {
        font-size: 15px;
    }
    
    .user-info-email {
        font-size: 12px;
    }
    
    .user-menu-item {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .guest-menu {
        gap: 6px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 13px;
        gap: 4px;
    }
    
    .auth-btn span {
        display: none; /* Show only icons on mobile */
    }
    
    .auth-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .user-menu-trigger {
        padding: 6px 8px;
    }
    
    .user-menu-dropdown-content {
        right: -15px;
        min-width: 240px;
    }
    
    .auth-btn {
        padding: 6px 10px;
    }
}

/* Animation for menu items */
.user-menu-item {
    position: relative;
    overflow: hidden;
}

.user-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.user-menu-item:hover::before,
.user-menu-item:focus::before {
    transform: scaleY(1);
}

/* Focus states for accessibility */
.user-menu-trigger:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.user-menu-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Remove old user menu styles */
.user-menu {
    display: none; /* Remove old menu */
}

.user-menu-item.btn-link-style {
    display: none; /* Remove old button style */
}

.free-badge {
    display: inline-flex;
    align-items: center;
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid var(--chip-border);
    border-radius: var(--chip-radius-sm);
    box-shadow: var(--chip-shadow);
    margin-left: 10px;
    vertical-align: middle;
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Animation for new analysis cards */
.tab-pane#genre-tab .score-card,
.tab-pane#voice-tab .score-card,
.tab-pane#instruments-tab .score-card,
.tab-pane#mood-tab .score-card,
.tab-pane#keywords-tab .score-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FEATURES GRID STYLES ===== */
.intro-section {
    padding: 60px 0;
    background: var(--gradient-bg);
    position: relative;
    overflow: hidden;
}

.intro-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

.intro-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.intro-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.2;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 50px;
    line-height: 1.6;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-highlight {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.feature-highlight:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(56, 189, 248, 0.2);
}

.feature-highlight:hover::before {
    transform: scaleX(1);
}

.feature-highlight h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-highlight h3::before {
    content: attr(data-icon);
    font-size: 1.6rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-highlight ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-highlight li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.feature-highlight li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1rem;
}

.feature-highlight li strong {
    color: var(--text-color);
    font-weight: 600;
}

.feature-highlight li:last-child {
    margin-bottom: 0;
}

/* Staggered animation for feature cards */
.feature-highlight:nth-child(1) {
    animation: slideInUp 0.6s ease-out 0.1s both;
}

.feature-highlight:nth-child(2) {
    animation: slideInUp 0.6s ease-out 0.2s both;
}

.feature-highlight:nth-child(3) {
    animation: slideInUp 0.6s ease-out 0.3s both;
}

.feature-highlight:nth-child(4) {
    animation: slideInUp 0.6s ease-out 0.4s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design for Features Grid */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
    
    .intro-content h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .intro-section {
        padding: 40px 0;
    }
    
    .intro-content {
        padding: 0 15px;
    }
    
    .intro-content h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .intro-content p {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 30px;
    }
    
    .feature-highlight {
        padding: 25px;
        border-radius: var(--radius-lg);
    }
    
    .feature-highlight h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .feature-highlight li {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .intro-content h2 {
        font-size: 1.6rem;
    }
    
    .feature-highlight {
        padding: 20px;
        border-radius: var(--radius-md);
    }
    
    .feature-highlight h3 {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Line 377 - Update text color */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

/* Line 655 - Keep background as is for tooltips */
/* Line 681 - Keep border as is for tooltips */

/* Line 1478 - Update text color */
.track-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Line 2553 - Update text color */
.analysis-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Line 2568 - Update text color */
.analysis-section p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Line 3977 - Update text color */
.feature-card h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Line 4003 - Update text color */
.feature-card p {
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ======================
   SCORE CIRCLE FALLBACK
   ====================== */

/* Basic fallback styling for score circles */
.score-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
}

/* Animation for new analysis cards */
.tab-pane#genre-tab .score-card,
.tab-pane#voice-tab .score-card,
.tab-pane#instruments-tab .score-card,
.tab-pane#mood-tab .score-card,
.tab-pane#keywords-tab .score-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Instruments Chart Specific Styling */
#instruments-tab .chart-container h3::before {
    content: '🎸';
}

#instruments-tab .chart-container {
    background: var(--gradient-card, var(--card-bg));
}

#instruments-tab .chart-container::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: var(--radius-xs);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#instruments-tab .chart-container:hover::after {
    opacity: 1;
}

/* Instruments Chart Canvas Sizing */
#instruments-tab .chart-container canvas {
    max-width: 100% !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
}

#instruments-chart {
    max-width: 100% !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
}

/* Mood Chart Specific Styling */
#mood-tab .chart-container h3::before {
    content: '😊';
}

#mood-tab .chart-container {
    background: var(--gradient-card, var(--card-bg));
}

#mood-tab .chart-container::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--warning), transparent);
    border-radius: var(--radius-xs);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#mood-tab .chart-container:hover::after {
    opacity: 1;
}

/* Mood Chart Canvas Sizing */
#mood-tab .chart-container canvas {
    max-width: 100% !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
}

#mood-polar-chart {
    max-width: 100% !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
}

/* Voice Chart Specific Styling */
#voice-tab .chart-container h3::before {
    content: '🎤';
}

#voice-tab .chart-container {
    background: var(--gradient-card, var(--card-bg));
}

#voice-tab .chart-container::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--success), transparent);
    border-radius: var(--radius-xs);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#voice-tab .chart-container:hover::after {
    opacity: 1;
}

/* Chart Animation Enhancements */
.chart-container canvas {
    transition: all 0.3s ease;
    max-width: 100% !important;
    max-height: 400px !important;
}

/* REMOVED: Problematic zoom effect that was causing charts to grow larger
.chart-container:hover canvas {
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.06);
}
*/

/* General Chart Sizing Constraints */
canvas[id$="-chart"] {
    max-width: 100% !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
}

/* ======================
   GENRE TREE VISUALIZATION
   ====================== */

/* Genre Tree Container */
.genre-tree-container {
    background: var(--gradient-card, var(--card-bg));
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.genre-tree-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.genre-tree-container h3 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.genre-tree-container h3::before {
    content: '🌳';
    font-size: 1.2rem;
}

/* Genre Tree Structure */
.genre-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    min-height: 400px;
}

/* Root Genre (Main/Primary) */
.genre-root {
    background: var(--gradient-primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: var(--shadow-glow);
    position: relative;
    margin-bottom: 40px;
    animation: pulse-root 3s infinite;
    z-index: 3;
}

@keyframes pulse-root {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-glow); }
    50% { transform: scale(1.05); box-shadow: var(--shadow-hover); }
}

/* Tree Branches */
.genre-branches {
    display: flex;
    justify-content: center;
    gap: 60px;
    position: relative;
    width: 100%;
    flex-wrap: wrap;
}

/* Branch Lines */

/* ==========================================================
   NEON GLASSMORPHISM OVERRIDES
   Glass panels, neon glow, frosted surfaces.
   Loads last to override any remaining legacy styles.
   ========================================================== */

.upload-area {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 2px dashed rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md), inset 0 0 60px rgba(56, 189, 248, 0.02);
}

.upload-area:hover {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: var(--shadow-hover), 0 0 40px rgba(56, 189, 248, 0.06);
    background: var(--surface-elevated);
}

.upload-button {
    background: var(--gradient-primary);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15), 0 0 40px rgba(168, 85, 247, 0.08);
    border-radius: var(--radius-pill);
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.upload-button:hover {
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.25), 0 0 60px rgba(168, 85, 247, 0.12);
}

.site-footer {
    background: linear-gradient(180deg, #0b0d24 0%, #070717 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(56, 189, 248, 0.14);
}

/* (instrumental-selection-container removed -- replaced by .track-type-prompt) */

.free-badge {
    background: var(--chip-bg);
    box-shadow: var(--chip-shadow);
}

.analysis-card,
.card,
.results-section {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-md);
}

.analysis-card:hover,
.card:hover {
    box-shadow: var(--shadow-hover);
}

a {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-light);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.15);
    background: var(--surface-elevated);
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary-light);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
    transform: scale(1.08);
}

/* Dark mode (default): show sun icon, hide moon */
.theme-icon-sun { display: block; }
.theme-icon-moon { display: none; }

/* Light mode: show moon icon, hide sun */
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

/* ======================
   AI MODEL COMPARE PANEL
   ====================== */

.ai-compare-panel {
    --compare-accent: color-mix(in srgb, var(--primary-color) 62%, #10b981 38%);
    --compare-border: color-mix(in srgb, var(--compare-accent) 20%, transparent);
    --compare-surface: color-mix(in srgb, var(--card-bg) 88%, white 12%);
    --compare-surface-strong: color-mix(in srgb, var(--card-bg) 82%, white 18%);
    --compare-shadow: 0 22px 52px rgba(15, 23, 42, 0.12);
    margin-top: 30px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--compare-accent) 18%, transparent), transparent 34%),
        linear-gradient(145deg, color-mix(in srgb, var(--card-bg) 96%, white 4%) 0%, var(--card-bg) 100%);
    border: 1px solid var(--compare-border);
    box-shadow: var(--compare-shadow), var(--shadow-sm);
}

html:not([data-theme="light"]) .ai-compare-panel {
    --compare-border: color-mix(in srgb, var(--compare-accent) 32%, transparent);
    --compare-surface: color-mix(in srgb, var(--card-bg) 92%, white 8%);
    --compare-surface-strong: color-mix(in srgb, var(--card-bg) 84%, white 16%);
    --compare-shadow: 0 28px 64px rgba(2, 6, 23, 0.52);
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--compare-accent) 24%, transparent), transparent 36%),
        linear-gradient(145deg, color-mix(in srgb, var(--card-bg) 94%, white 6%) 0%, color-mix(in srgb, var(--card-bg) 98%, black 2%) 100%);
}

html:not([data-theme="light"]) .ai-quality-banner {
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.34);
}

html:not([data-theme="light"]) .user-menu-section {
    background: color-mix(in srgb, var(--card-bg) 94%, transparent);
}

html:not([data-theme="light"]) .user-menu-history-item {
    background: color-mix(in srgb, var(--surface-elevated) 72%, transparent);
    border-color: rgba(255, 255, 255, 0.08);
}

.ai-compare-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.ai-compare-head h3 {
    margin: 6px 0 4px;
    font-size: clamp(1.1rem, 1rem + 0.7vw, 1.35rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.ai-compare-head p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 44ch;
    font-size: 0.95rem;
    line-height: 1.45;
}

.ai-compare-balance {
    min-width: 120px;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, color-mix(in srgb, var(--compare-accent) 14%, transparent), color-mix(in srgb, var(--compare-accent) 8%, transparent));
    border: 1px solid color-mix(in srgb, var(--compare-accent) 20%, transparent);
    color: var(--text-color);
    text-align: center;
}

.ai-compare-balance span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ai-compare-balance strong {
    display: block;
    margin-top: 4px;
    font-size: 1.2rem;
}

.ai-compare-balance[hidden] {
    display: none !important;
}

.ai-compare-guest-gate,
.ai-compare-owner-gate {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, color-mix(in srgb, var(--compare-accent) 12%, transparent), color-mix(in srgb, var(--card-bg) 92%, transparent));
    border: 1px solid color-mix(in srgb, var(--compare-accent) 18%, transparent);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.ai-compare-guest-gate p,
.ai-compare-owner-gate p {
    margin: 0;
    color: var(--text-color);
}

.ai-compare-guest-gate[hidden],
.ai-compare-owner-gate[hidden] {
    display: none !important;
}

.ai-compare-baseline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-compare-run-card,
.ai-compare-model-card,
.ai-compare-pack-card {
    border-radius: var(--radius-lg);
    border: 1px solid color-mix(in srgb, var(--text-color) 8%, transparent);
    background: linear-gradient(180deg, var(--compare-surface-strong) 0%, var(--compare-surface) 100%);
    padding: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.ai-compare-run-card--baseline {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--compare-accent) 16%, transparent),
        color-mix(in srgb, var(--compare-surface-strong) 86%, white 14%)
    );
}

.ai-compare-run-card--active {
    border-color: color-mix(in srgb, var(--compare-accent) 32%, transparent);
    box-shadow: 0 18px 38px color-mix(in srgb, var(--compare-accent) 18%, transparent);
}

.ai-compare-run-card--pending,
.ai-compare-run-card--processing {
    border-color: color-mix(in srgb, var(--warning) 28%, transparent);
}

.ai-compare-run-card--failed {
    border-color: color-mix(in srgb, var(--danger) 28%, transparent);
}

html:not([data-theme="light"]) .ai-compare-run-card,
html:not([data-theme="light"]) .ai-compare-model-card,
html:not([data-theme="light"]) .ai-compare-pack-card {
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.34);
}

.ai-compare-run-topline,
.ai-compare-model-topline {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ai-compare-run-card h4,
.ai-compare-model-card strong {
    margin: 6px 0 0;
}

.ai-compare-run-card p,
.ai-compare-model-copy {
    margin: 6px 0 0;
    color: var(--text-secondary);
    line-height: 1.42;
}

.ai-compare-run-copy {
    min-height: 2.8em;
}

.ai-compare-run-badge,
.ai-compare-model-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--compare-accent) 24%, transparent);
    border-radius: var(--chip-radius-sm);
    background: var(--chip-bg);
    box-shadow: var(--chip-shadow);
    color: color-mix(in srgb, var(--compare-accent) 78%, var(--text-color) 22%);
    font-size: 0.74rem;
    font-weight: 700;
}

.ai-compare-model-grid,
.ai-compare-results,
.ai-compare-topup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ai-compare-model-card,
.ai-compare-pack-card {
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ai-compare-model-card:hover,
.ai-compare-pack-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    border-color: color-mix(in srgb, var(--compare-accent) 24%, transparent);
}

.ai-compare-model-card--locked,
.ai-compare-model-card:disabled,
.ai-compare-pack-card:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ai-compare-model-meta,
.ai-compare-model-cta {
    display: block;
    margin-top: 8px;
}

.ai-compare-model-meta {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.ai-compare-run-meta {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.ai-compare-run-actions {
    margin-top: 10px;
}

.ai-compare-run-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid color-mix(in srgb, var(--compare-accent) 22%, transparent);
    background: color-mix(in srgb, var(--compare-accent) 8%, transparent);
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ai-compare-run-switch:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--compare-accent) 12%, transparent);
    border-color: color-mix(in srgb, var(--compare-accent) 30%, transparent);
}

.ai-compare-run-switch:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
}

.ai-compare-model-cta {
    color: var(--primary-color);
    font-weight: 700;
}

.ai-compare-empty {
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px dashed color-mix(in srgb, var(--compare-accent) 22%, transparent);
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--compare-accent) 4%, transparent);
}

.ai-compare-results {
    margin-top: 14px;
}

.ai-compare-topup {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--compare-accent) 18%, transparent);
}

.ai-compare-panel--view-only {
    padding: 14px;
}

.ai-compare-panel--view-only .ai-compare-head {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.ai-compare-panel--view-only .ai-compare-head h3 {
    margin: 4px 0 0;
    font-size: 1rem;
    line-height: 1.08;
}

.ai-compare-panel--view-only .ai-compare-owner-gate {
    margin-bottom: 8px;
    padding: 9px 11px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.ai-compare-panel--view-only .ai-compare-baseline {
    margin-bottom: 8px;
}

.ai-compare-panel--view-only .ai-compare-run-copy {
    min-height: 0;
}

.ai-compare-panel--view-only .ai-compare-run-card,
.ai-compare-panel--view-only .ai-compare-model-card {
    padding: 13px;
}

.ai-compare-panel--view-only .ai-compare-model-grid,
.ai-compare-panel--view-only .ai-compare-results {
    gap: 8px;
}

.ai-compare-viewonly-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 1px solid color-mix(in srgb, var(--compare-accent) 18%, transparent);
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--compare-accent) 10%, transparent),
        color-mix(in srgb, var(--compare-surface) 96%, transparent)
    );
}

.ai-compare-viewonly-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-compare-viewonly-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--compare-accent) 22%, transparent);
    border-radius: var(--chip-radius-sm);
    background: var(--chip-bg);
    box-shadow: var(--chip-shadow);
    color: color-mix(in srgb, var(--compare-accent) 72%, var(--text-color) 28%);
    font-size: 0.74rem;
    font-weight: 700;
}

.ai-compare-viewonly-model {
    color: var(--text-heading);
    font-size: 0.98rem;
    line-height: 1.15;
}

.ai-compare-viewonly-summary p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.ai-compare-model-grid--teaser {
    grid-template-columns: 1fr;
}

.ai-compare-panel--view-only .ai-compare-model-card {
    padding: 12px;
    border-radius: var(--radius-lg);
}

.ai-compare-panel--view-only .ai-compare-model-card strong {
    font-size: 0.95rem;
}

.ai-compare-panel--view-only .ai-compare-model-meta {
    margin-top: 6px;
    font-size: 0.8rem;
}

.ai-compare-panel--view-only .ai-compare-model-cta {
    margin-top: 5px;
    font-size: 0.88rem;
}

.ai-compare-panel--view-only .ai-compare-results {
    display: none !important;
}

.ai-compare-topup h4,
.ai-compare-topup p {
    margin: 0 0 10px;
}

.ai-compare-pack-card strong,
.ai-compare-pack-card span {
    display: block;
}

.ai-compare-pack-card span + span {
    margin-top: 8px;
    color: var(--text-secondary);
}

.ai-compare-pack-card.is-recommended {
    border-color: color-mix(in srgb, var(--compare-accent) 34%, transparent);
    box-shadow: 0 18px 36px color-mix(in srgb, var(--compare-accent) 18%, transparent);
}

@media (min-width: 768px) {
    .ai-compare-model-grid,
    .ai-compare-results,
    .ai-compare-topup-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-compare-model-grid--teaser {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ======================
   RESULTS COMPARE CTA
   ====================== */

.results-compare-cta {
    position: relative;
    margin-top: 30px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(56, 189, 248, 0.12);
    box-shadow: var(--shadow-sm);
}

.results-compare-cta--guest {
    pointer-events: none;
    user-select: none;
}

.results-compare-cta--guest .results-compare-content {
    filter: blur(2px) grayscale(0.4);
    opacity: 0.5;
}

.results-compare-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: var(--radius-lg);
    pointer-events: auto;
}

.results-compare-lock {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.12);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.results-compare-lock svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.results-compare-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.results-compare-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.results-compare-text {
    flex: 1;
}

.results-compare-text h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-compare-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: var(--chip-radius-sm);
    background: var(--chip-bg);
    border: 1px solid rgba(16, 185, 129, 0.24);
    color: var(--success);
    box-shadow: var(--chip-shadow);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-compare-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.btn-results-compare {
    flex-shrink: 0;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-results-compare:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
    color: white;
    text-decoration: none;
}

@media (max-width: 768px) {
    .results-compare-content {
        flex-direction: column;
        text-align: center;
    }
    .results-compare-lock {
        flex-direction: column;
        text-align: center;
    }
}

/* Header brand quality pass: product name first, honest free allowance second. */
.app-title--with-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.app-title--with-badge h1 {
    letter-spacing: 0;
    white-space: nowrap;
}

.app-title--with-badge .free-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 24px;
    margin-left: 0;
    padding: 5px 10px;
    border-radius: var(--chip-radius-sm);
    border: 1px solid var(--chip-border);
    background: var(--chip-bg);
    color: var(--chip-text);
    box-shadow: var(--chip-shadow);
    animation: none;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.app-title--with-badge .free-badge::before {
    content: none;
}

[data-theme="light"] .app-title--with-badge .free-badge {
    border-color: var(--chip-border);
    background: var(--chip-bg);
    color: var(--chip-text);
}

@media (max-width: 768px) {
    .app-title--with-badge {
        gap: 4px;
    }

    .app-title--with-badge .free-badge {
        min-height: 22px;
        padding: 2px 8px;
        font-size: 0.68rem;
    }
}

/* ===== Comment-for-tokens prompt ===== */
.comment-prompt-revisit {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 8999;
  box-sizing: border-box;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--card-bg) 82%, transparent);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.comment-prompt-revisit:hover,
.comment-prompt-revisit:focus-visible {
  color: var(--text-color);
  border-color: var(--primary-color);
}
.comment-prompt-revisit:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
@media (min-width: 769px) {
  .comment-prompt-revisit {
    left: auto;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: min(340px, calc(100vw - 48px));
  }
}
.comment-prompt {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-height: min(620px, calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)));
  box-sizing: border-box;
  padding: 18px 16px 16px;
  background: var(--gradient-card, var(--card-bg));
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.36);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 9000;
}
.comment-prompt::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-primary);
}
/* Dismiss (×). float+sticky rather than absolute: .comment-prompt scrolls
   (overflow-y: auto), and an absolutely positioned button scrolls out of reach
   on short viewports — exactly when the user most wants to close the card. */
.comment-prompt__close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  margin: -10px -8px 0 8px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.comment-prompt__close svg { width: 18px; height: 18px; }
.comment-prompt__close:hover,
.comment-prompt__close:focus-visible {
  color: var(--text-color);
  background: color-mix(in srgb, var(--text-color) 10%, transparent);
}
.comment-prompt__close:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}
/* Permanent opt-out. Deliberately the quietest control in the card — present
   and findable, never competing with the primary action. */
.comment-prompt__never {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 6px 8px;
  color: var(--text-secondary);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.comment-prompt__never:hover,
.comment-prompt__never:focus-visible { color: var(--text-color); }
.comment-prompt__never:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  .comment-prompt:not([hidden]) { animation: commentPromptSheetIn 320ms cubic-bezier(.2,.8,.2,1) both; }
  @keyframes commentPromptSheetIn {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
@media (min-width: 769px) {
  .comment-prompt {
    left: auto;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: min(420px, calc(100vw - 48px));
    max-height: min(640px, calc(100dvh - 48px - env(safe-area-inset-bottom, 0px)));
    padding: 22px 22px 20px;
  }
}
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .comment-prompt:not([hidden]) { animation-name: commentPromptSlideIn; }
  @keyframes commentPromptSlideIn {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
  }
}
.comment-prompt__badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 12px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--primary-light, var(--primary-color));
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
}
.comment-prompt__badge svg { width: 14px; height: 14px; }
.comment-prompt__title {
  margin: 0 0 6px; font-size: 18px; font-weight: 700;
  line-height: 1.3; color: var(--text-heading);
}
.comment-prompt__sub {
  margin: 0 0 14px; max-width: 60ch;
  font-size: 14px; line-height: 1.5; color: var(--text-secondary);
}
.comment-prompt__sub strong { color: var(--text-color); font-weight: 600; }
.comment-prompt__label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 700; color: var(--text-color);
}
.comment-prompt__form textarea {
  width: 100%; box-sizing: border-box; min-height: 84px;
  padding: 12px 14px; font-size: 16px; line-height: 1.5; font-family: inherit;
  color: var(--text-color);
  /* Recessed "well" so it clearly reads as an editable field in dark mode — the
     old var(--surface-elevated) fill + 12%-alpha accent border blended into the
     card and didn't look like an input. */
  background: rgba(0, 0, 0, 0.24);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.comment-prompt__form textarea:hover { border-color: rgba(255, 255, 255, 0.34); }
.comment-prompt__form textarea::placeholder { color: var(--text-secondary); opacity: .85; }
.comment-prompt__form textarea:focus {
  outline: none; border-color: var(--primary-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(56, 189, 248, 0.30);
}
/* Light theme: white field with a soft inset instead of the dark well. */
[data-theme="light"] .comment-prompt__form textarea {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.22);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .comment-prompt__form textarea:hover { border-color: rgba(15, 23, 42, 0.38); }
[data-theme="light"] .comment-prompt__form textarea:focus {
  border-color: var(--primary-color);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 3px rgba(56, 189, 248, 0.22);
}
.comment-prompt__actions {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 14px; margin-top: 12px;
}
.comment-prompt__cta {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; min-height: 44px; text-align: center;
}
.comment-prompt__cta svg { width: 16px; height: 16px; }
@media (min-width: 769px) {
  .comment-prompt__cta { width: auto; }
}

/* ---- Star rating input ---- */
.comment-prompt__rating { border: 0; margin: 0 0 14px; padding: 0; }
.comment-prompt__rating .comment-prompt__label { margin-bottom: 6px; }
.comment-prompt__note { margin: 8px 0 0; font-size: 12px; color: var(--text-secondary); }

/* Distinct class (.cp-stars) — avoids the legacy .star-rating widget in modal.css */
.cp-stars {
  display: inline-flex;
  flex-direction: row-reverse;   /* DOM is 5→1; reverse renders 1→5 left-to-right */
  justify-content: flex-end;
  gap: 0;
}
.cp-stars input {               /* visually hidden, still keyboard-focusable */
  position: absolute;
  width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}
.cp-stars label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 34px glyph + 5px padding = 44px touch target. The stars are the only control
     in the collapsed card, so undersized targets here block the whole flow. */
  padding: 5px;
  line-height: 0;
  cursor: pointer;
  /* Empty stars carry the "required, not yet answered" state and are the only
     control in the collapsed card — 0.22 alpha failed non-text contrast. */
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.15s ease, transform 0.15s ease;
}
[data-theme="light"] .cp-stars label { color: rgba(15, 23, 42, 0.42); }
.cp-stars label svg { width: 34px; height: 34px; fill: currentColor; }

/* checked star + all lower (lower values come later in DOM = left in row-reverse) */
.cp-stars input:checked ~ label { color: #fbbf24; }
/* while hovering, clear all then fill the hovered run (source order = hover wins) */
.cp-stars:hover label { color: rgba(255, 255, 255, 0.45); }
[data-theme="light"] .cp-stars:hover label { color: rgba(15, 23, 42, 0.18); }
.cp-stars label:hover,
.cp-stars label:hover ~ label { color: #fcd34d; transform: scale(1.06); }
.cp-stars input:focus-visible + label {
  outline: 2px solid var(--primary-color, #38bdf8);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  .cp-stars label { transition: none; }
  .cp-stars label:hover, .cp-stars label:hover ~ label { transform: none; }
}
.comment-prompt__status {
  margin: 10px 0 0; min-height: 1em;
  font-size: 13px; color: var(--primary-light, var(--primary-color));
}
.comment-prompt__thanks { text-align: center; padding: 8px 4px 4px; }
.comment-prompt__thanks-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 10px;
  color: var(--success); background: rgba(52, 211, 153, 0.12);
  border-radius: var(--radius-pill);
}
.comment-prompt__thanks-icon svg { width: 26px; height: 26px; }
.comment-prompt__thanks .comment-prompt__sub { margin-left: auto; margin-right: auto; }
@media (prefers-reduced-motion: no-preference) {
  .comment-prompt__thanks:not([hidden]) .comment-prompt__thanks-icon {
    animation: commentThanksPop 360ms cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes commentThanksPop {
    0% { transform: scale(.6); opacity: 0; }
    60% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
  }
}

/* Held/locked state — comment captured during analysis, auto-posts on completion.
   A full view-swap (not a tiny status line) so it's unmistakably "locked in". */
.comment-prompt__queued { text-align: center; padding: 8px 4px 4px; }
.comment-prompt__queued-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 10px;
  color: var(--primary-light, var(--primary-color));
  background: rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-pill);
}
.comment-prompt__queued-icon svg { width: 24px; height: 24px; }
.comment-prompt__queued .comment-prompt__sub {
  margin-left: auto; margin-right: auto;
}
.comment-prompt__locked {
  margin: 14px auto 0; max-width: 52ch;
  text-align: left;
  background: var(--surface-elevated);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.comment-prompt__locked-tag {
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-secondary);
}
.comment-prompt__locked-tag svg {
  width: 13px; height: 13px;
  color: var(--primary-light, var(--primary-color));
}
.comment-prompt__locked-text {
  margin: 0; font-size: 14px; line-height: 1.5;
  color: var(--text-color); font-style: italic;
  white-space: pre-wrap; word-break: break-word;
}
.comment-prompt__queued-pill {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 12px; padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--primary-light, var(--primary-color));
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
}
.comment-prompt__queued-dot {
  width: 8px; height: 8px; border-radius: var(--radius-pill);
  background: var(--primary-color, #38bdf8);
  flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .comment-prompt__queued:not([hidden]) .comment-prompt__queued-icon {
    animation: commentLockPop 360ms cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes commentLockPop {
    0% { transform: scale(.6); opacity: 0; }
    60% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
  }
  .comment-prompt__queued:not([hidden]) .comment-prompt__queued-dot {
    animation: commentQueuedPulse 1.4s ease-in-out infinite;
  }
  @keyframes commentQueuedPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .45; transform: scale(.8); }
  }
}

/* ==========================================================
   Homepage testimonials (Comment-for-Tokens social proof)
   Neon-glass cards: gradient quote glyph, initial avatars,
   verified meta, hover glow + equalizer micro-interaction.
   ========================================================== */
.testimonials-section {
    margin: clamp(3rem, 8vw, 5.5rem) 0;
    scroll-margin-top: 110px; /* clear the sticky header when #testimonials is the anchor */
}

.testimonials-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---- Section header ---- */
.testimonials-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto clamp(2rem, 5vw, 3rem);
}

.testimonials-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    background: var(--chip-bg, rgba(56, 189, 248, 0.1));
    border: 1px solid var(--chip-border, rgba(125, 211, 252, 0.22));
    color: var(--chip-text, rgba(255, 255, 255, 0.86));
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: var(--chip-shadow);
}

/* tiny equalizer bars — the audio motif of the whole product */
.testimonials-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 13px;
}
.testimonials-eq i {
    width: 3px;
    height: 40%;
    border-radius: var(--radius-xs);
    background: linear-gradient(180deg, #38bdf8, #a855f7);
}
@media (prefers-reduced-motion: no-preference) {
    .testimonials-eq i { animation: tEqBar 1.1s ease-in-out infinite; }
    .testimonials-eq i:nth-child(2) { animation-delay: 0.15s; }
    .testimonials-eq i:nth-child(3) { animation-delay: 0.3s; }
    .testimonials-eq i:nth-child(4) { animation-delay: 0.45s; }
}
@keyframes tEqBar {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}

.testimonials-head h2 {
    margin: 1rem 0 0.6rem;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-heading, #fff) 30%, var(--primary-light, #7dd3fc));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.testimonials-sub {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* ---- Grid ---- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

/* ---- Card ---- */
.testimonial-card {
    position: relative;
    margin: 0;
    padding: 1.6rem 1.6rem 1.4rem;
    background-color: var(--card-bg);
    background-image: var(--gradient-card, none);
    backdrop-filter: var(--glass-blur, blur(20px));
    -webkit-backdrop-filter: var(--glass-blur, blur(20px));
    border: 1px solid var(--border-color);
    border-radius: var(--radius, 16px);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
}

/* top gradient hairline that lights up on hover */
.testimonial-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--gradient-accent, linear-gradient(135deg, #38bdf8, #7c3aed));
    opacity: 0.5;
    transition: opacity 0.35s ease;
}

.testimonial-card:hover {
    transform: translateY(-6px);
    border-color: rgba(125, 211, 252, 0.34);
    box-shadow: var(--shadow-hover);
}
.testimonial-card:hover::before { opacity: 1; }

/* decorative gradient quote glyph behind the text */
.testimonial-quote-mark {
    position: absolute;
    top: -0.32em;
    right: 0.6rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 6rem;
    line-height: 1;
    background: var(--gradient-accent, linear-gradient(135deg, #38bdf8, #7c3aed));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0.16;
    pointer-events: none;
    user-select: none;
}

.testimonial-body {
    position: relative;
    margin: 0;
    color: var(--text-color);
    font-size: 1.02rem;
    line-height: 1.65;
    font-style: normal;
    /* keep very long comments tidy without breaking the grid rhythm */
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.testimonial-owner-reply {
    position: relative;
    padding: 0.95rem 1rem;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
}

.testimonial-owner-reply__label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--primary-light, var(--primary-color));
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.testimonial-owner-reply p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- Footer: avatar + meta ---- */
.testimonial-foot {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.testimonial-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.testimonial-avatar--0 { background: linear-gradient(135deg, #38bdf8, #7c3aed); }
.testimonial-avatar--1 { background: linear-gradient(135deg, #34d399, #0ea5e9); }
.testimonial-avatar--2 { background: linear-gradient(135deg, #a855f7, #ec4899); }
.testimonial-avatar--3 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.testimonial-avatar--4 { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.testimonial-avatar--5 { background: linear-gradient(135deg, #f472b6, #8b5cf6); }

.testimonial-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.testimonial-name {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.testimonial-sub {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.testimonial-verified {
    flex: 0 0 auto;
    color: var(--primary-color, #38bdf8);
}

/* ---- Staggered entrance (translate is independent of the hover transform) ---- */
@media (prefers-reduced-motion: no-preference) {
    .testimonial-card {
        opacity: 0;
        animation: tCardIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
        animation-delay: calc(var(--i, 0) * 70ms);
    }
}
@keyframes tCardIn {
    from { opacity: 0; translate: 0 18px; }
    to   { opacity: 1; translate: 0 0; }
}

/* ---- Small screens ---- */
@media (max-width: 600px) {
    .testimonials-grid { grid-template-columns: 1fr; }
    .testimonial-card { padding: 1.35rem; }
    .testimonial-quote-mark { font-size: 5rem; }
}

/* ---- Per-review star rating (display) ---- */
.testimonial-rating {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 0.1rem;
}
.testimonial-rating svg { width: 16px; height: 16px; }
.testimonial-rating .is-on { fill: #fbbf24; }
.testimonial-rating .is-off { fill: rgba(255, 255, 255, 0.16); }
[data-theme="light"] .testimonial-rating .is-off { fill: rgba(15, 23, 42, 0.15); }

/* ---- Aggregate rating summary (section header) ---- */
.testimonials-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem auto 0;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    background: var(--chip-bg, rgba(56, 189, 248, 0.1));
    border: 1px solid var(--chip-border, rgba(125, 211, 252, 0.22));
    box-shadow: var(--chip-shadow);
}
.testimonials-summary .t-sum-stars { display: inline-flex; gap: 1px; }
.testimonials-summary .t-sum-stars svg { width: 17px; height: 17px; fill: #fbbf24; }
.testimonials-summary .t-sum-score { font-weight: 700; color: var(--text-color); }
.testimonials-summary .t-sum-count { color: var(--text-secondary); font-size: 0.85rem; }

.testimonials-more {
    display: flex;
    justify-content: center;
    margin-top: clamp(1.5rem, 4vw, 2.25rem);
}

.testimonials-more-link,
.testimonials-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(125, 211, 252, 0.32);
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.08);
    color: var(--primary-light, #7dd3fc);
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.testimonials-more-link:hover,
.testimonials-load-more:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(125, 211, 252, 0.52);
    transform: translateY(-1px);
}

.page-testimonials {
    min-height: 100vh;
}

.testimonials-page {
    padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 5rem);
}

.testimonials-archive-hero {
    max-width: 820px;
    margin: 0 auto clamp(2rem, 5vw, 3rem);
    padding: 0 1.25rem;
    text-align: center;
}

.testimonials-archive-hero h1 {
    margin: 1rem 0 0.75rem;
    color: var(--text-heading, var(--text-color));
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.testimonials-archive-hero p {
    margin: 0 auto;
    max-width: 660px;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.65;
}

.testimonials-section--archive {
    margin-top: 0;
}

.testimonials-grid--archive {
    align-items: stretch;
}

.testimonial-body--full {
    display: block;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.testimonials-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: clamp(1.75rem, 5vw, 2.75rem);
}

.testimonials-pagination a,
.testimonials-pagination .pagination-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.testimonials-pagination a {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
}

.testimonials-pagination a.active {
    border-color: var(--primary-color);
    background: rgba(56, 189, 248, 0.14);
    color: var(--primary-light, #7dd3fc);
    font-weight: 800;
}

.testimonials-pagination .pagination-gap {
    color: var(--text-secondary);
}

.testimonials-pagination .testimonials-load-more {
    min-width: 180px;
    border-color: rgba(125, 211, 252, 0.32);
    color: var(--primary-light, #7dd3fc);
}

.testimonials-empty {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    text-align: center;
}

.testimonials-empty h2 {
    margin: 0 0 0.75rem;
    color: var(--text-heading, var(--text-color));
}

.testimonials-empty p {
    margin: 0;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .testimonials-pagination {
        justify-content: stretch;
    }

    .testimonials-pagination a,
    .testimonials-pagination .testimonials-load-more {
        flex: 1 1 auto;
    }
}

/* Loudness-context badge (Dynamics tab) */
.loudness-context-badge {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}
.loudness-context-badge[hidden] { display: none; }
.loudness-context-badge .loudness-context-label {
    font-weight: 600;
}
.loudness-context-badge .loudness-context-detail,
.loudness-context-badge .loudness-context-measured {
    font-size: 0.85em;
    opacity: 0.8;
}
.loudness-context-badge.severity-green { border-left-color: var(--success-color, #3ecf8e); }
.loudness-context-badge.severity-amber { border-left-color: var(--warning-color, #e0b341); }
.loudness-context-badge.severity-red { border-left-color: var(--danger-color, #e0564b); }

/* ==============================================
   SCORE CARD — gauge redesign (overrides legacy .score-card block above)
   Flat compact header: gauge (numeric /100 tabs only) + title + verdict word.
   Non-gauge cards (Key, %, multi-value) keep the flat card with their value.
   ============================================== */
.score-card {
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: left;
    padding: 16px 22px;
    margin-bottom: 20px;
    background: var(--card-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg);
    box-shadow: none;
    overflow: visible;
}
.score-card::before { content: none; display: none; }      /* kill the infinite shine */
.score-card:hover { transform: none; box-shadow: none; }
.score-card h3 { margin: 0; font-size: 1.1rem; font-weight: 650; }
.score-card h3::after { display: none; }                   /* kill underline accent */

/* On gauge cards the gauge shows the number; hide the legacy value. */
.score-card.has-gauge .score-value { display: none; }
/* Non-gauge cards: keep the value, but disable the old hover-only effects. */
.score-value { margin-left: auto; }
.score-value::before { content: none; display: none; }
.score-card:hover .score-value { transform: none; text-shadow: none; }
.score-card:hover .score-value::after { opacity: 0.7; }

/* ---- Gauge ---- */
.sc-gauge {
    position: relative;
    width: 124px;
    height: 72px;
    flex: 0 0 auto;
}
.sc-gauge svg { width: 100%; height: 100%; }
.sc-gauge .g-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.09);
    stroke-width: 11;
    stroke-linecap: round;
}
.sc-gauge .g-fill {
    fill: none;
    stroke-width: 11;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.1s cubic-bezier(0.4, 0, 0.15, 1), stroke 0.5s ease;
}
.sc-gauge .g-num {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    text-align: center;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.sc-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sc-word {
    font-size: 0.82rem;
    font-weight: 700;
}

[data-theme="light"] .sc-gauge .g-track { stroke: rgba(15, 23, 42, 0.1); }

@media (prefers-reduced-motion: reduce) {
    .sc-gauge .g-fill { transition: none; }
}

@media (max-width: 480px) {
    .score-card { padding: 14px 16px; gap: 14px; }
    .sc-gauge { width: 104px; height: 62px; }
    .sc-gauge .g-num { font-size: 1.55rem; }
}

/* Per-section "Read our guide" chip on results cards (gradient ghost -> glow lift) */
.section-guide-link {
    --sgl-grad: var(--gradient-accent, linear-gradient(135deg, #38bdf8, #7c3aed));
    --sgl-fill: linear-gradient(135deg, #7c3aed, #4f46e5);
    --sgl-glass: var(--surface-elevated, rgba(18, 20, 38, 0.6));
    position: relative;
    isolation: isolate;
    margin-left: auto;          /* push to the right edge of the score-card row */
    align-self: center;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    background:
        linear-gradient(var(--sgl-glass), var(--sgl-glass)) padding-box,
        var(--sgl-grad) border-box;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
    color: var(--accent, #a855f7);
    text-decoration: none;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s ease;
}
.section-guide-link::before {            /* gradient fill, fades in on hover */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--sgl-fill);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.section-guide-link::after {             /* advancing arrow */
    content: "\2192";
    font-weight: 700;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.section-guide-link:hover,
.section-guide-link:focus-visible {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent, #7c3aed) 70%, transparent),
                0 0 0 1px color-mix(in srgb, var(--accent, #7c3aed) 30%, transparent);
}
.section-guide-link:hover::before,
.section-guide-link:focus-visible::before {
    opacity: 1;
}
.section-guide-link:hover::after,
.section-guide-link:focus-visible::after {
    transform: translateX(4px);
}
.section-guide-link:focus-visible {
    outline: 2px solid var(--accent, #a855f7);
    outline-offset: 3px;
}
.section-guide-link:active {
    transform: translateY(-1px) scale(0.98);
}
@media (prefers-reduced-motion: reduce) {
    .section-guide-link,
    .section-guide-link::before,
    .section-guide-link::after {
        transition: none;
    }
    .section-guide-link:hover,
    .section-guide-link:focus-visible,
    .section-guide-link:active {
        transform: none;
    }
    .section-guide-link:hover::after,
    .section-guide-link:focus-visible::after {
        transform: none;
    }
}
