/* Transport Bar (Phase 3) */
.transport-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 左右分割 */
    gap: var(--space-lg);
    padding: var(--space-sm) var(--space-lg);
}

.transport-left-group,
.transport-right-group {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* Gain Match Switch */
.gain-match-control {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-2xs) var(--space-xs);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.gain-match-control:hover {
    opacity: 0.8;
}

.gain-match-control.is-locked {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

.switch-track {
    width: 32px;
    height: 18px;
    background: #3f3f46;
    border-radius: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-thumb {
    width: var(--radius-lg);
    height: var(--radius-lg);
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gain-match-control.active .switch-track {
    background: var(--preset-active-color, #22c55e);
}

.gain-match-control.active .switch-thumb {
    left: 17px;
}

.gain-match-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.gain-match-control.active .gain-match-label {
    color: var(--text-primary);
}

/* Rewind Button (Circular) */
.rewind-btn-transport {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.rewind-btn-transport:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* .play-btn-transport moved to buttons.css as .btn-play-round */

.visual-right-group {
    flex: 0 0 calc(50% - var(--text-base));
    display: flex;
    flex-direction: column;
    gap: var(--text-base);
}

/* Mastering Amount & Width Sliders */
.sliders-group-horizontal {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: var(--text-2xl);
    padding-top: var(--text-base);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.amount-slider-container {
    flex: 1;
    width: 100%;
    transition: opacity 0.3s ease;
}

.amount-slider-container.is-disabled {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(1);
}

.amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.amount-header label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

#mastering-amount-display,
#res-stereo-width-display,
#res-stereo-width-display-pro,
#res-stereo-width-display-pro,
#ai-intensity-display {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent-primary);
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
}

#mastering-amount-slider,
#res-stereo-width,
#res-stereo-width-pro,
#res-stereo-width-pro,
#ai-intensity-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: var(--glass-border);
    height: var(--radius-sm);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

#mastering-amount-slider::-webkit-slider-thumb,
#res-stereo-width::-webkit-slider-thumb,
#res-stereo-width-pro::-webkit-slider-thumb,
#res-stereo-width-pro::-webkit-slider-thumb,
#ai-intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: none;
    transition: transform 0.1s ease;
}

#mastering-amount-slider::-webkit-slider-thumb:hover,
#res-stereo-width::-webkit-slider-thumb:hover,
#res-stereo-width-pro::-webkit-slider-thumb:hover,
#res-stereo-width-pro::-webkit-slider-thumb:hover,
#ai-intensity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent-hover);
}

#mastering-amount-slider::-moz-range-thumb,
#res-stereo-width::-moz-range-thumb,
#res-stereo-width-pro::-moz-range-thumb,
#res-stereo-width-pro::-moz-range-thumb,
#ai-intensity-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: none;
}

.amount-notch {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 1;
}

.mastering-tools-area {
    display: none;
    /* Hidden by default, shown via JS only in localhost/dev */
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
}

.footer-dev-tools {
    width: auto;
    justify-content: flex-start;
    border-right: 1px solid var(--border-secondary);
    padding-right: var(--space-md);
    margin-right: var(--space-md);
}

.footer-dev-tools .btn-small {
    padding: 2px 10px;
    font-size: 10px;
    height: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.footer-dev-tools .btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.pro-footer-area {
    display: flex;
    align-items: center;
    margin-top: var(--space-md);
    padding: 0 var(--radius-sm);
}

.footer-shortcuts {
    margin-top: 0 !important;
    gap: var(--space-lg) !important;
}

/* .btn-small, .btn-icon, .btn-icon-small, .full-width moved to buttons.css */

.action-area {
    margin-top: auto;
    /* Push to bottom if flex container */
    padding: var(--space-lg) 0;
    position: sticky;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    /* Match bg-primary with opacity */
    backdrop-filter: none;
    border-top: 1px solid var(--border-secondary);
    z-index: 50;
    width: 100%;
    /* Ensure padding for visual separation */
    padding: var(--text-2xl);
    margin-left: -1.5rem;
    /* Counteract parent padding to span full width */
    margin-right: -1.5rem;
    display: flex;
    justify-content: center;
}

.comparison-btn {
    flex: 1;
    max-width: 200px;
    height: 48px;
    min-height: 48px;
}

/* Match Volume Toggle - FORCE ALIGNMENT */
.match-volume-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: var(--radius-md);
    vertical-align: middle;
}

.toggle-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    opacity: 0.8;
    display: inline-block;
    vertical-align: middle;
}

/* Settings List - Premium Grid Style */
.settings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.setting-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--radius-sm);
    transition: transform 0.2s, border-color 0.2s;
}

