/* ═══════════════════════════════════════════════════════════
   Sonariq Mastering Analyzer — Premium Dark Theme
   Design System: Orange accent on deep dark backgrounds
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables (Design Tokens) ── */
:root {
    /* Colors */
    --bg-primary: #0a0a12;
    --bg-secondary: #12121e;
    --bg-card: #181828;
    --bg-card-hover: #1e1e32;
    --bg-input: #1a1a2e;
    --bg-header: rgba(10, 10, 18, 0.85);

    --accent: #ff8800;
    --accent-glow: rgba(255, 136, 0, 0.3);
    --accent-dim: rgba(255, 136, 0, 0.15);
    --accent-bright: #ffaa33;

    --cyan: #22d3ee;
    --cyan-glow: rgba(34, 211, 238, 0.25);

    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.2);
    --orange: #f59e0b;
    --orange-glow: rgba(245, 158, 11, 0.2);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.2);
    --blue: #3b82f6;
    --pink: #ec4899;
    --yellow: #fbbf24;

    --text-primary: #ffffff;
    --text-secondary: #f1f5f9;
    --text-muted: #e2e8f0;

    --border: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(255, 136, 0, 0.25);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --shadow-header: 0 2px 20px rgba(0, 0, 0, 0.5);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    padding-top: 72px;
}

/* Background gradient effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255, 136, 0, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(34, 211, 238, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 72px;
    background: var(--bg-header);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    box-shadow: var(--shadow-header);
}

.header-inner {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    border: 1px solid var(--border-accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.1);
}

.header-text h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-bright), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.beta-badge {
    font-size: 0.5em;
    font-weight: 500;
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
    vertical-align: middle;
    margin-left: 10px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 136, 0, 0.5);
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 136, 0, 0.1);
    display: inline-block;
    line-height: 1.2;
}

.header-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.main-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 var(--space-lg);
    flex-wrap: nowrap;
}

.main-menu-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    border: none;
    background: transparent;
    white-space: nowrap;
}

.main-menu-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.main-menu-dropdown {
    position: relative;
}

.main-menu-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 270px;
    padding: 10px;
    background: rgba(18, 18, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.main-menu-dropdown:hover .main-menu-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(-6px);
}

.main-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.18s ease, color 0.18s ease;
}

.main-menu-item:hover {
    background: rgba(255, 136, 0, 0.08);
    color: #fff;
}

.main-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background: rgba(255, 136, 0, 0.12);
    border: 1px solid rgba(255, 136, 0, 0.28);
}

.main-menu-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.main-menu-desc {
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.72);
    margin-top: 2px;
    line-height: 1.3;
}

@media (max-width: 980px) {
    .main-menu {
        display: none;
    }
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #cc6600);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-accent:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD SECTION
   ═══════════════════════════════════════════════════════════ */

#upload-section {
    position: relative;
    z-index: 1;
    padding: var(--space-2xl) var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.drop-zone {
    width: 100%;
    max-width: 700px;
    padding: var(--space-2xl) var(--space-xl);
    border: 2px dashed rgba(255, 136, 0, 0.3);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(255, 136, 0, 0.03) 0%, rgba(34, 211, 238, 0.02) 100%);
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-dim), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.drop-zone:hover::before,
.drop-zone.dragover::before {
    opacity: 1;
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.drop-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.drop-zone h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.drop-formats {
    margin-top: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════════════════════ */

#progress-section {
    position: relative;
    z-index: 1;
    padding: 0 var(--space-xl) var(--space-xl);
}

.progress-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.progress-filename {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.progress-percent {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
}

.progress-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 999px;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px var(--accent-glow);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-status {
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.progress-mascot {
    position: relative;
    width: 100%;
    height: 180px;
    margin-top: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.progress-mascot-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.progress-mascot-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: translateY(4px);
}

.progress-mascot-gray {
    filter: grayscale(1) contrast(1.02) brightness(0.95);
    opacity: 0.9;
}

.progress-mascot-color {
    clip-path: inset(calc(100% - var(--reveal, 0%)) 0 0 0);
    transition: clip-path 220ms ease;
    filter: saturate(1.08) contrast(1.02);
}

.progress-mascot-color img {
    filter: drop-shadow(0 0 18px rgba(255, 136, 0, 0.14));
}

/* ── Progress Squares ── */
.progress-squares {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    margin-bottom: 4px;
}

.psq {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #0a0a12;
    border: 2px solid #3f3f5a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.psq .psq-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: #3f3f5a;
    transition: color 0.4s ease;
}

.psq.done {
    background: var(--accent);
    border-color: var(--accent-bright);
    box-shadow: 0 0 10px var(--accent-glow);
}

.psq.done .psq-label {
    color: #fff;
}

.psq.active {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    animation: psqPulse 1.2s ease-in-out infinite;
}

.psq.active .psq-label {
    color: var(--accent);
}

@keyframes psqPulse {

    0%,
    100% {
        box-shadow: 0 0 8px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 18px var(--accent-glow), 0 0 4px var(--accent);
    }
}

/* ── Batch Description ── */
.batch-description {
    max-width: 700px;
    margin: 0 auto var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, rgba(255, 136, 0, 0.04), rgba(34, 211, 238, 0.03));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    text-align: center;
}

.batch-description h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-bright);
    margin-bottom: var(--space-sm);
}

