/* ==========================================
   MINI PLAYER (app-bottom)
   ========================================== */

/* MINI PLAYER (independent styles) */
/* Мини-плеер с затемнением вверх */
/* Мини-плеер с тенью по всем сторонам и мягким затемнением вверх */
/* Мини-плеер с глубокой тенью */
/* Мини-плеер с margin для выхода border/tени за padding родителя */
/* Мини-плеер с выходом border/tени за padding родителя по обеим сторонам */
.mini-player {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background: #0f0f0f;
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    outline: none;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base);
    border: 2px solid #1f1f1f;
    box-shadow: 0 0 230px 0 rgba(10,10,10,0.80), 10px 0 80px 0 rgba(10,10,10,0.80);
}

/* Профессиональная тень вверх (градиент) */


.mini-player:focus,
.mini-player:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
    border-color: var(--accent);
}
.mini-player-cover {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.mini-player-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-player-info { flex: 1; min-width: 0; }
.mini-player-title { font-size: 14px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player-authors { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player-buttons { display: flex; gap: var(--spacing-xs); margin-left: auto; }

/* app-bottom base (overridden by main block below player section) */

.form-select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    display: flex;
}
.form-select-chevron svg {
    width: 18px;
    height: 18px;
}
.form-select-wrapper {
    position: relative;
    width: 100%;
}
.form-select {
    width: 100%;
    padding: 12px 44px 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: all var(--transition-base);
}
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
/* ==========================================
   STYLES - Choreo Store
   Modern Minimalist Dark Theme
   ========================================== */

:root {
    /* Icon Scale (for temporary size adjustment) */
    --icon-scale: 1;
    
    /* Background Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-hover: #222222;
    --bg-elevated: #161616;
    
    /* Text Colors */
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    --text-muted-accent: color-mix(in srgb, var(--accent) 40%, #525252);
    
    /* Accent Colors (default blue) */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-dim: rgba(59, 130, 246, 0.12);
    --accent-glow: rgba(59, 130, 246, 0.25);
    --accent-text: #ffffff;
    --player-accent-text: #ffffff;
    
    /* Semantic Colors */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-dim: rgba(239, 68, 68, 0.12);
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.12);
    
    /* Border Colors */
    --border: #262626;
    --border-light: #333333;
    --border-focus: var(--accent);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Z-Index Layers */
    --z-base: 1;
    --z-sticky: 100;
    --z-fixed: 200;
    --z-dropdown: 300;
    --z-modal: 400;
    --z-toast: 500;
    
    /* Layout Sizes */
    --header-height: 60px;
    --bottom-height: 72px;
    
    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-base: 0.15s ease;
    --transition-slow: 0.25s ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
}

/* ==========================================
   ACCENT COLOR THEMES
   ========================================== */

[data-accent="blue"] {
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-dim: rgba(59, 130, 246, 0.12);
    --accent-glow: rgba(59, 130, 246, 0.25);
}

[data-accent="purple"] {
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-dim: rgba(139, 92, 246, 0.12);
    --accent-glow: rgba(139, 92, 246, 0.25);
}

[data-accent="pink"] {
    --accent: #ec4899;
    --accent-hover: #db2777;
    --accent-dim: rgba(236, 72, 153, 0.12);
    --accent-glow: rgba(236, 72, 153, 0.25);
}

[data-accent="red"] {
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --accent-dim: rgba(239, 68, 68, 0.12);
    --accent-glow: rgba(239, 68, 68, 0.25);
}

[data-accent="orange"] {
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-dim: rgba(249, 115, 22, 0.12);
    --accent-glow: rgba(249, 115, 22, 0.25);
}

[data-accent="yellow"] {
    --accent: #eab308;
    --accent-hover: #ca8a04;
    --accent-dim: rgba(234, 179, 8, 0.12);
    --accent-glow: rgba(234, 179, 8, 0.25);
}

[data-accent="green"] {
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-dim: rgba(34, 197, 94, 0.12);
    --accent-glow: rgba(34, 197, 94, 0.25);
}

[data-accent="teal"] {
    --accent: #14b8a6;
    --accent-hover: #0d9488;
    --accent-dim: rgba(20, 184, 166, 0.12);
    --accent-glow: rgba(20, 184, 166, 0.25);
}

/* ==========================================
   RESET & BASE
   ========================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Touch devices: remove sticky hover by only applying :hover on devices with fine pointer */
@media (hover: none) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

html {
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    /* Make body exactly viewport height to avoid cumulative min-height causing overflow */
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   LAYOUT
   ========================================== */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Respect device safe area (notch) */
    padding-top: env(safe-area-inset-top, 0);
    height: calc(var(--header-height) + env(safe-area-inset-top, 0));
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    z-index: var(--z-fixed);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-left {
    min-width: 0;
    overflow: hidden;
}

.header-right {
    flex-shrink: 0;
}

.header-icon {
    display: flex;
    color: var(--accent);
}

.header-icon svg {
    width: calc(24px * var(--icon-scale));
    height: calc(24px * var(--icon-scale));
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.app-content {
    /* Vertical padding smaller, horizontal padding standard */
    padding: var(--spacing-sm) var(--spacing-md);
    max-width: 800px;
    margin: 0 auto;
}

/* Page-level wrapper offset: move top offset from individual sections
   to the page wrapper so sections keep their own spacing. */
.main-page {
    padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0));
    padding-bottom: calc(var(--bottom-height) + env(safe-area-inset-bottom, 0));
}

/* When viewing a single set page the global header is hidden; ensure
   content respects the safe-area and header height so it doesn't
   overlap the device notch or status area in PWA mode. */
.set-page {
    /* Header is hidden on the set page — only respect the device safe-area inset */
    padding-top: env(safe-area-inset-top, 0);
    /* Ensure full viewport height accounting for safe areas (no header height subtraction) */
    min-height: calc(100vh - env(safe-area-inset-top, 0) - (var(--bottom-height) + env(safe-area-inset-bottom, 0)));
    padding-bottom: calc(var(--bottom-height) + env(safe-area-inset-bottom, 0));
}

/* Custom accent color for set page (enabled via useSetAccentColor setting) */
.set-page.has-custom-accent {
    --accent: var(--set-page-accent);
}

.app-content.no-header {
    padding-top: var(--spacing-md);
}

.app-content.no-bottom {
    padding-bottom: var(--spacing-md);
}

.app-content.is-player {
    /* Remove vertical padding for full-screen player but keep horizontal gutters
       so other layout measurements (left/right spacing) remain consistent. */
    padding-top: 0;
    padding-bottom: 0;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    overflow: hidden;
    max-height: 100vh;
    /* Player page must appear above app-bottom (sync bar) */
    position: relative;
    z-index: calc(var(--z-fixed) + 10);
}

.app-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: var(--bottom-height);
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 0));
    z-index: var(--z-fixed);
    pointer-events: none;
}