.setting-item:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.setting-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.setting-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Hide scrollbar for Chrome/Safari/Opera */
    scrollbar-width: none;
    /* Firefox */
    font-family: var(--font-digital);
}

body::-webkit-scrollbar {
    display: none;
}

/* Transport Controls */
.transport-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filename {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

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

.buttons {
    display: flex;
    gap: var(--space-sm);
}

/* QC Badge */
.qc-badge {
    padding: var(--radius-sm) var(--space-sm);
    border-radius: var(--radius-lg);
    font-size: 0.8em;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.qc-badge.pass {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.qc-badge.warn {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Action Area */
.action-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.status-message {
    text-align: center;
    padding: var(--space-md);
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-primary);
}

/* Comparison */
.comparison-buttons {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    justify-content: center;
}

#comparison-player {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: block;
}

/* Report Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.metric-card {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
    text-align: center;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.metric-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: 1.05rem;
    font-weight: 600;
}

.metric-before {
    color: var(--text-secondary);
}

.metric-arrow {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.metric-after {
    color: var(--success);
}

.metric-change {
    font-size: 0.9rem;
    font-weight: 600;
    padding: var(--radius-sm) var(--space-sm);
    border-radius: var(--radius-full);
    display: inline-block;
}

.metric-change.positive {
    color: var(--success);
    background: rgba(34, 197, 94, 0.15);
}

.metric-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Graphs */
.graph-container {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
}

#loudness-graph {
    width: 100%;
    max-width: 700px;
    height: 200px;
    display: block;
    margin: 0 auto var(--space-md);
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
}

.graph-legend,
.spectrum-legend {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 24px;
    height: var(--radius-sm);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Spectrum */
.spectrum-container {
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

#spectrum-analyzer {
    width: 100%;
    max-width: 800px;
    height: 400px;
    display: block;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
}

/* Preset Comparison Table */
.preset-comparison-section {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
}

.preset-comparison-section h3 {
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.preset-table-container {
    overflow-x: auto;
}

.preset-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.preset-table thead {
    background: rgba(168, 85, 247, 0.1);
}

.preset-table th {
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
}

.preset-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-secondary);
}

.preset-table tbody tr:hover {
    background: var(--bg-card);
}

.preset-table .preset-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.preset-table .check-icon {
    color: var(--success);
    font-weight: bold;
}

.preset-table .cross-icon {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Report Summary */
.report-summary {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.report-summary strong {
    color: var(--accent-primary);
}

/* --- Pro Player Styles --- */
.pro-player-card {
    background: var(--bg-tertiary);
    /* Deep Dark */
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: var(--space-xl);
    color: var(--text-primary);
    box-shadow: none;
    border: 1px solid #333;
}

/* .preset-card.active は cards.css に統一 */

/* .player-header redundant definition removed */


/* .play-btn-circle is deprecated/unused */

.track-info {
    flex-grow: 1;
}

.track-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.icon-btn {
    background: transparent;
    border: 1px solid #444;
    color: var(--text-secondary);
    padding: 6px var(--space-sm);
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.icon-btn:hover,
.icon-btn.active {
    background: #333;
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.waveform-area {
    position: relative;
    width: 100%;
    height: 100px;
    /* Reduced height for more compact layout */
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: text;
    /* I-beam cursor for precise seeking */
    margin-bottom: 10px;
}

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

.playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    pointer-events: none;
    z-index: 10;
    left: 0;
}

.playhead::after {
    content: '';
    position: absolute;
    top: 0;
    /* Or bottom */
    left: -3px;
    width: var(--radius-md);
    height: var(--radius-md);
    background: #fff;
    border-radius: 50%;
}

/* Finalize Button (Action before download) */
.finalize-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    height: 36px;
    padding: 0 20px;
    border-radius: var(--radius-full);
    font-size: 14.5px;
    font-weight: 500;
    font-family: var(--font-base);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 var(--radius-sm) var(--radius-lg) rgba(168, 85, 247, 0.3);
    margin-right: var(--radius-md);
}

.finalize-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.4);
}

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

.finalize-btn.processing {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}


.spectrum-container-mini {
    width: 100%;
    height: 80px;
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

#live-spectrum-canvas {
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.spectrum-label {
    position: absolute;
    top: var(--radius-md);
    right: var(--space-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    text-transform: uppercase;
}

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

.hover-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.1s ease;
}



.player-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 var(--radius-sm);
}

/* --- Preset Section Styles --- */
.preset-list-header {
    padding: 0 0 var(--text-base) 0;
    margin-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
}

.preset-list-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.preset-list-header p {
    margin: 0.2rem 0 0 0;
}

.preset-item {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--radius-md);
    background: var(--bg-card);
}