.batch-description p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto;
}

.batch-description p strong {
    color: var(--text-primary);
}

.batch-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.batch-features span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   RESULTS SECTION
   ═══════════════════════════════════════════════════════════ */

#results-section {
    position: relative;
    z-index: 1;
    padding: var(--space-lg) var(--space-xl) var(--space-2xl);
    max-width: 1400px;
    margin: 0 auto;
}

/* ══ Summary Cards ══ */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.summary-card {
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-card:hover::before {
    opacity: 1;
}

.card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-xs);
}

.card-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-bright);
    line-height: 1.2;
}

.card-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Card color variations */
#card-lufs-int .card-value {
    color: var(--cyan);
}

#card-true-peak .card-value {
    color: var(--orange);
}

#card-dr .card-value {
    color: var(--purple);
}

#card-lra .card-value {
    color: var(--blue);
}

#card-key .card-value {
    color: var(--pink);
}

#card-tempo .card-value {
    color: var(--yellow);
}

#card-stereo .card-value {
    color: var(--accent-bright);
}

#card-clip .card-value {
    color: var(--red);
}

/* ══ Streaming Targets ══ */

.streaming-targets {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.targets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.target-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

.target-item.pass {
    border-color: rgba(255, 136, 0, 0.3);
}

.target-item.fail {
    border-color: rgba(239, 68, 68, 0.3);
}

.target-item.warning {
    border-color: rgba(245, 158, 11, 0.3);
}

.target-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.target-info {
    flex: 1;
}

.target-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.target-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.target-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.target-status.pass {
    background: rgba(255, 136, 0, 0.15);
    color: var(--accent);
}

.target-status.fail {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.target-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange);
}

/* ═══════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════ */

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1 1 auto;
    min-width: auto;
    padding: var(--space-sm) var(--space-sm);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(255, 136, 0, 0.15), rgba(34, 211, 238, 0.1));
    color: var(--accent-bright);
    box-shadow: inset 0 0 0 1px var(--border-accent);
}

/* ══ Tab Panels ══ */

.tab-panel {
    display: none;
    animation: fadeIn 0.35s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-card);
}

.chart-card {
    padding: var(--space-lg);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chart-container {
    position: relative;
    height: 450px;
    width: 100%;
}

.chart-container-sm {
    height: 260px;
}

/* ═══════════════════════════════════════════════════════════
   KEY DISPLAY
   ═══════════════════════════════════════════════════════════ */

.key-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) 0;
}

.key-note {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    text-shadow: 0 0 40px var(--purple-glow);
}

.key-mode {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.key-confidence {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════
   CLIP LIST
   ═══════════════════════════════════════════════════════════ */

.clip-list {
    padding: var(--space-lg);
}

.clip-list-content {
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) transparent;
}

.clip-list-content::-webkit-scrollbar {
    width: 6px;
}

.clip-list-content::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
    border-radius: 99px;
}

.clip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: background 0.2s ease;
}

.clip-item:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.clip-item:hover {
    background: rgba(239, 68, 68, 0.08);
}

.clip-time {
    color: var(--red);
    font-weight: 600;
}

.clip-peak {
    color: var(--orange);
}

