/* styles.css — All styles for Audio Manipulator Music Manager */

/* === Theme Variables === */
:root, [data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #141414;
    --bg-hover: #1a1a2a;
    --bg-input: #111;
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --text-muted: #666;
    --text-dim: #555;
    --accent: #4a9eff;
    --accent-hover: #3a8eef;
    --border: #222;
    --border-light: #333;
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ff9f0a;
}

[data-theme="midnight"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #101828;
    --bg-tertiary: #162035;
    --bg-card: #121a2e;
    --bg-hover: #1a2545;
    --bg-input: #101828;
    --text-primary: #d8dce8;
    --text-secondary: #8899bb;
    --text-muted: #556688;
    --text-dim: #445577;
    --accent: #5b8def;
    --accent-hover: #4a7cde;
    --border: #1a2540;
    --border-light: #253555;
    --danger: #ff5c52;
    --success: #40d168;
    --warning: #ffaa22;
}

[data-theme="light"] {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e5e5ea;
    --bg-card: #ffffff;
    --bg-hover: #e8e8f0;
    --bg-input: #ffffff;
    --text-primary: #1c1c1e;
    --text-secondary: #636366;
    --text-muted: #8e8e93;
    --text-dim: #aeaeb2;
    --accent: #007aff;
    --accent-hover: #0066dd;
    --border: #d1d1d6;
    --border-light: #c7c7cc;
    --danger: #ff3b30;
    --success: #34c759;
    --warning: #ff9500;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0px);
}

/* === App Layout === */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 428px;
    margin: 0 auto;
}

.tab-content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-view {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.tab-view.active {
    display: block;
}

/* === Tab Bar === */
.tab-bar {
    display: flex;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    flex-shrink: 0;
}

.tab-bar-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    gap: 2px;
    transition: color 0.15s;
}

.tab-bar-btn .tab-icon {
    font-size: 20px;
    line-height: 1;
}

.tab-bar-btn .tab-label {
    font-size: 10px;
    letter-spacing: 0.3px;
}

.tab-bar-btn.active {
    color: var(--accent);
}

/* === Mini Player === */
.mini-player {
    display: none;
    background: #1a1a1a;
    border-top: 1px solid var(--border-light);
    padding: 8px 16px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

.mini-player.visible {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-player-info {
    flex: 1;
    min-width: 0;
}

.mini-player-title {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
    margin-top: 1px;
}

.mini-player-play-btn {
    width: 36px;
    height: 36px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 14px;
    color: #000;
    line-height: 1;
}

.mini-player-play-btn:active {
    background: #bbb;
}

.mini-waveform {
    position: absolute;
    top: 50%;
    right: 56px;
    width: 80px;
    height: 24px;
    transform: translateY(-50%);
    opacity: 0.4;
    pointer-events: none;
}

.mini-player-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #4a9eff;
    transition: width 0.3s linear;
}

/* === Now Playing Overlay === */
.now-playing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: env(safe-area-inset-top, 0px);
}

.now-playing-overlay.open {
    transform: translateY(0);
}

.now-playing-overlay.animated-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(74, 158, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(191, 90, 242, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(48, 209, 88, 0.05) 0%, transparent 50%);
    background-size: 200% 200%;
    animation: np-bg-drift 12s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes np-bg-drift {
    0%, 100% { background-position: 0% 0%; }
    33% { background-position: 100% 50%; }
    66% { background-position: 50% 100%; }
}

.np-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px 0;
    position: relative;
}

.np-dismiss-btn {
    position: absolute;
    left: 16px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
}

.np-header-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sleep-timer-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 16px;
}

.sleep-timer-btn.active {
    color: var(--accent);
    border-color: var(--accent);
}

.sleep-timer-display {
    text-align: center;
    color: var(--accent);
    font-size: 13px;
    padding: 4px 0 0;
    letter-spacing: 0.5px;
}

.np-body {
    max-width: 428px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 60px;
}

/* Floating control strip */
.floating-strip {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
    max-width: 428px;
    margin: 0 auto;
    border-radius: 12px;
    touch-action: none;
    cursor: grab;
}

.floating-strip.visible {
    display: flex;
}

.floating-strip-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
    cursor: pointer;
}

.floating-strip-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
    flex-shrink: 0;
    min-width: 32px;
}

.floating-strip-bar {
    flex: 1;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.floating-strip-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s linear;
}

