:root {
    --primary: #6366f1;
    --secondary: #a855f7;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #22d3ee;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    color-scheme: dark; /* Force browser to use dark themed native UI */
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.blob-1 {
    background: var(--primary);
    top: -200px;
    right: -100px;
    animation: move 20s infinite alternate;
}

.blob-2 {
    background: var(--secondary);
    bottom: -200px;
    left: -100px;
    animation: move 25s infinite alternate-reverse;
}

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(100px, 100px); }
}

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

header {
    text-align: center;
    margin-bottom: 50px;
}

.tab-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn.is-active {
    color: var(--text-primary);
    border-color: rgba(34, 211, 238, 0.52);
    background: rgba(34, 211, 238, 0.16);
}

.gradient-text {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

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

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--accent);
    display: flex;
    align-items: center;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.drop-zone:hover, .drop-zone.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.drop-zone p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.drop-zone span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-player {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.waveform-container {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    height: 120px;
    overflow: hidden;
}

.project-file-note {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(99, 102, 241, 0.16);
    line-height: 1.5;
}

.project-overview-section {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(34, 211, 238, 0.24);
    background: rgba(34, 211, 238, 0.06);
}

.project-overview-section h3 {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 1.05rem;
}

.project-overview-summary {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.92rem;
}

.project-overview-tracks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.project-track-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

.project-track-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.project-track-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.project-track-actions {
    margin-top: 8px;
}

.track-solo-btn {
    border: 1px solid rgba(34, 211, 238, 0.38);
    background: rgba(34, 211, 238, 0.12);
    color: var(--accent);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

.track-solo-btn:hover {
    background: rgba(34, 211, 238, 0.18);
}

.project-audio-player-wrap {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.5);
}

.project-audio-player-title {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#project-audio-player {
    width: 100%;
}

.project-timeline {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
    align-items: center;
}

.timeline-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-lane {
    position: relative;
    height: 34px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    overflow: hidden;
}

.timeline-clip {
    position: absolute;
    top: 4px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.42), rgba(99, 102, 241, 0.42));
    border: 1px solid rgba(34, 211, 238, 0.45);
    min-width: 2px;
}

.timeline-ruler {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.timeline-ruler-grid {
    position: relative;
    height: 18px;
}

.timeline-ruler-mark {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.24);
}

.timeline-ruler-mark span {
    position: absolute;
    top: 0;
    left: 3px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.play-btn:hover {
    transform: scale(1.1);
    background: var(--accent);
}

.remove-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #ef4444;
    color: white;
}

.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input[type="range"] {
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.value-display {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-align: right;
}

.check-group {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.text-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    color-scheme: dark; /* Force browser to use dark themed native UI (dropdowns, etc.) */
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.text-input option {
    background-color: #1e293b;
    color: white;
}

.text-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.output-settings {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.checkbox-label span {
    transition: color 0.2s ease;
}

.checkbox-label strong {
    margin-left: auto;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 999px;
    padding: 2px 8px;
}

.preset-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(255, 255, 255, 0.05);
    padding: 18px 22px;
    border-radius: 18px;
    margin-left: 32px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.preset-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 16px;
}

.preset-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.preset-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border-radius: 14px;
    padding: 14px 18px;
    min-height: 54px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: rgba(99, 102, 241, 0.6);
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.preset-btn.is-active {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.9);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2) inset;
}

.preset-note {
    margin: 0;
    margin-left: 196px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.preset-save-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.preset-save-row + .preset-save-row {
    margin-top: 8px;
}

.param-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.param-label {
    font-size: 0.85rem;
    opacity: 0.8;
    white-space: nowrap;
    min-width: 90px;
}

.checkbox-label:hover span {
    color: var(--accent);
}

.weights-section {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.weights-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.weight-control {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.weight-control p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actions {
    text-align: center;
    margin: 40px 0;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 18px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.result-card {
    border-color: var(--accent);
    max-width: 500px;
    margin: 20px auto;
}

.pipeline-result-area {
    display: none; /* Hidden by default, shown by JS */
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(34, 211, 238, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    margin-left: 20px;
    animation: fadeIn 0.4s ease;
}

.pipeline-result-area h3 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--accent);
    white-space: nowrap;
}

.pipeline-result-area .status-message {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    padding: 0;
    background: none;
}

.pipeline-result-area .download-container {
    margin: 0;
}

.pipeline-result-area .download-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.execute-block {
    min-width: 300px;
    transition: min-width 0.3s ease;
}

.execute-block.has-result {
    min-width: 650px;
    justify-content: flex-start !important;
}

.status-message {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.download-container {
    text-align: center;
}

.download-btn {
    display: inline-block;
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent);
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-overlay p {
    margin-bottom: 20px;
    font-weight: 600;
}

.progress-container {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transition: width 0.3s ease;
}

.progress-percentage {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Loader UI Enhancements */
.loader-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.loader-header {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 16px;
}

.loader-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loader-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.loader-meta-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.loader-meta-badge span.highlight {
    color: var(--accent);
    font-weight: 600;
}

.stepper-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.step-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
}

.step-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
}

.step-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
    white-space: nowrap;
}

/* Active Step State */
.step-item.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
}

.step-item.active .step-icon {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
    animation: pulseBorder 1.5s infinite alternate;
}

.step-item.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.step-item.active .step-time {
    color: var(--accent);
    font-weight: 600;
}

/* Completed Step State */
.step-item.completed {
    background: rgba(34, 197, 94, 0.04);
    border-color: rgba(34, 197, 94, 0.2);
}

.step-item.completed .step-icon {
    border-color: #22c55e;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.step-item.completed .step-label {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

.step-item.completed .step-time {
    color: #22c55e;
    opacity: 0.8;
}

/* Spinner animation inside active step */
.step-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes pulseBorder {
    from { box-shadow: 0 0 2px rgba(34, 211, 238, 0.2); }
    to { box-shadow: 0 0 10px rgba(34, 211, 238, 0.5); }
}


/* ── Pipeline flow ── */
.pipeline-nav {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.pipeline-nav-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 80px;
    gap: 4px;
    flex-shrink: 0;
}

.pns-num {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.pns-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.pns-tag {
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pipeline-nav-arrow {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    padding: 0 2px;
    padding-top: 8px;
}

.pipeline-scroll-area {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 24px;
    align-items: stretch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.pipeline-scroll-area::-webkit-scrollbar {
    height: 8px;
}
.pipeline-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}
.pipeline-scroll-area::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.pipeline-block {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    flex: 0 0 480px;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.3);
}

.pipeline-block-hd {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pb-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 3px 9px;
    border-radius: 6px;
    flex-shrink: 0;
}

.pb-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pb-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

.pipeline-block-bd {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.pipeline-block-bd > .check-group:first-child {
    margin-top: 0;
}

.pipeline-connector {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 36px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    position: relative;
    flex-shrink: 0;
}

.pipeline-connector::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 14px;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-50%);
}

.param-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .parameter-grid {
        grid-template-columns: 1fr;
    }
    .gradient-text {
        font-size: 2.5rem;
    }
    .timeline-row,
    .timeline-ruler {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .timeline-label {
        font-size: 0.8rem;
    }
    .param-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 640px;
    margin: 0;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.credits-body::-webkit-scrollbar {
    width: 6px;
}
.credits-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.credits-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#credits-link:hover {
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}