.preset-item:hover {
    border-color: var(--text-secondary);
}

.preset-item.selected {
    background: rgba(168, 85, 247, 0.15);
    /* Slightly stronger */
    border-color: var(--primary-color);
    box-shadow: none;
    /* Double border effect */
}



.preset-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    width: 100%;
}

/* Checkbox styles removed as requested */

.preset-info {
    flex: 1;
}

.preset-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--radius-sm);
}

/* Responsive */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
    }

    .preset-sidebar {
        position: fixed;
        left: -260px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 50;
        transition: left var(--transition-base);
    }

    .preset-sidebar.open {
        left: 0;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Existing 640px media query removed and moved to the end of the file to prevent overrides */

/* Result Top Bar (Preset Tabs) */
.result-top-bar {
    display: flex;
    gap: 10px;
    padding: 10px 0 20px 0;
    overflow-x: auto;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.result-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: var(--space-xs) var(--space-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-base);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.result-chip:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.result-chip.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

/* --- Pro Player New Layout (v125+) --- */

.full-height-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    /* Adjust based on navbar height */
    overflow: hidden;
    background: #0f0f0f;
    /* Pitch black */
    color: var(--text-primary);
}

/* File Info Bar (Phase 1) */
.file-info-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--text-2xl);
    padding: var(--space-sm) 2.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-secondary);
    flex-shrink: 0;
}

.filename-text {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.pro-workspace {
    display: flex;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
}

/* Sidebar */
.pro-sidebar {
    width: 250px;
    background: #18181b;
    /* Dark zinc */
    border-right: 1px solid #27272a;
    display: flex;
    flex-direction: column;
    padding: var(--text-base);
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--text-2xl);
}

.sidebar-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-base);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0;
}

.icon-btn-small {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.song-list {
    flex: 1;
    overflow-y: auto;
}

.song-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    border-radius: 6px;
    cursor: pointer;
    background: #27272a;
    border: 1px solid #3f3f46;
    margin-bottom: 5px;
}

.song-item.active {
    background: #27272a;
    border-color: #52525b;
}

.song-number {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-right: 10px;
    width: 15px;
}

.song-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.song-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--text-base);
}