.floating-strip-track {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.np-track-info {
    text-align: center;
    margin-bottom: 24px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.np-album-art {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.np-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.np-track-text {
    min-width: 0;
}

.np-track-info.has-art .np-track-text {
    text-align: left;
}

.np-track-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    word-break: break-word;
}

.np-track-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.np-track-bpm {
    font-size: 12px;
    color: var(--accent);
    margin-top: 2px;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

/* === Transport === */
.transport {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.transport-btn {
    width: 44px;
    height: 44px;
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.transport-btn:active {
    background: #333;
}

.transport-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.transport-btn .icon {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1;
}

.extra-transport-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 4px 0 8px;
}

.extra-transport-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 5px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.extra-transport-btn .icon {
    font-size: 12px;
}

.extra-transport-btn .btn-label {
    font-size: 12px;
}

.extra-transport-btn.active {
    color: var(--accent);
    border-color: var(--accent);
}

.play-btn {
    width: 60px;
    height: 60px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.play-btn:active {
    background: #bbb;
}

.play-btn:disabled {
    background: #333;
    cursor: not-allowed;
}

.play-btn .icon {
    font-size: 22px;
    color: #000;
    line-height: 1;
}

.play-btn:disabled .icon {
    color: var(--text-muted);
}

/* === Seek Bar === */
.seek-group {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Waveform behind seek bar */
.waveform-wrap {
    position: relative;
    width: 100%;
    height: 48px;
    margin-bottom: 4px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

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

.waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--accent);
    opacity: 0.18;
    pointer-events: none;
    transition: width 0.1s linear;
}

.seek-time {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.seek-time span {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

/* === Range Inputs === */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.range-labels span {
    font-size: 11px;
    color: var(--text-dim);
}

/* === Control Groups (Speed/Pitch, EQ, Volume) === */
.control-group {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    gap: 4px;
}

.drag-handle {
    font-size: 14px;
    color: var(--text-dim);
    cursor: grab;
    touch-action: none;
    padding: 4px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.collapse-chevron {
    font-size: 10px;
    color: var(--text-dim);
    margin-right: 8px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.control-group.collapsed .collapse-chevron {
    transform: rotate(-90deg);
}

.control-group.collapsed .control-header {
    margin-bottom: 0;
}

.control-group.collapsed > *:not(.control-header) {
    display: none;
}

.control-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

/* === Semitone Controls === */
.semitone-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.semitone-btn {
    width: 44px;
    height: 44px;
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.semitone-btn:active {
    background: #333;
}

.semitone-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.semitone-display {
    text-align: center;
    min-width: 80px;
}

.semitone-display .value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

.semitone-display .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* === Speed Ramp === */
.speed-ramp-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border);
}

.speed-ramp-select {
    flex: 1;
    background: var(--bg-secondary);
    color: #fff;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 6px 4px;
    font-size: 13px;
    -webkit-appearance: none;
}

.speed-ramp-btn {
    background: #0af;
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-width: 50px;
}

.speed-ramp-btn:active {
    opacity: 0.7;
}

/* === EQ === */
.eq-container {
    display: flex;
    align-items: stretch;
    gap: 2px;
}

.eq-db-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding: 2px 6px 2px 0;
    font-size: 10px;
    color: var(--text-dim);
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
    min-width: 24px;
}

.eq-sliders {
    display: flex;
    flex: 1;
    justify-content: space-around;
    align-items: center;
    position: relative;
    padding: 4px 0;
}

.eq-sliders::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #333;
    pointer-events: none;
    z-index: 0;
}

.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.eq-band input[type="range"] {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 28px;
    height: 120px;
    background: transparent;
    margin: 0;
    padding: 0;
}

.eq-band input[type="range"]::-webkit-slider-runnable-track {
    width: 4px;
    background: #444;
    border-radius: 2px;
}

.eq-band input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    margin-left: -7px;
}

.eq-freq-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 6px;
    padding-left: 32px;
}

.eq-freq-labels span {
    font-size: 9px;
    color: var(--text-dim);
    text-align: center;
    flex: 1;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

.eq-tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    transform: translateX(-50%);
    z-index: 9999;
    white-space: nowrap;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

.eq-reset-btn {
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
}

.eq-reset-btn:active {
    background: #333;
}

.eq-preset-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.eq-preset-select {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 10px;
    -webkit-appearance: none;
    appearance: none;
}

.eq-bypassed .eq-sliders,
.eq-bypassed .eq-db-labels,
.eq-bypassed .eq-freq-labels,
.eq-bypassed .eq-q-row {
    opacity: 0.3;
}

/* Parametric EQ Q row */
.eq-q-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 8px 0 0;
    border-top: 1px solid var(--border);
}

.eq-q-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.eq-q-sliders {
    display: flex;
    flex: 1;
    gap: 2px;
}

.eq-q-sliders input[type="range"] {
    flex: 1;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.eq-q-sliders input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
}

.eq-q-sliders input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: -4.5px;
}

.eq-parametric-active {
    background: var(--accent) !important;
    color: #fff !important;
}

/* === Volume Boost Warning === */
.volume-warn input[type="range"] {
    background: #4d3800;
}
.volume-warn input[type="range"]::-webkit-slider-thumb {
    background: #ff9500;
}
.volume-warn .control-value {
    color: #ff9500;
}

.volume-danger input[type="range"] {
    background: #4d1a17;
}
.volume-danger input[type="range"]::-webkit-slider-thumb {
    background: #ff3b30;
}
.volume-danger .control-value {
    color: #ff3b30;
}

/* === Library Tab === */
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.library-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.load-folder-btn {
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--accent);
    font-size: 13px;
    padding: 6px 12px;
    cursor: pointer;
}

.load-folder-btn:active {
    background: #333;
}

.load-folder-btn-large {
    display: inline-block;
    background: #4a9eff;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 32px;
    cursor: pointer;
    margin-top: 16px;
}

.load-folder-btn-large:active {
    background: #3a8eef;
}

.library-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 120px;
    text-align: center;
}

.library-empty-text {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.search-bar-container {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-input:focus {
    border-color: var(--accent);
}

.filter-btn {
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 8px 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-btn:active {
    background: #333;
}

.filter-btn.active-filter {
    color: var(--accent);
    border-color: var(--accent);
}

.sort-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sort-select {
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    padding: 4px 8px;
    outline: none;
}

.track-count-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* === Track List (shared by Library, Queue, Playlists) === */
.track-list {
    list-style: none;
}

/* Folder view headers */
/* Spectrum Analyzer */
.spectrum-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.spectrum-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.spectrum-label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.spectrum-section canvas {
    background: var(--bg-tertiary);
}

.small-select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
}

.small-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
}

/* Cue points */
.cue-section {
    display: none;
    margin-bottom: 8px;
}

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

.cue-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cue-add-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.cue-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cue-chip {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cue-chip:active {
    background: #2a2a3a;
}

.cue-chip .cue-time {
    color: var(--text-muted);
    font-size: 11px;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

.cue-chip .cue-del {
    color: var(--text-dim);
    font-size: 10px;
    padding: 1px;
}

/* Queue Peek */
.queue-peek {
    margin-bottom: 10px;
}

.queue-peek-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.queue-peek-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-peek-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.queue-peek-item:active {
    background: var(--bg-hover);
}

/* Multi-select */
.select-mode-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.select-mode-btn.active {
    background: #1a2a3a;
    border-color: var(--accent);
}

.multi-select-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.multi-select-bar #multiSelectCount {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

.ms-action-btn {
    background: #1a2a3a;
    border: 1px solid var(--border-light);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.ms-action-btn.ms-danger {
    color: #ff453a;
    background: #2a1a1a;
}

.ms-cancel-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
}

.track-row .select-check {
    width: 22px;
    height: 22px;
    border: 2px solid #444;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
}

.track-row .select-check.checked {
    border-color: var(--accent);
    background: #4a9eff;
    color: #fff;
}

/* Noise generator */
.noise-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.noise-type-row {
    display: flex;
    gap: 8px;
}

.noise-type-btn {
    flex: 1;
    padding: 8px 4px;
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.noise-type-btn.active {
    background: #1a2a3a;
    border-color: var(--accent);
    color: var(--accent);
}

.noise-type-btn:active {
    background: #222;
}

/* Presets section */
.presets-section {
    margin-bottom: 16px;
}

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

.preset-sort-select {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    -webkit-appearance: none;
}

.preset-save-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.preset-save-btn:active {
    background: var(--bg-hover);
}

.presets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-chip:active {
    background: #1a2a1a;
    border-color: var(--accent);
}

.preset-chip .preset-delete {
    color: var(--text-dim);
    font-size: 11px;
    padding: 2px;
}

/* Filter rows (LP/HP) */
.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.filter-row input[type="range"] {
    flex: 1;
}

.filter-freq {
    font-size: 12px;
    color: var(--accent);
    width: 40px;
    text-align: right;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
    flex-shrink: 0;
}

/* Clipping indicator */
.clip-indicator {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    color: #ff453a;
    background: rgba(255, 69, 58, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.1s ease;
    vertical-align: middle;
    margin-left: 4px;
}

.clip-indicator.active {
    opacity: 1;
}

/* Loudness meter */
.loudness-meter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 4px 0;
}

.loudness-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.loudness-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.loudness-bar {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.1s;
}

.loudness-value {
    font-size: 11px;
    color: var(--text-primary);
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
    min-width: 52px;
    text-align: right;
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid #1a1a1a;
    cursor: pointer;
    gap: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 2px;
}

.folder-header:active {
    background: #1a1a1a;
}

.folder-chevron {
    font-size: 10px;
    color: var(--accent);
    flex-shrink: 0;
    width: 14px;
}

.folder-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.folder-count {
    font-size: 12px;
    color: var(--text-dim);
    background: #1a1a1a;
    padding: 2px 8px;
    border-radius: 10px;
}

.track-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1a1a1a;
    gap: 10px;
    cursor: pointer;
}

.track-row:active {
    background: #1a1a1a;
}

.track-row.unavailable {
    opacity: 0.4;
    cursor: default;
}

.tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.track-row.now-playing-row {
    border-left: 3px solid var(--accent);
    padding-left: 8px;
}

.track-drag-handle {
    color: #444;
    font-size: 16px;
    cursor: grab;
    padding: 4px;
    touch-action: none;
    flex-shrink: 0;
}

.track-drag-handle:active {
    color: var(--text-secondary);
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-name {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.track-action-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-action-btn:active {
    background: #333;
    color: #fff;
}

.unavailable-label {
    font-size: 10px;
    color: var(--text-dim);
    background: #1a1a1a;
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
}

/* === Bottom Sheet === */
.bottom-sheet-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
}

.bottom-sheet-backdrop.open {
    display: block;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-radius: 16px 16px 0 0;
    z-index: 301;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: #444;
    border-radius: 2px;
    margin: 10px auto;
}

.bottom-sheet-title {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 16px 8px;
    text-align: center;
}

.bottom-sheet-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    background: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
}

.bottom-sheet-option:active {
    background: #222;
}

.bottom-sheet-option.danger {
    color: #ff453a;
}

.bottom-sheet-option .bs-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.bottom-sheet-cancel {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 12px;
    padding: 14px;
    background: #222;
    border: none;
    border-radius: 10px;
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.bottom-sheet-cancel:active {
    background: #333;
}

/* === Playlist Picker (quick add) === */
.playlist-picker-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
}

.playlist-picker-backdrop.open {
    display: block;
}

.playlist-picker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-radius: 16px 16px 0 0;
    z-index: 301;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    max-height: 60vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.playlist-picker.open {
    transform: translateY(0);
}

.playlist-picker-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    padding: 16px 16px 8px;
    text-align: center;
}

.playlist-picker-item {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
}

.playlist-picker-item:active {
    background: #222;
}

.playlist-picker-new {
    color: var(--accent);
    font-weight: 600;
}

/* === Filter Popover === */
.filter-popover {
    display: none;
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.filter-popover.open {
    display: block;
}

.filter-group-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    margin-top: 10px;
}

.filter-group-label:first-child {
    margin-top: 0;
}

.filter-option {
    display: inline-block;
    padding: 4px 10px;
    background: #222;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    margin: 0 4px 4px 0;
}

.filter-option:active {
    background: #333;
}

.filter-option.selected {
    background: #1a3a5c;
    border-color: var(--accent);
    color: var(--accent);
}

.filter-folder-select {
    background: #222;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    padding: 6px 10px;
    outline: none;
    width: 100%;
    margin-top: 4px;
}

/* === Playlists Tab === */
.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.playlists-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.playlists-add-btn {
    width: 36px;
    height: 36px;
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--accent);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlists-add-btn:active {
    background: #333;
}

.playlists-empty {
    text-align: center;
    padding-top: 120px;
    color: var(--text-muted);
    font-size: 16px;
}

.playlist-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.playlist-card:active {
    background: #1a1a1a;
}

.playlist-card-info {
    flex: 1;
    min-width: 0;
}

.playlist-card-name {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.playlist-card-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.playlist-card-preview {
    font-size: 11px;
    color: #444;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card-more {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}

.playlist-card-more:active {
    color: #fff;
}

/* === Inside Playlist View === */
.playlist-inside-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.playlist-back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.playlist-inside-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex: 1;
    cursor: pointer;
}

.playlist-inside-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.playlist-play-btn,
.playlist-shuffle-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.playlist-play-btn {
    background: #4a9eff;
    border-color: var(--accent);
    color: #fff;
}

.playlist-play-btn:active {
    background: #3a8eef;
}

.playlist-shuffle-btn {
    background: #1a1a1a;
    color: var(--text-primary);
}

.playlist-shuffle-btn:active {
    background: #333;
}

.playlist-new-input-row {
    display: none;
    gap: 8px;
    margin-bottom: 12px;
}

.playlist-new-input-row.visible {
    display: flex;
}

.playlist-new-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #4a9eff;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
}

.playlist-new-confirm,
.playlist-new-cancel {
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--accent);
    font-size: 14px;
    padding: 8px 12px;
    cursor: pointer;
}

.playlist-new-cancel {
    color: var(--text-secondary);
}

/* === Queue Tab === */
.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.queue-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.queue-source {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.queue-empty {
    text-align: center;
    padding-top: 120px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    padding-left: 20px;
    padding-right: 20px;
}

.queue-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.clear-queue-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: #ff453a;
    font-size: 14px;
    cursor: pointer;
}

.clear-queue-btn:active {
    background: #2a1a1a;
}

.save-queue-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
}

.save-queue-btn:active {
    background: var(--bg-hover);
}

.queue-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-top: 1px solid #1a1a1a;
    margin-top: 8px;
}