.app-bottom > * {
    pointer-events: auto;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

/* Visible focus ring for keyboard users */
.btn:focus-visible {
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: 2px;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

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

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon svg {
    width: calc(18px * var(--icon-scale));
    height: calc(18px * var(--icon-scale));
}

.btn-small .btn-icon svg {
    width: calc(16px * var(--icon-scale));
    height: calc(16px * var(--icon-scale));
}

.btn-tiny .btn-icon svg {
    width: calc(14px * var(--icon-scale));
    height: calc(14px * var(--icon-scale));
}

/* Button Variants */
.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
}

@media (hover: hover) {
    .btn-primary:hover:not(:disabled) {
        background: var(--accent-hover);
    }
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

@media (hover: hover) {
    .btn-secondary:hover:not(:disabled) {
        background: var(--bg-hover);
        border-color: var(--border-light);
    }
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

@media (hover: hover) {
    .btn-ghost:hover:not(:disabled) {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }
}

/* Toggle active state - colored semi-transparent background with accent text/icon */
.btn-toggle-active {
    background: color-mix(in srgb, var(--player-accent, var(--accent)) 25%, transparent);
    color: var(--player-accent, var(--accent));
    border-color: transparent;
    gap: 0;
    padding: 12px 12px;
}

@media (hover: hover) {
    .btn-toggle-active:hover:not(:disabled) {
        background: color-mix(in srgb, var(--player-accent, var(--accent)) 35%, transparent);
        color: var(--player-accent, var(--accent));
        border-color: transparent;
    }
}

/* Toggle button: icon color when active */
.btn-toggle-active .btn-icon {
    color: var(--player-accent, var(--accent));
}

/* Toggle button text label */
.btn-toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--player-accent, var(--accent));
}

/* Speed button: text after icon */
.player-speed-btn .btn-toggle-text {
    margin-left: 6px;
}

/* Playlist button: text before icon */
.player-playlist-btn .btn-toggle-text {
    margin-right: 6px;
}

/* Mini-player buttons always white icons */
.mini-player-buttons .btn .btn-icon {
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

@media (hover: hover) {
    .btn-danger:hover:not(:disabled) {
        background: var(--danger-hover);
    }
}

/* Button Sizes */
.btn-small {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-md);
    min-height: 36px;
}

.btn-tiny {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    min-height: 28px;
}

.btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
}

.btn-icon-only.btn-small {
    width: 36px;
    height: 36px;
}

.btn-icon-only.btn-tiny {
    width: 28px;
    height: 28px;
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */

.form-field {
    margin-bottom: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.form-field-hidden {
    display: none;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
}

.input-wrapper.has-icon .input {
    padding-left: 44px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-base);
    outline: none;
}

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

@media (hover: hover) {
    .input:hover {
        border-color: var(--border-light);
    }
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ==========================================
   SELECT
   ========================================== */

.select-wrapper {
    position: relative;
}

.select {
    width: 100%;
    padding: 12px 44px 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: all var(--transition-base);
}

@media (hover: hover) {
    .select:hover {
        border-color: var(--border-light);
    }
}

.select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    display: flex;
}

.select-chevron svg {
    width: 18px;
    height: 18px;
}

/* ==========================================
   TOGGLE / SWITCH
   ========================================== */

.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.toggle-label-section {
    flex: 1;
    min-width: 0;
}

.toggle-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-description {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-muted);
}

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

.toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    top: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

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

/* ==========================================
   RADIO GROUP
   ========================================== */

.radio-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 14px;
}

@media (hover: hover) {
    .radio-option:hover {
        background: var(--bg-hover);
        border-color: var(--border-light);
    }
}

.radio-option.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.radio-option input {
    display: none;
}

/* Grouped radio group */
.radio-group--grouped {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 0;
}

.radio-group--grouped .radio-option {
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
}

.radio-group--grouped .radio-option.active {
    background: var(--bg-hover);
}

.radio-option .radio-icon svg {
    width: 18px;
    height: 18px;
}

/* ==========================================
   COLOR PICKER
   ========================================== */