.clip-none {
    text-align: center;
    padding: var(--space-xl);
    color: var(--accent);
    font-size: 0.9rem;
}

#canvas-goniometer {
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-md);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    max-width: 100%;
    max-height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

#main-footer {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

#main-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

#main-footer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════ */

.band-analysis-box {
    margin-top: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    animation: fadeIn 0.5s ease;
}

.band-analysis-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.band-analysis-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.band-analysis-item {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.band-analysis-item strong {
    color: #fff;
}

.hidden {
    display: none !important;
}

.u-hidden {
    display: none !important;
}

/* ══ Compare Player Specialty Styles ══ */
.sw-btn {
    padding: 15px 15px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid rgba(255,255,255,0.1);
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1a1a2e; /* Off state */
    border: 1px solid #3f3f5a;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.sw-btn.active .led {
    background: #ffaa00 !important; /* Force Orange LED */
    box-shadow: 0 0 15px #ffaa00, 0 0 5px #ff6600;
    border-color: #ffcc00;
}

/* External LED Indicators (Above buttons) */
.led-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1a1a2e;
    border: 1px solid #3f3f5a;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.led-indicator.active {
    background: #ffaa00 !important;
    box-shadow: 0 0 15px #ffaa00, 0 0 5px #ff6600;
    border-color: #ffcc00 !important;
}

.sw-btn .btn-txt {
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    color: #fff;
}

/* WERSJA A - Blue/Cyan */
.sw-btn-a {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3);
}

.sw-btn-a.active {
    background: #3b82f6 !important; /* Solid Blue matching waveform */
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
    border-color: #60a5fa;
}

/* WERSJA B - Green */
.sw-btn-b {
    background: rgba(255, 136, 0, 0.15) !important;
    border-color: rgba(255, 136, 0, 0.3);
}

.sw-btn-b.active {
    background: #22c55e !important; /* Solid Green matching waveform */
    box-shadow: 0 0 25px rgba(255, 136, 0, 0.6);
    border-color: #4ade80;
}

.sw-btn:hover:not(.active) {
    background: rgba(255,255,255,0.2) !important;
}

.sw-btn:hover:not(.active) {
    background: rgba(255,255,255,0.12);
}

.norm-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 25px;
    margin-top: 10px;
}

.norm-label {
    font-weight: 800;
    color: #fff;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.norm-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-norm {
    padding: 14px 28px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
}

.btn-norm:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.btn-norm:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-norm.active {
    background: linear-gradient(180deg, rgba(255, 136, 0, 0.4) 0%, rgba(255, 136, 0, 0.2) 100%) !important;
    border-color: #ffaa00 !important;
    color: #fff !important;
    box-shadow: 0 0 25px rgba(255, 136, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transform: scale(1.06) translateY(-2px);
}

.norm-info-grid, 
.batch-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
}

.norm-info-item,
.batch-info-item {
    background: rgba(255, 255, 255, 0.015);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.norm-info-item:hover,
.batch-info-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.06);
}