.history-chevron {
    font-size: 10px;
    transition: transform 0.2s;
}

.history-chevron.open {
    transform: rotate(180deg);
}

/* === Settings Tab === */
.settings-tab-header {
    margin-bottom: 20px;
}

.settings-tab-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.settings-section {
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.settings-section-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 16px 0;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
}

.setting-row + .setting-row {
    border-top: 1px solid var(--border);
}

.setting-label {
    font-size: 14px;
    color: var(--text-primary);
}

.setting-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

.setting-slider-row {
    padding: 0 16px 14px;
}

.setting-description {
    font-size: 12px;
    color: var(--text-dim);
    padding: 0 16px 12px;
    line-height: 1.4;
}

.setting-slider-row input[type="range"] {
    margin-bottom: 4px;
}

.ceiling-controls {
    transition: opacity 0.2s;
}

.ceiling-controls.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Diagnostics */
.diagnostic-panel {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 16px;
}

.diag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #1a1a1a;
}

.diag-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.diag-val {
    font-size: 12px;
    color: var(--text-primary);
    font-family: 'SF Mono', SFMono-Regular, Menlo, monospace;
}

.perf-overlay {
    position: fixed;
    top: 44px;
    right: 4px;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    color: #30d158;
    font: 10px/1.3 'SF Mono', SFMono-Regular, Menlo, monospace;
    padding: 4px 6px;
    border-radius: 6px;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.perf-overlay .perf-lbl { color: #8e8e93; }
.perf-overlay .perf-dim { color: #636366; margin-left: 4px; }
.perf-overlay .perf-warn { color: #ff9f0a; }
.perf-overlay .perf-bad { color: #ff453a; }

.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #333;
    border-radius: 14px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #4a9eff;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.reset-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: #ff453a;
    font-size: 15px;
    cursor: pointer;
    margin-top: 8px;
}

.reset-btn:active {
    background: #2a1a1a;
}

.settings-stats {
    font-size: 12px;
    color: var(--text-dim);
    padding: 8px 16px 12px;
    line-height: 1.6;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-undo-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
}

.toast-undo-btn:active {
    opacity: 0.6;
}

/* === File Input (hidden) === */
.hidden-file-input {
    display: none;
}

/* === Info Button === */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #555;
    background: none;
    color: var(--text-dim);
    font-size: 11px;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    margin-left: 6px;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    vertical-align: middle;
}

.info-btn:active {
    background: #333;
    border-color: var(--accent);
    color: var(--accent);
}

.info-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.info-popup.visible {
    opacity: 1;
    pointer-events: auto;
}

.info-popup-box {
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    max-width: 300px;
    width: 85%;
    text-align: center;
}

.info-popup-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.info-popup-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-popup-close {
    margin-top: 16px;
    background: #4a9eff;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 24px;
    cursor: pointer;
}

/* === Favorites === */
.fav-filter-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 18px;
    padding: 4px 8px;
    cursor: pointer;
    line-height: 1;
}

.fav-filter-btn.active {
    color: #ffd60a;
    border-color: #ffd60a;
}

.fav-btn {
    background: none;
    border: none;
    color: #444;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.fav-btn.favorited {
    color: #ffd60a;
}

/* === Setting Select === */
.setting-select {
    background: #1a1a1a;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* === Repeat Button === */
.repeat-btn {
    opacity: 0.4;
    font-size: 16px;
}

.repeat-btn.active {
    opacity: 1;
    color: var(--accent);
}

.repeat-btn.active-one {
    opacity: 1;
    color: #ff9f0a;
}

/* === Rename Input Inline === */
.rename-input {
    background: #1a1a1a;
    border: 1px solid #4a9eff;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 15px;
    padding: 4px 8px;
    outline: none;
    width: 100%;
}

/* === Accessibility: Large Touch Targets === */
[data-large-touch] button,
[data-large-touch] .toggle-switch {
    min-height: 48px;
    min-width: 48px;
}

[data-large-touch] input[type="range"] {
    height: 44px;
}

[data-large-touch] input[type="range"]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
}

[data-large-touch] .track-row {
    min-height: 56px;
    padding: 12px 10px;
}

[data-large-touch] .tab-bar-btn {
    min-height: 52px;
}

/* === Accessibility: Reduce Motion === */
[data-reduce-motion],
[data-reduce-motion] * {
    animation: none !important;
    transition: none !important;
}

/* === Accessibility: High Contrast === */
[data-high-contrast] {
    --text-primary: #fff;
    --text-secondary: #e0e0e0;
    --text-muted: #ccc;
    --border: #888;
}

[data-high-contrast] button,
[data-high-contrast] select,
[data-high-contrast] .toggle-switch {
    border: 2px solid #aaa !important;
}

[data-high-contrast] .track-row {
    border-bottom: 1px solid #666;
}

[data-high-contrast] input[type="range"]::-webkit-slider-runnable-track {
    background: #666;
}

/* Focus indicator for keyboard/screen reader */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* === Landscape / Wide EQ View === */
@media (orientation: landscape) and (max-height: 500px) {
    .now-playing-overlay {
        padding-top: 0;
    }

    .np-header {
        padding: 4px 16px;
    }

    .np-body {
        max-width: 100%;
        padding: 8px 16px;
    }

    .eq-band input[type="range"] {
        height: 180px;
        width: 36px;
    }

    .eq-band input[type="range"]::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
        margin-left: -9px;
    }

    .eq-freq-labels span {
        font-size: 10px;
    }

    .eq-q-sliders input[type="range"] {
        height: 28px;
    }

    .np-album-art {
        width: 56px;
        height: 56px;
    }

    .np-track-name {
        font-size: 16px;
    }

    .seek-group {
        margin-bottom: 8px;
        padding: 8px;
    }

    .control-group {
        padding: 8px;
        margin-bottom: 8px;
    }

    .waveform-wrap {
        height: 36px;
    }
}

@media (min-width: 768px) {
    .np-body {
        max-width: 600px;
    }

    .eq-band input[type="range"] {
        height: 160px;
        width: 34px;
    }

    .eq-band input[type="range"]::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
        margin-left: -8px;
    }
}

.update-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 12px;
    background: #333;
    color: #fff;
    font-size: 13px;
    padding: 10px 12px 10px 16px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    z-index: 600;
    max-width: calc(100vw - 32px);
}

.update-banner-action {
    background: #fff;
    color: #111;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 32px;
}

.update-banner-action:disabled {
    opacity: 0.5;
    cursor: default;
}

.update-banner-dismiss {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    min-width: 32px;
    min-height: 32px;
}

.update-banner-dismiss:hover {
    color: #fff;
}