.color-picker {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.color-option {
    position: relative;
    cursor: pointer;
}

.color-option input {
    display: none;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) {
    .color-option:hover .color-dot {
        transform: scale(1.1);
    }
}

.color-option.active .color-dot {
    border-color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.color-check {
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
    display: flex;
}

.color-check svg {
    width: 12px;
    height: 12px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.color-option.active .color-check {
    opacity: 1;
    transform: scale(1);
}

/* color-option keeps default browser focus styles (no custom outline) */

/* ==========================================
   SECTIONS
   ========================================== */

.section {
    margin-bottom: var(--spacing-lg);
    /* Sections keep normal spacing; page-level top offset moved to `.main-page`. */
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-md);
}

/* Focus style for section headers: use native focus ring and avoid clipping */
.section-header:focus {
    outline: none;
}
.section-header:focus-visible {
    outline: 2px auto -webkit-focus-ring-color;
    outline-offset: 2px;
    border-radius: 2px;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    min-width: 0;
    max-width: 100%;
}

.section-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Small tweak: ensure counters on set page have a little top spacing */
.set-item-counters {
    margin-top: 8px;
}

/* Player media structure styles (cover + info) */
.player-container .player-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Limit width and ensure it doesn't overflow */
    width: 100%;
    max-width: min(85%, 480px);
    margin: 0 auto;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    text-align: left;
    /* Ensure media shrinks to fit available space */
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.player-container .player-cover {
    /* Fill the media block so player-media width equals cover width */
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: block;
    flex-shrink: 0;
}

.player-container .player-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.player-container .player-info .marquee-container {
    width: 100%;
    max-width: 100%;
}

/* Landscape: side-by-side cover + info */
@media (orientation: landscape) and (max-height: 500px) {
    .player-container .player-media {
        flex-direction: row;
        align-items: center;
        max-width: 100%;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    .player-container .player-cover {
        width: auto;
        max-width: none;
        height: min(40vh, 200px);
        aspect-ratio: 1 / 1;
    }
    .player-container .player-info {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Marquee component styles (copied/adapted) */
/* Marquee component */
.marquee-container {
    overflow: hidden;
    position: relative;
}

.marquee-container::before,
.marquee-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 5px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, 
        var(--bg-primary) 0%, 
        transparent 100%);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, 
        var(--bg-primary) 0%, 
        transparent 100%);
}

.marquee-container.needs-scroll::before,
.marquee-container.needs-scroll::after {
    opacity: 1;
}

.marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.marquee-track.animating {
    animation: marquee-scroll var(--duration) linear infinite;
}

.marquee-track.paused {
    animation-play-state: paused;
}

.marquee-text {
    white-space: nowrap;
    padding-right: 20px;
}

.marquee-track.static .marquee-text {
    padding-right: 0;
}

.marquee-track.static .marquee-text:not(:first-child) {
    display: none;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.player-container .player-track-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.player-container .player-track-authors {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -4px;
}

.player-container .player-file-name {
    font-size: 11px;
    line-height: 14px;
    color: var(--text-muted);
    margin-top: -2px;
}

/* When filename is a marquee, apply muted style to the inner text */
.player-container .player-file-name .marquee-text {
    font-size: 11px;
    line-height: 14px;
    color: var(--text-muted);
}

.section-danger .section-title {
    color: var(--text-muted);
}

.section-danger .settings-item-label {
    color: var(--danger);
}

/* ==========================================
   SETTINGS GROUP
   ========================================== */

.settings-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    /* allow focus outlines from children to be visible (avoid clipped focus rings) */
    overflow: visible;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    gap: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-vertical {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
}

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

.settings-item-value {
    font-size: 14px;
    color: var(--text-secondary);
}

.settings-item-clickable {
    cursor: pointer;
    transition: background var(--transition-base);
}

@media (hover: hover) {
    .settings-item-clickable:hover {
        background: var(--bg-tertiary);
    }
}

/* ====================
   Set Details Header
   ==================== */
.set-details-header {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: var(--spacing-lg);
    box-shadow: none;
}

.set-details-title-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    overflow: visible;
}

.set-details-name {
    font-size: 18px;
    font-weight: 600;
    margin-left: var(--spacing-sm);
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

/* Spacer used when the set title is omitted but layout needs a flexible gap */
.set-details-spacer {
    flex: 1;
    min-width: 0;
}

/* set-details-title-row-buttons — visible on set page */
.set-details-title-row-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-left: auto;
}
/* Hide only in player page context */
.player-page .set-details-title-row-buttons {
    display: none !important;
}

.set-item-counters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}



.set-details-actions {
    margin-top: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-sm);
}

/* Player header mirrors set-details styles to preserve layout */
.player-header {
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.player-title {
    font-size: 18px;
    font-weight: 600;
    margin-left: var(--spacing-sm);
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

/* Player page safe-area padding for PWA devices */
.player-page {
    padding-top: env(safe-area-inset-top);
    padding-bottom: 0;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    z-index: calc(var(--z-fixed) + 10);
}

/* Custom accent color for player (set via JS --player-accent) */
.player-page .btn-primary {
    background: var(--player-accent, var(--accent));
}
@media (hover: hover) {
    .player-page .btn-primary:hover {
        background: var(--player-accent, var(--accent-hover));
        filter: brightness(0.9);
    }
}

.player-container {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.player-bottom {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
}

.player-bottom-files-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Add bottom inset so buttons sit above device safe-area / bottom padding */
.player-bottom-files-buttons {
    padding-bottom: var(--spacing-md);
}

.player-file-btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 8px;
}

.player-bottom-timeline {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.player-current-time,
.player-duration {
    width: 40px;
    text-align: center;
    font-size: 14px;
    color: #fff;
}

.player-progress-wrap {
    flex: 1 1 auto;
    padding: 0;
    cursor: pointer;
}

.player-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
    pointer-events: none;
}

.player-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--player-accent, var(--accent));
}

.player-bottom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    min-height: 64px; /* Account for center controls height */
}

.player-controls-center .btn-icon-only.btn-primary {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    padding: 0;
    box-shadow: var(--shadow-sm);
}
.player-controls-center .btn-icon-only.btn-primary .btn-icon svg {
    width: 26px;
    height: 26px;
    color: var(--player-accent-text, #fff);
}

/* All icons in player-controls-center should be white */
.player-controls-center .btn-icon svg {
    color: #fff;
}

/* Prev/Next smaller icon-only buttons */
.player-controls-left .btn-icon-only,
.player-controls-right .btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--text-muted);
}

