/* Lemon Music — Dark Premium Music Dashboard */

@import url('/assets/css/theme.css');

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

/* Global: no rounded corners — square boxes everywhere */
button, input, select, textarea, .btn, .btn-sm, .btn-outline,
.card, .lm-dialog, .lm-dialog-btn, .lm-dialog-btn-cancel,
.lm-dialog-btn-confirm, .lm-dialog-btn-danger,
.lm-dialog-icon, .lm-dialog::before,
.block-reason-btn, .report-select, .report-energy-slider,
.rematch-picker, .rematch-picker-input, .rematch-result,
.rematch-result img, .lm-toast,
.np-badge, .queue-art, .np-hero-art,
.track-under-review, .history-item-status {
    border-radius: 0 !important;
}

/* Disable zoom on mobile (iOS/Android) — this is a PWA, not a website */
html { touch-action: manipulation; }

/* Disable text selection on mobile (iOS/Android) — prevent copy of song lists */
@media (hover: none) and (pointer: coarse) {
    body {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    /* Re-enable for input fields */
    input, textarea, select, [contenteditable] {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}

html {
    overflow-y: scroll; /* Always show scrollbar to prevent layout judder */
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: 600px;
    margin: 0 auto;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    animation: pageFadeIn 0.35s ease;
}

a { color: var(--accent-secondary); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

h1, h2, h3 { color: var(--accent-primary); font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.6rem; margin-bottom: 16px; }
h2 { font-size: 1.15rem; margin-bottom: 14px; }
h3 { font-size: 1rem; margin-bottom: 10px; }

p.subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }

/* ═══════ NAVIGATION ═══════ */
.nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0 10px 12px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: visible;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 0;
    transition: all var(--transition);
    flex-shrink: 0;
    border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text-primary); background: var(--bg-elevated); opacity: 1; }
.nav a.active { color: var(--accent-secondary); border-bottom-color: var(--accent-secondary); }
.nav .brand {
    font-weight: 700;
    font-size: 1rem;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 4px 0;
    flex-shrink: 0;
}
.nav .brand:hover { opacity: 1; }
.nav-logo {
    height: 45px;
    width: auto;
    border-radius: 0;
    transition: filter var(--transition);
}
.nav .brand:hover .nav-logo {
    filter: drop-shadow(0 0 6px rgba(122,56,249,0.6)) drop-shadow(0 0 12px rgba(122,56,249,0.3));
}
.nav .brand:hover {
    background: transparent !important;
}

/* Hamburger toggle — always visible */
.nav-toggle {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 0;
    margin-top: 0;
    height: auto;
    min-height: auto;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle:hover { background: none; transform: none; box-shadow: none; }
.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 0;
    transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle-open .nav-toggle-bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle-open .nav-toggle-bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Nav links — dropdown menu (burger on all screen sizes) */
.nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    z-index: 100;
}
.nav-links.nav-open { display: flex; }
.nav-links a {
    padding: 14px 24px;
    font-size: 0.9rem;
    border-radius: 0;
    border-bottom: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}
.nav-links a:hover {
    background: linear-gradient(90deg, rgba(122,56,249,0.12), transparent) !important;
    border-left-color: var(--accent-primary);
    color: var(--text-primary);
    padding-left: 28px;
}
.nav-links a.active {
    border-left-color: var(--accent-secondary);
    background: linear-gradient(90deg, rgba(0,200,255,0.08), transparent);
    color: var(--accent-secondary);
    border-bottom-color: transparent;
}

/* Mobile-only elements — hidden on desktop */
.np-mobile-only { display: none; }

/* ═══════ CARDS ═══════ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: 0;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}

/* ═══════ FORMS ═══════ */
label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="search"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-border);
    border-radius: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
    min-height: var(--btn-h);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238899AA' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Date/time inputs — dark theme support */
input[type="date"],
input[type="time"] {
    color-scheme: dark;
    -webkit-appearance: none;
    appearance: none;
    min-width: 140px;
}
/* Show placeholder text when empty on iOS */
input[type="date"]:not(:valid):not(:focus) {
    color: var(--text-muted);
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
    opacity: 1;
}
/* iOS date input fix — ensure proper sizing */
@supports (-webkit-touch-callout: none) {
    input[type="date"],
    input[type="time"] {
        min-height: var(--btn-h);
        line-height: 1.2;
    }
}