.btn-white-block {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    padding: var(--space-sm);
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-white-block:hover {
    background: #e4e4e7;
}

/* Main Area */
.pro-main-area {
    flex: 1;
    background: #09090b;
    /* Almost black */
    display: flex;
    flex-direction: column;
    padding: var(--text-2xl) var(--space-xl);
    overflow-y: auto;
    overflow-x: hidden;
    gap: var(--text-base);
    min-height: 0;
}

/* Custom Thin Scrollbar */
.pro-main-area::-webkit-scrollbar {
    width: 6px;
}

.pro-main-area::-webkit-scrollbar-track {
    background: transparent;
}

.pro-main-area::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.pro-main-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Player Header */
/* Player Header (Preset Info & Sliders) - Unified Group */
.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

/* Header Sliders (Inside Player Header) */
.header-sliders {
    display: flex;
    gap: var(--space-sm);
    align-items: stretch;
}


.header-sliders #ai-optimizer-control {
    display: none;
}

.header-sliders .header-slider-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    justify-content: center;
}

.header-sliders .header-slider-group .slider-label-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.header-sliders .header-slider-group .slider-label-row span {
    color: var(--text-muted);
}

.header-sliders .header-slider-group input[type="range"] {
    width: 15rem;
    min-width: 12rem;
    cursor: pointer;
}

.play-btn-large {
    background: #27272a;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
    flex-shrink: 0;
}

.play-btn-large:hover {
    background: #3f3f46;
}

.track-title-large {
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

/* Waveform */
.waveform-container {
    position: relative;
    padding: var(--space-sm);
}

.zoom-controls {
    display: flex;
    justify-content: flex-start;
    padding-bottom: 5px;
}

.canvas-wrapper {
    position: relative;
    cursor: crosshair;
    /* Selection cursor */
    height: 150px;
    /* Force height */
}

/* 波形レイヤー: 6キャンバス重ね合わせ */
.waveform-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    /* デフォルト非表示 */
}

.waveform-layer.active {
    display: block;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #52525b;
    margin-top: 5px;
}

.controls-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--text-base);
}

/* A/B Switch - Sophisticated Segmented Control */
.ab-toggle-pill {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--radius-sm);
    display: inline-flex;
    gap: var(--radius-sm);
    position: relative;
}

.ab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    /* Muted text */
    padding: var(--radius-md) 20px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    /* Unified font-weight to prevent jumping */
    border: 1px solid transparent;
    /* Reserve space for active border */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.ab-btn:hover:not(.active) {
    color: var(--accent-hover);
    background: rgba(255, 255, 255, 0.05);
}