.player-bottom-files-buttons .btn {
    padding: 6px 10px;
    font-size: 13px;
}

.player-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 52px;
}

.player-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 52px;
    margin-left: auto;
}

.player-controls-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Speed popup */
.speed-popup {
    position: fixed;
    bottom: 100px;
    left: 50%;
    display: none;
    z-index: 1000;
    width: auto;
    min-width: 180px;
}

.speed-popup.visible {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.speed-slider-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
}

.speed-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--player-accent, var(--accent));
    border-radius: 50%;
    cursor: pointer;
}

.speed-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 40px;
    width: 40px;
    text-align: right;
}

.speed-buttons-row {
    display: flex;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-sm) var(--spacing-sm);
}

.speed-option-btn {
    flex: 1;
    min-width: 36px;
    justify-content: center;
    padding: var(--spacing-sm) !important;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

@media (hover: hover) {
    .speed-option-btn:hover {
        background: var(--bg-tertiary);
    }
}

.speed-option-btn.active {
    background: var(--player-accent, var(--accent));
    color: #fff;
}

/* ==========================================
   FILE VIEWER
   ========================================== */

.file-viewer-page {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    /* Safe-area for PWA on devices with notch */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.file-viewer-header {
    flex-shrink: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-left: calc(var(--spacing-md) + env(safe-area-inset-left, 0));
    padding-right: calc(var(--spacing-md) + env(safe-area-inset-right, 0));
    border-bottom: 1px solid var(--color-border);
    background: var(--bg);
}

.file-viewer-title {
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-viewer-content {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Image viewer */
.file-viewer-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    overflow: hidden;
    position: relative;
}

.file-viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    cursor: zoom-in;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.file-viewer-image.zoomed {
    cursor: grab;
    max-width: none;
    max-height: none;
}

.file-viewer-image.dragging {
    cursor: grabbing;
    transition: none;
}

/* Video viewer */
.file-viewer-video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: #000;
}

.file-viewer-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-sm);
}

/* PDF viewer */
.file-viewer-pdf {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--color-tertiary);
    -webkit-overflow-scrolling: touch;
}

.file-viewer-pdf-loading {
    padding: var(--spacing-xl);
    color: var(--text-muted);
    text-align: center;
}

.file-viewer-pdf-loading.error {
    color: var(--color-danger);
}

.file-viewer-pdf-page {
    position: relative;
    background: #fff;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.file-viewer-pdf-page.loaded {
    /* Page loaded state */
}

.file-viewer-pdf-page.error {
    background: var(--color-tertiary);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-danger);
}

.file-viewer-pdf-canvas {
    display: block;
    /* Don't override inline width/height set by JS */
    max-width: calc(100vw - var(--spacing-md) * 2);
}

.file-viewer-pdf-link {
    position: absolute;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s ease;
}

@media (hover: hover) {
    .file-viewer-pdf-link:hover {
        background: rgba(var(--accent-rgb), 0.15);
    }
}

.file-viewer-pdf-counter {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: var(--spacing-sm);
}

.file-viewer-pdf-unavailable {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    text-align: center;
}

.file-viewer-pdf-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
}

.file-viewer-pdf-icon svg {
    width: 100%;
    height: 100%;
}

.file-viewer-pdf-name {
    font-size: 16px;
    font-weight: 500;
}

.file-viewer-pdf-hint {
    font-size: 14px;
    color: var(--text-muted);
}

/* Text viewer */
.file-viewer-text {
    flex: 1;
    overflow: auto;
    padding: var(--spacing-md);
    background: var(--color-secondary);
}

.file-viewer-text-content {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    color: var(--text);
}

/* Unknown file viewer */
.file-viewer-unknown {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    text-align: center;
}

.file-viewer-unknown-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
}

.file-viewer-unknown-icon svg {
    width: 100%;
    height: 100%;
}

.file-viewer-unknown-name {
    font-size: 16px;
    font-weight: 500;
}

.file-viewer-unknown-type {
    font-size: 14px;
    color: var(--text-muted);
}

/* Error state */
.file-viewer-error {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-danger);
    text-align: center;
    padding: var(--spacing-xl);
}

/* Playlist block (inside player) */
.playlist-block {
    position: absolute;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    z-index: 10;
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    overflow: hidden;
}

.playlist-tracks {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.playlist-track-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    cursor: pointer;
    transition: background var(--transition-base);
}

@media (hover: hover) {
    .playlist-track-item:hover {
        background: var(--bg-secondary);
    }
}

.playlist-track-item.active {
    background: color-mix(in srgb, var(--player-accent, var(--accent)) 25%, transparent);
}

.playlist-track-item.active .playlist-track-title {
    color: var(--player-accent, var(--accent));
    font-weight: 600;
}

.playlist-track-item.active .playlist-track-artist {
    color: color-mix(in srgb, var(--player-accent, var(--accent)) 40%, var(--text-muted));
}

.playlist-track-cover {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

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

.playlist-track-artist {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-item-clickable:active {
    background: var(--bg-hover);
}

.settings-item-danger {
    color: var(--danger);
}

.settings-item-danger .settings-item-icon {
    color: var(--danger);
}

.settings-item-icon {
    display: flex;
    color: var(--text-muted);
}

.settings-item-icon svg {
    width: 18px;
    height: 18px;
}

/* Ensure clickable settings rows show the same rounded focus ring as buttons
   without changing markup. This avoids the default rectangular UA outline on divs. */
.settings-item-clickable:focus {
    outline: none;
}
.settings-item-clickable:focus-visible {
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: 2px;
    border-radius: var(--radius-lg);
}

/* ==========================================
   SET SETTINGS MODAL
   ========================================== */

.settings-section {
    margin-bottom: var(--spacing-lg);
}

.settings-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.settings-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.set-settings-cover-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.set-settings-cover-preview {
    width: 120px;
    height: 120px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto var(--spacing-sm);
}

.set-settings-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.set-settings-cover-preview.empty {
    color: var(--text-muted);
    opacity: 0.5;
}

.set-settings-cover-preview.empty svg {
    width: 48px;
    height: 48px;
}

.set-settings-upload-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.set-settings-upload-row .settings-hint {
    margin-top: 0;
}

.set-settings-color-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.color-input {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: transparent;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--radius-md) - 4px);
}