/* ═══════ CUSTOM SCROLLBAR ═══════ */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-light));
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-light), #B06CFF);
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-base);
}

/* Modal-specific scrollbar */
.modal-box::-webkit-scrollbar {
    width: 6px;
}
.modal-box::-webkit-scrollbar-track {
    background: var(--bg-surface);
}
.modal-box::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
}
.modal-box::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-secondary), #00E5FF);
    box-shadow: 0 0 6px var(--accent-cyan-glow);
}
.modal-box {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-surface);
}

/* ═══════ BUTTONS — ghost style, consistent height ═══════ */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    height: var(--btn-h);
    min-height: var(--btn-h);
    background: rgba(122,56,249,0.14);
    color: var(--accent-primary);
    border: 1px solid rgba(122,56,249,0.35);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 14px;
    text-decoration: none;
    line-height: 1;
    letter-spacing: 0.01em;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    transition: all var(--transition);
    white-space: nowrap;
}
button:hover, .btn:hover {
    background: rgba(122,56,249,0.26);
    border-color: rgba(122,56,249,0.6);
    box-shadow: 0 0 14px rgba(122,56,249,0.28);
    transform: translateY(-1px);
}
button:active, .btn:active { transform: scale(0.97); }

.btn-sm, button.btn-sm {
    padding: 0 14px;
    height: var(--btn-h-sm);
    min-height: var(--btn-h-sm);
    font-size: 0.82rem;
    margin-top: 0;
    border-radius: 8px;
}

.btn-danger, button.btn-danger {
    background: rgba(239,68,68,0.14);
    color: #EF4444;
    border-color: rgba(239,68,68,0.35);
}
.btn-danger:hover, button.btn-danger:hover {
    background: rgba(239,68,68,0.26);
    border-color: rgba(239,68,68,0.6);
    box-shadow: 0 0 14px rgba(239,68,68,0.25);
}

.btn-outline, button.btn-outline {
    background: rgba(0,200,255,0.10);
    border: 1px solid rgba(0,200,255,0.35);
    color: var(--accent-secondary);
}
.btn-outline:hover, button.btn-outline:hover {
    background: rgba(0,200,255,0.22);
    border-color: rgba(0,200,255,0.6);
    color: var(--accent-secondary);
    box-shadow: 0 0 14px rgba(0,200,255,0.22);
    transform: translateY(-1px);
}

/* ═══════ BUTTON GROUP ═══════ */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-group .btn-sm,
.btn-group button { margin-top: 0; }

/* ═══════ MESSAGES ═══════ */
.error {
    color: var(--danger);
    background: var(--danger-dim);
    padding: 10px 14px;
    border-radius: 0;
    margin-bottom: 14px;
    font-size: 0.9rem;
}
.success {
    color: var(--success);
    background: var(--success-dim);
    padding: 10px 14px;
    border-radius: 0;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

/* ═══════ BADGE ═══════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.badge-active { background: var(--accent-glow); color: var(--accent-primary); }
.badge-inactive { background: var(--danger-dim); color: var(--danger); }

/* ═══════ TABLES ═══════ */
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg-border);
    font-size: 0.88rem;
}
th { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ═══════ LOGIN ═══════ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
}
.login-box {
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: 0;
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.login-box h1 { margin-bottom: 28px; font-size: 1.4rem; }
.login-box label { text-align: left; }
.login-box button { width: 100%; margin-top: 20px; height: 48px; font-size: 1rem; border-radius: 0; }
.login-logo {
    width: 100px;
    height: 100px;
    border-radius: 0;
    margin-bottom: 20px;
    mix-blend-mode: screen;
}

/* ═══════ SLOT ITEMS (vibes list) ═══════ */
.slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: 0;
    margin-bottom: 10px;
    gap: 12px;
    box-shadow: var(--shadow);
}
.slot-item .slot-name { font-weight: 700; font-size: 0.95rem; }
.slot-item .slot-time { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.slot-item > div:first-child { flex: 1; min-width: 0; }
.slot-item .slot-actions { display: flex; gap: 6px; flex-shrink: 0; }
.slot-inactive { opacity: 0.4; }

/* ═══════ SEED / SEARCH ═══════ */
.seed-list { list-style: none; margin: 12px 0; }
.seed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border-radius: 0;
    margin-bottom: 6px;
}
.seed-item .seed-info { font-size: 0.9rem; }
.seed-item .seed-artist { color: var(--text-muted); }