.norm-info-title,
.batch-info-title {
    font-weight: 800;
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.norm-info-item p,
.batch-info-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ══ Player Main Controls Alignment ══ */
.player-main-ctrl {
    display: flex;
    align-items: flex-end; /* Align all buttons and badges to the bottom edge */
    gap: 25px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-compare-play {
    min-width: 190px;
    height: 60px;
    font-size: 1.1rem !important;
    background: linear-gradient(180deg, #1e1e32 0%, #12121e 100%) !important;
    border: 2px solid var(--accent) !important;
    color: #fff !important;
    border-radius: 15px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.btn-compare-play:hover {
    background: linear-gradient(180deg, #252540 0%, #181828 100%) !important;
    border-color: var(--accent-bright) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
}

.play-symbol {
    color: var(--accent); /* Triangle in orange */
    margin-right: 12px;
    font-size: 1.4rem;
    line-height: 1;
    text-shadow: 0 0 10px var(--accent-glow);
}

.ab-switch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 0 5px;
}

.ab-led-row {
    display: flex;
    justify-content: center;
    gap: 135px; /* Matchescenters of sw-btn-a and sw-btn-b */
    width: 100%;
}

.ab-switch-btns {
    display: flex;
    background: #050508;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.6);
}

.gain-display {
    display: flex;
    gap: 15px;
    margin-left: auto;
    padding-bottom: 10px; /* Fine-tune to align text baseline with buttons if needed */
}

.gain-badge {
    padding: 8px 14px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gain-badge-a {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.gain-badge-b {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {

    #results-section,
    #compare-results,
    #batch-results {
        padding: var(--space-md);
        max-width: 100%;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .compare-upload-grid {
        flex-direction: column;
        gap: var(--space-md);
    }

    .compare-vs {
        font-size: 1.2rem;
    }

    .drop-zone-sm {
        max-width: 100%;
        width: 100%;
    }

    .compare-table {
        font-size: 0.78rem;
    }

    .compare-table th,
    .compare-table td {
        padding: var(--space-sm);
    }
}


/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {

    /* Header */
    #main-header {
        padding: 0 16px;
        height: 72px;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    .header-text h1 {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {

/* Mode tabs */
    #mode-section {
        padding: var(--space-sm) var(--space-md) 0;
    }

    .mode-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mode-tabs::-webkit-scrollbar {
        display: none;
    }

    .mode-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.78rem;
        flex: 0 0 auto;
        text-align: center;
    }

    /* Upload */
    #upload-section,
    #compare-section,
    #batch-section {
        padding: var(--space-md);
    }

    .drop-zone {
        padding: var(--space-lg) var(--space-md);
        max-width: 100%;
    }

    .drop-icon {
        font-size: 2.5rem;
    }

    .drop-zone h2 {
        font-size: 1.1rem;
    }

    /* QC Banner */
    .qc-banner {
        padding: var(--space-md);
    }

    .qc-banner-top {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }

    .qc-verdict {
        font-size: 0.85rem;
        padding: var(--space-xs) var(--space-md);
    }

    .qc-stats {
        gap: var(--space-md);
        flex-wrap: wrap;
    }

    .qc-banner-details {
        gap: 4px;
    }

    .qc-banner-item {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    /* Summary Cards */
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .summary-card {
        padding: var(--space-md) var(--space-sm);
    }

    .card-value {
        font-size: 1.3rem;
    }

    .card-label {
        font-size: 0.65rem;
    }

    /* Streaming Targets */
    .streaming-targets {
        padding: var(--space-md);
    }

    .targets-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .target-item {
        padding: var(--space-sm) var(--space-md);
    }

    /* Tab Navigation */
    .tab-nav {
        border-radius: var(--radius-md);
        padding: 3px;
        gap: 2px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .tab-btn {
        min-width: auto;
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    /* Charts */
    .chart-card {
        padding: var(--space-md);
    }

    .chart-container {
        height: 220px;
    }

    .chart-container-sm {
        height: 200px;
    }

    .chart-container-lg {
        height: 300px;
    }

    .chart-title {
        font-size: 0.82rem;
    }

    /* Heatmap */
    .heatmap-container {
        height: 250px;
    }

    /* Key display */
    .key-note {
        font-size: 3rem;
    }

    .key-mode {
        font-size: 1rem;
    }

    /* QC Issues / AI Tips */
    .qc-issue,
    .ai-tip {
        padding: var(--space-sm) var(--space-md);
    }

    .qc-issue-icon,
    .ai-tip-icon {
        font-size: 1.1rem;
    }

    .ai-tip strong {
        font-size: 0.82rem;
    }

    .ai-tip p,
    .qc-issue p {
        font-size: 0.75rem;
    }

    /* Fade / Lossy */
    .fade-grid {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* Compare/Batch tables */
    .compare-table-wrap {
        margin: 0 calc(-1 * var(--space-md));
        padding: 0 var(--space-md);
    }

    .compare-table th,
    .compare-table td {
        padding: var(--space-sm) var(--space-xs);
        font-size: 0.72rem;
        white-space: nowrap;
    }

    /* Footer */
    #main-footer {
        padding: var(--space-md);
    }

/* ── Small Mobile (≤480px) ── */
@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .summary-card {
        padding: var(--space-sm) var(--space-xs);
    }

    .card-value {
        font-size: 1.1rem;
    }

    .card-unit {
        font-size: 0.65rem;
    }

    .drop-zone h2 {
        font-size: 1rem;
    }

    .drop-icon {
        font-size: 2rem;
        margin-bottom: var(--space-sm);
    }

    .chart-container {
        height: 180px;
    }

    .chart-container-lg {
        height: 250px;
    }

    .mode-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.72rem;
    }

    .qc-verdict {
        font-size: 0.75rem;
    }

    .btn {
        padding: 4px var(--space-sm);
        font-size: 0.72rem;
    }

    .header-text h1 {
        font-size: 0.9rem;
    }

    .header-logo {
        width: 30px;
        height: 30px;
    }

    .target-icon {
        font-size: 1.2rem;
    }

    .target-name {
        font-size: 0.78rem;
    }

    .target-detail,
    .target-reason {
        font-size: 0.65rem;
    }

    .target-status {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}
}

/* ══ AI Tips Responsive ══ */
.ai-tips-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}
@media (max-width: 1024px) {
    .ai-tips-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR (global)
   ═══════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Selection color */
::selection {
    background: var(--accent-dim);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   MODE SELECTOR
   ═══════════════════════════════════════════════════════════ */

#mode-section {
    position: relative;
    z-index: 1;
    padding: var(--space-md) var(--space-xl) 0;
    display: flex;
    justify-content: center;
}

.mode-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.mode-btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(255, 136, 0, 0.18), rgba(34, 211, 238, 0.12));
    color: var(--accent-bright);
    box-shadow: inset 0 0 0 1px var(--border-accent);
}

/* ═══════════════════════════════════════════════════════════
   COMPARE UPLOAD
   ═══════════════════════════════════════════════════════════ */

#compare-section,
#batch-section {
    position: relative;
    z-index: 1;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.compare-upload-grid {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    width: 100%;
    max-width: 900px;
    justify-content: center;
}

.drop-zone-sm {
    max-width: 350px;
    padding: var(--space-xl) var(--space-md);
}

.drop-zone-sm h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.drop-zone-sm .drop-icon {
    font-size: 2.5rem;
}

.compare-vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.btn-lg {
    padding: var(--space-md) var(--space-2xl);
    font-size: 1rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-secondary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   QC BANNER
   ═══════════════════════════════════════════════════════════ */

.qc-banner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
}

.qc-banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.qc-banner-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
}

.qc-verdict {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
}

.qc-verdict.pass {
    background: rgba(255, 136, 0, 0.12);
    color: var(--accent);
}

.qc-verdict.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--orange);
}

.qc-verdict.fail {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}

.qc-verdict-icon {
    font-size: 1.5rem;
}

.qc-stats {
    display: flex;
    gap: var(--space-lg);
}

.qc-stat {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.qc-stat.error {
    color: var(--red);
}

.qc-stat.warning {
    color: var(--orange);
}

.qc-stat.info {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   QC ISSUES LIST
   ═══════════════════════════════════════════════════════════ */

.qc-issues-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qc-issue {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.qc-issue.error {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
}

.qc-issue.warning {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
}

.qc-issue.info {
    background: rgba(148, 163, 184, 0.06);
}

.qc-issue.pass {
    background: rgba(255, 136, 0, 0.06);
    border-color: rgba(255, 136, 0, 0.2);
}

.qc-issue-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.qc-issue strong {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.qc-issue p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   AI TIPS
   ═══════════════════════════════════════════════════════════ */

.ai-tips-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.ai-tip {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05), rgba(34, 211, 238, 0.03));
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-md);
    transition: border-color 0.3s ease;
}

.ai-tip:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.ai-tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.ai-tip strong {
    font-size: 0.9rem;
    color: var(--accent-bright);
    display: block;
    margin-bottom: 4px;
}

.ai-tip p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   HEATMAP / GONIOMETER
   ═══════════════════════════════════════════════════════════ */

.heatmap-container {
    position: relative;
    width: 100%;
    height: 350px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.heatmap-container canvas {
    width: 100% !important;
    height: 100% !important;
}

#canvas-goniometer {
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════
   FADE / LOSSY INFO
   ═══════════════════════════════════════════════════════════ */

.fade-info,
.lossy-info {
    padding: var(--space-lg);
}

.fade-grid {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.fade-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.fade-item strong {
    color: var(--text-primary);
}

.lossy-result {
    font-size: 0.9rem;
}

.lossy-warn {
    color: var(--orange);
    padding: var(--space-md);
    background: rgba(245, 158, 11, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.lossy-warn small {
    color: var(--text-muted);
}

.lossy-ok {
    color: var(--accent);
    padding: var(--space-md);
    background: rgba(255, 136, 0, 0.08);
    border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════
   COMPARE TABLE / BATCH TABLE
   ═══════════════════════════════════════════════════════════ */

#compare-results,
#batch-results {
    position: relative;
    z-index: 1;
    padding: var(--space-lg) var(--space-xl) var(--space-2xl);
    max-width: 1400px;
    margin: 0 auto;
}

.compare-table-wrap {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.compare-table th {
    text-align: left;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.compare-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.compare-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.diff-up {
    color: var(--accent) !important;
}

.diff-down {
    color: var(--red) !important;
}

.full-width {
    grid-column: 1 / -1;
}

.card.full-width {
    padding: var(--space-lg);
}

/* QC Banner layout */
.qc-banner {
    flex-direction: column;
    gap: var(--space-md);
}

.qc-banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.qc-banner-details {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    width: 100%;
}

.qc-banner-item {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.qc-banner-item.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.qc-banner-item.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
}

.qc-banner-item.info {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-muted);
}

/* Target reasons */
.target-reason {
    font-size: 0.72rem;
    color: var(--orange);
    margin-top: 2px;
    font-style: italic;
}

.target-item.fail .target-reason {
    color: var(--red);
}

/* Larger chart for chords */
.chart-container-lg {
    height: 400px;
}

/* ═══════════════════════════════════════════════════════════
   LEGEND / GLOSSARY
   ═══════════════════════════════════════════════════════════ */

.legend-item {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.legend-item:hover {
    background: rgba(255, 136, 0, 0.04);
    border-color: rgba(255, 136, 0, 0.2);
}

.legend-term {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.legend-unit {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 4px;
    padding: 1px 6px;
    letter-spacing: 0.04em;
}

.legend-desc {
    font-size: 0.82rem;
    color: #b0bec5;
    line-height: 1.65;
}

.legend-desc strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legend-range {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.range-good {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(255, 136, 0, 0.08);
    border: 1px solid rgba(255, 136, 0, 0.2);
    border-radius: 20px;
    padding: 2px 10px;
}

.range-bad {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--orange);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 20px;
    padding: 2px 10px;
}

.range-tip {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 20px;
    padding: 2px 10px;
}

/* ═══════════════════════════════════════════════════════════
   TAB INFO BOX — per-tab explanations
   ═══════════════════════════════════════════════════════════ */

.tab-info-box {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.04), rgba(59, 130, 246, 0.04));
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-left: 3px solid var(--cyan);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: var(--space-lg);
    font-size: 0.87rem;
    color: #cbd5e1;
    line-height: 1.65;
}

.tab-info-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-info-legend {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 12px 0;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
}

.til-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    color: #b0bec5;
    line-height: 1.5;
}

.til-item strong {
    color: var(--text-primary);
}

.til-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.tab-info-tip {
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 10px;
    border-left: 2px solid rgba(255, 136, 0, 0.4);
    line-height: 1.6;
}

.tab-info-tip strong {
    color: var(--accent-bright);
}

.chart-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 10px;
    line-height: 1.55;
    font-style: italic;
}
/* ===========================================================
   COMPARE BUTTONS & LED
   =========================================================== */

.ab-switch {
    display: flex;
    background: var(--bg-card);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    gap: var(--space-md);
    align-items: center;
    justify-content: center; /* Centrowanie */
}

.sw-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
}

.sw-btn:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

/* Wersja A (Niebieska - jak waveform) */
.sw-btn-a {
    border-color: rgba(59, 130, 246, 0.3); /* Blue dim */
    color: var(--text-muted);
}

.sw-btn-a.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6; /* Blue bright */
    color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Wersja B (Zielona - jak waveform) */
.sw-btn-b {
    border-color: rgba(255, 136, 0, 0.3); /* Green dim */
    color: var(--text-muted);
}

.sw-btn-b.active {
    background: rgba(255, 136, 0, 0.15);
    border-color: #22c55e; /* Green bright */
    color: #22c55e;
    box-shadow: 0 0 20px rgba(255, 136, 0, 0.15);
}

.btn-txt {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* LED Indicator (Pomara�czowa) */
.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3a2a1a; /* Zgaszona (ciemny br�z) */
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.15s ease-out;
    margin-bottom: 2px;
}

/* Zapalona dioda (tylko w stanie active) */
.sw-btn.active .led {
    background: #ff9500; /* Orange bright */
    box-shadow: 
        0 0 6px #ff9500, 
        0 0 12px rgba(255, 149, 0, 0.8),
        inset 0 -1px 2px rgba(255, 255, 255, 0.4);
    border-color: #ffaa33;
    transform: scale(1.1);
}


/* ===========================================================
   BATCH PROGRESS LIST
   =========================================================== */

.batch-file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.batch-file-list::-webkit-scrollbar {
    width: 6px;
}
.batch-file-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.batch-file-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.batch-file-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.batch-file-percent {
    font-family: var(--font-mono);
    color: var(--accent);
}

.batch-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.batch-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.batch-file-item.done .batch-bar-fill {
    background: var(--accent-bright);
}

.batch-file-item.error .batch-bar-fill {
    background: var(--red);
}

.batch-file-item.pending {
    opacity: 0.5;
}

.login-shell {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 70px 24px 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 520px;
    background: rgba(16, 16, 24, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
    padding: 28px 26px;
    backdrop-filter: blur(16px) saturate(160%);
}

.login-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--accent-bright), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: rgba(226, 232, 240, 0.75);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 18px;
}

.login-providers {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.provider-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.provider-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 136, 0, 0.35);
    background: rgba(255, 136, 0, 0.08);
}

.provider-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.provider-github {
    color: #e2e8f0;
}

.login-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
}

.login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.login-divider span {
    position: relative;
    padding: 0 10px;
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.7);
    background: rgba(16, 16, 24, 0.9);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.85);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.login-email-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.login-input {
    flex: 1;
    height: 44px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 600;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-input:focus {
    border-color: rgba(255, 136, 0, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.12);
}

.login-hint {
    margin-top: 10px;
    font-size: 0.82rem;
    color: rgba(148, 163, 184, 0.95);
    line-height: 1.55;
}

.login-footnote {
    margin-top: 18px;
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.75);
    line-height: 1.6;
}

@media (max-width: 560px) {
    .login-email-row {
        flex-direction: column;
        align-items: stretch;
    }
    .login-card {
        padding: 22px 18px;
    }
}

/* ── Utility Classes (Refactoring) ── */
.u-flex { display: flex; }
.u-items-center { align-items: center; }
.u-flex-center { display: flex; align-items: center; justify-content: center; }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; }
.u-flex-wrap { display: flex; flex-wrap: wrap; }
.u-gap-sm { gap: 8px; }
.u-gap-md { gap: 12px; }
.u-gap-lg { gap: 20px; }

.u-text-none { text-decoration: none; }
.u-text-bold { font-weight: 700; }
.u-text-heavy { font-weight: 800; }
.u-text-white { color: #ffffff; }
.u-text-mono { font-family: var(--font-mono); }
.u-text-smaller { font-size: 0.85rem; }
.u-text-xs { font-size: 12px; }

.u-cursor-pointer { cursor: pointer; }
.u-hidden { display: none !important; }
.u-full-width { width: 100%; }

.u-grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.u-mb-xs { margin-bottom: 4px; }
.u-mb-sm { margin-bottom: 8px; }
.u-mb-md { margin-bottom: 12px; }
.u-mb-lg { margin-bottom: 20px; }
.u-mt-sm { margin-top: 8px; }
.u-mt-md { margin-top: 10px; }
.u-h-spacer { height: 10px; }

.u-color-blue { color: #60a5fa; }
.u-color-green { color: #4ade80; }
.u-color-accent { color: var(--accent); }

.pricing-save-badge {
    color: var(--accent);
    font-size: 0.8rem;
    margin-left: 4px;
}

/* Specific components from refactoring */
.report-box {
    flex: 1;
    min-width: 260px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.report-status-badge {
    font-weight: 900;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

.integrity-summary-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 136, 0, 0.06);
    border: 1px solid rgba(255, 136, 0, 0.18);
    color: rgba(226, 232, 240, 0.75);
}

.legend-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.legend-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.legend-content {
    display: none;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 22px 24px;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}

.q-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