.hex-input {
    width: 90px;
    height: 36px;
    padding: 0 var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 13px;
}

.hex-input::placeholder {
    color: var(--text-muted);
}

/* Color Palette from Cover */
.set-settings-palette {
    margin-top: var(--spacing-sm);
}

.set-settings-palette .settings-item-label {
    margin-bottom: var(--spacing-xs);
    font-size: 13px;
    color: var(--text-secondary);
}

.palette-swatches {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.palette-swatch {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    padding: 0;
}

@media (hover: hover) {
    .palette-swatch:hover {
        transform: scale(1.1);
        border-color: var(--border-light);
    }
}

.palette-swatch:active {
    transform: scale(0.95);
}

/* ==========================================
   CATEGORIES LIST
   ========================================== */

.categories-list {
    display: flex;
    flex-direction: column;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.category-item:last-child {
    border-bottom: none;
}

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

.category-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.category-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    cursor: grab;
    border: none;
}

@media (hover: hover) {
    .drag-handle:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }
}

.drag-handle svg {
    width: 16px;
    height: 16px;
}

.drag-handle.drag-disabled,
.drag-handle.drag-disabled:hover {
    cursor: not-allowed !important;
    opacity: 0.35 !important;
    background: transparent !important;
    color: var(--text-muted) !important;
}

.sortable-ghost {
    /* Visual ghost should be full opacity and borderless */
    opacity: 1 !important;
    transform: scale(0.98);
    border-bottom: none !important;
}

/* Hide ghost completely — items move directly in place */
.sortable-ghost-hidden {
    opacity: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* Make the original/chosen item semi-transparent while dragging */
/* Use a specific placeholder class set from Sortable hooks to avoid affecting the ghost */
.category-item.placeholder.sortable-chosen {
    opacity: 0.35 !important;
}

/* Hide right-side actions for the chosen (held) item and while dragging */
.category-item.sortable-chosen .category-actions,
.category-item.dragging .category-actions {
    visibility: hidden;
}

/* ==========================================
   MODAL
   ========================================== */

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
    padding: var(--spacing-md);
    pointer-events: auto;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    max-height: calc(100% - 180px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: var(--spacing-md);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* Confirm Modal */
.confirm-message {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 var(--spacing-sm);
}

.confirm-warning {
    color: var(--color-red);
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    padding: var(--spacing-sm);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
}

/* ==========================================
   DROP ZONE
   ========================================== */

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    /* Keyboard focus styles */
    outline: none;
}

@media (hover: hover) {
    .drop-zone:hover {
        border-color: var(--accent);
        background: var(--accent-dim);
    }
}

.drop-zone:focus,
.drop-zone:focus-visible {
    /* Match hover style for keyboard focus (no extra outline)
       Keep the dashed border + color change — do NOT add box-shadow/outline. */
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: none;
}

.drop-zone:focus .drop-zone-icon,
.drop-zone:focus-visible .drop-zone-icon,
.drop-zone:focus .drop-zone-subtext,
.drop-zone:focus-visible .drop-zone-subtext {
    color: var(--text-muted-accent);
}

.drop-zone-active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.drop-zone-icon {
    display: flex;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    transition: color var(--transition-base);
}

@media (hover: hover) {
    .drop-zone:hover .drop-zone-icon {
        color: var(--text-muted-accent);
    }
}
.drop-zone-active .drop-zone-icon {
    color: var(--text-muted-accent);
}

.drop-zone-active .drop-zone-icon {
    color: var(--accent);
}

.drop-zone-icon svg {
    width: 32px;
    height: 32px;
}

.drop-zone-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition-base);
}

.drop-zone-active .drop-zone-text {
    color: var(--accent);
}

.drop-zone-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    transition: color var(--transition-base);
}

@media (hover: hover) {
    .drop-zone:hover .drop-zone-subtext {
        color: var(--text-muted-accent);
    }
}

.drop-zone-input {
    display: none;
}

/* Global Drop Overlay */
.drop-overlay {
    position: fixed;
    top: var(--spacing-md);
    left: var(--spacing-md);
    right: var(--spacing-md);
    bottom: var(--spacing-md);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Place overlay below modals so it doesn't obscure them when modal is open */
    z-index: var(--z-dropdown);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    border-radius: var(--radius-xl);
}

