:root {
    --bg-dark: #090d16;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(26, 35, 54, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-glow: rgba(139, 92, 246, 0.35);

    /* Stem Colors */
    --stem-drums: #f59e0b;
    --stem-bass: #a855f7;
    --stem-vocals: #ec4899;
    --stem-guitar: #06b6d4;
    --stem-piano: #10b981;
    --stem-other: #3b82f6;

    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background animated gradient blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    animation: blobFloat 20s ease-in-out infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: #ec4899;
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.blob-3 {
    width: 450px;
    height: 450px;
    background: #06b6d4;
    top: 40%;
    left: 30%;
    animation-delay: -14s;
}

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 80px) scale(1.15); }
}

/* Main Container Layout */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
}

/* Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--accent-purple);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px var(--accent-glow);
}

.brand-text h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.accent-text {
    background: linear-gradient(135deg, #a855f7, #ec4899, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.header-badges {
    display: flex;
    gap: 1rem;

}

.model-badge, .hardware-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.model-badge {
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.3);
}

.hardware-badge {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Card General Styling */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.25rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Upload Section */
.upload-card .card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.upload-card p {
    color: var(--text-secondary);
}

/* Model Selector Container & Toggle Bar */
.model-selector-container {
    margin-bottom: 2rem;
}

.selector-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.model-toggle-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.model-toggle-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.model-toggle-btn:hover {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.06);
    transform: translateY(-2px);
}

.model-toggle-btn.active {
    border-color: var(--accent-purple);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.15));
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

.toggle-btn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.model-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.model-badge-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.model-badge-tag.badge-ft {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.4);
}

.model-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .model-toggle-bar {
        grid-template-columns: 1fr;
    }
}

/* Format Selector Container */
.format-selector-container {
    margin-bottom: 2rem;
}

.format-toggle-bar {
    display: flex;
    gap: 1rem;
}

.format-toggle-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.format-toggle-btn:hover {
    border-color: rgba(6, 182, 212, 0.5);
    color: #ffffff;
    background: rgba(6, 182, 212, 0.06);
}

.format-toggle-btn.active {
    border-color: #06b6d4;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.15));
    color: #ffffff;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

/* Source Section & OR Divider */
.source-section {
    margin-bottom: 1.5rem;
}

.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.or-divider span {
    padding: 0 1.25rem;
    color: var(--text-secondary);
    opacity: 0.7;
}


/* YouTube Panel & Card */
.youtube-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.youtube-card:focus-within {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2), inset 0 0 30px rgba(239, 68, 68, 0.08);
}

.url-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0.4rem 0.5rem 0.4rem 0.85rem;
    transition: all 0.2s ease;
}

.url-input-wrapper:focus-within {
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.url-icon-badge {
    color: #ef4444;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.url-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

.url-input-field::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.btn-url-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-url-action:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.url-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.url-hint i {
    color: #ef4444;
}

/* Primary Hero CTA Button */
.btn-hero-cta {
    width: 100%;
    padding: 1.1rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #3b82f6 100%);
    border: none;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-hero-cta:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

.btn-hero-cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-clear-file {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-clear-file:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}


.dropzone {
    border: 2px dashed rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    padding: 3.5rem 2rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    background: rgba(139, 92, 246, 0.03);
    transition: all 0.3s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--accent-purple);
    margin-bottom: 1.25rem;
}

.dropzone h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.browse-text {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.browse-text .highlight {
    color: var(--accent-purple);
    font-weight: 600;
}

.format-tags {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}

.tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* File Selected Bar */
.file-selected-bar {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    animation: fadeIn 0.4s ease;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.file-info i {
    font-size: 1.4rem;
    color: var(--accent-purple);
}

.file-name {
    font-weight: 600;
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.6rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.6);
}

.btn-accent {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: white;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.6);
}

.btn-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-play-master {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-play-master:hover {
    transform: scale(1.08);
}

.btn-stop-master {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-stop-master:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Progress Card */
.progress-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.4s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-title i {
    font-size: 1.8rem;
    color: var(--accent-purple);
}

.progress-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.progress-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-percent {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-purple);
}

.progress-bar-track {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899, #06b6d4);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.separation-metadata {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* Mixer Card */
.mixer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.track-title-block h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.song-title-badge {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.4rem;
    display: inline-block;
}

/* Master Controls Bar */
.master-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.75rem;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.playback-buttons {
    display: flex;
    gap: 0.75rem;
}

.master-time-display {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 90px;
    color: var(--text-secondary);
}

.master-seekbar-container {
    flex: 1;
}

.seekbar {
    width: 100%;
    height: 6px;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

.master-volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 140px;
}

.master-volume-control i {
    color: var(--text-secondary);
}

.vol-slider {
    width: 100px;
    height: 5px;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

/* Stems Container & Stem Strip Cards */
.stems-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.stem-strip {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--stem-color, var(--accent-purple));
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: 180px 1fr 220px 120px;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.25s ease;
}

.stem-strip:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.stem-strip.muted {
    opacity: 0.45;
}

.stem-strip.soloed {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.stem-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.stem-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--stem-color-bg, rgba(255, 255, 255, 0.1));
    color: var(--stem-color, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stem-title-group h4 {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: capitalize;
}

.stem-status-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Waveform Canvas */
.waveform-box {
    width: 100%;
    height: 48px;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

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

/* Controls (Solo/Mute/Vol) */
.stem-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-toggle {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle.active-solo {
    background: #f59e0b;
    color: #000;
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.btn-toggle.active-mute {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.stem-volume-fader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.stem-vol-slider {
    width: 80px;
    height: 4px;
    accent-color: var(--stem-color, var(--accent-purple));
    cursor: pointer;
}

.stem-download-action {
    text-align: right;
}

.btn-stem-dl {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-stem-dl:hover {
    background: var(--stem-color, var(--accent-purple));
    color: #fff;
    border-color: transparent;
}

/* History Section */
.history-card .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.history-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-title h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.history-count-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-history {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-history i {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 0.75rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.25s ease;
}

.history-item:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.04);
    transform: translateY(-2px);
}

.history-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.history-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c084fc;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.history-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.history-track-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.btn-history-load {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-history-load:hover {
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.btn-history-dl {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-history-dl:hover {
    border-color: #06b6d4;
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
}

.btn-history-del {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-history-del:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
}

/* Footer */
.app-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 2rem;
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .stem-strip {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 1rem;
    }
    .waveform-box {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .stem-strip {
        grid-template-columns: 1fr;
    }
    .waveform-box {
        grid-column: 1;
    }
    .master-controls {
        flex-direction: column;
        align-items: stretch;
    }
}