.search-results {
    list-style: none;
    margin: 8px 0;
    max-height: 400px;
    overflow-y: auto;
}
.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-border);
    gap: 12px;
}

/* ═══════ FORM ROW ═══════ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ═══════ SETTINGS GRID ═══════ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ═══════ NOW PLAYING ═══════ */
.now-playing-heading {
    color: var(--accent-secondary);
}
#now-playing-card {
    border-left: 3px solid var(--accent-secondary);
}
#now-playing-card h2 {
    color: var(--accent-secondary);
}

.now-playing-content {
    display: flex;
    align-items: center;
    gap: 16px;
}
.album-art {
    width: 72px;
    height: 72px;
    border-radius: 0;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.now-playing-info { flex: 1; min-width: 0; }
.now-playing-track { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-playing-artist { color: var(--text-muted); font-size: 0.9rem; }
.now-playing-album { color: var(--text-muted); font-size: 0.8rem; }
.now-playing-playlist { color: var(--accent-secondary); font-size: 0.8rem; margin-top: 4px; }

.progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 0;
    margin-top: 10px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent-secondary);
    border-radius: 0;
    transition: width 1s linear;
}

/* ═══════ SCHEDULE ═══════ */
.schedule-timeline { display: flex; flex-direction: column; gap: 8px; }
.schedule-slot {
    padding: 14px 16px;
    background: var(--bg-elevated);
    border-radius: 0;
    border-left: 3px solid var(--accent-secondary);
}
.schedule-slot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.schedule-slot-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.schedule-slot-time { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.schedule-slot-vibe { color: var(--accent-secondary); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-slot-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ═══════ STATUS GRID (dashboard) ═══════ */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.status-grid .status-value { color: var(--text-primary); }

/* Stat/metric numbers */
.stat-number {
    font-family: var(--font-mono);
}

/* Status indicators — cyan */
.status-connected {
    color: var(--accent-secondary);
}
.status-playing {
    color: var(--accent-secondary);
}

/* ═══════ HISTORY LIST ═══════ */
.history-list { display: flex; flex-direction: column; gap: 0; }
.history-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.history-item:last-child { border-bottom: none; }
.history-item-info { min-width: 0; flex: 1; }
.history-item-track { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-meta { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.history-item-status { flex-shrink: 0; font-size: 0.78rem; font-weight: 600; padding: 3px 8px; border-radius: 0; }
.history-item-status.played { color: var(--success); background: var(--success-dim); }
.history-item-status.skipped { color: var(--danger); background: var(--danger-dim); }
.history-item-status.blocked { color: var(--danger); background: var(--danger-dim); }

/* ═══════ ENERGY SLIDER ═══════ */
.energy-slider-wrap {
    padding: 4px 0 0;
    position: relative;
    overflow: hidden;
}
.energy-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right,
        #22d3ee,
        #38bdf8 12%,
        #818cf8 30%,
        #a855f7 50%,
        #ec4899 70%,
        #f43f5e 88%,
        #ef4444
    );
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
    margin: 0;
}
/* No pseudo-element glow — clean gradient bar */
.energy-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 40% 40%, #c084fc, #7c3aed 60%, #5b21b6);
    border: 2px solid rgba(192,132,252,0.6);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(124,58,237,0.5),
        0 0 20px rgba(124,58,237,0.2),
        inset 0 1px 2px rgba(255,255,255,0.3);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 4;
}
.energy-slider::-webkit-slider-thumb:hover {
    box-shadow:
        0 0 14px rgba(124,58,237,0.7),
        0 0 28px rgba(124,58,237,0.3),
        inset 0 1px 2px rgba(255,255,255,0.3);
    transform: scale(1.1);
}
.energy-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    cursor: grabbing;
    box-shadow:
        0 0 18px rgba(124,58,237,0.8),
        0 0 36px rgba(124,58,237,0.4),
        0 0 4px rgba(0,200,255,0.5),
        inset 0 1px 2px rgba(255,255,255,0.4);
}
.energy-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 40% 40%, #c084fc, #7c3aed 60%, #5b21b6);
    border: 2px solid rgba(192,132,252,0.6);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(124,58,237,0.5),
        0 0 20px rgba(124,58,237,0.2);
    cursor: grab;
}
.energy-slider::-moz-range-track {
    height: 6px;
    background: linear-gradient(to right,
        #22d3ee,
        #38bdf8 12%,
        #818cf8 30%,
        #a855f7 50%,
        #ec4899 70%,
        #f43f5e 88%,
        #ef4444
    );
    border-radius: 3px;
    border: none;
}
.energy-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 0 2px;
}
.energy-labels span:first-child { color: #22d3ee; }
.energy-labels span:nth-child(2) { color: rgba(168,85,247,0.7); }
.energy-labels span:last-child { color: #f43f5e; }
.energy-current {
    text-align: center;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    font-family: var(--font-mono);
}

/* ═══════ GENRE GRID ═══════ */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.genre-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: 0;
    cursor: pointer;
    margin-top: 0;
    font-size: 0.88rem;
    font-weight: 500;
    text-transform: none;
    color: var(--text-primary);
    transition: background var(--transition);
}
.genre-check:hover { background: var(--bg-border); }
.genre-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: var(--accent-primary);
    margin: 0;
    flex-shrink: 0;
}
.genre-check-label { flex: 1; }
.genre-check-count { color: var(--text-muted); font-size: 0.78rem; }