.drop-overlay-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Drop zone inside overlay - fill container */
.drop-overlay-zone {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Hide add-to-set zone by default */
.drop-overlay-zone-add {
    display: none;
}

/* Split overlay: two zones stacked vertically */
.drop-overlay.drop-overlay-split {
    flex-direction: column;
    gap: var(--spacing-sm);
}

.drop-overlay.drop-overlay-split .drop-overlay-zone {
    height: 50%;
    border-radius: var(--radius-lg);
}

.drop-overlay.drop-overlay-split .drop-overlay-zone-add {
    display: flex;
}

.drop-overlay-zone .drop-zone-icon svg {
    width: 64px;
    height: 64px;
}

/* ==========================================
   BUTTON MODIFIERS
   ========================================== */

.btn-full-width {
    width: 100%;
    margin-top: var(--spacing-sm);
}

.btn-icon-right {
    flex-direction: row-reverse;
}

/* ==========================================
   FILE LIST
   ========================================== */

.file-list {
    display: none;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.file-list:not(:empty) {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    /* Keyboard focus styles */
    outline: none;
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.file-list-item.clickable {
    cursor: pointer;
}

@media (hover: hover) {
    .file-list-item.clickable:hover {
        background: var(--bg-hover);
    }
}

.file-list-item.clickable:active {
    background: var(--bg-active);
}

.file-list-item:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

.file-list-item:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
}

.file-list-cover {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-list-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-list-cover svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.file-list-icon {
    display: flex;
    color: var(--text-muted);
}

.file-list-icon svg {
    width: 20px;
    height: 20px;
}

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

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

.file-list-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: var(--spacing-xs);
}

.file-list-size {
    font-size: 12px;
    color: var(--text-muted);
}

.file-list-type {
    font-size: 12px;
    color: var(--text-secondary);
}

/* TODO: file-list-link buttons are hidden for now — keep the elements in DOM for future use */
.file-list-link {
    display: none !important;
}

/* Buttons container for file/track list items */
.file-list-item-buttons {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    flex-shrink: 0;
    /* Keep buttons horizontal and anchor to the right of the item */
    flex-direction: row;
    margin-left: auto;
    /* Allow buttons container to stretch vertically so it can be the tallest sibling */
    align-self: stretch;
}

/* Track list item — visually similar to file-list-item but with 3-line info */
.track-list-item {
    /* Keep track item height determined by info/buttons; cover is fixed size */
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    outline: none;
}

.track-list-item:focus,
.track-list-item:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
}

.track-list-item.playing {
    background: color-mix(in srgb, var(--player-accent, var(--accent)) 25%, transparent);
}

.track-list-item.playing .track-list-title {
    color: var(--player-accent, var(--accent));
    font-weight: 600;
}

.track-list-item.playing .track-list-authors {
    color: color-mix(in srgb, var(--player-accent, var(--accent)) 40%, var(--text-muted));
}

.track-list-item.playing .track-list-filename {
    color: color-mix(in srgb, var(--player-accent, var(--accent)) 30%, var(--text-muted));
}

.track-list-item.playing .file-list-item-buttons .btn-icon {
    color: var(--player-accent, var(--accent));
}

.track-list-cover {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.track-list-cover img { width: 100%; height: 100%; object-fit: cover; }

.track-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.track-list-title { font-size: 14px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -4px; }
.track-list-authors { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -4px; }
.track-list-filename { font-size: 8px; line-height: 8px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ==========================================
   ADD SET ACTIONS
   ========================================== */

.add-set-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.add-set-actions .btn {
    flex: 1;
}

/* ==========================================
   SETTINGS VERSION
   ========================================== */

.settings-version {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: var(--spacing-md) 0;
}

.settings-version-status {
    font-size: 11px;
    opacity: 0.7;
}

.settings-version-subtitle {
    font-size: 10px;
    opacity: 0.5;
}

/* ==========================================
   MENU (Context Menu)
   ========================================== */

.menu {
    position: fixed;
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(-4px);
}

.menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================
   DISABLE TEXT SELECTION (global)
   Prevent copying/selecting text across the UI,
   but allow selection inside inputs, textareas,
   selects and explicitly contenteditable elements.
   ========================================== */

/* Disable selection globally */
body, body * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Re-enable selection for form controls and editable areas */
input, textarea, select, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

.menu-list {
    min-width: 160px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xs);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

@media (hover: hover) {
    .menu-item:hover {
        background: var(--bg-hover);
    }
}

/* Use background color for menu selection instead of native outline */
.menu-item:focus,
.menu-item:focus-visible,
.menu-item.focused {
    outline: none;
    background: var(--bg-selected, var(--bg-hover));
}

/* Disabled menu items should look inactive, matching ghost button disabled appearance */
.menu-item[disabled],
.menu-item[aria-disabled="true"] {
    color: var(--text-disabled);
    opacity: 0.35;
    cursor: default;
    background: transparent;
}

.menu-item.danger {
    color: var(--danger);
}

.menu-item-icon {
    display: flex;
}

.menu-item-icon svg {
    width: 18px;
    height: 18px;
}

.menu-item-label {
    flex: 1;
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-xs) 0;
}

/* ==========================================
   SET ITEM
   ========================================== */

.sets-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.set-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    transition: background var(--transition-base);
}

@media (hover: hover) {
    .set-item:hover {
        background: var(--bg-tertiary);
    }
}

.set-item-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.set-item-cover svg {
    width: 24px;
    height: 24px;
    color: rgba(255,255,255,0.8);
}

.set-item-play {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.set-item-play svg {
    width: 20px;
    height: 20px;
    color: white;
}

@media (hover: hover) {
    .set-item-cover:hover .set-item-play {
        opacity: 1;
    }
}

/* Syncing indicator — cloud icon pulses (see .set-item-cloud-icon rules above) */

.set-item-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.set-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.set-item-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 0 1 auto;
}

.set-item-cloud-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.4;
}

.set-item-cloud-icon svg {
    width: 14px;
    height: 14px;
}

/* Cloud icon — fully synced: accent color */
.set-synced .set-item-cloud-icon {
    color: var(--accent);
    opacity: 1;
}

/* Cloud icon pulse animation during sync (4.5s cycle) */
.set-syncing .set-item-cloud-icon {
    animation: cloudSyncPulse 4.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
    opacity: 1;
}

@keyframes cloudSyncPulse {
    0%, 100% { color: var(--text-muted); opacity: 0.4; }
    50% { color: var(--accent); opacity: 1; }
}

/* Pending archive (locked) set */
.set-item-lock-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}
.set-item-lock-icon svg {
    width: 14px;
    height: 14px;
}
.set-item-pending .set-item-cover {
    opacity: 0.5;
}

.set-item-counters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
}