.ab-btn.active {
    /* 実測バッジと統一 - グレーベース */
    background: rgba(156, 163, 175, 0.15);
    color: color-mix(in srgb, #9ca3af, white 40%);
    font-weight: 600;
    border: 1px solid rgba(156, 163, 175, 0.3);
    pointer-events: none;
    /* クリック無効化 */
    cursor: default;
}

#player-mastered-btn.active {
    /* 実測バッジと統一 - プリセットカラーベース */
    background: color-mix(in srgb, var(--preset-active-color, #22c55e), transparent 85%);
    border: 1px solid color-mix(in srgb, var(--preset-active-color, #22c55e), transparent 70%);
    color: color-mix(in srgb, var(--preset-active-color, #22c55e), white 40%);
}

/* Preset Info (Middle Text) */
.active-preset-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: var(--space-sm) var(--space-md);
    flex: 1;
    justify-content: flex-start;
    /* Align left but push stats to right manually */
    text-align: left;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: var(--radius-lg);
    margin-left: 0;
    /* Removed margin */
}

.info-icon {
    font-size: var(--space-xl);
}

.info-text {
    display: flex;
    flex-direction: column;
}

.info-name {
    color: var(--text-primary);
    font-weight: 700;
    /* Bold */
    font-family: var(--font-mono);
    /* Mono */
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1.5rem;
    /* Slightly larger */
}

.info-desc {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    line-height: 1.5;
    white-space: normal;
    max-width: none;
}

/* Intensity Slider Fake */
.intensity-control {
    display: flex;
    align-items: center;
    opacity: 0.5;
    /* Disabled look for now */
}

.fake-slider {
    width: 100px;
    height: var(--radius-sm);
    background: #3f3f46;
    border-radius: 2px;
    position: relative;
    display: flex;
    align-items: center;
}

.fake-fill {
    width: 70%;
    height: 100%;
    background: #06b6d4;
    /* Cyan */
}

.fake-knob {
    width: var(--radius-md);
    height: var(--radius-md);
    border-radius: 50%;
    background: #06b6d4;
    position: absolute;
    left: 70%;
}

/* Analysis Stats Pills */
.stats-pill-container {
    display: flex;
    gap: 0.8rem;
    width: 100%;
    flex-wrap: nowrap;
    /* Force single row */
    justify-content: space-between;
}

.stat-pill {
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--radius-sm);
    flex: 1;
    min-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    /* Bold */
    font-family: var(--font-mono);
    /* Force Mono */
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    /* Spacing */
    text-transform: uppercase;
    margin-bottom: 2px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 18px !important;
    font-weight: 700;
    /* Bold */
    margin: var(--radius-sm) 0;
    color: var(--text-primary) !important;
    text-shadow: 0 0 10px var(--glass-border);
    letter-spacing: 0.02em;
    /* Slight spacing for numbers */
}

.unit {
    font-size: 0.6em;
    margin-left: 4px;
    color: var(--text-secondary);
    font-weight: 600;
    vertical-align: baseline;
    letter-spacing: 0px;
}

/* Coloring the "After" part is handled via HTML injection in JS:
   <span style="color:#aaa">Before -> </span><span style="color:PRESET_COLOR">After</span>
*/

.stat-change {
    font-size: 13px;
    margin-left: 6px;
}

.stat-desc {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    line-height: 1.5;
    opacity: 0.9;
    max-width: 95%;
    border-top: 1px solid var(--glass-border);
    width: 100%;
    padding-top: var(--space-sm);
    text-align: left;
    white-space: normal !important;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: #ef4444;
}

/* Secondary Play Button */
.play-btn-round {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.play-btn-round:hover {
    background: var(--glass-border);
    transform: scale(1.05);
    border-color: var(--accent-primary);
}


.play-btn-round.playing {
    background: var(--preset-active-color, #3b82f6);
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* --- Pro Workspace & Song List (Restored) --- */
.pro-workspace {
    display: flex;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.pro-sidebar {
    width: 250px;
    background: #18181b;
    border-right: 1px solid #27272a;
    display: flex;
    flex-direction: column;
    padding: var(--text-base);
    flex-shrink: 0;
}

.song-list {
    flex: 1;
    overflow-y: auto;
}

.song-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    border-radius: 6px;
    cursor: pointer;
    background: #27272a;
    border: 1px solid #3f3f46;
    margin-bottom: 5px;
}

.song-item.active {
    background: #27272a;
    border-color: #52525b;
}

.song-number {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-right: 10px;
    width: 15px;
}

.song-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.song-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Preset Item Updates */
.preset-item.locked {
    opacity: 0.7;
    cursor: not-allowed;
    background: repeating-linear-gradient(45deg,
            var(--bg-card),
            var(--bg-card) 10px,
            rgba(0, 0, 0, 0.2) 10px,
            rgba(0, 0, 0, 0.2) 20px);
}

.preset-item.locked:hover {
    border-color: var(--border-secondary);
    transform: none;
}

.preset-lock-badge {
    position: absolute;
    top: var(--radius-md);
    right: var(--radius-md);
    background: rgba(0, 0, 0, 0.6);
    padding: var(--radius-sm);
    border-radius: var(--radius-sm);
    color: var(--color-rock-base);
}