/* Genre tags on schedule slots — purple active */
.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.genre-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-glow);
    color: var(--accent-light);
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Genre summary cards on tracks page */
.genre-summary-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: 0;
    text-decoration: none;
    transition: all var(--transition);
}
.genre-summary-tag:hover { background: var(--bg-border); opacity: 1; }
.genre-summary-active { border: 1.5px solid var(--accent-primary); background: var(--accent-glow); }
.genre-summary-name { font-weight: 600; font-size: 0.88rem; color: var(--text-primary); }
.genre-summary-count { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }

/* Schedule slot energy badge — purple */
.schedule-slot-energy {
    display: inline-block;
    background: var(--accent-glow);
    color: var(--accent-light);
    padding: 2px 8px;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 6px;
    font-family: var(--font-mono);
}

/* ═══════ TRACK LIST ═══════ */
.track-list { display: flex; flex-direction: column; }
.track-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.track-item:last-child { border-bottom: none; }
.track-item-info { min-width: 0; flex: 1; }
.track-item-title { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-item-meta { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.track-item-details { font-size: 0.78rem; }
.track-item-actions { flex-shrink: 0; }
.track-item-actions form { margin: 0; }
.track-blocked { opacity: 0.4; }
.restore-review-btn {
    background: var(--accent-secondary); color: #000; font-size: 0.72rem; font-weight: 600;
    border: none; border-radius: 6px; padding: 6px 12px; white-space: nowrap; cursor: pointer;
    margin: 0; flex-shrink: 0;
}
.track-under-review {
    display: inline-flex; align-items: center; gap: 4px;
    color: #F59E0B; font-size: 0.72rem; font-weight: 600;
    background: rgba(245,158,11,0.12); border-radius: 6px;
    padding: 4px 10px; white-space: nowrap;
}

/* BPM and metadata tags — cyan */
.track-meta-tag {
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ═══════ SPOTIFY MATCHING ═══════ */
.match-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 12px;
}
.match-progress-fill {
    height: 100%;
    background: var(--accent-secondary);
    border-radius: 0;
    transition: width 0.5s ease;
}
.match-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.match-stats strong { color: var(--text-primary); font-family: var(--font-mono); }
.genre-match-list { display: flex; flex-direction: column; gap: 10px; }
.genre-match-item {}
.genre-match-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.85rem;
}
.genre-match-name { font-weight: 600; }
.genre-match-count { color: var(--text-muted); font-family: var(--font-mono); }

/* ═══════ CODE ═══════ */
code {
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 0;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    word-break: break-all;
    font-family: var(--font-mono);
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 600px) {
    body { padding: 12px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

    .card { padding: 16px; }

    /* Nav — mobile adjustments */
    .nav { gap: 2px; }
    .nav .brand { font-size: 0.92rem; }
    .nav .brand span { display: none; }
    .nav-links { left: -12px; right: -12px; min-width: auto; }
    .nav-desktop-only { display: none !important; }
    .np-mobile-only { display: inline-flex; }

    /* Forms */
    .form-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .settings-grid { grid-template-columns: 1fr; }

    /* Slot items stack */
    .slot-item { flex-direction: column; align-items: stretch; }
    .slot-item .slot-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
    .slot-item .slot-actions .btn-sm,
    .slot-item .slot-actions .btn { width: 100%; }

    /* Now Playing */
    .now-playing-content { gap: 14px; }
    .album-art { width: 64px; height: 64px; }

    /* Schedule slots */
    .schedule-slot-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .schedule-slot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
    .schedule-slot-actions form { display: contents; }
    .schedule-slot-actions .btn-sm { width: 100%; }

    /* Search results */
    .search-result-item { flex-direction: column; align-items: stretch; gap: 8px; }
    .search-result-item > div:last-child { display: flex; gap: 6px; }
    .search-result-item > div:last-child .btn-sm { flex: 1; }

    /* Genre grid — single column on mobile */
    .genre-grid { grid-template-columns: 1fr; }

    /* Track filters mobile — stack vertically */
    .track-filters-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .track-filters-row select,
    .track-filters-row input {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Track items — keep horizontal on mobile with compact layout */
    .track-item { gap: 10px; padding: 10px 0; }
    .track-item-title { font-size: 0.85rem; }
    .track-item-meta { font-size: 0.75rem; }
    .track-item-details { display: block; margin-top: 2px; font-size: 0.72rem; }
    .track-item-actions { flex-shrink: 0; }
    .track-item-actions .btn-sm,
    .track-item-actions .btn.btn-sm { display: none; } /* Hide preview on mobile to save space */
    .track-item-actions .np-ctrl-btn { display: flex; }

    /* Now Playing Hero mobile */
    .np-hero-layout { flex-direction: column; align-items: center; text-align: center; }
    .np-hero-art { width: 160px; height: 160px; margin: 0 auto; }
    .np-hero-info { width: 100%; }
    .np-hero-meta { justify-content: center; }
    .np-energy-status { justify-content: center; }
    .now-playing-controls { gap: 12px; }
    .np-ctrl-btn { width: 48px; height: 48px; }

    /* Queue mobile */
    .queue-item { gap: 8px; }
    .queue-meta { flex-direction: row; gap: 3px; flex-wrap: nowrap; }
    .queue-meta .np-badge { padding: 2px 5px; font-size: 0.6rem; }
    .queue-genre-badge { display: none; }

    /* Schedule grid mobile */
    .schedule-grid { grid-template-columns: 1fr; gap: 12px; }
    .schedule-grid-col { min-height: auto; }
}

/* ═══════ NOW PLAYING HERO ═══════ */
@keyframes heroReveal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.now-playing-hero {
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-lg);
    animation: heroReveal 0.5s ease both;
}

/* Now Playing genre banner — same style as queue banner */
.np-genre-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--accent-glow);
    border-bottom: 1px solid var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-light);
    margin: -20px -20px 16px -20px;
    font-family: var(--font-mono);
}
.np-genre-banner-energy {
    color: var(--accent-secondary);
    font-weight: 700;
}