.file-counter {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.file-counter-icon {
    display: flex;
}

.file-counter-icon svg {
    width: 14px;
    height: 14px;
}

.set-item-size {
    font-size: 12px;
    color: var(--text-muted);
}

.set-item-buttons {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* Section headers - removed scale transform that caused shift on click */

/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-md);
    /* Ensure the empty state is vertically centered in the page area */
    min-height: calc(100vh - var(--header-height) - var(--bottom-height) - var(--spacing-lg));
}

.empty-state-icon {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state-icon svg {
    width: 48px;
    height: 48px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 280px;
    margin: 0 auto var(--spacing-lg);
}

.empty-state-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

/* ==========================================
   COLLAPSIBLE SECTION
   ========================================== */

.section-collapsible .section-header {
    user-select: none;
}

.section-chevron {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform var(--transition-base);
    margin-left: var(--spacing-xs);
}

.section-chevron svg {
    width: 16px;
    height: 16px;
}

.section-collapsible.collapsed .section-chevron {
    transform: rotate(-90deg);
}

.section-collapsible.collapsed .section-content {
    display: none;
}

.section-empty {
    font-size: 14px;
    color: var(--text-muted);
    padding: var(--spacing-sm);
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
}

/* ==========================================
   MODALS & TOASTS CONTAINERS
   ========================================== */

.modals-container {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    pointer-events: none;
    /* Keep container as a positioning context for overlays */
    display: block;
    box-sizing: border-box;
}

/* Give modals container larger vertical padding so modals are inset from edges */
.modals-container {
    padding-top: calc(var(--spacing-2xl, 48px) + env(safe-area-inset-top, 0));
    padding-bottom: calc(var(--spacing-2xl, 48px) + env(safe-area-inset-bottom, 0));
}

/* When overlays are placed inside .modals-container, constrain them to its bounds
   so modal-overlay cannot extend beyond the container's top/bottom edges. */
.modals-container .modal-overlay {
    /* Fill the container's inner box (respects container padding) */
    position: absolute;
    inset: 0;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: auto;
    padding: 0;
}

/* Constrain modal sizing to the overlay's height (which is limited by the container). */
.modals-container .modal {
    max-height: calc(100% - 180px);
    width: 100%;
    box-sizing: border-box;
}

.toasts-container {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: var(--z-toast);
    pointer-events: none;
}

.toasts-container > * {
    pointer-events: auto;
}

/* Mobile responsiveness and gesture tuning
   - Prevent overscroll pull-to-refresh and elastic scroll
   - Optimize touch handling and disable pinch/zoom gestures
*/
html, body {
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

img, a {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

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

/* ==========================================
   CLOUD DOWNLOAD MODAL
   ========================================== */

.cloud-input-row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}
.cloud-input-row .form-field,
.cloud-input-row .input-wrapper {
    flex: 1;
    min-width: 0;
}

.cloud-status {
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    min-height: 18px;
}

.cloud-file-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 300px;
    overflow-y: auto;
    margin-top: var(--spacing-sm);
}

.cloud-file-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.cloud-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.cloud-file-size {
    min-width: 56px;
    text-align: right;
    color: var(--text-muted);
    font-size: 12px;
}

.cloud-file-status {
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cloud-file-status.status-queued { color: var(--text-muted); }
.cloud-file-status.status-loading { color: var(--accent); }
.cloud-file-status.status-ready { color: #22c55e; }
.cloud-file-status.status-error { color: #ef4444; }

.cloud-progress {
    width: 60px;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.cloud-progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width 0.2s ease;
}

.cloud-total {
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Cloud link items (settings) */
.cloud-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}
.cloud-link-item:last-child {
    border-bottom: none;
}
.cloud-link-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 0;
}
.cloud-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--accent);
    flex-shrink: 0;
}
.cloud-link-icon svg {
    width: 18px;
    height: 18px;
}
.cloud-link-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cloud-link-label {
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cloud-link-meta {
    font-size: 11px;
    color: var(--text-muted);
}
.cloud-link-actions {
    display: flex;
    gap: var(--spacing-xs);
}
.cloud-link-syncing {
    animation: cloud-spin 1s linear infinite;
}
@keyframes cloud-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Cloud link modal settings */
.cloud-link-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}
.cloud-link-releases {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 200px;
    overflow-y: auto;
    margin-top: var(--spacing-xs);
}
.cloud-link-release-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.cloud-link-release-item input[type="checkbox"] {
    accent-color: var(--accent);
}
.cloud-link-release-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cloud-link-release-size {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.cloud-link-empty {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 13px;
}

/* Header sync icon */
.header-sync-icon {
    display: none;
    align-items: center;
    color: var(--accent);
}
.header-sync-icon.active {
    display: flex;
}
.header-sync-icon svg {
    width: 20px;
    height: 20px;
    animation: header-sync-rotate 1.2s linear infinite;
}
@keyframes header-sync-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Cloud link progress bar */
.cloud-link-progress {
    width: 100%;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
    display: none;
}
.cloud-link-progress.active {
    display: block;
}
.cloud-link-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Cloud release list in edit modal */
.cloud-edit-releases {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: var(--spacing-xs);
}
.cloud-edit-release-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    font-size: 13px;
}
.cloud-edit-release-row input[type="checkbox"] {
    flex-shrink: 0;
}
.cloud-edit-release-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cloud-copy-btn {\n    /* margin-top: var(--spacing-xs); */\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    /* font-size: 12px; */\n    /* padding: 4px 8px; */\n}

/* Sync bottom bar */
.sync-bottom-bar {
    background: #0f0f0f;
    border: 2px solid #1f1f1f;
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    padding: var(--spacing-sm) var(--spacing-md);
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    max-height: 120px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    margin-bottom: var(--spacing-xs);
    transition: opacity 0.3s ease;
}
.sync-bottom-bar .sync-bottom-warning {
    font-size: 11px;
    color: var(--text-warning, #f5a623);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sync-bottom-bar .sync-bottom-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 13px;
    color: var(--text-primary);
}
.sync-bottom-bar .sync-bottom-header .sync-bottom-status {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sync-bottom-bar .sync-bottom-header .sync-bottom-eta {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.sync-bottom-bar .sync-bottom-header .sync-bottom-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}
.sync-bottom-bar .sync-bottom-close svg {
    width: 14px;
    height: 14px;
}
.sync-bottom-bar .sync-bottom-file-status {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.sync-bottom-bar .sync-bottom-progress {
    width: 100%;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.sync-bottom-bar .sync-bottom-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ==========================================
   TIPS CAROUSEL
   ========================================== */

.tips-carousel {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius-sm) + var(--spacing-sm));
    background: #0f0f0f;
    border: 2px solid #1f1f1f;
    max-width: 500px;
    margin: 0 auto;
    margin-bottom: var(--spacing-xs);
}

.tips-carousel--no-shadow {
    box-shadow: none;
}

.tips-carousel-close {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    z-index: 10;
}

.tips-track {
    display: flex;
}

.tips-slide {
    min-width: 100%;
    padding: var(--spacing-md);
    padding-right: var(--spacing-xl);
}

.tips-slide-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.tips-slide-icon {
    display: flex;
    color: var(--accent);
}

.tips-slide-icon svg {
    width: 20px;
    height: 20px;
}

.tips-slide h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.tips-slide p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Tips Dots */
.tips-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: var(--spacing-sm);
    padding-top: 0;
}

.tips-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    transition: all var(--transition-base);
    cursor: pointer;
}

@media (hover: hover) {
    .tips-dot:hover {
        background: var(--text-muted);
    }
}

.tips-dot.active {
    background: var(--accent);
    width: 18px;
    border-radius: 3px;
}

/* ==========================================
   PLAYLISTS
   ========================================== */

/* Playlists management modal */
.playlists-modal-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.playlists-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.playlist-manage-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    background: var(--color-tertiary);
    transition: background var(--transition-base);
}