.np-hero-layout {
    display: flex;
    gap: 20px;
    align-items: center;
}

.np-hero-art {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    object-fit: cover;
}
.np-hero-art-empty {
    background: var(--bg-elevated);
}

/* Skeleton loading state for skip */
.np-skeleton-pulse {
    animation: skeletonPulse 1.2s ease-in-out infinite;
}
.np-skeleton-bar {
    background: var(--bg-elevated);
    border-radius: 4px;
    animation: skeletonPulse 1.2s ease-in-out infinite;
}
@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

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

.np-hero-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-hero-artist {
    font-size: 1rem;
    color: var(--accent-secondary);
    margin-bottom: 2px;
}

.np-hero-album {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.np-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.np-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
}
.np-badge-bpm {
    background: var(--accent-cyan-dim);
    color: var(--accent-secondary);
}
.np-badge-energy {
    background: color-mix(in srgb, var(--energy-color, #7A38F9) 20%, transparent);
    color: var(--energy-color, #7A38F9);
}
.np-badge-genre {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.np-energy-status {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    gap: 4px;
}
.np-energy-status strong {
    color: var(--accent-secondary);
    font-family: var(--font-mono);
}

/* Progress bar */
.np-progress-wrap {
    margin-top: 12px;
}
.np-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.np-progress-fill {
    height: 100%;
    background: var(--accent-secondary);
    transition: width 1s linear;
}
.np-progress-times {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Controls */
.now-playing-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bg-border);
}
.np-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all var(--transition);
}
.np-ctrl-btn:hover {
    background: var(--accent-cyan-dim);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 12px var(--accent-cyan-glow);
    transform: translateY(-1px);
}
.np-ctrl-danger:hover {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 12px rgba(239,68,68,0.3);
}
.np-ctrl-heart:hover {
    color: #EF4444;
    border-color: #EF4444;
    background: rgba(239,68,68,0.1);
    box-shadow: 0 0 12px rgba(239,68,68,0.3);
}
.np-heart-active {
    color: #EF4444 !important;
    border-color: #EF4444 !important;
    background: rgba(239,68,68,0.15) !important;
}

/* History page tabs */
.history-tabs { gap: 8px !important; }
.history-tab {
    padding: 10px 22px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    text-decoration: none;
    transition: all 0.15s ease;
}
.history-tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.history-tab-active {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    background: var(--bg-elevated);
}
.fav-remove-btn {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    color: var(--text-muted);
    border-color: var(--bg-border);
}
.fav-remove-btn:hover {
    color: #EF4444;
    border-color: #EF4444;
    background: rgba(239,68,68,0.1);
}

/* Nav status dot — top right in navbar */
.nav-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 12px;
}
.nav-dot-green {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse-dot 2s infinite;
}
.nav-dot-red {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Energy in hero */
.now-playing-energy {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--bg-border);
}
.energy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.energy-label-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.energy-current-val {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, #22d3ee, #a855f7, #f43f5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    text-shadow: none;
}
.energy-slider-active .energy-slider {
    filter: brightness(1.2);
}
.energy-slider-active::-webkit-slider-thumb {
    box-shadow:
        0 0 16px rgba(124,58,237,0.8),
        0 0 32px rgba(124,58,237,0.4),
        0 0 6px rgba(0,200,255,0.4),
        inset 0 1px 2px rgba(255,255,255,0.4) !important;
    transform: scale(1.15);
}

.now-playing-hero-empty {
    padding: 40px 20px;
    text-align: center;
}

/* ═══════ QUEUE ═══════ */
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.queue-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-border);
}
.queue-item:last-child { border-bottom: none; }
.queue-pos {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
    font-family: var(--font-mono);
}
.queue-art {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 4px;
}
.queue-art-empty {
    background: var(--bg-elevated);
    border-radius: 4px;
}
.queue-info {
    flex: 1;
    min-width: 0;
}
.queue-title {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.queue-meta {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.queue-time {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    width: 36px;
    text-align: center;
    font-family: var(--font-mono);
    flex-shrink: 0;
}
.queue-genre-badge {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
    opacity: 0.85;
}

/* Current genre banner — matches transition divider style */
.queue-genre-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}
.queue-genre-banner::before,
.queue-genre-banner::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
}
.queue-genre-banner span {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-primary);
    white-space: nowrap;
}
.queue-genre-banner-energy {
    color: var(--text-muted) !important;
    font-weight: 600;
}

/* Genre transition divider */
.queue-transition {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}
.queue-transition-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
}
.queue-transition-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.queue-transition-time {
    color: var(--accent-secondary);
    font-family: var(--font-mono);
}
.queue-transition-arrow {
    color: var(--accent-primary);
    font-size: 0.6rem;
}
.queue-transition-genre {
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.queue-transition-energy {
    color: var(--text-muted);
    font-weight: 600;
}

/* ═══════ SCHEDULE GRID ═══════ */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.schedule-grid-col {
    min-height: 200px;
}
.schedule-grid-day {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-border);
    margin-bottom: 8px;
    text-align: center;
}
.schedule-grid-slot {
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent-primary);
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.78rem;
}
.schedule-grid-slot:hover {
    background: var(--bg-border);
    box-shadow: 0 0 8px var(--accent-glow);
}
.schedule-grid-slot-time {
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}
.schedule-grid-slot-energy {
    display: inline-block;
    background: var(--accent-glow);
    color: var(--accent-light);
    padding: 1px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
    font-family: var(--font-mono);
}
.schedule-grid-slot-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}
.schedule-grid-slot-genre {
    font-size: 0.65rem;
    color: var(--accent-secondary);
    background: var(--accent-cyan-dim);
    padding: 1px 5px;
}
.schedule-grid-slot-inactive {
    opacity: 0.4;
}
.schedule-grid-gap {
    background: rgba(239,68,68,0.08);
    border-left: 3px solid var(--danger);
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.72rem;
    color: var(--danger);
    font-weight: 600;
}
.schedule-grid-empty {
    padding: 12px 8px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ═══════ MODAL ═══════ */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.modal-open {
    display: flex;
    animation: modalFadeIn 0.25s ease;
}
.modal-overlay.modal-closing {
    animation: modalFadeOut 0.2s ease forwards;
}
.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-top: 3px solid var(--accent-secondary);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 1px rgba(0,200,255,0.2);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h2 { margin: 0; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    height: auto;
    min-height: auto;
    line-height: 1;
    transition: color 0.15s ease;
}
.modal-close:hover { color: var(--text-primary); box-shadow: none; transform: none; }

/* ═══════ CUSTOM ALERT/CONFIRM DIALOG ═══════ */
/* ── Modal Dialog System ── */
.lm-dialog-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lm-dialog-overlay.lm-dialog-open {
    display: flex;
    animation: modalFadeIn 0.2s ease;
}
.lm-dialog-overlay.lm-dialog-closing {
    animation: modalFadeOut 0.15s ease forwards;
}
.lm-dialog {
    background: linear-gradient(165deg, #151d2a 0%, #0f1620 100%);
    border: 1px solid rgba(122,56,249,0.25);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 40px rgba(122,56,249,0.08), inset 0 1px 0 rgba(255,255,255,0.04);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.lm-dialog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px 16px 0 0;
}
.lm-dialog-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}
.lm-dialog-icon-error {
    background: var(--danger-dim);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(239,68,68,0.15);
}
.lm-dialog-icon-warn, .lm-dialog-icon-warning {
    background: rgba(245,158,11,0.12);
    color: #F59E0B;
    box-shadow: 0 0 20px rgba(245,158,11,0.1);
}
.lm-dialog-icon-info {
    background: var(--accent-cyan-dim);
    color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0,200,255,0.1);
}
.lm-dialog-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.lm-dialog-message {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}
.lm-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 8px;
}
.lm-dialog-btn {
    padding: 0 24px;
    height: var(--btn-h);
    min-height: var(--btn-h);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--bg-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 90px;
}
.lm-dialog-btn-cancel {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border-radius: 8px;
}
.lm-dialog-btn-cancel:hover {
    background: var(--bg-border);
    color: var(--text-primary);
}
.lm-dialog-btn-confirm {
    background: var(--accent-secondary);
    color: var(--bg-base);
    border-color: var(--accent-secondary);
    border-radius: 8px;
}
.lm-dialog-btn-confirm:hover {
    background: #33d4ff;
    box-shadow: 0 0 16px var(--accent-cyan-glow);
}
.lm-dialog-btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    border-radius: 8px;
}
.lm-dialog-btn-danger:hover {
    background: #f55;
    box-shadow: 0 0 16px rgba(239,68,68,0.4);
}