@media (hover: hover) {
    .playlist-manage-item:hover {
        background: var(--bg-hover);
    }
}

.playlist-manage-item.is-default {
    opacity: 0.8;
}

.playlist-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 16px;
    display: flex;
    align-items: center;
    padding: 2px;
    flex-shrink: 0;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.playlist-drag-handle:active {
    cursor: grabbing;
}

.playlist-drag-handle svg {
    width: 16px;
    height: 16px;
}

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

.playlist-manage-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-manage-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.playlist-manage-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.playlist-manage-lock {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    padding: 4px 14px;
}

.playlist-manage-lock svg {
    width: 16px;
    height: 16px;
}

/* Playlist edit/create modal */
.playlist-edit-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.playlist-edit-tracks {
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.playlist-edit-checked {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-edit-unchecked {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-edit-divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-sm) 0;
}

.playlist-edit-track-row.select-all-row {
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-sm);
}

.playlist-edit-track-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background var(--transition-base);
    flex-shrink: 0;
    min-height: 44px;
    box-sizing: border-box;
}

@media (hover: hover) {
    .playlist-edit-track-row:hover {
        background: var(--bg-hover);
    }
}

.playlist-edit-track-row.checked {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.playlist-track-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 14px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.playlist-track-drag-handle:active {
    cursor: grabbing;
}

.playlist-track-drag-handle svg {
    width: 14px;
    height: 14px;
}

.playlist-track-drag-spacer {
    width: 20px;
    flex-shrink: 0;
}

.playlist-track-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.playlist-edit-track-cover {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--color-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-edit-track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-edit-track-cover svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

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

.playlist-edit-track-title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-edit-track-artist {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Player playlist dropdown */
.player-playlist-dropdown {
    flex-shrink: 0;
    min-width: 0;
    overflow: visible;
}

/* Player replacements menu trigger */
.player-replacements-btn {
    flex-shrink: 0;
    margin-left: 4px;
}

/* Replacements popup menu */
.replacements-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rep-option {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (hover: hover) {
    .rep-option:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }
}

.rep-option-active {
    background: color-mix(in srgb, var(--player-accent, var(--accent)) 20%, transparent);
    color: var(--player-accent, var(--accent));
    font-weight: 600;
}

@media (hover: hover) {
    .rep-option-active:hover {
        background: color-mix(in srgb, var(--player-accent, var(--accent)) 30%, transparent);
    }
}

.player-playlist-dropdown .select-wrapper {
    position: relative;
    display: inline-flex;
}

.player-playlist-dropdown .select {
    width: auto;
    min-width: 80px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Accent-styled select for active non-default playlist */
.player-playlist-dropdown .select.player-playlist-accent {
    background: color-mix(in srgb, var(--player-accent, var(--accent)) 25%, transparent);
    color: var(--player-accent, var(--accent));
    border-color: transparent;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 32px 6px 12px;
    height: 44px;
    border-radius: var(--radius-lg);
}

@media (hover: hover) {
    .player-playlist-dropdown .select.player-playlist-accent:hover {
        background: color-mix(in srgb, var(--player-accent, var(--accent)) 35%, transparent);
        border-color: transparent;
    }
}

.player-playlist-dropdown .select.player-playlist-accent + .select-chevron {
    color: var(--player-accent, var(--accent));
}

/* Playlist label in set item counters (home page shortcuts) */
.set-item-playlist-label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: none;
}

/* Playlist shortcut set item style */
.set-item-playlist-shortcut {
}

.set-item-playlist-shortcut .set-item-cover {
    position: relative;
}

.set-item-playlist-shortcut .set-item-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border-radius: inherit;
    pointer-events: none;
}

/* Responsive: collapse +Set button to icon-only on narrow screens */
@media (max-width: 380px) {
    .header-right .btn-primary .btn-text {
        display: none;
    }
    .header-right .btn-primary {
        padding: 0;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
}