/* ── Report Track — Reason Pills ── */
.block-reason-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 12px; min-height: 38px; margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--bg-border);
    border-radius: 0;
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    height: auto;
}
.block-reason-btn:hover {
    border-color: rgba(122,56,249,0.4);
    color: var(--text-primary);
    background: rgba(122,56,249,0.08);
}
.block-reason-btn.block-reason-active {
    background: rgba(122,56,249,0.15);
    border-color: var(--accent-primary);
    color: var(--accent-light);
    box-shadow: 0 0 12px rgba(122,56,249,0.15);
}
.block-reason-btn[data-reason="Wrong match"].block-reason-active {
    background: rgba(245,158,11,0.12);
    border-color: #F59E0B;
    color: #F59E0B;
    box-shadow: 0 0 12px rgba(245,158,11,0.15);
}

/* ── Report Fields — No-jutter panel swap ── */
.report-fields-container {
    position: relative;
    height: 130px;
}
.report-panel {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 0; left: 0; right: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}
.report-panel.report-panel-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* ── Report Track — Form Controls ── */
.report-section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: left;
    opacity: 0.7;
}
.report-section-label span { opacity: 0.5; text-transform: none; letter-spacing: 0; }
.report-select, .report-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--bg-border);
    border-radius: 10px;
    font-size: 0.88rem;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.report-select:focus, .report-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(122,56,249,0.12);
}
.report-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%238899AA'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.report-energy-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.report-energy-slider:hover { opacity: 1; }
.report-energy-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 2px var(--accent-primary);
    cursor: pointer;
}
.report-energy-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 2px var(--accent-primary);
    cursor: pointer;
    border: none;
}
.report-energy-val {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    color: var(--accent-secondary);
}
/* ── Wrong Match — Open Button ── */
.rematch-open-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-base);
    color: var(--text-muted);
    border: 1px dashed var(--bg-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
    transition: all 0.2s;
}
.rematch-open-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(122,56,249,0.06);
}

/* ── Wrong Match — Selection Preview ── */
#rematch-selection {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-base);
    border: 2px solid var(--accent-secondary);
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(0,200,255,0.1);
}

/* ── Rematch Picker Modal ── */
.rematch-picker-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.rematch-picker-overlay.rematch-picker-open {
    display: flex;
    animation: modalFadeIn 0.2s ease;
}
.rematch-picker {
    background: linear-gradient(165deg, #151d2a 0%, #0f1620 100%);
    border: 1px solid rgba(122,56,249,0.25);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    height: 480px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 40px rgba(122,56,249,0.08), inset 0 1px 0 rgba(255,255,255,0.04);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}
.rematch-picker::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px 16px 0 0;
}
.rematch-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
}
.rematch-picker-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.rematch-picker-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.rematch-picker-close:hover { color: var(--text-primary); }
.rematch-picker-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 0 0 16px;
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--bg-border);
    border-radius: 10px;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
}
.rematch-picker-input:focus {
    border-color: var(--accent-primary);
}
.rematch-picker-body {
    padding: 0 28px 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}
.rematch-picker-results {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 80px;
    max-height: 50vh;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-border) transparent;
}
.rematch-picker-results::-webkit-scrollbar { width: 6px; }
.rematch-picker-results::-webkit-scrollbar-track { background: transparent; }
.rematch-picker-results::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 3px; }
.rematch-picker-results::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Rematch Results ── */
.rematch-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    margin-bottom: 4px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s;
}
.rematch-result:hover { background: rgba(255,255,255,0.04); }
.rematch-result:active { background: rgba(255,255,255,0.08); }
.rematch-result img { width: 44px; height: 44px; border-radius: 6px; flex-shrink: 0; }
.rematch-result-info { flex: 1; min-width: 0; }
.rematch-result-title { font-size: 0.85rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rematch-result-meta { font-size: 0.75rem; color: var(--text-muted); }

/* Toast notifications */
.lm-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-left: 3px solid var(--accent-secondary);
    padding: 12px 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 340px;
    pointer-events: none;
}
.lm-toast.lm-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.lm-toast-error { border-left-color: var(--danger); }

/* ═══════ TRACKS SEARCH ═══════ */
.search-hero {
    position: relative;
    margin-bottom: 14px;
}
.search-hero input {
    font-size: 1.1rem;
    padding: 14px 20px;
    padding-left: 44px;
    background: var(--bg-surface);
    border: 2px solid var(--bg-border);
}
.search-hero input:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}
.search-hero-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ═══════ HISTORY FILTERS ═══════ */
.history-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.history-filters input,
.history-filters select {
    width: auto;
    min-width: 140px;
    margin: 0;
}

/* ═══════ SETTINGS SECTIONS ═══════ */
.settings-section {
    border-left: 3px solid var(--accent-primary);
    padding-left: 16px;
    margin-bottom: 24px;
}
.settings-section h2 {
    color: var(--accent-secondary);
    margin-bottom: 8px;
}
.settings-section .subtitle {
    margin-bottom: 14px;
}

/* ═══════ USER LIST ═══════ */
.user-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-border);
    gap: 12px;
}
.user-list-item:last-child { border-bottom: none; }
.user-list-name { font-weight: 600; font-size: 0.92rem; }
.user-list-email { color: var(--text-muted); font-size: 0.82rem; }
.user-list-role {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
}

/* ═══════ CHECKBOX ROW ═══════ */
.day-check-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.day-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    background: var(--bg-elevated);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: all var(--transition);
    min-height: 56px;
}
.day-check:hover { background: var(--bg-border); }
.day-check input[type="checkbox"] {
    width: 16px; height: 16px; min-height: 16px;
    accent-color: var(--accent-primary);
    margin: 0;
}
